language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
C
wireshark/epan/dissectors/packet-rsvd.c
/* packet-rsvd.c * Routines for RSVD dissection * Copyright 2015, Richard Sharpe <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * RSVD, documented in [MS-RSVD].pdf, by Microsoft, the Remote Shared Virtual * Disk protocol. */ #include "config.h" #include <epan/conversation.h> #include <epan/packet.h> #if 0 #include "packet-smb-common.h" #endif #include "packet-windows-common.h" #include "packet-scsi.h" void proto_register_rsvd(void); static int proto_rsvd = -1; static int hf_svhdx_protocol_id = -1; static int hf_svhdx_protocol_version = -1; static int hf_svhdx_operation_code = -1; static int hf_svhdx_status = -1; static int hf_svhdx_request_id = -1; static int hf_svhdx_tunnel_scsi_length = -1; static int hf_svhdx_tunnel_scsi_reserved1 = -1; static int hf_svhdx_tunnel_scsi_cdb_length = -1; static int hf_svhdx_tunnel_scsi_sense_info_ex_length = -1; static int hf_svhdx_tunnel_scsi_data_in = -1; static int hf_svhdx_tunnel_scsi_reserved2 = -1; static int hf_svhdx_tunnel_scsi_srb_flags = -1; static int hf_svhdx_tunnel_scsi_data_transfer_length = -1; static int hf_svhdx_tunnel_scsi_reserved3 = -1; static int hf_svhdx_tunnel_scsi_cdb = -1; static int hf_svhdx_tunnel_scsi_cdb_padding = -1; static int hf_svhdx_tunnel_scsi_data = -1; static int hf_svhdx_tunnel_scsi_auto_generated_sense = -1; static int hf_svhdx_tunnel_scsi_srb_status = -1; static int hf_svhdx_tunnel_scsi_sense_data_ex = -1; static int hf_svhdx_tunnel_scsi_status = -1; static int hf_svhdx_tunnel_file_info_server_version = -1; static int hf_svhdx_tunnel_file_info_sector_size = -1; static int hf_svhdx_tunnel_file_info_physical_sector_size = -1; static int hf_svhdx_tunnel_file_info_reserved = -1; static int hf_svhdx_tunnel_file_info_virtual_size = -1; static int hf_svhdx_tunnel_disk_info_reserved1 = -1; static int hf_svhdx_tunnel_disk_info_blocksize = -1; static int hf_svhdx_tunnel_disk_info_linkage_id = -1; static int hf_svhdx_tunnel_disk_info_disk_type = -1; static int hf_svhdx_tunnel_disk_info_disk_format = -1; static int hf_svhdx_tunnel_disk_info_is_mounted = -1; static int hf_svhdx_tunnel_disk_info_is_4k_aligned = -1; static int hf_svhdx_tunnel_disk_info_reserved = -1; static int hf_svhdx_tunnel_disk_info_file_size = -1; static int hf_svhdx_tunnel_disk_info_virtual_disk_id = -1; static int hf_svhdx_tunnel_validate_disk_reserved = -1; static int hf_svhdx_tunnel_validate_disk_is_valid_disk = -1; static int hf_svhdx_tunnel_srb_status_status_key = -1; static int hf_svhdx_tunnel_srb_status_reserved = -1; static int hf_svhdx_tunnel_srb_status_sense_info_auto_generated = -1; static int hf_svhdx_tunnel_srb_status_srb_status = -1; static int hf_svhdx_tunnel_srb_status_scsi_status = -1; static int hf_svhdx_tunnel_srb_status_sense_info_ex_length = -1; static int hf_svhdx_tunnel_srb_status_sense_data_ex = -1; static int hf_svhdx_tunnel_safe_virtual_size = -1; static int hf_svhdx_tunnel_transaction_id = -1; static int hf_svhdx_tunnel_meta_operation_type = -1; static int hf_svhdx_tunnel_padding = -1; static int hf_svhdx_tunnel_resize_new_size = -1; static int hf_svhdx_tunnel_resize_expand_only_flag = -1; static int hf_svhdx_tunnel_resize_allow_unsafe_virt_size_flag = -1; static int hf_svhdx_tunnel_resize_shrink_to_minimum_safe_size_flag = -1; static int hf_svhdx_tunnel_meta_operation_start_reserved = -1; static int hf_svhdx_tunnel_snapshot_type = -1; static int hf_svhdx_tunnel_snapshot_id = -1; static int hf_svhdx_tunnel_create_snapshot_flags = -1; static int hf_svhdx_tunnel_create_snapshot_flag_enable_change_tracking = -1; static int hf_svhdx_tunnel_create_snapshot_stage1 = -1; static int hf_svhdx_tunnel_create_snapshot_stage2 = -1; static int hf_svhdx_tunnel_create_snapshot_stage3 = -1; static int hf_svhdx_tunnel_create_snapshot_stage4 = -1; static int hf_svhdx_tunnel_create_snapshot_stage5 = -1; static int hf_svhdx_tunnel_create_snapshot_stage6 = -1; static int hf_svhdx_tunnel_create_snapshot_parameters_payload_size = -1; static int hf_svhdx_tunnel_convert_dst_vhdset_name_len = -1; static int hf_svhdx_tunnel_convert_dst_vhdset_name = -1; static int hf_svhdx_tunnel_delete_snapshot_persist_reference = -1; static int hf_svhdx_tunnel_meta_op_query_progress_current_progress = -1; static int hf_svhdx_tunnel_meta_op_query_progress_complete_value = -1; static int hf_svhdx_tunnel_vhdset_information_type = -1; static int hf_svhdx_tunnel_vhdset_snapshot_creation_time = -1; static int hf_svhdx_tunnel_vhdset_is_valid_snapshot = -1; static int hf_svhdx_tunnel_vhdset_parent_snapshot_id = -1; static int hf_svhdx_tunnel_vhdset_log_file_id = -1; static gint ett_rsvd = -1; static gint ett_svhdx_tunnel_op_header = -1; static gint ett_svhdx_tunnel_scsi_request = -1; static gint ett_rsvd_create_snapshot_flags = -1; static const value_string rsvd_operation_code_vals[] = { { 0x02001001, "RSVD_TUNNEL_GET_INITIAL_INFO" }, { 0x02001002, "RSVD_TUNNEL_SCSI" }, { 0x02001003, "RSVD_TUNNEL_CHECK_CONNECTION_STATUS" }, { 0x02001004, "RSVD_TUNNEL_SRB_STATUS" }, { 0x02001005, "RSVD_TUNNEL_GET_DISK_INFO" }, { 0x02001006, "RSVD_TUNNEL_VALIDATE_DISK" }, { 0x02002101, "RSVD_TUNNEL_META_OPERATION_START" }, { 0x02002002, "RSVD_TUNNEL_META_OPERATION_QUERY_PROGRESS" }, { 0x02002005, "RSVD_TUNNEL_VHDSET_QUERY_INFORMATION" }, { 0x02002006, "RSVD_TUNNEL_DELETE_SNAPSHOT" }, { 0x02002008, "RSVD_TUNNEL_CHANGE_TRACKING_GET_PARAMETERS" }, { 0x02002009, "RSVD_TUNNEL_CHANGE_TRACKING_START" }, { 0x0200200A, "RSVD_TUNNEL_CHANGE_TRACKING_STOP" }, { 0x0200200C, "RSVD_TUNNEL_QUERY_VIRTUAL_DISK_CHANGES" }, { 0x0200200D, "RSVD_TUNNEL_QUERY_SAFE_SIZE" }, { 0, NULL } }; static const value_string rsvd_sense_info_vals[] = { { 0x0, "Sense Info Not Auto Generated" }, { 0x1, "Sense Info Auto Generated" }, { 0, NULL } }; static const value_string rsvd_disk_type_vals[] = { { 0x02, "VHD_TYPE_FIXED" }, { 0x03, "VHD_TYPE_DYNAMIC" }, { 0, NULL } }; static const value_string rsvd_disk_format_vals[] = { { 0x03, "VIRTUAL_STORAGE_TYPE_DEVICE_VHDX" }, { 0x04, "VIRTUAL_STORAGE_TYPE_DEVICE_VHDSET" }, { 0, NULL } }; /* * We need this data to handle SCSI requests and responses, I think */ typedef struct _rsvd_task_data_t { guint32 request_frame; guint32 response_frame; itlq_nexus_t *itlq; } rsvd_task_data_t; typedef struct _rsvd_conv_data_t { wmem_map_t *tasks; wmem_tree_t *itl; rsvd_task_data_t *task; conversation_t *conversation; } rsvd_conv_data_t; static rsvd_conv_data_t *rsvd_conv_data = NULL; static proto_tree *top_tree = NULL; static itl_nexus_t * get_itl_nexus(packet_info *pinfo) { itl_nexus_t *itl = NULL; if (!(itl = (itl_nexus_t *)wmem_tree_lookup32_le(rsvd_conv_data->itl, pinfo->num))) { itl = wmem_new(wmem_file_scope(), itl_nexus_t); itl->cmdset = 0xff; itl->conversation = rsvd_conv_data->conversation; wmem_tree_insert32(rsvd_conv_data->itl, pinfo->num, itl); } return itl; } static int dissect_RSVD_GET_INITIAL_INFO(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (!request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_GET_INITIAL_INFO_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_file_info_server_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_file_info_sector_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_file_info_physical_sector_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_file_info_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_file_info_virtual_size, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; } return offset; } static const value_string rsvd_data_in_vals[] = { { 0x00, "Client is requesting data from the server" }, { 0x01, "Client is sending data to the server" }, { 0x02, "Client is neither sending nor requesting an additional data buffer" }, { 0, NULL } }; static void dissect_scsi_payload_databuffer(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 data_transfer_length, gboolean request) { tvbuff_t *data_tvb = NULL; int tvb_len, tvb_rlen; tvb_len = tvb_captured_length_remaining(tvb, offset); if (tvb_len > (int)data_transfer_length) tvb_len = data_transfer_length; tvb_rlen = tvb_reported_length_remaining(tvb, offset); if (tvb_rlen > (int)data_transfer_length) tvb_rlen = data_transfer_length; data_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_len, tvb_rlen); if (rsvd_conv_data->task && rsvd_conv_data->task->itlq) { rsvd_conv_data->task->itlq->task_flags = SCSI_DATA_READ | SCSI_DATA_WRITE; rsvd_conv_data->task->itlq->data_length = data_transfer_length; rsvd_conv_data->task->itlq->bidir_data_length = data_transfer_length; dissect_scsi_payload(data_tvb, pinfo, top_tree, request, rsvd_conv_data->task->itlq, get_itl_nexus(pinfo), 0); } } /* * Dissect a tunnelled SCSI request and call the SCSI dissector where * needed. */ static int dissect_RSVD_TUNNEL_SCSI(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, gint16 len, gboolean request, guint64 request_id) { proto_tree *sub_tree; proto_item *sub_item; guint32 cdb_length; guint8 data_in; guint32 data_transfer_length; guint32 sense_info_ex_length; conversation_t *conversation; conversation = find_or_create_conversation(pinfo); rsvd_conv_data = (rsvd_conv_data_t *)conversation_get_proto_data(conversation, proto_rsvd); if (!rsvd_conv_data) { rsvd_conv_data = wmem_new(wmem_file_scope(), rsvd_conv_data_t); rsvd_conv_data->tasks = wmem_map_new(wmem_file_scope(), wmem_int64_hash, g_int64_equal); rsvd_conv_data->itl = wmem_tree_new(wmem_file_scope()); rsvd_conv_data->conversation = conversation; conversation_add_proto_data(conversation, proto_rsvd, rsvd_conv_data); } rsvd_conv_data->task = NULL; if (!pinfo->fd->visited) { guint64 *key_copy = wmem_new(wmem_file_scope(), guint64); *key_copy = request_id; rsvd_conv_data->task = wmem_new(wmem_file_scope(), rsvd_task_data_t); rsvd_conv_data->task->request_frame=pinfo->num; rsvd_conv_data->task->response_frame=0; rsvd_conv_data->task->itlq = NULL; wmem_map_insert(rsvd_conv_data->tasks, (const void *)key_copy, rsvd_conv_data->task); } else { rsvd_conv_data->task = (rsvd_task_data_t *)wmem_map_lookup(rsvd_conv_data->tasks, (const void *)&request_id); } sub_tree = proto_tree_add_subtree_format(parent_tree, tvb, offset, len, ett_svhdx_tunnel_scsi_request, &sub_item, "SVHDX_TUNNEL_SCSI_%s", (request ? "REQUEST" : "RESPONSE")); if (request) { tvbuff_t *scsi_cdb = NULL; /* Length */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* Reserved1 */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_reserved1, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* CDBLength */ cdb_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_cdb_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* SensInfoExLength */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_sense_info_ex_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* DataIn */ data_in = tvb_get_guint8(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_data_in, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* Reserved2 */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_reserved2, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* SrbFlags */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_srb_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* DataTransferLength */ data_transfer_length = tvb_get_letohl(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_data_transfer_length, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* CDBBuffer */ scsi_cdb = tvb_new_subset_length_caplen(tvb, offset, cdb_length, tvb_reported_length_remaining(tvb, offset)); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_cdb, tvb, offset, cdb_length, ENC_NA); offset += cdb_length; if (cdb_length < 16) { /* * CDBBuffer is always 16 bytes - see MS-RSVD section 2.2.4.7 * "SVHDX_TUNNEL_SCSI_REQUEST Structure": * * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rsvd/e8bcb003-97b3-41ef-9689-cd2d1668a9cc * * If CDB is actually smaller, we need to define padding bytes */ guint32 cdb_padding_length = 16 - cdb_length; proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_cdb_padding, tvb, offset, cdb_padding_length, ENC_NA); offset += cdb_padding_length; } /* Reserved3 */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* DataBuffer */ if (data_transfer_length) { proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_data, tvb, offset, data_transfer_length, ENC_NA); } /* * Now the SCSI Request */ if (rsvd_conv_data->task && !rsvd_conv_data->task->itlq) { rsvd_conv_data->task->itlq = wmem_new(wmem_file_scope(), itlq_nexus_t); rsvd_conv_data->task->itlq->first_exchange_frame = pinfo->num; rsvd_conv_data->task->itlq->last_exchange_frame = 0; rsvd_conv_data->task->itlq->lun = 0xffff; rsvd_conv_data->task->itlq->scsi_opcode = 0xffff; rsvd_conv_data->task->itlq->task_flags = 0; rsvd_conv_data->task->itlq->data_length = 0; rsvd_conv_data->task->itlq->bidir_data_length = 0; rsvd_conv_data->task->itlq->flags = 0; rsvd_conv_data->task->itlq->alloc_len = 0; rsvd_conv_data->task->itlq->fc_time = pinfo->abs_ts; rsvd_conv_data->task->itlq->extra_data = NULL; } if (rsvd_conv_data->task && rsvd_conv_data->task->itlq) { dissect_scsi_cdb(scsi_cdb, pinfo, top_tree, SCSI_DEV_SMC, rsvd_conv_data->task->itlq, get_itl_nexus(pinfo)); if (data_in == 0) { /* Only OUT operations have meaningful SCSI payload in request packet */ dissect_scsi_payload_databuffer(tvb, pinfo, offset, data_transfer_length, request); } } /* increment after DataBuffer */ offset += data_transfer_length; } else { guint8 scsi_status = 0; /* Length */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* A */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_auto_generated_sense, tvb, offset, 1, ENC_BIG_ENDIAN); /* SrbStatus */ proto_tree_add_bits_item(sub_tree, hf_svhdx_tunnel_scsi_srb_status, tvb, offset * 8 + 1, 7, ENC_BIG_ENDIAN); offset++; /* ScsiStatus */ scsi_status = tvb_get_guint8(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* CdbLength */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_cdb_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* SensInfoExLength */ sense_info_ex_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_sense_info_ex_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* DataIn */ data_in = tvb_get_guint8(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_data_in, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* Reserved */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_reserved2, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* SrbFlags */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_srb_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* DataTransferLength */ data_transfer_length = tvb_get_letohl(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_data_transfer_length, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* SenseDataEx */ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_sense_data_ex, tvb, offset, sense_info_ex_length, ENC_NA); offset += sense_info_ex_length; /* DataBuffer */ if (data_transfer_length) { proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_data, tvb, offset, data_transfer_length, ENC_NA); if (data_in == 1) { /* Only IN operations have meaningful SCSI payload in reply packet */ dissect_scsi_payload_databuffer(tvb, pinfo, offset, data_transfer_length, request); } offset += data_transfer_length; } /* * Now, the SCSI response */ if (rsvd_conv_data->task && rsvd_conv_data->task->itlq) { dissect_scsi_rsp(tvb, pinfo, top_tree, rsvd_conv_data->task->itlq, get_itl_nexus(pinfo), scsi_status); } } return offset; } static int dissect_RSVD_SRB_STATUS(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_SRB_STATUS_REQUEST"); /* StatusKey */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_status_key, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* Reserved */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_reserved, tvb, offset, 1, ENC_NA); offset += 27; } else { guint8 sense_info_length; gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_SRB_STATUS_RESPONSE"); /* StatusKey */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_status_key, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* SenseInfoAutoGenerated and SrbStatus */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_sense_info_auto_generated, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_bits_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_srb_status, tvb, offset * 8 + 1, 7, ENC_BIG_ENDIAN); offset += 1; /* ScsiStatus */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_scsi_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* SenseInfoExLength */ sense_info_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_sense_info_ex_length, tvb, offset, 1, ENC_NA); offset += 1; /* SenseDataEx */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_srb_status_sense_data_ex, tvb, offset, sense_info_length, ENC_NA); offset += sense_info_length; } return offset; } static int dissect_RSVD_GET_DISK_INFO(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_GET_DISK_INFO_REQUEST"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_reserved1, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_blocksize, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_linkage_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_is_mounted, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_is_4k_aligned, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_file_size, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_virtual_disk_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; } else { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_GET_DISK_INFO_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_disk_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_disk_format, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_blocksize, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_linkage_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_is_mounted, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_is_4k_aligned, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_file_size, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_disk_info_virtual_disk_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; } return offset; } static int dissect_RSVD_VALIDATE_DISK(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_VALIDATE_DISK_REQUEST"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_validate_disk_reserved, tvb, offset, 56, ENC_NA); offset += 56; } else { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_VALIDATE_DISK_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_validate_disk_is_valid_disk, tvb, offset, 1, ENC_NA); offset += 1; } return offset; } static const value_string rsvd_meta_operation_type_vals[] = { { 0x00, "SvhdxMetaOperationTypeResize" }, { 0x01, "SvhdxMetaOperationTypeCreateSnapshot" }, { 0x02, "SvhdxMetaOperationTypeOptimize" }, { 0x03, "SvhdxMetaOperationTypeExtractVHD" }, { 0x04, "SvhdxMetaOperationTypeConvertToVHDSet" }, { 0x05, "SvhdxMetaOperationTypeApplySnapshot" }, { 0, NULL } }; static const value_string svhdx_snapshot_type_vals[] = { { 0x01, "SvhdxSnapshotTypeVM" }, { 0x03, "SvhdxSnapshotTypeCDP" }, { 0x04, "SvhdxSnapshotTypeWriteable" }, { 0, NULL } }; static const value_string svhdx_snapshot_stage_vals[] = { { 0x00, "SvhdxSnapshotStageInvalid" }, { 0x01, "SvhdxSnapshotStageInitialize" }, { 0x02, "SvhdxSnapshotStageBlockIO" }, { 0x03, "SvhdxSnapshotStageSwitchObjectStore" }, { 0x04, "SvhdxSnapshotStageUnblockIO" }, { 0x05, "SvhdxSnapshotStageFinalize" }, { 0, NULL } }; #define SVHDX_SNAPSHOT_DISK_FLAG_ENABLE_CHANGE_TRACKING 0x00000001 static int dissect_RSVD2_META_OPERATION_START(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { static int * const meta_operation_create_snapshot_flags[] = { &hf_svhdx_tunnel_create_snapshot_flag_enable_change_tracking, NULL }; guint32 operation_type = 0; guint32 length = 0; proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_META_OPERATION_START_REQUEST"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_transaction_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; operation_type = tvb_get_letohl(tvb, offset); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_meta_operation_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_padding, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; switch (operation_type) { case 0x00: /* SvhdxMetaOperationTypeResize */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_resize_new_size, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_resize_expand_only_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_resize_allow_unsafe_virt_size_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_resize_shrink_to_minimum_safe_size_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_meta_operation_start_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; break; case 0x01: /* SvhdxMetaOperationTypeCreateSnapshot */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_bitmask(gfi_sub_tree, tvb, offset, hf_svhdx_tunnel_create_snapshot_flags, ett_rsvd_create_snapshot_flags, meta_operation_create_snapshot_flags, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_stage1, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_stage2, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_stage3, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_stage4, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_stage5, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_stage6, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_create_snapshot_parameters_payload_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; break; case 0x02: /* SvhdxMetaOperationTypeOptimize */ /* No Data, field MUST be empty */ break; case 0x03: /* SvhdxMetaOperationTypeExtractVHD */ /* TODO */ break; case 0x04: /* SvhdxMetaOperationTypeConvertToVHDSet */ length = tvb_get_letohl(tvb, offset); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_convert_dst_vhdset_name_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (length) { proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_convert_dst_vhdset_name, tvb, offset, length, ENC_UTF_16|ENC_LITTLE_ENDIAN); } break; case 0x05: /* SvhdxMetaOperationTypeApplySnapshot */ proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; break; } } return offset; } static int dissect_RSVD2_META_OPERATION_QUERY_PROGRESS(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request, guint32 status) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_META_OPERATION_QUERY_PROGRESS_REQUEST"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_transaction_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; } else { if (status == 0) { /* If status is not successful, RSVD response buffer is filled by data from request buffer and we should not parse output structure */ gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_META_OPERATION_QUERY_PROGRESS_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_meta_op_query_progress_current_progress, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_meta_op_query_progress_complete_value, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; } } return offset; } static const value_string svhdx_vhdset_information_type_vals[] = { { 0x02, "SvhdxVHDSetInformationTypeSnapshotList" }, { 0x05, "SvhdxVHDSetInformationTypeSnapshotEntry" }, { 0x08, "SvhdxVHDSetInformationTypeOptimizeNeeded" }, { 0x09, "SvhdxVHDSetInformationTypeCdpSnapshotRoot" }, { 0x0A, "SvhdxVHDSetInformationTypeCdpSnapshotActiveList" }, { 0x0C, "SvhdxVHDSetInformationTypeCdpSnapshotInactiveList" }, { 0, NULL } }; static int dissect_RSVD2_VHDSET_QUERY_INFORMATION(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_VHDSET_QUERY_INFORMATION_REQUEST"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_vhdset_information_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; } else { guint32 vhdset_info_type = tvb_get_letohl(tvb, offset); switch (vhdset_info_type) { case 0x02: /* SvhdxVHDSetInformationTypeSnapshotList */ gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_LIST_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_vhdset_information_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* TODO: make full dissection */ break; case 0x05: /* SvhdxVHDSetInformationTypeSnapshotEntry */ gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_ENTRY_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_vhdset_information_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_padding, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; offset = dissect_nt_64bit_time(tvb, gfi_sub_tree, offset, hf_svhdx_tunnel_vhdset_snapshot_creation_time); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_vhdset_is_valid_snapshot, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_vhdset_parent_snapshot_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_vhdset_log_file_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; break; } } return offset; } static int dissect_RSVD2_DELETE_SNAPSHOT(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_DELETE_SNAPSHOT_REQUEST"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_id, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset += 16; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_delete_snapshot_persist_reference, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_snapshot_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; } return offset; } static int dissect_RSVD2_QUERY_SAFE_SIZE(tvbuff_t *tvb, proto_tree *parent_tree, int offset, gint16 len, gboolean request) { proto_tree *gfi_sub_tree; proto_item *gfi_sub_item; if (!request) { gfi_sub_tree = proto_tree_add_subtree(parent_tree, tvb, offset, len, ett_svhdx_tunnel_op_header, &gfi_sub_item, "RSVD_TUNNEL_QUERY_SAFE_SIZE_RESPONSE"); proto_tree_add_item(gfi_sub_tree, hf_svhdx_tunnel_safe_virtual_size, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; } return offset; } static int dissect_rsvd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { guint32 header_bytes = 0; guint proto_id = 0; guint proto_version = 0; guint32 operation_code = 0; guint32 status; proto_item *ti; proto_tree *rsvd_tree; proto_item *sub_item; proto_tree *sub_tree; guint offset = 0; guint16 len; guint64 request_id = 0; gboolean request = *(gboolean *)data; top_tree = parent_tree; len = tvb_reported_length(tvb); col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVD"); col_clear(pinfo->cinfo, COL_INFO); /* * The header bytes need to be pulled in as a 32bit LE value. And the * header is the same in a request or a response ... */ header_bytes = tvb_get_letohl(tvb, 0); /* Get the header bytes */ proto_id = header_bytes >> 24; proto_version = (header_bytes >> 12) & 0x0FFF; operation_code = header_bytes; ti = proto_tree_add_item(parent_tree, proto_rsvd, tvb, offset, -1, ENC_NA); rsvd_tree = proto_item_add_subtree(ti, ett_rsvd); sub_tree = proto_tree_add_subtree(rsvd_tree, tvb, offset, (len>16) ? 16 : len, ett_svhdx_tunnel_op_header, &sub_item, "SVHDX_TUNNEL_OPERATION_HEADER"); /* ProtocolID */ proto_tree_add_uint(sub_tree, hf_svhdx_protocol_id, tvb, offset, 4, proto_id); /* ProtocolVersion */ proto_tree_add_uint(sub_tree, hf_svhdx_protocol_version, tvb, offset, 4, proto_version); /* Operation Code */ proto_tree_add_uint(sub_tree, hf_svhdx_operation_code, tvb, offset, 4, operation_code); offset += 4; /* Status */ status = tvb_get_letohl(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_status, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* RequestId */ request_id = tvb_get_ntoh64(tvb, offset); proto_tree_add_item(sub_tree, hf_svhdx_request_id, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s", val_to_str(operation_code, rsvd_operation_code_vals, "Unknown Operation Code (0x%08X)"), request ? "Request" : "Response"); proto_item_append_text(ti, ", %s %s", val_to_str(operation_code, rsvd_operation_code_vals, "Unknown Operation Code (0x%08X)"), request ? "Request" : "Response"); /* * Now process the individual requests ... */ switch (operation_code) { case 0x02001001: offset += dissect_RSVD_GET_INITIAL_INFO(tvb, rsvd_tree, offset, len - offset, request); break; case 0x02001002: offset += dissect_RSVD_TUNNEL_SCSI(tvb, pinfo, rsvd_tree, offset, len - offset, request, request_id); break; case 0x02001003: /* * There is nothing more here. */ break; case 0x02001004: offset += dissect_RSVD_SRB_STATUS(tvb, rsvd_tree, offset, len - offset, request); break; case 0x02001005: offset += dissect_RSVD_GET_DISK_INFO(tvb, rsvd_tree, offset, len - offset, request); break; case 0x02001006: offset += dissect_RSVD_VALIDATE_DISK(tvb, rsvd_tree, offset, len - offset, request); break; /* RSVD v2 operations */ case 0x02002101: offset += dissect_RSVD2_META_OPERATION_START(tvb, rsvd_tree, offset, len - offset, request); break; case 0x02002002: offset += dissect_RSVD2_META_OPERATION_QUERY_PROGRESS(tvb, rsvd_tree, offset, len - offset, request, status); break; case 0x02002005: offset += dissect_RSVD2_VHDSET_QUERY_INFORMATION(tvb, rsvd_tree, offset, len - offset, request); break; case 0x02002006: offset += dissect_RSVD2_DELETE_SNAPSHOT(tvb, rsvd_tree, offset, len - offset, request); break; case 0x0200200D: offset += dissect_RSVD2_QUERY_SAFE_SIZE(tvb, rsvd_tree, offset, len - offset, request); break; /* TODO: implement more dissectors for RSVD v2 */ default: break; } return offset; } void proto_register_rsvd(void) { static hf_register_info hf[] = { { &hf_svhdx_protocol_id, { "ProtocolId", "rsvd.svhdx_protocol_id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_protocol_version, { "ProtocolVersion", "rsvd.svhdx_protocol_version", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_operation_code, { "OperationCode", "rsvd.svhdx_operation_code", FT_UINT32, BASE_HEX, VALS(rsvd_operation_code_vals), 0, "Operation Code", HFILL }}, { &hf_svhdx_status, { "Status", "rsvd.svhdx_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &NT_errors_ext, 0, NULL, HFILL }}, { &hf_svhdx_request_id, { "RequestId", "rsvd.svhdx_request_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_length, { "Length", "rsvd.svhdx_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_reserved1, { "Reserved1", "rsvd.svhdx_scsi_reserved1", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_cdb_length, { "CDBLength", "rsvd.svhdx_scsi_cdb_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_sense_info_ex_length, { "SenseInfoExLength", "rsvd.svhdx_scsi_sense_info_ex_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_data_in, { "DataIn", "rsvd.svhdx_scsi_data_in", FT_UINT8, BASE_HEX, VALS(rsvd_data_in_vals), 0, "SCSI CDB transfer type", HFILL }}, { &hf_svhdx_tunnel_scsi_reserved2, { "Reserved2", "rsvd.svhdx_scsi_reserved2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_srb_flags, { "SRBFlags", "rsvd.svhdx_scsi_srbflags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_data_transfer_length, { "DataTransferLength", "rsvd.svhdx_scsi_data_transfer_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_reserved3, { "Reserved3", "rsvd.svhdx_scsi_reserved3", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_cdb, { "CDB", "rsvd.svhdx_scsi_cdb", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_cdb_padding, { "CDBPadding", "rsvd.svhdx_scsi_cdb_padding", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_data, {"Data", "rsvd.svhdx_scsi_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_auto_generated_sense, {"AutoGeneratedSenseInfo", "rsvd.svhdx_auto_generated_sense_info", FT_UINT8, BASE_HEX, VALS(rsvd_sense_info_vals), 0x80, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_srb_status, { "SrbStatus", "rsvd.svhdx_srb_status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_status, { "ScsiStatus", "rsvd.svhdx_scsi_status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_scsi_sense_data_ex, { "SenseDataEx", "rsvd.svhdx_scsi_sense_data_ex", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_file_info_server_version, { "ServerVersion", "rsvd.svhdx_file_info_server_version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_file_info_sector_size, { "SectorSize", "rsvd.svhdx_file_info_sector_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_file_info_physical_sector_size, { "PhysicalSectorSize", "rsvd.svhdx_file_info_physical_sector_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_file_info_reserved, { "Reserved", "rsvd.svhdx_file_info_reserved", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_file_info_virtual_size, { "VirtualSize", "rsvd.svhdx_file_info_virtual_size", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_reserved1, { "Reserved1", "rsvd.svhdx_disk_info_reserved1", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_blocksize, { "BlockSize", "rsvd.svhdx_disk_info_blocksize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_linkage_id, { "LinkageID", "rsvd.svhdx_disk_info_linkage_id", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_disk_type, { "DiskType", "rsvd.svhdx_disk_info_disk_type", FT_UINT32, BASE_HEX, VALS(rsvd_disk_type_vals), 0, "Disk Type", HFILL }}, { &hf_svhdx_tunnel_disk_info_disk_format, { "DiskFormat", "rsvd.svhdx_disk_info_disk_format", FT_UINT32, BASE_HEX, VALS(rsvd_disk_format_vals), 0, "Disk Format", HFILL }}, { &hf_svhdx_tunnel_disk_info_is_mounted, { "IsMounted", "rsvd.svhdx_tunnel_disk_info_is_mounted", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_is_4k_aligned, { "Is4KAligned", "rsvd.svhdx_tunnel_disk_info_is_4k_aligned", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_reserved, { "Reserved", "rsvd.svhdx_disk_info_reserved", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_file_size, { "FileSize", "rsvd.svhdx_disk_info_file_size", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_disk_info_virtual_disk_id, { "VirtualDiskId", "rsvd.svhdx_disk_info_virtual_disk_id", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_validate_disk_reserved, { "Reserved", "rsvd.svhdx_tunnel_validate_disk_reserved", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_validate_disk_is_valid_disk, { "IsValidDisk", "rsvd.svhdx_validate_disk_is_valid_disk", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_status_key, { "StatusKey", "rsvd.svhdx_srb_status_key", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_reserved, { "Reserved", "rsvd.svhdx_srb_status_reserved", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_sense_info_auto_generated, { "SenseInfoAutoGenerated", "rsvd.svhdx_sense_info_auto_generated", FT_UINT8, BASE_HEX, VALS(rsvd_sense_info_vals), 0x80, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_srb_status, { "SrbStatus", "rsvd.svhdx_srb_status_srb_status", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_scsi_status, { "SrbStatus", "rsvd.svhdx_srb_status_scsi_status", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_sense_info_ex_length, { "SenseInfoExLength", "rsvd.svhdx_srb_status_sense_info_ex_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_srb_status_sense_data_ex, { "Reserved", "rsvd.svhdx_srb_status_sense_data_ex", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_safe_virtual_size, { "SafeVirtualSize", "rsvd.svhdx_safe_size", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_transaction_id, { "TransactionId", "rsvd.svhdx_meta_operation.transaction_id", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_meta_operation_type, { "OperationType", "rsvd.svhdx_meta_operation.type", FT_UINT32, BASE_HEX, VALS(rsvd_meta_operation_type_vals), 0, "Type of meta-operation", HFILL }}, { &hf_svhdx_tunnel_padding, { "Padding", "rsvd.svhdx_padding", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_resize_new_size, { "NewSize", "rsvd.svhdx_meta_operation.new_size", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_resize_expand_only_flag, { "ExpandOnly", "rsvd.svhdx_meta_operation.expand_only", FT_BOOLEAN, 8, NULL, 0, "Indicates that shared virtual disk size can only expand", HFILL }}, { &hf_svhdx_tunnel_resize_allow_unsafe_virt_size_flag, { "AllowUnsafeVirtualSize", "rsvd.svhdx_meta_operation.allow_unsafe_virt_size", FT_BOOLEAN, 8, NULL, 0, "Indicates that the shared virtual disk size can be less than the data it currently contains", HFILL }}, { &hf_svhdx_tunnel_resize_shrink_to_minimum_safe_size_flag, { "ShrinkToMinimumSafeSize", "rsvd.svhdx_meta_operation.shrink_to_minimum_safe_size", FT_BOOLEAN, 8, NULL, 0, "Indicates that the shared virtual disk size can be shrunk to the data it currently contains", HFILL }}, { &hf_svhdx_tunnel_meta_operation_start_reserved, { "Reserved", "rsvd.svhdx_meta_operation.reserved", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_snapshot_type, { "SnapshotType", "rsvd.svhdx_snapshot_type", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_type_vals), 0, "Type of snapshot", HFILL }}, { &hf_svhdx_tunnel_snapshot_id, { "SnapshotId", "rsvd.svhdx_snapshot_id", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_create_snapshot_flags, { "Flags", "rsvd.svhdx_meta_operation.create_snapshot_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_create_snapshot_flag_enable_change_tracking, { "SVHDX_SNAPSHOT_DISK_FLAG_ENABLE_CHANGE_TRACKING", "rsvd.svhdx_meta_operation.create_snapshot_flag_enable_change_tracking", FT_BOOLEAN, 32, NULL, SVHDX_SNAPSHOT_DISK_FLAG_ENABLE_CHANGE_TRACKING, "Change tracking to be enabled when snapshot is taken", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_stage1, { "Stage1", "rsvd.svhdx_meta_operation.create_snapshot_stage1", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_stage_vals), 0, "The first stage", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_stage2, { "Stage2", "rsvd.svhdx_meta_operation.create_snapshot_stage2", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_stage_vals), 0, "The second stage", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_stage3, { "Stage3", "rsvd.svhdx_meta_operation.create_snapshot_stage3", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_stage_vals), 0, "The third stage", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_stage4, { "Stage4", "rsvd.svhdx_meta_operation.create_snapshot_stage4", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_stage_vals), 0, "The fourth stage", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_stage5, { "Stage5", "rsvd.svhdx_meta_operation.create_snapshot_stage5", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_stage_vals), 0, "The fifth stage", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_stage6, { "Stage6", "rsvd.svhdx_meta_operation.create_snapshot_stage6", FT_UINT32, BASE_HEX, VALS(svhdx_snapshot_stage_vals), 0, "The sixth stage", HFILL }}, { &hf_svhdx_tunnel_create_snapshot_parameters_payload_size, { "ParametersPayloadSize", "rsvd.svhdx_meta_operation.create_snapshot_params_payload_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_convert_dst_vhdset_name_len, { "DestinationVhdSetNameLength", "rsvd.svhdx_meta_operation.dst_vhdset_name_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_convert_dst_vhdset_name, { "DestinationVhdSetName", "rsvd.svhdx_meta_operation.dst_vhdset_name", FT_STRING, BASE_NONE, NULL, 0, "Name for the new VHD set be created", HFILL }}, { &hf_svhdx_tunnel_delete_snapshot_persist_reference, { "PersistReference", "rsvd.svhdx_delete_snapshot_persist_reference", FT_BOOLEAN, 4, NULL, 0, "Indicate if the snapshot needs to be persisted", HFILL }}, { &hf_svhdx_tunnel_meta_op_query_progress_current_progress, { "CurrentProgressValue", "rsvd.svhdx_query_progress.current_progress", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_meta_op_query_progress_complete_value, { "CompleteValue", "rsvd.svhdx_query_progress.complete_value", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_vhdset_information_type, { "VHDSetInformationType", "rsvd.svhdx_vhdset_information_type", FT_UINT32, BASE_HEX, VALS(svhdx_vhdset_information_type_vals), 0, "The information type requested", HFILL }}, { &hf_svhdx_tunnel_vhdset_snapshot_creation_time, { "SnapshotCreationTime", "rsvd.svhdx_vhdset_snapshot_creation_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, "Time when this object was created", HFILL }}, { &hf_svhdx_tunnel_vhdset_is_valid_snapshot, { "IsValidSnapshot", "rsvd.svhdx_vhdset_is_valid_snapshot", FT_BOOLEAN, 4, NULL, 0, "Set to 1 when the snapshot is valid", HFILL }}, { &hf_svhdx_tunnel_vhdset_parent_snapshot_id, { "ParentSnapshotId", "rsvd.svhdx_vhdxset_parent_snapshot_id", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_svhdx_tunnel_vhdset_log_file_id, { "LogFileId", "rsvd.svhdx_vhdxset_log_file_id", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }} }; static gint *ett[] = { &ett_rsvd, &ett_svhdx_tunnel_op_header, &ett_svhdx_tunnel_scsi_request, &ett_rsvd_create_snapshot_flags }; proto_rsvd = proto_register_protocol("Remote Shared Virtual Disk", "RSVD", "rsvd"); register_dissector("rsvd", dissect_rsvd, proto_rsvd); proto_register_field_array(proto_rsvd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rsvp.c
/* packet-rsvp.c * Routines for RSVP packet disassembly * * (c) Copyright Ashok Narayanan <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * NOTES * * This module defines routines to disassemble RSVP packets, as defined in * RFC 2205. All objects from RFC2205 are supported, in IPv4 and IPv6 mode. * In addition, the Integrated Services traffic specification objects * defined in RFC2210 are also supported. * * IPv6 support is not completely tested * * Mar 3, 2000: Added support for MPLS/TE objects, as defined in * <draft-ietf-mpls-rsvp-lsp-tunnel-04.txt> * * May 6, 2004: Added support for E-NNI objects, as defined in * <OIF-E-NNI-01.0> (Roberto Morro) * <roberto.morro[AT]tilab.com> * * May 6, 2004: Modified some UNI objects, as defined in * <OIF2003.249.09> (Roberto Morro) * <roberto.morro[AT]tilab.com> * * June 2, 2005: Modified more UNI objects to show correct TNA * addresses; Fixed LSP interface ID subobject (Richard Rabbat) * <richard[AT]us.fujitsu.com> * * July 25, 2005: improved ERROR and LABEL_SET objects dissector; * new ASSOCIATION object dissector (Roberto Morro) * <roberto.morro[AT]tilab.com> * * August 22, 2005: added support for tapping and conversations. * (Manu Pathak) <mapathak[AT]cisco.com> * * July 4, 2006: added support for RFC4124; new CLASSTYPE object dissector * (FF) <francesco.fondelli[AT]gmail.com> * * June 9, 2007: added support for draft-ietf-ccamp-ethernet-traffic-parameters-02 * and draft-ietf-ccamp-lsp-hierarchy-bis-02; added support for NOTIFY_REQUEST * and RECOVERY_LABEL objects (Roberto Morro) * <roberto.morro[AT]tilab.com> * * Oct 21, 2009: add support for RFC4328, new G.709 traffic parameters, * update gpid, switching and encoding type values to actual IANA numbers. * (FF) <francesco.fondelli[AT]gmail.com> * * Gen 20, 2010: add support for ERROR_STRING IF_ID TLV (see RFC 4783) * (FF) <francesco.fondelli[AT]gmail.com> * * Feb 12, 2010: add support for generalized label interpretation: SUKLM * format for SONET/SDH label (RFC 4606), t3t2t1 format for G.709 ODUk label * (RFC 4328), G.694 format for lambda label (draft-ietf-ccamp-gmpls-g-694-lamb * da-labels-05). Add related user preference option. * (FF) <francesco.fondelli[AT]gmail.com> * * Dec 3, 2010: add support for vendor private class object and ERO/RRO * sub-object (see RFC 3936). * (FF) <francesco.fondelli[AT]gmail.com> * * Dec 21, 2010: add new PROTECTION obj c-type 2 (RFC4872), * new TLVs for IF_ID (RFC4920), Path Key subobj in ERO (RFC5520), * new ASSOCIATION obj c-type 4 (oif2008.389), new LSP_ATTRIBUTES and * LSP_REQUIRED_ATTRIBUTES objects (RFC5420), improved ERROR object dissection, * new ADMIN_STATUS flags and fix to conversation (not applied to ACK, SREFRESH * and HELLO messages). * (Roberto Morro) <roberto.morro[AT]telecomitalia.it> * * Jul 20, 2013: add support for Exclude Routes (XRO) (see RFC 4874) * (FF) <francesco.fondelli[AT]gmail.com> * * Added support for "Ethernet line" LSP encoding (RFC 6004) * Added support for flexi-grid label (RFC 7699) * Added support for codepoint for network-assigned label (RFC 8359) * Added support for clean-up and bug fixes on ERO/RRO/XRO * Added support for full support of RFC 8001, including error code * - (c) 2018 Julien Meuric <[email protected]> * - (c) 2018 Khalifa Ndiaye <[email protected]> */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/exceptions.h> #include <epan/prefs.h> #include <epan/to_str.h> #include <epan/in_cksum.h> #include <epan/etypes.h> #include <epan/ipproto.h> #include <epan/conversation.h> #include <epan/conversation_table.h> #include <epan/tap.h> #include <epan/addr_resolv.h> #include "packet-rsvp.h" #include "packet-ip.h" #include "packet-diffserv-mpls-common.h" #include "packet-osi.h" /* RSVP over UDP encapsulation */ #define UDP_PORT_PRSVP 3455 void proto_register_rsvp(void); void proto_reg_handoff_rsvp(void); static dissector_handle_t rsvp_handle, rsvpe2ei_handle; static int proto_rsvp = -1; static int proto_rsvp_e2e1 = -1; static int hf_rsvp_error_flags = -1; static int hf_rsvp_error_flags_path_state_removed = -1; static int hf_rsvp_error_flags_not_guilty = -1; static int hf_rsvp_error_flags_in_place = -1; static int hf_rsvp_eth_tspec_tlv_color_mode = -1; static int hf_rsvp_eth_tspec_tlv_coupling_flag = -1; static int hf_rsvp_sender_tspec_standard_contiguous_concatenation = -1; static int hf_rsvp_sender_tspec_arbitrary_contiguous_concatenation = -1; static int hf_rsvp_sender_tspec_regenerator_section = -1; static int hf_rsvp_sender_tspec_multiplex_section = -1; static int hf_rsvp_sender_tspec_J0_transparency = -1; static int hf_rsvp_sender_tspec_SOH_RSOH_DCC_transparency = -1; static int hf_rsvp_sender_tspec_LOH_MSOH_DCC_transparency = -1; static int hf_rsvp_sender_tspec_LOH_MSOH_extended_DCC_transparency = -1; static int hf_rsvp_sender_tspec_K1_K2_transparency = -1; static int hf_rsvp_sender_tspec_E1_transparency = -1; static int hf_rsvp_sender_tspec_F1_transparency = -1; static int hf_rsvp_sender_tspec_E2_transparency = -1; static int hf_rsvp_sender_tspec_B1_transparency = -1; static int hf_rsvp_sender_tspec_B2_transparency = -1; static int hf_rsvp_sender_tspec_M0_transparency = -1; static int hf_rsvp_sender_tspec_M1_transparency = -1; static int hf_rsvp_flowspec_standard_contiguous_concatenation = -1; static int hf_rsvp_flowspec_arbitrary_contiguous_concatenation = -1; static int hf_rsvp_flowspec_regenerator_section = -1; static int hf_rsvp_flowspec_multiplex_section = -1; static int hf_rsvp_flowspec_J0_transparency = -1; static int hf_rsvp_flowspec_SOH_RSOH_DCC_transparency = -1; static int hf_rsvp_flowspec_LOH_MSOH_DCC_transparency = -1; static int hf_rsvp_flowspec_LOH_MSOH_extended_DCC_transparency = -1; static int hf_rsvp_flowspec_K1_K2_transparency = -1; static int hf_rsvp_flowspec_E1_transparency = -1; static int hf_rsvp_flowspec_F1_transparency = -1; static int hf_rsvp_flowspec_E2_transparency = -1; static int hf_rsvp_flowspec_B1_transparency = -1; static int hf_rsvp_flowspec_B2_transparency = -1; static int hf_rsvp_flowspec_M0_transparency = -1; static int hf_rsvp_flowspec_M1_transparency = -1; static int hf_rsvp_integrity_flags_handshake = -1; static int hf_rsvp_sa_flags_local = -1; static int hf_rsvp_sa_flags_label = -1; static int hf_rsvp_sa_flags_se_style = -1; static int hf_rsvp_sa_flags_bandwidth = -1; static int hf_rsvp_sa_flags_node = -1; static int hf_rsvp_rro_flags_local_avail = -1; static int hf_rsvp_rro_flags_local_in_use = -1; static int hf_rsvp_rro_flags_bandwidth = -1; static int hf_rsvp_rro_flags_node = -1; static int hf_rsvp_rro_flags_node_address = -1; static int hf_rsvp_rro_flags_backup_tunnel_bandwidth = -1; static int hf_rsvp_rro_flags_backup_tunnel_hop = -1; static int hf_rsvp_rro_flags_global_label = -1; static int hf_rsvp_lsp_attr = -1; static int hf_rsvp_lsp_attr_e2e = -1; static int hf_rsvp_lsp_attr_boundary = -1; static int hf_rsvp_lsp_attr_segment = -1; static int hf_rsvp_lsp_attr_integrity = -1; static int hf_rsvp_lsp_attr_contiguous = -1; static int hf_rsvp_lsp_attr_stitching = -1; static int hf_rsvp_lsp_attr_preplanned = -1; static int hf_rsvp_lsp_attr_nophp = -1; static int hf_rsvp_lsp_attr_oobmap = -1; static int hf_rsvp_lsp_attr_entropy = -1; static int hf_rsvp_lsp_attr_oammep = -1; static int hf_rsvp_lsp_attr_oammip = -1; static int hf_rsvp_lsp_attr_loopback = -1; static int hf_rsvp_lsp_attr_p2mp = -1; static int hf_rsvp_lsp_attr_rtm = -1; static int hf_rsvp_lsp_attr_lsi = -1; static int hf_rsvp_lsp_attr_lsids2e = -1; static int hf_rsvp_lsp_attr_telinklabel = -1; static int hf_rsvp_lsp_attr_srlgcollect = -1; static int hf_rsvp_gen_uni_direction = -1; static int hf_rsvp_protection_info_flags_secondary_lsp = -1; static int hf_rsvp_pi_link_flags_extra_traffic = -1; static int hf_rsvp_pi_link_flags_unprotected = -1; static int hf_rsvp_pi_link_flags_shared = -1; static int hf_rsvp_pi_link_flags_dedicated1_1 = -1; static int hf_rsvp_pi_link_flags_dedicated1plus1 = -1; static int hf_rsvp_pi_link_flags_enhanced = -1; static int hf_rsvp_pi_link_flags_extra = -1; static int hf_rsvp_pi_link_flags_dedicated_1_1 = -1; static int hf_rsvp_pi_link_flags_dedicated_1plus1 = -1; static int hf_rsvp_rfc4872_secondary = -1; static int hf_rsvp_rfc4872_protecting = -1; static int hf_rsvp_rfc4872_notification_msg = -1; static int hf_rsvp_rfc4872_operational = -1; static int hf_rsvp_pi_lsp_flags_full_rerouting = -1; static int hf_rsvp_pi_lsp_flags_rerouting_extra = -1; static int hf_rsvp_pi_lsp_flags_1_n_protection = -1; static int hf_rsvp_pi_lsp_flags_1plus1_unidirectional = -1; static int hf_rsvp_pi_lsp_flags_1plus1_bidirectional = -1; static int hf_rsvp_protection_info_in_place = -1; static int hf_rsvp_protection_info_required = -1; static int hf_rsvp_pi_seg_flags_full_rerouting = -1; static int hf_rsvp_pi_seg_flags_rerouting_extra = -1; static int hf_rsvp_pi_seg_flags_1_n_protection = -1; static int hf_rsvp_pi_seg_flags_1plus1_unidirectional = -1; static int hf_rsvp_pi_seg_flags_1plus1_bidirectional = -1; static int hf_rsvp_frr_flags_one2one_backup = -1; static int hf_rsvp_frr_flags_facility_backup = -1; static int hf_rsvp_type = -1; static int hf_rsvp_3gpp_obj_tid = -1; static int hf_rsvp_3gpp_obj_ie_len = -1; static int hf_rsvp_3gpp_obj_ie_type = -1; static int hf_rsvp_3gpp_obj_ue_ipv4_addr = -1; static int hf_rsvp_3gpp_obj_ue_ipv6_addr = -1; static int hf_rsvp_3gpp_obj_tft_d = -1; static int hf_rsvp_3gpp_obj_tft_ns = -1; static int hf_rsvp_3gpp_obj_tft_sr_id = -1; static int hf_rsvp_3gpp_obj_tft_p = -1; static int hf_rsvp_3gpp_obj_tft_opcode = -1; static int hf_rsvp_3gpp_obj_tft_n_pkt_flt = -1; static int hf_rsvp_3gpp_obj_flow_id = -1; static int hf_rsvp_3gpp_obj_pf_ev_prec = -1; static int hf_rsvp_3gpp_obj_pf_len = -1; static int hf_rsvp_3gpp_obj_pf_type = -1; static int hf_rsvp_3gpp_obj_pf_cont_len = -1; static int hf_rsvp_3gpp_obj_pf_comp_type_id = -1; static int hf_rsvp_3gpp_obj_pf_src_ipv4 = -1; static int hf_rsvp_3gpp_obj_pf_dst_ipv4 = -1; static int hf_rsvp_3gpp_obj_pf_ipv4_mask = -1; static int hf_rsvp_3gpp_obj_pf_src_ipv6 = -1; static int hf_rsvp_3gpp_obj_pf_dst_ipv6 = -1; static int hf_rsvp_3gpp_obj_pf_ipv6_prefix_length = -1; static int hf_rsvp_3gpp_obj_pf_prot_next = -1; static int hf_rsvp_3gpp_obj_pf_dst_port = -1; static int hf_rsvp_3gpp_obj_pf_src_port = -1; static int hf_rsvp_3gpp_obj_pf_ipsec_spi = -1; static int hf_rsvp_3gpp_obj_pf_tos_tc = -1; static int hf_rsvp_3gpp_obj_pf_flow_lbl = -1; static int hf_rsvp_3gpp_obj_pf_ipv6 = -1; static int hf_rsvp_3gpp_obj_pf_treatment = -1; static int hf_rsvp_3gpp_obj_pf_hint = -1; static int hf_rsvp_3gpp_obj_tft_qos_list_len = -1; static int hf_rsvp_3gpp_r_qos_blob_len = -1; static int hf_rsvp_3gpp_r_qos_blob_flow_pri = -1; static int hf_rsvp_3gpp_r_qos_blob_num_qos_att_set = -1; static int hf_rsvp_3gpp_qos_att_set_len = -1; static int hf_rsvp_3gpp_qos_attribute_set_id = -1; static int hf_rsvp_3gpp_qos_attribute_verbose = -1; static int hf_rsvp_3gpp_qos_attribute_prof_id = -1; static int hf_rsvp_3gpp_qos_attribute_traff_cls = -1; static int hf_rsvp_3gpp_qos_attribute_peak_rate = -1; static int hf_rsvp_3gpp_qos_attribute_bucket_size = -1; static int hf_rsvp_3gpp_qos_attribute_token_rate = -1; static int hf_rsvp_3gpp_qos_attribute_max_latency = -1; static int hf_rsvp_3gpp_qos_attribute_max_loss_rte = -1; static int hf_rsvp_3gpp_qos_attribute_delay_var_sensitive = -1; static int hf_rsvp_3gpp_qos_attribute_reserved = -1; static int hf_rsvp_3gpp_r_qos_blob = -1; static int hf_rsvp_3gpp_qos_result = -1; static int hf_rsvp_xro_sobj_lbit = -1; static int hf_rsvp_rro_sobj_dbit = -1; static int hf_rsvp_xro_sobj_len = -1; static int hf_rsvp_xro_sobj_ipv4_addr = -1; static int hf_rsvp_xro_sobj_ipv4_prefix = -1; static int hf_rsvp_xro_sobj_ipv4_attr = -1; static int hf_rsvp_xro_sobj_ipv6_attr = -1; static int hf_rsvp_xro_sobj_srlg_id = -1; static int hf_rsvp_xro_sobj_srlg_res = -1; static int hf_rsvp_private_data = -1; static int hf_rsvp_juniper_numtlvs = -1; static int hf_rsvp_juniper_padlength = -1; static int hf_rsvp_juniper_type = -1; static int hf_rsvp_juniper_length = -1; static int hf_rsvp_juniper_attrib_cos = -1; static int hf_rsvp_juniper_attrib_metric1 = -1; static int hf_rsvp_juniper_attrib_metric2 = -1; static int hf_rsvp_juniper_attrib_ccc_status = -1; static int hf_rsvp_juniper_attrib_path = -1; static int hf_rsvp_juniper_attrib_unknown = -1; static int hf_rsvp_juniper_unknown = -1; static int hf_rsvp_juniper_pad = -1; static int hf_rsvp_unknown_data = -1; static int hf_rsvp_ctype = -1; static int hf_rsvp_ctype_session = -1; static int hf_rsvp_ctype_scope = -1; static int hf_rsvp_ctype_label_request = -1; static int hf_rsvp_ctype_integrity = -1; static int hf_rsvp_ctype_adspec = -1; static int hf_rsvp_ctype_tspec = -1; static int hf_rsvp_ctype_call_id = -1; static int hf_rsvp_ctype_template = -1; static int hf_rsvp_ctype_style = -1; static int hf_rsvp_ctype_policy = -1; static int hf_rsvp_ctype_error = -1; static int hf_rsvp_ctype_attribute = -1; static int hf_rsvp_ctype_explicit_route = -1; static int hf_rsvp_ctype_secondary_explicit_route = -1; static int hf_rsvp_ctype_flowspec = -1; static int hf_rsvp_ctype_hop = -1; static int hf_rsvp_ctype_confirm = -1; static int hf_rsvp_ctype_time_values = -1; static int hf_rsvp_ctype_record_route = -1; static int hf_rsvp_ctype_secondary_record_route = -1; static int hf_rsvp_ctype_exclude_route = -1; static int hf_rsvp_ctype_message_id = -1; static int hf_rsvp_ctype_message_id_ack = -1; static int hf_rsvp_ctype_message_id_list = -1; static int hf_rsvp_ctype_hello = -1; static int hf_rsvp_ctype_dclass = -1; static int hf_rsvp_ctype_admin_status = -1; static int hf_rsvp_ctype_lsp_attributes = -1; static int hf_rsvp_ctype_label_set = -1; static int hf_rsvp_ctype_association = -1; static int hf_rsvp_ctype_tunnel_if_id = -1; static int hf_rsvp_ctype_3gpp_object = -1; static int hf_rsvp_ctype_restart_cap = -1; static int hf_rsvp_ctype_link_cap = -1; static int hf_rsvp_ctype_protection_info = -1; static int hf_rsvp_ctype_fast_reroute = -1; static int hf_rsvp_ctype_detour = -1; static int hf_rsvp_ctype_diffserv = -1; static int hf_rsvp_ctype_diffserv_aware_te = -1; static int hf_rsvp_ctype_vendor = -1; static int hf_rsvp_ctype_juniper = -1; static int hf_rsvp_ctype_unknown = -1; static int hf_rsvp_ctype_label = -1; static int hf_rsvp_ctype_notify_request = -1; static int hf_rsvp_ctype_generalized_uni = -1; static int hf_rsvp_parameter = -1; static int hf_rsvp_parameter_flags = -1; static int hf_rsvp_parameter_length = -1; static int hf_rsvp_error_value = -1; static int hf_rsvp_class = -1; static int hf_rsvp_class_length = -1; static int hf_rsvp_reserved = -1; static int hf_rsvp_switching_granularity = -1; static int hf_rsvp_callid_srcaddr_ether = -1; static int hf_rsvp_callid_srcaddr_bytes = -1; static int hf_rsvp_loose_hop = -1; static int hf_rsvp_data_length = -1; static int hf_rsvp_ctype_s2l_sub_lsp = -1; static int hf_rsvp_s2l_sub_lsp_destination_ipv4_address = -1; static int hf_rsvp_s2l_sub_lsp_destination_ipv6_address = -1; static int hf_rsvp_s2l_sub_lsp_data = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_rsvp_message_id_data = -1; static int hf_rsvp_ero_rro_subobjects_length = -1; static int hf_rsvp_fast_reroute_hop_limit = -1; static int hf_rsvp_lsp_tunnel_if_id_router_id = -1; static int hf_rsvp_ero_rro_subobjects_path_key = -1; static int hf_rsvp_ifid_tlv_area = -1; static int hf_rsvp_session_attribute_include_any = -1; static int hf_rsvp_lsp_tunnel_if_id_sc_pc_scn_address = -1; static int hf_rsvp_ero_rro_subobjects_ipv6_hop = -1; static int hf_rsvp_lsp_tunnel_if_id_ipv6_interface_address = -1; static int hf_rsvp_lsp_tunnel_if_id_component_link_identifier_ipv4 = -1; static int hf_rsvp_ifid_tlvinterface_id = -1; static int hf_rsvp_eth_tspec_cir = -1; static int hf_rsvp_confirm_receiver_address_ipv6 = -1; static int hf_rsvp_error_error_node_ipv6 = -1; static int hf_rsvp_time_values_data = -1; static int hf_rsvp_flowspec_rate = -1; static int hf_rsvp_session_attribute_hold_priority = -1; static int hf_rsvp_notify_request_notify_node_address_ipv4 = -1; static int hf_rsvp_lsp_tunnel_if_id_action = -1; static int hf_rsvp_scope_data = -1; static int hf_rsvp_label_request_l3pid = -1; static int hf_rsvp_eth_tspec_index = -1; static int hf_rsvp_integrity_sequence_number = -1; static int hf_rsvp_adspec_message_format_version = -1; static int hf_rsvp_fast_reroute_setup_priority = -1; static int hf_rsvp_eth_tspec_reserved = -1; static int hf_rsvp_eth_tspec_el2cp = -1; static int hf_rsvp_eth_tspec_il2cp = -1; static int hf_rsvp_fast_reroute_include_all = -1; static int hf_rsvp_association_routing_area_id = -1; static int hf_rsvp_label_label = -1; static int hf_rsvp_session_attribute_include_all = -1; static int hf_rsvp_flowspec_token_bucket_rate = -1; static int hf_rsvp_call_id_address_type = -1; static int hf_rsvp_session_attribute_name_length = -1; static int hf_rsvp_detour_data = -1; static int hf_rsvp_association_node_id = -1; static int hf_rsvp_ifid_tlv_length = -1; static int hf_rsvp_flags = -1; static int hf_rsvp_tspec_message_format_version = -1; static int hf_rsvp_ifid_tlv_ipv4_address = -1; static int hf_rsvp_hop_data = -1; static int hf_rsvp_ifid_tlv_data = -1; static int hf_rsvp_length = -1; static int hf_rsvp_ero_rro_subobjects_pce_id_ipv6 = -1; static int hf_rsvp_association_data = -1; static int hf_rsvp_tspec_number_of_multiplexed_components = -1; static int hf_rsvp_session_attribute_setup_priority = -1; static int hf_rsvp_message_id_flags = -1; static int hf_rsvp_hop_logical_interface = -1; static int hf_rsvp_compression_factor = -1; static int hf_rsvp_ero_rro_subobjects_private_data = -1; static int hf_rsvp_lsp_attributes_tlv_data = -1; static int hf_rsvp_flowspec_token_bucket_size = -1; static int hf_rsvp_call_id_data = -1; static int hf_rsvp_template_filter_source_address_ipv6 = -1; static int hf_rsvp_message_id_ack_flags = -1; static int hf_rsvp_flowspec_multiplier = -1; static int hf_rsvp_tspec_token_bucket_size = -1; static int hf_rsvp_admin_status_bits = -1; static int hf_rsvp_admin_status_data = -1; static int hf_rsvp_tspec_peak_data_rate = -1; static int hf_rsvp_flowspec_number_of_virtual_components = -1; static int hf_rsvp_hop_neighbor_address_ipv6 = -1; static int hf_rsvp_flowspec_signal_type_sonet = -1; static int hf_rsvp_ifid_tlv_autonomous_system = -1; static int hf_rsvp_scope_ipv6_address = -1; static int hf_rsvp_flowspec_service_header = -1; static int hf_rsvp_tspec_hint = -1; static int hf_rsvp_label_set_action = -1; static int hf_rsvp_error_data = -1; static int hf_rsvp_style_flags = -1; static int hf_rsvp_g_pid = -1; static int hf_rsvp_integrity_key_identifier = -1; static int hf_rsvp_adspec_service_header = -1; static int hf_rsvp_ifid_tlv_error_string = -1; static int hf_rsvp_session_destination_address = -1; static int hf_rsvp_ifid_tlv_node_id = -1; static int hf_rsvp_lsp_tunnel_if_id_component_link_identifier = -1; static int hf_rsvp_call_id_international_segment = -1; static int hf_rsvp_fast_reroute_include_any = -1; static int hf_rsvp_label_request_min_vci = -1; static int hf_rsvp_tspec_profile = -1; static int hf_rsvp_eth_tspec_length = -1; static int hf_rsvp_exclude_route_data = -1; static int hf_rsvp_record_route_data = -1; static int hf_rsvp_secondary_record_route_data = -1; static int hf_rsvp_confirm_receiver_address_ipv4 = -1; static int hf_rsvp_message_id_list_message_id = -1; static int hf_rsvp_template_filter_ipv4_tunnel_sender_address = -1; static int hf_rsvp_template_filter_ipv6_tunnel_sender_address = -1; static int hf_rsvp_template_filter_sub_group_originator_id = -1; static int hf_rsvp_template_filter_sub_group_id = -1; static int hf_rsvp_template_filter_data = -1; static int hf_rsvp_notify_request_notify_node_address_ipv6 = -1; static int hf_rsvp_message_id_ack_data = -1; static int hf_rsvp_eth_tspec_profile = -1; static int hf_rsvp_label_request_max_vpi = -1; static int hf_rsvp_ero_rro_subobjects_private_length = -1; static int hf_rsvp_fast_reroute_exclude_any = -1; static int hf_rsvp_lsp_tunnel_if_id_data = -1; static int hf_rsvp_hello_destination_instance = -1; static int hf_rsvp_tspec_signal_type_g709 = -1; static int hf_rsvp_call_id_reserved = -1; static int hf_rsvp_version = -1; static int hf_rsvp_association_source_ipv6 = -1; static int hf_rsvp_ero_rro_subobjects_flags = -1; static int hf_rsvp_lsp_tunnel_if_id_lsp_encoding_type = -1; static int hf_rsvp_association_type = -1; static int hf_rsvp_tspec_data = -1; static int hf_rsvp_session_destination_port = -1; static int hf_rsvp_association_id = -1; static int hf_rsvp_integrity_hash = -1; static int hf_rsvp_flowspec_number_of_contiguous_components = -1; static int hf_rsvp_policy_data = -1; static int hf_rsvp_tspec_token_bucket_rate = -1; static int hf_rsvp_tspec_multiplier = -1; static int hf_rsvp_dclass_dscp = -1; static int hf_rsvp_tspec_number_of_contiguous_components = -1; static int hf_rsvp_session_p2mp_id = -1; static int hf_rsvp_session_data = -1; static int hf_rsvp_lsp_tunnel_if_id_target_igp_instance = -1; static int hf_rsvp_flowspec_profile = -1; static int hf_rsvp_message_id_ack_epoch = -1; static int hf_rsvp_hello_source_instance = -1; static int hf_rsvp_scope_ipv4_address = -1; static int hf_rsvp_label_request_lsp_encoding_type = -1; static int hf_rsvp_fast_reroute_hold_priority = -1; static int hf_rsvp_label_request_max_vci = -1; static int hf_rsvp_fast_reroute_flags = -1; static int hf_rsvp_flowspec_peak_data_rate = -1; static int hf_rsvp_ero_rro_subobjects_label = -1; static int hf_rsvp_notify_request_data = -1; static int hf_rsvp_lsp_tunnel_if_id_connection_id = -1; static int hf_rsvp_eth_tspec_ebs = -1; static int hf_rsvp_fast_reroute_data = -1; static int hf_rsvp_label_request_min_vpi = -1; static int hf_rsvp_session_attribute_data = -1; static int hf_rsvp_protection_info_data = -1; static int hf_rsvp_tspec_transparency = -1; static int hf_rsvp_ifid_tlv_label = -1; static int hf_rsvp_session_extended_ipv4_address = -1; static int hf_rsvp_diffserv_aware_te_data = -1; static int hf_rsvp_lsp_tunnel_if_id_signal_type = -1; static int hf_rsvp_ero_rro_subobjects_pce_id_ipv4 = -1; static int hf_rsvp_error_error_node_ipv4 = -1; static int hf_rsvp_session_protocol = -1; static int hf_rsvp_tspec_signal_type_sonet = -1; static int hf_rsvp_session_attribute_flags = -1; static int hf_rsvp_ero_rro_subobjects_router_id = -1; static int hf_rsvp_message_id_list_data = -1; static int hf_rsvp_style_style = -1; static int hf_rsvp_tspec_number_of_virtual_components = -1; static int hf_rsvp_tspec_mtu = -1; static int hf_rsvp_lsp_tunnel_if_id_length = -1; static int hf_rsvp_ifid_tlv_ipv6_address = -1; static int hf_rsvp_diffserv_data = -1; static int hf_rsvp_session_flags = -1; static int hf_rsvp_flowspec_transparency = -1; static int hf_rsvp_dclass_data = -1; static int hf_rsvp_lsp_tunnel_if_id_interface_id = -1; static int hf_rsvp_lsp_tunnel_if_id_sc_pc_id = -1; static int hf_rsvp_error_error_code = -1; static int hf_rsvp_lsp_tunnel_if_id_ipv4_interface_address = -1; static int hf_rsvp_session_attribute_exclude_any = -1; static int hf_rsvp_sending_ttl = -1; static int hf_rsvp_integrity_flags = -1; static int hf_rsvp_message_id_ack_message_id = -1; static int hf_rsvp_message_id_message_id = -1; static int hf_rsvp_ero_rro_subobjects_interface_id = -1; static int hf_rsvp_message_length = -1; static int hf_rsvp_message_id_epoch = -1; static int hf_rsvp_flowspec_signal_type_g709 = -1; static int hf_rsvp_label_request_data = -1; static int hf_rsvp_restart_cap_data = -1; static int hf_rsvp_lsp_attributes_tlv = -1; static int hf_rsvp_flowspec_mtu = -1; static int hf_rsvp_flowspec_m = -1; static int hf_rsvp_tspec_service_header = -1; static int hf_rsvp_eth_tspec_cbs = -1; static int hf_rsvp_call_id_national_segment = -1; static int hf_rsvp_template_filter_source_port = -1; static int hf_rsvp_eth_tspec_eir = -1; static int hf_rsvp_ero_rro_subobjects_ipv4_hop = -1; static int hf_rsvp_lsp_tunnel_if_id_switching_type = -1; static int hf_rsvp_flowspec_number_of_multiplexed_components = -1; static int hf_rsvp_label_request_switching_type = -1; static int hf_rsvp_ero_rro_subobjects_prefix_length = -1; static int hf_rsvp_explicit_route_data = -1; static int hf_rsvp_secondary_explicit_route_data = -1; static int hf_rsvp_association_source_ipv4 = -1; static int hf_rsvp_call_id_local_identifier = -1; static int hf_rsvp_flowspec_message_format_version = -1; static int hf_rsvp_tspec_requested_concatenation = -1; static int hf_rsvp_association_padding = -1; static int hf_rsvp_hop_neighbor_address_ipv4 = -1; static int hf_rsvp_flowspec_requested_concatenation = -1; static int hf_rsvp_fast_reroute_bandwidth = -1; static int hf_rsvp_message_id_list_epoch = -1; static int hf_rsvp_style_data = -1; static int hf_rsvp_session_dscp = -1; static int hf_rsvp_confirm_data = -1; static int hf_rsvp_protection_info_link_flags = -1; static int hf_rsvp_message_id_list_flags = -1; static int hf_rsvp_label_data = -1; static int hf_rsvp_flowspec_slack_term = -1; static int hf_rsvp_label_generalized_label = -1; static int hf_rsvp_label_generalized_label_evpl_vlad_id = -1; static int hf_rsvp_session_attribute_name = -1; static int hf_rsvp_ifid_tlv_padding = -1; static int hf_rsvp_max_dlci = -1; static int hf_rsvp_minimum_policed_unit = -1; static int hf_rsvp_dlci_length = -1; static int hf_rsvp_label_request_m = -1; static int hf_rsvp_detour_avoid_node_id = -1; static int hf_rsvp_restart_cap_restart_time = -1; static int hf_rsvp_nsap_length = -1; static int hf_rsvp_message_checksum = -1; static int hf_rsvp_ero_rro_autonomous_system = -1; static int hf_rsvp_gen_uni_service_level = -1; static int hf_rsvp_hf_rsvp_adspec_break_bit = -1; static int hf_rsvp_extended_tunnel_id = -1; static int hf_rsvp_extended_tunnel_ipv6 = -1; static int hf_rsvp_maximum_packet_size = -1; static int hf_rsvp_min_dlci = -1; static int hf_rsvp_gen_uni_data = -1; static int hf_rsvp_gen_uni_logical_port_id = -1; static int hf_rsvp_refresh_interval = -1; static int hf_rsvp_detour_plr_id = -1; static int hf_rsvp_restart_cap_recovery_time = -1; static int hf_rsvp_extended_tunnel = -1; static int hf_rsvp_call_attributes_endpont_id = -1; static int hf_rsvp_isis_area_id = -1; static int hf_rsvp_adspec_type = -1; static int hf_rsvp_adspec_len = -1; static int hf_rsvp_adspec_uint = -1; static int hf_rsvp_adspec_float = -1; static int hf_rsvp_adspec_bytes = -1; static int hf_rsvp_wavelength_grid = -1; static int hf_rsvp_wavelength_cs1 = -1; static int hf_rsvp_wavelength_cs2 = -1; static int hf_rsvp_wavelength_cs3 = -1; static int hf_rsvp_wavelength_channel_spacing = -1; static int hf_rsvp_wavelength_n = -1; static int hf_rsvp_wavelength_m = -1; static int hf_rsvp_wavelength_freq = -1; static int hf_rsvp_wavelength_wavelength = -1; static int hf_rsvp_sonet_s = -1; static int hf_rsvp_sonet_u = -1; static int hf_rsvp_sonet_k = -1; static int hf_rsvp_sonet_l = -1; static int hf_rsvp_sonet_m = -1; static int hf_rsvp_g709_t3 = -1; static int hf_rsvp_g709_t2 = -1; static int hf_rsvp_g709_t1 = -1; static int hf_rsvp_label_set_type = -1; static int hf_rsvp_label_set_subchannel = -1; static int hf_rsvp_nsap_address = -1; static int hf_rsvp_class_diversity = -1; static int hf_rsvp_egress_label_type = -1; static int hf_rsvp_egress_label = -1; static int hf_rsvp_source_transport_network_addr = -1; static int hf_rsvp_ie_data = -1; static int hf_rsvp_3gpp_obj_pf_dst_port_range = -1; static int hf_rsvp_3gpp_obj_pf_src_port_range = -1; static expert_field ei_rsvp_invalid_length = EI_INIT; static expert_field ei_rsvp_packet_filter_component = EI_INIT; static expert_field ei_rsvp_bundle_component_msg = EI_INIT; static expert_field ei_rsvp_parameter = EI_INIT; static expert_field ei_rsvp_adspec_type = EI_INIT; static expert_field ei_rsvp_call_id_address_type = EI_INIT; static expert_field ei_rsvp_session_type = EI_INIT; static int rsvp_tap = -1; /* * All RSVP packets belonging to a particular flow belong to the same * conversation. The following structure definitions are for auxillary * structures which have all the relevant flow information to make up the * RSVP five-tuple. Note that the values of the five-tuple are determined * from the session object and sender template/filter spec for PATH/RESV * messages. * Update rsvp_request_equal() when you add stuff here. You might also * have to update rsvp_request_hash(). * TODO: Support for IPv6 conversations. */ typedef struct rsvp_session_ipv4_info { address destination; guint8 protocol; guint16 udp_dest_port; } rsvp_session_ipv4_info; typedef struct rsvp_session_ipv6_info { /* not supported yet */ guint8 dummy; } rsvp_session_ipv6_info; typedef struct rsvp_session_ipv4_lsp_info { address destination; guint16 udp_dest_port; guint32 ext_tunnel_id; } rsvp_session_ipv4_lsp_info; typedef struct rsvp_session_ipv6_lsp_info { address destination; guint16 udp_dest_port; guint64 ext_tunnel_id; } rsvp_session_ipv6_lsp_info; typedef struct rsvp_session_agg_ipv4_info { address destination; guint8 dscp; } rsvp_session_agg_ipv4_info; typedef struct rsvp_session_ipv4_uni_info { address destination; guint16 udp_dest_port; guint32 ext_tunnel_id; } rsvp_session_ipv4_uni_info; typedef struct rsvp_session_ipv4_p2mp_lsp_info { address destination; guint16 udp_dest_port; guint32 ext_tunnel_id; } rsvp_session_ipv4_p2mp_lsp_info; typedef struct rsvp_session_ipv6_p2mp_lsp_info { address destination; guint16 udp_dest_port; guint64 ext_tunnel_id; } rsvp_session_ipv6_p2mp_lsp_info; typedef struct rsvp_session_ipv4_enni_info { address destination; guint16 udp_dest_port; guint32 ext_tunnel_id; } rsvp_session_ipv4_enni_info; typedef struct rsvp_template_filter_info { address source; guint16 udp_source_port; } rsvp_template_filter_info; /* * The actual request key consists of a union of the various session objects * (which are uniquely identified based on the session type), and the * source_info structure, which has the information derived from the sender * template or the filter spec. * The request key is populated by copying the information from the * rsvp_conversation_info structure (rsvph), which in turn is populated when * the session, filter and sender template objects are dissected. */ struct rsvp_request_key { guint32 session_type; union { /* differentiated by session_type field */ rsvp_session_ipv4_info session_ipv4; rsvp_session_ipv6_info session_ipv6; rsvp_session_ipv4_lsp_info session_ipv4_lsp; rsvp_session_ipv6_lsp_info session_ipv6_lsp; rsvp_session_agg_ipv4_info session_agg_ipv4; rsvp_session_ipv4_uni_info session_ipv4_uni; rsvp_session_ipv4_p2mp_lsp_info session_ipv4_p2mp_lsp; rsvp_session_ipv6_p2mp_lsp_info session_ipv6_p2mp_lsp; rsvp_session_ipv4_enni_info session_ipv4_enni; } u; rsvp_template_filter_info source_info; guint32 conversation; }; /* * At present, there is nothing particularly important that we need to * store for the request value for each rsvp_request_key, so we just * store the unique 32-bit identifier internally allocated for the key * (and stored in the conversation attribute of rsvp_request_key above. * If this changes in the future, then other stuff can be added here. */ struct rsvp_request_val { guint32 value; }; /* * Initialize the conversation related data structures. */ static wmem_map_t *rsvp_request_hash = NULL; /* * The list of tree types */ enum { TT_RSVP, TT_HDR, TT_SESSION, TT_HOP, TT_HOP_SUBOBJ, TT_TIME_VALUES, TT_ERROR, TT_ERROR_SUBOBJ, TT_ERROR_FLAGS, TT_SCOPE, TT_STYLE, TT_CONFIRM, TT_SENDER_TEMPLATE, TT_FILTER_SPEC, TT_TSPEC, TT_TSPEC_SUBTREE, TT_FLOWSPEC, TT_FLOWSPEC_SUBTREE, TT_ETHSPEC_SUBTREE, TT_ADSPEC, TT_ADSPEC_SUBTREE, TT_INTEGRITY, TT_INTEGRITY_FLAGS, TT_DCLASS, TT_LSP_TUNNEL_IF_ID, TT_LSP_TUNNEL_IF_ID_SUBTREE, TT_POLICY, TT_MESSAGE_ID, TT_MESSAGE_ID_ACK, TT_MESSAGE_ID_LIST, TT_LABEL, TT_LABEL_SET, TT_LABEL_REQUEST, TT_SESSION_ATTRIBUTE, TT_SESSION_ATTRIBUTE_FLAGS, TT_HELLO_OBJ, TT_EXPLICIT_ROUTE, TT_EXPLICIT_ROUTE_SUBOBJ, TT_EXCLUDE_ROUTE, TT_EXCLUDE_ROUTE_SUBOBJ, TT_RECORD_ROUTE, TT_RECORD_ROUTE_SUBOBJ, TT_RECORD_ROUTE_SUBOBJ_FLAGS, TT_ADMIN_STATUS, TT_ADMIN_STATUS_FLAGS, TT_LSP_ATTRIBUTES, TT_LSP_ATTRIBUTES_FLAGS, TT_ASSOCIATION, TT_GEN_UNI, TT_GEN_UNI_SUBOBJ, TT_CALL_ID, TT_3GPP2_OBJECT, TT_BUNDLE_COMPMSG, TT_RESTART_CAP, TT_LINK_CAP, TT_PROTECTION_INFO, TT_PROTECTION_INFO_LINK, TT_PROTECTION_INFO_LSP, TT_PROTECTION_INFO_SEG, TT_FAST_REROUTE, TT_FAST_REROUTE_FLAGS, TT_DETOUR, TT_DIFFSERV, TT_DIFFSERV_MAP, TT_DIFFSERV_MAP_PHBID, TT_CLASSTYPE, TT_PRIVATE_CLASS, TT_JUNIPER, TT_UNKNOWN_CLASS, TT_3GPP_OBJ_FLOW, TT_3GPP_OBJ_QOS, TT_3GPP_OBJ_QOS_SUB_BLOB, TT_3GPP_OBJ_T2, TT_3GPP_OBJ_HO, TT_ADSPEC_TYPE_SUBTREE, TT_WAVELENGTH, TT_SONET_SDH, TT_G709, TT_RSVP_LSP_ATTR, TT_MAX }; static gint ett_treelist[TT_MAX]; #define TREE(X) ett_treelist[(X)] /* Should we dissect bundle messages? */ static gboolean rsvp_bundle_dissect = TRUE; /* FF: How should we dissect generalized label? */ static const enum_val_t rsvp_generalized_label_options[] = { /* see RFC 3471 Section 3.2.1.2 */ { "data", "data (no interpretation)", 1 }, /* see RFC 4606 Section 3 */ { "SUKLM", "SONET/SDH (\"S, U, K, L, M\" scheme)", 2 }, /* see I-D draft-ietf-ccamp-gmpls-g-694-lambda-labels-05 */ { "G694", "Wavelength Label (fixed or flexi grid)", 3 }, /* see RFC 4328 Section 4.1 */ { "G709", "ODUk Label", 4 }, { NULL, NULL, 0 } }; static guint rsvp_generalized_label_option = 1; /* * RSVP message types. * See * * http://www.iana.org/assignments/rsvp-parameters */ typedef enum { RSVP_MSG_PATH = 1, /* RFC 2205 */ RSVP_MSG_RESV, /* RFC 2205 */ RSVP_MSG_PERR, /* RFC 2205 */ RSVP_MSG_RERR, /* RFC 2205 */ RSVP_MSG_PTEAR, /* RFC 2205 */ RSVP_MSG_RTEAR, /* RFC 2205 */ RSVP_MSG_CONFIRM, /* XXX - DREQ, RFC 2745? */ /* 9 is DREP, RFC 2745 */ RSVP_MSG_RTEAR_CONFIRM = 10, /* from Fred Baker at Cisco */ /* 11 is unassigned */ RSVP_MSG_BUNDLE = 12, /* RFC 2961 */ RSVP_MSG_ACK, /* RFC 2961 */ /* 14 is reserved */ RSVP_MSG_SREFRESH = 15, /* RFC 2961 */ /* 16, 17, 18, 19 not listed */ RSVP_MSG_HELLO = 20, /* RFC 3209 */ RSVP_MSG_NOTIFY /* [RFC3473] */ /* 25 is Integrity Challenge RFC 2747, RFC 3097 */ /* 26 is Integrity Response RFC 2747, RFC 3097 */ /* 66 is DSBM_willing [SBM] */ /* 67 is I_AM_DSBM [SBM] */ /* [SBM] is Subnet Bandwidth Manager ID from July 1997 */ } rsvp_message_types; static const value_string message_type_vals[] = { { RSVP_MSG_PATH, "PATH Message. "}, { RSVP_MSG_RESV, "RESV Message. "}, { RSVP_MSG_PERR, "PATH ERROR Message. "}, { RSVP_MSG_RERR, "RESV ERROR Message. "}, { RSVP_MSG_PTEAR, "PATH TEAR Message. "}, { RSVP_MSG_RTEAR, "RESV TEAR Message. "}, { RSVP_MSG_CONFIRM, "CONFIRM Message. "}, { RSVP_MSG_RTEAR_CONFIRM, "RESV TEAR CONFIRM Message. "}, { RSVP_MSG_BUNDLE, "BUNDLE Message. "}, { RSVP_MSG_ACK, "ACK Message. "}, { RSVP_MSG_SREFRESH, "SREFRESH Message. "}, { RSVP_MSG_HELLO, "HELLO Message. "}, { RSVP_MSG_NOTIFY, "NOTIFY Message. "}, { 0, NULL} }; static value_string_ext message_type_vals_ext = VALUE_STRING_EXT_INIT(message_type_vals); /* * FF: please keep this list in sync with * http://www.iana.org/assignments/rsvp-parameters * Registry Name: 'Class' */ enum rsvp_classes { RSVP_CLASS_NULL = 0, RSVP_CLASS_SESSION, RSVP_CLASS_HOP = 3, RSVP_CLASS_INTEGRITY, RSVP_CLASS_TIME_VALUES, RSVP_CLASS_ERROR, RSVP_CLASS_SCOPE, RSVP_CLASS_STYLE, RSVP_CLASS_FLOWSPEC, RSVP_CLASS_FILTER_SPEC, RSVP_CLASS_SENDER_TEMPLATE, RSVP_CLASS_SENDER_TSPEC, RSVP_CLASS_ADSPEC, RSVP_CLASS_POLICY, RSVP_CLASS_CONFIRM, RSVP_CLASS_LABEL, RSVP_CLASS_HOP_COUNT, RSVP_CLASS_STRICT_SOURCE_ROUTE, RSVP_CLASS_LABEL_REQUEST = 19, RSVP_CLASS_EXPLICIT_ROUTE, RSVP_CLASS_RECORD_ROUTE, RSVP_CLASS_HELLO, RSVP_CLASS_MESSAGE_ID, RSVP_CLASS_MESSAGE_ID_ACK, RSVP_CLASS_MESSAGE_ID_LIST, /* 26-29 Unassigned */ RSVP_CLASS_DIAGNOSTIC = 30, RSVP_CLASS_ROUTE, RSVP_CLASS_DIAG_RESPONSE, RSVP_CLASS_DIAG_SELECT, RSVP_CLASS_RECOVERY_LABEL, RSVP_CLASS_UPSTREAM_LABEL, RSVP_CLASS_LABEL_SET, RSVP_CLASS_PROTECTION, /* 38-41 Unassigned */ RSVP_CLASS_DSBM_IP_ADDRESS = 42, RSVP_CLASS_SBM_PRIORITY, RSVP_CLASS_DSBM_TIMER_INTERVALS, RSVP_CLASS_SBM_INFO, /* 46-49 Unassigned */ RSVP_CLASS_S2L_SUB_LSP = 50, /* 51-62 Unassigned */ RSVP_CLASS_DETOUR = 63, RSVP_CLASS_CHALLENGE, RSVP_CLASS_DIFFSERV, RSVP_CLASS_CLASSTYPE, /* FF: RFC4124 */ RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES = 67, /* 68-123 Unassigned */ RSVP_CLASS_VENDOR_PRIVATE_1 = 124, RSVP_CLASS_VENDOR_PRIVATE_2 = 125, RSVP_CLASS_VENDOR_PRIVATE_3 = 126, RSVP_CLASS_VENDOR_PRIVATE_4 = 127, RSVP_CLASS_NODE_CHAR = 128, RSVP_CLASS_SUGGESTED_LABEL, RSVP_CLASS_ACCEPTABLE_LABEL_SET, RSVP_CLASS_RESTART_CAP, RSVP_CLASS_LINK_CAP = 133, /* 132-160 Unassigned */ /* 166-187 Unassigned */ RSVP_CLASS_VENDOR_PRIVATE_5 = 188, RSVP_CLASS_VENDOR_PRIVATE_6 = 189, RSVP_CLASS_VENDOR_PRIVATE_7 = 190, RSVP_CLASS_VENDOR_PRIVATE_8 = 191, RSVP_CLASS_SESSION_ASSOC = 192, RSVP_CLASS_LSP_TUNNEL_IF_ID, /* 194 Unassigned */ RSVP_CLASS_NOTIFY_REQUEST = 195, RSVP_CLASS_ADMIN_STATUS, RSVP_CLASS_LSP_ATTRIBUTES, RSVP_CLASS_ALARM_SPEC, RSVP_CLASS_ASSOCIATION, RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE, RSVP_CLASS_SECONDARY_RECORD_ROUTE, RSVP_CLASS_CALL_ATTRIBUTES, /* 203-204 Unassigned */ /* 204 Proprietary Juniper LSP properties https://www.juniper.net/techpubs/en_US/junos12.1/information-products/topic-collections/nog-mpls-logs/topic-20284.html */ RSVP_CLASS_JUNIPER_PROPERTIES = 204, RSVP_CLASS_FAST_REROUTE = 205, /* 206 Unassigned */ RSVP_CLASS_SESSION_ATTRIBUTE = 207, /* 208-223 Unassigned */ /* Class Numbers 224-255 are assigned by IANA using FCFS allocation. RSVP will silently ignore, but FORWARD an object with a Class Number in this range that it does not understand. */ /* 224 Unassigned */ RSVP_CLASS_DCLASS = 225, RSVP_CLASS_PACKETCABLE_EXTENSIONS, RSVP_CLASS_ATM_SERVICECLASS, RSVP_CLASS_CALL_OPS, RSVP_CLASS_GENERALIZED_UNI, RSVP_CLASS_CALL_ID, RSVP_CLASS_3GPP2_OBJECT, RSVP_CLASS_EXCLUDE_ROUTE, /* 233-251 Unassigned */ RSVP_CLASS_VENDOR_PRIVATE_9 = 252, RSVP_CLASS_VENDOR_PRIVATE_10 = 253, RSVP_CLASS_VENDOR_PRIVATE_11 = 254, RSVP_CLASS_VENDOR_PRIVATE_12 = 255 }; /* XXX: are any/all of the "missing" values below supposed to have value-strings */ static const value_string rsvp_class_vals[] = { { RSVP_CLASS_NULL, "NULL object"}, { RSVP_CLASS_SESSION, "SESSION object"}, { RSVP_CLASS_HOP, "HOP object"}, { RSVP_CLASS_INTEGRITY, "INTEGRITY object"}, { RSVP_CLASS_TIME_VALUES, "TIME VALUES object"}, { RSVP_CLASS_ERROR, "ERROR object"}, { RSVP_CLASS_SCOPE, "SCOPE object"}, { RSVP_CLASS_STYLE, "STYLE object"}, { RSVP_CLASS_FLOWSPEC, "FLOWSPEC object"}, { RSVP_CLASS_FILTER_SPEC, "FILTER SPEC object"}, { RSVP_CLASS_SENDER_TEMPLATE, "SENDER TEMPLATE object"}, { RSVP_CLASS_SENDER_TSPEC, "SENDER TSPEC object"}, { RSVP_CLASS_ADSPEC, "ADSPEC object"}, { RSVP_CLASS_POLICY, "POLICY object"}, { RSVP_CLASS_CONFIRM, "CONFIRM object"}, { RSVP_CLASS_LABEL, "LABEL object"}, { RSVP_CLASS_HOP_COUNT, "HOP_COUNT object"}, { RSVP_CLASS_STRICT_SOURCE_ROUTE, "STRICT_SOURCE_ROUTE object"}, { RSVP_CLASS_LABEL_REQUEST, "LABEL REQUEST object"}, { RSVP_CLASS_EXPLICIT_ROUTE, "EXPLICIT ROUTE object"}, { RSVP_CLASS_RECORD_ROUTE, "RECORD ROUTE object"}, { RSVP_CLASS_HELLO, "HELLO object"}, { RSVP_CLASS_MESSAGE_ID, "MESSAGE-ID object"}, { RSVP_CLASS_MESSAGE_ID_ACK, "MESSAGE-ID ACK/NACK object"}, { RSVP_CLASS_MESSAGE_ID_LIST, "MESSAGE-ID LIST object"}, /* RSVP_CLASS_DIAGNOSTIC RSVP_CLASS_ROUTE, RSVP_CLASS_DIAG_RESPONSE, RSVP_CLASS_DIAG_SELECT, */ { RSVP_CLASS_RECOVERY_LABEL, "RECOVERY-LABEL object"}, { RSVP_CLASS_UPSTREAM_LABEL, "UPSTREAM-LABEL object"}, { RSVP_CLASS_LABEL_SET, "LABEL-SET object"}, { RSVP_CLASS_PROTECTION, "PROTECTION object"}, /* RSVP_CLASS_DSBM_IP_ADDRESS RSVP_CLASS_SBM_PRIORITY, RSVP_CLASS_DSBM_TIMER_INTERVALS, RSVP_CLASS_SBM_INFO, */ { RSVP_CLASS_S2L_SUB_LSP, "S2L_SUB_LSP object"}, { RSVP_CLASS_DETOUR, "DETOUR object"}, /* RSVP_CLASS_CHALLENGE, */ { RSVP_CLASS_DIFFSERV, "DIFFSERV object"}, { RSVP_CLASS_CLASSTYPE, "CLASSTYPE object"}, { RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES, "LSP REQUIRED ATTRIBUTES object"}, { RSVP_CLASS_VENDOR_PRIVATE_1, "VENDOR PRIVATE object (0bbbbbbb: " "reject if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_2, "VENDOR PRIVATE object (0bbbbbbb: " "reject if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_3, "VENDOR PRIVATE object (0bbbbbbb: " "reject if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_4, "VENDOR PRIVATE object (0bbbbbbb: " "reject if unknown)"}, /* RSVP_CLASS_NODE_CHAR */ { RSVP_CLASS_SUGGESTED_LABEL, "SUGGESTED-LABEL object"}, { RSVP_CLASS_ACCEPTABLE_LABEL_SET, "ACCEPTABLE-LABEL-SET object"}, { RSVP_CLASS_RESTART_CAP, "RESTART-CAPABILITY object"}, { RSVP_CLASS_LINK_CAP, "LINK-CAPABILITY object"}, { RSVP_CLASS_VENDOR_PRIVATE_5, "VENDOR PRIVATE object (10bbbbbb: " "ignore if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_6, "VENDOR PRIVATE object (10bbbbbb: " "ignore if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_7, "VENDOR PRIVATE object (10bbbbbb: " "ignore if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_8, "VENDOR PRIVATE object (10bbbbbb: " "ignore if unknown)"}, /* RSVP_CLASS_SESSION_ASSOC */ { RSVP_CLASS_LSP_TUNNEL_IF_ID, "LSP-TUNNEL INTERFACE-ID object"}, { RSVP_CLASS_NOTIFY_REQUEST, "NOTIFY-REQUEST object"}, { RSVP_CLASS_ADMIN_STATUS, "ADMIN-STATUS object"}, { RSVP_CLASS_LSP_ATTRIBUTES, "LSP ATTRIBUTES object"}, /* RSVP_CLASS_ALARM_SPEC, */ { RSVP_CLASS_ASSOCIATION, "ASSOCIATION object"}, { RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE, "SECONDARY EXPLICIT ROUTE object"}, { RSVP_CLASS_SECONDARY_RECORD_ROUTE, "SECONDARY RECORD ROUTE object"}, { RSVP_CLASS_CALL_ATTRIBUTES, "CALL ATTRIBUTES object"}, { RSVP_CLASS_JUNIPER_PROPERTIES, "Juniper properties object"}, { RSVP_CLASS_FAST_REROUTE, "FAST-REROUTE object"}, { RSVP_CLASS_SESSION_ATTRIBUTE, "SESSION ATTRIBUTE object"}, { RSVP_CLASS_DCLASS, "DCLASS object"}, /* RSVP_CLASS_PACKETCABLE_EXTENSIONS, RSVP_CLASS_ATM_SERVICECLASS, RSVP_CLASS_CALL_OPS, */ { RSVP_CLASS_GENERALIZED_UNI, "GENERALIZED-UNI object"}, { RSVP_CLASS_CALL_ID, "CALL-ID object"}, { RSVP_CLASS_3GPP2_OBJECT, "3GPP2 object"}, { RSVP_CLASS_EXCLUDE_ROUTE, "EXCLUDE ROUTE object"}, { RSVP_CLASS_VENDOR_PRIVATE_9, "VENDOR PRIVATE object (11bbbbbb: " "forward if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_10, "VENDOR PRIVATE object (11bbbbbb: " "forward if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_11, "VENDOR PRIVATE object (11bbbbbb: " "forward if unknown)"}, { RSVP_CLASS_VENDOR_PRIVATE_12, "VENDOR PRIVATE object (11bbbbbb: " "forward if unknown)"}, { 0, NULL} }; static value_string_ext rsvp_class_vals_ext = VALUE_STRING_EXT_INIT(rsvp_class_vals); /* * RSVP error values */ enum rsvp_error_types { RSVP_ERROR_CONFIRM = 0, RSVP_ERROR_ADMISSION, RSVP_ERROR_POLICY, RSVP_ERROR_NO_PATH, RSVP_ERROR_NO_SENDER, RSVP_ERROR_CONFLICT_RESV_STYLE, RSVP_ERROR_UNKNOWN_RESV_STYLE, RSVP_ERROR_CONFLICT_DEST_PORTS, RSVP_ERROR_CONFLICT_SRC_PORTS, /* 9-11 Reserved */ RSVP_ERROR_PREEMPTED =12, RSVP_ERROR_UNKNOWN_CLASS, RSVP_ERROR_UNKNOWN_C_TYPE, /* 15-19 Reserved */ RSVP_ERROR_RES_FOR_API = 20, RSVP_ERROR_TRAFFIC, RSVP_ERROR_TRAFFIC_SYSTEM, RSVP_ERROR_SYSTEM, RSVP_ERROR_ROUTING, RSVP_ERROR_NOTIFY, RSVP_ERROR_NEW_AGGR, /* RFC3175 */ RSVP_ERROR_DIFFSERV, RSVP_ERROR_DSTE, /* RFC4124 */ RSVP_ERROR_UNKNOWN_ATTR_TLV, /* RFC5420 */ RSVP_ERROR_UNKNOWN_ATTR_BIT, /* RFC5420 */ RSVP_ERROR_ALARMS, /* RFC4783 */ RSVP_ERROR_CALL_MGMT, /* RFC4974 */ RSVP_ERROR_USER_ERROR_SPEC, /* RFC5284 */ RSVP_ERROR_REROUTE, /* RFC5710 */ RSVP_ERROR_HO_PROC_FAIL, /* RFC5852 */ RSVP_ERROR_UNREC_REC_PROXY_ERR, /* RFC5946 */ RSVP_ERROR_RSVP_OVER_MPLS_PROB, /* RFC6016 */ RSVP_ERROR_LSP_HIER_ISSUE, /* RFC6107 */ RSVP_ERROR_VCAT_CALL_MGMT /* RFC6344 */ }; static const value_string rsvp_error_codes[] = { { RSVP_ERROR_CONFIRM, "Confirmation"}, { RSVP_ERROR_ADMISSION, "Admission Control Failure "}, { RSVP_ERROR_POLICY, "Policy Control Failure"}, { RSVP_ERROR_NO_PATH, "No PATH information for this RESV message"}, { RSVP_ERROR_NO_SENDER, "No sender information for this RESV message"}, { RSVP_ERROR_CONFLICT_RESV_STYLE, "Conflicting reservation styles"}, { RSVP_ERROR_UNKNOWN_RESV_STYLE, "Unknown reservation style"}, { RSVP_ERROR_CONFLICT_DEST_PORTS, "Conflicting destination ports"}, { RSVP_ERROR_CONFLICT_SRC_PORTS, "Conflicting source ports"}, { RSVP_ERROR_PREEMPTED, "Service preempted"}, { RSVP_ERROR_UNKNOWN_CLASS, "Unknown object class"}, { RSVP_ERROR_UNKNOWN_C_TYPE, "Unknown object C-type"}, { RSVP_ERROR_RES_FOR_API, "Reserved for API"}, { RSVP_ERROR_TRAFFIC, "Traffic Control Error"}, { RSVP_ERROR_TRAFFIC_SYSTEM, "Traffic Control System Error"}, { RSVP_ERROR_SYSTEM, "RSVP System Error"}, { RSVP_ERROR_ROUTING, "Routing Error"}, { RSVP_ERROR_NOTIFY, "RSVP Notify Error"}, { RSVP_ERROR_NEW_AGGR, "New aggregate needed"}, { RSVP_ERROR_DIFFSERV, "RSVP Diff-Serv Error"}, { RSVP_ERROR_DSTE, "RSVP DiffServ-aware TE Error"}, { RSVP_ERROR_UNKNOWN_ATTR_TLV, "Unknown attributes TLV"}, { RSVP_ERROR_UNKNOWN_ATTR_BIT, "Unknown attributes bit"}, { RSVP_ERROR_ALARMS, "Alarms"}, { RSVP_ERROR_CALL_MGMT, "Call management"}, { RSVP_ERROR_USER_ERROR_SPEC, "User error spec"}, { RSVP_ERROR_REROUTE, "Reroute"}, { RSVP_ERROR_HO_PROC_FAIL, "Handover Procedure Failure"}, { RSVP_ERROR_UNREC_REC_PROXY_ERR, "Unrecoverable Receiver Proxy Error"}, { RSVP_ERROR_RSVP_OVER_MPLS_PROB, "RSVP over MPLS Problem"}, { RSVP_ERROR_LSP_HIER_ISSUE, "LSP Hierarchy Issue"}, { RSVP_ERROR_VCAT_CALL_MGMT, "VCAT Call Management"}, { 0, NULL} }; static value_string_ext rsvp_error_codes_ext = VALUE_STRING_EXT_INIT(rsvp_error_codes); static const value_string rsvp_admission_control_error_vals[] = { { 1, "Delay bound cannot be met"}, { 2, "Requested bandwidth unavailable"}, { 3, "MTU in flowspec larger than interface MTU"}, { 4, "LSP Admission Failure"}, { 5, "Bad Association Type"}, { 0, NULL} }; static value_string_ext rsvp_admission_control_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_admission_control_error_vals); static const value_string rsvp_policy_control_error_vals[] = { { 0, "Information reporting"}, { 1, "Warning"}, { 2, "Reason unknown"}, { 3, "Generic Policy Rejection"}, { 4, "Quota or Accounting violation"}, { 5, "Flow was preempted"}, { 6, "Previously installed policy expired (not refreshed)"}, { 7, "Previous policy data was replaced & caused rejection"}, { 8, "Policies could not be merged (multicast)"}, { 9, "PDP down or non functioning"}, { 10, "Third Party Server (e.g., Kerberos) unavailable"}, { 11, "POLICY_DATA object has bad syntax"}, { 12, "POLICY_DATA object failed Integrity Check"}, { 13, "POLICY_ELEMENT object has bad syntax"}, { 14, "Mandatory PE Missing (Empty PE is in the PD object)"}, { 15, "PEP Out of resources to handle policies."}, { 16, "PDP encountered bad RSVP objects or syntax"}, { 17, "Service type was rejected"}, { 18, "Reservation Style was rejected"}, { 19, "FlowSpec was rejected (too large)"}, { 20, "Hard Pre-empted"}, { 21, "SRLG Recording Rejected"}, { 100, "Unauthorized sender"}, { 101, "Unauthorized receiver"}, { 102, "ERR_PARTIAL_PREEMPT"}, { 103, "Inter-domain policy failure"}, { 104, "Inter-domain explicit route rejected"}, { 0, NULL} }; static value_string_ext rsvp_policy_control_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_policy_control_error_vals); static const value_string rsvp_traffic_control_error_vals[] = { { 1, "Service conflict"}, { 2, "Service unsupported"}, { 3, "Bad Flowspec value"}, { 4, "Bad Tspec value"}, { 5, "Bad Adspec value"}, { 0, NULL} }; static value_string_ext rsvp_traffic_control_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_traffic_control_error_vals); static const value_string rsvp_routing_error_vals[] = { { 1, "Bad EXPLICIT_ROUTE object"}, { 2, "Bad strict node"}, { 3, "Bad loose node"}, { 4, "Bad initial subobject"}, { 5, "No route available toward destination"}, { 6, "Unacceptable label value"}, { 7, "RRO indicated routing loops"}, { 8, "non-RSVP-capable router stands in the path"}, { 9, "MPLS label allocation failure"}, { 10, "Unsupported L3PID"}, { 11, "Label Set"}, { 12, "Switching Type"}, { 13, "Unassigned"}, { 14, "Unsupported Encoding"}, { 15, "Unsupported Link Protection"}, { 16, "Unknown Interface Index"}, { 17, "Unsupported LSP Protection"}, { 18, "PROTECTION object not applicable"}, { 19, "Bad PRIMARY_PATH_ROUTE object"}, { 20, "PRIMARY_PATH_ROUTE object not applicable"}, { 21, "LSP Segment Protection Failed"}, { 22, "Re-routing limit exceeded"}, { 23, "Unable to Branch"}, { 24, "Unsupported LSP Integrity"}, { 25, "P2MP Re-Merge Detected"}, { 26, "P2MP Re-Merge Parameter Mismatch"}, { 27, "ERO Resulted in Re-Merge"}, { 28, "Contiguous LSP type not supported"}, { 29, "ERO conflicts with inter-domain signaling method"}, { 30, "Stitching unsupported"}, { 31, "Unknown PCE-ID for PKS expansion"}, { 32, "Unreachable PCE for PKS expansion"}, { 33, "Unknown Path Key for PKS expansion"}, { 34, "ERO too large for MTU"}, { 64, "Unsupported Exclude Route Subobject Type"}, { 65, "Inconsistent Subobject"}, { 66, "Local Node in Exclude Route"}, { 67, "Route Blocked by Exclude Route"}, { 68, "XRO Too Complex"}, { 69, "EXRS Too Complex"}, { 100, "Diversity not available"}, { 101, "Service level not available"}, { 102, "Invalid/Unknown connection ID"}, { 103, "No route available toward source (ASON)"}, { 104, "Unacceptable interface ID (ASON)"}, { 105, "Invalid/unknown call ID (ASON)"}, { 106, "Invalid SPC interface ID/label (ASON)"}, { 0, NULL} }; static value_string_ext rsvp_routing_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_routing_error_vals); static const value_string rsvp_notify_error_vals[] = { { 1, "RRO too large for MTU"}, { 2, "RRO Notification"}, { 3, "Tunnel locally repaired"}, { 4, "Control Channel Active State"}, { 5, "Control Channel Degraded State"}, { 6, "Preferable path exists"}, { 7, "Link maintenance required"}, { 8, "Node maintenance required"}, { 9, "LSP Failure"}, { 10, "LSP recovered"}, { 11, "LSP Local Failure"}, { 12, "No OOB mapping received"}, { 0, NULL} }; static value_string_ext rsvp_notify_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_notify_error_vals); static const value_string rsvp_diffserv_error_vals[] = { { 1, "Unexpected DIFFSERV object"}, { 2, "Unsupported PHB"}, { 3, "Invalid `EXP<->PHB mapping'"}, { 4, "Unsupported PSC"}, { 5, "Per-LSP context allocation failure"}, { 0, NULL} }; static value_string_ext rsvp_diffserv_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_diffserv_error_vals); /* FF: RFC4124 */ static const value_string rsvp_diffserv_aware_te_error_vals[] = { { 1, "Unexpected CLASSTYPE object"}, { 2, "Unsupported Class-Type"}, { 3, "Invalid Class-Type value"}, { 4, "CT and setup priority do not form a configured TE-Class"}, { 5, "CT and holding priority do not form a configured TE-Class"}, { 6, "CT and setup priority do not form a configured TE-Class AND CT and holding priority do not form a configured TE-Class"}, { 7, "Inconsistency between signaled PSC and signaled CT"}, { 8, "Inconsistency between signaled PHBs and signaled CT"}, { 0, NULL} }; static value_string_ext rsvp_diffserv_aware_te_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_diffserv_aware_te_error_vals); static const value_string rsvp_call_mgmt_error_vals[] = { { 1, "Call ID Contention"}, { 2, "Connections still Exist"}, { 3, "Unknown Call ID"}, { 4, "Duplicate Call"}, { 0, NULL} }; static value_string_ext rsvp_call_mgmt_error_vals_ext = VALUE_STRING_EXT_INIT(rsvp_call_mgmt_error_vals); /* * Defines the reservation style plus style-specific information that * is not a FLOWSPEC or FILTER_SPEC object, in a RESV message. */ #define RSVP_DISTINCT (1 << 3) #define RSVP_SHARED (2 << 3) #define RSVP_SHARING_MASK (RSVP_DISTINCT | RSVP_SHARED) #define RSVP_SCOPE_WILD 1 #define RSVP_SCOPE_EXPLICIT 2 #define RSVP_SCOPE_MASK 0x07 #define RSVP_WF (RSVP_SHARED | RSVP_SCOPE_WILD) #define RSVP_FF (RSVP_DISTINCT | RSVP_SCOPE_EXPLICIT) #define RSVP_SE (RSVP_SHARED | RSVP_SCOPE_EXPLICIT) static const value_string style_vals[] = { { RSVP_WF, "Wildcard Filter" }, { RSVP_FF, "Fixed Filter" }, { RSVP_SE, "Shared-Explicit" }, { 0, NULL } }; enum { RSVP_SESSION_TYPE_IPV4 = 1, RSVP_SESSION_TYPE_IPV6, RSVP_SESSION_TYPE_IPV4_LSP = 7, RSVP_SESSION_TYPE_IPV6_LSP, RSVP_SESSION_TYPE_AGGREGATE_IPV4 = 9, RSVP_SESSION_TYPE_AGGREGATE_IPV6, RSVP_SESSION_TYPE_IPV4_UNI = 11, RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4 = 13, RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6, RSVP_SESSION_TYPE_IPV4_E_NNI }; /* * Defines a desired QoS, in a RESV message. */ enum qos_service_type { QOS_QUALITATIVE = 128, /* Qualitative service */ QOS_NULL = 6, /* Null service (RFC2997) */ QOS_CONTROLLED_LOAD= 5, /* Controlled Load Service */ QOS_GUARANTEED = 2, /* Guaranteed service */ QOS_TSPEC = 1 /* Traffic specification */ }; static const value_string qos_vals[] = { { QOS_QUALITATIVE, "Qualitative QoS" }, { QOS_NULL, "Null-Service QoS" }, { QOS_CONTROLLED_LOAD, "Controlled-load QoS" }, { QOS_GUARANTEED, "Guaranteed rate QoS" }, { QOS_TSPEC, "Traffic specification" }, { 0, NULL } }; static const value_string svc_vals[] = { { 126, "Compression Hint" }, { 127, "Token bucket" }, { 128, "Null Service" }, { 130, "Guaranteed-rate RSpec" }, { 0, NULL } }; static value_string_ext svc_vals_ext = VALUE_STRING_EXT_INIT(svc_vals); enum rsvp_spec_types { INTSRV = 2 }; enum intsrv_services { INTSRV_GENERAL = 1, INTSRV_GTD = 2, INTSRV_CLOAD = 5, INTSRV_NULL = 6, INTSRV_QUALITATIVE = 128 }; static const value_string intsrv_services_str[] = { { INTSRV_GENERAL, "Default General Parameters"}, { INTSRV_GTD, "Guaranteed Rate"}, { INTSRV_CLOAD, "Controlled Load"}, { INTSRV_NULL, "Null Service"}, { INTSRV_QUALITATIVE, "Null Service"}, { 0, NULL } }; static value_string_ext intsrv_services_str_ext = VALUE_STRING_EXT_INIT(intsrv_services_str); /*Ingress Layer 2 Control Processing values*/ static const value_string il2cp_val_str[] = { { 0, "Ingress Layer 2 Control Processing: 0 - Reserved" }, { 1, "Ingress Layer 2 Control Processing: 1 - Discard/Block" }, { 2, "Ingress Layer 2 Control Processing: 2 - Peer/Process" }, { 3, "Ingress Layer 2 Control Processing: 3 - Pass to EVC/Pass" }, { 4, "Ingress Layer 2 Control Processing: 4 - Peer and Pass to EVC" }, { 0, NULL } }; /*Egress Layer 2 Control Processing values*/ static const value_string el2cp_val_str[] = { { 0, "Egress Layer 2 Control Processing: 0 - Reserved" }, { 1, "Egress Layer 2 Control Processing: 1 - Based on IL2CP Value" }, { 2, "Egress Layer 2 Control Processing: 2 - Generate" }, { 3, "Egress Layer 2 Control Processing: 3 - None" }, { 4, "Egress Layer 2 Control Processing: 4 - Reserved" }, { 0, NULL } }; #if 0 enum intsrv_field_name { INTSRV_NON_IS_HOPS = 1, INTSRV_COMPOSED_NON_IS_HOPS, INTSRV_IS_HOPS, INTSRV_COMPOSED_IS_HOPS, INTSRV_PATH_BANDWIDTH, INTSRV_MIN_PATH_BANDWIDTH, INTSRV_IF_LATENCY, INTSRV_PATH_LATENCY, INTSRV_MTU, INTSRV_COMPOSED_MTU, INTSRV_TOKEN_BUCKET_TSPEC = 127, INTSRV_QUALITATIVE_TSPEC = 128, INTSRV_GTD_RSPEC = 130, INTSRV_DELAY = 131, /* Gtd Parameter C - Max Delay Bound - bytes */ INTSRV_MAX_JITTER, /* Gtd Parameter D - Max Jitter */ INTSRV_E2E_DELAY, /* Gtd Parameter Ctot */ INTSRV_E2E_MAX_JITTER, /* Gtd Parameter Dtot */ INTSRV_SHP_DELAY, /* Gtd Parameter Csum */ INTSRV_SHP_MAX_JITTER /* Gtd Parameter Dsum */ }; #endif static const value_string adspec_params[] = { { 4, "IS Hop Count"}, { 6, "Path b/w estimate"}, { 8, "Minimum path latency"}, { 10, "Composed MTU"}, { 133, "End-to-end composed value for C"}, { 134, "End-to-end composed value for D"}, { 135, "Since-last-reshaping point composed C"}, { 136, "Since-last-reshaping point composed D"}, { 0, NULL } }; static value_string_ext adspec_params_ext = VALUE_STRING_EXT_INIT(adspec_params); /* * FF: please keep this list in sync with * http://www.iana.org/assignments/gmpls-sig-parameters/gmpls-sig-parameters.xhtml * Registry Name: 'LSP Encoding Types' */ const range_string gmpls_lsp_enc_rvals[] = { { 1, 1, "Packet" }, { 2, 2, "Ethernet" }, { 3, 3, "ANSI/ETSI PDH" }, { 4, 4, "Reserved" }, { 5, 5, "SDH ITU-T G.707 / SONET ANSI T1.105" }, { 6, 6, "Reserved" }, { 7, 7, "Digital Wrapper" }, { 8, 8, "Lambda (photonic)" }, { 9, 9, "Fiber" }, { 10, 10, "Reserved" }, { 11, 11, "FiberChannel" }, { 12, 12, "G.709 ODUk (Digital Path)" }, { 13, 13, "G.709 Optical Channel" }, { 14, 14, "Ethernet Line (EPL Type 2)" }, { 15, 239, "Unassigned" }, { 240, 255, "Experimental Usage/temporarily" }, { 0, 0, NULL } }; /* * FF: please keep this list in sync with * http://www.iana.org/assignments/gmpls-sig-parameters/gmpls-sig-parameters.xhtml * Registry Name: 'Switching Types' */ const range_string gmpls_switching_type_rvals[] = { { 1, 1, "Packet-Switch Capable-1 (PSC-1)" }, { 2, 2, "Packet-Switch Capable-2 (PSC-2)" }, { 3, 3, "Packet-Switch Capable-3 (PSC-3)" }, { 4, 4, "Packet-Switch Capable-4 (PSC-4)" }, { 5, 29, "Unassigned" }, { 30, 30, "Ethernet Virtual Private Line (EVPL)" }, { 31, 39, "Unassigned" }, { 40, 40, "802.1 PBB-TE" }, { 41, 50, "Unassigned" }, { 51, 51, "Layer-2 Switch Capable (L2SC)" }, { 52, 99, "Unassigned" }, { 100, 100, "Time-Division-Multiplex Capable (TDM)" }, { 101, 124, "Unassigned" }, { 125, 125, "Data Channel Switching Capable (DCSC)" }, { 126, 149, "Unassigned" }, { 150, 150, "Lambda-Switch Capable (LSC)" }, { 151, 151, "WSON-LSC"}, { 152, 152, "Flexi-Grid-LSC"}, { 153, 169, "Unassigned" }, { 200, 200, "Fiber-Switch Capable (FSC)" }, { 201, 255, "Unassigned" }, { 0, 0, NULL } }; /* * FF: please keep this list in sync with * http://www.iana.org/assignments/gmpls-sig-parameters/gmpls-sig-parameters.xhtml * Registry Name: 'Generalized PID (G-PID)' */ static const range_string gmpls_gpid_rvals[] = { { 0, 0, "Unknown" }, { 1, 4, "Reserved" }, { 5, 5, "Asynchronous mapping of E4" }, { 6, 6, "Asynchronous mapping of DS3/T3" }, { 7, 7, "Asynchronous mapping of E3" }, { 8, 8, "Bit synchronous mapping of E3" }, { 9, 9, "Byte synchronous mapping of E3" }, { 10, 10, "Asynchronous mapping of DS2/T2" }, { 11, 11, "Bit synchronous mapping of DS2/T2" }, { 12, 12, "Reserved" }, { 13, 13, "Asynchronous mapping of E1" }, { 14, 14, "Byte synchronous mapping of E1" }, { 15, 15, "Byte synchronous mapping of 31 * DS0" }, { 16, 16, "Asynchronous mapping of DS1/T1" }, { 17, 17, "Bit synchronous mapping of DS1/T1" }, { 18, 18, "Byte synchronous mapping of DS1/T1" }, { 19, 19, "VC-11 in VC-12" }, { 20, 21, "Reserved" }, { 22, 22, "DS1 SF Asynchronous" }, { 23, 23, "DS1 ESF Asynchronous" }, { 24, 24, "DS3 M23 Asynchronous" }, { 25, 25, "DS3 C-Bit Parity Asynchronous" }, { 26, 26, "VT/LOVC" }, { 27, 27, "STS SPE/HOVC" }, { 28, 28, "POS - No Scrambling, 16 bit CRC" }, { 29, 29, "POS - No Scrambling, 32 bit CRC" }, { 30, 30, "POS - Scrambling, 16 bit CRC" }, { 31, 31, "POS - Scrambling, 32 bit CRC" }, { 32, 32, "ATM mapping" }, { 33, 33, "Ethernet PHY" }, { 34, 34, "SONET/SDH" }, { 35, 35, "Reserved (SONET deprecated)" }, { 36, 36, "Digital Wrapper" }, { 37, 37, "Lambda" }, { 38, 38, "ANSI/ETSI PDH" }, { 39, 39, "Reserved" }, { 40, 40, "Link Access Protocol SDH (LAPS - X.85 and X.86)" }, { 41, 41, "FDDI" }, { 42, 42, "DQDB (ETSI ETS 300 216)" }, { 43, 43, "FiberChannel-3 (Services)" }, { 44, 44, "HDLC" }, { 45, 45, "Ethernet V2/DIX (only)" }, { 46, 46, "Ethernet 802.3 (only)" }, { 47, 47, "G.709 ODUj" }, { 48, 48, "G.709 OTUk(v)" }, { 49, 49, "CBR/CBRa" }, { 50, 50, "CBRb" }, { 51, 51, "BSOT" }, { 52, 52, "BSNT" }, { 53, 53, "IP/PPP (GFP)" }, { 54, 54, "Ethernet MAC (framed GFP)" }, { 55, 55, "Ethernet PHY (transparent GFP" }, { 56, 56, "ESCON" }, { 57, 57, "FICON" }, { 58, 58, "Fiber Channel" }, { 59, 31743, "Unassigned" }, { 31744, 32767, "Experimental Usage/temporarily" }, { 32768, 65535, "Reserved" }, { 0, 0, NULL }, }; const value_string gmpls_protection_cap_str[] = { { 1, "Extra Traffic"}, { 2, "Unprotected"}, { 4, "Shared"}, { 8, "Dedicated 1:1"}, { 16, "Dedicated 1+1"}, { 32, "Enhanced"}, { 64, "Reserved"}, { 128, "Reserved"}, { 0, NULL } }; static const value_string gmpls_sonet_signal_type_str[] = { { 1, "VT1.5 SPE / VC-11"}, { 2, "VT2 SPE / VC-12"}, { 3, "VT3 SPE"}, { 4, "VT6 SPE / VC-2"}, { 5, "STS-1 SPE / VC-3"}, { 6, "STS-3c SPE / VC-4"}, { 7, "STS-1 / STM-0 (transp)"}, { 8, "STS-3 / STM-1 (transp)"}, { 9, "STS-12 / STM-4 (transp)"}, { 10, "STS-48 / STM-16 (transp)"}, { 11, "STS-192 / STM-64 (transp)"}, { 12, "STS-768 / STM-256 (transp)"}, /* Extended non-SONET signal types */ { 13, "VTG / TUG-2"}, { 14, "TUG-3"}, { 15, "STSG-3 / AUG-1"}, { 16, "STSG-12 / AUG-4"}, { 17, "STSG-48 / AUG-16"}, { 18, "STSG-192 / AUG-64"}, { 19, "STSG-768 / AUG-256"}, /* Other SONEt signal types */ { 21, "STS-12c SPE / VC-4-4c"}, { 22, "STS-48c SPE / VC-4-16c"}, { 23, "STS-192c SPE / VC-4-64c"}, { 0, NULL} }; value_string_ext gmpls_sonet_signal_type_str_ext = VALUE_STRING_EXT_INIT(gmpls_sonet_signal_type_str); static const value_string ouni_guni_diversity_str[] = { { 1, "Node Diverse"}, { 2, "Link Diverse"}, { 3, "Shared-Risk Link Group Diverse"}, { 4, "Shared Path"}, { 0, NULL} }; /* FF: RFC 4328 G.709 signal type */ static const range_string gmpls_g709_signal_type_rvals[] = { { 0, 0, "Not significant"}, { 1, 1, "ODU1 (i.e., 2.5 Gbps)"}, { 2, 2, "ODU2 (i.e., 10 Gbps)"}, { 3, 3, "ODU3 (i.e., 40 Gbps)"}, { 4, 5, "Reserved (for future use)"}, { 6, 6, "OCh at 2.5 Gbps"}, { 7, 7, "OCh at 10 Gbps"}, { 8, 8, "OCh at 40 Gbps"}, { 9, 255, "Reserved (for future use)"}, { 0, 0, NULL} }; /* XRO related */ static const value_string rsvp_xro_sobj_lbit_vals[] = { { 1, "Should be avoided" }, { 0, "Must be excluded" }, { 0, NULL } }; /* RRO related */ static const value_string rsvp_rro_sobj_dbit_vals[] = { { 1, "Upstream direction" }, { 0, "Downstream direction" }, { 0, NULL } }; #if 0 static const value_string rsvp_xro_sobj_type_vals[] = { { 1, "IPv4 prefix" }, { 2, "IPv6 prefix" }, { 4, "Unnumbered Interface ID" }, { 32, "Autonomous system number" }, { 33, "Explicit Exclusion Route subobject (EXRS)" }, { 34, "SRLG" }, { 0, NULL } }; #endif static const value_string rsvp_xro_sobj_ip_attr_vals[] = { { 0, "Interface" }, { 1, "Node" }, { 2, "SRLG" }, { 0, NULL } }; static const value_string rsvp_juniper_attr_vals[] = { { 0x01, "Cos" }, { 0x02, "Metric 1" }, { 0x04, "Metric 2" }, { 0x08, "CCC Status" }, { 0x10, "Path Type" }, { 0, NULL } }; static const value_string rsvp_juniper_path_attr_vals[] = { { 0x02, "Primary" }, { 0x03, "Secondary" }, { 0, NULL } }; /* -------------------- Stuff for MPLS/TE objects -------------------- */ static const value_string proto_vals[] = { { IP_PROTO_ICMP, "ICMP"}, { IP_PROTO_IGMP, "IGMP"}, { IP_PROTO_TCP, "TCP" }, { IP_PROTO_UDP, "UDP" }, { IP_PROTO_OSPF, "OSPF"}, { 0, NULL } }; /* Filter keys */ enum hf_rsvp_filter_keys { /* Message types */ RSVPF_MSG, /* Message type */ /* Shorthand for message types */ RSVPF_PATH, RSVPF_RESV, RSVPF_PATHERR, RSVPF_RESVERR, RSVPF_PATHTEAR, RSVPF_RESVTEAR, RSVPF_RCONFIRM, RSVPF_JUNK_MSG8, RSVPF_JUNK_MSG9, RSVPF_RTEARCONFIRM, RSVPF_JUNK11, RSVPF_BUNDLE, RSVPF_ACK, RSVPF_JUNK14, RSVPF_SREFRESH, RSVPF_JUNK16, RSVPF_JUNK17, RSVPF_JUNK18, RSVPF_JUNK19, RSVPF_HELLO, RSVPF_NOTIFY, /* Does the message contain an object of this type? */ RSVPF_OBJECT, /* Object present shorthands */ RSVPF_SESSION, RSVPF_DUMMY_1, RSVPF_HOP, RSVPF_INTEGRITY, RSVPF_TIME_VALUES, RSVPF_ERROR, RSVPF_SCOPE, RSVPF_STYLE, RSVPF_FLOWSPEC, RSVPF_FILTER_SPEC, RSVPF_SENDER, RSVPF_TSPEC, RSVPF_ADSPEC, RSVPF_POLICY, RSVPF_CONFIRM, RSVPF_LABEL, RSVPF_DUMMY_2, RSVPF_DUMMY_3, RSVPF_LABEL_REQUEST, RSVPF_EXPLICIT_ROUTE, RSVPF_RECORD_ROUTE, RSVPF_HELLO_OBJ, RSVPF_MESSAGE_ID, RSVPF_MESSAGE_ID_ACK, RSVPF_MESSAGE_ID_LIST, RSVPF_RECOVERY_LABEL, RSVPF_UPSTREAM_LABEL, RSVPF_LABEL_SET, RSVPF_PROTECTION, RSVPF_DIFFSERV, RSVPF_DSTE, RSVPF_SUGGESTED_LABEL, RSVPF_ACCEPTABLE_LABEL_SET, RSVPF_RESTART_CAP, RSVPF_LINK_CAP, RSVPF_SESSION_ATTRIBUTE, RSVPF_DCLASS, RSVPF_LSP_TUNNEL_IF_ID, RSVPF_NOTIFY_REQUEST, RSVPF_ADMIN_STATUS, RSVPF_ADMIN_STATUS_REFLECT, RSVPF_ADMIN_STATUS_HANDOVER, RSVPF_ADMIN_STATUS_LOCKOUT, RSVPF_ADMIN_STATUS_INHIBIT, RSVPF_ADMIN_STATUS_CALL_MGMT, RSVPF_ADMIN_STATUS_TESTING, RSVPF_ADMIN_STATUS_DOWN, RSVPF_ADMIN_STATUS_DELETE, RSVPF_LSP_ATTRIBUTES, RSVPF_ASSOCIATION, RSVPF_CALL_ATTRIBUTES, RSVPF_GENERALIZED_UNI, RSVPF_CALL_ID, RSVPF_3GPP2_OBJECT, RSVPF_UNKNOWN_OBJ, /* Session object */ RSVPF_SESSION_IP, RSVPF_SESSION_SHORT_CALL_ID, RSVPF_SESSION_PROTO, RSVPF_SESSION_PORT, RSVPF_SESSION_TUNNEL_ID, RSVPF_SESSION_EXT_TUNNEL_ID, RSVPF_SESSION_EXT_TUNNEL_ID_IPV6, /* Sender template */ RSVPF_SENDER_IP, RSVPF_SENDER_PORT, RSVPF_SENDER_LSP_ID, RSVPF_SENDER_SHORT_CALL_ID, /* Diffserv object */ RSVPF_DIFFSERV_MAPNB, RSVPF_DIFFSERV_MAP, RSVPF_DIFFSERV_MAP_EXP, RSVPF_DIFFSERV_PHBID, RSVPF_DIFFSERV_PHBID_DSCP, RSVPF_DIFFSERV_PHBID_CODE, RSVPF_DIFFSERV_PHBID_BIT14, RSVPF_DIFFSERV_PHBID_BIT15, /* Diffserv-aware TE object */ RSVPF_DSTE_CLASSTYPE, /* Generalized UNI object */ RSVPF_GUNI_SRC_IPV4, RSVPF_GUNI_DST_IPV4, RSVPF_GUNI_SRC_IPV6, RSVPF_GUNI_DST_IPV6, /* CALL ID object */ RSVPF_CALL_ID_SRC_ADDR_IPV4, RSVPF_CALL_ID_SRC_ADDR_IPV6, /* EXCLUDE ROUTE object */ RSVPF_EXCLUDE_ROUTE, /* S2L_SUB_LSP object */ RSVPF_S2L_SUB_LSP, /* Vendor Private objects */ RSVPF_PRIVATE_OBJ, RSVPF_ENT_CODE, RSVPF_SECONDARY_EXPLICIT_ROUTE, RSVPF_SECONDARY_RECORD_ROUTE, RSVPF_JUNIPER, /* Sentinel */ RSVPF_MAX }; static const true_false_string tfs_desired_not_desired = { "Desired", "Not Desired" }; static const true_false_string tfs_next_next_hop_next_hop = { "Next-Next-Hop", "Next-Hop" }; static const true_false_string tfs_loose_strict_hop = { "Loose Hop", "Strict Hop" }; static const true_false_string tfs_can_cannot = { "Can", "Cannot" }; static const true_false_string tfs_gen_uni_direction = { "U: 1 - Upstream label/port ID", "U: 0 - Downstream label/port ID" }; static const unit_name_string units_word_not_including_header = { " word, not including header", " words, not including header" }; static int hf_rsvp_filter[RSVPF_MAX] = { -1 }; /* RSVP Conversation related Hash functions */ /* * Compare two RSVP request keys to see if they are equal. Return 1 if they * are, 0 otherwise. * Two RSVP request keys are equal if and only if they have the exactly the * same internal conversation identifier, session type, and matching values in * the session info and source info structures. */ static gint rsvp_equal(gconstpointer k1, gconstpointer k2) { const struct rsvp_request_key *key1 = (const struct rsvp_request_key*) k1; const struct rsvp_request_key *key2 = (const struct rsvp_request_key*) k2; if (key1->conversation != key2->conversation) { return 0; } if (key1->session_type != key2->session_type) { return 0; } switch (key1->session_type) { case RSVP_SESSION_TYPE_IPV4: if (addresses_equal(&key1->u.session_ipv4.destination, &key2->u.session_ipv4.destination) == FALSE) return 0; if (key1->u.session_ipv4.protocol != key2->u.session_ipv4.protocol) return 0; if (key1->u.session_ipv4.udp_dest_port != key2->u.session_ipv4.udp_dest_port) return 0; break; case RSVP_SESSION_TYPE_IPV6: /* this is not supported yet for conversations */ break; case RSVP_SESSION_TYPE_IPV4_LSP: if (addresses_equal(&key1->u.session_ipv4_lsp.destination, &key2->u.session_ipv4_lsp.destination) == FALSE) return 0; if (key1->u.session_ipv4_lsp.udp_dest_port != key2->u.session_ipv4_lsp.udp_dest_port) return 0; if (key1->u.session_ipv4_lsp.ext_tunnel_id != key2->u.session_ipv4_lsp.ext_tunnel_id) return 0; break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: if (addresses_equal(&key1->u.session_agg_ipv4.destination, &key2->u.session_agg_ipv4.destination) == FALSE) return 0; if (key1->u.session_agg_ipv4.dscp != key2->u.session_agg_ipv4.dscp) return 0; break; case RSVP_SESSION_TYPE_AGGREGATE_IPV6: /* this is not supported yet for conversations */ break; case RSVP_SESSION_TYPE_IPV4_UNI: if (addresses_equal(&key1->u.session_ipv4_uni.destination, &key2->u.session_ipv4_uni.destination) == FALSE) return 0; if (key1->u.session_ipv4_uni.udp_dest_port != key2->u.session_ipv4_uni.udp_dest_port) return 0; if (key1->u.session_ipv4_uni.ext_tunnel_id != key2->u.session_ipv4_uni.ext_tunnel_id) return 0; break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4: if (addresses_equal(&key1->u.session_ipv4_p2mp_lsp.destination, &key2->u.session_ipv4_p2mp_lsp.destination) == FALSE) return 0; if (key1->u.session_ipv4_p2mp_lsp.udp_dest_port != key2->u.session_ipv4_p2mp_lsp.udp_dest_port) return 0; if (key1->u.session_ipv4_p2mp_lsp.ext_tunnel_id != key2->u.session_ipv4_p2mp_lsp.ext_tunnel_id) return 0; break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6: if (addresses_equal(&key1->u.session_ipv6_p2mp_lsp.destination, &key2->u.session_ipv6_p2mp_lsp.destination) == FALSE) return 0; if (key1->u.session_ipv6_p2mp_lsp.udp_dest_port != key2->u.session_ipv6_p2mp_lsp.udp_dest_port) return 0; if (key1->u.session_ipv6_p2mp_lsp.ext_tunnel_id != key2->u.session_ipv6_p2mp_lsp.ext_tunnel_id) return 0; break; case RSVP_SESSION_TYPE_IPV4_E_NNI: if (addresses_equal(&key1->u.session_ipv4_enni.destination, &key2->u.session_ipv4_enni.destination) == FALSE) return 0; if (key1->u.session_ipv4_enni.udp_dest_port != key2->u.session_ipv4_enni.udp_dest_port) return 0; if (key1->u.session_ipv4_enni.ext_tunnel_id != key2->u.session_ipv4_enni.ext_tunnel_id) return 0; break; default: /* This should never happen. */ break; } if (addresses_equal(&key1->source_info.source, &key2->source_info.source) == FALSE) return 0; if (key1->source_info.udp_source_port != key2->source_info.udp_source_port) return 0; /* If we get here, the two keys are equal. */ return 1; } /* * Calculate a hash key for the supplied RSVP request. The internally allocated * conversation-id is unique, so we just use that. */ static guint rsvp_hash(gconstpointer k) { const struct rsvp_request_key *key = (const struct rsvp_request_key*) k; return key->conversation; } static const char* rsvp_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) { if ((filter == CONV_FT_SRC_ADDRESS) && (conv->src_address.type == AT_IPv4)) return "ip.src"; if ((filter == CONV_FT_DST_ADDRESS) && (conv->dst_address.type == AT_IPv4)) return "ip.dst"; if ((filter == CONV_FT_ANY_ADDRESS) && (conv->src_address.type == AT_IPv4)) return "ip.addr"; return CONV_FILTER_INVALID; } static ct_dissector_info_t rsvp_ct_dissector_info = {&rsvp_conv_get_filter_type}; static tap_packet_status rsvp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags) { conv_hash_t *hash = (conv_hash_t*) pct; hash->flags = flags; const rsvp_conversation_info *rsvph = (const rsvp_conversation_info *)vip; add_conversation_table_data(hash, &rsvph->source, &rsvph->destination, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &rsvp_ct_dissector_info, CONVERSATION_NONE); return TAP_PACKET_REDRAW; } static const char* rsvp_endpoint_get_filter_type(endpoint_item_t* endpoint, conv_filter_type_e filter) { if ((filter == CONV_FT_ANY_ADDRESS) && (endpoint->myaddress.type == AT_IPv4)) return "ip.addr"; return CONV_FILTER_INVALID; } static et_dissector_info_t rsvp_endpoint_dissector_info = {&rsvp_endpoint_get_filter_type}; static tap_packet_status rsvp_endpoint_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags) { conv_hash_t *hash = (conv_hash_t*) pit; hash->flags = flags; const rsvp_conversation_info *rsvph = (const rsvp_conversation_info *)vip; /* Take two "add" passes per packet, adding for each direction, ensures * that all packets are counted properly (even if address is sending to * itself). XXX - this could probably be done more efficiently inside * endpoint_table */ add_endpoint_table_data(hash, &rsvph->source, 0, TRUE, 1, pinfo->fd->pkt_len, &rsvp_endpoint_dissector_info, ENDPOINT_NONE); add_endpoint_table_data(hash, &rsvph->destination, 0, FALSE, 1, pinfo->fd->pkt_len, &rsvp_endpoint_dissector_info, ENDPOINT_NONE); return TAP_PACKET_REDRAW; } static inline int rsvp_class_to_filter_num(int classnum) { switch(classnum) { case RSVP_CLASS_SESSION : case RSVP_CLASS_HOP : case RSVP_CLASS_INTEGRITY : case RSVP_CLASS_TIME_VALUES : case RSVP_CLASS_ERROR : case RSVP_CLASS_SCOPE : case RSVP_CLASS_STYLE : case RSVP_CLASS_FLOWSPEC : case RSVP_CLASS_FILTER_SPEC : case RSVP_CLASS_SENDER_TEMPLATE : case RSVP_CLASS_SENDER_TSPEC : case RSVP_CLASS_ADSPEC : case RSVP_CLASS_POLICY : case RSVP_CLASS_CONFIRM : case RSVP_CLASS_LABEL : case RSVP_CLASS_LABEL_REQUEST : case RSVP_CLASS_HELLO : case RSVP_CLASS_EXPLICIT_ROUTE : case RSVP_CLASS_RECORD_ROUTE : case RSVP_CLASS_MESSAGE_ID : case RSVP_CLASS_MESSAGE_ID_ACK : case RSVP_CLASS_MESSAGE_ID_LIST : return classnum + RSVPF_OBJECT; break; case RSVP_CLASS_RECOVERY_LABEL : case RSVP_CLASS_UPSTREAM_LABEL : case RSVP_CLASS_LABEL_SET : case RSVP_CLASS_PROTECTION : return RSVPF_RECOVERY_LABEL + (classnum - RSVP_CLASS_RECOVERY_LABEL); case RSVP_CLASS_SUGGESTED_LABEL : case RSVP_CLASS_ACCEPTABLE_LABEL_SET : case RSVP_CLASS_RESTART_CAP : return RSVPF_SUGGESTED_LABEL + (classnum - RSVP_CLASS_SUGGESTED_LABEL); case RSVP_CLASS_LINK_CAP : return RSVPF_LINK_CAP; case RSVP_CLASS_DIFFSERV : return RSVPF_DIFFSERV; case RSVP_CLASS_CLASSTYPE : return RSVPF_DSTE; case RSVP_CLASS_NOTIFY_REQUEST : return RSVPF_NOTIFY_REQUEST; case RSVP_CLASS_ADMIN_STATUS : return RSVPF_ADMIN_STATUS; case RSVP_CLASS_LSP_ATTRIBUTES : return RSVPF_LSP_ATTRIBUTES; case RSVP_CLASS_ASSOCIATION : return RSVPF_ASSOCIATION; case RSVP_CLASS_CALL_ATTRIBUTES: return RSVPF_CALL_ATTRIBUTES; case RSVP_CLASS_SESSION_ATTRIBUTE : return RSVPF_SESSION_ATTRIBUTE; case RSVP_CLASS_GENERALIZED_UNI : return RSVPF_GENERALIZED_UNI; case RSVP_CLASS_CALL_ID : return RSVPF_CALL_ID; case RSVP_CLASS_3GPP2_OBJECT : return RSVPF_3GPP2_OBJECT; case RSVP_CLASS_DCLASS : return RSVPF_DCLASS; case RSVP_CLASS_LSP_TUNNEL_IF_ID : return RSVPF_LSP_TUNNEL_IF_ID; case RSVP_CLASS_EXCLUDE_ROUTE: return RSVPF_EXCLUDE_ROUTE; case RSVP_CLASS_S2L_SUB_LSP: return RSVPF_S2L_SUB_LSP; case RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE: return RSVPF_SECONDARY_EXPLICIT_ROUTE; case RSVP_CLASS_SECONDARY_RECORD_ROUTE: return RSVPF_SECONDARY_RECORD_ROUTE; case RSVP_CLASS_JUNIPER_PROPERTIES : return RSVPF_JUNIPER; case RSVP_CLASS_VENDOR_PRIVATE_1: case RSVP_CLASS_VENDOR_PRIVATE_2: case RSVP_CLASS_VENDOR_PRIVATE_3: case RSVP_CLASS_VENDOR_PRIVATE_4: case RSVP_CLASS_VENDOR_PRIVATE_5: case RSVP_CLASS_VENDOR_PRIVATE_6: case RSVP_CLASS_VENDOR_PRIVATE_7: case RSVP_CLASS_VENDOR_PRIVATE_8: case RSVP_CLASS_VENDOR_PRIVATE_9: case RSVP_CLASS_VENDOR_PRIVATE_10: case RSVP_CLASS_VENDOR_PRIVATE_11: case RSVP_CLASS_VENDOR_PRIVATE_12: return RSVPF_PRIVATE_OBJ; default: return RSVPF_UNKNOWN_OBJ; } } static inline int rsvp_class_to_tree_type(int classnum) { switch(classnum) { case RSVP_CLASS_SESSION : return TT_SESSION; case RSVP_CLASS_HOP : return TT_HOP; case RSVP_CLASS_INTEGRITY : return TT_INTEGRITY; case RSVP_CLASS_TIME_VALUES : return TT_TIME_VALUES; case RSVP_CLASS_ERROR : return TT_ERROR; case RSVP_CLASS_SCOPE : return TT_SCOPE; case RSVP_CLASS_STYLE : return TT_STYLE; case RSVP_CLASS_FLOWSPEC : return TT_FLOWSPEC; case RSVP_CLASS_FILTER_SPEC : return TT_FILTER_SPEC; case RSVP_CLASS_SENDER_TEMPLATE : return TT_SENDER_TEMPLATE; case RSVP_CLASS_SENDER_TSPEC : return TT_TSPEC; case RSVP_CLASS_ADSPEC : return TT_ADSPEC; case RSVP_CLASS_POLICY : return TT_POLICY; case RSVP_CLASS_CONFIRM : return TT_CONFIRM; case RSVP_CLASS_RECOVERY_LABEL : case RSVP_CLASS_UPSTREAM_LABEL : case RSVP_CLASS_SUGGESTED_LABEL : case RSVP_CLASS_LABEL : return TT_LABEL; case RSVP_CLASS_LABEL_REQUEST : return TT_LABEL_REQUEST; case RSVP_CLASS_HELLO : return TT_HELLO_OBJ; case RSVP_CLASS_EXPLICIT_ROUTE : return TT_EXPLICIT_ROUTE; case RSVP_CLASS_RECORD_ROUTE : return TT_RECORD_ROUTE; case RSVP_CLASS_MESSAGE_ID : return TT_MESSAGE_ID; case RSVP_CLASS_MESSAGE_ID_ACK : return TT_MESSAGE_ID_ACK; case RSVP_CLASS_MESSAGE_ID_LIST : return TT_MESSAGE_ID_LIST; case RSVP_CLASS_LABEL_SET : return TT_LABEL_SET; case RSVP_CLASS_PROTECTION : return TT_PROTECTION_INFO; case RSVP_CLASS_ACCEPTABLE_LABEL_SET : return TT_UNKNOWN_CLASS; case RSVP_CLASS_RESTART_CAP : return TT_RESTART_CAP; case RSVP_CLASS_LINK_CAP : return TT_LINK_CAP; case RSVP_CLASS_DIFFSERV : return TT_DIFFSERV; case RSVP_CLASS_CLASSTYPE: return TT_CLASSTYPE; case RSVP_CLASS_NOTIFY_REQUEST : return TT_UNKNOWN_CLASS; case RSVP_CLASS_ADMIN_STATUS : return TT_ADMIN_STATUS; case RSVP_CLASS_LSP_ATTRIBUTES : case RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES : return TT_LSP_ATTRIBUTES; case RSVP_CLASS_ASSOCIATION : return TT_ASSOCIATION; case RSVP_CLASS_CALL_ATTRIBUTES: return RSVPF_CALL_ATTRIBUTES; case RSVP_CLASS_JUNIPER_PROPERTIES : return TT_JUNIPER; case RSVP_CLASS_SESSION_ATTRIBUTE : return TT_SESSION_ATTRIBUTE; case RSVP_CLASS_GENERALIZED_UNI : return TT_GEN_UNI; case RSVP_CLASS_CALL_ID : return TT_CALL_ID; case RSVP_CLASS_3GPP2_OBJECT : return TT_3GPP2_OBJECT; case RSVP_CLASS_DCLASS : return TT_DCLASS; case RSVP_CLASS_LSP_TUNNEL_IF_ID : return TT_LSP_TUNNEL_IF_ID; case RSVP_CLASS_EXCLUDE_ROUTE : return TT_EXCLUDE_ROUTE; case RSVP_CLASS_VENDOR_PRIVATE_1: case RSVP_CLASS_VENDOR_PRIVATE_2: case RSVP_CLASS_VENDOR_PRIVATE_3: case RSVP_CLASS_VENDOR_PRIVATE_4: case RSVP_CLASS_VENDOR_PRIVATE_5: case RSVP_CLASS_VENDOR_PRIVATE_6: case RSVP_CLASS_VENDOR_PRIVATE_7: case RSVP_CLASS_VENDOR_PRIVATE_8: case RSVP_CLASS_VENDOR_PRIVATE_9: case RSVP_CLASS_VENDOR_PRIVATE_10: case RSVP_CLASS_VENDOR_PRIVATE_11: case RSVP_CLASS_VENDOR_PRIVATE_12: return TT_PRIVATE_CLASS; default: return TT_UNKNOWN_CLASS; } } static void find_rsvp_session_tempfilt(tvbuff_t *tvb, int hdr_offset, int *session_offp, int *tempfilt_offp) { int s_off = 0, t_off = 0; int len, off; guint obj_length; if (!tvb_bytes_exist(tvb, hdr_offset+6, 2)) goto done; len = tvb_get_ntohs(tvb, hdr_offset+6) + hdr_offset; for (off = hdr_offset + 8; (off < len) && tvb_bytes_exist(tvb, off, 3); off += obj_length) { obj_length = tvb_get_ntohs(tvb, off); if (obj_length == 0) break; switch(tvb_get_guint8(tvb, off+2)) { case RSVP_CLASS_SESSION: s_off = off; break; case RSVP_CLASS_SENDER_TEMPLATE: case RSVP_CLASS_FILTER_SPEC: t_off = off; break; default: break; } } done: if (session_offp) *session_offp = s_off; if (tempfilt_offp) *tempfilt_offp = t_off; } static const value_string rsvp_c_type_session_vals[] = { {RSVP_SESSION_TYPE_IPV4, "IPv4"}, {RSVP_SESSION_TYPE_IPV4_LSP, "IPv4-LSP"}, {RSVP_SESSION_TYPE_IPV6_LSP, "IPv6-LSP"}, {RSVP_SESSION_TYPE_AGGREGATE_IPV4, "IPv4-Aggregate"}, {RSVP_SESSION_TYPE_IPV4_UNI, "IPv4-UNI"}, {RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4, "IPv4-P2MP LSP TUNNEL"}, {RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6, "IPv6-P2MP LSP TUNNEL"}, {RSVP_SESSION_TYPE_IPV4_E_NNI, "IPv4-E-NNI"}, {0, NULL } }; static const value_string rsvp_c_type_call_id_vals[] = { {0, "Empty"}, {1, "Operator Specific"}, {2, "Globally Unique"}, {0, NULL } }; static const value_string rsvp_c_type_hop_vals[] = { {1, "IPv4"}, {2, "IPv6"}, {3, "IPv4 IF-ID"}, {4, "IPv6 IF-ID"}, {0, NULL } }; static const value_string rsvp_c_type_time_values_vals[] = { {1, "Time Values"}, {0, NULL } }; static const value_string rsvp_c_type_error_vals[] = { {1, "IPv4"}, {2, "IPv6"}, {3, "IPv4 IF-ID"}, {4, "IPv6 IF-ID"}, {0, NULL } }; static const value_string rsvp_c_type_scope_vals[] = { {1, "IPv4"}, {2, "IPv6"}, {0, NULL } }; static const value_string rsvp_c_type_style_vals[] = { {1, "Style"}, {0, NULL } }; static const value_string rsvp_c_type_confirm_vals[] = { {1, "IPv4"}, {2, "IPv6"}, {0, NULL } }; static const value_string rsvp_c_type_template_vals[] = { {1, "IPv4"}, {2, "IPv6"}, {7, "IPv4 LSP"}, {8, "IPv6 LSP"}, {9, "IPv4 Aggregate"}, {12, "P2MP_LSP_TUNNEL_IPv4"}, {13, "P2MP_LSP_TUNNEL_IPv6"}, {0, NULL } }; static const value_string rsvp_c_type_tspec_vals[] = { {2, "Integrated Services"}, {4, "SONET/SDH"}, {5, "G.709"}, {6, "Ethernet"}, {0, NULL } }; static const value_string rsvp_c_type_flowspec_vals[] = { {2, "Integrated Services"}, {4, "SONET/SDH"}, {5, "G.709"}, {6, "Ethernet"}, {0, NULL } }; static const value_string rsvp_c_type_label_request_vals[] = { { 2, "Label Request with ATM label Range"}, { 3, "Label Request with Frame-Relay label Range"}, { 4, "Generalized Label Request"}, { 5, "Generalized Channel_set Label Request"}, { 0, NULL } }; static const value_string rsvp_c_type_attribute_vals[] = { { 1, "IPv4 LSP"}, { 7, "IPv4 LSP Resource Affinities"}, { 0, NULL } }; static const value_string rsvp_c_type_association_vals[] = { { 1, "IPv4"}, { 2, "IPv6"}, { 4, "Routing Area"}, { 0, NULL } }; static const value_string rsvp_c_type_tunnel_if_vals[] = { { 1, "Unnumbered interface"}, { 2, "IPv4"}, { 3, "IPv6"}, { 4, "Unnumbered interface with target"}, { 0, NULL } }; static const value_string rsvp_c_type_diffserv_vals[] = { { 1, "E-LSP"}, { 2, "L-LSP"}, { 0, NULL } }; static const value_string rsvp_c_type_label_vals[] = { { 1, "Packet Label"}, { 2, "Generalized Label"}, { 4, "Generalized Channel_set"}, { 0, NULL } }; static const value_string rsvp_c_type_notify_request_vals[] = { { 1, "IPv4"}, { 2, "IPv6"}, { 0, NULL } }; static const value_string rsvp_c_type_s2l_sub_lsp_vals[] = { { 1, "IPv4"}, { 2, "IPv6"}, { 0, NULL } }; static char * summary_session(wmem_allocator_t *pool, tvbuff_t *tvb, int offset) { switch(tvb_get_guint8(tvb, offset+3)) { case RSVP_SESSION_TYPE_IPV4: return wmem_strdup_printf(pool, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ", tvb_ip_to_str(pool, tvb, offset+4), tvb_get_guint8(tvb, offset+8), tvb_get_ntohs(tvb, offset+10)); break; case RSVP_SESSION_TYPE_IPV4_LSP: return wmem_strdup_printf(pool, "SESSION: IPv4-LSP, Destination %s, Short Call ID %d, Tunnel ID %d, Ext ID %0x. ", tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+8), tvb_get_ntohs(tvb, offset+10), tvb_get_ntohl(tvb, offset+12)); break; case RSVP_SESSION_TYPE_IPV6_LSP: return wmem_strdup_printf(pool, "SESSION: IPv6-LSP, Destination %s, Short Call ID %d, Tunnel ID %d, Ext ID %0x%0x%0x%0x. ", tvb_ip6_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+20), tvb_get_ntohs(tvb, offset+22), tvb_get_ntohl(tvb, offset+24), tvb_get_ntohl(tvb, offset+28), tvb_get_ntohl(tvb, offset+32), tvb_get_ntohl(tvb, offset+36)); case RSVP_SESSION_TYPE_AGGREGATE_IPV4: return wmem_strdup_printf(pool, "SESSION: IPv4-Aggregate, Destination %s, DSCP %d. ", tvb_ip_to_str(pool, tvb, offset+4), tvb_get_guint8(tvb, offset+11)); break; case RSVP_SESSION_TYPE_IPV4_UNI: return wmem_strdup_printf(pool, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ", tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip_to_str(pool, tvb, offset+12)); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4: return wmem_strdup_printf(pool, "SESSION: IPv4-P2MP LSP TUNNEL, P2MP ID %u, Tunnel ID %d, Ext Tunnel %s. ", tvb_get_ntohl(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip_to_str(pool, tvb, offset+12)); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6: return wmem_strdup_printf(pool, "SESSION: IPv6-P2MP LSP TUNNEL, P2MP ID %u, Tunnel ID %d, Ext Tunnel %s. ", tvb_get_ntohl(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip6_to_str(pool, tvb, offset+12)); break; case RSVP_SESSION_TYPE_IPV4_E_NNI: return wmem_strdup_printf(pool, "SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ", tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip_to_str(pool, tvb, offset+12)); break; default: return wmem_strdup_printf(pool, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3)); break; } DISSECTOR_ASSERT_NOT_REACHED(); } static char * summary_template(wmem_allocator_t *pool, tvbuff_t *tvb, int offset) { const char *objtype; if (tvb_get_guint8(tvb, offset+2) == RSVP_CLASS_FILTER_SPEC) objtype = "FILTERSPEC"; else objtype = "SENDER TEMPLATE"; switch(tvb_get_guint8(tvb, offset+3)) { case 1: return wmem_strdup_printf(pool, "%s: IPv4, Sender %s, Port %d. ", objtype, tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+10)); break; case 7: return wmem_strdup_printf(pool, "%s: IPv4-LSP, Tunnel Source: %s, Short Call ID: %d, LSP ID: %d. ", objtype, tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+8), tvb_get_ntohs(tvb, offset+10)); break; case 8: return wmem_strdup_printf(pool, "%s: IPv6-LSP, Tunnel Source: %s, Short Call ID: %d, LSP ID: %d. ", objtype, tvb_ip6_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+20), tvb_get_ntohs(tvb, offset+22)); break; case 9: return wmem_strdup_printf(pool, "%s: IPv4-Aggregate, Aggregator %s. ", objtype, tvb_ip_to_str(pool, tvb, offset+4)); break; case 12: return wmem_strdup_printf(pool, "%s: P2MP_LSP_TUNNEL_IPv4, IPv4 tunnel sender address %s, LSP ID: %d, Sub-Group ID %d. ", objtype, tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_get_ntohs(tvb, offset+18)); break; case 13: return wmem_strdup_printf(pool, "%s: P2MP_LSP_TUNNEL_IPv6, IPv6 tunnel sender address %s, LSP ID: %d, Sub-Group ID %d. ", objtype, tvb_ip_to_str(pool, tvb, offset+4), tvb_get_ntohs(tvb, offset+22), tvb_get_ntohs(tvb, offset+40)); break; default: return wmem_strdup_printf(pool, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3)); break; } DISSECTOR_ASSERT_NOT_REACHED(); } /*------------------------------------------------------------------------------ * SESSION *------------------------------------------------------------------------------*/ static void dissect_rsvp_session(packet_info *pinfo, proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type, rsvp_conversation_info *rsvph) { proto_item *hidden_item; int offset2 = offset + 4; proto_item_set_text(ti, "%s", summary_session(pinfo->pool, tvb, offset)); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case RSVP_SESSION_TYPE_IPV4: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_PROTO], tvb, offset2+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_flags, tvb, offset2+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_PORT], tvb, offset2+6, 2, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4; set_address_tvb(&rsvph->destination, AT_IPv4, 4, tvb, offset2); rsvph->protocol = tvb_get_guint8(tvb, offset2+4); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); break; case RSVP_SESSION_TYPE_IPV6: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_destination_address, tvb, offset2, 16, ENC_NA); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_protocol, tvb, offset2+16, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_flags, tvb, offset2+17, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_destination_port, tvb, offset2+18, 2, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key * later. IPv6 conversatiuon support is not implemented yet, so only * the session type is stored. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV6; break; case RSVP_SESSION_TYPE_IPV4_LSP: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN);; proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); /*short call id*/ proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_SHORT_CALL_ID], tvb, offset2+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], tvb, offset2+6, 2, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_extended_tunnel_id, tvb, offset2+8, 4, tvb_get_ntohl(tvb, offset2+8), "%u (%s)", tvb_get_ntohl(tvb, offset2+8), tvb_ip_to_str(pinfo->pool, tvb, offset2+8)); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4_LSP; set_address_tvb(&rsvph->destination, AT_IPv4, 4, tvb, offset2); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; case RSVP_SESSION_TYPE_IPV6_LSP: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], tvb, offset2, 16, ENC_BIG_ENDIAN); /*short call id*/ proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_SHORT_CALL_ID], tvb, offset2+16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], tvb, offset2+18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_extended_tunnel_ipv6, tvb, offset2+20, 16, ENC_NA); proto_item_set_text(ti, "Extended Tunnel ID: (%s)", tvb_ip6_to_str(pinfo->pool, tvb, offset2+20)); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID_IPV6], tvb, offset2+20, 16, ENC_NA); proto_item_set_hidden(hidden_item); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV6_LSP; set_address_tvb(&rsvph->destination, AT_IPv6, 16, tvb, offset2); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+18); rsvph->ext_tunnel_id_ipv6_pre = tvb_get_ntoh64(tvb, offset2+20); rsvph->ext_tunnel_id_ipv6_post = tvb_get_ntoh64(tvb, offset2+28); break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN);; proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_dscp, tvb, offset2+7, 1, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_AGGREGATE_IPV4; set_address_tvb(&rsvph->destination, AT_IPv4, 4, tvb, offset2); rsvph->dscp = tvb_get_guint8(tvb, offset2+7); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; case RSVP_SESSION_TYPE_IPV4_UNI: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], tvb, offset2+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_extended_ipv4_address, tvb, offset2+8, 4, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4_UNI; set_address_tvb(&rsvph->destination, AT_IPv4, 4, tvb, offset2); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_p2mp_id, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], tvb, offset2+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_extended_tunnel, tvb, offset2+8, 4, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4; set_address_tvb(&rsvph->destination, AT_IPv4, 4, tvb, offset2); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_p2mp_id, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], tvb, offset2+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_extended_tunnel, tvb, offset2+8, 16, ENC_NA); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID_IPV6], tvb, offset2+8, 16, ENC_NA); proto_item_set_hidden(hidden_item); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6; set_address_tvb(&rsvph->destination, AT_IPv6, 16, tvb, offset2); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+18); rsvph->ext_tunnel_id_ipv6_pre = tvb_get_ntoh64(tvb, offset2+20); rsvph->ext_tunnel_id_ipv6_post = tvb_get_ntoh64(tvb, offset2+28); break; case RSVP_SESSION_TYPE_IPV4_E_NNI: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], tvb, offset2+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_extended_ipv4_address, tvb, offset2+8, 4, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); /* * Save this information to build the conversation request key * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4_E_NNI; set_address_tvb(&rsvph->destination, AT_IPv4, 4, tvb, offset2); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_data, tvb, offset2, obj_length-4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * TLVs for HOP, ERROR and other IF_ID extended objects (RFC4920) * (TODO: TLV type 12, 13, 25) *------------------------------------------------------------------------------*/ static void dissect_rsvp_ifid_tlv(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int length, int subtree_type) { int tlv_off, padding; guint16 tlv_type; int tlv_len; guint8 isis_len; const char *tlv_name, *ip_str; proto_tree *rsvp_ifid_subtree=NULL, *ti2 = NULL; for (tlv_off = 0; tlv_off < length; ) { tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); if ((tlv_len == 0) || (tlv_off+tlv_len > length)) { proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+tlv_off+2, 2, "Invalid TLV length"); return; } switch(tlv_type) { case 1: /* IPv4 */ tlv_name = ""; goto ifid_ipv4; case 14: /* PREVIOUS_HOP_IPV4 */ tlv_name = "Previous-Hop "; goto ifid_ipv4; case 16: /* INCOMING_IPV4 */ tlv_name = "Incoming "; ifid_ipv4: ip_str = tvb_ip_to_str(pinfo->pool, tvb, offset+tlv_off+4); rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sIPv4 TLV - %s", tlv_name, ip_str); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%sIPv4)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_ipv4_address, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%sIPv4: %s. ", tlv_name, ip_str); break; case 2: /* IPv6 */ tlv_name = ""; goto ifid_ipv6; case 15: /* PREVIOUS_HOP_IPV6 */ tlv_name = "Previous-Hop "; goto ifid_ipv6; case 17: /* INCOMING_IPV6 */ tlv_name = "Incoming "; ifid_ipv6: ip_str = tvb_ip6_to_str(pinfo->pool, tvb, offset+tlv_off+4); rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sIPv6 TLV - %s", tlv_name, ip_str); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%sIPv6)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_ipv6_address, tvb, offset+tlv_off+4, 16, ENC_NA); proto_item_append_text(ti, "%sIPv6: %s. ", tlv_name, ip_str); break; case 3: /* IF_INDEX */ tlv_name = ""; goto ifid_ifindex; case 4: /* COMPONENT_IF_DOWNSTREAM */ tlv_name = " Forward"; goto ifid_ifindex; case 5: /* COMPONENT_IF_UPSTREAM */ tlv_name = " Reverse"; goto ifid_ifindex; case 18: /* INCOMING_IF_INDEX */ tlv_name = " Incoming"; ifid_ifindex: ip_str = tvb_ip_to_str(pinfo->pool, tvb, offset+tlv_off+4); rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "Interface-Index%s TLV - %s, %d", tlv_name, ip_str, tvb_get_ntohl(tvb, offset+tlv_off+8)); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (Interface Index%s)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_ipv4_address, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlvinterface_id, tvb, offset+tlv_off+8, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Data If-Index%s: %s, %d. ", tlv_name, ip_str, tvb_get_ntohl(tvb, offset+tlv_off+8)); break; case 6: /* DOWNSTREAM_LABEL */ tlv_name = "Downstream"; goto ifid_label; case 7: /* UPSTREAM_LABEL */ tlv_name = "Upstream"; goto ifid_label; case 19: /* INCOMING_DOWN_LABEL */ tlv_name = "Incoming-Downstream"; goto ifid_label; case 20: /* INCOMING_UP_LABEL */ tlv_name = "Incoming-Upstream"; ifid_label: rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%s-Label TLV - %u", tlv_name, tvb_get_ntohl(tvb, offset+tlv_off+4)); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%s-Label)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_label, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%s-Label: %u. ", tlv_name, tvb_get_ntohl(tvb, offset+tlv_off+4)); break; case 8: /* NODE_ID */ tlv_name = ""; goto ifid_nodeid; case 21: /* REPORTING_NODE_ID */ tlv_name = "Reporting-"; ifid_nodeid: ip_str = tvb_ip_to_str(pinfo->pool, tvb, offset+tlv_off+4); rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sNode-ID TLV - %s", tlv_name, ip_str); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%sNode-ID)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_node_id, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%sNode-ID: %s. ", tlv_name, ip_str); break; case 9: /* OSPF_AREA */ tlv_name = ""; goto ifid_ospf; case 22: /* REPORTING_OSPF_AREA */ tlv_name = "Reporting-"; ifid_ospf: rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sOSPF-Area TLV - %u", tlv_name, tvb_get_ntohl(tvb, offset+tlv_off+4)); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%sOSPF-Area)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_area, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%sOSPF-Area: %u. ", tlv_name, tvb_get_ntohl(tvb, offset+tlv_off+4)); break; case 10: /* ISIS_AREA */ tlv_name = ""; goto ifid_isis; case 23: /* REPORTING_ISIS_AREA */ tlv_name = "Reporting-"; ifid_isis: isis_len = tvb_get_guint8(tvb, offset+tlv_off+4); if ((isis_len < 2) || (isis_len > 11)) { proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+tlv_off, tlv_len, "%sISIS-Area TLV - Invalid Length field", tlv_name); break; } ip_str = print_nsap_net(pinfo->pool, tvb, offset+tlv_off+5, isis_len); rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sISIS-Area TLV - %s", tlv_name, ip_str); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%sISIS-Area)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_string(rsvp_ifid_subtree, hf_rsvp_isis_area_id, tvb, offset+tlv_off+4, 4, ip_str); proto_item_append_text(ti, "%sISIS-Area: %s. ", tlv_name, ip_str); break; case 11: /* AUTONOMOUS_SYSTEM */ tlv_name = ""; goto ifid_as; case 24: /* REPORTING_AUTONOMOUS_SYSTEM */ tlv_name = "Reporting-"; ifid_as: rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "%sAS TLV - %u", tlv_name, tvb_get_ntohl(tvb, offset+tlv_off+4)); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%sAS)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_autonomous_system, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%sAS: %u. ", tlv_name, tvb_get_ntohl(tvb, offset+tlv_off+4)); break; case 26: /* NODE_EXCLUSIONS */ tlv_name = "Node"; goto ifid_ex; case 27: /* LINK_EXCLUSIONS */ tlv_name = "Link"; ifid_ex: rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, &ti2, "%s-Exclusions TLV - ", tlv_name); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%d (%s-Exclusions)", tlv_type, tlv_name); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); dissect_rsvp_ifid_tlv(ti2, pinfo, rsvp_ifid_subtree, tvb, offset+tlv_off+4, tlv_len-4, TREE(TT_HOP_SUBOBJ)); break; case 516: /* FF: ERROR_STRING TLV, RFC 4783 */ rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset + tlv_off, tlv_len, subtree_type, NULL, "ERROR_STRING TLV - %s", tvb_format_text(pinfo->pool, tvb, offset + tlv_off + 4, tlv_len - 4)); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset + tlv_off, 2, tlv_type, "516 (ERROR_STRING)"); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset + tlv_off + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_error_string, tvb, offset + tlv_off + 4, tlv_len - 4, ENC_NA|ENC_ASCII); break; default: /* FF: not yet known TLVs are displayed as raw data */ rsvp_ifid_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset + tlv_off, tlv_len, subtree_type, NULL, "Unknown TLV (%u)", tlv_type); proto_tree_add_uint_format_value(rsvp_ifid_subtree, hf_rsvp_type, tvb, offset + tlv_off, 2, tlv_type, "%u (Unknown)", tlv_type); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_length, tvb, offset + tlv_off + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_data, tvb, offset + tlv_off + 4, tlv_len - 4, ENC_NA); break; } padding = (4 - (tlv_len % 4)) % 4; if (padding != 0) proto_tree_add_item(rsvp_ifid_subtree, hf_rsvp_ifid_tlv_padding, tvb, offset + tlv_off + tlv_len, padding, ENC_NA); tlv_off += tlv_len + padding; } } /*------------------------------------------------------------------------------ * HOP *------------------------------------------------------------------------------*/ static void dissect_rsvp_hop(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hop, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_neighbor_address_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_logical_interface, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "HOP: IPv4, %s", tvb_ip_to_str(pinfo->pool, tvb, offset2)); break; case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hop, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_neighbor_address_ipv6, tvb, offset2, 16, ENC_NA); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_logical_interface, tvb, offset2+16, 4, ENC_BIG_ENDIAN); break; case 3: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hop, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_neighbor_address_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_logical_interface, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "HOP: IPv4 IF-ID. Control IPv4: %s. ", tvb_ip_to_str(pinfo->pool, tvb, offset2)); dissect_rsvp_ifid_tlv(ti, pinfo, rsvp_object_tree, tvb, offset+12, obj_length-12, TREE(TT_HOP_SUBOBJ)); break; case 4: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hop, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_neighbor_address_ipv6, tvb, offset2, 16, ENC_NA); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_logical_interface, tvb, offset2+16, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "HOP: IPv6 IF-ID. Control IPv6: %s. ", tvb_ip6_to_str(pinfo->pool, tvb, offset2)); dissect_rsvp_ifid_tlv(ti, pinfo, rsvp_object_tree, tvb, offset+24, obj_length-24, TREE(TT_HOP_SUBOBJ)); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hop, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hop_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * TIME VALUES *------------------------------------------------------------------------------*/ static void dissect_rsvp_time_values(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_time_values, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_refresh_interval, tvb, offset2, 4, tvb_get_ntohl(tvb, offset2), "%u ms (%u seconds)", tvb_get_ntohl(tvb, offset2), tvb_get_ntohl(tvb, offset2)/1000); proto_item_set_text(ti, "TIME VALUES: %d ms", tvb_get_ntohl(tvb, offset2)); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_time_values, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_time_values_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * Error value field in ERROR object *------------------------------------------------------------------------------*/ static guint16 dissect_rsvp_error_value(proto_tree *ti, tvbuff_t *tvb, int offset, guint8 error_code) { guint16 error_val; guint8 error_class, error_ctype; value_string_ext *rsvp_error_vals_ext_p = NULL; error_val = tvb_get_ntohs(tvb, offset); switch (error_code) { case RSVP_ERROR_ADMISSION: rsvp_error_vals_ext_p = &rsvp_admission_control_error_vals_ext; break; case RSVP_ERROR_POLICY: rsvp_error_vals_ext_p = &rsvp_policy_control_error_vals_ext; break; case RSVP_ERROR_TRAFFIC: rsvp_error_vals_ext_p = &rsvp_traffic_control_error_vals_ext; break; case RSVP_ERROR_ROUTING: rsvp_error_vals_ext_p = &rsvp_routing_error_vals_ext; break; case RSVP_ERROR_NOTIFY: rsvp_error_vals_ext_p = &rsvp_notify_error_vals_ext; break; case RSVP_ERROR_DIFFSERV: rsvp_error_vals_ext_p = &rsvp_diffserv_error_vals_ext; break; case RSVP_ERROR_DSTE: rsvp_error_vals_ext_p = &rsvp_diffserv_aware_te_error_vals_ext; break; case RSVP_ERROR_CALL_MGMT: rsvp_error_vals_ext_p = &rsvp_call_mgmt_error_vals_ext; break; } switch (error_code) { case RSVP_ERROR_ADMISSION: case RSVP_ERROR_TRAFFIC: if ((error_val & 0xc0) == 0) { DISSECTOR_ASSERT(rsvp_error_vals_ext_p != NULL); proto_tree_add_uint_format_value(ti, hf_rsvp_error_value, tvb, offset, 2, error_val, "%s (%u)", val_to_str_ext(error_val, rsvp_error_vals_ext_p, "Unknown (%d)"), error_val); } else if ((error_val & 0xc0) == 0x80) { proto_tree_add_uint_format_value(ti, hf_rsvp_error_value, tvb, offset, 2, error_val, "Organization specific subcode (%u)", error_val); } else if ((error_val & 0xc0) == 0xc0) { proto_tree_add_uint_format_value(ti, hf_rsvp_error_value, tvb, offset, 2, error_val, "Service specific subcode (%u)", error_val); } break; case RSVP_ERROR_UNKNOWN_CLASS: case RSVP_ERROR_UNKNOWN_C_TYPE: error_class = error_val / 256; error_ctype = error_val % 256; proto_tree_add_uint_format_value(ti, hf_rsvp_class, tvb, offset, 2, error_class, "%u (%s) - CType: %u", error_class, val_to_str_ext_const(error_class, &rsvp_class_vals_ext, "Unknown"), error_ctype); break; case RSVP_ERROR_POLICY: case RSVP_ERROR_NOTIFY: case RSVP_ERROR_ROUTING: case RSVP_ERROR_DIFFSERV: case RSVP_ERROR_DSTE: case RSVP_ERROR_CALL_MGMT: DISSECTOR_ASSERT(rsvp_error_vals_ext_p != NULL); proto_tree_add_uint_format_value(ti, hf_rsvp_error_value, tvb, offset, 2, error_val, "%s (%u)", val_to_str_ext(error_val, rsvp_error_vals_ext_p, "Unknown (%d)"), error_val); break; default: proto_tree_add_uint_format_value(ti, hf_rsvp_error_value, tvb, offset, 2, error_val, "%u", error_val); break; } return error_val; } /*------------------------------------------------------------------------------ * ERROR *------------------------------------------------------------------------------*/ static void dissect_rsvp_error(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; int offset3 = 0; guint8 error_flags; guint8 error_code; guint16 error_val; proto_tree *ti2 = NULL, *rsvp_error_subtree; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_error, tvb, offset+3, 1, ENC_BIG_ENDIAN); if(obj_length>4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_error_node_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN); offset3 = offset2+4; } break; } case 2: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_error, tvb, offset+3, 1, ENC_BIG_ENDIAN); if(obj_length>4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_error_node_ipv6, tvb, offset2, 16, ENC_NA); offset3 = offset2+16; } break; } case 3: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_error, tvb, offset+3, 1, ENC_BIG_ENDIAN); if(obj_length>4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_error_node_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN); offset3 = offset2+4; } break; } case 4: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_error, tvb, offset+3, 1, ENC_BIG_ENDIAN); if(obj_length>16) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_error_node_ipv6, tvb, offset2, 16, ENC_NA); offset3 = offset2+16; } break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_error, tvb, offset+3, 1, ENC_BIG_ENDIAN); if(obj_length>4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_data, tvb, offset2, obj_length - 4, ENC_NA); } return; } if(obj_length>4) { error_flags = tvb_get_guint8(tvb, offset3); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_flags, tvb, offset3, 1, ENC_BIG_ENDIAN); rsvp_error_subtree = proto_item_add_subtree(ti2, TREE(TT_ERROR_FLAGS)); proto_tree_add_item(rsvp_error_subtree, hf_rsvp_error_flags_path_state_removed, tvb, offset3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_error_subtree, hf_rsvp_error_flags_not_guilty, tvb, offset3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_error_subtree, hf_rsvp_error_flags_in_place, tvb, offset3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti2, " %s %s %s", (error_flags & (1U<<2)) ? "Path-State-Removed" : "", (error_flags & (1U<<1)) ? "NotGuilty" : "", (error_flags & (1U<<0)) ? "InPlace" : ""); error_code = tvb_get_guint8(tvb, offset3+1); proto_tree_add_item(rsvp_object_tree, hf_rsvp_error_error_code, tvb, offset3+1, 1, ENC_BIG_ENDIAN); error_val = dissect_rsvp_error_value(rsvp_object_tree, tvb, offset3+2, error_code); switch (type) { case 1: proto_item_set_text(ti, "ERROR: IPv4, Error code: %s, Value: %d, Error Node: %s", val_to_str_ext(error_code, &rsvp_error_codes_ext, "Unknown (%d)"), error_val, tvb_ip_to_str(pinfo->pool, tvb, offset2)); break; case 3: proto_item_set_text(ti, "ERROR: IPv4 IF-ID, Error code: %s, Value: %d, Control Node: %s. ", val_to_str_ext(error_code, &rsvp_error_codes_ext, "Unknown (%d)"), error_val, tvb_ip_to_str(pinfo->pool, tvb, offset2)); dissect_rsvp_ifid_tlv(ti, pinfo, rsvp_object_tree, tvb, offset+12, obj_length-12, TREE(TT_ERROR_SUBOBJ)); break; } } } /*------------------------------------------------------------------------------ * SCOPE *------------------------------------------------------------------------------*/ static void dissect_rsvp_scope(proto_item *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); mylen = obj_length - 4; switch(type) { case 1: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_scope, tvb, offset+3, 1, ENC_BIG_ENDIAN); while (mylen > 0) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_scope_ipv4_address, tvb, offset2, 4, ENC_BIG_ENDIAN); offset2 += 4; mylen -= 4; } break; } case 2: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_scope, tvb, offset+3, 1, ENC_BIG_ENDIAN); while (mylen > 0) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_scope_ipv6_address, tvb, offset2, 16, ENC_NA); offset2 += 16; mylen -= 16; } break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_scope, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_scope_data, tvb, offset2, mylen, ENC_NA); break; } } /*------------------------------------------------------------------------------ * STYLE *------------------------------------------------------------------------------*/ static void dissect_rsvp_style(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: { guint32 style; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_style, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_style_flags, tvb, offset2, 1, ENC_BIG_ENDIAN); style = tvb_get_ntoh24(tvb, offset2+1); proto_tree_add_item(rsvp_object_tree, hf_rsvp_style_style, tvb, offset2+1, 3, ENC_BIG_ENDIAN); proto_item_set_text(ti, "STYLE: %s (%d)", val_to_str_const(style, style_vals, "Unknown"), style); break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_style, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_style_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * CONFIRM *------------------------------------------------------------------------------*/ static void dissect_rsvp_confirm(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_confirm, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_confirm_receiver_address_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "CONFIRM: Receiver %s", tvb_ip_to_str(wmem_packet_scope(), tvb, offset2)); break; } case 2: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_confirm, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_confirm_receiver_address_ipv6, tvb, offset2, 16, ENC_NA); break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_confirm, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_confirm_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * SENDER TEMPLATE and FILTERSPEC *------------------------------------------------------------------------------*/ static void dissect_rsvp_template_filter(packet_info *pinfo, proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type, rsvp_conversation_info *rsvph) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "%s", summary_template(pinfo->pool, tvb, offset)); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_PORT], tvb, offset2+6, 2, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key later. */ set_address_tvb(&rsvph->source, AT_IPv4, 4, tvb, offset2); rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); break; case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_source_address_ipv6, tvb, offset2, 16, ENC_NA); proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_source_port, tvb, offset2+18, 2, ENC_BIG_ENDIAN); break; case 7: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); /*short call ID*/ if (rsvp_class == RSVP_CLASS_SENDER_TEMPLATE){ proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_SHORT_CALL_ID], tvb, offset2+4, 2, ENC_BIG_ENDIAN); } proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_LSP_ID], tvb, offset2+6, 2, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key later. */ set_address_tvb(&rsvph->source, AT_IPv4, 4, tvb, offset2); rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); break; case 8: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_IP], tvb, offset2, 16, ENC_BIG_ENDIAN); /*short call ID*/ if (rsvp_class == RSVP_CLASS_SENDER_TEMPLATE){ proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_SHORT_CALL_ID], tvb, offset2+16, 2, ENC_BIG_ENDIAN); } proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_LSP_ID], tvb, offset2+18, 2, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key later. */ set_address_tvb(&rsvph->source, AT_IPv6, 16, tvb, offset2); rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+18); break; case 9: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_IP], tvb, offset2, 4, ENC_BIG_ENDIAN); /* * Save this information to build the conversation request key later. */ set_address_tvb(&rsvph->source, AT_IPv4, 4, tvb, offset2); break; case 12: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_ipv4_tunnel_sender_address, tvb, offset2, 4, ENC_BIG_ENDIAN); offset2 += 4; proto_tree_add_item(rsvp_object_tree, hf_rsvp_reserved, tvb, offset2, 2, ENC_NA); offset2 += 2; proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_LSP_ID], tvb, offset2, 2, ENC_BIG_ENDIAN); offset2 += 2; proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_sub_group_originator_id, tvb, offset2, 4, ENC_NA); offset2 += 4; proto_tree_add_item(rsvp_object_tree, hf_rsvp_reserved, tvb, offset2, 2, ENC_NA); offset2 += 2; proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_sub_group_id, tvb, offset2, 2, ENC_BIG_ENDIAN); /*offset += 2;*/ break; case 13: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_ipv6_tunnel_sender_address, tvb, offset2, 16, ENC_NA); offset2 += 16; proto_tree_add_item(rsvp_object_tree, hf_rsvp_reserved, tvb, offset2, 2, ENC_NA); offset2 += 2; proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_SENDER_LSP_ID], tvb, offset2, 2, ENC_BIG_ENDIAN); offset2 += 2; proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_sub_group_originator_id, tvb, offset2, 16, ENC_NA); offset2 += 16; proto_tree_add_item(rsvp_object_tree, hf_rsvp_reserved, tvb, offset2, 2, ENC_NA); offset2 += 2; proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_sub_group_id, tvb, offset2, 2, ENC_BIG_ENDIAN); /*offset += 2;*/ break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_template_filter_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * TLVs for Ethernet SENDER TSPEC and FLOWSPEC (RFC6003) *------------------------------------------------------------------------------*/ static void dissect_rsvp_eth_tspec_tlv(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int tlv_length, int subtree_type) { int tlv_off; int bit_offset; guint16 tlv_type; int tlv_len; guint8 profile; proto_tree *rsvp_ethspec_subtree, *ethspec_profile_subtree, *ti3; for (tlv_off = 0; tlv_off < tlv_length; ) { tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); if ((tlv_len == 0) || (tlv_off+tlv_len > tlv_length)) { proto_tree_add_expert(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+tlv_off+2, 2); return; } switch(tlv_type) { case 0: case 1: /*case 2: ethernet bandwidth profile accordig to RFC 6003*/ case 2: rsvp_ethspec_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "Ethernet Bandwidth Profile TLV: CIR=%.10g, CBS=%.10g, " "EIR=%.10g, EBS=%.10g", tvb_get_ntohieee_float(tvb, offset+tlv_off+8), tvb_get_ntohieee_float(tvb, offset+tlv_off+12), tvb_get_ntohieee_float(tvb, offset+tlv_off+16), tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); proto_tree_add_uint_format_value(rsvp_ethspec_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%u - Ethernet Bandwidth Profile", tlv_type); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); profile = tvb_get_guint8(tvb, offset+tlv_off+4); ti3 = proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_profile, tvb, offset+tlv_off+4, 1, ENC_NA); ethspec_profile_subtree = proto_item_add_subtree(ti3, TREE(TT_ETHSPEC_SUBTREE)); proto_tree_add_item(ethspec_profile_subtree, hf_rsvp_eth_tspec_tlv_color_mode, tvb, offset+tlv_off+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ethspec_profile_subtree, hf_rsvp_eth_tspec_tlv_coupling_flag, tvb, offset+tlv_off+4, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti3, " %s %s", (profile & (1U<<1)) ? "CM" : "", (profile & (1U<<0)) ? "CF" : ""); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_index, tvb, offset+tlv_off+5, 1, ENC_NA); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_reserved, tvb, offset+tlv_off+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_cir, tvb, offset+tlv_off+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_cbs, tvb, offset+tlv_off+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_eir, tvb, offset+tlv_off+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_ebs, tvb, offset+tlv_off+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "ETH profile: CIR=%.10g, CBS=%.10g, EIR=%.10g, " "EBS=%.10g", tvb_get_ntohieee_float(tvb, offset+tlv_off+8), tvb_get_ntohieee_float(tvb, offset+tlv_off+12), tvb_get_ntohieee_float(tvb, offset+tlv_off+16), tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); break; /* L2CP RFC 6004 */ case 3: if (tlv_len != 8){ proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+tlv_off+2, 2, "Invalid TLV length"); return; } /* point to the first bit in the Ingress Layer 2 Control Processing */ bit_offset = (offset<<5) + 31; proto_tree_add_bits_item(rsvp_object_tree, hf_rsvp_eth_tspec_il2cp, tvb, bit_offset, 4, ENC_BIG_ENDIAN); bit_offset += 4; proto_tree_add_bits_item(rsvp_object_tree, hf_rsvp_eth_tspec_el2cp, tvb, bit_offset, 4, ENC_BIG_ENDIAN); break; case 255: rsvp_ethspec_subtree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "RESERVED (RFC6003)"); proto_tree_add_uint_format_value(rsvp_ethspec_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%u (RESERVED)", tlv_type); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); break; case 129: /* OIF demo 2009 */ rsvp_ethspec_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "Ethernet Bandwidth Profile TLV: CIR=%.10g, CBS=%.10g, " "EIR=%.10g, EBS=%.10g", tvb_get_ntohieee_float(tvb, offset+tlv_off+8), tvb_get_ntohieee_float(tvb, offset+tlv_off+12), tvb_get_ntohieee_float(tvb, offset+tlv_off+16), tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); proto_tree_add_uint_format_value(rsvp_ethspec_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "%u - Ethernet Bandwidth Profile", tlv_type); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); profile = tvb_get_guint8(tvb, offset+tlv_off+4); ti3 = proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_profile, tvb, offset+tlv_off+4, 1, ENC_BIG_ENDIAN); ethspec_profile_subtree = proto_item_add_subtree(ti3, TREE(TT_ETHSPEC_SUBTREE)); proto_tree_add_item(ethspec_profile_subtree, hf_rsvp_eth_tspec_tlv_color_mode, tvb, offset+tlv_off+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ethspec_profile_subtree, hf_rsvp_eth_tspec_tlv_coupling_flag, tvb, offset+tlv_off+4, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti3, " %s %s", (profile & (1U<<1)) ? "CM" : "", (profile & (1U<<0)) ? "CF" : ""); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_index, tvb, offset+tlv_off+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_reserved, tvb, offset+tlv_off+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_cir, tvb, offset+tlv_off+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_cbs, tvb, offset+tlv_off+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_eir, tvb, offset+tlv_off+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ethspec_subtree, hf_rsvp_eth_tspec_ebs, tvb, offset+tlv_off+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "ETH profile: CIR=%.10g, CBS=%.10g, EIR=%.10g, " "EBS=%.10g", tvb_get_ntohieee_float(tvb, offset+tlv_off+8), tvb_get_ntohieee_float(tvb, offset+tlv_off+12), tvb_get_ntohieee_float(tvb, offset+tlv_off+16), tvb_get_ntohieee_float(tvb, offset+tlv_off+20)); break; default: proto_tree_add_uint_format(rsvp_object_tree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "Unknown TLV: %u", tlv_type); break; } tlv_off += tlv_len; } } /*------------------------------------------------------------------------------ * SENDER TSPEC *------------------------------------------------------------------------------*/ static const value_string rsvp_switching_granularity_vals[] = { {0, "Provided in signaling"}, {1, "Ethernet port"}, {2, "Ethernet frame"}, {0, NULL } }; static void dissect_rsvp_tspec(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; proto_tree *tspec_tree, *ti2 = NULL; guint8 signal_type; guint16 m; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); mylen = obj_length - 4; switch(type) { case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_message_format_version, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_data_length, tvb, offset2+2, 2, ENC_BIG_ENDIAN); mylen -= 4; offset2 += 4; proto_item_set_text(ti, "SENDER TSPEC: IntServ, "); while (mylen > 0) { guint8 param_id; guint param_len, raw_len; guint param_len_processed; guint length; proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_service_header, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint(rsvp_object_tree, hf_rsvp_data_length, tvb, offset2+2, 2, ENC_BIG_ENDIAN, &length); mylen -= 4; offset2 += 4; /* Process all known service headers as a set of parameters */ param_len_processed = 0; while (param_len_processed < length) { param_id = tvb_get_guint8(tvb, offset2); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_parameter, tvb, offset2, 1, ENC_NA); raw_len = tvb_get_ntohs(tvb, offset2+2); param_len = raw_len + 1; switch(param_id) { case 127: /* Token Bucket */ proto_item_set_len(ti2, param_len*4); tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); proto_tree_add_item(tspec_tree, hf_rsvp_parameter_flags, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(tspec_tree, hf_rsvp_parameter_length, tvb, offset2+2, 2, raw_len); proto_tree_add_item(tspec_tree, hf_rsvp_tspec_token_bucket_rate, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_tspec_token_bucket_size, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_tspec_peak_data_rate, tvb, offset2+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_minimum_policed_unit, tvb, offset2+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_maximum_packet_size, tvb, offset2+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ", tvb_get_ntohieee_float(tvb, offset2+4)); proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u", tvb_get_ntohieee_float(tvb, offset2+4), tvb_get_ntohieee_float(tvb, offset2+8), tvb_get_ntohieee_float(tvb, offset2+12), tvb_get_ntohl(tvb, offset2+16), tvb_get_ntohl(tvb, offset2+20)); break; case 128: /* Null Service (RFC2997) */ proto_item_set_len(ti2, param_len*4); tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); proto_tree_add_item(tspec_tree, hf_rsvp_parameter_flags, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(tspec_tree, hf_rsvp_parameter_length, tvb, offset2+2, 2, raw_len); proto_tree_add_item(tspec_tree, hf_rsvp_maximum_packet_size, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Null Service. M=%u", tvb_get_ntohl(tvb, offset2+4)); proto_item_append_text(ti2, "Max pkt size=%u", tvb_get_ntohl(tvb, offset2+4)); break; case 126: /* Compression hint (RFC3006) */ proto_item_set_len(ti2, param_len*4); tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); proto_tree_add_item(tspec_tree, hf_rsvp_parameter_flags, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(tspec_tree, hf_rsvp_parameter_length, tvb, offset2+2, 2, raw_len); proto_tree_add_item(tspec_tree, hf_rsvp_tspec_hint, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_compression_factor, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Compression Hint. Hint=%u, Factor=%u", tvb_get_ntohl(tvb, offset2+4), tvb_get_ntohl(tvb, offset2+8)); proto_item_append_text(ti2, "Hint=%u, Factor=%u", tvb_get_ntohl(tvb, offset2+4), tvb_get_ntohl(tvb, offset2+8)); break; default: proto_item_set_len(ti2, param_len*4); expert_add_info_format(pinfo, ti2, &ei_rsvp_parameter, "Unknown parameter %d, %d words", param_id, param_len); break; } param_len_processed += param_len; offset2 += param_len*4; } mylen -= length*4; } break; case 4: /* SONET/SDH Tspec */ proto_item_set_text(ti, "SENDER TSPEC: SONET/SDH, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); signal_type = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_signal_type_sonet, tvb, offset2, 1, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_requested_concatenation, tvb, offset2+1, 1, ENC_BIG_ENDIAN); tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_standard_contiguous_concatenation, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_arbitrary_contiguous_concatenation, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_number_of_contiguous_components, tvb, offset2+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_number_of_virtual_components, tvb, offset2+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_multiplier, tvb, offset2+6, 2, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); tspec_tree = proto_item_add_subtree(ti2, TREE(TT_TSPEC_SUBTREE)); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_regenerator_section, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_multiplex_section, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_J0_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_SOH_RSOH_DCC_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_LOH_MSOH_DCC_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_LOH_MSOH_extended_DCC_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_K1_K2_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_E1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_F1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_E2_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_B1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_B2_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_M0_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tspec_tree, hf_rsvp_sender_tspec_M1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_profile, tvb, offset2+12, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d", val_to_str_ext_const(signal_type, &gmpls_sonet_signal_type_str_ext, "Unknown"), tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2), tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6), tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12)); break; case 5: /* FF: G.709 TSPEC, RFC 4328 */ proto_item_set_text(ti, "SENDER TSPEC: G.709, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tspec, tvb, offset + 3, 1, ENC_BIG_ENDIAN); signal_type = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_signal_type_g709, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_number_of_multiplexed_components, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_number_of_virtual_components, tvb, offset2 + 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_multiplier, tvb, offset2 + 6, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Signal [%s], NMC %d, NVC %d, MT %d", rval_to_str_const(signal_type, gmpls_g709_signal_type_rvals, "Unknown"), tvb_get_ntohs(tvb, offset2 + 2), tvb_get_ntohs(tvb, offset2 + 4), tvb_get_ntohs(tvb, offset2 + 6)); break; case 6: /* Ethernet TSPEC (RFC6003) */ proto_item_set_text(ti, "SENDER TSPEC: Ethernet, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_switching_granularity, tvb, offset2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_mtu, tvb, offset2+2, 2, ENC_BIG_ENDIAN); dissect_rsvp_eth_tspec_tlv(ti, pinfo, rsvp_object_tree, tvb, offset+8, obj_length-8, TREE(TT_TSPEC_SUBTREE)); break; case 8: /* SSON FOWSPEC (RFC7762)*/ m = tvb_get_ntohs(tvb, offset2); proto_item_set_text(ti, "SENDER TSPEC: SSON, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_flowspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_m, tvb, offset2, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "slot width (m) = %f (%d)", m*12.5, tvb_get_ntohs(tvb, offset2)); break; default: /* Unknown TSpec */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_tspec_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * FLOWSPEC *------------------------------------------------------------------------------*/ static void dissect_rsvp_flowspec(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen, signal_type; proto_tree *flowspec_tree, *ti2 = NULL; proto_item *hidden_item; guint16 m; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); mylen = obj_length - 4; switch(type) { case 2: if (mylen < 4) { proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, 0, 0, "Object length %u < 8", obj_length); return; } proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_flowspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_message_format_version, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_data_length, tvb, offset2+2, 2, ENC_BIG_ENDIAN); proto_item_set_text(ti, "FLOWSPEC: "); mylen -= 4; offset2+= 4; while (mylen > 0) { guint8 service_num; guint length; guint8 param_id; guint param_len, raw_len; guint param_len_processed; if (mylen < 4) { proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, 0, 0, "Object length %u not large enough", obj_length); return; } service_num = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_service_header, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint(rsvp_object_tree, hf_rsvp_data_length, tvb, offset2+2, 2, ENC_BIG_ENDIAN, &length); mylen -= 4; offset2 += 4; proto_item_append_text(ti, "%s: ", val_to_str_ext(service_num, &intsrv_services_str_ext, "Unknown (%d)")); /* Process all known service headers as a set of parameters */ param_len_processed = 0; while (param_len_processed < length) { ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_parameter, tvb, offset2, 1, ENC_NA); param_id = tvb_get_guint8(tvb, offset2); raw_len = tvb_get_ntohs(tvb, offset2+2); param_len = raw_len + 1; switch(param_id) { case 127: /* Token Bucket */ proto_item_set_len(ti2, param_len*4); flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); proto_tree_add_item(flowspec_tree, hf_rsvp_parameter_flags, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(flowspec_tree, hf_rsvp_parameter_length, tvb, offset2+2, 2, raw_len); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_token_bucket_rate, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_token_bucket_size, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_peak_data_rate, tvb, offset2+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_minimum_policed_unit, tvb, offset2+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_maximum_packet_size, tvb, offset2+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Token Bucket, %.10g bytes/sec. ", tvb_get_ntohieee_float(tvb, offset2+4)); proto_item_append_text(ti2, "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u", tvb_get_ntohieee_float(tvb, offset2+4), tvb_get_ntohieee_float(tvb, offset2+8), tvb_get_ntohieee_float(tvb, offset2+12), tvb_get_ntohl(tvb, offset2+16), tvb_get_ntohl(tvb, offset2+20)); break; case 130: /* Guaranteed-rate RSpec */ proto_item_set_len(ti2, param_len*4); flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); proto_tree_add_item(flowspec_tree, hf_rsvp_parameter_flags, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(flowspec_tree, hf_rsvp_parameter_length, tvb, offset2+2, 2, raw_len); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_rate, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_slack_term, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "RSpec, %.10g bytes/sec. ", tvb_get_ntohieee_float(tvb, offset2+4)); proto_item_append_text(ti2, "R=%.10g, s=%u", tvb_get_ntohieee_float(tvb, offset2+4), tvb_get_ntohl(tvb, offset2+8)); break; case 128: /* Null Service (RFC2997) */ proto_item_set_len(ti2, param_len*4); flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); proto_tree_add_item(flowspec_tree, hf_rsvp_parameter_flags, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(flowspec_tree, hf_rsvp_parameter_length, tvb, offset2+2, 2, raw_len); proto_tree_add_item(flowspec_tree, hf_rsvp_maximum_packet_size, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Null Service. M=%u", tvb_get_ntohl(tvb, offset2+4)); proto_item_append_text(ti2, "Max pkt size=%u", tvb_get_ntohl(tvb, offset2+4)); break; default: expert_add_info_format(pinfo, ti2, &ei_rsvp_parameter, "Unknown parameter %d, %d words", param_id, param_len); break; } param_len_processed += param_len; offset2 += param_len * 4; } /* offset2 += length*4; */ mylen -= length*4; } break; case 4: proto_item_set_text(ti, "FLOWSPEC: SONET/SDH, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_flowspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); signal_type = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_signal_type_sonet, tvb, offset2, 1, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_requested_concatenation, tvb, offset2+1, 1, ENC_BIG_ENDIAN); flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_standard_contiguous_concatenation, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_arbitrary_contiguous_concatenation, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_number_of_contiguous_components, tvb, offset2+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_number_of_virtual_components, tvb, offset2+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_multiplier, tvb, offset2+6, 2, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); flowspec_tree = proto_item_add_subtree(ti2, TREE(TT_FLOWSPEC_SUBTREE)); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_regenerator_section, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_multiplex_section, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_J0_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_SOH_RSOH_DCC_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_LOH_MSOH_DCC_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_LOH_MSOH_extended_DCC_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_K1_K2_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_E1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_F1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_E2_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_B1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_B2_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_M0_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flowspec_tree, hf_rsvp_flowspec_M1_transparency, tvb, offset2+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_profile, tvb, offset2+12, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d", val_to_str_ext_const(signal_type, &gmpls_sonet_signal_type_str_ext, "Unknown"), tvb_get_guint8(tvb, offset2+1), tvb_get_ntohs(tvb, offset2+2), tvb_get_ntohs(tvb, offset2+4), tvb_get_ntohs(tvb, offset2+6), tvb_get_ntohl(tvb, offset2+8), tvb_get_ntohl(tvb, offset2+12)); break; case 5: /* FF: G.709 FLOWSPEC, RFC 4328 */ proto_item_set_text(ti, "FLOWSPEC: G.709, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_flowspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); signal_type = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_signal_type_g709, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_number_of_multiplexed_components, tvb, offset2 + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_number_of_virtual_components, tvb, offset2 + 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_multiplier, tvb, offset2 + 6, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Signal [%s], NMC %d, NVC %d, MT %d", rval_to_str_const(signal_type, gmpls_g709_signal_type_rvals, "Unknown"), tvb_get_ntohs(tvb, offset2 + 2), tvb_get_ntohs(tvb, offset2 + 4), tvb_get_ntohs(tvb, offset2 + 6)); break; case 6: /* Ethernet FLOWSPEC (RFC6003) */ proto_item_set_text(ti, "FLOWSPEC: Ethernet, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_flowspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_switching_granularity, tvb, offset2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_mtu, tvb, offset2+2, 2, ENC_BIG_ENDIAN); dissect_rsvp_eth_tspec_tlv(ti, pinfo, rsvp_object_tree, tvb, offset+8, obj_length-8, TREE(TT_FLOWSPEC_SUBTREE)); break; case 8: /* SSON FOWSPEC (RFC7762)*/ m = tvb_get_ntohs(tvb, offset2); proto_item_set_text(ti, "FLOWSPEC: SSON, "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_flowspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_flowspec_m, tvb, offset2, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "slot width (m) = %f (%d)", m*12.5, tvb_get_ntohs(tvb, offset2)); break; default: break; } } /*------------------------------------------------------------------------------ * ADSPEC *------------------------------------------------------------------------------*/ static void dissect_rsvp_adspec(proto_item *ti _U_, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type _U_) { int offset2 = offset + 4; int mylen, i; proto_tree *adspec_tree, *adspec_type_tree; proto_item *ti2; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_adspec, tvb, offset+3, 1, ENC_BIG_ENDIAN); mylen = obj_length - 4; proto_tree_add_item(rsvp_object_tree, hf_rsvp_adspec_message_format_version, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_data_length, tvb, offset2+2, 2, ENC_BIG_ENDIAN); mylen -= 4; offset2 += 4; while (mylen > 0) { guint8 service_num; guint length; const char *str; service_num = tvb_get_guint8(tvb, offset2); str = val_to_str_ext_const(service_num, &intsrv_services_str_ext, "Unknown"); length = tvb_get_ntohs(tvb, offset2+2); adspec_tree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset2, (length+1)*4, TREE(TT_ADSPEC_SUBTREE), NULL, str); proto_tree_add_item(adspec_tree, hf_rsvp_adspec_service_header, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(adspec_tree, hf_rsvp_hf_rsvp_adspec_break_bit, tvb, offset2+1, 1, ENC_NA); proto_tree_add_uint(adspec_tree, hf_rsvp_data_length, tvb, offset2+2, 2, length); mylen -= 4; offset2 += 4; i = length*4; while (i > 0) { guint id, phdr_length; ti2 = proto_tree_add_item_ret_uint(adspec_tree, hf_rsvp_adspec_type, tvb, offset2, 1, ENC_NA, &id); adspec_type_tree = proto_item_add_subtree(ti2, TREE(TT_ADSPEC_TYPE_SUBTREE)); proto_tree_add_item_ret_uint(adspec_type_tree, hf_rsvp_adspec_len, tvb, offset2+2, 2, ENC_BIG_ENDIAN, &phdr_length); proto_item_set_len(ti2, phdr_length); str = try_val_to_str_ext(id, &adspec_params_ext); if (str) { switch(id) { case 4: case 8: case 10: case 133: case 134: case 135: case 136: /* 32-bit unsigned integer */ proto_tree_add_uint_format(adspec_type_tree, hf_rsvp_adspec_uint, tvb, offset2, (phdr_length+1)<<2, tvb_get_ntohl(tvb, offset2+4), "%s: %u", str, tvb_get_ntohl(tvb, offset2+4)); break; case 6: /* IEEE float */ proto_tree_add_float_format(adspec_type_tree, hf_rsvp_adspec_float, tvb, offset2, (phdr_length+1)<<2, tvb_get_ntohieee_float(tvb, offset2+4), "%s: %.10g", str, tvb_get_ntohieee_float(tvb, offset2+4)); break; default: proto_tree_add_bytes_format(adspec_tree, hf_rsvp_adspec_bytes, tvb, offset2, (phdr_length+1)<<2, NULL, "%s", str); break; } } else { expert_add_info(pinfo, ti2, &ei_rsvp_adspec_type); } offset2 += (phdr_length+1)<<2; i -= (phdr_length+1)<<2; mylen -= (phdr_length+1)<<2; } } } /*------------------------------------------------------------------------------ * INTEGRITY *------------------------------------------------------------------------------*/ static void dissect_rsvp_integrity(proto_item *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type _U_) { int offset2 = offset + 4; proto_tree *ti2, *rsvp_integ_flags_tree; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_integrity, tvb, offset+3, 1, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_integrity_flags, tvb, offset2, 1, ENC_BIG_ENDIAN); rsvp_integ_flags_tree = proto_item_add_subtree(ti2, TREE(TT_INTEGRITY_FLAGS)); proto_tree_add_item(rsvp_integ_flags_tree, hf_rsvp_integrity_flags_handshake, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_integrity_key_identifier, tvb, offset2+2, 6, ENC_NA); proto_tree_add_item(rsvp_object_tree, hf_rsvp_integrity_sequence_number, tvb, offset2+8, 8, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_integrity_hash, tvb, offset2+16, obj_length - 20, ENC_NA); } /*------------------------------------------------------------------------------ * POLICY *------------------------------------------------------------------------------*/ static void dissect_rsvp_policy(proto_item *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type _U_) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_policy, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_policy_data, tvb, offset2, obj_length - 4, ENC_NA); } /*------------------------------------------------------------------------------ * LABEL_REQUEST *------------------------------------------------------------------------------*/ static void dissect_rsvp_label_request(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_label_request, tvb, offset+3, 1, ENC_BIG_ENDIAN); switch(type) { case 1: { unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_l3pid, tvb, offset2+2, 2, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LABEL REQUEST: Basic: L3PID: %s (0x%04x)", val_to_str_const(l3pid, etype_vals, "Unknown"), l3pid); break; } case 2: { unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); unsigned short min_vpi, min_vci, max_vpi, max_vci; proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_l3pid, tvb, offset2+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_m, tvb, offset2+4, 1, ENC_NA); min_vpi = tvb_get_ntohs(tvb, offset2+4) & 0x7f; min_vci = tvb_get_ntohs(tvb, offset2+6); max_vpi = tvb_get_ntohs(tvb, offset2+8) & 0x7f; max_vci = tvb_get_ntohs(tvb, offset2+10); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_min_vpi, tvb, offset2+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_min_vci, tvb, offset2+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_max_vpi, tvb, offset2+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_max_vci, tvb, offset2+10, 2, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LABEL REQUEST: ATM: L3PID: %s (0x%04x). VPI/VCI: Min: %d/%d, Max: %d/%d. %s Merge. ", val_to_str_const(l3pid, etype_vals, "Unknown"), l3pid, min_vpi, min_vci, max_vpi, max_vci, (tvb_get_guint8(tvb, offset2+4) & 0x80) ? "Can" : "Cannot"); break; } case 3: { guint16 l3pid = tvb_get_ntohs(tvb, offset2+2); guint32 min_dlci, max_dlci, dlci_len, dlci_len_code; proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_l3pid, tvb, offset2+2, 2, ENC_BIG_ENDIAN); dlci_len_code = (tvb_get_ntohs(tvb, offset2+4) & 0x0180) >> 7; min_dlci = tvb_get_ntohl(tvb, offset2+4) & 0x7fffff; max_dlci = tvb_get_ntohl(tvb, offset2+8) & 0x7fffff; switch(dlci_len_code) { case 0: /* 10-bit DLCIs */ dlci_len = 10; min_dlci &= 0x3ff; max_dlci &= 0x3ff; break; case 2: dlci_len = 23; break; default: dlci_len = 0; min_dlci = 0; max_dlci = 0; break; } proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_dlci_length, tvb, offset2+4, 2, dlci_len, "%s (%d)", (dlci_len==10) ? "10 bits" : (dlci_len==23) ? "23 bits" : "INVALID", dlci_len_code); proto_tree_add_uint(rsvp_object_tree, hf_rsvp_min_dlci, tvb, offset2+5, 3, min_dlci); proto_tree_add_uint(rsvp_object_tree, hf_rsvp_max_dlci, tvb, offset2+8, 2, max_dlci); proto_item_set_text(ti, "LABEL REQUEST: Frame: L3PID: %s (0x%04x). DLCI Len: %s. Min DLCI: %d. Max DLCI: %d", val_to_str_const(l3pid, etype_vals, "Unknown"), l3pid, (dlci_len==10) ? "10 bits" : (dlci_len==23) ? "23 bits" : "INVALID", min_dlci, max_dlci); break; } case 4: case 5: { unsigned short l3pid = tvb_get_ntohs(tvb, offset2+2); unsigned char lsp_enc = tvb_get_guint8(tvb,offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_lsp_encoding_type, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_switching_type, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_g_pid, tvb, offset2+2, 2, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LABEL REQUEST: Generalized: LSP Encoding=%s, " "Switching Type=%s, G-PID=%s ", rval_to_str(lsp_enc, gmpls_lsp_enc_rvals, "Unknown (%d)"), rval_to_str(tvb_get_guint8(tvb,offset2+1), gmpls_switching_type_rvals, "Unknown (%d)"), rval_to_str_const(l3pid, gmpls_gpid_rvals, val_to_str(l3pid, etype_vals, "Unknown (0x%04x)"))); break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_request_data, tvb, offset2, obj_length - 4, ENC_NA); break; } /* switch(type) */ } /*----------------------------------------------------------------------------- * LABEL *---------------------------------------------------------------------------*/ /* FF: G.694 lambda label, see draft-ietf-ccamp-gmpls-g-694-lambda-labels-05 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Grid | C.S | Reserved | n | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ static const value_string lambda_grid_vals[] = { { 1, "DWDM"}, { 2, "CWDM"}, { 3, "Flexi"}, { 0, NULL } }; static const value_string grid1_cs_vals[] = { { 1, "100GHz"}, { 2, "50GHz"}, { 3, "25GHz"}, { 4, "12.5GHz"}, { 0, NULL } }; static const value_string grid2_cs_vals[] = { { 1, "20nm"}, { 0, NULL } }; static const value_string grid3_cs_vals[] = { { 5, "6.25GHz"}, { 0, NULL } }; static void dissect_glabel_lambda(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset) { float freq = 0.0f; float slot_width = 0.0f; guint32 wavelength = 0; float cs_thz = 0.0f; proto_tree *wavelength_tree; guint8 grid, cs; gint16 n, m; grid = ((tvb_get_guint8(tvb, offset) & 0xE0) >> 5); cs = ((tvb_get_guint8(tvb, offset) & 0x1E) >> 1); n = tvb_get_ntohs(tvb, offset + 2); wavelength_tree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset, 4, TREE(TT_WAVELENGTH), NULL, "Wavelength Label"); proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_grid, tvb, offset, 1, ENC_NA); switch(grid) { case 1: /* DWDM grid: Frequency (THz) = 193.1 THz + n * channel spacing (THz) */ cs_thz = cs == 1 ? 0.1f : cs == 2 ? 0.05f : cs == 3 ? 0.025f : cs == 4 ? 0.0125f : 0.0f; freq = 193.1f + (n * cs_thz); proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_cs1, tvb, offset, 1, ENC_NA); proto_tree_add_uint_format_value(wavelength_tree, hf_rsvp_wavelength_n, tvb, offset+2, 2, n, "%d", n); proto_tree_add_float_format_value(wavelength_tree, hf_rsvp_wavelength_freq, tvb, offset, 4, freq, "%.2fTHz", freq); proto_item_append_text(ti, ": Wavelength: grid=DWDM, channel spacing=%s, central frequency=%d, freq=%.2fTHz", val_to_str_const(cs, grid1_cs_vals, "Unknown"), n, freq); break; case 2: /* CWDM grid: Wavelength (nm) = 1471 nm + n * 20 nm */ wavelength = 1471 + (n * 20); proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_cs2, tvb, offset, 1, ENC_NA); proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_n, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(wavelength_tree, hf_rsvp_wavelength_wavelength, tvb, offset, 4, wavelength, "%unm", wavelength); proto_item_append_text(ti, ": Wavelength: grid=CWDM, channel spacing=%s, central frequenc=%d, wavelength=%unm", val_to_str_const(cs, grid2_cs_vals, "Unknown"), n, wavelength); break; case 3: /* flexi grid: Slot width (Ghz) = 12.5 Ghz * m, see RFC 7699 */ m = tvb_get_ntohs(tvb, offset + 4); slot_width = 12.5f * m; proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_cs3, tvb, offset, 1, ENC_NA); proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_n, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_float_format_value(wavelength_tree, hf_rsvp_wavelength_m, tvb, offset, 4, slot_width, "%.2fGHz", slot_width); proto_item_append_text(ti, ": Wavelength: grid=flexi, channel spacing=%s, central frequenc=%d, Channel Width=%.2fGhz", val_to_str_const(cs, grid3_cs_vals, "Unknown"), n, slot_width); break; default: /* unknown grid: */ proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_channel_spacing, tvb, offset, 1, ENC_NA); proto_tree_add_item(wavelength_tree, hf_rsvp_wavelength_n, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, ": Wavelength: grid=%u, channel spacing=%u, central frequenc=%d", grid, cs, n); break; } } /* FF: SONET/SDH label, see RFC 4606 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | S | U | K | L | M | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ static void dissect_glabel_sdh(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset) { guint16 s; guint8 u, k, l, m; proto_tree* sonet_tree; sonet_tree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset, 4, TREE(TT_SONET_SDH), NULL, "SONET/SDH Label"); proto_tree_add_item(sonet_tree, hf_rsvp_sonet_s, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sonet_tree, hf_rsvp_sonet_u, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sonet_tree, hf_rsvp_sonet_k, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sonet_tree, hf_rsvp_sonet_l, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sonet_tree, hf_rsvp_sonet_m, tvb, offset+3, 1, ENC_BIG_ENDIAN); s = tvb_get_ntohs(tvb, offset); u = ((tvb_get_guint8(tvb, offset + 2) & 0xF0) >> 4); k = ((tvb_get_guint8(tvb, offset + 2) & 0x0F) >> 0); l = ((tvb_get_guint8(tvb, offset + 3) & 0xF0) >> 4); m = ((tvb_get_guint8(tvb, offset + 3) & 0x0F) >> 0); proto_item_append_text(ti, ": SONET/SDH: S=%u, U=%u, K=%u, L=%u, M=%u", s, u, k, l, m); } /* FF: G.709 label (aka ODUk label), see RFC 4328 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | t3 | t2 |t1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ static void dissect_glabel_g709(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset) { guint8 t1, t2, t3; proto_tree* g709_tree; g709_tree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset, 4, TREE(TT_G709), NULL, "G.709 ODUk Label"); proto_tree_add_item(g709_tree, hf_rsvp_g709_t3, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(g709_tree, hf_rsvp_g709_t2, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(g709_tree, hf_rsvp_g709_t1, tvb, offset+3, 1, ENC_BIG_ENDIAN); t2 = ((tvb_get_guint8(tvb, offset + 3) & 0x0E) >> 1); t1 = ((tvb_get_guint8(tvb, offset + 3) & 0x01) >> 0); t3 = ((tvb_get_guint8(tvb, offset + 2) & 0x03) << 4); t3 |= ((tvb_get_guint8(tvb, offset + 3) & 0xF0) >> 4); proto_item_append_text(ti, ": G.709 ODUk: " "t3=%u, " "t2=%u, " "t1=%u", t3, t2, t1); } /* FF: EVPL Generalized Label, see RFC6004 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Rsvd | VLAN ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ static void dissect_glabel_evpl(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset) { int bit_offset; guint16 vlan_id = ((tvb_get_ntohs(tvb,offset) << 4) & 0xFFFF); /* point to the first bit in VLAN ID */ bit_offset = (offset<<2)+3; proto_tree_add_bits_item(rsvp_object_tree,hf_rsvp_label_generalized_label_evpl_vlad_id,tvb, bit_offset, 12, ENC_BIG_ENDIAN); proto_item_append_text(ti, ": EVPL Generalized Label: " "VLAN ID = %u" ,vlan_id); } static void dissect_rsvp_label(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { int offset2 = offset + 4; int mylen, i; const char *name; proto_item *hidden_item; guint32 unassigned_upstream_label; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); name = (rsvp_class==RSVP_CLASS_SUGGESTED_LABEL ? "SUGGESTED LABEL": (rsvp_class==RSVP_CLASS_UPSTREAM_LABEL ? "UPSTREAM LABEL": (rsvp_class==RSVP_CLASS_RECOVERY_LABEL ? "RECOVERY LABEL": "LABEL"))); mylen = obj_length - 4; switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_label, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_label, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "%s: %u", name, tvb_get_ntohl(tvb, offset2)); break; case 2: unassigned_upstream_label = tvb_get_ntoh24(tvb, offset2); if(unassigned_upstream_label == 0xffffffff){ /* Unassigned upstream label, see RFC 8359 */ proto_item_append_text(ti, ": Unassigned upstream label ( 0x%x )",unassigned_upstream_label); } else { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_label, tvb, offset+3, 1, ENC_BIG_ENDIAN); if (rsvp_generalized_label_option == 1) { /* FF: no generalized label interpretation */ proto_item_set_text(ti, "%s: Generalized: ", name); for (i = 0; i < mylen; i += 4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_generalized_label, tvb, offset2+i, 4, ENC_BIG_ENDIAN); if (i < 16) { proto_item_append_text(ti, "0x%x%s", tvb_get_ntohl(tvb, offset2+i), i+4<mylen?", ":""); } else if (i == 16) { proto_item_append_text(ti, "..."); } } } else if (rsvp_generalized_label_option == 2) { dissect_glabel_sdh(ti, rsvp_object_tree, tvb, offset2); } else if (rsvp_generalized_label_option == 4) { dissect_glabel_g709(ti, rsvp_object_tree, tvb, offset2); } else if (rsvp_generalized_label_option == 3) { dissect_glabel_lambda(ti, rsvp_object_tree, tvb, offset2); } else if (rsvp_generalized_label_option == 5) { dissect_glabel_evpl(ti, rsvp_object_tree, tvb, offset2); } } break; case 4: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_label, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, ": Generalized Channel_set"); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_data, tvb, offset2, mylen, ENC_NA); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_label, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_data, tvb, offset2, mylen, ENC_NA); break; } } /*------------------------------------------------------------------------------ * LABEL_SET *------------------------------------------------------------------------------*/ static const value_string action_type_vals[] = { { 0, "Inclusive list"}, { 1, "Exclusive list"}, { 2, "Inclusive range"}, { 3, "Exclusive range"}, { 0, NULL} }; static void dissect_rsvp_label_set(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type _U_) { int offset2 = offset + 8; guint8 label_type; int len, i; len = obj_length - 8; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_label_set, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_label_set_action, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, ": %s", val_to_str(tvb_get_guint8(tvb, offset+4), action_type_vals, "Unknown (%u)")); label_type = tvb_get_guint8 (tvb, offset+7); proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_label_set_type, tvb, offset+7, 1, label_type, "%s", (label_type == 1) ? "Packet Label" : "Generalized Label"); proto_item_append_text(ti, ", %s", (label_type == 1) ? "Packet Label: " : "Generalized Label: "); for (i = 0; i < len/4; i++) { guint32 subchannel = tvb_get_ntohl(tvb, offset2+i*4); proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_label_set_subchannel, tvb, offset2+i*4, 4, subchannel, "Subchannel %u: %u (0x%x)", i+1, subchannel, subchannel); if (i<5) { if (i!=0) proto_item_append_text(ti, ", "); proto_item_append_text(ti, "%u", tvb_get_ntohl(tvb, offset2+i*4)); } } } /*------------------------------------------------------------------------------ * SESSION ATTRIBUTE *------------------------------------------------------------------------------*/ static void dissect_rsvp_session_attribute(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; guint8 flags; guint8 name_len; proto_tree *ti2, *rsvp_sa_flags_tree; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: case 7: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_attribute, tvb, offset+3, 1, ENC_BIG_ENDIAN); if (type == 1) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_exclude_any, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_include_any, tvb, offset2+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_include_all, tvb, offset2+8, 4, ENC_BIG_ENDIAN); offset2 = offset2+12; } proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_setup_priority, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_hold_priority, tvb, offset2+1, 1, ENC_BIG_ENDIAN); flags = tvb_get_guint8(tvb, offset2+2); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_flags, tvb, offset2+2, 1, ENC_BIG_ENDIAN); rsvp_sa_flags_tree = proto_item_add_subtree(ti2, TREE(TT_SESSION_ATTRIBUTE_FLAGS)); proto_tree_add_item(rsvp_sa_flags_tree, hf_rsvp_sa_flags_local, tvb, offset2+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_sa_flags_tree, hf_rsvp_sa_flags_label, tvb, offset2+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_sa_flags_tree, hf_rsvp_sa_flags_se_style, tvb, offset2+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_sa_flags_tree, hf_rsvp_sa_flags_bandwidth, tvb, offset2+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_sa_flags_tree, hf_rsvp_sa_flags_node, tvb, offset2+2, 1, ENC_BIG_ENDIAN); name_len = tvb_get_guint8(tvb, offset2+3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_name_length, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_name, tvb, offset2+4, name_len, ENC_NA|ENC_ASCII); proto_item_set_text(ti, "SESSION ATTRIBUTE: SetupPrio %d, HoldPrio %d, %s%s%s%s%s [%s]", tvb_get_guint8(tvb, offset2), tvb_get_guint8(tvb, offset2+1), flags &0x01 ? "Local Protection, " : "", flags &0x02 ? "Label Recording, " : "", flags &0x04 ? "SE Style, " : "", flags &0x08 ? "Bandwidth Protection, " : "", flags &0x10 ? "Node Protection, " : "", name_len ? tvb_format_text(wmem_packet_scope(), tvb, offset2+4, name_len) : ""); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_attribute, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_session_attribute_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS, * RFC 3209, RFC 3473, RFC 5420, RFC 4873, RFC 5553 *------------------------------------------------------------------------------*/ static void dissect_rsvp_ro_subobjects(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class) { int i, type, lbit, dbit, path_key, l, flags; proto_tree *ti2 = NULL, *rsvp_ro_subtree, *rsvp_rro_flags_subtree; int tree_type; switch(rsvp_class) { case RSVP_CLASS_EXPLICIT_ROUTE: case RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE: tree_type = TREE(TT_EXPLICIT_ROUTE_SUBOBJ); break; case RSVP_CLASS_RECORD_ROUTE: case RSVP_CLASS_SECONDARY_RECORD_ROUTE: tree_type = TREE(TT_RECORD_ROUTE_SUBOBJ); break; case RSVP_CLASS_EXCLUDE_ROUTE: tree_type = TREE(TT_EXCLUDE_ROUTE_SUBOBJ); break; default: /* Bail out */ return; } /* 0 1 2 3 */ /* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 */ /* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ /* |L| Type | Length | Value... | */ /* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ for (i=1, l = 0; l < obj_length - 4; i++) { type = tvb_get_guint8(tvb, offset + l); if ((rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE) || (rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE) || (rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE)) type &= 0x7f; lbit = tvb_get_guint8(tvb, offset + l) & 0x80; dbit = tvb_get_guint8(tvb, offset + l + 2) & 0x80; switch(type) { case 1: /* IPv4 */ rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, 8, tree_type, &ti2, "IPv4 Subobject - %s%s", tvb_ip_to_str(pinfo->pool, tvb, offset+l+2), (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) ? (lbit ? ", Loose" : ", Strict") : ""); if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_loose_hop, tvb, offset+l, 1, ENC_NA); if (rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE){ proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_lbit, tvb, offset+l, 1, ENC_BIG_ENDIAN); } proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "1 (IPv4)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); if(rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE){ proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_ipv4_hop, tvb, offset+l+2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_prefix_length, tvb, offset+l+6, 1, ENC_BIG_ENDIAN); } if(rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE){ proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_ipv4_addr, tvb, offset + l + 2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_ipv4_prefix, tvb, offset + l + 6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_ipv4_attr, tvb, offset + l + 7, 1, ENC_BIG_ENDIAN); } if (i < 4) { proto_item_append_text(ti, "IPv4 %s%s", tvb_ip_to_str(pinfo->pool, tvb, offset+l+2), lbit ? " [L]" : ""); } if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) { flags = tvb_get_guint8(tvb, offset+l+7); if (flags&0x20) { proto_item_append_text(ti, " (Node-id)"); proto_item_append_text(ti2, " (Node-id)"); } if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); ti2 = proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_flags, tvb, offset+l+7, 1, ENC_BIG_ENDIAN); rsvp_rro_flags_subtree = proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_local_avail, tvb, offset+l+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_local_in_use, tvb, offset+l+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_bandwidth, tvb, offset+l+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_node, tvb, offset+l+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_node_address, tvb, offset+l+7, 1, ENC_BIG_ENDIAN); } break; case 2: /* IPv6 */ rsvp_ro_subtree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset+l, 20, tree_type, &ti2, "IPv6 Subobject"); if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE){ proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_loose_hop, tvb, offset+l, 1, ENC_NA); } proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_lbit, tvb, offset + l, 1, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "2 (IPv6)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_ipv6_hop, tvb, offset+l+2, 16, ENC_NA); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_prefix_length, tvb, offset+l+18, 1, ENC_BIG_ENDIAN); if(rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE){ proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_ipv6_attr, tvb, offset + l + 19, 1, ENC_BIG_ENDIAN); } if (i < 4) { proto_item_append_text(ti, "IPv6 [...]%s", lbit ? " [L]":""); } if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) { flags = tvb_get_guint8(tvb, offset+l+19); if (flags&0x20) { proto_item_append_text(ti, " (Node-id)"); proto_item_append_text(ti2, " (Node-id)"); } if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); if (flags&0x04) proto_item_append_text(ti2, ", Backup BW Avail"); if (flags&0x08) proto_item_append_text(ti2, ", Backup is Next-Next-Hop"); ti2 = proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_flags, tvb, offset+l+19, 1, ENC_BIG_ENDIAN); rsvp_rro_flags_subtree = proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_local_avail, tvb, offset+l+19, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_local_in_use, tvb, offset+l+19, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_backup_tunnel_bandwidth, tvb, offset+l+19, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_backup_tunnel_hop, tvb, offset+l+19, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_node_address, tvb, offset+l+19, 1, ENC_BIG_ENDIAN); } break; case 3: /* Label RFC 3477 */ rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, 8, tree_type, &ti2, "Label Subobject - %d, %s", tvb_get_ntohl(tvb, offset+l+4), (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) ? (lbit ? "Loose" : "Strict") : ""); if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_loose_hop, tvb, offset+l, 1, ENC_NA); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "3 (Label)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) { flags = tvb_get_guint8(tvb, offset+l+2); if (flags&0x01) proto_item_append_text(ti2, "The label will be understood if received on any interface"); ti2 = proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_flags, tvb, offset+l+2, 1, ENC_BIG_ENDIAN); rsvp_rro_flags_subtree = proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_global_label, tvb, offset+l+2, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ctype, tvb, offset+l+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_label, tvb, offset+l+4, 4, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "Label %d%s", tvb_get_ntohl(tvb, offset+l+4), lbit ? " [L]":""); } break; case 4: /* Unnumbered Interface-ID RFC 3477, RFC 6107*/ rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, 8, tree_type, &ti2, "Unnumbered Interface-ID - %s, %d, %s", tvb_ip_to_str(pinfo->pool, tvb, offset+l+4), tvb_get_ntohl(tvb, offset+l+8), (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) ? (lbit ? "Loose" : "Strict") : ""); if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_loose_hop, tvb, offset+l, 1, ENC_NA); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "4 (Unnumbered Interface-ID)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) { flags = tvb_get_guint8(tvb, offset+l+2); if (flags&0x01) proto_item_append_text(ti2, ", Local Protection Available"); if (flags&0x02) proto_item_append_text(ti2, ", Local Protection In Use"); ti2 = proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_flags, tvb, offset+l+2, 1, ENC_BIG_ENDIAN); rsvp_rro_flags_subtree = proto_item_add_subtree(ti2, TREE(TT_RECORD_ROUTE_SUBOBJ_FLAGS)); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_local_avail, tvb, offset+l+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_rro_flags_subtree, hf_rsvp_rro_flags_local_in_use, tvb, offset+l+2, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_router_id, tvb, offset+l+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_interface_id, tvb, offset+l+8, 4, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "Unnum %s/%d%s", tvb_ip_to_str(pinfo->pool, tvb, offset+l+4), tvb_get_ntohl(tvb, offset+l+8), lbit ? " [L]":""); } break; case 21: case 32: /* AS */ if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) goto defaultsub; lbit = tvb_get_ntohs(tvb, offset+l+2); rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, 4, tree_type, &ti2, "Autonomous System %u", lbit); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "32 (Autonomous System Number)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_autonomous_system, tvb, offset+l+2, 2, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "AS %d", tvb_get_ntohs(tvb, offset+l+2)); } break; case 34: /* SRLG subobject RFC 4874 */ if (rsvp_class == RSVP_CLASS_EXPLICIT_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE) goto defaultsub; if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE){ rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset + l, 8, tree_type, NULL, "SRLG Subobject - %u", tvb_get_ntohl(tvb, offset + l + 4)); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1,type, "34 (SRLG sub-object)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_len, tvb, offset + l + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_rro_sobj_dbit, tvb, offset + l+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_srlg_res, tvb, offset + l + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_srlg_id, tvb, offset + l + 4, 4, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "SRLG %u%s", tvb_get_ntohl(tvb, offset + l + 4), dbit ? " [D]" : ""); } } else{ rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset + l, 8, tree_type, NULL, "SRLG Subobject - %u", tvb_get_ntohl(tvb, offset + l + 2)); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_lbit, tvb, offset + l, 1, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1,type, "34 (SRLG sub-object)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_len, tvb, offset + l + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_srlg_id, tvb, offset + l + 2, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_xro_sobj_srlg_res, tvb, offset + l + 6, 2, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "SRLG %u%s", tvb_get_ntohl(tvb, offset + l + 2), lbit ? " [L]" : ""); } } break; case 64: /* PKSv4 - RFC5520 */ if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) goto defaultsub; path_key = tvb_get_ntohs(tvb, offset+l+2); rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, 8, tree_type, &ti2, "Path Key subobject - %s, %u", tvb_ip_to_str(pinfo->pool, tvb, offset+l+4), path_key); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "64 (Path Key with IPv4 PCE-ID)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_path_key, tvb, offset+l+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_pce_id_ipv4, tvb, offset+l+4, 4, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "Path Key %d", path_key); } break; case 65: /* PKSv6 - RFC5520 */ if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_EXCLUDE_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) goto defaultsub; path_key = tvb_get_ntohs(tvb, offset+l+2); rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, 8, tree_type, &ti2, "Path Key subobject - %s, %u", tvb_ip6_to_str(pinfo->pool, tvb, offset+l+4), path_key); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "65 (Path Key with IPv6 PCE-ID)"); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_path_key, tvb, offset+l+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_pce_id_ipv6, tvb, offset+l+4, 16, ENC_NA); if (i < 4) { proto_item_append_text(ti, "Path Key %d", path_key); } break; case 124: case 125: case 126: case 127: /* * FF: Types 124 through 127 are to be reserved for Vendor * Private Use (see RFC 3936, Section 2.3.1) in case of * EXPLICIT_ROUTE (aka ERO). */ if (rsvp_class == RSVP_CLASS_RECORD_ROUTE || rsvp_class == RSVP_CLASS_SECONDARY_RECORD_ROUTE) goto defaultsub; else goto privatesub; break; case 252: case 253: case 254: case 255: /* * FF: Types 252 through 255 are to be reserved for Vendor * Private Use (see RFC 3936, Section 2.3.1) in case of * RECORD_ROUTE (aka RRO). */ privatesub: /* Private subobject */ /* * FF: The first four octets of the sub-object contents of * a Vendor Private sub-object of an EXPLICIT_ROUTE or * RECORD_ROUTE object MUST be that vendor's SMI enterprise * code in network octet order. */ { guint8 private_so_len = tvb_get_guint8(tvb, offset+l+1); rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, tvb_get_guint8(tvb, offset+l+1), tree_type, &ti2, "Private Subobject: %d", type); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_loose_hop, tvb, offset+l, 1, ENC_NA); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "%u (Private)", type); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_private_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_filter[RSVPF_ENT_CODE], tvb, offset+l+4, 4, ENC_BIG_ENDIAN); if (private_so_len > 8) { /* some private data */ proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_private_data, tvb, offset+l+8, private_so_len - 8, ENC_NA); } } break; default: /* Unknown subobject */ defaultsub: rsvp_ro_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+l, tvb_get_guint8(tvb, offset+l+1), tree_type, &ti2, "Unknown subobject: %d", type); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_loose_hop, tvb, offset+l, 1, ENC_NA); proto_tree_add_uint_format_value(rsvp_ro_subtree, hf_rsvp_type, tvb, offset+l, 1, type, "%u (Unknown)", type); proto_tree_add_item(rsvp_ro_subtree, hf_rsvp_ero_rro_subobjects_length, tvb, offset+l+1, 1, ENC_BIG_ENDIAN); break; } if (tvb_get_guint8(tvb, offset+l+1) < 1) { proto_tree_add_expert_format(rsvp_ro_subtree, pinfo, &ei_rsvp_invalid_length, tvb, offset+l+1, 1, "Invalid length: %u", tvb_get_guint8(tvb, offset+l+1)); return; } l += tvb_get_guint8(tvb, offset+l+1); if (l < obj_length - 4) { if (i < 4) proto_item_append_text(ti, ", "); else if (i==4) proto_item_append_text(ti, "..."); } } } /*------------------------------------------------------------------------------ * EXPLICIT ROUTE OBJECT *------------------------------------------------------------------------------*/ static void dissect_rsvp_explicit_route(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_explicit_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_text(ti, "EXPLICIT ROUTE: "); dissect_rsvp_ro_subobjects(ti, pinfo, rsvp_object_tree, tvb, offset + 4, obj_length, rsvp_class); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_explicit_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_explicit_route_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * RECORD ROUTE OBJECT *------------------------------------------------------------------------------*/ static void dissect_rsvp_record_route(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "RECORD ROUTE: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_record_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); dissect_rsvp_ro_subobjects(ti, pinfo, rsvp_object_tree, tvb, offset + 4, obj_length, rsvp_class); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_record_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_record_route_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * EXCLUDE ROUTE OBJECT *------------------------------------------------------------------------------*/ static void dissect_rsvp_exclude_route(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int ctype) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "EXCLUDE ROUTE: "); switch (ctype) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_exclude_route, tvb, offset + 3, 1, ENC_BIG_ENDIAN); dissect_rsvp_ro_subobjects(ti, pinfo, rsvp_object_tree, tvb, offset + 4, obj_length, rsvp_class); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_exclude_route, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_exclude_route_data, tvb, offset + 4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * MESSAGE ID *------------------------------------------------------------------------------*/ static void dissect_rsvp_message_id(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_epoch, tvb, offset+5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_message_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "MESSAGE-ID: %d %s", tvb_get_ntohl(tvb, offset+8), tvb_get_guint8(tvb, offset+4) & 1 ? "(Ack Desired)" : ""); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * MESSAGE ID ACK *------------------------------------------------------------------------------*/ static void dissect_rsvp_message_id_ack(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id_ack, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_epoch, tvb, offset+5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_message_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "MESSAGE-ID ACK: %d", tvb_get_ntohl(tvb, offset+8)); break; case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id_ack, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_epoch, tvb, offset+5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_message_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "MESSAGE-ID NACK: %d", tvb_get_ntohl(tvb, offset+8)); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id_ack, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_ack_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * MESSAGE ID LIST *------------------------------------------------------------------------------*/ static void dissect_rsvp_message_id_list(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id_list, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_list_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_list_epoch, tvb, offset+5, 3, ENC_BIG_ENDIAN); for (mylen = 8; mylen < obj_length; mylen += 4) proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_list_message_id, tvb, offset+mylen, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "MESSAGE-ID LIST: %d IDs", (obj_length - 8)/4); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_message_id_list, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_message_id_list_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * HELLO *------------------------------------------------------------------------------*/ static void dissect_rsvp_hello(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length _U_, int rsvp_class _U_, int type) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hello, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hello_source_instance, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_hello_destination_instance, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, ": %s. Src Instance: 0x%0x. Dest Instance: 0x%0x. ", type==1 ? "REQUEST" : "ACK", tvb_get_ntohl(tvb, offset+4), tvb_get_ntohl(tvb, offset+8)); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_hello, tvb, offset+3, 1, ENC_BIG_ENDIAN); break; }; } /*------------------------------------------------------------------------------ * DCLASS *------------------------------------------------------------------------------*/ static void dissect_rsvp_dclass(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; int mylen; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "DCLASS: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_dclass, tvb, offset+3, 1, ENC_BIG_ENDIAN); for (mylen = 4; mylen < obj_length; mylen += 4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_dclass_dscp, tvb, offset+mylen+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%d%s", tvb_get_guint8(tvb, offset+mylen+3)>>2, mylen==obj_length-4 ? "": mylen<16 ? ", ": mylen==16 ? ", ..." : ""); } break; default: mylen = obj_length - 4; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_dclass, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_dclass_data, tvb, offset2, mylen, ENC_NA); break; } } /*------------------------------------------------------------------------------ * ADMINISTRATIVE STATUS *------------------------------------------------------------------------------*/ static void dissect_rsvp_admin_status(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; guint32 status; static int * const status_flags[] = { &hf_rsvp_filter[RSVPF_ADMIN_STATUS_REFLECT], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_HANDOVER], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_LOCKOUT], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_INHIBIT], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_CALL_MGMT], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_TESTING], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_DOWN], &hf_rsvp_filter[RSVPF_ADMIN_STATUS_DELETE], NULL }; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "ADMIN STATUS: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_admin_status, tvb, offset+3, 1, ENC_BIG_ENDIAN); status = tvb_get_ntohl(tvb, offset2); proto_tree_add_bitmask(rsvp_object_tree, tvb, offset2, hf_rsvp_admin_status_bits, TREE(TT_ADMIN_STATUS_FLAGS), status_flags, ENC_BIG_ENDIAN); proto_item_set_text(ti, "ADMIN-STATUS: %s%s%s%s%s%s%s%s", (status & (1U<<31)) ? "Reflect " : "", (status & (1U<<6)) ? "Handover " : "", (status & (1U<<5)) ? "Lockout " : "", (status & (1U<<4)) ? "Inhibit " : "", (status & (1U<<3)) ? "Call " : "", (status & (1U<<2)) ? "Testing " : "", (status & (1U<<1)) ? "Admin-Down " : "", (status & (1U<<0)) ? "Deleting " : ""); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_admin_status, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_admin_status_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * LSP ATTRIBUTES *------------------------------------------------------------------------------*/ static void dissect_rsvp_lsp_attributes(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { int tlv_off; guint32 attributes; guint16 tlv_type, tlv_len; proto_tree *ti2, *rsvp_lsp_attr_subtree; static int * const rsvp_lsp_attr_flags[] = { &hf_rsvp_lsp_attr_e2e, &hf_rsvp_lsp_attr_boundary, &hf_rsvp_lsp_attr_segment, &hf_rsvp_lsp_attr_integrity, &hf_rsvp_lsp_attr_contiguous, &hf_rsvp_lsp_attr_stitching, &hf_rsvp_lsp_attr_preplanned, &hf_rsvp_lsp_attr_nophp, &hf_rsvp_lsp_attr_oobmap, &hf_rsvp_lsp_attr_entropy, &hf_rsvp_lsp_attr_oammep, &hf_rsvp_lsp_attr_oammip, &hf_rsvp_lsp_attr_srlgcollect, &hf_rsvp_lsp_attr_loopback, &hf_rsvp_lsp_attr_p2mp, &hf_rsvp_lsp_attr_rtm, &hf_rsvp_lsp_attr_telinklabel, &hf_rsvp_lsp_attr_lsi, &hf_rsvp_lsp_attr_lsids2e, NULL }; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); if (rsvp_class == RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES) proto_item_set_text(ti, "LSP REQUIRED ATTRIBUTES: "); else proto_item_set_text(ti, "LSP ATTRIBUTES: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_lsp_attributes, tvb, offset+3, 1, ENC_BIG_ENDIAN); for (tlv_off = 4; tlv_off < obj_length-4; ) { tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); if ((tlv_len == 0) || (tlv_off+tlv_len > obj_length)) { proto_tree_add_expert(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+tlv_off+2, 2); return; } switch(tlv_type) { case 1: attributes = tvb_get_ntohl(tvb, offset+tlv_off+4); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_attributes_tlv, tvb, offset+tlv_off, 4, ENC_BIG_ENDIAN); rsvp_lsp_attr_subtree = proto_item_add_subtree(ti2, TREE(TT_LSP_ATTRIBUTES_FLAGS)); proto_tree_add_bitmask(rsvp_lsp_attr_subtree, tvb, offset+tlv_off+4, hf_rsvp_lsp_attr, ett_treelist[TT_RSVP_LSP_ATTR], rsvp_lsp_attr_flags, ENC_NA); proto_item_append_text(ti, "LSP Attribute:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", (attributes & 0x80000000) ? " End-to-end re-routing" : "", (attributes & 0x40000000) ? " Boundary re-routing" : "", (attributes & 0x20000000) ? " Segment-based re-routing" : "", (attributes & 0x10000000) ? " LSP Integrity Required" : "", (attributes & 0x08000000) ? " Contiguous LSP" : "", (attributes & 0x04000000) ? " LSP stitching desired" : "", (attributes & 0x02000000) ? " Pre-Planned LSP Flag" : "", (attributes & 0x01000000) ? " Non-PHP behavior flag" : "", (attributes & 0x00800000) ? " OOB mapping flag" : "", (attributes & 0x00400000) ? " Entropy Label Capability" : "", (attributes & 0x00200000) ? " OAM MEP entities desired" : "", (attributes & 0x00100000) ? " OAM MIP entities desired" : "", (attributes & 0x00080000) ? " SRLG Collection Flag" : "", (attributes & 0x00040000) ? " Loopback" : "", (attributes & 0x00020000) ? " P2MP-TE Tree Re-evaluation Request" : "", (attributes & 0x00010000) ? " RTM_SET" : "", (attributes & 0x00008000) ? " TE Link Label" : "", (attributes & 0x00004000) ? " LSI-D" : "", (attributes & 0x00002000) ? " LSI-D-S2E" : ""); break; default: proto_tree_add_uint_format(rsvp_object_tree, hf_rsvp_type, tvb, offset+tlv_off, tlv_len, tlv_type, "Unknown TLV: %d", tlv_type); break; } tlv_off += tlv_len; } break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_lsp_attributes, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_attributes_tlv_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * ASSOCIATION *------------------------------------------------------------------------------*/ static const value_string association_type_vals[] = { { 0, "Reserved"}, { 1, "Recovery"}, { 2, "Resource Sharing"}, { 3, "Segment Recovery"}, { 4, "Inter-domain Recovery"}, { 0, NULL} }; static void dissect_rsvp_association(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { guint16 association_type; guint16 association_id; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "ASSOCIATION "); association_type = tvb_get_ntohs (tvb, offset + 4); association_id = tvb_get_ntohs (tvb, offset + 6); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_association, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, "(IPv4): "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_type, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%s. ", val_to_str(association_type, association_type_vals, "Unknown (%u)")); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_id, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "ID: %u. ", association_id); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_source_ipv4, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Src: %s", tvb_ip_to_str(wmem_packet_scope(), tvb, offset+8)); break; case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_association, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, "(IPv6): "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_type, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%s. ", val_to_str(association_type, association_type_vals, "Unknown (%u)")); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_id, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "ID: %u. ", association_id); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_source_ipv6, tvb, offset+8, 16, ENC_NA); proto_item_append_text(ti, "Src: %s", tvb_ip6_to_str(wmem_packet_scope(), tvb, offset+8)); break; case 4: /* oif2008.389 */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_association, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, "(Routing Area): "); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_type, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%s. ", val_to_str(association_type, association_type_vals, "Unknown (%u)")); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_id, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Association ID: %u, ", association_id); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_routing_area_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Routing Area ID: %u, ", tvb_get_ntohl (tvb, offset+8)); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_node_id, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Node ID: %s", tvb_ip_to_str(wmem_packet_scope(), tvb, offset+12)); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_padding, tvb, offset+8, 16, ENC_NA); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_association, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_association_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * TLVs for LSP TUNNEL IF ID object * draft-ietf-ccamp-lsp-hierarchy-bis-02 *------------------------------------------------------------------------------*/ static void dissect_rsvp_lsp_tunnel_if_id_tlv(proto_tree *rsvp_object_tree, packet_info* pinfo, tvbuff_t *tvb, int offset, int tlv_length, int subtree_type) { int tlv_off; guint16 tlv_type; int tlv_len; proto_tree *ti, *rsvp_lsp_tunnel_if_id_subtree; for (tlv_off = 0; tlv_off < tlv_length; ) { tlv_type = tvb_get_ntohs(tvb, offset+tlv_off); tlv_len = tvb_get_ntohs(tvb, offset+tlv_off+2); if ((tlv_len == 0) || ((tlv_off+tlv_len) > tlv_length)) { proto_tree_add_expert(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+tlv_off+2, 2); return; } switch(tlv_type) { case 1: rsvp_lsp_tunnel_if_id_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "Unnumbered component link identifier: %u", tvb_get_ntohl(tvb, offset+tlv_off+4)); proto_tree_add_uint_format_value(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "1 (Unnumbered component link identifier)"); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_component_link_identifier, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); break; case 2: rsvp_lsp_tunnel_if_id_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, NULL, "IPv4 component link identifier: %s", tvb_ip_to_str(pinfo->pool, tvb, offset+tlv_off+4)); proto_tree_add_uint_format_value(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "2 (IPv4 component link identifier)"); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_component_link_identifier_ipv4, tvb, offset+tlv_off+4, 4, ENC_BIG_ENDIAN); break; case 32769: /* oif-p0040.002.09 demo spec */ rsvp_lsp_tunnel_if_id_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset+tlv_off, tlv_len, subtree_type, &ti, "Targeted client layer: "); proto_tree_add_uint_format_value(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "32769 (Targeted client layer)"); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_length, tvb, offset+tlv_off+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_lsp_encoding_type, tvb, offset+tlv_off+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_switching_type, tvb, offset+tlv_off+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_signal_type, tvb, offset+tlv_off+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_connection_id, tvb, offset+tlv_off+8, 8, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_sc_pc_id, tvb, offset+tlv_off+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_lsp_tunnel_if_id_subtree, hf_rsvp_lsp_tunnel_if_id_sc_pc_scn_address, tvb, offset+tlv_off+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "LSP Encoding=%s, Switching Type=%s, Signal Type=%s", rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+4), gmpls_lsp_enc_rvals, "Unknown (%d)"), rval_to_str(tvb_get_guint8(tvb,offset+tlv_off+5), gmpls_switching_type_rvals, "Unknown (%d)"), val_to_str_ext(tvb_get_guint8(tvb,offset+tlv_off+6), &gmpls_sonet_signal_type_str_ext, "Unknown (%d)")); break; default: proto_tree_add_uint_format(rsvp_object_tree, hf_rsvp_type, tvb, offset+tlv_off, 2, tlv_type, "Unknown TLV: %u", tlv_type); break; } tlv_off += tlv_len; } } /*------------------------------------------------------------------------------ * LSP TUNNEL INTERFACE ID *------------------------------------------------------------------------------*/ static const value_string lsp_tunnel_if_id_action_str[] = { { 0, "LSP is FA (MPLS-TE topology advertisement only)"}, { 1, "LSP is RA (IP network advertisement only)"}, { 2, "LSP is RA (both IP and MPLS-TE topology advertisement)"}, { 3, "LSP is to be used as a virtual local link"}, { 0, NULL} }; static void dissect_rsvp_lsp_tunnel_if_id(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "LSP INTERFACE-ID: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tunnel_if_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_router_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_interface_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered, Router-ID %s, Interface-ID %d", tvb_ip_to_str(pinfo->pool, tvb, offset+4), tvb_get_ntohl(tvb, offset+8)); break; case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tunnel_if_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_ipv4_interface_address, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_target_igp_instance, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LSP INTERFACE-ID: IPv4, interface address %s," "IGP instance %s", tvb_ip_to_str(pinfo->pool, tvb, offset+4), tvb_ip_to_str(pinfo->pool, tvb, offset+8)); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_action, tvb, offset+12, 1, ENC_BIG_ENDIAN); dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, pinfo, tvb, offset+16, obj_length-16, TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); break; case 3: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tunnel_if_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_ipv6_interface_address, tvb, offset+4, 16, ENC_NA); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_target_igp_instance, tvb, offset+20, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LSP INTERFACE-ID: IPv6, interface address %s," "IGP instance %s", tvb_ip6_to_str(pinfo->pool, tvb, offset+4), tvb_ip_to_str(pinfo->pool, tvb, offset+20)); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_action, tvb, offset+24, 1, ENC_BIG_ENDIAN); dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, pinfo, tvb, offset+28, obj_length-28, TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); break; case 4: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tunnel_if_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_router_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_interface_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_target_igp_instance, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_item_set_text(ti, "LSP INTERFACE-ID: Unnumbered with target, Router-ID %s," " Interface-ID %d, IGP instance %s", tvb_ip_to_str(pinfo->pool, tvb, offset+4), tvb_get_ntohl(tvb, offset+8), tvb_ip_to_str(pinfo->pool, tvb, offset+12)); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_action, tvb, offset+16, 1, ENC_BIG_ENDIAN); dissect_rsvp_lsp_tunnel_if_id_tlv(rsvp_object_tree, pinfo, tvb, offset+20, obj_length-20, TREE(TT_LSP_TUNNEL_IF_ID_SUBTREE)); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_tunnel_if_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_lsp_tunnel_if_id_data, tvb, offset+4, obj_length-4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * NOTIFY REQUEST *------------------------------------------------------------------------------*/ static void dissect_rsvp_notify_request(proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_notify_request, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_notify_request_notify_node_address_ipv4, tvb, offset2, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, ": Notify node: %s", tvb_ip_to_str(wmem_packet_scope(), tvb, offset2)); break; } case 2: { proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_notify_request, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_notify_request_notify_node_address_ipv6, tvb, offset2, 16, ENC_NA); proto_item_append_text(ti, ": Notify node: %s", tvb_ip6_to_str(wmem_packet_scope(), tvb, offset2)); break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_notify_request, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_notify_request_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * GENERALIZED UNI *------------------------------------------------------------------------------*/ static void dissect_rsvp_gen_uni(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type, rsvp_conversation_info *rsvph) { int offset2 = offset + 4; int mylen, i, j, k, l; proto_item *ti2= NULL, *len_item; proto_tree *rsvp_gen_uni_subtree, *rsvp_session_subtree, *rsvp_template_subtree; int s_len, s_class, s_type, sobj_len, nsap_len; int offset3; proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "GENERALIZED UNI: "); mylen = obj_length - 4; switch(type) { case 1: { const char *c; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_generalized_uni, tvb, offset+3, 1, ENC_BIG_ENDIAN); for (i=1, l = 0; l < mylen; i++) { sobj_len = tvb_get_ntohs(tvb, offset2+l); j = tvb_get_guint8(tvb, offset2+l+2); switch(j) { case 1: case 2: /* We do source and destination TNA together */ c = (j==1) ? "Source" : "Destination"; k = tvb_get_guint8(tvb, offset2+l+3); switch(k) { case 1: rsvp_gen_uni_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+l, 8, TREE(TT_GEN_UNI_SUBOBJ), NULL, "%s IPv4 TNA: %s", c, tvb_ip_to_str(pinfo->pool, tvb, offset2+l+4)); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (%s)", j, c); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k, "1 (IPv4)"); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); if (j==1) proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_SRC_IPV4], tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); else proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_DST_IPV4], tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); if (i < 4) { proto_item_append_text(ti, "%s IPv4 TNA: %s", c, tvb_ip_to_str(pinfo->pool, tvb, offset2+l+4)); } break; case 2: rsvp_gen_uni_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+l, 20, TREE(TT_GEN_UNI_SUBOBJ), NULL, "%s IPv6 TNA:", c); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (%s)", j, c); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k, "2 (IPv6)"); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); if (j==1) proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_SRC_IPV6], tvb, offset2+l+4, 16, ENC_NA); else proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_filter[RSVPF_GUNI_DST_IPV6], tvb, offset2+l+4, 16, ENC_NA); if (i < 4) { proto_item_append_text(ti, "%s IPv6 TNA: %s", c, tvb_ip6_to_str(pinfo->pool, tvb, offset2+l+4)); } break; case 3: rsvp_gen_uni_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+l, tvb_get_ntohs(tvb, offset2+l), TREE(TT_GEN_UNI_SUBOBJ), NULL, "%s NSAP TNA: ", c); nsap_len = tvb_get_guint8(tvb, offset2+l+4); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (%s)", j, c); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k, "3 (NSAP)"); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_nsap_length, tvb, offset2+l+4, 1, ENC_BIG_ENDIAN); proto_tree_add_string(rsvp_gen_uni_subtree, hf_rsvp_nsap_address, tvb, offset2+l+5, sobj_len-4, print_nsap_net(pinfo->pool, tvb, offset2+l+5, nsap_len)); if (i < 4) { proto_item_append_text(ti, "%s NSAP TNA: %s", c, print_nsap_net(pinfo->pool, tvb, offset2+l+5, nsap_len)); } break; default: rsvp_gen_uni_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+l, tvb_get_ntohs(tvb, offset2+l), TREE(TT_GEN_UNI_SUBOBJ), NULL, "%s UNKNOWN TNA", c); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (%s)", j, c); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k, "%d (UNKNOWN)", k); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_gen_uni_data, tvb, offset2+l+4, sobj_len-4, ENC_NA); if (i < 4) { proto_item_append_text(ti, "%s UNKNOWN", c); } break; } break; case 3: /* Diversity subobject */ k = tvb_get_guint8(tvb, offset2+l+3); switch(k) { default: case 1: rsvp_gen_uni_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+l, tvb_get_ntohs(tvb, offset2+l), TREE(TT_GEN_UNI_SUBOBJ), &ti2, "Diversity Subobject"); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (Diversity)", j); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_class_diversity, tvb, offset2+l+4, 1, ENC_NA); s_len = tvb_get_ntohs(tvb, offset2+l+8); s_class = tvb_get_guint8(tvb, offset2+l+10); s_type = tvb_get_guint8(tvb, offset2+l+11); rsvp_session_subtree = proto_tree_add_subtree(rsvp_gen_uni_subtree, tvb, offset2+l+8, s_len, TREE(rsvp_class_to_tree_type(s_class)), &ti2, "Session"); len_item = proto_tree_add_uint(rsvp_session_subtree, hf_rsvp_length, tvb, offset2+l+8, 2, s_len); if (s_len < 4) { expert_add_info_format(pinfo, len_item, &ei_rsvp_invalid_length, "Length: %u (bogus, must be >= 4)", s_len); break; } proto_tree_add_uint(rsvp_session_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, offset2+8+l+10, 1, s_class); dissect_rsvp_session(pinfo, ti2, rsvp_session_subtree, tvb, offset2+l+8, s_len, s_class, s_type, rsvph); offset3 = offset2 + s_len; s_len = tvb_get_ntohs(tvb, offset3+l+8); s_class = tvb_get_guint8(tvb, offset3+l+10); s_type = tvb_get_guint8(tvb, offset3+l+11); rsvp_template_subtree = proto_tree_add_subtree(rsvp_gen_uni_subtree, tvb, offset3+l+8, s_len, TREE(rsvp_class_to_tree_type(s_class)), &ti2, "Template"); proto_tree_add_uint(rsvp_template_subtree, hf_rsvp_length, tvb, offset3+l+8, 2, s_len); if (s_len < 4) { expert_add_info_format(pinfo, len_item, &ei_rsvp_invalid_length, "Length: %u (bogus, must be >= 4)", s_len); break; } proto_tree_add_uint(rsvp_template_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, offset3+8+l+10, 1, s_class); dissect_rsvp_template_filter(pinfo, ti2, rsvp_template_subtree, tvb, offset3+l+8, s_len, s_class, s_type, rsvph); if (i < 4) { proto_item_append_text(ti, "Diversity"); } break; } break; case 4: /* Egress Label */ k = tvb_get_guint8(tvb, offset2+l+3); if (k == 1) /* Egress label sub-type */ rsvp_gen_uni_subtree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset2+l, sobj_len, TREE(TT_GEN_UNI_SUBOBJ), &ti2, "Egress Label Subobject"); else if (k == 2) /* SPC_label sub-type (see G.7713.2) */ rsvp_gen_uni_subtree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset2+l, sobj_len, TREE(TT_GEN_UNI_SUBOBJ), &ti2, "SPC Label Subobject"); else rsvp_gen_uni_subtree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset2+l, sobj_len, TREE(TT_GEN_UNI_SUBOBJ), &ti2, "Unknown Label Subobject"); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (Egress/SPC Label)", j); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_gen_uni_direction, tvb, offset+l+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_egress_label_type, tvb, offset2+l+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_gen_uni_logical_port_id, tvb, offset2+l+8, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti2, ": %s, Label type %d, Port ID %d, Label ", tvb_get_guint8(tvb, offset2+l+4) & 0x80 ? "Upstream" : "Downstream", tvb_get_guint8(tvb, offset2+l+7), tvb_get_ntohl(tvb, offset2+l+8)); for (j=12; j < sobj_len; j+=4) { proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_egress_label, tvb, offset2+l+j, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti2, "%u ", tvb_get_ntohl(tvb, offset2+l+j)); } if (i < 4) { if (k == 1) proto_item_append_text(ti, "Egress Label"); else if (k == 2) proto_item_append_text(ti, "SPC Label"); } break; case 5: /* Service Level */ k = tvb_get_guint8(tvb, offset2+l+3); switch(k) { default: case 1: rsvp_gen_uni_subtree = proto_tree_add_subtree(rsvp_object_tree, tvb, offset2+l, sobj_len, TREE(TT_GEN_UNI_SUBOBJ), &ti2, "Service Level Subobject"); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_class, tvb, offset2+l+2, 1, j, "%d (Service Level)", j); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l+3, 1, k); proto_tree_add_uint(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l, 2, sobj_len); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_gen_uni_service_level, tvb, offset2+l+4, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti2, ": %u", tvb_get_guint8(tvb, offset2+l+4)); if (i < 4) { proto_item_append_text(ti, "Service Level %d", tvb_get_guint8(tvb, offset2+l+4)); } break; } break; default: /* Unknown subobject */ rsvp_gen_uni_subtree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+l, sobj_len, TREE(TT_GEN_UNI_SUBOBJ), NULL, "Unknown subobject: %u", j); proto_tree_add_uint_format_value(rsvp_gen_uni_subtree, hf_rsvp_type, tvb, offset2+l, 1, j, "%u (Unknown)", j); proto_tree_add_item(rsvp_gen_uni_subtree, hf_rsvp_class_length, tvb, offset2+l+1, 1, ENC_BIG_ENDIAN); break; } if (tvb_get_guint8(tvb, offset2+l+1) < 1) { proto_tree_add_expert_format(rsvp_gen_uni_subtree, pinfo, &ei_rsvp_invalid_length, tvb, offset2+l+1, 1, "Invalid length: %u", tvb_get_guint8(tvb, offset2+l+1)); return; } l += tvb_get_guint8(tvb, offset2+l+1); if (l < mylen) { if (i < 4) proto_item_append_text(ti, ", "); else if (i==4) proto_item_append_text(ti, "..."); } } break; } default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_generalized_uni, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_gen_uni_data, tvb, offset2, mylen, ENC_NA); break; } } /*------------------------------------------------------------------------------ * CALL_ID *------------------------------------------------------------------------------*/ static const value_string address_type_vals[] = { { 1, "1 (IPv4)"}, { 2, "2 (IPv6)"}, { 3, "3 (NSAP)"}, { 4, "4 (MAC)"}, { 0x7f, "0x7f (Vendor-defined)"}, { 0, NULL} }; static void dissect_rsvp_call_id(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int c_type) { int type = 0; const guint8 *str; int offset2 = offset + 4; int offset3, offset4, len; proto_tree *ti2 = NULL, *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "CALL-ID: "); switch(c_type) { case 0: proto_item_append_text(ti,"Empty"); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_call_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); if (obj_length > 4) proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_data, tvb, offset2, obj_length-4, ENC_NA); break; case 1: case 2: type = tvb_get_guint8 (tvb, offset2); if (c_type == 1) { offset3 = offset2 + 4; len = obj_length - 16; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_call_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_address_type, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_reserved, tvb, offset2+1, 3, ENC_BIG_ENDIAN); proto_item_append_text(ti, "Operator-Specific. Addr Type: %s. ", val_to_str(type, address_type_vals, "Unknown (%u)")); } else { offset3 = offset2 + 16; len = obj_length - 28; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_call_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_address_type, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item_ret_string(rsvp_object_tree, hf_rsvp_call_id_international_segment, tvb, offset2 + 1, 3, ENC_NA|ENC_ASCII, pinfo->pool, &str); proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ", val_to_str(type, address_type_vals, "Unknown (%u)"), str); proto_tree_add_item_ret_string(rsvp_object_tree, hf_rsvp_call_id_national_segment, tvb, offset2 + 4, 12, ENC_NA|ENC_ASCII, pinfo->pool, &str); proto_item_append_text(ti, "Natl Segment: %s. ", str); } switch(type) { case 1: offset4 = offset3 + 4; str = tvb_ip_to_str(pinfo->pool, tvb, offset3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4], tvb, offset3, 4, ENC_BIG_ENDIAN); break; case 2: offset4 = offset3 + 16; str = tvb_ip6_to_str(pinfo->pool, tvb, offset3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6], tvb, offset3, 16, ENC_NA); break; case 3: offset4 = offset3 + 20; str = print_nsap_net(pinfo->pool, tvb, offset3, 20); proto_tree_add_string(rsvp_object_tree, hf_rsvp_source_transport_network_addr, tvb, offset3, 20, str); break; case 4: offset4 = offset3 + 6; str = tvb_ether_to_str(pinfo->pool, tvb, offset3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_callid_srcaddr_ether, tvb, offset3, 6, ENC_NA); break; case 0x7F: offset4 = offset3 + len; str = tvb_bytes_to_str(pinfo->pool, tvb, offset3, len); proto_tree_add_item(rsvp_object_tree, hf_rsvp_callid_srcaddr_bytes, tvb, offset3, len, ENC_NA); break; default: offset4 = offset3 + len; str = "???"; expert_add_info(pinfo, ti2, &ei_rsvp_call_id_address_type); break; } proto_item_append_text(ti, "Src: %s. ", str); proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_local_identifier, tvb, offset4, 8, ENC_NA); proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(pinfo->pool, tvb, offset4, 8)); break; default: proto_item_append_text(ti, " Unknown"); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_call_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_data, tvb, offset2, obj_length-4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * 3GPP2_OBJECT X.S0057-0 v1.0, X.S0011-004-E v1.0 *------------------------------------------------------------------------------*/ static const value_string rsvp_3gpp_object_ie_type_vals[] = { { 0, "TFT IPv4"}, { 1, "TFT IPv4 Error"}, { 2, "TFT IPv6"}, { 3, "TFT IPv6 Error"}, { 4, "Header Removal"}, { 5, "Header Removal Error"}, { 6, "Channel Treatment"}, { 7, "Channel Treatment Error"}, { 0, NULL} }; static const value_string rsvp_3gpp_object_tft_d_vals[] = { { 0, "Forward Direction"}, { 1, "Reverse Direction"}, { 2, "Reserved"}, { 3, "Reserved"}, { 0, NULL} }; static const value_string rsvp_3gpp_obj_tft_opcode_vals[] = { { 0x00, "Spare"}, { 0x01, "Create new TFT"}, { 0x02, "Delete existing TFT"}, { 0x03, "Add packet filters to existing TFT"}, { 0x04, "Replace packet filters in existing TFT"}, { 0x05, "Delete packet filters from existing TFT"}, { 0x06, "QoS Check"}, { 0x07, "Reserved"}, { 0x80, "Initiate Flow Request"}, { 0x81, "QoS Check Confirm"}, { 0x82, "Initiate Delete Packet Filter from Existing TFT"}, { 0x83, "Initiate Replace packet filters in existing TFT"}, { 0, NULL} }; static const value_string rsvp_3gpp_obj_pf_comp_type_id_vals[] = { { 16, "IPv4 Source Address with Subnet Mask"}, { 17, "IPv4 Destination Address with Subnet Mask"}, { 32, "IPv6 Source Address with Prefix Length"}, { 33, "IPv6 Destination Address with Prefix Length"}, { 48, "Protocol /Next header"}, { 64, "Single Destination Port"}, { 65, "Destination Port range"}, { 80, "Single Source Port"}, { 81, "Source Port range"}, { 96, "Security Parameter Index"}, { 112, "Type of Service/Traffic Class"}, { 128, "Flow label"}, { 129, "Type 2 Routing Header with Prefix Length"}, { 130, "Home Address Option with Prefix Length"}, { 0, NULL} }; static const value_string rsvp_3gpp_obj_pf_treatment_vals[] = { { 0, "Header Compression"}, { 1, "Maximum Buffer Timer"}, { 0, NULL} }; #if 0 static const value_string rsvp_3gpp_qos_result_vals[] = { { 0, "Successful"}, { 1, "UE Initiated QoS is not authorized"}, { 2, "NW initiated QoS in progress for this flow"}, { 3, "Requested FlowProfileIDs failed mapping"}, { 0, NULL} }; #endif static const value_string rsvp_3gpp_obj_traffic_class_vals[] = { { 0, "Unknown"}, { 1, "Conversational"}, { 2, "Streaming"}, { 3, "Interactive"}, { 4, "Background"}, { 0, NULL} }; static void dissect_rsvp_3gpp_object(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int c_type) { guint16 length, ie_type; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); offset+=3; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_3gpp_object, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Set obj_length to the remaining bytes */ obj_length = obj_length - 4; if(c_type==1){ /* Transaction ID */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tid, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; obj_length = obj_length - 4; /* IE List */ while(obj_length>0){ length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; ie_type = tvb_get_ntohs(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_ie_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; if ((ie_type == 0)||(ie_type==2)){ guint8 tft_opcode, tft_n_pkt_flt; int i; if(ie_type == 0){ /*IPv4*/ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_ue_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; }else{ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_ue_ipv6_addr, tvb, offset, 16, ENC_NA); offset+=16; } /* D Reserved NS SR_ID Reserved P TFT Operation Code Number of Packet filters */ /* D */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_d, tvb, offset, 4, ENC_BIG_ENDIAN); /* NS */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_ns, tvb, offset, 4, ENC_BIG_ENDIAN); /* SR_ID */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_sr_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* P */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_p, tvb, offset, 4, ENC_BIG_ENDIAN); /* TFT Operation Code */ tft_opcode = tvb_get_guint8(tvb, offset+2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_opcode, tvb, offset, 4, ENC_BIG_ENDIAN); /* Number of Packet filters */ tft_n_pkt_flt = tvb_get_guint8(tvb, offset+3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_n_pkt_flt, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; /* Packet filter list * The packet filter list contains a variable number of packet filters. It shall be * encoded same as defined in X.S0011-D Chapter 4 [5] except as defined * below: * For "QoS Check Confirm" operations, the packet filter list shall be empty. * For "Initiate Delete Packet Filter from Existing TFT", the packet filter list * shall contain a variable number of Flow Identifiers given in the number of * packet filters field. In this case, the packet filter evaluation precedence, * length, and contents are not included, only the Flow Identifiers are * included. See Figure B-6, X.S0011-D [5] . * For "Initiate Flow request" and "Initiate Replace Packet Filters in Existing * TFT" Replace Packet Filters in Existing TFT the packet filter list shall * contain a variable number of Flow Identifiers, along with the packet filter * contents. See Figure B-7, X.S0011-D */ if((tft_opcode!=0x81)&&(tft_n_pkt_flt != 0)){ /* Packet Filter List */ for (i = 0; i < tft_n_pkt_flt; i++) { proto_tree *flow_tree, *t2_tree; guint16 pkt_flt_len, item_len, pf_cont_len; guint8 pf_comp_type_id; flow_tree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset, -1, ett_treelist[TT_3GPP_OBJ_FLOW], &ti, "Flow Identifier Num %u",i+1); proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_flow_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; item_len = 1; if((tft_opcode==0x05)||(tft_opcode==0x82)){ /* delete packet filters from existing TFT, Initiate Delete Packet Filter from Existing TFT */ proto_item_set_len(ti, item_len); continue; } /* Packet filter evaluation precedence */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_ev_prec, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Packet filter length */ pkt_flt_len = tvb_get_ntohs(tvb,offset); proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_len, tvb, offset, 2, ENC_BIG_ENDIAN); item_len = item_len + pkt_flt_len +1; offset+=2; /* Packet filter contents */ /* PF Type (0-1) */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Length */ pf_cont_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_cont_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Packet filter component type identifier */ pf_comp_type_id = tvb_get_guint8(tvb, offset); proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_comp_type_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Packet filter component */ switch(pf_comp_type_id){ case 16: /* IPv4 Source Address with Subnet Mask */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_src_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_ipv4_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; pf_cont_len-=11; break; case 17: /* IPv4 Destination Address with Subnet Mask */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_dst_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_ipv4_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; /* Items length (8 + 3)*/ pf_cont_len-=11; break; case 32: /* IPv6 Source Address with Prefix Length */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_src_ipv6, tvb, offset, 16, ENC_NA); offset+=16; proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_ipv6_prefix_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Items length (17 + 3)*/ pf_cont_len-=20; break; case 33: /* IPv6 Destination Address with Prefix Length */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_dst_ipv6, tvb, offset, 16, ENC_NA); offset+=16; proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_ipv6_prefix_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Items length (17 + 3)*/ pf_cont_len-=20; break; case 48: /* Protocol /Next header */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_prot_next, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Items length (1 + 3)*/ pf_cont_len-=4; break; case 64: /* Single Destination Port */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* Items length (2 + 3)*/ pf_cont_len-=5; break; case 65: /* Destination Port range */ proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_3gpp_obj_pf_dst_port_range, tvb, offset, 4, tvb_get_ntohs(tvb,offset), "%u-%u", tvb_get_ntohs(tvb,offset), tvb_get_ntohs(tvb,offset+2)); offset+=4; break; case 80: /* Single Source Port */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* Items length (2 + 3)*/ pf_cont_len-=5; break; case 81: /* Source Port range */ proto_tree_add_uint_format_value(rsvp_object_tree, hf_rsvp_3gpp_obj_pf_src_port_range, tvb, offset, 4, tvb_get_ntohs(tvb,offset), "Source Port range %u-%u", tvb_get_ntohs(tvb,offset), tvb_get_ntohs(tvb,offset+2)); offset+=4; /* Items length (4 + 3)*/ pf_cont_len-=7; break; case 96: /* Security Parameter Index */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_ipsec_spi, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; /* Items length (4 + 3)*/ pf_cont_len-=7; break; case 112: /* Type of Service/Traffic Class */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_tos_tc, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Items length (1 + 3)*/ pf_cont_len-=4; break; case 128: /* Flow label */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_flow_lbl, tvb, offset, 3, ENC_BIG_ENDIAN); offset+=3; /* Items length (3 + 3)*/ pf_cont_len-=6; break; case 129: /* Type 2 Routing Header with Prefix Length */ t2_tree = proto_tree_add_subtree(flow_tree, tvb, offset, 17, ett_treelist[TT_3GPP_OBJ_T2], NULL, "Type 2 Routing Header packet filter"); proto_tree_add_item(t2_tree, hf_rsvp_3gpp_obj_pf_ipv6, tvb, offset, 16, ENC_NA); offset+=16; proto_tree_add_item(t2_tree, hf_rsvp_3gpp_obj_pf_ipv6_prefix_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Items length (17 + 3)*/ pf_cont_len-=20; break; case 130: /* Home Address Option with Prefix Length */ t2_tree = proto_tree_add_subtree(flow_tree, tvb, offset, 17, ett_treelist[TT_3GPP_OBJ_HO], NULL, "Home address Option packet filter"); proto_tree_add_item(t2_tree, hf_rsvp_3gpp_obj_pf_ipv6, tvb, offset, 16, ENC_NA); offset+=16; proto_tree_add_item(t2_tree, hf_rsvp_3gpp_obj_pf_ipv6_prefix_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Items length (17 + 3)*/ pf_cont_len-=20; break; default: proto_tree_add_expert(flow_tree, pinfo, &ei_rsvp_packet_filter_component, tvb, offset, pf_cont_len-2); offset = offset + pkt_flt_len - 5; pf_cont_len=0; break; } if(pf_cont_len != 0){ /* Packet filter treatment */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_treatment, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* [RFC 3006] hint */ proto_tree_add_item(flow_tree, hf_rsvp_3gpp_obj_pf_hint, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; } proto_item_set_len(ti, item_len); } } /* QoS List (QoS Check, QoS-Check Confirm Initiate Flow Request * and Initiate Replace Packet Filters in Existing TFT) * XXX * Create new TFT? */ if((tft_opcode == 0x01)||(tft_opcode == 0x06)||(tft_opcode == 0x80)||(tft_opcode == 0x81)||(tft_opcode == 0x83)){ /* QoS List Length */ gint32 tft_qos_list_len; guint8 blob_len, item_len, padding_len; gboolean verbose; proto_tree *qos_tree, *qos_sub_blob_tree, *qos_att_tree; int num = 0, j, num_qos_att_set; tft_qos_list_len = tvb_get_ntohs(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_3gpp_obj_tft_qos_list_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; tft_qos_list_len-=2; if(tft_qos_list_len > 0){ while (tft_qos_list_len>0) { int bit_offset; /* offset in bits */ guint8 qos_attribute_set_len; num++; qos_tree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset, -1, ett_treelist[TT_3GPP_OBJ_QOS], NULL, "QOS Flow Identifier Num %u", num); /* Flow Identifier */ proto_tree_add_item(qos_tree, hf_rsvp_3gpp_obj_flow_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; tft_qos_list_len--; /* R_QOS_SUB_BLOB_LEN 1 */ blob_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(qos_tree, hf_rsvp_3gpp_r_qos_blob_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; tft_qos_list_len--; /* R_QoS_SUB_BLOB X.S0011-004-D */ ti = proto_tree_add_item(qos_tree, hf_rsvp_3gpp_r_qos_blob, tvb, offset, blob_len, ENC_NA); qos_sub_blob_tree = proto_item_add_subtree(ti, ett_treelist[TT_3GPP_OBJ_QOS_SUB_BLOB]); proto_tree_add_item(qos_sub_blob_tree, hf_rsvp_3gpp_r_qos_blob_flow_pri, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(qos_sub_blob_tree, hf_rsvp_3gpp_r_qos_blob_num_qos_att_set, tvb, offset, 1, ENC_BIG_ENDIAN); num_qos_att_set = (tvb_get_guint8(tvb, offset) & 0x0e)>>1; /* point to the first bit in the QoS_ATTRIBUTE_SET */ bit_offset = (offset<<3)+7; for (j = 0; j < num_qos_att_set; j++) { qos_attribute_set_len = tvb_get_bits8(tvb,bit_offset,4); qos_att_tree = proto_tree_add_subtree_format(qos_sub_blob_tree, tvb, bit_offset>>3, qos_attribute_set_len, ett_treelist[TT_3GPP_OBJ_QOS_SUB_BLOB], NULL, "QoS_ATTRIBUTE_SET %u(%u bytes)", j+1, qos_attribute_set_len); proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_att_set_len, tvb, bit_offset, 4, ENC_BIG_ENDIAN); bit_offset+=4; if(qos_attribute_set_len==0){ break; } proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_set_id, tvb, bit_offset, 7, ENC_BIG_ENDIAN); bit_offset+=7; verbose = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_verbose, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; if(verbose == FALSE){ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_prof_id, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=16; }else{ /* Traffic_Class 0 or 3 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_traff_cls, tvb, bit_offset, 3, ENC_BIG_ENDIAN); bit_offset+=3; /* Peak_Rate 0 or 16 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_peak_rate, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=16; /* Bucket_Size 0 or 16 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_bucket_size, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=16; /* Token_Rate 0 or 16 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_token_rate, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=16; /* Max_Latency 0 or 8 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_max_latency, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=8; /* Max_Loss_Rate 0 or 8 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_max_loss_rte, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=8; /* Delay_Var_Sensitive 0 or 1 */ proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_delay_var_sensitive, tvb, bit_offset, 16, ENC_BIG_ENDIAN); bit_offset+=1; } /* Padd to fill up to octet boundary, Reserved 0-7 as needed */ padding_len = 0; if((bit_offset & 0x07) != 0){ padding_len = 8 - (bit_offset & 0x07); proto_tree_add_bits_item(qos_att_tree, hf_rsvp_3gpp_qos_attribute_reserved, tvb, bit_offset, padding_len, ENC_BIG_ENDIAN); } bit_offset = bit_offset + padding_len; } offset = offset + blob_len; tft_qos_list_len = tft_qos_list_len - blob_len; /* Result Code This field is only included in the ResvConf message when * the TFT Operation Code field is set to QoS-Check Confirm. */ item_len = blob_len + 2; if(tft_opcode == 0x81){ proto_tree_add_item(qos_tree, hf_rsvp_3gpp_qos_result, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; tft_qos_list_len--; item_len++; } proto_item_set_len(ti, item_len); } } }else{ proto_tree_add_item(rsvp_object_tree, hf_rsvp_ie_data, tvb, offset, length-2, ENC_NA); } obj_length = obj_length - length; } } } } /*------------------------------------------------------------------------------ * RESTART CAPABILITY *------------------------------------------------------------------------------*/ static void dissect_rsvp_restart_cap(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int offset2 = offset + 4; guint restart, recovery; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "RESTART CAPABILITY: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_restart_cap, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint(rsvp_object_tree, hf_rsvp_restart_cap_restart_time, tvb, offset2, 4, ENC_BIG_ENDIAN, &restart); proto_tree_add_item_ret_uint(rsvp_object_tree, hf_rsvp_restart_cap_recovery_time, tvb, offset2+4, 4, ENC_BIG_ENDIAN, &recovery); proto_item_append_text(ti, "Restart Time: %d ms. Recovery Time: %d ms.", restart, recovery); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_restart_cap, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_restart_cap_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * LINK CAPABILITY *------------------------------------------------------------------------------*/ static void dissect_rsvp_link_cap(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "LINK CAPABILITY: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_link_cap, tvb, offset+3, 1, type); dissect_rsvp_ro_subobjects(ti, pinfo, rsvp_object_tree, tvb, offset + 4, obj_length, rsvp_class); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_link_cap, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_record_route_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * PROTECTION INFORMATION *------------------------------------------------------------------------------*/ static void dissect_rsvp_protection_info(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { guint8 flags1, lsp_flags, link_flags, seg_flags; proto_tree *ti2, *rsvp_pi_link_flags_tree, *rsvp_pi_lsp_flags_tree, *rsvp_pi_seg_flags_tree; int offset2 = offset + 4; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "PROTECTION_INFO: "); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_protection_info, tvb, offset+3, 1, ENC_BIG_ENDIAN); flags1 = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_protection_info_flags_secondary_lsp, tvb, offset2, 1, ENC_BIG_ENDIAN); link_flags = tvb_get_guint8(tvb, offset2+3); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_protection_info_link_flags, tvb, offset2+3, 1, ENC_BIG_ENDIAN); rsvp_pi_link_flags_tree = proto_item_add_subtree(ti2, TREE(TT_PROTECTION_INFO_LINK)); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_extra_traffic, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_unprotected, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_shared, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_dedicated1_1, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_dedicated1plus1, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_enhanced, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%s%s%s%s%s%s%s.", flags1&0x80 ? "SecondaryLSP ":"", link_flags&0x01 ? "ExtraTraffic ":"", link_flags&0x02 ? "Unprotected ":"", link_flags&0x04 ? "Shared ":"", link_flags&0x08 ? "Dedicated1:1 ":"", link_flags&0x10 ? "Dedicated1+1 ":"", link_flags&0x20 ? "Enhanced ":""); break; case 2: /* RFC4872 */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_protection_info, tvb, offset+3, 1, ENC_BIG_ENDIAN); flags1 = tvb_get_guint8(tvb, offset2); proto_tree_add_item(rsvp_object_tree, hf_rsvp_rfc4872_secondary, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_rfc4872_protecting, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_rfc4872_notification_msg, tvb, offset2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_rfc4872_operational, tvb, offset2, 1, ENC_BIG_ENDIAN); lsp_flags = tvb_get_guint8(tvb, offset2+1); rsvp_pi_lsp_flags_tree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+1, 1, TREE(TT_PROTECTION_INFO_LSP), NULL, "LSP Flags: 0x%02x -%s%s%s%s%s%s", lsp_flags, lsp_flags == 0 ? " Unprotected":"", lsp_flags&0x01 ? " Rerouting":"", lsp_flags&0x02 ? " Rerouting with extra-traffic":"", lsp_flags&0x04 ? " 1:N Protection with extra-traffic":"", lsp_flags&0x08 ? " 1+1 Unidirectional protection":"", lsp_flags&0x10 ? " 1+1 Bidirectional protection":""); proto_tree_add_item(rsvp_pi_lsp_flags_tree, hf_rsvp_pi_lsp_flags_full_rerouting, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_lsp_flags_tree, hf_rsvp_pi_lsp_flags_rerouting_extra, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_lsp_flags_tree, hf_rsvp_pi_lsp_flags_1_n_protection, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_lsp_flags_tree, hf_rsvp_pi_lsp_flags_1plus1_unidirectional, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_lsp_flags_tree, hf_rsvp_pi_lsp_flags_1plus1_bidirectional, tvb, offset2+1, 1, ENC_BIG_ENDIAN); link_flags = tvb_get_guint8(tvb, offset2+3); rsvp_pi_link_flags_tree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+3, 1, TREE(TT_PROTECTION_INFO_LINK), NULL, "Link Flags: 0x%02x -%s%s%s%s%s%s", link_flags, link_flags&0x01 ? " ExtraTraffic":"", link_flags&0x02 ? " Unprotected":"", link_flags&0x04 ? " Shared":"", link_flags&0x08 ? " Dedicated1:1":"", link_flags&0x10 ? " Dedicated1+1":"", link_flags&0x20 ? " Enhanced":""); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_extra, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_unprotected, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_shared, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_dedicated_1_1, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_dedicated_1plus1, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_link_flags_tree, hf_rsvp_pi_link_flags_enhanced, tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_protection_info_in_place, tvb, offset2+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_protection_info_required, tvb, offset2+4, 1, ENC_BIG_ENDIAN); seg_flags = tvb_get_guint8(tvb, offset2+5); rsvp_pi_seg_flags_tree = proto_tree_add_subtree_format(rsvp_object_tree, tvb, offset2+5, 1, TREE(TT_PROTECTION_INFO_SEG), NULL, "Segment recovery Flags: 0x%02x - %s%s%s%s%s%s", seg_flags, seg_flags == 0 ? " Unprotected":"", seg_flags&0x01 ? " Rerouting":"", seg_flags&0x02 ? " Rerouting with extra-traffic":"", seg_flags&0x04 ? " 1:N Protection with extra-traffic":"", seg_flags&0x08 ? " 1+1 Unidirectional protection":"", seg_flags&0x10 ? " 1+1 Bidirectional protection":""); proto_tree_add_item(rsvp_pi_seg_flags_tree, hf_rsvp_pi_seg_flags_full_rerouting, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_seg_flags_tree, hf_rsvp_pi_seg_flags_rerouting_extra, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_seg_flags_tree, hf_rsvp_pi_seg_flags_1_n_protection, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_seg_flags_tree, hf_rsvp_pi_seg_flags_1plus1_unidirectional, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_pi_seg_flags_tree, hf_rsvp_pi_seg_flags_1plus1_bidirectional, tvb, offset2+1, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, "%s%s%s%s Link:%s%s%s%s%s%s, LSP:%s%s%s%s%s%s.", flags1&0x80 ? "SecondaryLSP ":"", flags1&0x40 ? "ProtectingLSP ":"", flags1&0x20 ? "Notification ":"", flags1&0x10 ? "OperationalLSP ":"", link_flags&0x01 ? " ExtraTraffic":"", link_flags&0x02 ? " Unprotected":"", link_flags&0x04 ? " Shared":"", link_flags&0x08 ? " Dedicated1:1":"", link_flags&0x10 ? " Dedicated1+1":"", link_flags&0x20 ? " Enhanced":"", lsp_flags == 0 ? " Unprotected":"", lsp_flags&0x01 ? " Rerouting":"", lsp_flags&0x02 ? " Rerouting with extra-traffic":"", lsp_flags&0x04 ? " 1:N Protection with extra-traffic":"", lsp_flags&0x08 ? " 1+1 Unidirectional protection":"", lsp_flags&0x10 ? " 1+1 Bidirectional protection":""); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_protection_info, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_protection_info_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * FAST REROUTE *------------------------------------------------------------------------------*/ static void dissect_rsvp_fast_reroute(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { guint8 flags; proto_tree *ti2, *rsvp_frr_flags_tree; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "FAST_REROUTE: "); switch(type) { case 1: case 7: if (((type == 1) && (obj_length != 24)) || ((type == 7) && (obj_length != 20))) { proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset, obj_length, "Invalid length: cannot decode"); proto_item_append_text(ti, "Invalid length"); break; } proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_fast_reroute, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_setup_priority, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_hold_priority, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_hop_limit, tvb, offset+6, 1, ENC_BIG_ENDIAN); flags = tvb_get_guint8(tvb, offset+7); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_flags, tvb, offset+7, 1, ENC_BIG_ENDIAN); rsvp_frr_flags_tree = proto_item_add_subtree(ti2, TREE(TT_FAST_REROUTE_FLAGS)); proto_tree_add_item(rsvp_frr_flags_tree, hf_rsvp_frr_flags_one2one_backup, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_frr_flags_tree, hf_rsvp_frr_flags_facility_backup, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_bandwidth, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_include_any, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_exclude_any, tvb, offset+16, 4, ENC_BIG_ENDIAN); if (type == 1) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_include_all, tvb, offset+20, 4, ENC_BIG_ENDIAN); } proto_item_append_text(ti, "%s%s", flags &0x01 ? "One-to-One Backup, " : "", flags &0x02 ? "Facility Backup" : ""); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_fast_reroute, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_fast_reroute_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * S2L_SUB_LSP *------------------------------------------------------------------------------*/ static void dissect_rsvp_s2l_sub_lsp(proto_tree *ti, packet_info* pinfo _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "S2L SUB LSP: "); switch(type) { case 1: /* IPv4 */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_s2l_sub_lsp, tvb, offset+3, 1, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(rsvp_object_tree, hf_rsvp_s2l_sub_lsp_destination_ipv4_address, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset)); break; case 2: /* IPv6 */ proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_s2l_sub_lsp, tvb, offset+3, 1, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(rsvp_object_tree, hf_rsvp_s2l_sub_lsp_destination_ipv6_address, tvb, offset, 16, ENC_NA); proto_item_append_text(ti, "IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset)); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_s2l_sub_lsp, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_s2l_sub_lsp_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * DETOUR *------------------------------------------------------------------------------*/ static void dissect_rsvp_detour(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int remaining_length, count; int iter; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "DETOUR: "); switch(type) { case 7: iter = 0; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_detour, tvb, offset+3, 1, ENC_BIG_ENDIAN); for (remaining_length = obj_length - 4, count = 1; remaining_length > 0; remaining_length -= 8, count++) { if (remaining_length < 8) { proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset+remaining_length, obj_length-remaining_length, "Invalid length: cannot decode"); proto_item_append_text(ti, "Invalid length"); break; } iter++; proto_tree_add_ipv4_format(rsvp_object_tree, hf_rsvp_detour_plr_id, tvb, offset+(4*iter), 4, tvb_get_ntohl(tvb, offset+(4*iter)), "PLR ID %d: %s", count, tvb_ip_to_str(pinfo->pool, tvb, offset+(4*iter))); iter++; proto_tree_add_ipv4_format(rsvp_object_tree, hf_rsvp_detour_avoid_node_id, tvb, offset+(4*iter), 4, tvb_get_ntohl(tvb, offset+(4*iter)), "Avoid Node ID %d: %s", count, tvb_ip_to_str(pinfo->pool, tvb, offset+(4*iter))); } break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_detour, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_detour_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * DIFFSERV *------------------------------------------------------------------------------*/ static void dissect_rsvp_diffserv(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { int mapnb, count; int *hfindexes[] = { &hf_rsvp_filter[RSVPF_DIFFSERV_MAP], &hf_rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID], &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], &hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15] }; gint *etts[] = { &TREE(TT_DIFFSERV_MAP), &TREE(TT_DIFFSERV_MAP_PHBID) }; proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "DIFFSERV: "); offset += 3; switch (type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_diffserv, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_uint(rsvp_object_tree, hf_rsvp_filter[RSVPF_DIFFSERV_MAPNB], tvb, offset + 4, 1, mapnb = tvb_get_guint8(tvb, offset + 4) & 15); proto_item_append_text(ti, "E-LSP, %u MAP%s", mapnb, (mapnb == 0) ? "" : "s"); offset += 5; for (count = 0; count < mapnb; count++) { dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, offset, hfindexes, etts); offset += 4; } break; case 2: proto_item_append_text(ti, "L-LSP"); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_diffserv, tvb, offset, 1, ENC_BIG_ENDIAN); dissect_diffserv_mpls_common(tvb, rsvp_object_tree, type, offset + 3, hfindexes, etts); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_diffserv, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_diffserv_data, tvb, offset + 1, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * CLASSTYPE *------------------------------------------------------------------------------*/ static void dissect_rsvp_diffserv_aware_te(proto_tree *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { proto_item *hidden_item; int offset2 = offset + 4; guint8 ct = 0; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_DSTE], tvb, offset, 8, ENC_NA); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); switch(type) { case 1: ct = tvb_get_guint8(tvb, offset2+3); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_diffserv_aware_te, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_DSTE_CLASSTYPE], tvb, offset2+3, 1, ENC_BIG_ENDIAN); proto_item_set_text(ti, "CLASSTYPE: CT %u", ct); break; default: proto_item_set_text(ti, "CLASSTYPE: (Unknown C-type)"); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_diffserv_aware_te, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_diffserv_aware_te_data, tvb, offset2, obj_length - 4, ENC_NA); break; } } /*---------------------------------------------------------------------------- * VENDOR PRIVATE USE *---------------------------------------------------------------------------*/ static void dissect_rsvp_vendor_private_use(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type _U_) { /* * FF: from Section 2, RFC 3936 * * "Organization/Vendor Private" ranges refer to values that are * enterprise-specific; these MUST NOT be registered with IANA. For * Vendor Private values, the first 4-octet word of the data field MUST * be an enterprise code [ENT: www.iana.org/assignments/enterprise-numbers] * (network order) as registered with the IANA SMI Network Management * Private Enterprise Codes, and the rest of the data thereafter is for * the private use of the registered enterprise. */ proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_PRIVATE_OBJ], tvb, offset, obj_length, ENC_NA); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_vendor, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_ENT_CODE], tvb, offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_private_data, tvb, offset + 8, obj_length - 8, ENC_NA); } /*------------------------------------------------------------------------------ * SECONDARY EXPLICIT ROUTE OBJECT *------------------------------------------------------------------------------*/ static void dissect_rsvp_secondary_explicit_route(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "SECONDARY EXPLICIT ROUTE: "); switch(type) { case 2: // P2MP proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_secondary_explicit_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); dissect_rsvp_ro_subobjects(ti, pinfo, rsvp_object_tree, tvb, offset + 4, obj_length, rsvp_class); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_secondary_explicit_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_secondary_explicit_route_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*------------------------------------------------------------------------------ * SECONDARY RECORD ROUTE OBJECT *------------------------------------------------------------------------------*/ static void dissect_rsvp_secondary_record_route(proto_item *ti, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type) { proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_item_set_text(ti, "SECONDARY RECORD ROUTE: "); switch(type) { case 2: // P2MP proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_secondary_record_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); dissect_rsvp_ro_subobjects(ti, pinfo, rsvp_object_tree, tvb, offset + 4, obj_length, rsvp_class); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_secondary_record_route, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_object_tree, hf_rsvp_secondary_record_route_data, tvb, offset+4, obj_length - 4, ENC_NA); break; } } /*---------------------------------------------------------------------------- * CALL ATTRIBUTES *---------------------------------------------------------------------------*/ static void dissect_rsvp_call_attributes(proto_tree *ti _U_, packet_info* pinfo, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length _U_, int rsvp_class _U_, int type _U_) { int offset2 = offset + 4; guint16 tlv_type; guint16 tlv_len; tlv_type = tvb_get_ntohs(tvb, offset2); tlv_len = tvb_get_ntohs(tvb, offset2+2); if (tlv_len < 4){ proto_tree_add_expert_format(rsvp_object_tree, pinfo, &ei_rsvp_invalid_length, tvb, offset2+2, 2, "Invalid TLV length"); return; } switch(tlv_type){ case 2: proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_attributes_endpont_id, tvb, offset2 + 4, tlv_len - 4, ENC_NA|ENC_ASCII); break; } } /*---------------------------------------------------------------------------- * JUNIPER PROPRIETARY *---------------------------------------------------------------------------*/ static void dissect_rsvp_juniper(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type) { /* * Juniper proprietary TLVs: * According to the tcpdump code, this is of the form: * #TLVs (2 bytes) * #Padbytes (2 bytes) * per TLV: * type (1 byte) * length * value (length-2 bytes) * padbytes */ proto_item *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_filter[RSVPF_JUNIPER], tvb, offset, obj_length, ENC_NA); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_juniper, tvb, offset + 3, 1, ENC_BIG_ENDIAN); offset += 4; if (type == 1) { guint tlvs, pad; tlvs = tvb_get_ntohs(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_numtlvs, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; pad = tvb_get_ntohs(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_padlength, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; while (tlvs > 0) { guint8 t, l; t = tvb_get_guint8(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; l = tvb_get_guint8(tvb, offset); proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; switch (t) { case 0x01: proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_attrib_cos, tvb, offset, l-2, ENC_BIG_ENDIAN); offset += (l-2); break; case 0x02: proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_attrib_metric1, tvb, offset, l-2, ENC_BIG_ENDIAN); offset += (l-2); break; case 0x04: proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_attrib_metric2, tvb, offset, l-2, ENC_BIG_ENDIAN); offset += (l-2); break; case 0x08: proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_attrib_ccc_status, tvb, offset, l-2, ENC_BIG_ENDIAN); offset += (l-2); break; case 0x10: proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_attrib_path, tvb, offset, l-2, ENC_BIG_ENDIAN); offset += (l-2); break; default: proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_attrib_unknown, tvb, offset, l-2, ENC_NA); offset += (l-2); break; } tlvs--; } proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_pad, tvb, offset, pad, ENC_NA); } else if (obj_length > 4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_juniper_unknown, tvb, offset, obj_length, ENC_NA); } } /*---------------------------------------------------------------------------- * UNKNOWN *---------------------------------------------------------------------------*/ static void dissect_rsvp_unknown(proto_tree *ti _U_, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type _U_) { proto_tree *hidden_item; hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_unknown, tvb, offset + 3, 1, ENC_BIG_ENDIAN); if (obj_length > 4) { proto_tree_add_item(rsvp_object_tree, hf_rsvp_unknown_data, tvb, offset + 4, obj_length - 4, ENC_NA); } } /*------------------------------------------------------------------------------ * Dissect a single RSVP message in a tree *------------------------------------------------------------------------------*/ static void dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int tree_mode, rsvp_conversation_info *rsvph, gboolean e2ei) { proto_tree *rsvp_tree; proto_tree *rsvp_header_tree; proto_tree *rsvp_object_tree; proto_tree *ti, *len_item; proto_item *hidden_item, *cksum_item; guint16 cksum, computed_cksum; vec_t cksum_vec[1]; int offset = 0; int len; guint8 message_type; int session_off, tempfilt_off; int msg_length; int obj_length; gboolean have_integrity_object = FALSE; offset = 0; msg_length = tvb_get_ntohs(tvb, 6); message_type = tvb_get_guint8(tvb, 1); ti = proto_tree_add_item(tree, proto_rsvp, tvb, offset, msg_length, ENC_NA); rsvp_tree = proto_item_add_subtree(ti, tree_mode); if (e2ei) proto_item_append_text(rsvp_tree, " (E2E-IGNORE)"); proto_item_append_text(rsvp_tree, ": "); proto_item_append_text(rsvp_tree, "%s", val_to_str_ext(message_type, &message_type_vals_ext, "Unknown (%u). ")); find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); if (session_off) proto_item_append_text(rsvp_tree, "%s", summary_session(pinfo->pool, tvb, session_off)); if (tempfilt_off) proto_item_append_text(rsvp_tree, "%s", summary_template(pinfo->pool, tvb, tempfilt_off)); rsvp_header_tree = proto_tree_add_subtree_format(rsvp_tree, tvb, offset, 8, TREE(TT_HDR), &ti, "RSVP Header. %s", val_to_str_ext(message_type, &message_type_vals_ext, "Unknown Message (%u). ")); if (e2ei) proto_item_append_text(ti, " (E2E-IGNORE)"); proto_tree_add_item(rsvp_header_tree, hf_rsvp_version, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_header_tree, hf_rsvp_flags, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_uint(rsvp_header_tree, hf_rsvp_filter[RSVPF_MSG], tvb, offset+1, 1, message_type); switch (RSVPF_MSG + message_type) { case RSVPF_PATH: case RSVPF_RESV: case RSVPF_PATHERR: case RSVPF_RESVERR: case RSVPF_PATHTEAR: case RSVPF_RESVTEAR: case RSVPF_RCONFIRM: case RSVPF_RTEARCONFIRM: case RSVPF_BUNDLE: case RSVPF_ACK: case RSVPF_SREFRESH: case RSVPF_HELLO: case RSVPF_NOTIFY: hidden_item = proto_tree_add_boolean(rsvp_header_tree, hf_rsvp_filter[RSVPF_MSG + message_type], tvb, offset+1, 1, 1); proto_item_set_hidden(hidden_item); break; } cksum = tvb_get_ntohs(tvb, offset+2); cksum_item = proto_tree_add_item(rsvp_header_tree, hf_rsvp_message_checksum, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_header_tree, hf_rsvp_sending_ttl, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rsvp_header_tree, hf_rsvp_message_length, tvb, offset+6, 2, ENC_BIG_ENDIAN); offset = 8; len = 8; if (message_type == RSVP_MSG_BUNDLE) { /* Bundle message. Dissect component messages */ if (rsvp_bundle_dissect) { int len2 = 8; while (len2 < msg_length) { gint sub_len; tvbuff_t *tvb_sub; sub_len = tvb_get_ntohs(tvb, len2+6); tvb_sub = tvb_new_subset_length(tvb, len2, sub_len); dissect_rsvp_msg_tree(tvb_sub, pinfo, rsvp_tree, TREE(TT_BUNDLE_COMPMSG), rsvph, e2ei); len2 += sub_len; } } else { proto_tree_add_expert(rsvp_tree, pinfo, &ei_rsvp_bundle_component_msg, tvb, offset, msg_length - len); } return; } while (len < msg_length) { guint8 rsvp_class; guint8 type; obj_length = tvb_get_ntohs(tvb, offset); rsvp_class = tvb_get_guint8(tvb, offset+2); type = tvb_get_guint8(tvb, offset+3); ti = proto_tree_add_item(rsvp_tree, hf_rsvp_filter[rsvp_class_to_filter_num(rsvp_class)], tvb, offset, obj_length, ENC_BIG_ENDIAN); rsvp_object_tree = proto_item_add_subtree(ti, TREE(rsvp_class_to_tree_type(rsvp_class))); len_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_length, tvb, offset, 2, ENC_BIG_ENDIAN); if (obj_length < 4) { expert_add_info_format(pinfo, len_item, &ei_rsvp_invalid_length, "Length: %u (bogus, must be >= 4)", obj_length); break; } proto_tree_add_uint(rsvp_object_tree, hf_rsvp_filter[RSVPF_OBJECT], tvb, offset+2, 1, rsvp_class); switch(rsvp_class) { case RSVP_CLASS_SESSION: dissect_rsvp_session(pinfo, ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); break; case RSVP_CLASS_HOP: dissect_rsvp_hop(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_TIME_VALUES: dissect_rsvp_time_values(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_ERROR: dissect_rsvp_error(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_SCOPE: dissect_rsvp_scope(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_STYLE: dissect_rsvp_style(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_CONFIRM: dissect_rsvp_confirm(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_SENDER_TEMPLATE: case RSVP_CLASS_FILTER_SPEC: dissect_rsvp_template_filter(pinfo, ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); break; case RSVP_CLASS_SENDER_TSPEC: dissect_rsvp_tspec(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_FLOWSPEC: dissect_rsvp_flowspec(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_ADSPEC: dissect_rsvp_adspec(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_INTEGRITY: have_integrity_object = TRUE; dissect_rsvp_integrity(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_POLICY: dissect_rsvp_policy(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_LABEL_REQUEST: dissect_rsvp_label_request(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_RECOVERY_LABEL: case RSVP_CLASS_UPSTREAM_LABEL: case RSVP_CLASS_SUGGESTED_LABEL: case RSVP_CLASS_LABEL: dissect_rsvp_label(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_LABEL_SET: dissect_rsvp_label_set(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_SESSION_ATTRIBUTE: dissect_rsvp_session_attribute(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_EXPLICIT_ROUTE: dissect_rsvp_explicit_route(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_RECORD_ROUTE: dissect_rsvp_record_route(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_EXCLUDE_ROUTE: dissect_rsvp_exclude_route(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_MESSAGE_ID: dissect_rsvp_message_id(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_MESSAGE_ID_ACK: dissect_rsvp_message_id_ack(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_MESSAGE_ID_LIST: dissect_rsvp_message_id_list(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_HELLO: dissect_rsvp_hello(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_DCLASS: dissect_rsvp_dclass(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_ADMIN_STATUS: dissect_rsvp_admin_status(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_LSP_ATTRIBUTES: case RSVP_CLASS_LSP_REQUIRED_ATTRIBUTES: dissect_rsvp_lsp_attributes(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_ASSOCIATION: dissect_rsvp_association(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_LSP_TUNNEL_IF_ID: dissect_rsvp_lsp_tunnel_if_id(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_NOTIFY_REQUEST: dissect_rsvp_notify_request(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_GENERALIZED_UNI: dissect_rsvp_gen_uni(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); break; case RSVP_CLASS_CALL_ID: dissect_rsvp_call_id(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_3GPP2_OBJECT: dissect_rsvp_3gpp_object(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_RESTART_CAP: dissect_rsvp_restart_cap(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_LINK_CAP: dissect_rsvp_link_cap(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_PROTECTION: dissect_rsvp_protection_info(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_FAST_REROUTE: dissect_rsvp_fast_reroute(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_S2L_SUB_LSP: dissect_rsvp_s2l_sub_lsp(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_DETOUR: dissect_rsvp_detour(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_DIFFSERV: dissect_rsvp_diffserv(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_CLASSTYPE: dissect_rsvp_diffserv_aware_te(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_VENDOR_PRIVATE_1: case RSVP_CLASS_VENDOR_PRIVATE_2: case RSVP_CLASS_VENDOR_PRIVATE_3: case RSVP_CLASS_VENDOR_PRIVATE_4: case RSVP_CLASS_VENDOR_PRIVATE_5: case RSVP_CLASS_VENDOR_PRIVATE_6: case RSVP_CLASS_VENDOR_PRIVATE_7: case RSVP_CLASS_VENDOR_PRIVATE_8: case RSVP_CLASS_VENDOR_PRIVATE_9: case RSVP_CLASS_VENDOR_PRIVATE_10: case RSVP_CLASS_VENDOR_PRIVATE_11: case RSVP_CLASS_VENDOR_PRIVATE_12: dissect_rsvp_vendor_private_use(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_SECONDARY_EXPLICIT_ROUTE: dissect_rsvp_secondary_explicit_route(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_SECONDARY_RECORD_ROUTE: dissect_rsvp_secondary_record_route(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_CALL_ATTRIBUTES: dissect_rsvp_call_attributes(ti, pinfo, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_JUNIPER_PROPERTIES: dissect_rsvp_juniper(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; case RSVP_CLASS_NULL: default: dissect_rsvp_unknown(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type); break; } offset += obj_length; len += obj_length; } /* We delay the checksum check until here so we know if the message * contained an integrity object or not */ if (!pinfo->fragmented && ((int) tvb_captured_length(tvb) >= msg_length)) { /* The packet isn't part of a fragmented datagram and isn't truncated, so we can checksum it. */ SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, msg_length); computed_cksum = in_cksum(&cksum_vec[0], 1); /* * in_cksum() should never return 0xFFFF here, because, to quote * RFC 1624 section 3 "Discussion": * * In one's complement, there are two representations of * zero: the all zero and the all one bit values, often * referred to as +0 and -0. One's complement addition * of non-zero inputs can produce -0 as a result, but * never +0. Since there is guaranteed to be at least * one non-zero field in the IP header, and the checksum * field in the protocol header is the complement of the * sum, the checksum field can never contain ~(+0), which * is -0 (0xFFFF). It can, however, contain ~(-0), which * is +0 (0x0000). * * RFC 1624 is discussing the checksum of the *IPv4* header, * where the "version" field is 4, ensuring that, in a valid * IPv4 header, there is at least one non-zero field, but it * also applies to an RSVP packet, because header includes a * version field with the value 1, so at least one field in * the checksummed data is non-zero. * * in_cksum() returns the negation of the one's-complement * sum of all the data handed to it, and that data won't be * all zero, so the sum won't be 0 (+0), and thus the negation * won't be -0, i.e. won't be 0xFFFF. */ if (computed_cksum == 0) { proto_item_append_text(cksum_item, " [correct]"); } else if (cksum == 0 && have_integrity_object) { proto_item_append_text(cksum_item, " [ignored, integrity object used]"); } else { proto_item_append_text(cksum_item, " [incorrect, should be 0x%04x]", in_cksum_shouldbe(cksum, computed_cksum)); } } } /*------------------------------------------------------------------------------ * The main loop *------------------------------------------------------------------------------*/ static void dissect_rsvp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean e2ei) { guint8 message_type; int session_off, tempfilt_off; rsvp_conversation_info *rsvph; conversation_t *conversation; struct rsvp_request_key request_key, *new_request_key; struct rsvp_request_val *request_val; col_clear(pinfo->cinfo, COL_INFO); message_type = tvb_get_guint8(tvb, 1); rsvph = wmem_new0(pinfo->pool, rsvp_conversation_info); /* Copy over the source and destination addresses from the pinfo strucutre */ set_address(&rsvph->source, pinfo->src.type, pinfo->src.len, pinfo->src.data); set_address(&rsvph->destination, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data); col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext(message_type, &message_type_vals_ext, "Unknown (%u). ")); if (message_type == RSVP_MSG_BUNDLE) { col_set_str(pinfo->cinfo, COL_INFO, rsvp_bundle_dissect ? "Component Messages Dissected" : "Component Messages Not Dissected"); } else { find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); if (session_off) col_append_str(pinfo->cinfo, COL_INFO, summary_session(pinfo->pool, tvb, session_off)); if (tempfilt_off) col_append_str(pinfo->cinfo, COL_INFO, summary_template(pinfo->pool, tvb, tempfilt_off)); } dissect_rsvp_msg_tree(tvb, pinfo, tree, TREE(TT_RSVP), rsvph, e2ei); /* ACK, SREFRESH and HELLO messages don't have any associated SESSION and, therefore, no conversation */ if ((message_type == RSVP_MSG_ACK) || (message_type == RSVP_MSG_SREFRESH) || (message_type == RSVP_MSG_HELLO)) return; /* Find out what conversation this packet is part of. */ conversation = find_or_create_conversation(pinfo); /* Now build the request key */ memset(&request_key, 0, sizeof(request_key)); request_key.conversation = conversation->conv_index; request_key.session_type = rsvph->session_type; switch (request_key.session_type) { case RSVP_SESSION_TYPE_IPV4: set_address(&request_key.u.session_ipv4.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_ipv4.protocol = rsvph->protocol; request_key.u.session_ipv4.udp_dest_port = rsvph->udp_dest_port; break; case RSVP_SESSION_TYPE_IPV6: /* Not supported yet */ break; case RSVP_SESSION_TYPE_IPV4_LSP: set_address(&request_key.u.session_ipv4_lsp.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_ipv4_lsp.udp_dest_port = rsvph->udp_dest_port; request_key.u.session_ipv4_lsp.ext_tunnel_id = rsvph->ext_tunnel_id; break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: set_address(&request_key.u.session_agg_ipv4.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_agg_ipv4.dscp = rsvph->dscp; break; case RSVP_SESSION_TYPE_IPV4_UNI: set_address(&request_key.u.session_ipv4_uni.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_ipv4_uni.udp_dest_port = rsvph->udp_dest_port; request_key.u.session_ipv4_uni.ext_tunnel_id = rsvph->ext_tunnel_id; break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4: set_address(&request_key.u.session_ipv4_p2mp_lsp.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_ipv4_p2mp_lsp.udp_dest_port = rsvph->udp_dest_port; request_key.u.session_ipv4_p2mp_lsp.ext_tunnel_id = rsvph->ext_tunnel_id; break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6: set_address(&request_key.u.session_ipv6_p2mp_lsp.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_ipv6_p2mp_lsp.udp_dest_port = rsvph->udp_dest_port; request_key.u.session_ipv6_p2mp_lsp.ext_tunnel_id = rsvph->ext_tunnel_id_ipv6_pre; break; case RSVP_SESSION_TYPE_IPV4_E_NNI: set_address(&request_key.u.session_ipv4_enni.destination, rsvph->destination.type, rsvph->destination.len, rsvph->destination.data); request_key.u.session_ipv4_enni.udp_dest_port = rsvph->udp_dest_port; request_key.u.session_ipv4_enni.ext_tunnel_id = rsvph->ext_tunnel_id; break; default: /* This should never happen. */ proto_tree_add_expert(tree, pinfo, &ei_rsvp_session_type, tvb, 0, 0); break; } copy_address_shallow(&request_key.source_info.source, &rsvph->source); request_key.source_info.udp_source_port = rsvph->udp_source_port; /* See if a request with this key already exists */ request_val = (struct rsvp_request_val *) wmem_map_lookup(rsvp_request_hash, &request_key); /* If not, insert the new request key into the hash table */ if (!request_val) { new_request_key = (struct rsvp_request_key *)wmem_memdup( wmem_file_scope(), &request_key, sizeof(struct rsvp_request_key)); switch (request_key.session_type) { case RSVP_SESSION_TYPE_IPV4: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_ipv4.destination, &request_key.u.session_ipv4.destination); break; case RSVP_SESSION_TYPE_IPV4_LSP: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_ipv4_lsp.destination, &request_key.u.session_ipv4_lsp.destination); break; case RSVP_SESSION_TYPE_AGGREGATE_IPV4: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_agg_ipv4.destination, &request_key.u.session_agg_ipv4.destination); break; case RSVP_SESSION_TYPE_IPV4_UNI: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_ipv4_uni.destination, &request_key.u.session_ipv4_uni.destination); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_ipv4_p2mp_lsp.destination, &request_key.u.session_ipv4_p2mp_lsp.destination); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_ipv6_p2mp_lsp.destination, &request_key.u.session_ipv6_p2mp_lsp.destination); break; case RSVP_SESSION_TYPE_IPV4_E_NNI: copy_address_wmem(wmem_file_scope(), &new_request_key->u.session_ipv4_enni.destination, &request_key.u.session_ipv4_enni.destination); break; default: break; } copy_address_wmem(wmem_file_scope(), &new_request_key->source_info.source, &rsvph->source); request_val = wmem_new(wmem_file_scope(), struct rsvp_request_val); request_val->value = conversation->conv_index; wmem_map_insert(rsvp_request_hash, new_request_key, request_val); } tap_queue_packet(rsvp_tap, pinfo, rsvph); } static int dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP"); dissect_rsvp_common(tvb, pinfo, tree, FALSE); return tvb_captured_length(tvb); } static int dissect_rsvp_e2ei(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP-E2EI"); dissect_rsvp_common(tvb, pinfo, tree, TRUE); return tvb_captured_length(tvb); } static void register_rsvp_prefs(void) { module_t *rsvp_module; rsvp_module = prefs_register_protocol(proto_rsvp, NULL); prefs_register_bool_preference( rsvp_module, "process_bundle", "Dissect sub-messages in BUNDLE message", "Specifies whether Wireshark should decode and display sub-messages within BUNDLE messages", &rsvp_bundle_dissect); prefs_register_enum_preference( rsvp_module, "generalized_label_options", "Dissect generalized labels as", "Specifies how Wireshark should dissect generalized labels", (gint *)&rsvp_generalized_label_option, rsvp_generalized_label_options, FALSE); } void proto_register_rsvp(void) { gint i; static hf_register_info rsvpf_info[] = { /* Message type number */ {&hf_rsvp_filter[RSVPF_MSG], { "Message Type", "rsvp.msg", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &message_type_vals_ext, 0x0, NULL, HFILL } }, /* Message type shorthands */ {&hf_rsvp_filter[RSVPF_PATH], { "Path Message", "rsvp.path", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RESV], { "Resv Message", "rsvp.resv", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_PATHERR], { "Path Error Message", "rsvp.perr", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RESVERR], { "Resv Error Message", "rsvp.rerr", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_PATHTEAR], { "Path Tear Message", "rsvp.ptear", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RESVTEAR], { "Resv Tear Message", "rsvp.rtear", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RCONFIRM], { "Resv Confirm Message", "rsvp.resvconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RTEARCONFIRM], { "Resv Tear Confirm Message", "rsvp.rtearconf", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_BUNDLE], { "Bundle Message", "rsvp.bundle", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ACK], { "Ack Message", "rsvp.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SREFRESH], { "Srefresh Message", "rsvp.srefresh", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_HELLO], { "HELLO Message", "rsvp.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Object class */ {&hf_rsvp_filter[RSVPF_OBJECT], { "Object class", "rsvp.object", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rsvp_class_vals_ext, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype, { "C-type", "rsvp.ctype", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_session, { "C-type", "rsvp.ctype.session", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_session_vals), 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_3gpp_object, { "C-type", "rsvp.ctype.3gpp_object", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_restart_cap, { "C-type", "rsvp.ctype.restart_cap", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_link_cap, { "C-type", "rsvp.ctype.link_cap", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_protection_info, { "C-type", "rsvp.ctype.protection_info", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_fast_reroute, { "C-type", "rsvp.ctype.fast_reroute", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_detour, { "C-type", "rsvp.ctype.detour", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_diffserv, { "C-type", "rsvp.ctype.diffserv", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_diffserv_vals), 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_diffserv_aware_te, { "C-type", "rsvp.ctype.diffserv_aware_te", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_vendor, { "C-type", "rsvp.ctype.vendor", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_juniper, { "C-type", "rsvp.ctype.juniper", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_unknown, { "C-type", "rsvp.ctype.unknown", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_label, { "C-type", "rsvp.ctype.label", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_label_vals), 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_notify_request, { "C-type", "rsvp.ctype.notify_request", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_notify_request_vals), 0x0, NULL, HFILL } }, {&hf_rsvp_ctype_generalized_uni, { "C-type", "rsvp.ctype.generalized_uni", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_parameter, { "Parameter", "rsvp.parameter", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &svc_vals_ext, 0x0, NULL, HFILL } }, {&hf_rsvp_parameter_flags, { "Parameter flags", "rsvp.parameter_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_parameter_length, { "Parameter length", "rsvp.parameter_length", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_word_not_including_header, 0x0, NULL, HFILL } }, {&hf_rsvp_error_value, { "Error value", "rsvp.error_value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_class, { "Class", "rsvp.class", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_class_length, { "Length", "rsvp.class_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_reserved, { "Reserved", "rsvp.ctype.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_switching_granularity, { "Switching granularity", "rsvp.switching_granularity", FT_UINT16, BASE_DEC, VALS(rsvp_switching_granularity_vals), 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_NOTIFY], { "Notify Message", "rsvp.notify", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Object present shorthands */ {&hf_rsvp_filter[RSVPF_SESSION], { "SESSION", "rsvp.session", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_HOP], { "HOP", "rsvp.hop", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_HELLO_OBJ], { "HELLO Request/Ack", "rsvp.hello_obj", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_INTEGRITY], { "INTEGRITY", "rsvp.integrity", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_TIME_VALUES], { "TIME VALUES", "rsvp.time", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ERROR], { "ERROR", "rsvp.error", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SCOPE], { "SCOPE", "rsvp.scope", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_STYLE], { "STYLE", "rsvp.style", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_FLOWSPEC], { "FLOWSPEC", "rsvp.flowspec", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_FILTER_SPEC], { "FILTERSPEC", "rsvp.filter", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SENDER], { "SENDER TEMPLATE", "rsvp.sender", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_TSPEC], { "SENDER TSPEC", "rsvp.tspec", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADSPEC], { "ADSPEC", "rsvp.adspec", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_POLICY], { "POLICY", "rsvp.policy", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_CONFIRM], { "CONFIRM", "rsvp.confirm", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_LABEL], { "LABEL", "rsvp.label", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RECOVERY_LABEL], { "RECOVERY LABEL", "rsvp.recovery_label", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_UPSTREAM_LABEL], { "UPSTREAM LABEL", "rsvp.upstream_label", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SUGGESTED_LABEL], { "SUGGESTED LABEL", "rsvp.suggested_label", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_LABEL_SET], { "LABEL SET", "rsvp.label_set", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ACCEPTABLE_LABEL_SET], { "ACCEPTABLE LABEL SET", "rsvp.acceptable_label_set", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_PROTECTION], { "PROTECTION", "rsvp.protection", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV], { "DIFFSERV", "rsvp.diffserv", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DSTE], { "CLASSTYPE", "rsvp.dste", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RESTART_CAP], { "RESTART CAPABILITY", "rsvp.restart", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_LINK_CAP], { "LINK CAPABILITY", "rsvp.link", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_LABEL_REQUEST], { "LABEL REQUEST", "rsvp.label_request", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_ATTRIBUTE], { "SESSION ATTRIBUTE", "rsvp.session_attribute", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_EXPLICIT_ROUTE], { "EXPLICIT ROUTE", "rsvp.explicit_route", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_RECORD_ROUTE], { "RECORD ROUTE", "rsvp.record_route", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_MESSAGE_ID], { "MESSAGE-ID", "rsvp.msgid", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_MESSAGE_ID_ACK], { "MESSAGE-ID ACK", "rsvp.msgid_ack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_MESSAGE_ID_LIST], { "MESSAGE-ID LIST", "rsvp.msgid_list", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DCLASS], { "DCLASS", "rsvp.dclass", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_LSP_TUNNEL_IF_ID], { "LSP INTERFACE-ID", "rsvp.lsp_tunnel_if_id", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS], { "ADMIN STATUS", "rsvp.admin_status", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_REFLECT], { "Reflect", "rsvp.admin_status.reflect", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_HANDOVER], { "Handover", "rsvp.admin_status.handover", FT_BOOLEAN, 32, NULL, 0x40, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_LOCKOUT], { "Lockout", "rsvp.admin_status.lockout", FT_BOOLEAN, 32, NULL, 0x20, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_INHIBIT], { "Inhibit Alarm Communication", "rsvp.admin_status.inhibit", FT_BOOLEAN, 32, NULL, 0x10, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_CALL_MGMT], { "Call Management", "rsvp.admin_status.callmgmt", FT_BOOLEAN, 32, NULL, 0x08, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_TESTING], { "Testing", "rsvp.admin_status.testing", FT_BOOLEAN, 32, NULL, 0x04, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_DOWN], { "Administratively down", "rsvp.admin_status.down", FT_BOOLEAN, 32, NULL, 0x02, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ADMIN_STATUS_DELETE], { "Delete in progress", "rsvp.admin_status.delete", FT_BOOLEAN, 32, NULL, 0x01, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_LSP_ATTRIBUTES], { "LSP ATTRIBUTES", "rsvp.lsp_attributes", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_ASSOCIATION], { "ASSOCIATION", "rsvp.association", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SECONDARY_EXPLICIT_ROUTE], { "SECONDARY EXPLICIT ROUTE", "rsvp.secondary_explicit_route", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SECONDARY_RECORD_ROUTE], { "SECONDARY RECORD ROUTE", "rsvp.secondary_record_route", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_CALL_ATTRIBUTES], { "CALL ATTRIBUTES", "rsvp.call_attributes", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_NOTIFY_REQUEST], { "NOTIFY REQUEST", "rsvp.notify_request", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_GENERALIZED_UNI], { "GENERALIZED UNI", "rsvp.generalized_uni", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_CALL_ID], { "CALL ID", "rsvp.call_id", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_3GPP2_OBJECT], { "3GPP2 OBJECT", "rsvp.3gpp2_object", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_PRIVATE_OBJ], { "Private object", "rsvp.obj_private", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_UNKNOWN_OBJ], { "Unknown object", "rsvp.obj_unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Session fields */ {&hf_rsvp_filter[RSVPF_SESSION_IP], { "Destination address", "rsvp.session.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_SHORT_CALL_ID], { "Short Call ID", "rsvp.session.short_call_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_PORT], { "Port number", "rsvp.session.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_PROTO], { "Protocol", "rsvp.session.proto", FT_UINT8, BASE_DEC, VALS(proto_vals), 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_TUNNEL_ID], { "Tunnel ID", "rsvp.session.tunnel_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID], { "Extended tunnel ID", "rsvp.session.ext_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SESSION_EXT_TUNNEL_ID_IPV6], { "Extended tunnel ID", "rsvp.session.ext_tunnel_id_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_JUNIPER], { "Juniper", "rsvp.juniper", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Sender template/Filterspec fields */ {&hf_rsvp_filter[RSVPF_SENDER_IP], { "Sender IPv4 address", "rsvp.sender.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SENDER_PORT], { "Sender port number", "rsvp.sender.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SENDER_LSP_ID], { "LSP ID", "rsvp.sender.lsp_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_SENDER_SHORT_CALL_ID], { "Short Call ID", "rsvp.sender.short_call_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Diffserv object fields */ {&hf_rsvp_filter[RSVPF_DIFFSERV_MAPNB], { "MAPnb", "rsvp.diffserv.mapnb", FT_UINT8, BASE_DEC, NULL, 0x0, MAPNB_DESCRIPTION, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_MAP], { "MAP", "rsvp.diffserv.map", FT_NONE, BASE_NONE, NULL, 0x0, MAP_DESCRIPTION, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_MAP_EXP], { "EXP", "rsvp.diffserv.map.exp", FT_UINT8, BASE_DEC, NULL, 0x0, EXP_DESCRIPTION, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID], { PHBID_DESCRIPTION, "rsvp.diffserv.phbid", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_DSCP], { PHBID_DSCP_DESCRIPTION, "rsvp.diffserv.phbid.dscp", FT_UINT16, BASE_DEC, NULL, PHBID_DSCP_MASK, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_CODE], { PHBID_CODE_DESCRIPTION, "rsvp.diffserv.phbid.code", FT_UINT16, BASE_DEC, NULL, PHBID_CODE_MASK, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT14], { PHBID_BIT14_DESCRIPTION, "rsvp.diffserv.phbid.bit14", FT_UINT16, BASE_DEC, VALS(phbid_bit14_vals), PHBID_BIT14_MASK, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_DIFFSERV_PHBID_BIT15], { PHBID_BIT15_DESCRIPTION, "rsvp.diffserv.phbid.bit15", FT_UINT16, BASE_DEC, VALS(phbid_bit15_vals), PHBID_BIT15_MASK, NULL, HFILL } }, /* Diffserv-aware TE object field */ {&hf_rsvp_filter[RSVPF_DSTE_CLASSTYPE], { "CT", "rsvp.dste.classtype", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Generalized UNI object field */ {&hf_rsvp_filter[RSVPF_GUNI_SRC_IPV4], { "Source TNA", "rsvp.guni.srctna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_GUNI_DST_IPV4], { "Destination TNA", "rsvp.guni.dsttna.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_GUNI_SRC_IPV6], { "Source TNA", "rsvp.guni.srctna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_GUNI_DST_IPV6], { "Destination TNA", "rsvp.guni.dsttna.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Generalized UNI object field */ {&hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV4], { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_filter[RSVPF_CALL_ID_SRC_ADDR_IPV6], { "Source Transport Network Address", "rsvp.callid.srcaddr.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_callid_srcaddr_ether, { "Source Transport Network Address", "rsvp.callid.srcaddr.ether", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_callid_srcaddr_bytes, { "Source Transport Network Address", "rsvp.callid.srcaddr.bytes", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* S2L_SUB_LSP object */ {&hf_rsvp_filter[RSVPF_S2L_SUB_LSP], { "S2L_SUB_LSP", "rsvp.s2l_sub_lsp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* * FF: Vendor Private object field, please see * http://www.iana.org/assignments/enterprise-numbers */ {&hf_rsvp_filter[RSVPF_ENT_CODE], { "Enterprise Code", "rsvp.obj_private.enterprise", FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0, "IANA Network Management Private Enterprise Code", HFILL } }, {&hf_rsvp_error_flags, { "Flags", "rsvp.error_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_rsvp_error_flags_path_state_removed, { "Path State Removed", "rsvp.error_flags.path_state_removed", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, {&hf_rsvp_error_flags_not_guilty, { "NotGuilty", "rsvp.error_flags.not_guilty", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, {&hf_rsvp_error_flags_in_place, { "InPlace", "rsvp.error_flags.in_place", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL } }, {&hf_rsvp_eth_tspec_tlv_color_mode, { "Color Mode (CM)", "rsvp.eth_tspec_tlv.color_mode", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, {&hf_rsvp_eth_tspec_tlv_coupling_flag, { "Coupling Flag (CF)", "rsvp.eth_tspec_tlv.coupling_flag", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL } }, {&hf_rsvp_sender_tspec_standard_contiguous_concatenation, { "Standard contiguous concatenation", "rsvp.sender_tspec.standard_contiguous_concatenation", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL } }, {&hf_rsvp_sender_tspec_arbitrary_contiguous_concatenation, { "Arbitrary contiguous concatenation", "rsvp.sender_tspec.arbitrary_contiguous_concatenation", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL } }, {&hf_rsvp_sender_tspec_regenerator_section, { "Section/Regenerator Section layer transparency", "rsvp.sender_tspec.regenerator_section", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001, NULL, HFILL } }, {&hf_rsvp_sender_tspec_multiplex_section, { "Line/Multiplex Section layer transparency", "rsvp.sender_tspec.multiplex_section", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002, NULL, HFILL } }, {&hf_rsvp_sender_tspec_J0_transparency, { "J0 transparency", "rsvp.sender_tspec.J0_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000004, NULL, HFILL } }, {&hf_rsvp_sender_tspec_SOH_RSOH_DCC_transparency, { "SOH/RSOH DCC transparency", "rsvp.sender_tspec.SOH_RSOH_DCC_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000008, NULL, HFILL } }, {&hf_rsvp_sender_tspec_LOH_MSOH_DCC_transparency, { "LOH/MSOH DCC transparency", "rsvp.sender_tspec.LOH_MSOH_DCC_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000010, NULL, HFILL } }, {&hf_rsvp_sender_tspec_LOH_MSOH_extended_DCC_transparency, { "LOH/MSOH Extended DCC transparency", "rsvp.sender_tspec.LOH_MSOH_extended_DCC_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000020, NULL, HFILL } }, {&hf_rsvp_sender_tspec_K1_K2_transparency, { "K1/K2 transparency", "rsvp.sender_tspec.K1_K2_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000040, NULL, HFILL } }, {&hf_rsvp_sender_tspec_E1_transparency, { "E1 transparency", "rsvp.sender_tspec.E1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000080, NULL, HFILL } }, {&hf_rsvp_sender_tspec_F1_transparency, { "F1 transparency", "rsvp.sender_tspec.F1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000100, NULL, HFILL } }, {&hf_rsvp_sender_tspec_E2_transparency, { "E2 transparency", "rsvp.sender_tspec.E2_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000200, NULL, HFILL } }, {&hf_rsvp_sender_tspec_B1_transparency, { "B1 transparency", "rsvp.sender_tspec.B1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000400, NULL, HFILL } }, {&hf_rsvp_sender_tspec_B2_transparency, { "B2 transparency", "rsvp.sender_tspec.B2_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000800, NULL, HFILL } }, {&hf_rsvp_sender_tspec_M0_transparency, { "M0 transparency", "rsvp.sender_tspec.M0_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00001000, NULL, HFILL } }, {&hf_rsvp_sender_tspec_M1_transparency, { "M1 transparency", "rsvp.sender_tspec.M1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00002000, NULL, HFILL } }, {&hf_rsvp_flowspec_standard_contiguous_concatenation, { "Standard contiguous concatenation", "rsvp.flowspec.standard_contiguous_concatenation", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL } }, {&hf_rsvp_flowspec_arbitrary_contiguous_concatenation, { "Arbitrary contiguous concatenation", "rsvp.flowspec.arbitrary_contiguous_concatenation", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL } }, {&hf_rsvp_flowspec_regenerator_section, { "Section/Regenerator Section layer transparency", "rsvp.flowspec.regenerator_section", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001, NULL, HFILL } }, {&hf_rsvp_flowspec_multiplex_section, { "Line/Multiplex Section layer transparency", "rsvp.flowspec.multiplex_section", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002, NULL, HFILL } }, {&hf_rsvp_flowspec_J0_transparency, { "J0 transparency", "rsvp.flowspec.J0_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000004, NULL, HFILL } }, {&hf_rsvp_flowspec_SOH_RSOH_DCC_transparency, { "SOH/RSOH DCC transparency", "rsvp.flowspec.SOH_RSOH_DCC_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000008, NULL, HFILL } }, {&hf_rsvp_flowspec_LOH_MSOH_DCC_transparency, { "LOH/MSOH DCC transparency", "rsvp.flowspec.LOH_MSOH_DCC_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000010, NULL, HFILL } }, {&hf_rsvp_flowspec_LOH_MSOH_extended_DCC_transparency, { "LOH/MSOH Extended DCC transparency", "rsvp.flowspec.LOH_MSOH_extended_DCC_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000020, NULL, HFILL } }, {&hf_rsvp_flowspec_K1_K2_transparency, { "K1/K2 transparency", "rsvp.flowspec.K1_K2_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000040, NULL, HFILL } }, {&hf_rsvp_flowspec_E1_transparency, { "E1 transparency", "rsvp.flowspec.E1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000080, NULL, HFILL } }, {&hf_rsvp_flowspec_F1_transparency, { "F1 transparency", "rsvp.flowspec.F1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000100, NULL, HFILL } }, {&hf_rsvp_flowspec_E2_transparency, { "E2 transparency", "rsvp.flowspec.E2_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000200, NULL, HFILL } }, {&hf_rsvp_flowspec_B1_transparency, { "B1 transparency", "rsvp.flowspec.B1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000400, NULL, HFILL } }, {&hf_rsvp_flowspec_B2_transparency, { "B2 transparency", "rsvp.flowspec.B2_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000800, NULL, HFILL } }, {&hf_rsvp_flowspec_M0_transparency, { "M0 transparency", "rsvp.flowspec.M0_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00001000, NULL, HFILL } }, {&hf_rsvp_flowspec_M1_transparency, { "M1 transparency", "rsvp.flowspec.M1_transparency", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00002000, NULL, HFILL } }, {&hf_rsvp_integrity_flags_handshake, { "Handshake", "rsvp.integrity.flags.handshake", FT_BOOLEAN, 8, TFS(&tfs_capable_not_capable), 0x01, NULL, HFILL } }, {&hf_rsvp_sa_flags_local, { "Local protection", "rsvp.sa.flags.local", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x01, NULL, HFILL } }, {&hf_rsvp_sa_flags_label, { "Label recording", "rsvp.sa.flags.label", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x02, NULL, HFILL } }, {&hf_rsvp_sa_flags_se_style, { "SE style", "rsvp.sa.flags.se_style", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x04, NULL, HFILL } }, {&hf_rsvp_sa_flags_bandwidth, { "Bandwidth protection", "rsvp.sa.flags.bandwidth", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x08, NULL, HFILL } }, {&hf_rsvp_sa_flags_node, { "Node protection", "rsvp.sa.flags.node", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x10, NULL, HFILL } }, {&hf_rsvp_rro_flags_local_avail, { "Local Protection", "rsvp.rro.flags.local_avail", FT_BOOLEAN, 8, TFS(&tfs_available_not_available), 0x01, NULL, HFILL } }, {&hf_rsvp_rro_flags_local_in_use, { "Local Protection", "rsvp.rro.flags.local_in_use", FT_BOOLEAN, 8, TFS(&tfs_used_notused), 0x02, NULL, HFILL } }, {&hf_rsvp_rro_flags_bandwidth, { "Bandwidth Protection", "rsvp.rro.flags.bandwidth", FT_BOOLEAN, 8, TFS(&tfs_available_not_available), 0x04, NULL, HFILL } }, {&hf_rsvp_rro_flags_node, { "Node Protection", "rsvp.rro.flags.node", FT_BOOLEAN, 8, TFS(&tfs_available_not_available), 0x08, NULL, HFILL } }, {&hf_rsvp_rro_flags_node_address, { "Address Specifies a Node-id Address", "rsvp.rro.flags.node_address", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL } }, {&hf_rsvp_rro_flags_backup_tunnel_bandwidth, { "Backup Tunnel Has Bandwidth", "rsvp.rro.flags.backup_tunnel_bandwidth", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL } }, {&hf_rsvp_rro_flags_backup_tunnel_hop, { "Backup Tunnel Goes To", "rsvp.rro.flags.backup_tunnel_hop", FT_BOOLEAN, 8, TFS(&tfs_next_next_hop_next_hop), 0x08, NULL, HFILL } }, {&hf_rsvp_rro_flags_global_label, { "Global label", "rsvp.rro.flags.global_label", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, {&hf_rsvp_lsp_attr, { "LSP Attributes Flags", "rsvp.lsp_attr", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL} }, {&hf_rsvp_lsp_attr_e2e, { "End-to-end re-routing", "rsvp.lsp_attr.e2e", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x80000000, /* 0 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_boundary, { "Boundary re-routing", "rsvp.lsp_attr.boundary", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x40000000, /* 1 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_segment, { "Segment-based re-routing", "rsvp.lsp_attr.segment", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x20000000, /* 2 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_integrity, { "LSP Integrity Required", "rsvp.lsp_attr.integrity", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x10000000, /* 3 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_contiguous, { "Contiguous LSP", "rsvp.lsp_attr.contiguous", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x08000000, /* 4 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_stitching, { "LSP stitching desired", "rsvp.lsp_attr.stitching", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x04000000, /* 5 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_preplanned, { "Pre-Planned LSP Flag", "rsvp.lsp_attr.preplanned", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x02000000, /* 6 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_nophp, { "Non-PHP behavior flag", "rsvp.lsp_attr.nophp", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x01000000, /* 7 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_oobmap, { "OOB mapping flag", "rsvp.lsp_attr.oobmap", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00800000, /* 8 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_entropy, { "Entropy Label Capability", "rsvp.lsp_attr.entropy", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00400000, /* 9 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_oammep, { "OAM MEP entities desired", "rsvp.lsp_attr.oammep", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00200000, /* 10 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_oammip, { "OAM MIP entities desired", "rsvp.lsp_attr.oammip", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00100000, /* 11 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_srlgcollect, { "SRLG Collection Flag", "rsvp.lsp_attr.srlgcollect", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00080000, /* 12 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_loopback, { "Loopback", "rsvp.lsp_attr.Loopback", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00040000, /* 13 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_p2mp, { "P2MP-TE Tree Re-evaluation Request", "rsvp.lsp_attr.p2mp", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00020000, /* 14 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_rtm, { "RTM_SET", "rsvp.lsp_attr.rtm", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00010000, /* 15 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_telinklabel, { "TE Link Label", "rsvp.lsp_attr.telinklabel", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00008000, /* 16 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_lsi, { "LSI-D", "rsvp.lsp_attr.lsi", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00004000, /* 17 */ NULL, HFILL } }, {&hf_rsvp_lsp_attr_lsids2e, { "LSI-D-S2E", "rsvp.lsp_attr.lsids2e", FT_BOOLEAN, 32, TFS(&tfs_desired_not_desired), 0x00002000, /* 18 */ NULL, HFILL } }, {&hf_rsvp_gen_uni_direction, { "Direction", "rsvp.gen_uni.direction", FT_BOOLEAN, 8, TFS(&tfs_gen_uni_direction), 0x80, NULL, HFILL } }, {&hf_rsvp_protection_info_flags_secondary_lsp, { "Secondary LSP", "rsvp.pi.flags.secondary_lsp", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_extra_traffic, { "Extra Traffic", "rsvp.pi_link.flags.extra_traffic", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x01, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_unprotected, { "Unprotected", "rsvp.pi_link.flags.unprotected", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x02, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_shared, { "Shared", "rsvp.pi_link.flags.shared", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x04, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_dedicated1_1, { "Dedicated 1:1", "rsvp.pi_link.flags.dedicated1_1", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x08, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_dedicated1plus1, { "Dedicated 1+1", "rsvp.pi_link.flags.dedicated1plus1", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x10, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_enhanced, { "Enhanced", "rsvp.pi_link.flags.enhanced", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x20, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_extra, { "Extra Traffic", "rsvp.pi_link.flags.extra", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x01, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_dedicated_1_1, { "Dedicated 1:1", "rsvp.pi_link.flags.dedicated_1_1", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x08, NULL, HFILL } }, {&hf_rsvp_pi_link_flags_dedicated_1plus1, { "Dedicated 1+1", "rsvp.pi_link.flags.dedicated_1plus1", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x10, NULL, HFILL } }, {&hf_rsvp_rfc4872_secondary, { "Secondary LSP", "rsvp.rfc4872.secondary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } }, {&hf_rsvp_rfc4872_protecting, { "Protecting LSP", "rsvp.rfc4872.protecting", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL } }, {&hf_rsvp_rfc4872_notification_msg, { "Protecting LSP", "rsvp.rfc4872.notification_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL } }, {&hf_rsvp_rfc4872_operational, { "Protecting LSP", "rsvp.rfc4872.operational", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL } }, {&hf_rsvp_pi_lsp_flags_full_rerouting, { "(Full) rerouting", "rsvp.pi_lsp.flags.full_rerouting", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x01, NULL, HFILL } }, {&hf_rsvp_pi_lsp_flags_rerouting_extra, { "Rerouting without extra-traffic", "rsvp.pi_lsp.flags.rerouting_extra", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x02, NULL, HFILL } }, {&hf_rsvp_pi_lsp_flags_1_n_protection, { "1:N protection with extra-traffic", "rsvp.pi_lsp.flags.1_n_protection", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x04, NULL, HFILL } }, {&hf_rsvp_pi_lsp_flags_1plus1_unidirectional, { "1+1 unidirectional protection", "rsvp.pi_lsp.flags.1plus1_unidirectional", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x08, NULL, HFILL } }, {&hf_rsvp_pi_lsp_flags_1plus1_bidirectional, { "1+1 bidirectional protection", "rsvp.pi_lsp.flags.1plus1_bidirectional", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x10, NULL, HFILL } }, {&hf_rsvp_protection_info_in_place, { "In-Place", "rsvp.protection_info.in_place", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } }, {&hf_rsvp_protection_info_required, { "Required", "rsvp.protection_info.required", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL } }, {&hf_rsvp_pi_seg_flags_full_rerouting, { "(Full) rerouting", "rsvp.pi_seg.flags.full_rerouting", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x01, NULL, HFILL } }, {&hf_rsvp_pi_seg_flags_rerouting_extra, { "Rerouting without extra-traffic", "rsvp.pi_seg.flags.rerouting_extra", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x02, NULL, HFILL } }, {&hf_rsvp_pi_seg_flags_1_n_protection, { "1:N protection with extra-traffic", "rsvp.pi_seg.flags.1_n_protection", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x04, NULL, HFILL } }, {&hf_rsvp_pi_seg_flags_1plus1_unidirectional, { "1+1 unidirectional protection", "rsvp.pi_seg.flags.1plus1_unidirectional", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x08, NULL, HFILL } }, {&hf_rsvp_pi_seg_flags_1plus1_bidirectional, { "1+1 bidirectional protection", "rsvp.pi_seg.flags.1plus1_bidirectional", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x10, NULL, HFILL } }, {&hf_rsvp_frr_flags_one2one_backup, { "One-to-One Backup", "rsvp.frr.flags.one2one_backup", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x01, NULL, HFILL } }, {&hf_rsvp_frr_flags_facility_backup, { "Facility Backup", "rsvp.frr.flags.facility_backup", FT_BOOLEAN, 8, TFS(&tfs_desired_not_desired), 0x02, NULL, HFILL } }, {&hf_rsvp_type, { "Type", "rsvp.type", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tid, { "Transaction ID", "rsvp.3gpp_obj.tid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_ie_len, { "Length", "rsvp.3gpp_obj.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_ie_type, { "IE Type", "rsvp.3gpp_obj.ie_type", FT_UINT32, BASE_DEC, VALS(rsvp_3gpp_object_ie_type_vals), 0, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_ue_ipv4_addr, { "UE IPv4 address", "rsvp.3gpp_obj.ue_ipv4_addr", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_ue_ipv6_addr, { "UE IPv6 address", "rsvp.3gpp_obj.ue_ipv6_addr", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tft_d, { "Direction(D)", "rsvp.3gpp_obj.tft_d", FT_UINT32, BASE_DEC, VALS(rsvp_3gpp_object_tft_d_vals), 0xc0000000, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tft_ns, { "Non-Specific bit(NS)", "rsvp.3gpp_obj.tft_ns", FT_UINT32, BASE_DEC, NULL, 0x08000000, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tft_sr_id, { "SR_ID", "rsvp.3gpp_obj.tft_sr_id", FT_UINT32, BASE_DEC, NULL, 0x07000000, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tft_p, { "Persistency(P)", "rsvp.3gpp_obj.tft_p", FT_UINT32, BASE_DEC, NULL, 0x00010000, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tft_opcode, { "TFT Operation Code", "rsvp.3gpp_obj.tft_opcode", FT_UINT32, BASE_DEC, VALS(rsvp_3gpp_obj_tft_opcode_vals), 0x0000ff00, NULL, HFILL } }, {&hf_rsvp_3gpp_obj_tft_n_pkt_flt, { "Number of Packet filters", "rsvp.3gpp_obj.tft_n_pkt_flt", FT_UINT32, BASE_DEC, NULL, 0x000000ff, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_flow_id, { "Flow Identifier", "rsvp.3gpp_obj.flow_id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_ev_prec, { "Packet filter evaluation precedence", "rsvp.3gpp_obj.pf_ev_prec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_len, { "Packet filter length", "rsvp.3gpp_obj.pf_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_type, { "PF Type", "rsvp.3gpp_obj.pf_type", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_cont_len, { "Length", "rsvp.3gpp_obj.pf_cont_len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_comp_type_id, { "PF component identifier", "rsvp.3gpp_obj.pf_comp_type_id", FT_UINT8, BASE_DEC, VALS(rsvp_3gpp_obj_pf_comp_type_id_vals), 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_src_ipv4, { "IPv4 Source Address", "rsvp.3gpp_obj.pf_src_ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_dst_ipv4, { "IPv4 Destination Address", "rsvp.3gpp_obj.pf_dst_ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_ipv4_mask, { "IPv4 Mask", "rsvp.3gpp_obj.pf_ipv4_mask", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_src_ipv6, { "IPv6 Source Address", "rsvp.3gpp_obj.pf_src_ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_dst_ipv6, { "IPv6 Destination Address", "rsvp.3gpp_obj.pf_dst_ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_ipv6_prefix_length, { "IPv6 Prefix length", "rsvp.3gpp_obj.pf_ipv6_prefix_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_prot_next, { "Protocol field(IPv4) or Next Header(IPv6)", "rsvp.3gpp_obj.pf_prot_next", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_dst_port, { "Single Destination Port", "rsvp.3gpp_obj.pf_dst_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_src_port, { "Single Source Port", "rsvp.3gpp_obj.pf_src_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_ipsec_spi, { "IPsec SPI", "rsvp.3gpp_obj.pf_ipsec_spi", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_tos_tc, { "Type of Service (IPv4)/Traffic Class (IPv6)", "rsvp.3gpp_obj.pf_tos_tc", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_flow_lbl, { "Flow label", "rsvp.3gpp_obj.pf_flow_lbl", FT_UINT24, BASE_DEC, NULL, 0x0fffff, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_ipv6, { "IPv6 Address", "rsvp.3gpp_obj.pf_ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_treatment, { "PF Treatment", "rsvp.3gpp_obj.pf_treatment", FT_UINT8, BASE_DEC, VALS(rsvp_3gpp_obj_pf_treatment_vals), 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_pf_hint, { "PF Hint", "rsvp.3gpp_obj.pf_hint", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_obj_tft_qos_list_len, { "QoS List Length", "rsvp.3gpp_obj.qos_list_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_r_qos_blob_len, { "R_QOS_SUB_BLOB_LEN", "rsvp.3gpp_obj.r_qos_blob_len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_r_qos_blob_flow_pri, { "FLOW_PRIORITY", "rsvp.3gpp_obj.r_qos_blob.flow_pri", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL } }, { &hf_rsvp_3gpp_r_qos_blob_num_qos_att_set, { "NUM_QoS_ATTRIBUTE_SETS", "rsvp.3gpp_obj.r_qos_blob.num_qos_att_set", FT_UINT8, BASE_DEC, NULL, 0x0e, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_att_set_len, { "QoS_ATTRIBUTE_SET_LEN", "rsvp.3gpp_obj.r_qos_blob.qos_att_set_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_set_id, { "QoS_ATTRIBUTE_SET_ID", "rsvp.3gpp_obj.r_qos_blob.qos_attribute_set_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_verbose, { "VERBOSE", "rsvp.3gpp_obj.r_qos_blob.verbose", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_prof_id, { "ProfileID", "rsvp.3gpp_obj.r_qos_blob.prof_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_traff_cls, { "Traffic_Class", "rsvp.3gpp_obj.r_qos_blob.traff_cls", FT_UINT8, BASE_DEC, VALS(rsvp_3gpp_obj_traffic_class_vals), 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_peak_rate, { "Peak_Rate", "rsvp.3gpp_obj.r_qos_blob.peak_rate", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_bucket_size, { "Bucket_Size", "rsvp.3gpp_obj.r_qos_blob.bucket_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_token_rate, { "Token_Rate", "rsvp.3gpp_obj.r_qos_blob.token_rate", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_max_latency, { "Max_Latency", "rsvp.3gpp_obj.r_qos_blob.max_latency", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_max_loss_rte, { "Max_Loss_Rate", "rsvp.3gpp_obj.r_qos_blob.max_loss_rte", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_delay_var_sensitive, { "Delay_Var_Sensitive", "rsvp.3gpp_obj.r_qos_blob.delay_var_sensitive", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_attribute_reserved, { "Reserved", "rsvp.3gpp_obj.r_qos_blob.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rsvp_3gpp_r_qos_blob, { "R_QOS_SUB_BLOB", "rsvp.3gpp_obj.r_qos_blob", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_3gpp_qos_result, { "Result Code", "rsvp.3gpp_obj.qos_result_code", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_lbit, { "L(oose) bit", "rsvp.xro.sobj.lbit", FT_UINT8, BASE_DEC,VALS(rsvp_xro_sobj_lbit_vals), 0x80, NULL, HFILL } }, { &hf_rsvp_rro_sobj_dbit, { "D(irection) bit", "rsvp.rro.sobj.dbit", FT_UINT8, BASE_DEC,VALS(rsvp_rro_sobj_dbit_vals), 0x80, NULL, HFILL } }, { &hf_rsvp_xro_sobj_len, { "Length", "rsvp.xro.sobj.len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_ipv4_addr, { "IPv4 prefix", "rsvp.xro.sobj.ipv4.addr", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_ipv4_prefix, { "Prefix Length", "rsvp.xro.sobj.ipv4.prefix", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_ipv4_attr, { "Attribute", "rsvp.xro.sobj.ipv4.attr", FT_UINT8, BASE_DEC, VALS(rsvp_xro_sobj_ip_attr_vals), 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_ipv6_attr, { "Attribute", "rsvp.xro.sobj.ipv6.attr", FT_UINT8, BASE_DEC, VALS(rsvp_xro_sobj_ip_attr_vals), 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_srlg_id, { "SRLG Id", "rsvp.xro.sobj.srlg.id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_xro_sobj_srlg_res, { "Reserved", "rsvp.xro.sobj.srlg.res", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_private_data, { "Data", "rsvp.private.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_numtlvs, { "Num TLVs", "rsvp.juniper.tlvs", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_padlength, { "Padlength", "rsvp.juniper.padlength", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_type, { "Juniper type", "rsvp.juniper.type", FT_UINT8, BASE_HEX, VALS(rsvp_juniper_attr_vals), 0, NULL, HFILL } }, { &hf_rsvp_juniper_length, { "Juniper length", "rsvp.juniper.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_attrib_cos, { "Cos", "rsvp.juniper.attrib.cos", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_attrib_metric1, { "Metric 1", "rsvp.juniper.attrib.metric1", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_attrib_metric2, { "Metric 2", "rsvp.juniper.attrib.metric2", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_attrib_ccc_status, { "CCC Status", "rsvp.juniper.attrib.ccc_status", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_attrib_path, { "Path type", "rsvp.juniper.attrib.path", FT_UINT16, BASE_HEX, VALS(rsvp_juniper_path_attr_vals), 0, NULL, HFILL } }, { &hf_rsvp_juniper_attrib_unknown, { "Unknown", "rsvp.juniper.attrib.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_pad, { "Pad", "rsvp.juniper.pad", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_juniper_unknown, { "Unknown", "rsvp.juniper.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_unknown_data, { "Data", "rsvp.unknown.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, {&hf_rsvp_loose_hop, { "Hop", "rsvp.loose_hop", FT_BOOLEAN, 8, TFS(&tfs_loose_strict_hop), 0x80, NULL, HFILL } }, { &hf_rsvp_data_length, { "Data length", "rsvp.data_length", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_word_not_including_header, 0, NULL, HFILL } }, { &hf_rsvp_ctype_s2l_sub_lsp, { "C-Type", "rsvp.ctype.s2l_sub_lsp", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_s2l_sub_lsp_vals), 0, NULL, HFILL } }, { &hf_rsvp_s2l_sub_lsp_destination_ipv4_address, { "IPv4 S2L Sub-LSP destination address", "rsvp.s2l_sub_lsp.destination_ipv4_address", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_s2l_sub_lsp_destination_ipv6_address, { "IPv6 S2L Sub-LSP destination address", "rsvp.s2l_sub_lsp.destination_ipv6_address", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rsvp_s2l_sub_lsp_data, { "Data", "rsvp.s2l_sub_lsp.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_rsvp_session_flags, { "Flags", "rsvp.session.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_destination_address, { "Destination address", "rsvp.session.destination_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_protocol, { "Protocol", "rsvp.session.protocol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_destination_port, { "Destination port", "rsvp.session.destination_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_dscp, { "DSCP", "rsvp.session.dscp", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dscp_vals_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_session_extended_ipv4_address, { "Extended IPv4 Address", "rsvp.session.extended_ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_p2mp_id, { "P2MP ID", "rsvp.session.p2mp_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_data, { "Data", "rsvp.session.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_length, { "Length", "rsvp.ifid_tlv.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_ipv4_address, { "IPv4 address", "rsvp.ifid_tlv.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_ipv6_address, { "IPv6 address", "rsvp.ifid_tlv.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlvinterface_id, { "Interface-ID", "rsvp.ifid_tlv.interface_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_label, { "Label", "rsvp.ifid_tlv.label", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_node_id, { "Node ID", "rsvp.ifid_tlv.node_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_area, { "Area", "rsvp.ifid_tlv.area", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_autonomous_system, { "Autonomous System", "rsvp.ifid_tlv.autonomous_system", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_error_string, { "Error String", "rsvp.ifid_tlv.error_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_data, { "Data", "rsvp.ifid_tlv.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ifid_tlv_padding, { "Padding", "rsvp.ifid_tlv.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_hop, { "C-Type", "rsvp.ctype.hop", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_hop_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_hop_neighbor_address_ipv4, { "Neighbor address", "rsvp.hop.neighbor_address_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_hop_logical_interface, { "Logical interface", "rsvp.hop.logical_interface", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_hop_neighbor_address_ipv6, { "Neighbor address", "rsvp.neighbor_address_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_hop_data, { "Data", "rsvp.hop.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_time_values, { "C-Type", "rsvp.ctype.time_values", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_time_values_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_time_values_data, { "Data", "rsvp.time_values.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_error, { "C-Type", "rsvp.ctype.error", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_error_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_error_error_node_ipv4, { "Error node", "rsvp.error.error_node_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_error_error_node_ipv6, { "Error node", "rsvp.error.error_node_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_error_data, { "Data", "rsvp.error.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_error_error_code, { "Error code", "rsvp.error.error_code", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rsvp_error_codes_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_scope, { "C-Type", "rsvp.ctype.scope", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_scope_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_scope_ipv4_address, { "IPv4 Address", "rsvp.scope.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_scope_ipv6_address, { "IPv6 Address", "rsvp.scope.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_scope_data, { "Data", "rsvp.scope.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_style, { "C-Type", "rsvp.ctype.style", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_style_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_style_flags, { "Flags", "rsvp.style.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_style_style, { "Style", "rsvp.style.style", FT_UINT24, BASE_HEX, VALS(style_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_style_data, { "Data", "rsvp.style.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_confirm, { "C-Type", "rsvp.ctype.confirm", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_confirm_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_confirm_receiver_address_ipv4, { "Receiver address", "rsvp.confirm.receiver_address_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_confirm_receiver_address_ipv6, { "Receiver address", "rsvp.confirm.receiver_address_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_confirm_data, { "Data", "rsvp.confirm.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_template, { "C-Type", "rsvp.ctype.template", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_template_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_source_address_ipv6, { "Source address", "rsvp.template_filter.source_address_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_source_port, { "Source port", "rsvp.template_filter.source_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_ipv4_tunnel_sender_address, { "IPv4 Tunnel Sender Address", "rsvp.template_filter.ipv4_tunnel_sender_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_ipv6_tunnel_sender_address, { "IPv6 Tunnel Sender Address", "rsvp.template_filter.ipv6_tunnel_sender_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_sub_group_originator_id, { "Sub-Group Originator ID", "rsvp.template_filter.sub_group_originator_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_sub_group_id, { "Sub-Group ID", "rsvp.template_filter.sub_group_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_template_filter_data, { "Data", "rsvp.template_filter.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_length, { "Length", "rsvp.eth_tspec.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_profile, { "Profile", "rsvp.eth_tspec.profile", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_index, { "Index", "rsvp.eth_tspec.index", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_reserved, { "Reserved", "rsvp.eth_tspec.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_el2cp, { "EL2CP", "rsvp.eth_tspec.el2cp", FT_UINT8, BASE_DEC, VALS(el2cp_val_str), 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_il2cp, { "IL2CP", "rsvp.eth_tspec.il2cp", FT_UINT8, BASE_DEC, VALS(il2cp_val_str), 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_cir, { "CIR", "rsvp.eth_tspec.cir", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_cbs, { "CBS", "rsvp.eth_tspec.cbs", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_eir, { "EIR", "rsvp.eth_tspec.eir", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_eth_tspec_ebs, { "EBS", "rsvp.eth_tspec.ebs", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_tspec, { "C-Type", "rsvp.ctype.tspec", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_tspec_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_message_format_version, { "Message format version", "rsvp.tspec.message_format_version", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_rsvp_tspec_service_header, { "Service header", "rsvp.tspec.service_header", FT_UINT8, BASE_DEC, VALS(qos_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_token_bucket_rate, { "Token bucket rate", "rsvp.tspec.token_bucket_rate", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_token_bucket_size, { "Token bucket size", "rsvp.tspec.token_bucket_size", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_peak_data_rate, { "Peak data rate", "rsvp.tspec.peak_data_rate", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_hint, { "Hint", "rsvp.tspec.hint", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_compression_factor, { "Compression Factor", "rsvp.tspec.compression_factor", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_signal_type_sonet, { "Signal Type", "rsvp.tspec.signal_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gmpls_sonet_signal_type_str_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_requested_concatenation, { "Requested Concatenation (RCC)", "rsvp.tspec.requested_concatenation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_number_of_contiguous_components, { "Number of Contiguous Components (NCC)", "rsvp.tspec.number_of_contiguous_components", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_number_of_virtual_components, { "Number of Virtual Components (NVC)", "rsvp.tspec.number_of_virtual_components", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_multiplier, { "Multiplier (MT)", "rsvp.tspec.multiplier", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_transparency, { "Transparency (T)", "rsvp.tspec.transparency", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_profile, { "Profile (P)", "rsvp.tspec.profile", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_signal_type_g709, { "Signal Type", "rsvp.tspec.signal_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_g709_signal_type_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_number_of_multiplexed_components, { "Number of Multiplexed Components (NMC)", "rsvp.number_of_multiplexed_components", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_mtu, { "MTU", "rsvp.tspec.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_tspec_data, { "Data", "rsvp.tspec.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_flowspec, { "C-Type", "rsvp.ctype.flowspec", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_flowspec_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_message_format_version, { "Message format version", "rsvp.flowspec.message_format_version", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_rsvp_flowspec_service_header, { "Service header", "rsvp.flowspec.service_header", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &intsrv_services_str_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_token_bucket_rate, { "Token bucket rate", "rsvp.flowspec.token_bucket_rate", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_token_bucket_size, { "Token bucket size", "rsvp.flowspec.token_bucket_size", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_peak_data_rate, { "Peak data rate", "rsvp.flowspec.peak_data_rate", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_rate, { "Rate", "rsvp.flowspec.rate", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_slack_term, { "Slack term", "rsvp.flowspec.slack_term", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_signal_type_sonet, { "Signal Type", "rsvp.flowspec.signal_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gmpls_sonet_signal_type_str_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_requested_concatenation, { "Requested Concatenation (RCC)", "rsvp.flowspec.requested_concatenation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_number_of_contiguous_components, { "Number of Contiguous Components (NCC)", "rsvp.flowspec.number_of_contiguous_components", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_number_of_virtual_components, { "Number of Virtual Components (NVC)", "rsvp.flowspec.number_of_virtual_components", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_multiplier, { "Multiplier (MT)", "rsvp.flowspec.multiplier", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_transparency, { "Transparency (T)", "rsvp.flowspec.transparency", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_profile, { "Profile (P)", "rsvp.flowspec.profile", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_signal_type_g709, { "Signal Type", "rsvp.flowspec.signal_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_g709_signal_type_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_number_of_multiplexed_components, { "Number of Multiplexed Components (NMC)", "rsvp.flowspec.number_of_multiplexed_components", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_mtu, { "MTU", "rsvp.flowspec.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_flowspec_m, { "m", "rsvp.flowspec.m", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_adspec, { "C-Type", "rsvp.ctype.adspec", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_adspec_message_format_version, { "Message format version", "rsvp.adspec.message_format_version", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_rsvp_adspec_service_header, { "Service header", "rsvp.adspec.service_header", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &intsrv_services_str_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_integrity, { "C-Type", "rsvp.ctype.integrity", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_integrity_flags, { "Flags", "rsvp.integrity.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_integrity_key_identifier, { "Key Identifier", "rsvp.integrity.key_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_integrity_sequence_number, { "Sequence Number", "rsvp.integrity.sequence_number", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_integrity_hash, { "Hash", "rsvp.integrity.hash", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_policy, { "C-Type", "rsvp.ctype.policy", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_policy_data, { "Data", "rsvp.policy.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_label_request, { "C-Type", "rsvp.ctype.label_request", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_label_request_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_label_request_l3pid, { "L3PID", "rsvp.label_request.l3pid", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_label_request_min_vpi, { "Min VPI", "rsvp.label_request.min_vpi", FT_UINT16, BASE_DEC, NULL, 0x7f, NULL, HFILL }}, { &hf_rsvp_label_request_min_vci, { "Min VCI", "rsvp.label_request.min_vci", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_request_max_vpi, { "Max VPI", "rsvp.label_request.max_vpi", FT_UINT16, BASE_DEC, NULL, 0x7f, NULL, HFILL }}, { &hf_rsvp_label_request_max_vci, { "Max VCI", "rsvp.label_request.max_vci", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_request_lsp_encoding_type, { "LSP Encoding Type", "rsvp.label_request.lsp_encoding_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_lsp_enc_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_label_request_switching_type, { "Switching Type", "rsvp.label_request.switching_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_switching_type_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_g_pid, { "G-PID", "rsvp.label_request.g_pid", FT_UINT16, BASE_HEX|BASE_RANGE_STRING, RVALS(gmpls_gpid_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_label_request_data, { "Data", "rsvp.label_request.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_label, { "Label", "rsvp.label.label", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_generalized_label, { "Generalized Label", "rsvp.label.generalized_label", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_generalized_label_evpl_vlad_id, { "VLAN ID", "rsvp.label.generalized_label_evpl_vlad_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_data, { "Data", "rsvp.label.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_set_action, { "Action", "rsvp.label_set.action", FT_UINT8, BASE_DEC, VALS(action_type_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_attribute, { "C-Type", "rsvp.ctype.attribute", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_attribute_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_exclude_any, { "Exclude-Any", "rsvp.session_attribute.exclude_any", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_include_any, { "Include-Any", "rsvp.session_attribute.include_any", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_include_all, { "Include-All", "rsvp.session_attribute.include_all", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_setup_priority, { "Setup priority", "rsvp.session_attribute.setup_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_hold_priority, { "Hold priority", "rsvp.session_attribute.hold_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_flags, { "Flags", "rsvp.session_attribute.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_name_length, { "Name length", "rsvp.session_attribute.name_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_name, { "Name", "rsvp.session_attribute.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_session_attribute_data, { "Data", "rsvp.session_attribute.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_length, { "Length", "rsvp.ero_rro_subobjects.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_ipv4_hop, { "IPv4 hop", "rsvp.ero_rro_subobjects.ipv4_hop", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_prefix_length, { "Prefix length", "rsvp.ero_rro_subobjects.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_flags, { "Flags", "rsvp.ero_rro_subobjects.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_ipv6_hop, { "IPv6 hop", "rsvp.ero_rro_subobjects.ipv6_hop", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_label, { "Label", "rsvp.ero_rro_subobjects.label", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_router_id, { "Router-ID", "rsvp.ero_rro_subobjects.router_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_interface_id, { "Interface-ID", "rsvp.ero_rro_subobjects.interface_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_path_key, { "Path Key", "rsvp.ero_rro_subobjects.path_key", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_pce_id_ipv4, { "PCE-ID", "rsvp.ero_rro_subobjects.pce_id_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_pce_id_ipv6, { "PCE-ID", "rsvp.ero_rro_subobjects.pce_id_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_private_length, { "Length", "rsvp.ero_rro_subobjects.private_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_subobjects_private_data, { "Data", "rsvp.ero_rro_subobjects.private_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_explicit_route, { "C-Type", "rsvp.ctype.explicit_route", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_explicit_route_data, { "Data", "rsvp.explicit_route.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_record_route, { "C-Type", "rsvp.ctype.record_route", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_record_route_data, { "Data", "rsvp.record_route.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_exclude_route, { "C-Type", "rsvp.ctype.exclude_route", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_exclude_route_data, { "Data", "rsvp.exclude_route.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_secondary_explicit_route, { "C-Type", "rsvp.ctype.secondary_explicit_route", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_secondary_explicit_route_data, { "Data", "rsvp.secondary_explicit_route.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_secondary_record_route, { "C-Type", "rsvp.ctype.secondary_record_route", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_secondary_record_route_data, { "Data", "rsvp.secondary_record_route.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_message_id, { "C-Type", "rsvp.ctype.message_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_flags, { "Flags", "rsvp.message_id.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_epoch, { "Epoch", "rsvp.message_id.epoch", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_message_id, { "Message-ID", "rsvp.message_id.message_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_data, { "Data", "rsvp.message_id.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_message_id_ack, { "C-Type", "rsvp.ctype.message_id_ack", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_ack_flags, { "Flags", "rsvp.message_id_ack.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_ack_epoch, { "Epoch", "rsvp.message_id_ack.epoch", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_ack_message_id, { "Message-ID", "rsvp.message_id_ack.message_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_ack_data, { "Data", "rsvp.message_id_ack.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_message_id_list, { "C-Type", "rsvp.ctype.message_id_list", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_list_flags, { "Flags", "rsvp.message_id_list.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_list_epoch, { "Epoch", "rsvp.message_id_list.epoch", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_list_message_id, { "Message-ID", "rsvp.message_id_list.message_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_id_list_data, { "Data", "rsvp.message_id_list.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_hello, { "C-Type", "rsvp.ctype.hello", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_hello_source_instance, { "Source Instance", "rsvp.hello.source_instance", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_hello_destination_instance, { "Destination Instance", "rsvp.hello.destination_instance", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_dclass, { "C-Type", "rsvp.ctype.dclass", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_dclass_dscp, { "DSCP", "rsvp.dclass.dscp", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dscp_vals_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_dclass_data, { "Data", "rsvp.dclass.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_admin_status, { "C-Type", "rsvp.ctype.admin_status", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_admin_status_bits, { "Admin Status", "rsvp.admin_status.bits", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_admin_status_data, { "Data", "rsvp.admin_status.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_lsp_attributes, { "C-Type", "rsvp.ctype.lsp_attributes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_attributes_tlv, { "LSP attributes TLV", "rsvp.lsp_attributes_tlv", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_attributes_tlv_data, { "Data", "rsvp.lsp_attributes_tlv.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_association, { "C-Type", "rsvp.ctype.association", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_association_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_association_type, { "Association type", "rsvp.association.type", FT_UINT16, BASE_DEC, VALS(association_type_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_association_id, { "Association ID", "rsvp.association.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_association_source_ipv4, { "Association source", "rsvp.association.source_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_association_source_ipv6, { "Association source", "rsvp.association.source_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_association_routing_area_id, { "Routing Area ID", "rsvp.association.routing_area_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_association_node_id, { "Node ID", "rsvp.association.node_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_association_padding, { "Padding", "rsvp.association.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_association_data, { "Data", "rsvp.association.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_tunnel_if_id, { "C-Type", "rsvp.ctype.tunnel_if_id", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_tunnel_if_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_length, { "Length", "rsvp.lsp_tunnel_if_id.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_component_link_identifier, { "Component link identifier", "rsvp.lsp_tunnel_if_id.component_link_identifier", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_component_link_identifier_ipv4, { "Component link identifier", "rsvp.lsp_tunnel_if_id.component_link_identifier_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_lsp_encoding_type, { "LSP Encoding Type", "rsvp.lsp_tunnel_if_id.lsp_encoding_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_lsp_enc_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_switching_type, { "Switching Type", "rsvp.lsp_tunnel_if_id.switching_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_switching_type_rvals), 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_signal_type, { "Signal Type", "rsvp.lsp_tunnel_if_id.signal_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gmpls_sonet_signal_type_str_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_connection_id, { "Sub Interface/Connection ID", "rsvp.lsp_tunnel_if_id.connection_id", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_sc_pc_id, { "SC PC ID", "rsvp.lsp_tunnel_if_id.sc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_sc_pc_scn_address, { "SC PC SCN Address", "rsvp.lsp_tunnel_if_id.sc_pc_scn_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_router_id, { "Router ID", "rsvp.lsp_tunnel_if_id.router_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_interface_id, { "Interface ID", "rsvp.lsp_tunnel_if_id.interface_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_ipv4_interface_address, { "IPv4 interface address", "rsvp.lsp_tunnel_if_id.ipv4_interface_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_target_igp_instance, { "Target IGP instance", "rsvp.lsp_tunnel_if_id.target_igp_instance", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_action, { "Action", "rsvp.lsp_tunnel_if_id.action", FT_UINT8, BASE_DEC, VALS(lsp_tunnel_if_id_action_str), 0xF0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_ipv6_interface_address, { "IPv6 interface address", "rsvp.lsp_tunnel_if_id.ipv6_interface_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_lsp_tunnel_if_id_data, { "Data", "rsvp.lsp_tunnel_if_id.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_notify_request_notify_node_address_ipv4, { "Notify node address", "rsvp.notify_request.notify_node_address_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_notify_request_notify_node_address_ipv6, { "Notify node address", "rsvp.notify_request.notify_node_address_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_notify_request_data, { "Data", "rsvp.notify_request.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ctype_call_id, { "C-Type", "rsvp.ctype.call_id", FT_UINT32, BASE_DEC, VALS(rsvp_c_type_call_id_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_call_id_data, { "Data", "rsvp.call_id.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_call_id_address_type, { "Address type", "rsvp.call_id.address_type", FT_UINT8, BASE_DEC, VALS(address_type_vals), 0x0, NULL, HFILL }}, { &hf_rsvp_call_id_reserved, { "Reserved", "rsvp.call_id.reserved", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_call_id_international_segment, { "International Segment", "rsvp.call_id.international_segment", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_call_id_national_segment, { "National Segment", "rsvp.call_id.national_segment", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_call_id_local_identifier, { "Local Identifier", "rsvp.call_id.local_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_restart_cap_data, { "Data", "rsvp.restart_cap.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_protection_info_link_flags, { "Link Flags", "rsvp.protection_info.link_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_protection_info_data, { "Data", "rsvp.protection_info.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_setup_priority, { "Setup Priority", "rsvp.fast_reroute.setup_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_hold_priority, { "Hold Priority", "rsvp.fast_reroute.hold_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_hop_limit, { "Hop Limit", "rsvp.fast_reroute.hop_limit", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_flags, { "Flags", "rsvp.fast_reroute.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_bandwidth, { "Bandwidth", "rsvp.fast_reroute.bandwidth", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_include_any, { "Include-Any", "rsvp.fast_reroute.include_any", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_exclude_any, { "Exclude-Any", "rsvp.fast_reroute.exclude_any", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_include_all, { "Include-All", "rsvp.fast_reroute.include_all", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_fast_reroute_data, { "Data", "rsvp.fast_reroute.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_detour_data, { "Data", "rsvp.detour.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_diffserv_data, { "Data", "rsvp.diffserv.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_diffserv_aware_te_data, { "Data", "rsvp.diffserv_aware_te.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_version, { "RSVP Version", "rsvp.version", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_rsvp_flags, { "Flags", "rsvp.flags", FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL }}, { &hf_rsvp_sending_ttl, { "Sending TTL", "rsvp.sending_ttl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_length, { "Message length", "rsvp.message_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_length, { "Length", "rsvp.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_extended_tunnel_id, { "Extended Tunnel ID", "rsvp.extended_tunnel_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_extended_tunnel_ipv6, { "Extended Tunnel ID", "rsvp.extended_tunnel_id_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_extended_tunnel, { "Extended Tunnel ID", "rsvp.extended_tunnel", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_refresh_interval, { "Refresh interval", "rsvp.refresh_interval", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_minimum_policed_unit, { "Minimum policed unit [m]", "rsvp.minimum_policed_unit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_maximum_packet_size, { "Maximum packet size [M]", "rsvp.maximum_packet_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_hf_rsvp_adspec_break_bit, { "Break bit", "rsvp.adspec.break_bit", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }}, { &hf_rsvp_label_request_m, { "M (Merge in Data Plane)", "rsvp.label_request.m", FT_BOOLEAN, 8, TFS(&tfs_can_cannot), 0x80, NULL, HFILL }}, { &hf_rsvp_dlci_length, { "DLCI Length", "rsvp.label_request.dlci_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_min_dlci, { "Min DLCI", "rsvp.label_request.min_dlci", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_max_dlci, { "Max DLCI", "rsvp.label_request.max_dlci", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ero_rro_autonomous_system, { "Autonomous System", "rsvp.ero_rro_subobjects.autonomous_system", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_nsap_length, { "NSAP Length", "rsvp.nsap_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_gen_uni_data, { "Data", "rsvp.gen_uni.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_gen_uni_logical_port_id, { "Logical Port ID", "rsvp.gen_uni.logical_port_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_gen_uni_service_level, { "Service Level", "rsvp.gen_uni.service_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_restart_cap_restart_time, { "Restart Time", "rsvp.restart_cap.restart_time", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL }}, { &hf_rsvp_restart_cap_recovery_time, { "Recovery Time", "rsvp.restart_cap.recovery_time", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL }}, { &hf_rsvp_detour_plr_id, { "PLR ID", "rsvp.detour.plr_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_detour_avoid_node_id, { "Avoid Node ID", "rsvp.detour.avoid_node_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_message_checksum, { "Message Checksum", "rsvp.message_checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_call_attributes_endpont_id, { "Endpoint ID", "rsvp.call_attributes.endpoint_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_isis_area_id, { "IS-IS Area Identifier", "rsvp.isis_area_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_adspec_type, { "Adspec Type", "rsvp.adspec.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &adspec_params_ext, 0x0, NULL, HFILL }}, { &hf_rsvp_adspec_len, { "Length", "rsvp.adspec.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_adspec_uint, { "Adspec uint", "rsvp.adspec.uint", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_adspec_float, { "Adspec float", "rsvp.adspec.float", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_adspec_bytes, { "Adspec bytes", "rsvp.adspec.bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_wavelength_freq, { "Freq", "rsvp.wavelength.freq", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_wavelength_grid, { "Grid", "rsvp.wavelength.grid", FT_UINT8, BASE_DEC, VALS(lambda_grid_vals), 0xE0, NULL, HFILL }}, { &hf_rsvp_wavelength_cs1, { "Channel Spacing", "rsvp.wavelength.cs1", FT_UINT8, BASE_DEC, VALS(grid1_cs_vals), 0x1E, NULL, HFILL }}, { &hf_rsvp_wavelength_cs2, { "Channel Spacing", "rsvp.wavelength.cs2", FT_UINT8, BASE_DEC, VALS(grid2_cs_vals), 0x1E, NULL, HFILL }}, { &hf_rsvp_wavelength_cs3, { "Channel Spacing", "rsvp.wavelength.cs3", FT_UINT8, BASE_DEC, VALS(grid3_cs_vals), 0x1E, NULL, HFILL }}, { &hf_rsvp_wavelength_channel_spacing, { "Channel Spacing", "rsvp.wavelength.channel_spacing", FT_UINT8, BASE_DEC, NULL, 0x1E, NULL, HFILL }}, { &hf_rsvp_wavelength_n, { "Central Frequency", "rsvp.wavelength.n", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_wavelength_m, { "Channel Width (m)", "rsvp.wavelength.m", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_wavelength_wavelength, { "Wavelength", "rsvp.wavelength.wavelength", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_nanometers, 0x0, NULL, HFILL }}, { &hf_rsvp_sonet_s, { "S", "rsvp.sonet.s", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_sonet_u, { "U", "rsvp.sonet.u", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_rsvp_sonet_k, { "K", "rsvp.sonet.k", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_rsvp_sonet_l, { "L", "rsvp.sonet.l", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_rsvp_sonet_m, { "M", "rsvp.sonet.m", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_rsvp_g709_t3, { "t3", "rsvp.g709.t3", FT_UINT16, BASE_DEC, NULL, 0x03F0, NULL, HFILL }}, { &hf_rsvp_g709_t2, { "t2", "rsvp.g709.t2", FT_UINT8, BASE_DEC, NULL, 0x0E, NULL, HFILL }}, { &hf_rsvp_g709_t1, { "t1", "rsvp.g709.t1", FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }}, { &hf_rsvp_ctype_label_set, { "C-Type", "rsvp.ctype.label_set", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_set_type, { "Label type", "rsvp.label_set.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_label_set_subchannel, { "Subchannel", "rsvp.label_set.subchannel", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_nsap_address, { "NSAP address", "rsvp.nsap_address", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_class_diversity, { "Diversity", "rsvp.class_diversity", FT_UINT8, BASE_DEC, VALS(ouni_guni_diversity_str), 0xF0, NULL, HFILL }}, { &hf_rsvp_egress_label_type, { "Label type", "rsvp.egress.label_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_egress_label, { "Label", "rsvp.egress.label", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_source_transport_network_addr, { "Source Transport Network addr", "rsvp.source_transport_network_addr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_ie_data, { "IE Data", "rsvp.ie_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_3gpp_obj_pf_dst_port_range, { "Destination Port range", "rsvp.3gpp_obj.pf_dst_port_range", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rsvp_3gpp_obj_pf_src_port_range, { "Source Port range", "rsvp.3gpp_obj.pf_src_port_range", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static ei_register_info ei[] = { { &ei_rsvp_invalid_length, { "rsvp.invalid_length", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }}, { &ei_rsvp_packet_filter_component, { "rsvp.packet_filter_component", PI_UNDECODED, PI_WARN, "Not dissected Packet filter component", EXPFILL }}, { &ei_rsvp_bundle_component_msg, { "rsvp.bundle_component_msg", PI_UNDECODED, PI_WARN, "Bundle Component Messages Not Dissected", EXPFILL }}, { &ei_rsvp_parameter, { "rsvp.parameter.unknown", PI_PROTOCOL, PI_WARN, "Unknown parameter", EXPFILL }}, { &ei_rsvp_adspec_type, { "rsvp.adspec.type.unknown", PI_PROTOCOL, PI_WARN, "Unknown type", EXPFILL }}, { &ei_rsvp_call_id_address_type, { "rsvp.call_id.address_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown Transport Network type", EXPFILL }}, { &ei_rsvp_session_type, { "rsvp.session_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown session type", EXPFILL }}, }; expert_module_t* expert_rsvp; gint *ett_tree[TT_MAX]; /* Build the tree array */ for (i=0; i<TT_MAX; i++) { ett_treelist[i] = -1; ett_tree[i] = &(ett_treelist[i]); } proto_rsvp = proto_register_protocol("Resource ReserVation Protocol (RSVP)", "RSVP", "rsvp"); /* Created to remove Decode As confusion */ proto_rsvp_e2e1 = proto_register_protocol_in_name_only("Resource ReserVation Protocol (RSVP-E2EI)", "RSVP-E2EI", "rsvp-e2ei", proto_rsvp, FT_PROTOCOL); rsvp_handle = register_dissector("rsvp", dissect_rsvp, proto_rsvp); rsvpe2ei_handle = register_dissector("rsvp_e2ei", dissect_rsvp_e2ei, proto_rsvp_e2e1); proto_register_field_array(proto_rsvp, rsvpf_info, array_length(rsvpf_info)); proto_register_subtree_array(ett_tree, array_length(ett_tree)); expert_rsvp = expert_register_protocol(proto_rsvp); expert_register_field_array(expert_rsvp, ei, array_length(ei)); register_rsvp_prefs(); rsvp_request_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), rsvp_hash, rsvp_equal); register_conversation_table(proto_rsvp, TRUE, rsvp_conversation_packet, rsvp_endpoint_packet); } void proto_reg_handoff_rsvp(void) { dissector_add_uint("ip.proto", IP_PROTO_RSVP, rsvp_handle); dissector_add_uint("ip.proto", IP_PROTO_RSVPE2EI, rsvpe2ei_handle); dissector_add_uint_with_preference("udp.port", UDP_PORT_PRSVP, rsvp_handle); rsvp_tap = register_tap("rsvp"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-rsvp.h
/* packet-rsvp.h * Declarations of variables exported by "packet-rsvp.c" * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_RSVP_H #define PACKET_RSVP_H /* RSVP conversations support */ typedef struct rsvp_conversation_info { guint8 session_type; address source; address destination; guint16 udp_source_port; guint16 udp_dest_port; guint8 protocol; guint32 ext_tunnel_id; guint64 ext_tunnel_id_ipv6_pre; guint64 ext_tunnel_id_ipv6_post; guint8 dscp; } rsvp_conversation_info; extern const range_string gmpls_switching_type_rvals[]; extern const range_string gmpls_lsp_enc_rvals[]; extern const value_string gmpls_protection_cap_str[]; extern value_string_ext gmpls_sonet_signal_type_str_ext; #endif
C
wireshark/epan/dissectors/packet-rsync.c
/* packet-rsync.c * Routines for rsync dissection * [ very rough, but mininally functional ] * Copyright 2003, Brad Hards <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/prefs.h> #include <epan/proto_data.h> void proto_register_rsync(void); void proto_reg_handoff_rsync(void); #define RSYNCD_MAGIC_HEADER "@RSYNCD:" #define RSYNCD_MAGIC_HEADER_LEN 8 #define RSYNCD_AUTHREQD "@RSYNCD: AUTHREQD " #define RSYNCD_AUTHREQD_LEN 18 #define RSYNCD_EXIT "@RSYNCD: EXIT" #define RSYNCD_EXIT_LEN 13 #define RSYNC_MODULE_LIST_QUERY "\n" #define RSYNC_MODULE_LIST_QUERY_LEN 1 /* what states make sense here ? */ typedef enum _rsync_state { RSYNC_INIT = 0, RSYNC_SERV_INIT = 1, RSYNC_CLIENT_QUERY = 2, RSYNC_MODULE_LIST = 4, RSYNC_COMMAND = 5, RSYNC_SERV_MOTD = 6, RSYNC_DATA = 7 } rsync_state_t; enum rsync_who { CLIENT, SERVER }; static gboolean rsync_desegment = TRUE; /* this is a guide to the current conversation state */ struct rsync_conversation_data { rsync_state_t client_state; rsync_state_t server_state; }; struct rsync_frame_data { rsync_state_t state; }; static int proto_rsync = -1; static int hf_rsync_command_string = -1; static int hf_rsync_data = -1; static int hf_rsync_hdr_magic = -1; static int hf_rsync_hdr_version = -1; static int hf_rsync_module_list_string = -1; static int hf_rsync_motd_string = -1; static int hf_rsync_query_string = -1; static int hf_rsync_rsyncdok_string = -1; static gint ett_rsync = -1; static dissector_handle_t rsync_handle; #define TCP_PORT_RSYNC 873 static range_t *glb_rsync_tcp_range = NULL; #define VERSION_LEN 4 /* 2 digits for main version; '.'; 1 digit for sub version */ static void dissect_rsync_version_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rsync_tree, enum rsync_who me) { int offset = 0; guint8 *version; guint len; proto_tree_add_item(rsync_tree, hf_rsync_hdr_magic, tvb, offset, RSYNCD_MAGIC_HEADER_LEN, ENC_ASCII); offset += RSYNCD_MAGIC_HEADER_LEN; offset += 1; /* skip the space */ proto_tree_add_item(rsync_tree, hf_rsync_hdr_version, tvb, offset, -1, ENC_ASCII); len = tvb_reported_length_remaining(tvb, offset); version = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII|ENC_NA); /* VERSION string can contain undesirable char (like \n) at the end. Trim it. */ if (len > 0 && version[len - 1] == '\n') version[len - 1] = 0x0; col_add_fstr(pinfo->cinfo, COL_INFO, "%s Initialisation (Version %s)", (me == SERVER ? "Server" : "Client"), version); } /* Packet dissection routine called by tcp (& udp) when port 873 detected */ static int dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean desegment _U_) { conversation_t *conversation; struct rsync_conversation_data *conversation_data; struct rsync_frame_data *rsync_frame_data_p; proto_item *ti; proto_tree *rsync_tree; enum rsync_who me; int offset = 0; guint buff_length; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSYNC"); col_clear(pinfo->cinfo, COL_INFO); me = value_is_in_range(glb_rsync_tcp_range, pinfo->srcport) ? SERVER : CLIENT; conversation = find_or_create_conversation(pinfo); conversation_data = (struct rsync_conversation_data *)conversation_get_proto_data(conversation, proto_rsync); if (conversation_data == NULL) { /* new conversation */ conversation_data = wmem_new(wmem_file_scope(), struct rsync_conversation_data); conversation_data->client_state = RSYNC_INIT; conversation_data->server_state = RSYNC_SERV_INIT; conversation_add_proto_data(conversation, proto_rsync, conversation_data); } conversation_set_dissector(conversation, rsync_handle); ti = proto_tree_add_item(tree, proto_rsync, tvb, 0, -1, ENC_NA); rsync_tree = proto_item_add_subtree(ti, ett_rsync); rsync_frame_data_p = (struct rsync_frame_data *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rsync, 0); if (!rsync_frame_data_p) { /* then we haven't seen this frame before */ rsync_frame_data_p = wmem_new(wmem_file_scope(), struct rsync_frame_data); rsync_frame_data_p->state = (me == SERVER) ? conversation_data->server_state : conversation_data->client_state; p_add_proto_data(wmem_file_scope(), pinfo, proto_rsync, 0, rsync_frame_data_p); } if (me == SERVER) { switch (rsync_frame_data_p->state) { case RSYNC_SERV_INIT: dissect_rsync_version_header(tvb, pinfo, rsync_tree, me); conversation_data->server_state = RSYNC_SERV_MOTD; break; case RSYNC_SERV_MOTD: proto_tree_add_item(rsync_tree, hf_rsync_motd_string, tvb, offset, -1, ENC_ASCII); col_set_str(pinfo->cinfo, COL_INFO, "Server MOTD"); conversation_data->server_state = RSYNC_SERV_MOTD; break; case RSYNC_MODULE_LIST: /* there are two cases - file list, or authentication */ if (0 == tvb_strneql(tvb, offset, RSYNCD_AUTHREQD, RSYNCD_AUTHREQD_LEN)) { /* matches, so we assume it's an authentication message */ proto_tree_add_item(rsync_tree, hf_rsync_rsyncdok_string, tvb, offset, -1, ENC_ASCII); col_set_str(pinfo->cinfo, COL_INFO, "Authentication"); conversation_data->server_state = RSYNC_DATA; } else { /* it didn't match, so it is probably a module list */ proto_tree_add_item(rsync_tree, hf_rsync_module_list_string, tvb, offset, -1, ENC_ASCII); /* we need to check the end of the buffer for magic string */ buff_length = tvb_captured_length_remaining(tvb, offset); if (buff_length > RSYNCD_EXIT_LEN && 0 == tvb_strneql(tvb, buff_length-RSYNCD_EXIT_LEN-1, RSYNCD_EXIT, RSYNCD_EXIT_LEN)) { /* that's all, folks */ col_set_str(pinfo->cinfo, COL_INFO, "Final module list"); conversation_data->server_state = RSYNC_DATA; } else { /* there must be more data */ col_set_str(pinfo->cinfo, COL_INFO, "Module list"); conversation_data->server_state = RSYNC_MODULE_LIST; } } break; case RSYNC_DATA: proto_tree_add_item(rsync_tree, hf_rsync_data, tvb, offset, -1, ENC_NA); col_set_str(pinfo->cinfo, COL_INFO, "Data"); conversation_data->server_state = RSYNC_DATA; break; default: /* Unknown state */ break; } } else { /* me == CLIENT */ switch (rsync_frame_data_p->state) { case RSYNC_INIT: dissect_rsync_version_header(tvb, pinfo, rsync_tree, me); conversation_data->client_state = RSYNC_CLIENT_QUERY; break; case RSYNC_CLIENT_QUERY: proto_tree_add_item(rsync_tree, hf_rsync_query_string, tvb, offset, -1, ENC_ASCII); col_set_str(pinfo->cinfo, COL_INFO, "Client Query"); conversation_data->client_state = RSYNC_COMMAND; if (tvb_captured_length(tvb) == RSYNC_MODULE_LIST_QUERY_LEN && 0 == tvb_strneql(tvb, offset, RSYNC_MODULE_LIST_QUERY, RSYNC_MODULE_LIST_QUERY_LEN)) { conversation_data->server_state = RSYNC_MODULE_LIST; } else { conversation_data->server_state = RSYNC_DATA; } break; case RSYNC_COMMAND: /* then we are still sending commands */ proto_tree_add_item(rsync_tree, hf_rsync_command_string, tvb, offset, -1, ENC_ASCII); col_set_str(pinfo->cinfo, COL_INFO, "Client Command"); conversation_data->client_state = RSYNC_COMMAND; break; case RSYNC_DATA: /* then we are still sending commands */ proto_tree_add_item(rsync_tree, hf_rsync_data, tvb, offset, -1, ENC_NA); col_set_str(pinfo->cinfo, COL_INFO, "Data"); conversation_data->client_state = RSYNC_DATA; break; default: /* Unknown state */ break; } } return tvb_captured_length(tvb); } /* Packet dissection routine called by tcp (& udp) when port 873 detected */ static int dissect_rsync(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return dissect_rsync_encap(tvb, pinfo, tree, rsync_desegment); } static void apply_rsync_prefs(void) { /* Rsync uses the port preference to determine client/server */ glb_rsync_tcp_range = prefs_get_range_value("rsync", "tcp.port"); } /* Register protocol with Wireshark. */ void proto_register_rsync(void) { static hf_register_info hf[] = { { &hf_rsync_hdr_magic, { "Magic Header", "rsync.hdr_magic", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_hdr_version, { "Header Version", "rsync.hdr_version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_query_string, { "Client Query String", "rsync.query", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_motd_string, { "Server MOTD String", "rsync.motd", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_module_list_string, { "Server Module List", "rsync.module_list", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_rsyncdok_string, { "RSYNCD Response String", "rsync.response", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_command_string, { "Client Command String", "rsync.command", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rsync_data, { "rsync data", "rsync.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_rsync, }; module_t *rsync_module; proto_rsync = proto_register_protocol("RSYNC File Synchroniser", "RSYNC", "rsync"); proto_register_field_array(proto_rsync, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); rsync_module = prefs_register_protocol(proto_rsync, apply_rsync_prefs); prefs_register_bool_preference(rsync_module, "desegment", "Reassemble RSYNC messages spanning multiple TCP segments", "Whether the RSYNC dissector should reassemble messages spanning multiple TCP segments." " To use this option, you must also enable" " \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &rsync_desegment); rsync_handle = create_dissector_handle(dissect_rsync, proto_rsync); } void proto_reg_handoff_rsync(void) { dissector_add_uint_with_preference("tcp.port", TCP_PORT_RSYNC, rsync_handle); apply_rsync_prefs(); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtacser.c
/* packet-rtacser.c * Routines for Schweitzer Engineering Laboratories "Real-Time Automation Controller" (RTAC) Serial Line Dissection * By Chris Bontje (cbontje[AT]gmail.com) * Copyright May 2013 * ************************************************************************************************ * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * ************************************************************************************************ * Dissector Notes: * * The RTAC product family (SEL-3530, SEL-2241, SEL-3505) is a Linux-based Automation Controller * product that is capable of interfacing with SEL and 3rd-party equipment using a variety of * standard industrial protocols such as SEL FM, DNP3, Modbus, C37.118, Telegyr 8979 and others. * Each protocol instance (master/client or slave/server) is configured to utilize either Ethernet * or EIA-232/485 serial connectivity with protocol variations for each medium taken into account. * * The configuration software for the RTAC platform is named AcSELerator RTAC (SEL-5033) and * is used to set up all communications and user logic for the controller as well as provide * downloading and online debugging facilities. One particularly useful aspect of the online * debugging capabilities is a robust Communication Monitor tool that can show raw data streams * from either serial or Ethernet interfaces. Many similar products have this same capability * but the RTAC software goes a step beyond by providing a "save-as" function to save all captured * data into pcap format for further analysis in Wireshark. * * All Ethernet-style capture files will have a packets with a "Linux Cooked Capture" header * including the "source" MAC address of the device responsible for the generation of the message * and the TCP/IP header(s) maintained from the original conversation. The application data from the * message will follow as per a standard Wireshark packet. * * Serial-based pcap capture files were orignally stored using "User 0" DLT type 147 to specify a * user-defined dissector for pcap data but this format was later modified to specify a custom DLT type * known as LINKTYPE_RTAC_SERIAL (DLT 250). The pcap file data portion contains a standard 12-byte serial * header followed by the application payload data from actual rx/tx activity on the line. Some useful * information can be retrieved from the 12-byte header information, such as conversation time-stamps, * UART function and EIA-232 serial control line states at the time of the message. * * This dissector will automatically be used for any newer-style DLT 250 files, and the payload protocol * can be configured via built-in preferences to use whatever standardized industrial protocol is present * on the line for attempted dissection (selfm, mbrtu, dnp3.udp, synphasor). Older pcap files of DLT type 147 * can be used by setting the DLT_USER preferences configuration of User 0 (DLT=147) with a 'Header Size' * of '12' and a 'Header Protocol' of 'rtacser'. The payload protocol should be set to use the protocol * dissector for the data that is present on the line (again, selfm, mbrtu, dnp3.udp or synphasor). */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/decode_as.h> #include <wiretap/wtap.h> void proto_register_rtacser(void); /* Initialize the protocol and registered fields */ static int proto_rtacser = -1; static int hf_rtacser_timestamp = -1; static int hf_rtacser_event_type = -1; static int hf_rtacser_ctrl_cts = -1; static int hf_rtacser_ctrl_dcd = -1; static int hf_rtacser_ctrl_dsr = -1; static int hf_rtacser_ctrl_rts = -1; static int hf_rtacser_ctrl_dtr = -1; static int hf_rtacser_ctrl_ring = -1; static int hf_rtacser_ctrl_mbok = -1; static int hf_rtacser_footer = -1; /* Initialize the subtree pointers */ static gint ett_rtacser = -1; static gint ett_rtacser_cl = -1; static dissector_handle_t rtacser_handle; static dissector_table_t subdissector_table; #define RTACSER_HEADER_LEN 12 /* Bit-masks for EIA-232 serial control lines */ #define RTACSER_CTRL_CTS 0x01 #define RTACSER_CTRL_DCD 0x02 #define RTACSER_CTRL_DSR 0x04 #define RTACSER_CTRL_RTS 0x08 #define RTACSER_CTRL_DTR 0x10 #define RTACSER_CTRL_RING 0x20 #define RTACSER_CTRL_MBOK 0x40 /* Event Types */ static const value_string rtacser_eventtype_vals[] = { { 0x00, "STATUS_CHANGE" }, { 0x01, "DATA_TX_START" }, { 0x02, "DATA_RX_START" }, { 0x03, "DATA_TX_END" }, { 0x04, "DATA_RX_END" }, { 0x05, "CAPTURE_DATA_LOST" }, { 0x06, "CAPTURE_COMPLETE" }, { 0x07, "FRAMING_ERROR" }, { 0x08, "PARITY_ERROR" }, { 0x09, "SERIAL_BREAK_EVENT" }, { 0x0A, "SERIAL_OVERFLOW_EVENT" }, { 0, NULL } }; static void rtacser_ppi_prompt(packet_info *pinfo _U_, gchar* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); } /******************************************************************************************************/ /* Code to dissect RTAC Serial-Line Protocol packets */ /******************************************************************************************************/ static void dissect_rtacser_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *rtacser_item, *cl_item; proto_tree *rtacser_tree, *cl_tree; int offset = 0, len; guint event_type; gboolean cts, dcd, dsr, rts, dtr, ring, mbok; tvbuff_t *payload_tvb; len = RTACSER_HEADER_LEN; /* Make entries in Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTAC Serial"); col_clear(pinfo->cinfo, COL_INFO); rtacser_item = proto_tree_add_protocol_format(tree, proto_rtacser, tvb, 0, len, "RTAC Serial Line"); rtacser_tree = proto_item_add_subtree(rtacser_item, ett_rtacser); /* Time-stamp is stored as 2 x 32-bit unsigned integers, the left and right-hand side of the decimal point respectively */ /* The format mirrors the timeval struct - absolute Epoch time (seconds since 1/1/1970) with an added microsecond component */ proto_tree_add_item(rtacser_tree, hf_rtacser_timestamp, tvb, offset, 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN); offset += 8; /* Set INFO column with RTAC Serial Event Type */ event_type = tvb_get_guint8(tvb, offset); col_add_fstr(pinfo->cinfo, COL_INFO, "%-21s", val_to_str_const(event_type, rtacser_eventtype_vals, "Unknown Type")); /* Add event type to tree */ proto_tree_add_item(rtacser_tree, hf_rtacser_event_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Retrieve EIA-232 serial control line states */ cts = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_CTS; dcd = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_DCD; dsr = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_DSR; rts = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_RTS; dtr = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_DTR; ring = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_RING; mbok = tvb_get_guint8(tvb, offset) & RTACSER_CTRL_MBOK; cl_tree = proto_tree_add_subtree(rtacser_tree, tvb, offset, 1, ett_rtacser_cl, &cl_item, "Control Lines"); /* Add UART Control Line information to INFO column */ col_append_str(pinfo->cinfo, COL_INFO, " ( "); (cts) ? col_append_str(pinfo->cinfo, COL_INFO, "CTS") : col_append_str(pinfo->cinfo, COL_INFO, "/CTS"); (dcd) ? col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DCD") : col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "/DCD"); (dsr) ? col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DSR") : col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "/DSR"); (rts) ? col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RTS") : col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "/RTS"); (dtr) ? col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DTR") : col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "/DTR"); (ring) ? col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RING") : col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "/RING"); (mbok) ? col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "MBOK") : col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "/MBOK"); col_append_str(pinfo->cinfo, COL_INFO, " )"); /* Add UART Control Line information to tree */ proto_item_append_text(cl_item, " ("); (cts) ? proto_item_append_text(cl_item, "CTS, ") : proto_item_append_text(cl_item, "/CTS, "); (dcd) ? proto_item_append_text(cl_item, "DCD, ") : proto_item_append_text(cl_item, "/DCD, "); (dsr) ? proto_item_append_text(cl_item, "DSR, ") : proto_item_append_text(cl_item, "/DSR, "); (rts) ? proto_item_append_text(cl_item, "RTS, ") : proto_item_append_text(cl_item, "/RTS, "); (dtr) ? proto_item_append_text(cl_item, "DTR, ") : proto_item_append_text(cl_item, "/DTR, "); (ring) ? proto_item_append_text(cl_item, "RING, ") : proto_item_append_text(cl_item, "/RING, "); (mbok) ? proto_item_append_text(cl_item, "MBOK") : proto_item_append_text(cl_item, "/MBOK"); proto_item_append_text(cl_item, ")"); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_cts, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_dcd, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_dsr, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_rts, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_dtr, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_ring, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cl_tree, hf_rtacser_ctrl_mbok, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 2-byte footer */ proto_tree_add_item(rtacser_tree, hf_rtacser_footer, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (tvb_reported_length_remaining(tvb, offset) > 0) { payload_tvb = tvb_new_subset_remaining(tvb, RTACSER_HEADER_LEN); if (!dissector_try_payload(subdissector_table, payload_tvb, pinfo, tree)){ call_data_dissector(payload_tvb, pinfo, tree); } } } /******************************************************************************************************/ /* Dissect RTAC Serial-line protocol payload */ /******************************************************************************************************/ static int dissect_rtacser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint length = tvb_captured_length(tvb); /* Check for a RTAC Serial packet. It should be at least 12 bytes */ if(length < 12) { return 0; } dissect_rtacser_data(tvb, pinfo, tree); return tvb_captured_length(tvb); } /******************************************************************************************************/ /* Register the protocol with Wireshark */ /******************************************************************************************************/ void proto_reg_handoff_rtacser(void); void proto_register_rtacser(void) { /* RTAC Serial Protocol header fields */ static hf_register_info rtacser_hf[] = { { &hf_rtacser_timestamp, { "Arrived At Time", "rtacser.timestamp", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_rtacser_event_type, { "Event Type", "rtacser.eventtype", FT_UINT8, BASE_HEX, VALS(rtacser_eventtype_vals), 0x0, NULL, HFILL }}, { &hf_rtacser_ctrl_cts, { "CTS", "rtacser.cts", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_CTS, NULL, HFILL }}, { &hf_rtacser_ctrl_dcd, { "DCD", "rtacser.dcd", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_DCD, NULL, HFILL }}, { &hf_rtacser_ctrl_dsr, { "DSR", "rtacser.dsr", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_DSR, NULL, HFILL }}, { &hf_rtacser_ctrl_rts, { "RTS", "rtacser.rts", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_RTS, NULL, HFILL }}, { &hf_rtacser_ctrl_dtr, { "DTR", "rtacser.dtr", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_DTR, NULL, HFILL }}, { &hf_rtacser_ctrl_ring, { "RING", "rtacser.ring", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_RING, NULL, HFILL }}, { &hf_rtacser_ctrl_mbok, { "MBOK", "rtacser.mbok", FT_UINT8, BASE_DEC, NULL, RTACSER_CTRL_MBOK, NULL, HFILL }}, { &hf_rtacser_footer, { "Footer", "rtacser.footer", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_rtacser, &ett_rtacser_cl, }; module_t *rtacser_module; /* Register the protocol name and description */ proto_rtacser = proto_register_protocol("RTAC Serial", "RTAC Serial", "rtacser"); /* Registering protocol to be called by another dissector */ rtacser_handle = register_dissector("rtacser", dissect_rtacser, proto_rtacser); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_rtacser, rtacser_hf, array_length(rtacser_hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register required preferences for RTAC Serial Payload Protocol */ rtacser_module = prefs_register_protocol_obsolete(proto_rtacser); /* RTAC Serial Preference - Payload Protocol in use */ prefs_register_obsolete_preference(rtacser_module, "rtacserial_payload_proto"); subdissector_table = register_decode_as_next_proto(proto_rtacser, "rtacser.data", "RTAC Serial Data Subdissector", rtacser_ppi_prompt); } /******************************************************************************************************/ /* If this dissector uses sub-dissector registration add a registration routine. This format is required because a script is used to find these routines and create the code that calls these routines. */ /******************************************************************************************************/ void proto_reg_handoff_rtacser(void) { dissector_add_uint("wtap_encap", WTAP_ENCAP_RTAC_SERIAL, rtacser_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtcdc.c
/* * packet-rtcdc.c * Routines for the RTCWeb Data Channel Protocol dissection * as specified in * https://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-03 * and specified in * https://tools.ietf.org/html/draft-ietf-rtcweb-data-protocol-08 * We might want to remove the support of * https://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-03 * in the future, but I'll leave it in for now. * Copyright 2012 - 2013, Michael Tuexen <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/sctpppids.h> void proto_register_rtcdc(void); void proto_reg_handoff_rtcdc(void); /* Initialize the protocol and registered fields */ static int proto_rtcdc = -1; static int hf_message_type = -1; static int hf_channel_type = -1; static int hf_flags = -1; static int hf_flags_reserved = -1; static int hf_unordered_allowed = -1; static int hf_reliability = -1; static int hf_priority = -1; static int hf_label = -1; static int hf_error = -1; static int hf_sid = -1; static int hf_new_channel_type = -1; static int hf_new_reliability = -1; static int hf_new_priority = -1; static int hf_new_label_length = -1; static int hf_new_protocol_length = -1; static int hf_new_label = -1; static int hf_new_protocol = -1; /* Initialize the subtree pointers */ static gint ett_rtcdc = -1; static gint ett_flags = -1; static expert_field ei_rtcdc_new_reliability_non_zero = EI_INIT; static expert_field ei_rtcdc_message_type_unknown = EI_INIT; static expert_field ei_rtcdc_inconsistent_label_and_parameter_length = EI_INIT; static expert_field ei_rtcdc_message_too_long = EI_INIT; static expert_field ei_rtcdc_new_channel_type = EI_INIT; #define DATA_CHANNEL_OPEN_REQUEST 0x00 #define DATA_CHANNEL_OPEN_RESPONSE 0x01 #define DATA_CHANNEL_ACK 0x02 #define DATA_CHANNEL_NEW_OPEN_REQUEST 0x03 static const value_string message_type_values[] = { { DATA_CHANNEL_OPEN_REQUEST, "DATA_CHANNEL_OPEN_REQUEST" }, { DATA_CHANNEL_OPEN_RESPONSE, "DATA_CHANNEL_OPEN_RESPONSE" }, { DATA_CHANNEL_ACK, "DATA_CHANNEL_ACK" }, { DATA_CHANNEL_NEW_OPEN_REQUEST, "DATA_CHANNEL_OPEN_REQUEST" }, { 0, NULL } }; #define DATA_CHANNEL_RELIABLE 0x00 #define DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT 0x01 #define DATA_CHANNEL_PARTIAL_RELIABLE_TIMED 0x02 static const value_string channel_type_values[] = { { DATA_CHANNEL_RELIABLE, "DATA_CHANNEL_RELIABLE" }, { DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT, "DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT" }, { DATA_CHANNEL_PARTIAL_RELIABLE_TIMED, "DATA_CHANNEL_PARTIAL_RELIABLE_TIMED" }, { 0, NULL } }; #define MESSAGE_TYPE_LENGTH 1 #define CHANNEL_TYPE_LENGTH 1 #define FLAGS_LENGTH 2 #define RELIABILITY_LENGTH 2 #define PRIORITY_LENGTH 2 #define MESSAGE_TYPE_OFFSET 0 #define CHANNEL_TYPE_OFFSET (MESSAGE_TYPE_OFFSET + MESSAGE_TYPE_LENGTH) #define FLAGS_OFFSET (CHANNEL_TYPE_OFFSET + CHANNEL_TYPE_LENGTH) #define RELIABILITY_OFFSET (FLAGS_OFFSET + FLAGS_LENGTH) #define PRIORITY_OFFSET (RELIABILITY_OFFSET + RELIABILITY_LENGTH) #define LABEL_OFFSET (PRIORITY_OFFSET + PRIORITY_LENGTH) #define DATA_CHANNEL_FLAG_OUT_OF_ORDER_ALLOWED_MASK 0x0001 #define DATA_CHANNEL_FLAG_RESERVED_MASK 0xFFFE static void dissect_open_request_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *rtcdc_tree, proto_item *rtcdc_item _U_) { if (rtcdc_tree) { proto_tree *flags_tree; proto_item *flags_item; proto_tree_add_item(rtcdc_tree, hf_channel_type, tvb, CHANNEL_TYPE_OFFSET, CHANNEL_TYPE_LENGTH, ENC_BIG_ENDIAN); flags_item = proto_tree_add_item(rtcdc_tree, hf_flags, tvb, FLAGS_OFFSET, FLAGS_LENGTH, ENC_BIG_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_flags); proto_tree_add_item(flags_tree, hf_flags_reserved, tvb, FLAGS_OFFSET, FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_unordered_allowed, tvb, FLAGS_OFFSET, FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_reliability, tvb, RELIABILITY_OFFSET, RELIABILITY_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_priority, tvb, PRIORITY_OFFSET, PRIORITY_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_label, tvb, LABEL_OFFSET, -1, ENC_ASCII); } return; } #define ERROR_LENGTH 1 #define SID_LENGTH 2 #define DATA_CHANNEL_RESPONSE_LENGTH (MESSAGE_TYPE_LENGTH + ERROR_LENGTH + FLAGS_LENGTH + SID_LENGTH) #define ERROR_OFFSET (MESSAGE_TYPE_OFFSET + MESSAGE_TYPE_LENGTH) #define SID_OFFSET (FLAGS_OFFSET + FLAGS_LENGTH) static void dissect_open_response_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree, proto_item *rtcdc_item) { if (tvb_reported_length(tvb) > DATA_CHANNEL_RESPONSE_LENGTH) { expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_message_too_long); } if (rtcdc_tree) { proto_tree_add_item(rtcdc_tree, hf_error, tvb, ERROR_OFFSET, ERROR_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_flags, tvb, FLAGS_OFFSET, FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_sid, tvb, SID_OFFSET, SID_LENGTH, ENC_BIG_ENDIAN); } return; } #define DATA_CHANNEL_ACK_LENGTH MESSAGE_TYPE_LENGTH static void dissect_open_ack_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree _U_, proto_item *rtcdc_item) { if (tvb_reported_length(tvb) > DATA_CHANNEL_ACK_LENGTH) { expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_message_too_long); } return; } #define NEW_DATA_CHANNEL_RELIABLE 0x00 #define NEW_DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT 0x01 #define NEW_DATA_CHANNEL_PARTIAL_RELIABLE_TIMED 0x02 #define NEW_DATA_CHANNEL_RELIABLE_UNORDERED 0x80 #define NEW_DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED 0x81 #define NEW_DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED 0x82 static const value_string new_channel_type_values[] = { { NEW_DATA_CHANNEL_RELIABLE, "DATA_CHANNEL_RELIABLE" }, { NEW_DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT, "DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT" }, { NEW_DATA_CHANNEL_PARTIAL_RELIABLE_TIMED, "DATA_CHANNEL_PARTIAL_RELIABLE_TIMED" }, { NEW_DATA_CHANNEL_RELIABLE_UNORDERED, "DATA_CHANNEL_RELIABLE_UNORDERED" }, { NEW_DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED, "DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED" }, { NEW_DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED, "DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED" }, { 0, NULL } }; #define NEW_MESSAGE_TYPE_LENGTH 1 #define NEW_CHANNEL_TYPE_LENGTH 1 #define NEW_PRIORITY_LENGTH 2 #define NEW_RELIABILITY_LENGTH 4 #define NEW_LABEL_LENGTH_LENGTH 2 #define NEW_PROTOCOL_LENGTH_LENGTH 2 #define NEW_OPEN_REQUEST_HEADER_LENGTH (guint)(NEW_MESSAGE_TYPE_LENGTH + \ NEW_CHANNEL_TYPE_LENGTH + \ NEW_PRIORITY_LENGTH + \ NEW_RELIABILITY_LENGTH + \ NEW_LABEL_LENGTH_LENGTH + \ NEW_PROTOCOL_LENGTH_LENGTH) #define NEW_MESSAGE_TYPE_OFFSET 0 #define NEW_CHANNEL_TYPE_OFFSET (NEW_MESSAGE_TYPE_OFFSET + NEW_MESSAGE_TYPE_LENGTH) #define NEW_PRIORITY_OFFSET (NEW_CHANNEL_TYPE_OFFSET + NEW_CHANNEL_TYPE_LENGTH) #define NEW_RELIABILITY_OFFSET (NEW_PRIORITY_OFFSET + NEW_PRIORITY_LENGTH) #define NEW_LABEL_LENGTH_OFFSET (NEW_RELIABILITY_OFFSET + NEW_RELIABILITY_LENGTH) #define NEW_PROTOCOL_LENGTH_OFFSET (NEW_LABEL_LENGTH_OFFSET + NEW_LABEL_LENGTH_LENGTH) #define NEW_LABEL_OFFSET (NEW_PROTOCOL_LENGTH_OFFSET + NEW_PROTOCOL_LENGTH_LENGTH) static void dissect_new_open_request_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree, proto_item *rtcdc_item) { guint8 channel_type; guint32 reliability; guint16 label_length; guint16 protocol_length; channel_type = tvb_get_guint8(tvb, NEW_CHANNEL_TYPE_OFFSET); if ((channel_type & 0x7f) > 0x02) { expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_new_channel_type); } reliability = tvb_get_ntohl(tvb, NEW_RELIABILITY_OFFSET); if ((reliability > 0) && ((channel_type & 0x7f) == 0x00)) { expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_new_reliability_non_zero); } label_length = tvb_get_ntohs(tvb, NEW_LABEL_LENGTH_OFFSET); protocol_length = tvb_get_ntohs(tvb, NEW_PROTOCOL_LENGTH_OFFSET); if (NEW_OPEN_REQUEST_HEADER_LENGTH + (guint)label_length + (guint)protocol_length != tvb_reported_length(tvb)) { expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_inconsistent_label_and_parameter_length); } if (rtcdc_tree) { proto_tree_add_item(rtcdc_tree, hf_new_channel_type, tvb, NEW_CHANNEL_TYPE_OFFSET, NEW_CHANNEL_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_new_priority, tvb, NEW_PRIORITY_OFFSET, NEW_PRIORITY_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_new_reliability, tvb, NEW_RELIABILITY_OFFSET, NEW_RELIABILITY_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_new_label_length, tvb, NEW_LABEL_LENGTH_OFFSET, NEW_LABEL_LENGTH_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_new_protocol_length, tvb, NEW_PROTOCOL_LENGTH_OFFSET, NEW_PROTOCOL_LENGTH_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(rtcdc_tree, hf_new_label, tvb, NEW_LABEL_OFFSET, label_length, ENC_ASCII); proto_tree_add_item(rtcdc_tree, hf_new_protocol, tvb, NEW_LABEL_OFFSET + label_length, protocol_length, ENC_ASCII); } return; } static int dissect_rtcdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *rtcdc_item, *msg_item; proto_tree *rtcdc_tree; guint8 message_type; message_type = tvb_get_guint8(tvb, MESSAGE_TYPE_OFFSET); col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTCDC"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, message_type_values, "reserved")); rtcdc_item = proto_tree_add_item(tree, proto_rtcdc, tvb, 0, -1, ENC_NA); rtcdc_tree = proto_item_add_subtree(rtcdc_item, ett_rtcdc); msg_item = proto_tree_add_item(rtcdc_tree, hf_message_type, tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN); switch (message_type) { case DATA_CHANNEL_OPEN_REQUEST: dissect_open_request_message(tvb, pinfo, rtcdc_tree, rtcdc_item); break; case DATA_CHANNEL_OPEN_RESPONSE: dissect_open_response_message(tvb, pinfo, rtcdc_tree, rtcdc_item); break; case DATA_CHANNEL_ACK: dissect_open_ack_message(tvb, pinfo, rtcdc_tree, rtcdc_item); break; case DATA_CHANNEL_NEW_OPEN_REQUEST: dissect_new_open_request_message(tvb, pinfo, rtcdc_tree, rtcdc_item); break; default: expert_add_info(pinfo, msg_item, &ei_rtcdc_message_type_unknown); break; } return tvb_captured_length(tvb); } void proto_register_rtcdc(void) { expert_module_t *expert_rtcdc; static hf_register_info hf[] = { { &hf_message_type, { "Message type", "rtcdc.message_type", FT_UINT8, BASE_DEC, VALS(message_type_values), 0x0, NULL, HFILL } }, { &hf_channel_type, { "Channel type", "rtcdc.channel_type", FT_UINT8, BASE_DEC, VALS(channel_type_values), 0x0, NULL, HFILL } }, { &hf_flags, { "Flags", "rtcdc.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_flags_reserved, { "Reserved", "rtcdc.flags_reserved", FT_UINT16, BASE_HEX, NULL, DATA_CHANNEL_FLAG_RESERVED_MASK, NULL, HFILL } }, { &hf_unordered_allowed, { "Unordered allowed", "rtcdc.flags_unordered_allowed", FT_BOOLEAN, 16, NULL, DATA_CHANNEL_FLAG_OUT_OF_ORDER_ALLOWED_MASK, NULL, HFILL } }, { &hf_reliability, { "Reliability parameter", "rtcdc.reliability_parameter", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_priority, { "Priority", "rtcdc.priority", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_label, { "Label", "rtcdc.label", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_error, { "Error", "rtcdc.error", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sid, { "Reverse stream identifier", "rtcdc.reverse_stream_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_new_channel_type, { "Channel type", "rtcdc.channel_type", FT_UINT8, BASE_DEC, VALS(new_channel_type_values), 0x0, NULL, HFILL } }, { &hf_new_reliability, { "Reliability parameter", "rtcdc.reliability_parameter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_new_priority, { "Priority", "rtcdc.priority", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_new_label_length, { "Label length", "rtcdc.label_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_new_protocol_length, { "Protocol length", "rtcdc.protocol_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_new_label, { "Label", "rtcdc.label", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_new_protocol, { "Protocol", "rtcdc.protocol", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_rtcdc, &ett_flags }; static ei_register_info ei[] = { { &ei_rtcdc_message_too_long, { "rtcdc.message_too_long", PI_MALFORMED, PI_ERROR, "Message too long", EXPFILL }}, { &ei_rtcdc_new_channel_type, { "rtcdc.channel_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown channel type", EXPFILL }}, { &ei_rtcdc_new_reliability_non_zero, { "rtcdc.reliability_parameter.non_zero", PI_PROTOCOL, PI_WARN, "Reliability parameter non zero for reliable channel", EXPFILL }}, { &ei_rtcdc_inconsistent_label_and_parameter_length, { "rtcdc.inconsistent_label_and_parameter_length", PI_MALFORMED, PI_ERROR, "Inconsistent label and parameter length", EXPFILL }}, { &ei_rtcdc_message_type_unknown, { "rtcdc.message_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown message type", EXPFILL }}, }; proto_rtcdc = proto_register_protocol("WebRTC Datachannel Protocol", "RTCDC", "rtcdc"); proto_register_field_array(proto_rtcdc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtcdc = expert_register_protocol(proto_rtcdc); expert_register_field_array(expert_rtcdc, ei, array_length(ei)); /* rtcdc_module = prefs_register_protocol(proto_rtcdc, NULL); */ } void proto_reg_handoff_rtcdc(void) { static dissector_handle_t rtcdc_handle; rtcdc_handle = create_dissector_handle(dissect_rtcdc, proto_rtcdc); dissector_add_uint_with_preference("sctp.ppi", WEBRTC_DCEP_PROTOCOL_ID, rtcdc_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtcp.c
/* packet-rtcp.c * * Routines for RTCP dissection * RTCP = Real-time Transport Control Protocol * * Copyright 2000, Philips Electronics N.V. * Written by Andreas Sikkema <[email protected]> * * Copyright 2004, Anders Broman <[email protected]> * * Copyright 2005, Nagarjuna Venna <[email protected]> * * Copyright 2010, Matteo Valdina <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This dissector tries to dissect the RTCP protocol according to Annex A * of ITU-T Recommendation H.225.0 (02/98) and RFC 3550 (obsoleting 1889). * H.225.0 literally copies RFC 1889, but omitting a few sections. * * RTCP traffic is traditionally handled by an uneven UDP portnumber. This * can be any port number, but there is a registered port available, port 5005 * See Annex B of ITU-T Recommendation H.225.0, section B.7 * * Note that nowadays RTP and RTCP are often multiplexed onto a single port, * per RFC 5671. * * Information on PoC can be found from * https://www.omaspecworks.org (OMA SpecWorks, formerly the Open * Mobile Alliance - http://www.openmobilealliance.org/) * * RTCP XR is specified in RFC 3611. * * See also https://www.iana.org/assignments/rtp-parameters * * RTCP FB is specified in RFC 4585 and extended by RFC 5104 * * MS-RTP: Real-time Transport Protocol (RTP) Extensions * https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-rtp */ /* * The part of this dissector for IDMS XR blocks was written by * Torsten Loebner ([email protected]) in the context of a graduation * project with the research organization TNO in Delft, Netherland. * The extension is based on the RTCP XR block specified in * ETSI TS 182 063 v3.5.2 Annex W (https://www.etsi.org/deliver/etsi_ts/183000_183099/183063/), * which was registered by IANA as RTCP XR Block Type 12 * (https://www.iana.org/assignments/rtcp-xr-block-types/rtcp-xr-block-types.xml). */ #include "config.h" #include <stdlib.h> #include <epan/packet.h> #include "packet-rtcp.h" #include "packet-rtp.h" #include "packet-gsm_a_common.h" #include <epan/conversation.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/to_str.h> #include <epan/proto_data.h> void proto_register_rtcp(void); void proto_reg_handoff_rtcp(void); /* Version is the first 2 bits of the first octet*/ #define RTCP_VERSION(octet) ((octet) >> 6) /* Padding is the third bit; no need to shift, because true is any value other than 0! */ #define RTCP_PADDING(octet) ((octet) & 0x20) /* Receiver/ Sender count is the 5 last bits */ #define RTCP_COUNT(octet) ((octet) & 0x1F) static dissector_handle_t rtcp_handle; static dissector_handle_t srtcp_handle; /* add dissector table to permit sub-protocol registration */ static dissector_table_t rtcp_dissector_table; static dissector_table_t rtcp_psfb_dissector_table; static dissector_table_t rtcp_rtpfb_dissector_table; static const value_string rtcp_version_vals[] = { { 2, "RFC 1889 Version" }, { 0, "Old VAT Version" }, { 1, "First Draft Version" }, { 0, NULL }, }; #define RTCP_PT_MIN 192 /* Supplemental H.261 specific RTCP packet types according to Section C.3.5 */ #define RTCP_FIR 192 #define RTCP_NACK 193 #define RTCP_SMPTETC 194 #define RTCP_IJ 195 /* RTCP packet types according to Section A.11.1 */ /* And https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml */ #define RTCP_SR 200 #define RTCP_RR 201 #define RTCP_SDES 202 #define RTCP_BYE 203 #define RTCP_APP 204 #define RTCP_RTPFB 205 #define RTCP_PSFB 206 #define RTCP_XR 207 #define RTCP_AVB 208 #define RTCP_RSI 209 #define RTCP_TOKEN 210 #define RTCP_PT_MAX 210 static const value_string rtcp_packet_type_vals[] = { { RTCP_SR, "Sender Report" }, { RTCP_RR, "Receiver Report" }, { RTCP_SDES, "Source description" }, { RTCP_BYE, "Goodbye" }, { RTCP_APP, "Application specific" }, { RTCP_RTPFB, "Generic RTP Feedback" }, { RTCP_PSFB, "Payload-specific Feedback" }, { RTCP_XR, "Extended report (RFC 3611)"}, { RTCP_AVB, "AVB RTCP packet (IEEE1733)" }, { RTCP_RSI, "Receiver Summary Information" }, { RTCP_TOKEN, "Port Mapping" }, { RTCP_FIR, "Full Intra-frame Request (H.261)" }, { RTCP_NACK, "Negative Acknowledgement (H.261)" }, { RTCP_SMPTETC, "SMPTE time-code mapping" }, { RTCP_IJ, "Extended inter-arrival jitter report" }, { 0, NULL } }; /* RTCP SDES types (Section A.11.2) */ #define RTCP_SDES_END 0 #define RTCP_SDES_CNAME 1 #define RTCP_SDES_NAME 2 #define RTCP_SDES_EMAIL 3 #define RTCP_SDES_PHONE 4 #define RTCP_SDES_LOC 5 #define RTCP_SDES_TOOL 6 #define RTCP_SDES_NOTE 7 #define RTCP_SDES_PRIV 8 #define RTCP_SDES_H323_CADDR 9 #define RTCP_SDES_APSI 10 static const value_string rtcp_sdes_type_vals[] = { { RTCP_SDES_END, "END" }, { RTCP_SDES_CNAME, "CNAME (user and domain)" }, { RTCP_SDES_NAME, "NAME (common name)" }, { RTCP_SDES_EMAIL, "EMAIL (e-mail address)" }, { RTCP_SDES_PHONE, "PHONE (phone number)" }, { RTCP_SDES_LOC, "LOC (geographic location)" }, { RTCP_SDES_TOOL, "TOOL (name/version of source app)" }, { RTCP_SDES_NOTE, "NOTE (note about source)" }, { RTCP_SDES_PRIV, "PRIV (private extensions)" }, { RTCP_SDES_H323_CADDR, "H323-CADDR (H.323 callable address)" }, { RTCP_SDES_APSI, "Application Specific Identifier" }, { 0, NULL } }; /* RTCP XR Blocks (Section 4, RTC 3611) * or https://www.iana.org/assignments/rtcp-xr-block-types */ #define RTCP_XR_LOSS_RLE 1 #define RTCP_XR_DUP_RLE 2 #define RTCP_XR_PKT_RXTIMES 3 #define RTCP_XR_REF_TIME 4 #define RTCP_XR_DLRR 5 #define RTCP_XR_STATS_SUMRY 6 #define RTCP_XR_VOIP_METRCS 7 #define RTCP_XR_BT_XNQ 8 #define RTCP_XR_TI_VOIP 9 #define RTCP_XR_PR_LOSS_RLE 10 #define RTCP_XR_MC_ACQ 11 #define RTCP_XR_IDMS 12 static const value_string rtcp_xr_type_vals[] = { { RTCP_XR_LOSS_RLE, "Loss Run Length Encoding Report Block" }, { RTCP_XR_DUP_RLE, "Duplicate Run Length Encoding Report Block" }, { RTCP_XR_PKT_RXTIMES, "Packet Receipt Times Report Block" }, { RTCP_XR_REF_TIME, "Receiver Reference Time Report Block" }, { RTCP_XR_DLRR, "DLRR Report Block" }, { RTCP_XR_STATS_SUMRY, "Statistics Summary Report Block" }, { RTCP_XR_VOIP_METRCS, "VoIP Metrics Report Block" }, { RTCP_XR_BT_XNQ, "BT XNQ RTCP XR (RFC5093) Report Block" }, { RTCP_XR_TI_VOIP, "Texas Instruments Extended VoIP Quality Block" }, { RTCP_XR_PR_LOSS_RLE, "Post-repair Loss RLE Report Block" }, { RTCP_XR_MC_ACQ, "Multicast Acquisition Report Block" }, { RTCP_XR_IDMS, "Inter-destination Media Synchronization Block" }, /* [https://www.etsi.org/deliver/etsi_ts/183000_183099/183063/][ETSI 183 063][Miguel_Angel_Reina_Ortega] */ { 0, NULL} }; /* XR VoIP Metrics Block - PLC Algorithms */ static const value_string rtcp_xr_plc_algo_vals[] = { { 0, "Unspecified" }, { 1, "Disabled" }, { 2, "Enhanced" }, { 3, "Standard" }, { 0, NULL } }; /* XR VoIP Metrics Block - JB Adaptive */ static const value_string rtcp_xr_jb_adaptive_vals[] = { { 0, "Unknown" }, { 1, "Reserved" }, { 2, "Non-Adaptive" }, { 3, "Adaptive" }, { 0, NULL } }; /* XR Stats Summary Block - IP TTL or Hop Limit */ static const value_string rtcp_xr_ip_ttl_vals[] = { { 0, "No TTL Values" }, { 1, "IPv4" }, { 2, "IPv6" }, { 3, "Undefined" }, { 0, NULL } }; /* XR IDMS synchronization packet sender type */ static const value_string rtcp_xr_idms_spst[] = { { 0, "Reserved" }, { 1, "SC" }, { 2, "MSAS" }, { 3, "SC' INPUT" }, { 4, "SC' OUTPUT" }, { 5, "Reserved" }, { 6, "Reserved" }, { 7, "Reserved" }, { 8, "Reserved" }, { 9, "Reserved" }, { 10, "Reserved" }, { 11, "Reserved" }, { 12, "Reserved" }, { 13, "Reserved" }, { 14, "Reserved" }, { 15, "Reserved" }, { 0, NULL } }; /* RTCP Application PoC1 Value strings * OMA-TS-PoC-UserPlane-V1_0-20060609-A */ #define TBCP_BURST_REQUEST 0 #define TBCP_BURST_GRANTED 1 #define TBCP_BURST_TAKEN_EXPECT_NO_REPLY 2 #define TBCP_BURST_DENY 3 #define TBCP_BURST_RELEASE 4 #define TBCP_BURST_IDLE 5 #define TBCP_BURST_REVOKE 6 #define TBCP_BURST_ACKNOWLEDGMENT 7 #define TBCP_QUEUE_STATUS_REQUEST 8 #define TBCP_QUEUE_STATUS_RESPONSE 9 #define TBCP_DISCONNECT 11 #define TBCP_CONNECT 15 #define TBCP_BURST_TAKEN_EXPECT_REPLY 18 static const value_string rtcp_app_poc1_floor_cnt_type_vals[] = { { TBCP_BURST_REQUEST, "TBCP Talk Burst Request"}, { TBCP_BURST_GRANTED, "TBCP Talk Burst Granted"}, { TBCP_BURST_TAKEN_EXPECT_NO_REPLY, "TBCP Talk Burst Taken (no ack expected)"}, { TBCP_BURST_DENY, "TBCP Talk Burst Deny"}, { TBCP_BURST_RELEASE, "TBCP Talk Burst Release"}, { TBCP_BURST_IDLE, "TBCP Talk Burst Idle"}, { TBCP_BURST_REVOKE, "TBCP Talk Burst Revoke"}, { TBCP_BURST_ACKNOWLEDGMENT, "TBCP Talk Burst Acknowledgement"}, { TBCP_QUEUE_STATUS_REQUEST, "TBCP Queue Status Request"}, { TBCP_QUEUE_STATUS_RESPONSE, "TBCP Queue Status Response"}, { TBCP_DISCONNECT, "TBCP Disconnect"}, { TBCP_CONNECT, "TBCP Connect"}, { TBCP_BURST_TAKEN_EXPECT_REPLY, "TBCP Talk Burst Taken (ack expected)"}, { 0, NULL } }; static const value_string rtcp_app_poc1_reason_code1_vals[] = { { 1, "Another PoC User has permission"}, { 2, "Internal PoC server error"}, { 3, "Only one participant in the group"}, { 4, "Retry-after timer has not expired"}, { 5, "Listen only"}, { 0, NULL } }; static const value_string rtcp_app_poc1_reason_code2_vals[] = { { 1, "Only one user"}, { 2, "Talk burst too long"}, { 3, "No permission to send a Talk Burst"}, { 4, "Talk burst pre-empted"}, { 0, NULL } }; static const value_string rtcp_app_poc1_reason_code_ack_vals[] = { { 0, "Accepted"}, { 1, "Busy"}, { 2, "Not accepted"}, { 0, NULL } }; static const value_string rtcp_app_poc1_conn_sess_type_vals[] = { { 0, "None"}, { 1, "1-to-1"}, { 2, "Ad-hoc"}, { 3, "Pre-arranged"}, { 4, "Chat"}, { 0, NULL } }; static const value_string rtcp_app_poc1_qsresp_priority_vals[] = { { 0, "No priority (un-queued)"}, { 1, "Normal priority"}, { 2, "High priority"}, { 3, "Pre-emptive priority"}, { 0, NULL } }; /* 3GPP 29.414 RTP Multiplexing */ static const value_string rtcp_app_mux_selection_vals[] = { { 0, "No multiplexing applied"}, { 1, "Multiplexing without RTP header compression applied"}, { 2, "Multiplexing with RTP header compression applied"}, { 3, "Reserved"}, { 0, NULL} }; /* RFC 4585 and RFC 5104 */ static const value_string rtcp_rtpfb_fmt_vals[] = { { 1, "Generic negative acknowledgement (NACK)"}, { 3, "Temporary Maximum Media Stream Bit Rate Request (TMMBR)"}, { 4, "Temporary Maximum Media Stream Bit Rate Notification (TMMBN)"}, { 15, "Transport-wide Congestion Control (Transport-cc)"}, /*https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01*/ { 31, "Reserved for future extensions"}, { 0, NULL } }; static const value_string rtcp_psfb_fmt_vals[] = { { 1, "Picture Loss Indication"}, { 2, "Slice Loss Indication"}, { 3, "Reference Picture Selection Indication"}, { 4, "Full Intra Request (FIR) Command"}, { 5, "Temporal-Spatial Trade-off Request (TSTR)"}, { 6, "Temporal-Spatial Trade-off Notification (TSTN)"}, { 7, "Video Back Channel Message (VBCM)"}, { 15, "Application Layer Feedback"}, { 31, "Reserved for future extensions"}, { 0, NULL } }; static const value_string rtcp_psfb_fmt_summary_vals[] = { { 1, "PLI"}, { 2, "SLI"}, { 3, "RPSI"}, { 4, "FIR"}, { 5, "TSTR"}, { 6, "TSTN"}, { 7, "VBCM"}, { 15, "ALFB"}, { 31, "Reserved"}, { 0, NULL } }; /* Microsoft Profile Specific Extension Types */ static const value_string rtcp_ms_profile_extension_vals[] = { { 1, "MS - Estimated Bandwidth"}, { 4, "MS - Packet Loss Notification"}, { 5, "MS - Video Preference"}, { 6, "MS - Padding"}, { 7, "MS - Policy Server Bandwidth"}, { 8, "MS - TURN Server Bandwidth"}, { 9, "MS - Audio Healer Metrics"}, { 10, "MS - Receiver-side Bandwidth Limit"}, { 11, "MS - Packet Train Packet"}, { 12, "MS - Peer Info Exchange"}, { 13, "MS - Network Congestion Notification"}, { 14, "MS - Modality Send Bandwidth Limit"}, { 0, NULL } }; static const value_string rtcp_ssrc_values[] = { { 0xFFFFFFFF, "SOURCE_NONE" }, { 0xFFFFFFFE, "SOURCE_ANY" }, { 0, NULL } }; static const value_string rtcp_mcpt_subtype_vals[] = { { 0x00, "Floor Request" }, { 0x01, "Floor Granted" }, { 0x02, "Floor Taken" }, { 0x03, "Floor Deny" }, { 0x04, "Floor Release" }, { 0x05, "Floor Idle" }, { 0x06, "Floor Revoke" }, { 0x08, "Floor Queue Position Request" }, { 0x09, "Floor Queue Position Info" }, { 0x0a, "Floor Ack" }, { 0x0f, "Floor Release Multi Talker" }, { 0x11, "Floor Granted(ack req)" }, { 0x12, "Floor Taken(ack req)" }, { 0x13, "Floor Deny(ack req)" }, { 0x14, "Floor Release(ack req)" }, { 0x15, "Floor Idle(ack req)" }, { 0x19, "Floor Queue Position Info(ack req)" }, { 0, NULL } }; static const value_string rtcp_mccp_subtype_vals[] = { { 0x00, "Map Group To Bearer" }, { 0x01, "Unmap Group To Bearer" }, { 0, NULL } }; /* TS 24.380 */ static const value_string rtcp_mcpt_field_id_vals[] = { { 0, "Floor Priority" }, { 1, "Duration" }, { 2, "Reject Cause" }, { 3, "Queue Info" }, { 4, "Granted Party's Identity" }, { 5, "Permission to Request the Floor" }, { 6, "User ID" }, { 7, "Queue Size" }, { 8, "Message Sequence-Number" }, { 9, "Queued User ID" }, { 10, "Source" }, { 11, "Track Info" }, { 12, "Message Type" }, { 13, "Floor Indicator" }, { 14, "SSRC" }, { 15, "List of Granted Users" }, { 16, "List of SSRCs" }, { 17, "Functional Alias" }, { 18, "List of Functional Aliases" }, { 19, "Location" }, { 20, "List of Locations" }, { 102, "Floor Priority" }, { 103, "Duration" }, { 104, "Reject Cause" }, { 105, "Queue Info" }, { 106, "Granted Party's Identity" }, { 108, "Permission to Request the Floor" }, { 109, "User ID" }, { 110, "Queue Size" }, { 111, "Message SequenceNumber" }, { 112, "Queued User ID" }, { 113, "Source" }, { 114, "Track Info" }, { 115, "Message Type" }, { 116, "Floor Indicator" }, { 0, NULL } }; /* TS 24.380 */ static const value_string rtcp_mccp_field_id_vals[] = { { 0, "Subchannel" }, { 1, "TMGI" }, { 3, "MCPTT Group ID" }, { 0, NULL } }; /* RTCP header fields */ static int proto_rtcp = -1; static int proto_srtcp = -1; static int hf_rtcp_version = -1; static int hf_rtcp_padding = -1; static int hf_rtcp_rc = -1; static int hf_rtcp_sc = -1; static int hf_rtcp_pt = -1; static int hf_rtcp_length = -1; static int hf_rtcp_ssrc_sender = -1; static int hf_rtcp_ssrc_media_source = -1; static int hf_rtcp_ntp = -1; static int hf_rtcp_ntp_msw = -1; static int hf_rtcp_ntp_lsw = -1; static int hf_rtcp_timebase_indicator = -1; static int hf_rtcp_identity = -1; static int hf_rtcp_stream_id = -1; static int hf_rtcp_as_timestamp = -1; static int hf_rtcp_rtp_timestamp = -1; static int hf_rtcp_sender_pkt_cnt = -1; static int hf_rtcp_sender_oct_cnt = -1; static int hf_rtcp_ssrc_source = -1; static int hf_rtcp_ssrc_fraction = -1; static int hf_rtcp_ssrc_cum_nr = -1; static int hf_rtcp_ssrc_discarded = -1; /* First the 32 bit number, then the split * up 16 bit values */ /* These two are added to a subtree */ static int hf_rtcp_ssrc_ext_high_seq = -1; static int hf_rtcp_ssrc_high_seq = -1; static int hf_rtcp_ssrc_high_cycles = -1; static int hf_rtcp_ssrc_jitter = -1; static int hf_rtcp_ssrc_lsr = -1; static int hf_rtcp_ssrc_dlsr = -1; /* static int hf_rtcp_ssrc_csrc = -1; */ static int hf_rtcp_sdes_type = -1; static int hf_rtcp_sdes_length = -1; static int hf_rtcp_sdes_text = -1; static int hf_rtcp_sdes_prefix_len = -1; static int hf_rtcp_sdes_prefix_string = -1; static int hf_rtcp_subtype = -1; static int hf_rtcp_name_ascii = -1; static int hf_rtcp_app_data = -1; static int hf_rtcp_app_data_str = -1; static int hf_rtcp_fsn = -1; static int hf_rtcp_blp = -1; static int hf_rtcp_padding_count = -1; static int hf_rtcp_padding_data = -1; static int hf_rtcp_profile_specific_extension_type = -1; static int hf_rtcp_profile_specific_extension_length = -1; static int hf_rtcp_profile_specific_extension = -1; static int hf_rtcp_app_poc1 = -1; static int hf_rtcp_app_poc1_sip_uri = -1; static int hf_rtcp_app_poc1_disp_name = -1; static int hf_rtcp_app_poc1_priority = -1; static int hf_rtcp_app_poc1_request_ts = -1; static int hf_rtcp_app_poc1_stt = -1; static int hf_rtcp_app_poc1_partic = -1; static int hf_rtcp_app_poc1_ssrc_granted = -1; static int hf_rtcp_app_poc1_last_pkt_seq_no = -1; static int hf_rtcp_app_poc1_ignore_seq_no = -1; static int hf_rtcp_app_poc1_reason_code1 = -1; static int hf_rtcp_app_poc1_reason1_phrase = -1; static int hf_rtcp_app_poc1_reason_code2 = -1; static int hf_rtcp_app_poc1_new_time_request = -1; static int hf_rtcp_app_poc1_ack_subtype = -1; static int hf_rtcp_app_poc1_ack_reason_code = -1; static int hf_rtcp_app_poc1_qsresp_priority = -1; static int hf_rtcp_app_poc1_qsresp_position = -1; static int hf_rtcp_app_poc1_conn_content[5] = { -1, -1, -1, -1, -1 }; static int hf_rtcp_app_poc1_conn_session_type = -1; static int hf_rtcp_app_poc1_conn_add_ind_mao = -1; static int hf_rtcp_app_poc1_conn_sdes_items[5] = { -1, -1, -1, -1, -1 }; static int hf_rtcp_app_mux = -1; static int hf_rtcp_app_mux_mux = -1; static int hf_rtcp_app_mux_cp = -1; static int hf_rtcp_app_mux_selection = -1; static int hf_rtcp_app_mux_localmuxport = -1; static int hf_rtcp_xr_block_type = -1; static int hf_rtcp_xr_block_specific = -1; static int hf_rtcp_xr_block_length = -1; static int hf_rtcp_xr_thinning = -1; static int hf_rtcp_xr_voip_metrics_burst_density = -1; static int hf_rtcp_xr_voip_metrics_gap_density = -1; static int hf_rtcp_xr_voip_metrics_burst_duration = -1; static int hf_rtcp_xr_voip_metrics_gap_duration = -1; static int hf_rtcp_xr_voip_metrics_rtdelay = -1; static int hf_rtcp_xr_voip_metrics_esdelay = -1; static int hf_rtcp_xr_voip_metrics_siglevel = -1; static int hf_rtcp_xr_voip_metrics_noiselevel = -1; static int hf_rtcp_xr_voip_metrics_rerl = -1; static int hf_rtcp_xr_voip_metrics_gmin = -1; static int hf_rtcp_xr_voip_metrics_rfactor = -1; static int hf_rtcp_xr_voip_metrics_extrfactor = -1; static int hf_rtcp_xr_voip_metrics_moslq = -1; static int hf_rtcp_xr_voip_metrics_moscq = -1; static int hf_rtcp_xr_voip_metrics_plc = -1; static int hf_rtcp_xr_voip_metrics_jbadaptive = -1; static int hf_rtcp_xr_voip_metrics_jbrate = -1; static int hf_rtcp_xr_voip_metrics_jbnominal = -1; static int hf_rtcp_xr_voip_metrics_jbmax = -1; static int hf_rtcp_xr_voip_metrics_jbabsmax = -1; static int hf_rtcp_xr_stats_loss_flag = -1; static int hf_rtcp_xr_stats_dup_flag = -1; static int hf_rtcp_xr_stats_jitter_flag = -1; static int hf_rtcp_xr_stats_ttl = -1; static int hf_rtcp_xr_beginseq = -1; static int hf_rtcp_xr_endseq = -1; static int hf_rtcp_xr_chunk_null_terminator = -1; static int hf_rtcp_xr_chunk_length = -1; static int hf_rtcp_xr_chunk_bit_vector = -1; static int hf_rtcp_xr_receipt_time_seq = -1; static int hf_rtcp_xr_stats_lost = -1; static int hf_rtcp_xr_stats_dups = -1; static int hf_rtcp_xr_stats_minjitter = -1; static int hf_rtcp_xr_stats_maxjitter = -1; static int hf_rtcp_xr_stats_meanjitter = -1; static int hf_rtcp_xr_stats_devjitter = -1; static int hf_rtcp_xr_stats_minttl = -1; static int hf_rtcp_xr_stats_maxttl = -1; static int hf_rtcp_xr_stats_meanttl = -1; static int hf_rtcp_xr_stats_devttl = -1; static int hf_rtcp_xr_timestamp = -1; static int hf_rtcp_xr_lrr = -1; static int hf_rtcp_xr_dlrr = -1; static int hf_rtcp_xr_idms_spst = -1; static int hf_rtcp_xr_idms_pt = -1; static int hf_rtcp_xr_idms_msci = -1; static int hf_rtcp_xr_idms_source_ssrc = -1; static int hf_rtcp_xr_idms_ntp_rcv_ts = -1; static int hf_rtcp_xr_idms_rtp_ts = -1; static int hf_rtcp_xr_idms_ntp_pres_ts = -1; static int hf_rtcp_length_check = -1; static int hf_rtcp_rtpfb_fmt = -1; static int hf_rtcp_rtpfb_nack_pid = -1; static int hf_rtcp_rtpfb_nack_blp = -1; static int hf_rtcp_rtpfb_transport_cc_fci_base_seq = -1; static int hf_rtcp_rtpfb_transport_cc_fci_pkt_stats_cnt = -1; static int hf_rtcp_rtpfb_transport_cc_fci_ref_time = -1; static int hf_rtcp_rtpfb_transport_cc_fci_fb_pkt_cnt = -1; static int hf_rtcp_rtpfb_transport_cc_fci_pkt_chunk = -1; static int hf_rtcp_rtpfb_transport_cc_fci_recv_delta_1_byte = -1; static int hf_rtcp_rtpfb_transport_cc_fci_recv_delta_2_bytes = -1; static int hf_rtcp_rtpfb_transport_cc_fci_recv_delta_padding = -1; static int hf_rtcp_psfb_fmt = -1; static int hf_rtcp_fci = -1; static int hf_rtcp_psfb_fir_fci_ssrc = -1; static int hf_rtcp_psfb_fir_fci_csn = -1; static int hf_rtcp_psfb_fir_fci_reserved = -1; static int hf_rtcp_psfb_sli_first = -1; static int hf_rtcp_psfb_sli_number = -1; static int hf_rtcp_psfb_sli_picture_id = -1; static int hf_rtcp_psfb_remb_fci_identifier = -1; static int hf_rtcp_psfb_remb_fci_number_ssrcs = -1; static int hf_rtcp_psfb_remb_fci_ssrc = -1; static int hf_rtcp_psfb_remb_fci_exp = -1; static int hf_rtcp_psfb_remb_fci_mantissa = -1; static int hf_rtcp_psfb_remb_fci_bitrate = -1; static int hf_rtcp_rtpfb_tmbbr_fci_ssrc = -1; static int hf_rtcp_rtpfb_tmbbr_fci_exp = -1; static int hf_rtcp_rtpfb_tmbbr_fci_mantissa = -1; static int hf_rtcp_rtpfb_tmbbr_fci_bitrate = -1; static int hf_rtcp_rtpfb_tmbbr_fci_measuredoverhead = -1; static int hf_srtcp_e = -1; static int hf_srtcp_index = -1; static int hf_srtcp_mki = -1; static int hf_srtcp_auth_tag = -1; static int hf_rtcp_xr_btxnq_begseq = -1; /* added for BT XNQ block (RFC5093) */ static int hf_rtcp_xr_btxnq_endseq = -1; static int hf_rtcp_xr_btxnq_vmaxdiff = -1; static int hf_rtcp_xr_btxnq_vrange = -1; static int hf_rtcp_xr_btxnq_vsum = -1; static int hf_rtcp_xr_btxnq_cycles = -1; static int hf_rtcp_xr_btxnq_jbevents = -1; static int hf_rtcp_xr_btxnq_tdegnet = -1; static int hf_rtcp_xr_btxnq_tdegjit = -1; static int hf_rtcp_xr_btxnq_es = -1; static int hf_rtcp_xr_btxnq_ses = -1; static int hf_rtcp_xr_btxnq_spare = -1; /* RTCP setup fields */ static int hf_rtcp_setup = -1; static int hf_rtcp_setup_frame = -1; static int hf_rtcp_setup_method = -1; /* RTCP roundtrip delay fields */ static int hf_rtcp_last_sr_timestamp_frame = -1; static int hf_rtcp_time_since_last_sr = -1; static int hf_rtcp_roundtrip_delay = -1; /* MS Profile Specific Extension Fields */ static int hf_rtcp_pse_ms_bandwidth = -1; static int hf_rtcp_pse_ms_confidence_level = -1; static int hf_rtcp_pse_ms_seq_num = -1; static int hf_rtcp_pse_ms_frame_resolution_width = -1; static int hf_rtcp_pse_ms_frame_resolution_height = -1; static int hf_rtcp_pse_ms_bitrate = -1; static int hf_rtcp_pse_ms_frame_rate = -1; static int hf_rtcp_pse_ms_concealed_frames = -1; static int hf_rtcp_pse_ms_stretched_frames = -1; static int hf_rtcp_pse_ms_compressed_frames = -1; static int hf_rtcp_pse_ms_total_frames = -1; static int hf_rtcp_pse_ms_receive_quality_state = -1; static int hf_rtcp_pse_ms_fec_distance_request = -1; static int hf_rtcp_pse_ms_last_packet_train = -1; static int hf_rtcp_pse_ms_packet_idx = -1; static int hf_rtcp_pse_ms_packet_cnt = -1; static int hf_rtcp_pse_ms_packet_train_byte_cnt = -1; static int hf_rtcp_pse_ms_inbound_bandwidth = -1; static int hf_rtcp_pse_ms_outbound_bandwidth = -1; static int hf_rtcp_pse_ms_no_cache = -1; static int hf_rtcp_pse_ms_congestion_info = -1; static int hf_rtcp_pse_ms_modality = -1; /* Microsoft PLI Extension */ static int hf_rtcp_psfb_pli_ms_request_id = -1; static int hf_rtcp_psfb_pli_ms_sfr = -1; /* Microsoft Video Source Request */ static int hf_rtcp_psfb_ms_type = -1; static int hf_rtcp_psfb_ms_length = -1; static int hf_rtcp_psfb_ms_msi = -1; static int hf_rtcp_psfb_ms_vsr_request_id = -1; static int hf_rtcp_psfb_ms_vsr_version = -1; static int hf_rtcp_psfb_ms_vsr_key_frame_request = -1; static int hf_rtcp_psfb_ms_vsr_num_entries = -1; static int hf_rtcp_psfb_ms_vsr_entry_length = -1; static int hf_rtcp_psfb_ms_vsre_payload_type = -1; static int hf_rtcp_psfb_ms_vsre_ucconfig_mode = -1; static int hf_rtcp_psfb_ms_vsre_no_sp_frames = -1; static int hf_rtcp_psfb_ms_vsre_baseline = -1; static int hf_rtcp_psfb_ms_vsre_cgs = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_bitmask = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_4by3 = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_16by9 = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_1by1 = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_3by4 = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_9by16 = -1; static int hf_rtcp_psfb_ms_vsre_aspect_ratio_20by3 = -1; static int hf_rtcp_psfb_ms_vsre_max_width = -1; static int hf_rtcp_psfb_ms_vsre_max_height = -1; static int hf_rtcp_psfb_ms_vsre_min_bitrate = -1; static int hf_rtcp_psfb_ms_vsre_bitrate_per_level = -1; static int hf_rtcp_psfb_ms_vsre_bitrate_histogram = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_mask = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_7_5 = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_12_5 = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_15 = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_25 = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_30 = -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_50= -1; static int hf_rtcp_psfb_ms_vsre_frame_rate_60 = -1; static int hf_rtcp_psfb_ms_vsre_must_instances = -1; static int hf_rtcp_psfb_ms_vsre_may_instances = -1; static int hf_rtcp_psfb_ms_vsre_quality_histogram = -1; static int hf_rtcp_psfb_ms_vsre_max_pixels = -1; static int hf_rtcp_mcptt_fld_id = -1; static int hf_rtcp_mcptt_fld_len = -1; static int hf_rtcp_mcptt_fld_val = -1; static int hf_rtcp_mcptt_granted_partys_id = -1; static int hf_rtcp_app_data_padding = -1; static int hf_rtcp_mcptt_priority = -1; static int hf_rtcp_mcptt_duration = -1; static int hf_rtcp_mcptt_user_id = -1; static int hf_rtcp_mcptt_floor_ind = -1; static int hf_rtcp_mcptt_rej_cause = -1; static int hf_rtcp_mcptt_rej_cause_floor_deny; static int hf_rtcp_mcptt_rej_cause_floor_revoke; static int hf_rtcp_mcptt_rej_phrase = -1; static int hf_rtcp_mcptt_queue_pos_inf = -1; static int hf_rtcp_mcptt_queue_pri_lev = -1; static int hf_rtcp_mcptt_perm_to_req_floor = -1; static int hf_rtcp_mcptt_queue_size = -1; static int hf_rtcp_mcptt_msg_seq_num = -1; static int hf_rtcp_mcptt_queued_user_id = -1; static int hf_rtcp_mcptt_source = -1; static int hf_rtcp_mcptt_queueing_cap = -1; static int hf_rtcp_mcptt_part_type_len = -1; static int hf_rtcp_mcptt_participant_type = -1; static int hf_rtcp_mcptt_participant_ref = - 1; static int hf_rtcp_mcptt_ssrc = -1; static int hf_rtcp_mcptt_num_users = -1; static int hf_rtcp_mcptt_user_id_len = -1; static int hf_rtcp_spare16 = -1; static int hf_rtcp_mcptt_num_ssrc = -1; static int hf_rtcp_mcptt_func_alias = -1; static int hf_rtcp_mcptt_num_fas = -1; static int hf_rtcp_mcptt_fa_len = -1; static int hf_rtcp_mcptt_loc_type = -1; static int hf_rtcp_mcptt_cellid = -1; static int hf_rtcp_mcptt_enodebid = -1; static int hf_rtcp_mcptt_ecgi_eci = -1; static int hf_rtcp_mcptt_tac = -1; static int hf_rtcp_mcptt_mbms_serv_area = -1; static int hf_rtcp_mcptt_mbsfn_area_id = -1; static int hf_rtcp_mcptt_lat = -1; static int hf_rtcp_mcptt_long = -1; static int hf_rtcp_mcptt_msg_type = -1; static int hf_rtcp_mcptt_num_loc = -1; static int hf_rtcp_mcptt_str = -1; static int hf_rtcp_mccp_len = -1; static int hf_rtcp_mccp_field_id = -1; static int hf_rtcp_mcptt_group_id = -1; static int hf_rtcp_mccp_audio_m_line_no = -1; static int hf_rtcp_mccp_floor_m_line_no = -1; static int hf_rtcp_mccp_ip_version = -1; static int hf_rtcp_mccp_floor_port_no = -1; static int hf_rtcp_mccp_media_port_no = -1; static int hf_rtcp_mccp_ipv4 = -1; static int hf_rtcp_mccp_ipv6 = -1; static int hf_rtcp_mccp_tmgi = -1; static int hf_rtcp_encrypted = -1; /* RTCP fields defining a sub tree */ static gint ett_rtcp = -1; static gint ett_rtcp_sr = -1; static gint ett_rtcp_rr = -1; static gint ett_rtcp_sdes = -1; static gint ett_rtcp_bye = -1; static gint ett_rtcp_app = -1; static gint ett_rtcp_rtpfb = -1; static gint ett_rtcp_psfb = -1; static gint ett_rtcp_xr = -1; static gint ett_rtcp_fir = -1; static gint ett_rtcp_nack = -1; static gint ett_ssrc = -1; static gint ett_ssrc_item = -1; static gint ett_ssrc_ext_high = -1; static gint ett_sdes = -1; static gint ett_sdes_item = -1; static gint ett_PoC1 = -1; static gint ett_mux = -1; static gint ett_rtcp_setup = -1; static gint ett_rtcp_roundtrip_delay = -1; static gint ett_xr_block = -1; static gint ett_xr_block_contents = -1; static gint ett_xr_ssrc = -1; static gint ett_xr_loss_chunk = -1; static gint ett_poc1_conn_contents = -1; static gint ett_rtcp_nack_blp = -1; static gint ett_pse = -1; static gint ett_ms_vsr = -1; static gint ett_ms_vsr_entry = -1; static gint ett_ms_ds = -1; static gint ett_rtcp_mcpt = -1; static gint ett_rtcp_mcptt_participant_ref = -1; static gint ett_rtcp_mcptt_eci = -1; static gint ett_rtcp_mccp_tmgi = -1; static expert_field ei_rtcp_not_final_padding = EI_INIT; static expert_field ei_rtcp_bye_reason_not_padded = EI_INIT; static expert_field ei_rtcp_xr_block_length_bad = EI_INIT; static expert_field ei_rtcp_roundtrip_delay = EI_INIT; static expert_field ei_rtcp_length_check = EI_INIT; static expert_field ei_rtcp_roundtrip_delay_negative = EI_INIT; static expert_field ei_rtcp_psfb_ms_type = EI_INIT; static expert_field ei_rtcp_missing_sender_ssrc = EI_INIT; static expert_field ei_rtcp_missing_block_header = EI_INIT; static expert_field ei_rtcp_block_length = EI_INIT; static expert_field ei_srtcp_encrypted_payload = EI_INIT; static expert_field ei_rtcp_rtpfb_transportcc_bad = EI_INIT; static expert_field ei_rtcp_mcptt_unknown_fld = EI_INIT; static expert_field ei_rtcp_mcptt_location_type = EI_INIT; static expert_field ei_rtcp_appl_extra_bytes = EI_INIT; static expert_field ei_rtcp_appl_not_ascii = EI_INIT; static expert_field ei_rtcp_appl_non_conformant = EI_INIT; static expert_field ei_rtcp_appl_non_zero_pad = EI_INIT; enum default_protocol_type { RTCP_PROTO_RTCP, RTCP_PROTO_SRTCP }; static const enum_val_t rtcp_default_protocol_vals[] = { {"RTCP", "RTCP", RTCP_PROTO_RTCP}, {"SRTCP", "SRTCP", RTCP_PROTO_SRTCP}, {NULL, NULL, -1} }; static gint global_rtcp_default_protocol = RTCP_PROTO_RTCP; /* Main dissection function */ static int dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data); static int dissect_srtcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data); /* Displaying set info */ static gboolean global_rtcp_show_setup_info = TRUE; static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); /* Related to roundtrip calculation (using LSR and DLSR) */ static gboolean global_rtcp_show_roundtrip_calculation = FALSE; #define MIN_ROUNDTRIP_TO_REPORT_DEFAULT 10 static guint global_rtcp_show_roundtrip_calculation_minimum = MIN_ROUNDTRIP_TO_REPORT_DEFAULT; static void remember_outgoing_sr(packet_info *pinfo, guint32 lsr); static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 lsr, guint32 dlsr); static void add_roundtrip_delay_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint frame, guint gap_between_reports, gint delay); enum application_specific_encoding_type { RTCP_APP_NONE, RTCP_APP_MCPTT }; static const enum_val_t rtcp_application_specific_encoding_vals[] = { {"None", "None", RTCP_APP_NONE}, {"MCPT", "MCPT", RTCP_APP_MCPTT}, {NULL, NULL, -1} }; static gint preferences_application_specific_encoding = RTCP_APP_NONE; /* Set up an RTCP conversation using the info given */ void srtcp_add_address( packet_info *pinfo, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number, struct srtp_info *srtcp_info) { address null_addr; conversation_t *p_conv; struct _rtcp_conversation_info *p_conv_data; /* * If this isn't the first time this packet has been processed, * we've already done this work, so we don't need to do it * again. */ if (pinfo->fd->visited) { return; } clear_address(&null_addr); /* * Check if the ip address and port combination is not * already registered as a conversation. */ p_conv = find_conversation( setup_frame_number, addr, &null_addr, CONVERSATION_UDP, port, other_port, NO_ADDR_B | (!other_port ? NO_PORT_B : 0)); /* * If not, create a new conversation. */ if ( ! p_conv ) { p_conv = conversation_new( setup_frame_number, addr, &null_addr, CONVERSATION_UDP, (guint32)port, (guint32)other_port, NO_ADDR2 | (!other_port ? NO_PORT2 : 0)); } /* Set dissector */ conversation_set_dissector(p_conv, rtcp_handle); /* * Check if the conversation has data associated with it. */ p_conv_data = (struct _rtcp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtcp); /* * If not, add a new data item. */ if ( ! p_conv_data ) { /* Create conversation data */ p_conv_data = wmem_new0(wmem_file_scope(), struct _rtcp_conversation_info); conversation_add_proto_data(p_conv, proto_rtcp, p_conv_data); } /* * Update the conversation data. */ p_conv_data->setup_method_set = TRUE; (void) g_strlcpy(p_conv_data->setup_method, setup_method, MAX_RTCP_SETUP_METHOD_SIZE); p_conv_data->setup_frame_number = setup_frame_number; p_conv_data->srtcp_info = srtcp_info; } /* Set up an RTCP conversation using the info given */ void rtcp_add_address( packet_info *pinfo, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number) { srtcp_add_address(pinfo, addr, port, other_port, setup_method, setup_frame_number, NULL); } static gboolean dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ ) { unsigned int offset = 0; unsigned int first_byte; unsigned int packet_type; if (tvb_captured_length(tvb) < 2) return FALSE; /* Look at first byte */ first_byte = tvb_get_guint8(tvb, offset); /* Are version bits set to 2? */ if (((first_byte & 0xC0) >> 6) != 2) { return FALSE; } /* Look at packet type */ packet_type = tvb_get_guint8(tvb, offset + 1); /* First packet within compound packet is supposed to be a sender or receiver report. (However, see RFC 5506 which allows the use of non-compound RTCP packets in some circumstances.) - allow BYE because this happens anyway - allow APP because TBCP ("PoC1") packets aren't compound... - allow PSFB for MS */ if (!((packet_type == RTCP_SR) || (packet_type == RTCP_RR) || (packet_type == RTCP_BYE) || (packet_type == RTCP_APP) || (packet_type == RTCP_PSFB))) { return FALSE; } /* Overall length must be a multiple of 4 bytes */ if (tvb_reported_length(tvb) % 4) { return FALSE; } /* OK, dissect as RTCP */ /* XXX: This heuristic doesn't differentiate between RTCP and SRTCP. * There are some possible extra heuristics: looking to see if there's * extra length (that is not padding), looking if padding is enabled * but the last byte is inconsistent with padding, stepping through * compound packets and seeing if it looks encrypted at some point, etc. */ if (global_rtcp_default_protocol == RTCP_PROTO_RTCP) { dissect_rtcp(tvb, pinfo, tree, data); } else { dissect_srtcp(tvb, pinfo, tree, data); } return TRUE; } /* Dissect the length field. Append to this field text indicating the number of actual bytes this translates to (i.e. (raw value + 1) * 4) */ static int dissect_rtcp_length_field( proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *ti; unsigned short raw_length = tvb_get_ntohs( tvb, offset ); ti = proto_tree_add_item( tree, hf_rtcp_length, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, " (%u bytes)", (raw_length+1)*4); offset += 2; return offset; } static int dissect_rtcp_nack( tvbuff_t *tvb, int offset, proto_tree *tree ) { /* Packet type = FIR (H261) */ proto_tree_add_item( tree, hf_rtcp_rc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet type, 8 bits = APP */ proto_tree_add_item( tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words minus one */ offset = dissect_rtcp_length_field(tree, tvb, offset); /* SSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* FSN, 16 bits */ proto_tree_add_item( tree, hf_rtcp_fsn, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* BLP, 16 bits */ proto_tree_add_item( tree, hf_rtcp_blp, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; return offset; } static int dissect_rtcp_rtpfb_tmmbr( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item, int num_fci, int is_notification) { guint8 exp; guint32 mantissa; proto_tree *fci_tree; if (is_notification == 1) { fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, 8, ett_ssrc, NULL, "TMMBN %d", num_fci ); } else { fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, 8, ett_ssrc, NULL, "TMMBR %d", num_fci ); } /* SSRC 32 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Exp 6 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_exp, tvb, offset, 1, ENC_BIG_ENDIAN ); exp = (tvb_get_guint8(tvb, offset) & 0xfc) >> 2; /* Mantissa 17 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_mantissa, tvb, offset, 3, ENC_BIG_ENDIAN ); mantissa = (tvb_get_ntohl( tvb, offset) & 0x3fffe00) >> 9; proto_tree_add_string_format_value( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_bitrate, tvb, offset, 3, "", "%u*2^%u", mantissa, exp); offset += 3; /* Overhead */ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_measuredoverhead, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; if (top_item != NULL) { proto_item_append_text(top_item, ": TMMBR: %u*2^%u", mantissa, exp); } return offset; } /* Dissect Application Specific Feedback messages */ static int dissect_rtcp_asfb_ms( tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo) { guint8 num_entries; guint8 desc = 0; guint16 type; guint16 length; guint8 i; guint32 msi; guint32 min_bitrate, bitrate_per_level; proto_tree *rtcp_ms_vsr_tree; proto_tree *rtcp_ms_vsr_entry_tree; proto_tree *rtcp_ms_ds_tree; proto_item *item, *type_item; type = tvb_get_ntohs(tvb, offset); type_item = proto_tree_add_item( tree, hf_rtcp_psfb_ms_type, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; length = tvb_get_ntohs(tvb, offset) - 4; proto_tree_add_item( tree, hf_rtcp_psfb_ms_length, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; if (type == 1) { rtcp_ms_vsr_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_ms_vsr, &item, "MS Video Source Request"); col_append_fstr(pinfo->cinfo, COL_INFO,"( MS-VSR )"); item = proto_tree_add_item( rtcp_ms_vsr_tree, hf_rtcp_psfb_ms_msi, tvb, offset, 4, ENC_BIG_ENDIAN ); msi = tvb_get_ntohl (tvb, offset); /* Decode if it is NONE or ANY and add to line */ proto_item_append_text(item," %s", val_to_str_const(msi, rtcp_ssrc_values, "")); offset += 4; proto_tree_add_item( rtcp_ms_vsr_tree, hf_rtcp_psfb_ms_vsr_request_id, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* 2 reserved bytes */ offset += 2; proto_tree_add_item( rtcp_ms_vsr_tree, hf_rtcp_psfb_ms_vsr_version, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; proto_tree_add_item( rtcp_ms_vsr_tree, hf_rtcp_psfb_ms_vsr_key_frame_request, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; num_entries = tvb_get_guint8(tvb, offset); proto_tree_add_item( rtcp_ms_vsr_tree, hf_rtcp_psfb_ms_vsr_num_entries, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; proto_tree_add_item( rtcp_ms_vsr_tree, hf_rtcp_psfb_ms_vsr_entry_length, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* 4 reserved bytes */ offset += 4; while (num_entries-- && tvb_captured_length_remaining (tvb, offset) >= 0x44) { rtcp_ms_vsr_entry_tree = proto_tree_add_subtree_format(rtcp_ms_vsr_tree, tvb, offset, 0x44, ett_ms_vsr_entry, NULL, "MS Video Source Request Entry #%d", ++desc); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_payload_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_ucconfig_mode, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_no_sp_frames, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_baseline, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_cgs, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_bitmask, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_20by3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_9by16, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_3by4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_1by1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_16by9, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_aspect_ratio_4by3, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_max_width, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_max_height, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_min_bitrate, tvb, offset, 4, ENC_BIG_ENDIAN); min_bitrate = tvb_get_ntohl (tvb, offset); offset += 4; /* 4 Reserved bytes */ offset += 4; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_bitrate_per_level, tvb, offset, 4, ENC_BIG_ENDIAN); bitrate_per_level = tvb_get_ntohl (tvb, offset); offset += 4; for (i = 0 ; i < 10 ; i++) { item = proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_bitrate_histogram, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_prepend_text(item,"Bitrate %d - %d ", min_bitrate + i * bitrate_per_level, min_bitrate + (i + 1) * bitrate_per_level); offset += 2; } proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset +=3; /* Move to low byte of mask where valid setting are */ proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_60, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_50, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_30, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_25, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_15, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_12_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_frame_rate_7_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_must_instances, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_may_instances, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i = 0 ; i < 8 ; i++) { item = proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_quality_histogram, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_prepend_text(item, "Quality Level %d ", i+1 ); offset += 2; } proto_tree_add_item (rtcp_ms_vsr_entry_tree, hf_rtcp_psfb_ms_vsre_max_pixels, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } else if (type == 3) { /* MS Dominant Speaker History */ rtcp_ms_ds_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_ms_ds, NULL, "MS Dominant Speaker History"); col_append_fstr(pinfo->cinfo, COL_INFO,"( MS-DSH )"); while (length-- && tvb_captured_length_remaining (tvb, offset) >= 4) { item = proto_tree_add_item( rtcp_ms_ds_tree, hf_rtcp_psfb_ms_msi, tvb, offset, 4, ENC_BIG_ENDIAN ); msi = tvb_get_ntohl (tvb, offset); proto_item_append_text(item," %s", val_to_str_const(msi, rtcp_ssrc_values, "")); offset += 4; length --; } } else { expert_add_info(pinfo, type_item, &ei_rtcp_psfb_ms_type); offset += tvb_captured_length_remaining (tvb, offset); } return offset; } static int dissect_rtcp_psfb_remb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item, int num_fci, int *read_fci) { guint exp, indexSsrcs; guint8 numberSsrcs; guint64 mantissa, bitrate; proto_tree *fci_tree; fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, 8, ett_ssrc, NULL, "REMB %d", num_fci ); /* Unique identifier 'REMB' */ proto_tree_add_item( fci_tree, hf_rtcp_psfb_remb_fci_identifier, tvb, offset, 4, ENC_ASCII ); offset += 4; /* Number of ssrcs - they will each be parsed below */ proto_tree_add_item( fci_tree, hf_rtcp_psfb_remb_fci_number_ssrcs, tvb, offset, 1, ENC_BIG_ENDIAN ); numberSsrcs = tvb_get_guint8( tvb, offset); offset += 1; /* Exp 6 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_psfb_remb_fci_exp, tvb, offset, 1, ENC_BIG_ENDIAN ); exp = (tvb_get_guint8(tvb, offset) & 0xfc) ; exp = exp >> 2; /* Mantissa 18 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_psfb_remb_fci_mantissa, tvb, offset, 3, ENC_BIG_ENDIAN ); mantissa = (tvb_get_ntohl( tvb, offset - 1) & 0x0003ffff); bitrate = mantissa << exp; proto_tree_add_string_format_value( fci_tree, hf_rtcp_psfb_remb_fci_bitrate, tvb, offset, 3, "", "%" PRIu64, bitrate); offset += 3; for (indexSsrcs = 0; indexSsrcs < numberSsrcs; indexSsrcs++) { /* SSRC 32 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_psfb_remb_fci_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; } if (top_item != NULL) { proto_item_append_text(top_item, ": REMB: max bitrate=%" PRIu64, bitrate); } *read_fci = 2 + (numberSsrcs); return offset; } #define RTCP_HEADER_LENGTH 12 static int dissect_rtcp_rtpfb_transport_cc( tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *rtcp_tree, guint *padding_set, int pkt_len) { proto_tree *fci_tree, *pkt_chunk_tree, *recv_delta_tree; proto_item *item = NULL; guint8 *delta_array; guint16 *pkt_seq_array; guint32 i, pkt_base_seq, pkt_seq_num, pkt_count, delta_index = 0; gint fci_length = pkt_len - RTCP_HEADER_LENGTH; int padding_length = offset; fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, fci_length, ett_ssrc, NULL, "Transport-cc" ); /* base sequence number */ proto_tree_add_item_ret_uint( fci_tree, hf_rtcp_rtpfb_transport_cc_fci_base_seq, tvb, offset, 2, ENC_BIG_ENDIAN, &pkt_base_seq ); offset += 2; pkt_seq_num = pkt_base_seq; /* packet status count */ proto_tree_add_item_ret_uint( fci_tree, hf_rtcp_rtpfb_transport_cc_fci_pkt_stats_cnt, tvb, offset, 2, ENC_BIG_ENDIAN, &pkt_count ); offset += 2; delta_array = wmem_alloc0_array( pinfo->pool, gint8, pkt_count ); pkt_seq_array = wmem_alloc0_array( pinfo->pool, gint16, pkt_count ); /* reference time */ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_transport_cc_fci_ref_time, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* feedback packet count */ proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_transport_cc_fci_fb_pkt_cnt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; /* packet chunk */ pkt_chunk_tree = proto_tree_add_subtree_format( fci_tree, tvb, offset, 0, ett_ssrc, NULL, "Packet Chunks" ); for (i = 0; i < pkt_count; ) { guint32 chunk = 0; item = proto_tree_add_item_ret_uint( pkt_chunk_tree, hf_rtcp_rtpfb_transport_cc_fci_pkt_chunk, tvb, offset, 2, ENC_BIG_ENDIAN, &chunk ); /* Packet Status Symbols */ /** * 00 Packet not received * 01 Packet received, small delta * 10 Packet received, large or negative delta * 11 [Reserved] */ if ( !(chunk & 0x8000) ) { /* Run length chunk, first bit is zero */ guint length = chunk & 0x1FFF; if ( length <= 0 || pkt_count - delta_index < length ) { /* Malformed packet (zero or too many packets), stop parsing. */ proto_tree_add_expert(pkt_chunk_tree, pinfo, &ei_rtcp_rtpfb_transportcc_bad, tvb, offset, 2); offset += 2; return offset; } if ( !(chunk & 0x6000) ) { proto_item_append_text( item, " [Run Length Chunk] Packet not received. Length : %d", length); pkt_seq_num += length; } else if ( chunk & 0x2000 ) { proto_item_append_text( item, " [Run Length Chunk] Small Delta. Length : %d", length); for (guint j = 0; j < length; j++) { /*1 means 1 byte delta, 2 means 2 bytes delta*/ delta_array[delta_index+j] = 1; pkt_seq_array[delta_index+j] = pkt_seq_num++; } delta_index += length; } else if ( chunk & 0x4000 ) { proto_item_append_text( item, " [Run Length Chunk] Large or Negative Delta. Length : %d", length); for (guint j = 0; j < length; j++) { delta_array[delta_index+j] = 2; pkt_seq_array[delta_index+j] = pkt_seq_num++; } delta_index += length; } else { proto_item_append_text( item, " [Run Length Chunk] [Reserved]. Length : %d", length); pkt_seq_num += length; } i += length; } else { wmem_strbuf_t* status = wmem_strbuf_new(pinfo->pool, "|"); /* Status Vector Chunk, first bit is one */ if ( !(chunk & 0x4000) ) { /* 1 bit symbols */ int data = chunk & 0x3FFF; int chunk_count = 14; for (int k = 0; k < chunk_count; k++) { if ( (data & (0x2000>>k)) == 0 ) { if ( i + k < pkt_count ) { wmem_strbuf_append(status, " N |"); pkt_seq_num++; } else { /* padding */ wmem_strbuf_append(status, " _ |"); } } else { if (delta_index >= pkt_count) { /* Malformed packet (too many status packets). */ proto_tree_add_expert(pkt_chunk_tree, pinfo, &ei_rtcp_rtpfb_transportcc_bad, tvb, offset, 2); offset += 2; return offset; } wmem_strbuf_append(status, " R |"); delta_array[delta_index] = 1; pkt_seq_array[delta_index] = pkt_seq_num++; delta_index++; } } proto_item_append_text( item, " [1 bit Status Vector Chunk]: %s", wmem_strbuf_get_str(status)); i += chunk_count; } else { /* 2 bits symbols */ int chunk_count = 7; int data = chunk & 0x3FFF; for (int k = 0; k < chunk_count; k++) { switch ( (data & (0x3000 >> (2*k))) >> ( 2 * (6-k) ) ) { case 0: /*00 packet not received*/ if ( i + k < pkt_count ) { wmem_strbuf_append(status, " NR |"); pkt_seq_num++; } else { /*padding*/ wmem_strbuf_append(status, " __ |"); } break; case 1: /*01 Packet received, small delta*/ if (delta_index >= pkt_count) { /* Malformed packet (too many status packets). */ proto_tree_add_expert(pkt_chunk_tree, pinfo, &ei_rtcp_rtpfb_transportcc_bad, tvb, offset, 2); offset += 2; return offset; } wmem_strbuf_append(status, " SD |"); delta_array[delta_index] = 1; pkt_seq_array[delta_index] = pkt_seq_num++; delta_index++; break; case 2: /*10 Packet received, large or negative delta*/ if (delta_index >= pkt_count) { /* Malformed packet (too many status packets). */ proto_tree_add_expert(pkt_chunk_tree, pinfo, &ei_rtcp_rtpfb_transportcc_bad, tvb, offset, 2); offset += 2; return offset; } wmem_strbuf_append(status, " LD |"); delta_array[delta_index] = 2; pkt_seq_array[delta_index] = pkt_seq_num++; delta_index++; break; case 3: /*11 packet received, w/o(wrong? overflow?) timestamp*/ default: /*TODO: process overflow status which is not details on draft.*/ wmem_strbuf_append(status, " WO |"); pkt_seq_num++; break; } } proto_item_append_text( item, " [2 bits Status Vector Chunk]: %s", wmem_strbuf_get_str(status)); i += chunk_count; } } offset += 2; } /* recv delta */ recv_delta_tree = proto_tree_add_subtree_format( fci_tree, tvb, offset, 0, ett_ssrc, NULL, "Recv Delta" ); for (i = 0; i < pkt_count; i++ ) { if ( delta_array[i] == 1 ) { /*1 byte delta*/ guint32 delta; item = proto_tree_add_item_ret_uint( recv_delta_tree, hf_rtcp_rtpfb_transport_cc_fci_recv_delta_1_byte, tvb, offset, 1, ENC_BIG_ENDIAN, &delta ); proto_item_append_text( item, " Small Delta: [seq: %d] %lf ms", pkt_seq_array[i], delta*250.0/1000); offset += 1; } else if ( delta_array[i] == 2 ) { /*2 bytes delta*/ gint16 delta; item = proto_tree_add_item( recv_delta_tree, hf_rtcp_rtpfb_transport_cc_fci_recv_delta_2_bytes, tvb, offset, 2, ENC_BIG_ENDIAN); delta = tvb_get_ntohs(tvb, offset); if ( delta < 0 ) { proto_item_append_text( item, " Negative Delta: [seq: %d] %lf ms", pkt_seq_array[i], delta*250.0/1000 ); } else { proto_item_append_text( item, " Large Delta: [seq: %d] %lf ms", pkt_seq_array[i], delta*250.0/1000 ); } offset += 2; } else { /*End with 0*/ break; } } /* padding */ padding_length = fci_length - (offset - padding_length); if ( padding_length > 0 ) { proto_tree_add_item( recv_delta_tree, hf_rtcp_rtpfb_transport_cc_fci_recv_delta_padding, tvb, offset, padding_length, ENC_BIG_ENDIAN ); offset += padding_length; *padding_set = 0; /* consume RTCP padding here */ } /* delta_array / pkt_seq_array will be freed out of pinfo->pool */ delta_array = NULL; pkt_seq_array = NULL; return offset; } static int dissect_rtcp_rtpfb_nack( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item) { int i; int nack_num_frames_lost; proto_tree *bitfield_tree; unsigned int rtcp_rtpfb_nack_pid; unsigned int rtcp_rtpfb_nack_blp; proto_item *ti; proto_tree_add_item(rtcp_tree, hf_rtcp_rtpfb_nack_pid, tvb, offset, 2, ENC_BIG_ENDIAN); rtcp_rtpfb_nack_pid = tvb_get_ntohs(tvb, offset); offset += 2; ti = proto_tree_add_item(rtcp_tree, hf_rtcp_rtpfb_nack_blp, tvb, offset, 2, ENC_BIG_ENDIAN); rtcp_rtpfb_nack_blp = tvb_get_ntohs(tvb, offset); bitfield_tree = proto_item_add_subtree(ti, ett_rtcp_nack_blp); nack_num_frames_lost = 1; if (rtcp_rtpfb_nack_blp) { proto_item_append_text(ti, " (Frames"); for (i = 0; i < 16; i ++) { if (rtcp_rtpfb_nack_blp & (1<<i)) { proto_tree_add_uint_format(bitfield_tree, hf_rtcp_rtpfb_nack_pid, tvb, offset, 2, rtcp_rtpfb_nack_pid + i + 1, "Frame %u also lost", rtcp_rtpfb_nack_pid + i + 1); proto_item_append_text(ti, " %u", rtcp_rtpfb_nack_pid + i + 1); nack_num_frames_lost ++; } } proto_item_append_text(ti, " lost)"); } else { proto_item_append_text(ti, " (No additional frames lost)"); } offset += 2; if (top_item != NULL) { proto_item_append_text(top_item, ": NACK: %d frames lost", nack_num_frames_lost); } return offset; } static int dissect_rtcp_rtpfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item, guint *padding_set, packet_info *pinfo ) { unsigned int counter; unsigned int rtcp_rtpfb_fmt; int packet_length; int start_offset = offset; /* Transport layer FB message */ /* Feedback message type (FMT): 5 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_rtpfb_fmt, tvb, offset, 1, ENC_BIG_ENDIAN ); rtcp_rtpfb_fmt = (tvb_get_guint8(tvb, offset) & 0x1f); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ packet_length = (tvb_get_ntohs(tvb, offset) + 1) * 4; offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); /* SSRC of packet sender, 32 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* SSRC of media source, 32 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_ssrc_media_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Check if we have a type specific dissector, * if we do, just return from here */ if (packet_length > 12) { tvbuff_t *subtvb = tvb_new_subset_length(tvb, offset, packet_length - 12); if (dissector_try_uint (rtcp_rtpfb_dissector_table, rtcp_rtpfb_fmt, subtvb, pinfo, rtcp_tree)) return start_offset + packet_length; } /* Transport-Layer Feedback Message Elements */ counter = 0; while ((offset - start_offset) < packet_length) { counter++; if (rtcp_rtpfb_fmt == 1) { offset = dissect_rtcp_rtpfb_nack(tvb, offset, rtcp_tree, top_item); } else if (rtcp_rtpfb_fmt == 3) { offset = dissect_rtcp_rtpfb_tmmbr(tvb, offset, rtcp_tree, top_item, counter, 0); } else if (rtcp_rtpfb_fmt == 4) { offset = dissect_rtcp_rtpfb_tmmbr(tvb, offset, rtcp_tree, top_item, counter, 1); } else if (rtcp_rtpfb_fmt == 15) { /* Handle transport-cc (RTP Extensions for Transport-wide Congestion Control) - https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01 */ offset = dissect_rtcp_rtpfb_transport_cc( tvb, offset, pinfo, rtcp_tree, padding_set, packet_length); } else { /* Unknown FMT */ proto_tree_add_item(rtcp_tree, hf_rtcp_fci, tvb, offset, start_offset + packet_length - offset, ENC_NA ); offset = start_offset + packet_length; } } return offset; } static int dissect_rtcp_psfb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, int packet_length, proto_item *top_item _U_, packet_info *pinfo _U_) { unsigned int counter; unsigned int num_fci; unsigned int read_fci; proto_tree *fci_tree; proto_item *ti; unsigned int rtcp_psfb_fmt; int base_offset = offset; int i; /* Payload-specific FB message */ /* Feedback message type (FMT): 5 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_psfb_fmt, tvb, offset, 1, ENC_BIG_ENDIAN ); rtcp_psfb_fmt = (tvb_get_guint8(tvb, offset) & 0x1f); col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(rtcp_psfb_fmt, rtcp_psfb_fmt_summary_vals, "Unknown")); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ num_fci = (tvb_get_ntohs(tvb, offset) - 2); offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); /* SSRC of packet sender, 32 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* SSRC of media source, 32 bits */ ti = proto_tree_add_item( rtcp_tree, hf_rtcp_ssrc_media_source, tvb, offset, 4, ENC_BIG_ENDIAN ); /* Decode if it is NONE or ANY and add to line */ proto_item_append_text(ti," %s", val_to_str_const(tvb_get_ntohl(tvb,offset), rtcp_ssrc_values, "")); offset += 4; /* Check if we have a type specific dissector, * if we do, just return from here */ if (packet_length > 12) { tvbuff_t *subtvb = tvb_new_subset_length(tvb, offset, packet_length - 12); if (dissector_try_uint (rtcp_psfb_dissector_table, rtcp_psfb_fmt, subtvb, pinfo, rtcp_tree)) return base_offset + packet_length; } /* Feedback Control Information (FCI) */ counter = 0; read_fci = 0; while ( read_fci < num_fci ) { switch (rtcp_psfb_fmt) { case 1: /* Picture Loss Indications (PLI) */ { /* Handle MS PLI Extension */ fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, 12, ett_ssrc, NULL, "MS PLI"); proto_tree_add_item( fci_tree, hf_rtcp_psfb_pli_ms_request_id, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* 2 reserved bytes */ offset += 2; for (i = 0 ; i < 8 ; i++) { ti = proto_tree_add_item( fci_tree, hf_rtcp_psfb_pli_ms_sfr, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_item_prepend_text(ti,"PRID %d - %d ", i * 8, (i+1) * 8 - 1); offset++; } read_fci += 3; break; } case 2: /* Slice Loss Indication (SLI) */ /* Handle SLI */ fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, 4, ett_ssrc, NULL, "SLI %u", ++counter ); proto_tree_add_item( fci_tree, hf_rtcp_psfb_sli_first, tvb, offset, 4, ENC_BIG_ENDIAN ); proto_tree_add_item( fci_tree, hf_rtcp_psfb_sli_number, tvb, offset, 4, ENC_BIG_ENDIAN ); proto_tree_add_item( fci_tree, hf_rtcp_psfb_sli_picture_id, tvb, offset, 4, ENC_BIG_ENDIAN ); offset +=4; read_fci++; break; case 4: /* Handle FIR */ { /* Create a new subtree for a length of 8 bytes */ fci_tree = proto_tree_add_subtree_format( rtcp_tree, tvb, offset, 8, ett_ssrc, NULL, "FIR %u", ++counter ); /* SSRC 32 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Command Sequence Number 8 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_csn, tvb, offset, 1, ENC_BIG_ENDIAN ); /*proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN );*/ offset += 1; /* Reserved 24 bit*/ proto_tree_add_item( fci_tree, hf_rtcp_psfb_fir_fci_reserved, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; read_fci += 2; break; } case 15: { /* * Handle Application Layer Feedback messages. * * XXX - how do we determine how to interpret these? * * REMB (Receiver Estimated Maximum Bitrate) is, according * to section 2.3 "Signaling of use of this extension" of * https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03, * indicated as an SDP option when the session is set up. * * MS-RTP is, according to MS-RTP and according to MS-SDPEXT * section 3.1.5.30.2 "a=rtcp-fb attribute", indicated as an * SDP option when the session is set up. * * Those would work if we have the SDP setup traffic and parse * the a=rtcp-fb attribute, but if we don't, we'd need to have * the user specify it somehow. */ guint32 magic_value = tvb_get_ntohl( tvb, offset); /* look for string literal 'REMB' which is 0x52454d42 hex */ if (magic_value == 0x52454d42) { /* Handle REMB (Receiver Estimated Maximum Bitrate) - https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-00 */ offset = dissect_rtcp_psfb_remb(tvb, offset, rtcp_tree, top_item, counter, &read_fci); } else { /* Handle MS Application Layer Feedback Messages - MS-RTP */ offset = dissect_rtcp_asfb_ms(tvb, offset, rtcp_tree, pinfo); read_fci = num_fci; /* Consume all the bytes. */ } break; } case 3: /* Reference Picture Selection Indication (RPSI) - Not decoded*/ default: /* Consume anything left so it doesn't make an infinite loop. */ read_fci = num_fci; break; } } /* Append undecoded FCI information */ if ((packet_length - (offset - base_offset)) > 0) { proto_tree_add_item( rtcp_tree, hf_rtcp_fci, tvb, offset, packet_length - (offset - base_offset), ENC_NA ); offset = base_offset + packet_length; } return offset; } static int dissect_rtcp_fir( tvbuff_t *tvb, int offset, proto_tree *tree ) { /* Packet type = FIR (H261) */ proto_tree_add_item( tree, hf_rtcp_rc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet type, 8 bits = APP */ proto_tree_add_item( tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words minus one */ offset = dissect_rtcp_length_field(tree, tvb, offset); /* SSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; return offset; } static int dissect_rtcp_app_poc1(tvbuff_t* tvb, packet_info* pinfo, int offset, proto_tree* tree, int packet_len, proto_item* subtype_item, guint rtcp_subtype) { /* PoC1 Application */ guint item_len; guint8 t2timer_code, participants_code; guint sdes_type; proto_tree* PoC1_tree; proto_item* PoC1_item; int padding; proto_item_append_text(subtype_item, " %s", val_to_str(rtcp_subtype, rtcp_app_poc1_floor_cnt_type_vals, "unknown (%u)")); col_add_fstr(pinfo->cinfo, COL_INFO, "(PoC1) %s", val_to_str(rtcp_subtype, rtcp_app_poc1_floor_cnt_type_vals, "unknown (%u)")); offset += 4; packet_len -= 4; if (packet_len == 0) return offset; /* No more data */ /* Create a subtree for the PoC1 Application items; we don't yet know the length */ /* Top-level poc tree */ PoC1_item = proto_tree_add_item(tree, hf_rtcp_app_poc1, tvb, offset, packet_len, ENC_NA); PoC1_tree = proto_item_add_subtree(PoC1_item, ett_PoC1); /* Dissect it according to its subtype */ switch (rtcp_subtype) { case TBCP_BURST_REQUEST: { guint8 code; guint16 priority; /* Both items here are optional */ if (tvb_reported_length_remaining(tvb, offset) == 0) { return offset; } /* Look for a code in the first byte */ code = tvb_get_guint8(tvb, offset); offset += 1; /* Priority (optional) */ if (code == 102) { item_len = tvb_get_guint8(tvb, offset); offset += 1; if (item_len != 2) /* SHALL be 2 */ return offset; priority = tvb_get_ntohs(tvb, offset); proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_priority, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", val_to_str_const(priority, rtcp_app_poc1_qsresp_priority_vals, "Unknown")); /* Look for (optional) next code */ if (tvb_reported_length_remaining(tvb, offset) == 0) { return offset; } code = tvb_get_guint8(tvb, offset); offset += 1; } /* Request timestamp (optional) */ if (code == 103) { char* buff; item_len = tvb_get_guint8(tvb, offset); offset += 1; if (item_len != 8) /* SHALL be 8 */ return offset; proto_tree_add_item_ret_time_string(PoC1_tree, hf_rtcp_app_poc1_request_ts, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &buff); offset += 8; col_append_fstr(pinfo->cinfo, COL_INFO, " ts=\"%s\"", buff); } } break; case TBCP_BURST_GRANTED: { proto_item* ti; guint16 stop_talking_time; guint16 participants; /* Stop talking timer (now mandatory) */ t2timer_code = tvb_get_guint8(tvb, offset); offset += 1; if (t2timer_code != 101) /* SHALL be 101 */ return offset; item_len = tvb_get_guint8(tvb, offset); offset += 1; if (item_len != 2) /* SHALL be 2 */ return offset; stop_talking_time = tvb_get_ntohs(tvb, offset); ti = proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_stt, tvb, offset, 2, ENC_BIG_ENDIAN); /* Append text with meanings of value */ switch (stop_talking_time) { case 0: proto_item_append_text(ti, " unknown"); break; case 65535: proto_item_append_text(ti, " infinity"); break; default: proto_item_append_text(ti, " seconds"); break; } offset += item_len; col_append_fstr(pinfo->cinfo, COL_INFO, " stop-talking-time=%u", stop_talking_time); /* Participants (optional) */ if (tvb_reported_length_remaining(tvb, offset) == 0) { return offset; } participants_code = tvb_get_guint8(tvb, offset); offset += 1; if (participants_code != 100) /* SHALL be 100 */ return offset; item_len = tvb_get_guint8(tvb, offset); offset += 1; if (item_len != 2) /* SHALL be 2 */ return offset; participants = tvb_get_ntohs(tvb, offset); ti = proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_partic, tvb, offset, 2, ENC_BIG_ENDIAN); /* Append text with meanings of extreme values */ switch (participants) { case 0: proto_item_append_text(ti, " (not known)"); break; case 65535: proto_item_append_text(ti, " (or more)"); break; default: break; } offset += item_len; col_append_fstr(pinfo->cinfo, COL_INFO, " participants=%u", participants); } break; case TBCP_BURST_TAKEN_EXPECT_NO_REPLY: case TBCP_BURST_TAKEN_EXPECT_REPLY: { guint16 participants; proto_item* ti; /* SSRC of PoC client */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_ssrc_granted, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; packet_len -= 4; /* SDES type (must be CNAME) */ sdes_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(PoC1_tree, hf_rtcp_sdes_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; packet_len--; if (sdes_type != RTCP_SDES_CNAME) { return offset; } /* SIP URI */ item_len = tvb_get_guint8(tvb, offset); /* Item len of 1 because it's an FT_UINT_STRING... */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_sip_uri, tvb, offset, 1, ENC_ASCII | ENC_BIG_ENDIAN); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " CNAME=\"%s\"", tvb_get_string_enc(pinfo->pool, tvb, offset, item_len, ENC_ASCII)); offset += item_len; packet_len = packet_len - item_len - 1; /* In the application dependent data, the TBCP Talk Burst Taken message SHALL carry * a SSRC field and SDES items, CNAME and MAY carry SDES item NAME to identify the * PoC Client that has been granted permission to send a Talk Burst. * * The SDES item NAME SHALL be included if it is known by the PoC Server. * Therefore the length of the packet will vary depending on number of SDES items * and the size of the SDES items. */ if (packet_len == 0) return offset; /* SDES type (must be NAME if present) */ sdes_type = tvb_get_guint8(tvb, offset); if (sdes_type == RTCP_SDES_NAME) { proto_tree_add_item(PoC1_tree, hf_rtcp_sdes_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; packet_len--; /* Display name */ item_len = tvb_get_guint8(tvb, offset); /* Item len of 1 because it's an FT_UINT_STRING... */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_disp_name, tvb, offset, 1, ENC_ASCII | ENC_BIG_ENDIAN); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " DISPLAY-NAME=\"%s\"", tvb_get_string_enc(pinfo->pool, tvb, offset, item_len, ENC_ASCII)); offset += item_len; packet_len = packet_len - item_len - 1; if (packet_len == 0) { return offset; } /* Move onto next 4-byte boundary */ if (offset % 4) { int padding2 = (4 - (offset % 4)); offset += padding2; } } /* Participants (optional) */ if (tvb_reported_length_remaining(tvb, offset) == 0) { return offset; } participants_code = tvb_get_guint8(tvb, offset); offset += 1; if (participants_code != 100) { /* SHALL be 100 */ return offset; } item_len = tvb_get_guint8(tvb, offset); offset += 1; if (item_len != 2) { /* SHALL be 2 */ return offset; } participants = tvb_get_ntohs(tvb, offset); ti = proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_partic, tvb, offset, 2, ENC_BIG_ENDIAN); /* Append text with meanings of extreme values */ switch (participants) { case 0: proto_item_append_text(ti, " (not known)"); break; case 65535: proto_item_append_text(ti, " (or more)"); break; default: break; } col_append_fstr(pinfo->cinfo, COL_INFO, " Participants=%u", participants); offset += item_len; } break; case TBCP_BURST_DENY: { guint8 reason_code; /* Reason code */ reason_code = tvb_get_guint8(tvb, offset); proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_reason_code1, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; packet_len--; col_append_fstr(pinfo->cinfo, COL_INFO, " reason-code=\"%s\"", val_to_str_const(reason_code, rtcp_app_poc1_reason_code1_vals, "Unknown")); /* Reason phrase */ item_len = tvb_get_guint8(tvb, offset); if (item_len != 0) { proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_reason1_phrase, tvb, offset, 1, ENC_ASCII | ENC_BIG_ENDIAN); } offset += (item_len + 1); } break; case TBCP_BURST_RELEASE: { guint16 last_seq_no; /*guint16 ignore_last_seq_no;*/ /* Sequence number of last RTP packet in burst */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_last_pkt_seq_no, tvb, offset, 2, ENC_BIG_ENDIAN); last_seq_no = tvb_get_ntohs(tvb, offset); /* Bit 16 is ignore flag */ offset += 2; proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_ignore_seq_no, tvb, offset, 2, ENC_BIG_ENDIAN); /*ignore_last_seq_no = (tvb_get_ntohs(tvb, offset) & 0x8000);*/ /* XXX: Was the intention to also show the "ignore_last_seq_no' flag in COL_INFO ? */ col_append_fstr(pinfo->cinfo, COL_INFO, " last_rtp_seq_no=%u", last_seq_no); /* 15 bits of padding follows */ offset += 2; } break; case TBCP_BURST_IDLE: break; case TBCP_BURST_REVOKE: { /* Reason code */ guint16 reason_code = tvb_get_ntohs(tvb, offset); proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_reason_code2, tvb, offset, 2, ENC_BIG_ENDIAN); /* The meaning of this field depends upon the reason code... */ switch (reason_code) { case 1: /* Only one user */ /* No additional info */ break; case 2: /* Talk burst too long */ /* Additional info is 16 bits with time (in seconds) client can request */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_new_time_request, tvb, offset + 2, 2, ENC_BIG_ENDIAN); break; case 3: /* No permission */ /* No additional info */ break; case 4: /* Pre-empted */ /* No additional info */ break; } col_append_fstr(pinfo->cinfo, COL_INFO, " reason-code=\"%s\"", val_to_str_const(reason_code, rtcp_app_poc1_reason_code2_vals, "Unknown")); offset += 4; } break; case TBCP_BURST_ACKNOWLEDGMENT: { guint8 subtype; /* Code of message being acknowledged */ subtype = (tvb_get_guint8(tvb, offset) & 0xf8) >> 3; proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_ack_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " (for %s)", val_to_str_const(subtype, rtcp_app_poc1_floor_cnt_type_vals, "Unknown")); /* Reason code only seen if subtype was Connect */ if (subtype == TBCP_CONNECT) { proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_ack_reason_code, tvb, offset, 2, ENC_BIG_ENDIAN); } /* 16 bits of padding follow */ offset += 4; } break; case TBCP_QUEUE_STATUS_REQUEST: break; case TBCP_QUEUE_STATUS_RESPONSE: { guint16 position; proto_item* ti; /* Priority */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_qsresp_priority, tvb, offset, 1, ENC_BIG_ENDIAN); /* Queue position. 65535 indicates 'position not available' */ position = tvb_get_ntohs(tvb, offset + 1); ti = proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_qsresp_position, tvb, offset + 1, 2, ENC_BIG_ENDIAN); if (position == 0) { proto_item_append_text(ti, " (client is un-queued)"); } if (position == 65535) { proto_item_append_text(ti, " (position not available)"); } col_append_fstr(pinfo->cinfo, COL_INFO, " position=%u", position); /* 1 bytes of padding follows */ offset += 4; } break; case TBCP_DISCONNECT: break; case TBCP_CONNECT: { proto_item* content; proto_tree* content_tree = proto_tree_add_subtree(PoC1_tree, tvb, offset, 2, ett_poc1_conn_contents, &content, "SDES item content"); gboolean contents[5]; unsigned int i; guint8 items_set = 0; guint16 items_field = tvb_get_ntohs(tvb, offset); /* Dissect each defined bit flag in the SDES item content */ for (i = 0; i < 5; i++) { proto_tree_add_item(content_tree, hf_rtcp_app_poc1_conn_content[i], tvb, offset, 2, ENC_BIG_ENDIAN); contents[i] = items_field & (1 << (15 - i)); if (contents[i]) ++items_set; } /* Show how many flags were set */ proto_item_append_text(content, " (%u items)", items_set); /* Session type */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_conn_session_type, tvb, offset + 2, 1, ENC_BIG_ENDIAN); /* Additional indications */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_conn_add_ind_mao, tvb, offset + 3, 1, ENC_BIG_ENDIAN); offset += 4; packet_len -= 4; /* One SDES item for every set flag in contents array */ for (i = 0; i < array_length(contents); ++i) { if (contents[i]) { guint /*sdes_type2,*/ sdes_len2; /* (sdes_type2 not currently used...). Could complain if type doesn't match expected for item... */ /*sdes_type2 = tvb_get_guint8( tvb, offset );*/ offset += 1; sdes_len2 = tvb_get_guint8(tvb, offset); /* Add SDES field indicated as present */ proto_tree_add_item(PoC1_tree, hf_rtcp_app_poc1_conn_sdes_items[i], tvb, offset, 1, ENC_BIG_ENDIAN); /* Move past field */ offset += sdes_len2 + 1; packet_len -= (sdes_len2 + 2); } } break; } default: break; } padding = 0; if (offset % 4) { padding = (4 - (offset % 4)); } if (padding) { proto_tree_add_item(PoC1_tree, hf_rtcp_app_data_padding, tvb, offset, padding, ENC_BIG_ENDIAN); offset += padding; } return offset; } static const value_string mcptt_floor_ind_vals[] = { { 0x0080, "Multi-talker" }, { 0x0100, "Temporary group call" }, { 0x0200, "Dual floor" }, { 0x0400, "Queueing supported" }, { 0x0800, "Imminent peril call" }, { 0x1000, "Emergency call" }, { 0x2000, "System call" }, { 0x4000, "Broadcast group call" }, { 0x8000, "Normal call" }, { 0, NULL }, }; static const value_string rtcp_mcptt_rej_cause_floor_deny_vals[] = { { 0x1, "Another MCPTT client has permission" }, { 0x2, "Internal floor control server error" }, { 0x3, "Only one participant" }, { 0x4, "Retry-after timer has not expired" }, { 0x5, "Receive only" }, { 0x6, "No resources available" }, { 0x7, "Queue full" }, { 0xff, "Other reason" }, { 0, NULL }, }; static const value_string rtcp_mcptt_rej_cause_floor_revoke_vals[] = { { 0x1, "Only one MCPTT client" }, { 0x2, "Media burst too long" }, { 0x3, "No permission to send a Media Burst" }, { 0x4, "Media Burst pre-empted" }, { 0x6, "No resources available" }, { 0xff, "Other reason" }, { 0, NULL }, }; static const value_string rtcp_mcptt_perm_to_req_floor_vals[] = { { 0x0, "The receiver is not permitted to request floor" }, { 0x1, "The receiver is permitted to request floor" }, { 0, NULL }, }; static const value_string rtcp_mcptt_source_vals[] = { { 0x0, "The floor participant is the source" }, { 0x1, "The participating MCPTT function is the source" }, { 0x2, "The controlling MCPTT function is the source" }, { 0x3, "The non-controlling MCPTT function is the source" }, { 0, NULL }, }; static const value_string rtcp_mcptt_loc_type_vals[] = { { 0x0, "Not provided" }, { 0x1, "ECGI" }, { 0x2, "Tracking Area" }, { 0x3, "PLMN ID" }, { 0x4, "MBMS Service Area" }, { 0x5, "MBSFN Area ID" }, { 0x6, "Geographic coordinates" }, { 0, NULL }, }; static int dissect_rtcp_mcptt_location_ie(tvbuff_t* tvb, packet_info* pinfo, int offset, proto_tree* tree, guint32 mcptt_fld_len) { guint32 loc_type; int start_offset = offset; static int * const ECGI_flags[] = { &hf_rtcp_mcptt_enodebid, &hf_rtcp_mcptt_cellid, NULL }; /* Location Type */ proto_tree_add_item_ret_uint(tree, hf_rtcp_mcptt_loc_type, tvb, offset, 1, ENC_BIG_ENDIAN, &loc_type); offset += 1; switch (loc_type) { case 0: /* Not provided */ break; case 1: /* ECGI - 56 bits = MCC + MNC + ECI*/ dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_ECGI, TRUE); offset += 3; proto_tree_add_bitmask(tree, tvb, offset, hf_rtcp_mcptt_ecgi_eci, ett_rtcp_mcptt_eci, ECGI_flags, ENC_BIG_ENDIAN); offset += 4; break; case 2: /* Tracking Area - 40 bits = MCC + MNC + 16 bits */ /* ECGI - 56 bits = MCC + MNC + ECI*/ dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_ECGI, TRUE); offset += 3; proto_tree_add_item(tree, hf_rtcp_mcptt_tac, tvb, offset, 2, ENC_NA); offset += 2; break; case 3: /* PLMN ID - 24 bits = MCC+MNC */ dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_ECGI, TRUE); offset += 3; break; case 4: /* MBMS Service Area - 16 bits = [0-65535] */ proto_tree_add_item(tree, hf_rtcp_mcptt_mbms_serv_area, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 5: /* MBSFN Area ID - 8 bits = [0-255] */ proto_tree_add_item(tree, hf_rtcp_mcptt_mbsfn_area_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; case 6: /* Geographic coordinates - 48 bits = latitude in first 24 bits + longitude in last 24 bits coded as * in subclause 6.1 in 3GPP TS 23.032 * XXX Make use of dissect_geographical_description() ? */ proto_tree_add_item(tree, hf_rtcp_mcptt_lat, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_rtcp_mcptt_long, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; break; default: proto_tree_add_expert(tree, pinfo, &ei_rtcp_mcptt_location_type, tvb, offset-1, 1); break; } if ((guint)(offset - start_offset) != mcptt_fld_len) { proto_tree_add_item(tree, hf_rtcp_app_data_padding, tvb, offset, offset - start_offset, ENC_BIG_ENDIAN); offset += (offset - start_offset); } return offset; } /* TS 24.380 */ static int dissect_rtcp_app_mcpt(tvbuff_t* tvb, packet_info* pinfo, int offset, proto_tree* tree, int packet_len, proto_item* subtype_item, guint rtcp_subtype) { proto_tree* sub_tree; guint32 mcptt_fld_id, mcptt_fld_len; col_add_fstr(pinfo->cinfo, COL_INFO, "(MCPT) %s", val_to_str(rtcp_subtype, rtcp_mcpt_subtype_vals, "unknown (%u)")); proto_item_append_text(subtype_item, " %s", val_to_str(rtcp_subtype, rtcp_mcpt_subtype_vals, "unknown (%u)")); sub_tree = proto_tree_add_subtree(tree, tvb, offset, packet_len, ett_rtcp_mcpt, NULL, "Mission Critical Push To Talk(MCPTT)"); offset += 4; packet_len -= 4; if (packet_len == 0) { return offset; } if (tvb_ascii_isprint(tvb, offset, packet_len - 3)) { proto_tree_add_item(tree, hf_rtcp_mcptt_str, tvb, offset, packet_len, ENC_ASCII | ENC_NA); proto_tree_add_expert(sub_tree, pinfo, &ei_rtcp_appl_non_conformant, tvb, offset, packet_len); return offset + packet_len; } while (packet_len > 0) { proto_item* ti; int len_len, padding = 0; int start_offset = offset; /* Field ID 8 bits*/ ti = proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_fld_id, tvb, offset, 1, ENC_BIG_ENDIAN, &mcptt_fld_id); offset++; /* Length value * a length value which is: * - one octet long, if the field ID is less than 192; and * - two octets long, if the field ID is equal to or greater than 192; */ if (mcptt_fld_id < 192) { len_len = 1; } else { len_len = 2; } proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_fld_len, tvb, offset, len_len, ENC_BIG_ENDIAN, &mcptt_fld_len); offset += len_len; if ((1 + len_len + mcptt_fld_len) % 4) { padding = (4 - ((1 + len_len + mcptt_fld_len) % 4)); } if (mcptt_fld_len != 0) { /* Field Value */ switch (mcptt_fld_id) { case 0: /* Floor Priority */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_priority, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 1: /* Duration */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_duration, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 2: { /* Reject Cause */ guint32 cause = 0; switch (rtcp_subtype) { case 3: /* Floor deny */ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_rej_cause_floor_deny, tvb, offset, 2, ENC_BIG_ENDIAN, &cause); col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(cause, rtcp_mcptt_rej_cause_floor_deny_vals, "Unknown")); break; case 6: /* Floor revoke */ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_rej_cause_floor_revoke, tvb, offset, 2, ENC_BIG_ENDIAN, &cause); col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(cause, rtcp_mcptt_rej_cause_floor_deny_vals, "Unknown")); break; default: proto_tree_add_item(sub_tree, hf_rtcp_mcptt_rej_cause, tvb, offset, 2, ENC_BIG_ENDIAN); break; } offset += 2; /* If the length field is set to '2', there is no <Reject Phrase> value in the Reject Cause field */ if (mcptt_fld_len == 2) { break; } /* Reject Phrase */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_rej_phrase, tvb, offset, mcptt_fld_len - 2, ENC_UTF_8 | ENC_NA); offset += (mcptt_fld_len - 2); break; } case 3: /* Queue Info*/ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_queue_pos_inf, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sub_tree, hf_rtcp_mcptt_queue_pri_lev, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; case 4: case 106: /* Granted Party's Identity */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_granted_partys_id, tvb, offset, mcptt_fld_len, ENC_UTF_8 | ENC_NA); offset += mcptt_fld_len; break; case 5: /* Permission to Request the Floor */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_perm_to_req_floor, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 6: /* User ID */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_user_id, tvb, offset, mcptt_fld_len, ENC_UTF_8 | ENC_NA); offset += mcptt_fld_len; break; case 7: /* Queue Size */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_queue_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 8: /* Message Sequence-Number */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_msg_seq_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 9: /* Queued User ID */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_queued_user_id, tvb, offset, mcptt_fld_len, ENC_UTF_8 | ENC_NA); offset += mcptt_fld_len; break; case 10: /* Source */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_source, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 11: { guint32 fld_len, num_ref; int rem_len = mcptt_fld_len; proto_tree* part_tree; /* Track Info */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_queueing_cap, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; rem_len -= 1; proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_part_type_len, tvb, offset, 1, ENC_BIG_ENDIAN, &fld_len); offset += 1; rem_len -= 1; int part_type_padding = (4 - (fld_len % 4)); proto_tree_add_item(sub_tree, hf_rtcp_mcptt_participant_type, tvb, offset, fld_len, ENC_UTF_8 | ENC_NA); offset += fld_len; rem_len -= fld_len; if(part_type_padding > 0){ guint32 data; proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_app_data_padding, tvb, offset, part_type_padding, ENC_BIG_ENDIAN, &data); if (data != 0) { proto_tree_add_expert(sub_tree, pinfo, &ei_rtcp_appl_non_zero_pad, tvb, offset, part_type_padding); } offset += part_type_padding; rem_len -= part_type_padding; } if (rem_len > 0) { num_ref = 1; /* Floor Participant Reference */ while (rem_len > 0) { part_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, 4, ett_rtcp_mcptt_participant_ref, NULL, "Floor Participant Reference %u", num_ref); proto_tree_add_item(part_tree, hf_rtcp_mcptt_participant_ref, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; rem_len -= 4; num_ref++; } } break; } case 12: /* Message Type */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_msg_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(sub_tree, hf_rtcp_spare16, tvb, offset, 1, ENC_NA); offset += 1; break; case 13: { /* Floor Indicator */ guint32 floor_ind; proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_floor_ind, tvb, offset, 2, ENC_BIG_ENDIAN, &floor_ind); col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(floor_ind, mcptt_floor_ind_vals, "Unknown")); offset += 2; break; } case 14: /* SSRC */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sub_tree, hf_rtcp_spare16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 15: /* List of Granted Users */ { guint32 num_users, user_id_len; /* No of users */ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_num_users, tvb, offset, 1, ENC_BIG_ENDIAN, &num_users); offset += 1; while (num_users > 0) { proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_user_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &user_id_len); offset += 1; proto_tree_add_item(sub_tree, hf_rtcp_mcptt_user_id, tvb, offset, user_id_len, ENC_UTF_8 | ENC_NA); offset += user_id_len; num_users--; } break; } case 16: /* List of SSRCs */ { guint32 num_ssrc; /* Number of SSRCs*/ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_num_ssrc, tvb, offset, 1, ENC_BIG_ENDIAN, &num_ssrc); offset += 1; proto_tree_add_item(sub_tree, hf_rtcp_spare16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; while (num_ssrc > 0) { proto_tree_add_item(sub_tree, hf_rtcp_mcptt_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; num_ssrc--; } break; } case 17: /* Functional Alias */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_func_alias, tvb, offset, mcptt_fld_len, ENC_UTF_8 | ENC_NA); offset += mcptt_fld_len; break; case 18: /* List of Functional Aliases */ { guint32 num_fas, fa_len; /* No of FAs */ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_num_fas, tvb, offset, 1, ENC_BIG_ENDIAN, &num_fas); offset += 1; while (num_fas > 0) { proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_fa_len, tvb, offset, 1, ENC_BIG_ENDIAN, &fa_len); offset += 1; proto_tree_add_item(sub_tree, hf_rtcp_mcptt_func_alias, tvb, offset, fa_len, ENC_UTF_8 | ENC_NA); offset += fa_len; num_fas--; } break; } case 19: /* Location */ offset = dissect_rtcp_mcptt_location_ie(tvb, pinfo, offset, sub_tree, mcptt_fld_len); break; case 20: /* List of Locations */ { guint32 num_loc; /* Number of SSRCs*/ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mcptt_num_loc, tvb, offset, 1, ENC_BIG_ENDIAN, &num_loc); offset += 1; while (num_loc > 0) { offset = dissect_rtcp_mcptt_location_ie(tvb, pinfo, offset, sub_tree, mcptt_fld_len); num_loc--; } break; } default: expert_add_info(pinfo, ti, &ei_rtcp_mcptt_unknown_fld); proto_tree_add_item(sub_tree, hf_rtcp_mcptt_fld_val, tvb, offset, mcptt_fld_len, ENC_NA); offset += mcptt_fld_len; break; } } if (padding) { guint32 data; proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_app_data_padding, tvb, offset, padding, ENC_BIG_ENDIAN, &data); if (data != 0) { proto_tree_add_expert(sub_tree, pinfo, &ei_rtcp_appl_non_zero_pad, tvb, offset, padding); } offset += padding; } packet_len -= offset - start_offset; if (packet_len >= 4) { guint32 dword = tvb_get_ntohl(tvb, offset); if (dword == 0) { /* Extra 4 zero bytes */ proto_tree_add_expert(sub_tree, pinfo, &ei_rtcp_appl_extra_bytes, tvb, offset, 4); packet_len -= 4; offset += 4; } } } return offset; } /* TS 24.380 V 13.2.0*/ static int dissect_rtcp_app_mccp(tvbuff_t* tvb, packet_info* pinfo, int offset, proto_tree* tree, int packet_len, proto_item* subtype_item, guint rtcp_subtype) { proto_tree* sub_tree; guint32 mccp_fld_id, mccp_fld_len; int total_packet_length; col_add_fstr(pinfo->cinfo, COL_INFO, "(MCCP) %s", val_to_str(rtcp_subtype, rtcp_mccp_subtype_vals, "unknown (%u)")); proto_item_append_text(subtype_item, " %s", val_to_str(rtcp_subtype, rtcp_mccp_subtype_vals, "unknown (%u)")); if (packet_len <= 0) { total_packet_length = tvb_reported_length_remaining(tvb, offset); proto_tree_add_expert_format(tree, pinfo, &ei_rtcp_length_check, tvb, offset, total_packet_length, "Incorrect RTCP packet length information (expected 0 bytes, found %d)", total_packet_length); packet_len = total_packet_length; } sub_tree = proto_tree_add_subtree(tree, tvb, offset, packet_len, ett_rtcp_mcpt, NULL, "MBMS subchannel control"); offset += 4; packet_len -= 4; if (packet_len == 0) { return offset; } while (packet_len > 0) { proto_item* ti; int padding = 0; int start_offset = offset; /* Each MBMS subchannel control specific field consists of an 8-bit <Field ID> item, * an 8-bit octet <Length> value item containing the length of the field value not * including <Field ID> or the <Length> value items. */ ti = proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mccp_field_id, tvb, offset, 1, ENC_BIG_ENDIAN, &mccp_fld_id); offset += 1; packet_len -= 1; proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mccp_len, tvb, offset, 1, ENC_BIG_ENDIAN, &mccp_fld_len); offset += 1; packet_len -= 1; if ((2 + mccp_fld_len) % 4) { padding = (4 - ((2 + mccp_fld_len) % 4)); } switch (mccp_fld_id) { case 0: { /* Subchannel */ /*The <Audio m-line Number> value shall consist of 4 bit parameter giving the * number of the" m=audio" m-line in the SIP MESSAGE request announcing * the MBMS bearer described in 3GPP TS 24.379 */ guint32 ip_ver, floor_m_line_no; proto_tree_add_item(sub_tree, hf_rtcp_mccp_audio_m_line_no, tvb, offset, 1, ENC_BIG_ENDIAN); /* The <Floor m-line Number> value shall consist of 4 bit parameter giving the * number of the "m=application" m-line in the SIP MESSAGE request announcing * the MBMS bearer described in 3GPP TS 24.379 */ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mccp_floor_m_line_no, tvb, offset, 1, ENC_BIG_ENDIAN, &floor_m_line_no); offset += 1; /* IP version */ proto_tree_add_item_ret_uint(sub_tree, hf_rtcp_mccp_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN, &ip_ver); offset += 1; /* Floor Port Number * If the <Floor m-line Number> value is equal to '0', * the <Floor control Port Number> value is not included in the MBMS Subchannel field. */ if (floor_m_line_no > 0) { proto_tree_add_item(sub_tree, hf_rtcp_mccp_floor_port_no, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } /* Medis Port Number */ proto_tree_add_item(sub_tree, hf_rtcp_mccp_media_port_no, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* IP Address*/ if (ip_ver == 0) { proto_tree_add_item(sub_tree, hf_rtcp_mccp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else { proto_tree_add_item(sub_tree, hf_rtcp_mccp_ipv6, tvb, offset, 16, ENC_NA); offset += 16; } } break; case 1: /* TMGI */ { proto_tree* tmgi_tree; ti = proto_tree_add_item(sub_tree, hf_rtcp_mccp_tmgi, tvb, offset, mccp_fld_len, ENC_NA); tmgi_tree = proto_item_add_subtree(ti, ett_rtcp_mccp_tmgi); de_sm_tmgi(tvb, tmgi_tree, pinfo, offset, mccp_fld_len, NULL, 0); offset += mccp_fld_len; } break; case 3: /* MCPTT Group ID */ proto_tree_add_item(sub_tree, hf_rtcp_mcptt_group_id, tvb, offset, mccp_fld_len, ENC_UTF_8 | ENC_NA); offset += mccp_fld_len; break; default: expert_add_info(pinfo, ti, &ei_rtcp_mcptt_unknown_fld); proto_tree_add_item(sub_tree, hf_rtcp_mcptt_fld_val, tvb, offset, mccp_fld_len, ENC_NA); offset += mccp_fld_len; break; } if (padding) { proto_tree_add_item(sub_tree, hf_rtcp_app_data_padding, tvb, offset, padding, ENC_BIG_ENDIAN); offset += padding; } packet_len -= offset - start_offset; if (packet_len >= 4) { guint32 dword; if (mccp_fld_len % 4) { dword = tvb_get_ntohl(tvb, offset); padding = (4 - (mccp_fld_len % 4)); dword = dword >> (padding * 8); if (dword == 0) { /* Extra 4 zero bytes */ proto_tree_add_expert(sub_tree, pinfo, &ei_rtcp_appl_extra_bytes, tvb, offset, padding); packet_len -= padding; offset += padding; } } } } return offset; } static int dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree, unsigned int padding, int packet_len, proto_item *subtype_item, guint rtcp_subtype, guint32 app_length ) { const guint8* ascii_name; gboolean is_ascii; /* XXX If more application types are to be dissected it may be useful to use a table like in packet-sip.c */ static const char poc1_app_name_str[] = "PoC1"; static const char mux_app_name_str[] = "3GPP"; /* Application Name (ASCII) */ is_ascii = tvb_ascii_isprint(tvb, offset, 4); if (is_ascii) { proto_tree_add_item_ret_string(tree, hf_rtcp_name_ascii, tvb, offset, 4, ENC_ASCII | ENC_NA, pinfo->pool, &ascii_name); } else { proto_tree_add_expert(tree, pinfo, &ei_rtcp_appl_not_ascii, tvb, offset, 4); } /* Applications specific data */ if (padding) { /* If there's padding present, we have to remove that from the data part * The last octet of the packet contains the length of the padding */ packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1); } if (is_ascii) { /* See if we can handle this application type */ if (g_ascii_strncasecmp(ascii_name, poc1_app_name_str, 4) == 0) { offset = dissect_rtcp_app_poc1(tvb, pinfo, offset, tree, packet_len, subtype_item, rtcp_subtype); } else if (g_ascii_strncasecmp(ascii_name, mux_app_name_str, 4) == 0) { /* 3GPP Nb protocol extension (3GPP 29.414) for RTP Multiplexing */ col_append_fstr(pinfo->cinfo, COL_INFO, "( %s ) subtype=%u", ascii_name, rtcp_subtype); offset += 4; packet_len -= 4; /* Applications specific data */ if (padding) { /* If there's padding present, we have to remove that from the data part * The last octet of the packet contains the length of the padding */ packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1); } if (packet_len == 4) { guint16 local_port = 0; proto_item* mux_item = proto_tree_add_item(tree, hf_rtcp_app_mux, tvb, offset, packet_len, ENC_NA); proto_tree* mux_tree = proto_item_add_subtree(mux_item, ett_mux); proto_tree_add_item(mux_tree, hf_rtcp_app_mux_mux, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(mux_tree, hf_rtcp_app_mux_cp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(mux_tree, hf_rtcp_app_mux_selection, tvb, offset, 1, ENC_BIG_ENDIAN); local_port = tvb_get_ntohs(tvb, offset + 2); proto_tree_add_uint(mux_tree, hf_rtcp_app_mux_localmuxport, tvb, offset + 2, 2, local_port * 2); } else { /* fall back to just showing the data if it's the wrong length */ proto_tree_add_item(tree, hf_rtcp_app_data, tvb, offset, packet_len, ENC_NA); } if ((int)(offset + packet_len) >= offset) offset += packet_len; return offset; } else if (g_ascii_strncasecmp(ascii_name, "MCPT", 4) == 0) { offset = dissect_rtcp_app_mcpt(tvb, pinfo, offset, tree, packet_len, subtype_item, rtcp_subtype); } else if (g_ascii_strncasecmp(ascii_name, "MCCP", 4) == 0) { offset = dissect_rtcp_app_mccp(tvb, pinfo, offset, tree, packet_len, subtype_item, rtcp_subtype); } else { tvbuff_t* next_tvb; /* tvb to pass to subdissector */ /* tvb == Pass the entire APP payload so the subdissector can have access to the * entire data set */ next_tvb = tvb_new_subset_length(tvb, offset - 8, app_length + 4); /* look for registered sub-dissectors */ if (dissector_try_string(rtcp_dissector_table, ascii_name, next_tvb, pinfo, tree, NULL)) { /* found subdissector - return tvb_reported_length */ offset += 4; packet_len -= 4; if (padding) { /* If there's padding present, we have to remove that from the data part * The last octet of the packet contains the length of the padding */ packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1); } if ((int)(offset + packet_len) >= offset) offset += packet_len; return offset; } else { /* Unhandled application type, just show app name and raw data */ col_append_fstr(pinfo->cinfo, COL_INFO, "( %s ) subtype=%u", ascii_name, rtcp_subtype); offset += 4; packet_len -= 4; /* Applications specific data */ if (padding) { /* If there's padding present, we have to remove that from the data part * The last octet of the packet contains the length of the padding */ packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1); } if (tvb_ascii_isprint(tvb, offset, packet_len)) { proto_tree_add_item(tree, hf_rtcp_app_data_str, tvb, offset, packet_len, ENC_ASCII | ENC_NA); } else { proto_tree_add_item(tree, hf_rtcp_app_data, tvb, offset, packet_len, ENC_NA); } if ((int)(offset + packet_len) >= offset) offset += packet_len; } } } else { /* Unhandled application type, just show subtype and raw data */ col_append_fstr(pinfo->cinfo, COL_INFO, "subtype=%u", rtcp_subtype); offset += 4; packet_len -= 4; /* Applications specific data */ if (padding) { /* If there's padding present, we have to remove that from the data part * The last octet of the packet contains the length of the padding */ packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1); } if (tvb_ascii_isprint(tvb, offset, packet_len)) { proto_tree_add_item(tree, hf_rtcp_app_data_str, tvb, offset, packet_len, ENC_ASCII | ENC_NA); } else { proto_tree_add_item(tree, hf_rtcp_app_data, tvb, offset, packet_len, ENC_NA); } if ((int)(offset + packet_len) >= offset) offset += packet_len; } return offset; } static int dissect_rtcp_bye( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, int count, int packet_length ) { int chunk; unsigned int reason_length = 0; gint reason_offset = 0; chunk = 1; while ( chunk <= count ) { /* source identifier, 32 bits */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; chunk++; } if (count * 4 < packet_length) { /* Bye reason consists of an 8 bit length l and a string with length l */ reason_length = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtcp_sdes_length, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; reason_offset = offset; proto_tree_add_item( tree, hf_rtcp_sdes_text, tvb, offset, reason_length, ENC_ASCII); offset += reason_length; } /* BYE packet padded out if string didn't fit in previous word */ if (offset % 4) { gint pad_size = (4 - (offset % 4)); int i; /* Check padding */ for (i = 0; i < pad_size; i++) { if ((!(tvb_offset_exists(tvb, offset + i))) || (tvb_get_guint8(tvb, offset + i) != 0)) { proto_tree_add_expert(tree, pinfo, &ei_rtcp_bye_reason_not_padded, tvb, reason_offset, reason_length); } } offset += pad_size; } return offset; } static int dissect_rtcp_sdes( tvbuff_t *tvb, int offset, proto_tree *tree, int count ) { int chunk; proto_item *sdes_item; proto_tree *sdes_tree; proto_tree *sdes_item_tree; proto_item *ti; int start_offset; int items_start_offset; guint32 ssrc; unsigned int item_len; unsigned int sdes_type; unsigned int prefix_len; chunk = 1; while ( chunk <= count ) { /* Create a subtree for this chunk; we don't yet know the length. */ start_offset = offset; ssrc = tvb_get_ntohl( tvb, offset ); sdes_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_sdes, &sdes_item, "Chunk %u, SSRC/CSRC 0x%X", chunk, ssrc); /* SSRC_n source identifier, 32 bits */ proto_tree_add_item( sdes_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Create a subtree for the SDES items; we don't yet know the length */ items_start_offset = offset; sdes_item_tree = proto_tree_add_subtree(sdes_tree, tvb, offset, -1, ett_sdes_item, &ti, "SDES items" ); /* * Not every message is ended with "null" bytes, so check for * end of frame as well. */ while ( tvb_reported_length_remaining( tvb, offset ) > 0 ) { /* ID, 8 bits */ sdes_type = tvb_get_guint8( tvb, offset ); proto_tree_add_item( sdes_item_tree, hf_rtcp_sdes_type, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( sdes_type == RTCP_SDES_END ) { /* End of list */ break; } /* Item length, 8 bits */ item_len = tvb_get_guint8( tvb, offset ); proto_tree_add_item( sdes_item_tree, hf_rtcp_sdes_length, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( item_len != 0 ) { if ( sdes_type == RTCP_SDES_PRIV ) { /* PRIV adds two items between the * SDES length and value - an 8 bit * length giving the length of a * "prefix string", and the string. */ prefix_len = tvb_get_guint8( tvb, offset ); if ( prefix_len + 1 > item_len ) { proto_tree_add_uint_format_value( sdes_item_tree, hf_rtcp_sdes_prefix_len, tvb, offset, 1, prefix_len, "%u (bogus, must be <= %u)", prefix_len, item_len - 1); offset += item_len; continue; } proto_tree_add_item( sdes_item_tree, hf_rtcp_sdes_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; proto_tree_add_item( sdes_item_tree, hf_rtcp_sdes_prefix_string, tvb, offset, prefix_len, ENC_ASCII ); offset += prefix_len; item_len -= prefix_len +1; if ( item_len == 0 ) continue; } proto_tree_add_item( sdes_item_tree, hf_rtcp_sdes_text, tvb, offset, item_len, ENC_ASCII ); offset += item_len; } } /* Set the length of the items subtree. */ proto_item_set_len(ti, offset - items_start_offset); /* 32 bits = 4 bytes, so..... * If offset % 4 != 0, we divide offset by 4, add one and then * multiply by 4 again to reach the boundary */ if ( offset % 4 != 0 ) offset = ((offset / 4) + 1 ) * 4; /* Set the length of this chunk. */ proto_item_set_len(sdes_item, offset - start_offset); chunk++; } return offset; } static void parse_xr_type_specific_field(tvbuff_t *tvb, gint offset, guint block_type, proto_tree *tree, guint8 *thinning) { static int * const flags[] = { &hf_rtcp_xr_stats_loss_flag, &hf_rtcp_xr_stats_dup_flag, &hf_rtcp_xr_stats_jitter_flag, &hf_rtcp_xr_stats_ttl, NULL }; switch (block_type) { case RTCP_XR_LOSS_RLE: case RTCP_XR_DUP_RLE: case RTCP_XR_PKT_RXTIMES: *thinning = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_rtcp_xr_thinning, tvb, offset, 1, ENC_BIG_ENDIAN); break; case RTCP_XR_STATS_SUMRY: proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN); break; default: proto_tree_add_item(tree, hf_rtcp_xr_block_specific, tvb, offset, 1, ENC_BIG_ENDIAN); break; } } static gboolean validate_xr_block_length(tvbuff_t *tvb, packet_info *pinfo, int offset, guint block_type, guint block_len, proto_tree *tree) { proto_item *ti; ti = proto_tree_add_uint(tree, hf_rtcp_xr_block_length, tvb, offset, 2, block_len); proto_item_append_text(ti, " (%u bytes)", (block_len)*4); switch (block_type) { case RTCP_XR_REF_TIME: if (block_len != 2) expert_add_info_format(pinfo, ti, &ei_rtcp_xr_block_length_bad, "Invalid block length, should be 2"); return FALSE; case RTCP_XR_STATS_SUMRY: if (block_len != 9) expert_add_info_format(pinfo, ti, &ei_rtcp_xr_block_length_bad, "Invalid block length, should be 9"); return FALSE; case RTCP_XR_VOIP_METRCS: case RTCP_XR_BT_XNQ: if (block_len != 8) expert_add_info_format(pinfo, ti, &ei_rtcp_xr_block_length_bad, "Invalid block length, should be 8"); return FALSE; case RTCP_XR_IDMS: if (block_len != 7) expert_add_info_format(pinfo, ti, &ei_rtcp_xr_block_length_bad, "Invalid block length, should be 7"); return FALSE; default: break; } return TRUE; } static int dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, unsigned int padding, gint packet_len) { guint block_num; /* Packet length should at least be 4 */ if (packet_len < 4) { proto_tree_add_expert(tree, pinfo, &ei_rtcp_missing_sender_ssrc, tvb, offset, packet_len); return offset + packet_len; } if (padding) { /* If there's padding present, we have to remove that from the data part * The last octet of the packet contains the length of the padding */ packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1); } /* SSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; packet_len -= 4; for( block_num = 1; packet_len > 0; block_num++) { guint block_type = tvb_get_guint8(tvb, offset), block_length = 0; gint content_length = 0; guint8 thinning = 0; /*gboolean valid = TRUE;*/ /* Create a subtree for this block, don't know the length yet*/ proto_item *block; proto_tree *xr_block_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_xr_block, &block, "Block %u", block_num); proto_tree *content_tree; proto_tree_add_item(xr_block_tree, hf_rtcp_xr_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); if (packet_len >= 2) { parse_xr_type_specific_field(tvb, offset + 1, block_type, xr_block_tree, &thinning); if (packet_len >= 4) { block_length = tvb_get_ntohs(tvb, offset + 2); /* XXX: What if FALSE return from the following ?? */ /*valid =*/ validate_xr_block_length(tvb, pinfo, offset + 2, block_type, block_length, xr_block_tree); } } else { expert_add_info(pinfo, block, &ei_rtcp_missing_block_header); return offset + packet_len; } content_length = block_length * 4; proto_item_set_len(block, content_length + 4); if (content_length > packet_len) { expert_add_info(pinfo, block, &ei_rtcp_block_length); } offset += 4; packet_len -= 4; content_tree = proto_tree_add_subtree(xr_block_tree, tvb, offset, content_length, ett_xr_block_contents, NULL, "Contents"); switch (block_type) { case RTCP_XR_VOIP_METRCS: { guint fraction_rate; /* Identifier */ proto_tree_add_item(content_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Loss Rate */ fraction_rate = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format_value(content_tree, hf_rtcp_ssrc_fraction, tvb, offset, 1, fraction_rate, "%u / 256", fraction_rate); offset++; /* Discard Rate */ fraction_rate = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format_value(content_tree, hf_rtcp_ssrc_discarded, tvb, offset, 1, fraction_rate, "%u / 256", fraction_rate); offset++; /* Burst Density */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_burst_density, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Gap Density */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_gap_density, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Burst Duration */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_burst_duration, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Gap Duration */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_gap_duration, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Round Trip Delay */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_rtdelay, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* End System Delay */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_esdelay, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Signal Level */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_int_format_value(content_tree, hf_rtcp_xr_voip_metrics_siglevel, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_siglevel, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Noise Level */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_int_format_value(content_tree, hf_rtcp_xr_voip_metrics_noiselevel, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_noiselevel, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* RERL */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_uint_format_value(content_tree, hf_rtcp_xr_voip_metrics_rerl, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_rerl, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* GMin */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_gmin, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* R factor */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_uint_format_value(content_tree, hf_rtcp_xr_voip_metrics_rfactor, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_rfactor, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* external R Factor */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_uint_format_value(content_tree, hf_rtcp_xr_voip_metrics_extrfactor, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_extrfactor, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* MOS LQ */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_float_format_value(content_tree, hf_rtcp_xr_voip_metrics_moslq, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_float(content_tree, hf_rtcp_xr_voip_metrics_moslq, tvb, offset, 1, (float) (tvb_get_guint8(tvb, offset) / 10.0)); offset++; /* MOS CQ */ if (tvb_get_guint8(tvb, offset) == 0x7f) proto_tree_add_float_format_value(content_tree, hf_rtcp_xr_voip_metrics_moscq, tvb, offset, 1, 0x7f, "Unavailable"); else proto_tree_add_float(content_tree, hf_rtcp_xr_voip_metrics_moscq, tvb, offset, 1, (float) (tvb_get_guint8(tvb, offset) / 10.0)); offset++; /* PLC, JB Adaptive, JB Rate */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_plc, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_jbadaptive, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_jbrate, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 2; /* skip over reseved bit */ /* JB Nominal */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_jbnominal, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* JB Max */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_jbmax, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* JB Abs max */ proto_tree_add_item(content_tree, hf_rtcp_xr_voip_metrics_jbabsmax, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; } case RTCP_XR_STATS_SUMRY: { /* Identifier */ proto_tree_add_item(content_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Begin Seq */ proto_tree_add_item(content_tree, hf_rtcp_xr_beginseq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* End Seq */ proto_tree_add_item(content_tree, hf_rtcp_xr_endseq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Lost Pkts */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_lost, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Dup Pkts */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_dups, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Min Jitter */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_minjitter, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Max Jitter */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_maxjitter, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Mean Jitter */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_meanjitter, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Dev Jitter */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_devjitter, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Min TTL */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_minttl, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; /* Max TTL */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_maxttl, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; /* Mean TTL */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_meanttl, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; /* Dev TTL */ proto_tree_add_item(content_tree, hf_rtcp_xr_stats_devttl, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; break; } case RTCP_XR_REF_TIME: { proto_tree_add_item(content_tree, hf_rtcp_xr_timestamp, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); offset += 8; break; } case RTCP_XR_DLRR: { /* Each report block is 12 bytes */ gint sources = content_length / 12; gint counter = 0; for(counter = 0; counter < sources; counter++) { /* Create a new subtree for a length of 12 bytes */ proto_tree *ssrc_tree = proto_tree_add_subtree_format(content_tree, tvb, offset, 12, ett_xr_ssrc, NULL, "Source %u", counter + 1); /* SSRC_n source identifier, 32 bits */ proto_tree_add_item(ssrc_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Last RR timestamp */ proto_tree_add_item(ssrc_tree, hf_rtcp_xr_lrr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Delay since last RR timestamp */ proto_tree_add_item(ssrc_tree, hf_rtcp_xr_dlrr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if (content_length % 12 != 0) offset += content_length % 12; break; } case RTCP_XR_PKT_RXTIMES: { /* 8 bytes of fixed header */ guint32 rcvd_time; gint count = 0, skip = 8; guint16 begin = 0; /* Identifier */ proto_tree_add_item(content_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Begin Seq */ begin = tvb_get_ntohs(tvb, offset); /* Apply Thinning value */ begin = (begin + ((1<<thinning)-1)) & ~((1<<thinning)-1); proto_tree_add_item(content_tree, hf_rtcp_xr_beginseq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* End Seq */ proto_tree_add_item(content_tree, hf_rtcp_xr_endseq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for(count = 0; skip < content_length; skip += 4, count++) { rcvd_time = tvb_get_ntohl(tvb, offset); proto_tree_add_uint_format(content_tree, hf_rtcp_xr_receipt_time_seq, tvb, offset, 4, rcvd_time, "Seq: %u, Receipt Time: %u", (begin + (count<<thinning)) % 65536, rcvd_time); offset += 4; } break; } case RTCP_XR_LOSS_RLE: case RTCP_XR_DUP_RLE: { /* 8 bytes of fixed header */ gint count = 0, skip = 8; proto_tree *chunks_tree; /* Identifier */ proto_tree_add_item(content_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Begin Seq */ proto_tree_add_item(content_tree, hf_rtcp_xr_beginseq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* End Seq */ proto_tree_add_item(content_tree, hf_rtcp_xr_endseq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* report Chunks */ chunks_tree = proto_tree_add_subtree(content_tree, tvb, offset, content_length, ett_xr_loss_chunk, NULL, "Report Chunks"); for(count = 1; skip < content_length; skip += 2, count++) { guint value = tvb_get_ntohs(tvb, offset); if (value == 0) { proto_tree_add_none_format(chunks_tree, hf_rtcp_xr_chunk_null_terminator, tvb, offset, 2, "Chunk: %u -- Null Terminator ", count); } else if ( ! ( value & 0x8000 )) { const gchar *run_type = (value & 0x4000) ? "1s" : "0s"; value &= 0x3FFF; proto_tree_add_uint_format(chunks_tree, hf_rtcp_xr_chunk_length, tvb, offset, 2, value, "Chunk: %u -- Length Run %s, length: %u", count, run_type, value); } else { proto_tree_add_uint_format(chunks_tree, hf_rtcp_xr_chunk_bit_vector, tvb, offset, 2, value & 0x7FFF, "Chunk: %u -- Bit Vector 0x%x", count, value & 0x7FFF); } offset += 2; } break; } case RTCP_XR_BT_XNQ: { /* BT XNQ block as defined in RFC5093 */ guint temp_value; /* used when checking spare bits in block type 8 */ proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_begseq, tvb, offset, 2, ENC_BIG_ENDIAN); /* Begin Sequence number */ proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_endseq, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* End Sequence number */ offset += 4; proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_vmaxdiff, tvb, offset, 2, ENC_BIG_ENDIAN); /* vmaxdiff */ proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_vrange, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* vrange */ offset += 4; proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_vsum, tvb, offset, 4, ENC_BIG_ENDIAN); /* vsum */ offset += 4; proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_cycles, tvb, offset, 2, ENC_BIG_ENDIAN); /* cycle count */ proto_tree_add_item(content_tree, hf_rtcp_xr_btxnq_jbevents, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* jitter buffer events */ offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* tDegNet */ if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_tdegnet, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* tDegJit */ if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_tdegjit, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* ES */ if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_es, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; temp_value = tvb_get_ntohl(tvb, offset); /* SES */ if ((temp_value & 0x0ff000000) != 0) proto_tree_add_string(content_tree, hf_rtcp_xr_btxnq_spare, tvb, offset, 1, "Warning - spare bits not 0"); proto_tree_add_uint(content_tree, hf_rtcp_xr_btxnq_ses, tvb, offset+1, 3, temp_value & 0x0ffffff); offset += 4; break; } case RTCP_XR_IDMS: { proto_item *item; int hour,min,sec,msec; guint32 tmp_ts; offset -= 3; proto_tree_add_item(content_tree, hf_rtcp_xr_idms_spst, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=3; proto_tree_add_item(content_tree, hf_rtcp_xr_idms_pt, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(content_tree, hf_rtcp_xr_idms_msci, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(content_tree, hf_rtcp_xr_idms_source_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(content_tree, hf_rtcp_xr_idms_ntp_rcv_ts, tvb, offset, 8, ENC_BIG_ENDIAN); item = proto_tree_add_item(content_tree, hf_rtcp_ntp, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); proto_item_set_generated(item); proto_tree_add_item(content_tree, hf_rtcp_xr_idms_rtp_ts, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; tmp_ts = tvb_get_ntohl(tvb,offset); hour = ( (int) ( tmp_ts >> 16 ) ) / 3600; min = (( (int) ( tmp_ts >> 16 ) ) - hour * 3600) / 60; sec = (( (int) ( tmp_ts >> 16 ) ) - hour * 3600 - min * 60); msec = ( (int) ( tmp_ts & 0x0000FFFF ) ) / 66; proto_tree_add_uint_format_value(content_tree, hf_rtcp_xr_idms_ntp_pres_ts, tvb, offset, 4, tmp_ts, "%d:%02d:%02d:%03d [h:m:s:ms]", hour,min,sec,msec); offset+=4; } break; default: /* skip over the unknown block */ offset += content_length; break; } /* switch (block_type) */ packet_len -= content_length; } /* for (block_num = ...) */ return offset; } static int dissect_rtcp_avb( tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, int packet_length _U_ ) { /* SSRC / CSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Name (ASCII) */ proto_tree_add_item( tree, hf_rtcp_name_ascii, tvb, offset, 4, ENC_ASCII ); offset += 4; /* TimeBase Indicator */ proto_tree_add_item( tree, hf_rtcp_timebase_indicator, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* Identity */ proto_tree_add_item( tree, hf_rtcp_identity, tvb, offset, 10, ENC_NA ); offset += 10; /* Stream id, 64 bits */ proto_tree_add_item( tree, hf_rtcp_stream_id, tvb, offset, 8, ENC_BIG_ENDIAN ); offset += 8; /* AS timestamp, 32 bits */ proto_tree_add_item( tree, hf_rtcp_as_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* RTP timestamp, 32 bits */ proto_tree_add_item( tree, hf_rtcp_rtp_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; return offset; } static int dissect_rtcp_rsi( tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, int packet_length ) { proto_item *item; /* SSRC / CSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* SSRC / CSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* NTP timestamp */ proto_tree_add_item(tree, hf_rtcp_ntp_msw, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_rtcp_ntp_lsw, tvb, offset+4, 4, ENC_BIG_ENDIAN); item = proto_tree_add_item(tree, hf_rtcp_ntp, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); proto_item_set_generated(item); offset += 8; /* Sub report blocks */ return offset + (packet_length - 16); } static int dissect_rtcp_token( tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, int packet_len, guint rtcp_subtype _U_ ) { /* SSRC / CSRC */ proto_tree_add_item( tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* subtypes */ return offset + (packet_len - 4); } static void dissect_rtcp_profile_specific_extensions (packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int offset, int remaining) { gint16 extension_type; gint16 extension_length; proto_tree *pse_tree; proto_item *pse_item; proto_item *item; col_append_fstr(pinfo->cinfo, COL_INFO, "("); while (remaining) { extension_type = tvb_get_ntohs (tvb, offset); extension_length = tvb_get_ntohs (tvb, offset+2); if (extension_length < 4) { extension_length = 4; /* expert info? */ } pse_tree = proto_tree_add_subtree(tree, tvb, offset, extension_length, ett_pse, &pse_item, "Payload Specific Extension"); proto_item_append_text(pse_item, " (%s)", val_to_str_const(extension_type, rtcp_ms_profile_extension_vals, "Unknown")); col_append_fstr(pinfo->cinfo, COL_INFO, "PSE:%s ", val_to_str_const(extension_type, rtcp_ms_profile_extension_vals, "Unknown")); proto_tree_add_item(pse_tree, hf_rtcp_profile_specific_extension_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(pse_tree, hf_rtcp_profile_specific_extension_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; switch (extension_type) { case 1: /* MS Estimated Bandwidth */ item = proto_tree_add_item(pse_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN); /* Decode if it is NONE or ANY and add to line */ proto_item_append_text(item," %s", val_to_str_const(tvb_get_ntohl (tvb, offset), rtcp_ssrc_values, "")); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_bandwidth, tvb, offset + 4, 4, ENC_BIG_ENDIAN); /* Confidence level byte is optional so check length first */ if (extension_length == 16) { proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_confidence_level, tvb, offset + 8, 1, ENC_BIG_ENDIAN); } break; case 4: /* MS Packet Loss Notification */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_seq_num, tvb, offset + 2, 2, ENC_BIG_ENDIAN); break; case 5: /* MS Video Preference */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_frame_resolution_width, tvb, offset + 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_frame_resolution_height, tvb, offset + 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_bitrate, tvb, offset + 8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_frame_rate, tvb, offset + 12, 2, ENC_BIG_ENDIAN); break; case 7: /* MS Policy Server Bandwidth */ /* First 4 bytes are reserved */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_bandwidth, tvb, offset + 4, 4, ENC_BIG_ENDIAN); break; case 8: /* MS TURN Server Bandwidth */ /* First 4 bytes are reserved */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_bandwidth, tvb, offset + 4, 4, ENC_BIG_ENDIAN); break; case 9: /* MS Audio Healer Metrics */ item = proto_tree_add_item(pse_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN); /* Decode if it is NONE or ANY and add to line */ proto_item_append_text(item," %s", val_to_str_const(tvb_get_ntohl (tvb, offset), rtcp_ssrc_values, "")); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_concealed_frames, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_stretched_frames, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_compressed_frames, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_total_frames, tvb, offset+16, 4, ENC_BIG_ENDIAN); /* 2 bytes Reserved */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_receive_quality_state, tvb, offset+22, 1, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_fec_distance_request, tvb, offset+23, 1, ENC_BIG_ENDIAN); break; case 10: /* MS Receiver-side Bandwidth Limit */ /* First 4 bytes are reserved */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_bandwidth, tvb, offset + 4, 4, ENC_BIG_ENDIAN); break; case 11: /* MS Packet Train Packet */ item = proto_tree_add_item(pse_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN); /* Decode if it is NONE or ANY and add to line */ proto_item_append_text(item," %s", val_to_str_const(tvb_get_ntohl (tvb, offset), rtcp_ssrc_values, "")); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_last_packet_train, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_packet_idx, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_packet_cnt, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_packet_train_byte_cnt, tvb, offset+6, 2, ENC_BIG_ENDIAN); break; case 12: /* MS Peer Info Exchange */ item = proto_tree_add_item(pse_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN); /* Decode if it is NONE or ANY and add to line */ proto_item_append_text(item," %s", val_to_str_const(tvb_get_ntohl (tvb, offset), rtcp_ssrc_values, "")); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_inbound_bandwidth, tvb, offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_outbound_bandwidth, tvb, offset + 8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_no_cache, tvb, offset + 12, 1, ENC_BIG_ENDIAN); break; case 13: /* MS Network Congestion Notification */ proto_tree_add_item(pse_tree, hf_rtcp_ntp_msw, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_ntp_lsw, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_ntp, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_congestion_info, tvb, offset + 12, 1, ENC_BIG_ENDIAN); break; case 14: /* MS Modality Send Bandwidth Limit */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_modality, tvb, offset, 1, ENC_BIG_ENDIAN); /* 3 bytes Reserved */ proto_tree_add_item(pse_tree, hf_rtcp_pse_ms_bandwidth, tvb, offset + 4, 4, ENC_BIG_ENDIAN); break; case 6: /* MS Padding */ default: /* Unrecognized */ proto_tree_add_item(pse_tree, hf_rtcp_profile_specific_extension, tvb, offset, extension_length - 4, ENC_NA); break; } remaining -= extension_length; offset += extension_length - 4; } col_append_fstr(pinfo->cinfo, COL_INFO, ") "); } static int dissect_rtcp_rr( packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int count, int packet_length ) { int counter; proto_tree *ssrc_tree; proto_tree *ssrc_sub_tree; proto_tree *high_sec_tree; proto_item *ti; guint8 rr_flt; int rr_offset = offset; counter = 1; while ( counter <= count ) { guint32 lsr, dlsr; /* Create a new subtree for a length of 24 bytes */ ssrc_tree = proto_tree_add_subtree_format(tree, tvb, offset, 24, ett_ssrc, NULL, "Source %u", counter ); /* SSRC_n source identifier, 32 bits */ proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; ssrc_sub_tree = proto_tree_add_subtree(ssrc_tree, tvb, offset, 20, ett_ssrc_item, NULL, "SSRC contents" ); /* Fraction lost, 8bits */ rr_flt = tvb_get_guint8( tvb, offset ); proto_tree_add_uint_format_value( ssrc_sub_tree, hf_rtcp_ssrc_fraction, tvb, offset, 1, rr_flt, "%u / 256", rr_flt ); offset++; /* Cumulative number of packets lost, 24 bits */ proto_tree_add_item( ssrc_sub_tree, hf_rtcp_ssrc_cum_nr, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* Extended highest sequence nr received, 32 bits * Just for the sake of it, let's add another subtree * because this might be a little clearer */ ti = proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_ext_high_seq, tvb, offset, 4, ENC_BIG_ENDIAN ); high_sec_tree = proto_item_add_subtree( ti, ett_ssrc_ext_high ); /* Sequence number cycles */ proto_tree_add_item( high_sec_tree, hf_rtcp_ssrc_high_cycles, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* highest sequence number received */ proto_tree_add_item( high_sec_tree, hf_rtcp_ssrc_high_seq, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* Interarrival jitter */ proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_jitter, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Last SR timestamp */ lsr = tvb_get_ntohl( tvb, offset ); proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_lsr, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Delay since last SR timestamp */ dlsr = tvb_get_ntohl( tvb, offset ); ti = proto_tree_add_item( ssrc_tree, hf_rtcp_ssrc_dlsr, tvb, offset, 4, ENC_BIG_ENDIAN ); proto_item_append_text(ti, " (%d milliseconds)", (int)(((double)dlsr/(double)65536) * 1000.0)); offset += 4; /* Do roundtrip calculation */ if (global_rtcp_show_roundtrip_calculation) { /* Based on delay since SR was sent in other direction */ calculate_roundtrip_delay(tvb, pinfo, ssrc_tree, lsr, dlsr); } counter++; } /* If length remaining, assume profile-specific extension bytes */ if ((offset-rr_offset) < packet_length) { dissect_rtcp_profile_specific_extensions (pinfo, tvb, tree, offset, packet_length - (offset - rr_offset)); offset = rr_offset + packet_length; } return offset; } static int dissect_rtcp_sr( packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int count, int packet_length ) { proto_item *item; guint32 ts_msw, ts_lsw; int sr_offset = offset; /* NTP timestamp */ ts_msw = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_rtcp_ntp_msw, tvb, offset, 4, ENC_BIG_ENDIAN); ts_lsw = tvb_get_ntohl(tvb, offset+4); proto_tree_add_item(tree, hf_rtcp_ntp_lsw, tvb, offset+4, 4, ENC_BIG_ENDIAN); item = proto_tree_add_item(tree, hf_rtcp_ntp, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); proto_item_set_generated(item); offset += 8; /* RTP timestamp, 32 bits */ proto_tree_add_item( tree, hf_rtcp_rtp_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Sender's packet count, 32 bits */ proto_tree_add_item( tree, hf_rtcp_sender_pkt_cnt, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Sender's octet count, 32 bits */ proto_tree_add_item( tree, hf_rtcp_sender_oct_cnt, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; /* Record the time of this packet in the sender's conversation */ if (global_rtcp_show_roundtrip_calculation) { /* Use middle 32 bits of 64-bit time value */ guint32 lsr = ((ts_msw & 0x0000ffff) << 16 | (ts_lsw & 0xffff0000) >> 16); /* Record the time that we sent this in appropriate conversation */ remember_outgoing_sr(pinfo, lsr); } /* The rest of the packet is equal to the RR packet */ if ( count != 0 ) offset = dissect_rtcp_rr( pinfo, tvb, offset, tree, count, packet_length-(offset-sr_offset) ); else { /* If length remaining, assume profile-specific extension bytes */ if ((offset-sr_offset) < packet_length) { dissect_rtcp_profile_specific_extensions (pinfo, tvb, tree, offset, packet_length - (offset - sr_offset)); offset = sr_offset + packet_length; } } return offset; } /* Look for conversation info and display any setup info found */ void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Conversation and current data */ struct _rtcp_conversation_info *p_conv_data; /* Use existing packet data if available */ p_conv_data = (struct _rtcp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0); if (!p_conv_data) { conversation_t *p_conv; /* First time, get info from conversation */ p_conv = find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv) { /* Look for data in conversation */ struct _rtcp_conversation_info *p_conv_packet_data; p_conv_data = (struct _rtcp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtcp); if (p_conv_data) { /* Save this conversation info into packet info */ p_conv_packet_data = (struct _rtcp_conversation_info *)wmem_memdup(wmem_file_scope(), p_conv_data, sizeof(struct _rtcp_conversation_info)); p_add_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0, p_conv_packet_data); } } } /* Create setup info subtree with summary info. */ if (p_conv_data && p_conv_data->setup_method_set) { proto_tree *rtcp_setup_tree; proto_item *ti = proto_tree_add_string_format(tree, hf_rtcp_setup, tvb, 0, 0, "", "Stream setup by %s (frame %u)", p_conv_data->setup_method, p_conv_data->setup_frame_number); proto_item_set_generated(ti); rtcp_setup_tree = proto_item_add_subtree(ti, ett_rtcp_setup); if (rtcp_setup_tree) { /* Add details into subtree */ proto_item *item = proto_tree_add_uint(rtcp_setup_tree, hf_rtcp_setup_frame, tvb, 0, 0, p_conv_data->setup_frame_number); proto_item_set_generated(item); item = proto_tree_add_string(rtcp_setup_tree, hf_rtcp_setup_method, tvb, 0, 0, p_conv_data->setup_method); proto_item_set_generated(item); } } } /* Update conversation data to record time that outgoing rr/sr was sent */ static void remember_outgoing_sr(packet_info *pinfo, guint32 lsr) { conversation_t *p_conv; struct _rtcp_conversation_info *p_conv_data; struct _rtcp_conversation_info *p_packet_data; /* This information will be accessed when an incoming packet comes back to the side that sent this packet, so no use storing in the packet info. However, do store the fact that we've already set this info before */ /**************************************************************************/ /* First of all, see if we've already stored this information for this sr */ /* Look first in packet info */ p_packet_data = (struct _rtcp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0); if (p_packet_data && p_packet_data->last_received_set && (p_packet_data->last_received_frame_number >= pinfo->num)) { /* We already did this, OK */ return; } /**************************************************************************/ /* Otherwise, we want to find/create the conversation and update it */ /* First time, get info from conversation. Even though we think of this as an outgoing packet being sent, we store the time as being received by the destination. */ p_conv = find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); /* If the conversation doesn't exist, create it now. */ if (!p_conv) { p_conv = conversation_new(pinfo->num, &pinfo->net_dst, &pinfo->net_src, CONVERSATION_UDP, pinfo->destport, pinfo->srcport, NO_ADDR2); if (!p_conv) { /* Give up if can't create it */ return; } } /****************************************************/ /* Now find/create conversation data */ p_conv_data = (struct _rtcp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtcp); if (!p_conv_data) { /* Allocate memory for data */ p_conv_data = wmem_new0(wmem_file_scope(), struct _rtcp_conversation_info); /* Add it to conversation. */ conversation_add_proto_data(p_conv, proto_rtcp, p_conv_data); } /*******************************************************/ /* Update conversation data */ p_conv_data->last_received_set = TRUE; p_conv_data->last_received_frame_number = pinfo->num; p_conv_data->last_received_timestamp = pinfo->abs_ts; p_conv_data->last_received_ts = lsr; /****************************************************************/ /* Update packet info to record conversation state */ /* Will use/create packet info */ if (!p_packet_data) { p_packet_data = wmem_new0(wmem_file_scope(), struct _rtcp_conversation_info); p_add_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0, p_packet_data); } /* Copy current conversation data into packet info */ p_packet_data->last_received_set = TRUE; p_packet_data->last_received_frame_number = p_conv_data->last_received_frame_number; } /* Use received sr to work out what the roundtrip delay is (at least between capture point and the other endpoint involved in the conversation) */ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 lsr, guint32 dlsr) { /*****************************************************/ /* This is called dissecting an SR. We need to: - look in the packet info for stored calculation. If found, use. - look up the conversation of the sending side to see when the 'last SR' was detected (received) - calculate the network delay using the that packet time, this packet time, and dlsr *****************************************************/ conversation_t *p_conv; struct _rtcp_conversation_info *p_conv_data; struct _rtcp_conversation_info *p_packet_data; /*************************************************/ /* Look for previous result */ p_packet_data = (struct _rtcp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0); if (p_packet_data && p_packet_data->lsr_matched) { /* Show info. */ add_roundtrip_delay_info(tvb, pinfo, tree, p_packet_data->calculated_delay_used_frame, p_packet_data->calculated_delay_report_gap, p_packet_data->calculated_delay); return; } /********************************************************************/ /* Look for captured timestamp of last SR in conversation of sender */ /* of this packet */ p_conv = find_conversation(pinfo->num, &pinfo->net_src, &pinfo->net_dst, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, NO_ADDR_B); if (!p_conv) { return; } /* Look for conversation data */ p_conv_data = (struct _rtcp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtcp); if (!p_conv_data) { return; } if (p_conv_data->last_received_set) { /* Store result of calculation in packet info */ if (!p_packet_data) { /* Create packet info if it doesn't exist */ p_packet_data = wmem_new0(wmem_file_scope(), struct _rtcp_conversation_info); /* Set as packet info */ p_add_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0, p_packet_data); } /* Don't allow match seemingly calculated from same (or later!) frame */ if (pinfo->num <= p_conv_data->last_received_frame_number) { return; } /* The previous report must match the lsr given here */ if (p_conv_data->last_received_ts == lsr) { /* Look at time of since original packet was sent */ gint seconds_between_packets = (gint) (pinfo->abs_ts.secs - p_conv_data->last_received_timestamp.secs); gint nseconds_between_packets = pinfo->abs_ts.nsecs - p_conv_data->last_received_timestamp.nsecs; gint total_gap = (seconds_between_packets*1000) + (nseconds_between_packets / 1000000); gint dlsr_ms = (int)(((double)dlsr/(double)65536) * 1000.0); gint delay; /* Delay is gap - dlsr (N.B. this is allowed to be -ve) */ delay = total_gap - dlsr_ms; /* Record that the LSR matches */ p_packet_data->lsr_matched = TRUE; /* No useful calculation can be done if dlsr not set... */ if (dlsr) { p_packet_data->calculated_delay = delay; p_packet_data->calculated_delay_report_gap = total_gap; p_packet_data->calculated_delay_used_frame = p_conv_data->last_received_frame_number; } /* Show info. */ add_roundtrip_delay_info(tvb, pinfo, tree, p_conv_data->last_received_frame_number, total_gap, delay); } } } /* Show the calculated roundtrip delay info by adding protocol tree items and appending text to the info column */ static void add_roundtrip_delay_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint frame, guint gap_between_reports, gint delay) { /* 'Last SR' frame used in calculation. Show this even if no delay shown */ proto_item *item = proto_tree_add_uint(tree, hf_rtcp_last_sr_timestamp_frame, tvb, 0, 0, frame); proto_item_set_generated(item); /* Time elapsed since 'Last SR' time in capture */ item = proto_tree_add_uint(tree, hf_rtcp_time_since_last_sr, tvb, 0, 0, gap_between_reports); proto_item_set_generated(item); /* Don't report on calculated delays below the threshold. Will report delays less than -threshold, to highlight problems with generated reports */ if (abs(delay) < (int)global_rtcp_show_roundtrip_calculation_minimum) { return; } /* Calculated delay in ms */ item = proto_tree_add_int(tree, hf_rtcp_roundtrip_delay, tvb, 0, 0, delay); proto_item_set_generated(item); /* Add to expert info */ if (delay >= 0) { expert_add_info_format(pinfo, item, &ei_rtcp_roundtrip_delay, "RTCP round-trip delay detected (%d ms)", delay); } else { expert_add_info_format(pinfo, item, &ei_rtcp_roundtrip_delay_negative, "Negative RTCP round-trip delay detected (%d ms)", delay); } /* Report delay in INFO column */ col_append_fstr(pinfo->cinfo, COL_INFO, " (roundtrip delay <-> %s = %dms, using frame %u) ", address_to_str(pinfo->pool, &pinfo->net_src), delay, frame); } static int rtcp_packet_type_to_tree( int rtcp_packet_type) { int tree; switch(rtcp_packet_type) { case RTCP_SR: tree = ett_rtcp_sr; break; case RTCP_RR: tree = ett_rtcp_rr; break; case RTCP_SDES: tree = ett_rtcp_sdes; break; case RTCP_BYE: tree = ett_rtcp_bye; break; case RTCP_APP: tree = ett_rtcp_app; break; case RTCP_RTPFB: tree = ett_rtcp_rtpfb; break; case RTCP_PSFB: tree = ett_rtcp_psfb; break; case RTCP_XR: tree = ett_rtcp_xr; break; case RTCP_FIR: tree = ett_rtcp_fir; break; case RTCP_NACK: tree = ett_rtcp_nack; break; default: tree = ett_rtcp; } return tree; } static int dissect_rtcp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_, gboolean is_srtp ) { proto_item *ti; proto_tree *rtcp_tree = NULL; guint padding_set = 0; proto_item *padding_item = NULL; gint offset = 0; gint total_packet_length = 0; guint padding_offset = 0; gboolean srtcp_encrypted = FALSE; gboolean srtcp_now_encrypted = FALSE; conversation_t *p_conv; struct srtp_info *srtcp_info = NULL; guint32 srtcp_offset = 0; guint32 srtcp_index = 0; guint8 temp_byte; int proto_to_use = proto_rtcp; temp_byte = tvb_get_guint8(tvb, offset); /* RFC 7983 gives current best practice in demultiplexing RT[C]P packets: * Examine the first byte of the packet: * +----------------+ * | [0..3] -+--> forward to STUN * | | * | [16..19] -+--> forward to ZRTP * | | * packet --> | [20..63] -+--> forward to DTLS * | | * | [64..79] -+--> forward to TURN Channel * | | * | [128..191] -+--> forward to RTP/RTCP * +----------------+ * * DTLS-SRTP MUST support multiplexing of DTLS and RTP over the same * port pair (RFCs 5764, 8835), and STUN packets sharing one port are * common as well. In WebRTC it's common to get a SDP early in the * setup process that sets up a RTCP conversation and sets the dissector * to RTCP, but to still get subsequent STUN and DTLS packets. * * XXX: Add a pref like RTP to specifically send the packet to the correct * other dissector. For now, rejecting packets works for the general setup, * since the other dissectors have fairly good heuristic dissectors that * are enabled by default. */ /* first see if this conversation is encrypted SRTP, and if so do not try to dissect the payload(s) */ p_conv = find_conversation(pinfo->num, &pinfo->net_src, &pinfo->net_dst, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, NO_ADDR_B); if (p_conv) { struct _rtcp_conversation_info *p_conv_data; p_conv_data = (struct _rtcp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtcp); if (p_conv_data && p_conv_data->srtcp_info) { gboolean e_bit; proto_to_use = proto_srtcp; srtcp_info = p_conv_data->srtcp_info; /* get the offset to the start of the SRTCP fields at the end of the packet */ srtcp_offset = tvb_reported_length_remaining(tvb, offset) - srtcp_info->auth_tag_len - srtcp_info->mki_len - 4; /* It has been setup as SRTCP, but skip to the SRTCP E field at the end to see if this particular packet is encrypted or not. The E bit is the MSB. */ srtcp_index = tvb_bytes_exist(tvb, srtcp_offset, 4) ? tvb_get_ntohl(tvb, srtcp_offset) : 0; e_bit = (srtcp_index & 0x80000000) ? TRUE : FALSE; srtcp_index &= 0x7fffffff; if (srtcp_info->encryption_algorithm!=SRTP_ENC_ALG_NULL) { /* just flag it for now - the first SR or RR header and SSRC are unencrypted */ if (e_bit) srtcp_encrypted = TRUE; } } } else if (is_srtp) { /* We've been told to dissect this as SRTCP without conversation info * (so via Decode As or heuristic); since we don't know where the SRTCP * bits start, so we don't know if it's encrypted. Assume yes, to * avoid errors. */ srtcp_encrypted = TRUE; proto_to_use = proto_srtcp; } col_set_str(pinfo->cinfo, COL_PROTOCOL, (proto_to_use == proto_srtcp) ? "SRTCP" : "RTCP"); if (RTCP_VERSION(temp_byte) != 2) { /* Unknown or unsupported version */ col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown %s version %u", (proto_to_use == proto_srtcp) ? "SRTCP" : "RTCP", RTCP_VERSION(temp_byte)); ti = proto_tree_add_item(tree, proto_to_use, tvb, offset, -1, ENC_NA ); rtcp_tree = proto_item_add_subtree(ti, ett_rtcp); proto_tree_add_item( rtcp_tree, hf_rtcp_version, tvb, offset, 1, ENC_BIG_ENDIAN); /* XXX: Offset is zero here, so in practice this rejects the packet * and lets heuristic dissectors make an attempt, though extra tree * entries appear on a tshark one pass even if some other dissector * claims the packet. */ return offset; } /* * Check if there are at least 4 bytes left in the frame, * the last 16 bits of those is the length of the current * RTCP message. The last compound message contains padding, * that enables us to break from the while loop. */ while ( !srtcp_now_encrypted && tvb_bytes_exist( tvb, offset, 4) ) { gint elem_count; guint packet_type; gint packet_length; /* * First retrieve the packet_type */ packet_type = tvb_get_guint8( tvb, offset + 1 ); /* * Check if it's a valid type */ if ( ( packet_type < RTCP_PT_MIN ) || ( packet_type > RTCP_PT_MAX ) ) break; col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(packet_type, rtcp_packet_type_vals, "Unknown")); /* * get the packet-length for the complete RTCP packet */ packet_length = ( tvb_get_ntohs( tvb, offset + 2 ) + 1 ) * 4; total_packet_length += packet_length; ti = proto_tree_add_item(tree, proto_to_use, tvb, offset, packet_length, ENC_NA ); proto_item_append_text(ti, " (%s)", val_to_str_const(packet_type, rtcp_packet_type_vals, "Unknown")); rtcp_tree = proto_item_add_subtree( ti, rtcp_packet_type_to_tree(packet_type) ); /* Conversation setup info */ if (global_rtcp_show_setup_info) { show_setup_info(tvb, pinfo, rtcp_tree); } if (padding_set) { /* Padding can't yet be set, since there is another packet */ expert_add_info(pinfo, padding_item, &ei_rtcp_not_final_padding); } temp_byte = tvb_get_guint8( tvb, offset ); proto_tree_add_item( rtcp_tree, hf_rtcp_version, tvb, offset, 1, ENC_BIG_ENDIAN); padding_set = RTCP_PADDING( temp_byte ); padding_offset = offset + packet_length - 1; padding_item = proto_tree_add_boolean( rtcp_tree, hf_rtcp_padding, tvb, offset, 1, temp_byte ); elem_count = RTCP_COUNT( temp_byte ); switch ( packet_type ) { case RTCP_SR: case RTCP_RR: /* Receiver report count, 5 bits */ proto_tree_add_uint( rtcp_tree, hf_rtcp_rc, tvb, offset, 1, temp_byte ); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); /* Sender Synchronization source, 32 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; if (srtcp_encrypted) { /* rest of the payload is encrypted - do not try to dissect */ srtcp_now_encrypted = TRUE; break; } if ( packet_type == RTCP_SR ) offset = dissect_rtcp_sr( pinfo, tvb, offset, rtcp_tree, elem_count, packet_length-8 ); else offset = dissect_rtcp_rr( pinfo, tvb, offset, rtcp_tree, elem_count, packet_length-8 ); break; case RTCP_SDES: /* Source count, 5 bits */ proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, temp_byte ); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_sdes( tvb, offset, rtcp_tree, elem_count ); break; case RTCP_BYE: /* Source count, 5 bits */ proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, temp_byte ); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_bye( tvb, pinfo, offset, rtcp_tree, elem_count, packet_length-4 ); break; case RTCP_APP: { /* Subtype, 5 bits */ guint rtcp_subtype; guint app_length; proto_item* subtype_item; rtcp_subtype = elem_count; subtype_item = proto_tree_add_uint( rtcp_tree, hf_rtcp_subtype, tvb, offset, 1, elem_count ); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ app_length = tvb_get_ntohs( tvb, offset ) <<2; offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); /* SSRC / CSRC */ proto_tree_add_item(rtcp_tree, hf_rtcp_ssrc_source, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (srtcp_encrypted) { /* rest of the payload is encrypted - do not try to dissect hf_rtcp_encrypted*/ proto_tree_add_item(rtcp_tree, hf_rtcp_encrypted, tvb, offset, -1, ENC_NA); if (preferences_application_specific_encoding == RTCP_APP_MCPTT) { col_add_fstr(pinfo->cinfo, COL_INFO, "(MCPT) %s", val_to_str(rtcp_subtype, rtcp_mcpt_subtype_vals, "unknown (%u)")); proto_item_append_text(subtype_item, " %s", val_to_str(rtcp_subtype, rtcp_mcpt_subtype_vals, "unknown (%u)")); } return tvb_reported_length(tvb); } offset = dissect_rtcp_app( tvb, pinfo, offset,rtcp_tree, padding_set, packet_length - 8, subtype_item, rtcp_subtype, app_length); } break; case RTCP_XR: /* Reserved, 5 bits, Ignore */ offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_xr( tvb, pinfo, offset, rtcp_tree, padding_set, packet_length - 4 ); break; case RTCP_AVB: /* Subtype, 5 bits */ proto_tree_add_uint( rtcp_tree, hf_rtcp_subtype, tvb, offset, 1, elem_count ); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_avb( tvb, pinfo, offset, rtcp_tree, packet_length - 4 ); break; case RTCP_RSI: /* Reserved, 5 bits, Ignore */ offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_rsi( tvb, pinfo, offset, rtcp_tree, packet_length - 4 ); break; case RTCP_TOKEN: { /* Subtype, 5 bits */ guint rtcp_subtype; rtcp_subtype = elem_count; proto_tree_add_uint( rtcp_tree, hf_rtcp_subtype, tvb, offset, 1, elem_count ); offset++; /* Packet type, 8 bits */ proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* Packet length in 32 bit words MINUS one, 16 bits */ offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset); offset = dissect_rtcp_token( tvb, pinfo, offset, rtcp_tree, packet_length - 4, rtcp_subtype ); } break; case RTCP_FIR: offset = dissect_rtcp_fir( tvb, offset, rtcp_tree ); break; case RTCP_NACK: offset = dissect_rtcp_nack( tvb, offset, rtcp_tree ); break; case RTCP_RTPFB: offset = dissect_rtcp_rtpfb( tvb, offset, rtcp_tree, ti, &padding_set, pinfo ); break; case RTCP_PSFB: offset = dissect_rtcp_psfb( tvb, offset, rtcp_tree, packet_length, ti, pinfo ); break; default: /* * To prevent endless loops in case of an unknown message type * increase offset. Some time the while will end :-) */ offset++; break; } col_set_fence(pinfo->cinfo, COL_INFO); } /* If the padding bit is set, the last octet of the * packet contains the length of the padding * We only have to check for this at the end of the LAST RTCP message */ if ( padding_set ) { guint padding_length; /* The last RTCP message in the packet has padding - find it. * * The padding count is found at an offset of padding_offset; it * contains the number of padding octets, including the padding * count itself. */ padding_length = tvb_get_guint8( tvb, padding_offset); /* This length includes the padding length byte itself, so 0 is not * a valid value. */ if (padding_length != 0) { proto_tree_add_item( rtcp_tree, hf_rtcp_padding_data, tvb, offset, padding_length - 1, ENC_NA ); offset += padding_length - 1; } proto_tree_add_item( rtcp_tree, hf_rtcp_padding_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } /* If the payload was encrypted, the main payload was not dissected. */ if (srtcp_encrypted == TRUE) { /* If we don't have srtcp_info we cant calculate the length */ if (srtcp_info) { proto_tree_add_expert(rtcp_tree, pinfo, &ei_srtcp_encrypted_payload, tvb, offset, srtcp_offset - offset); proto_tree_add_item(rtcp_tree, hf_srtcp_e, tvb, srtcp_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_uint(rtcp_tree, hf_srtcp_index, tvb, srtcp_offset, 4, srtcp_index); srtcp_offset += 4; if (srtcp_info->mki_len) { proto_tree_add_item(rtcp_tree, hf_srtcp_mki, tvb, srtcp_offset, srtcp_info->mki_len, ENC_NA); srtcp_offset += srtcp_info->mki_len; } if (srtcp_info->auth_tag_len) { proto_tree_add_item(rtcp_tree, hf_srtcp_auth_tag, tvb, srtcp_offset, srtcp_info->auth_tag_len, ENC_NA); /*srtcp_offset += srtcp_info->auth_tag_len;*/ } } else { proto_tree_add_expert(rtcp_tree, pinfo, &ei_srtcp_encrypted_payload, tvb, offset, -1); } } /* offset should be total_packet_length by now... */ else if (offset == total_packet_length) { ti = proto_tree_add_boolean_format_value(rtcp_tree, hf_rtcp_length_check, tvb, 0, 0, TRUE, "OK - %u bytes", offset); /* Hidden might be less annoying here...? */ proto_item_set_generated(ti); } else { ti = proto_tree_add_boolean_format_value(rtcp_tree, hf_rtcp_length_check, tvb, 0, 0, FALSE, "Wrong (expected %u bytes, found %d)", total_packet_length, offset); proto_item_set_generated(ti); expert_add_info_format(pinfo, ti, &ei_rtcp_length_check, "Incorrect RTCP packet length information (expected %u bytes, found %d)", total_packet_length, offset); } return tvb_captured_length(tvb); } static int dissect_srtcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data) { return dissect_rtcp_common(tvb, pinfo, tree, data, TRUE); } static int dissect_rtcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data) { return dissect_rtcp_common(tvb, pinfo, tree, data, FALSE); } void proto_register_rtcp(void) { static hf_register_info hf[] = { { &hf_rtcp_version, { "Version", "rtcp.version", FT_UINT8, BASE_DEC, VALS(rtcp_version_vals), 0xC0, NULL, HFILL } }, { &hf_rtcp_padding, { "Padding", "rtcp.padding", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_rtcp_rc, { "Reception report count", "rtcp.rc", FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL } }, { &hf_rtcp_sc, { "Source count", "rtcp.sc", FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL } }, { &hf_rtcp_pt, { "Packet type", "rtcp.pt", FT_UINT8, BASE_DEC, VALS( rtcp_packet_type_vals ), 0x0, NULL, HFILL } }, { &hf_rtcp_length, { "Length", "rtcp.length", FT_UINT16, BASE_DEC, NULL, 0x0, "32-bit words (-1) in packet", HFILL } }, { &hf_rtcp_ssrc_sender, { "Sender SSRC", "rtcp.senderssrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_media_source, { "Media source SSRC", "rtcp.mediassrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ntp_msw, { "Timestamp, MSW", "rtcp.timestamp.ntp.msw", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ntp_lsw, { "Timestamp, LSW", "rtcp.timestamp.ntp.lsw", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ntp, { "MSW and LSW as NTP timestamp", "rtcp.timestamp.ntp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_timebase_indicator, { "Timebase Indicator", "rtcp.timebase_indicator", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_identity, { "Identity", "rtcp.identity", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_stream_id, { "Stream id", "rtcp.stream_id", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_as_timestamp, { "AS timestamp", "rtcp.timestamp.as", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtp_timestamp, { "RTP timestamp", "rtcp.timestamp.rtp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_sender_pkt_cnt, { "Sender's packet count", "rtcp.sender.packetcount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_sender_oct_cnt, { "Sender's octet count", "rtcp.sender.octetcount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_source, { "Identifier", "rtcp.ssrc.identifier", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_fraction, { "Fraction lost", "rtcp.ssrc.fraction", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_cum_nr, { "Cumulative number of packets lost", "rtcp.ssrc.cum_nr", FT_INT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_ext_high_seq, { "Extended highest sequence number received", "rtcp.ssrc.ext_high", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_high_seq, { "Highest sequence number received", "rtcp.ssrc.high_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_high_cycles, { "Sequence number cycles count", "rtcp.ssrc.high_cycles", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_jitter, { "Interarrival jitter", "rtcp.ssrc.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_lsr, { "Last SR timestamp", "rtcp.ssrc.lsr", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_ssrc_dlsr, { "Delay since last SR timestamp", "rtcp.ssrc.dlsr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_rtcp_ssrc_csrc, { "SSRC / CSRC identifier", "rtcp.sdes.ssrc_csrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_rtcp_sdes_type, { "Type", "rtcp.sdes.type", FT_UINT8, BASE_DEC, VALS( rtcp_sdes_type_vals ), 0x0, NULL, HFILL } }, { &hf_rtcp_sdes_length, { "Length", "rtcp.sdes.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_sdes_text, { "Text", "rtcp.sdes.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_sdes_prefix_len, { "Prefix length", "rtcp.sdes.prefix.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_sdes_prefix_string, { "Prefix string", "rtcp.sdes.prefix.string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_subtype, { "Subtype", "rtcp.app.subtype", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, { &hf_rtcp_name_ascii, { "Name (ASCII)", "rtcp.app.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_data, { "Application specific data", "rtcp.app.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_data_str, { "Application specific data", "rtcp.app.data_str", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1, { "PoC1 Application specific data", "rtcp.app.poc1", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_sip_uri, { "SIP URI", "rtcp.app.poc1.sip.uri", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_disp_name, { "Display Name", "rtcp.app.poc1.disp.name", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_priority, { "Priority", "rtcp.app.poc1.priority", FT_UINT16, BASE_DEC, VALS(rtcp_app_poc1_qsresp_priority_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_request_ts, { "Talk Burst Request Timestamp", "rtcp.app.poc1.request.ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_stt, { "Stop talking timer", "rtcp.app.poc1.stt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_partic, { "Number of participants", "rtcp.app.poc1.participants", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_ssrc_granted, { "SSRC of client granted permission to talk", "rtcp.app.poc1.ssrc.granted", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_last_pkt_seq_no, { "Sequence number of last RTP packet", "rtcp.app.poc1.last.pkt.seq.no", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_ignore_seq_no, { "Ignore sequence number field", "rtcp.app.poc1.ignore.seq.no", FT_UINT16, BASE_HEX, NULL, 0x8000, NULL, HFILL } }, { &hf_rtcp_app_poc1_reason_code1, { "Reason code", "rtcp.app.poc1.reason.code", FT_UINT8, BASE_DEC, VALS(rtcp_app_poc1_reason_code1_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_reason1_phrase, { "Reason Phrase", "rtcp.app.poc1.reason.phrase", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_reason_code2, { "Reason code", "rtcp.app.poc1.reason.code", FT_UINT16, BASE_DEC, VALS(rtcp_app_poc1_reason_code2_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_new_time_request, { "New time client can request (seconds)", "rtcp.app.poc1.new.time.request", FT_UINT16, BASE_DEC, NULL, 0x0, "Time in seconds client can request for", HFILL } }, { &hf_rtcp_app_poc1_ack_subtype, { "Subtype", "rtcp.app.poc1.ack.subtype", FT_UINT8, BASE_DEC, VALS(rtcp_app_poc1_floor_cnt_type_vals), 0xf8, NULL, HFILL } }, { &hf_rtcp_app_poc1_ack_reason_code, { "Reason code", "rtcp.app.poc1.ack.reason.code", FT_UINT16, BASE_DEC, VALS(rtcp_app_poc1_reason_code_ack_vals), 0x07ff, NULL, HFILL } }, { &hf_rtcp_app_poc1_qsresp_priority, { "Priority", "rtcp.app.poc1.qsresp.priority", FT_UINT8, BASE_DEC, VALS(rtcp_app_poc1_qsresp_priority_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_qsresp_position, { "Position (number of clients ahead)", "rtcp.app.poc1.qsresp.position", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_content[0], { "Identity of inviting client", "rtcp.app.poc1.conn.content.a.id", FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_content[1], { "Nick name of inviting client", "rtcp.app.poc1.conn.content.a.dn", FT_BOOLEAN, 16, NULL, 0x4000, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_content[2], { "Session identity", "rtcp.app.poc1.conn.content.sess.id", FT_BOOLEAN, 16, NULL, 0x2000, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_content[3], { "Group name", "rtcp.app.poc1.conn.content.grp.dn", FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_content[4], { "Group identity", "rtcp.app.poc1.conn.content.grp.id", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_session_type, { "Session type", "rtcp.app.poc1.conn.session.type", FT_UINT8, BASE_DEC, VALS(rtcp_app_poc1_conn_sess_type_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_add_ind_mao, { "Manual answer override", "rtcp.app.poc1.conn.add.ind.mao", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_sdes_items[0], { "Identity of inviting client", "rtcp.app.poc1.conn.sdes.a.id", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_sdes_items[1], { "Nick name of inviting client", "rtcp.app.poc1.conn.sdes.a.dn", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_sdes_items[2], { "Session identity", "rtcp.app.poc1.conn.sdes.sess.id", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_sdes_items[3], { "Group Name", "rtcp.app.poc1.conn.sdes.grp.dn", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_poc1_conn_sdes_items[4], { "Group identity", "rtcp.app.poc1.conn.sdes.grp.id", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_mux, { "RtpMux Application specific data", "rtcp.app.mux", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_mux_mux, { "Multiplexing supported", "rtcp.app.mux.mux", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtcp_app_mux_cp, { "Header compression supported", "rtcp.app.mux.cp", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_rtcp_app_mux_selection, { "Multiplexing selection", "rtcp.app.mux.selection", FT_UINT8, BASE_DEC, VALS(rtcp_app_mux_selection_vals), 0x30, NULL, HFILL } }, { &hf_rtcp_app_mux_localmuxport, { "Local Mux Port", "rtcp.app.mux.muxport", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_fsn, { "First sequence number", "rtcp.nack.fsn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_blp, { "Bitmask of following lost packets", "rtcp.nack.blp", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_padding_count, { "Padding count", "rtcp.padding.count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_padding_data, { "Padding data", "rtcp.padding.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_profile_specific_extension_type, { "Extension Type", "rtcp.profile-specific-extension.type", FT_UINT16, BASE_DEC, VALS( rtcp_ms_profile_extension_vals ), 0x0, NULL, HFILL } }, { &hf_rtcp_profile_specific_extension_length, { "Extension Length", "rtcp.profile-specific-extension.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_profile_specific_extension, { "Profile-specific extension", "rtcp.profile-specific-extension", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_setup, { "Stream setup", "rtcp.setup", FT_STRING, BASE_NONE, NULL, 0x0, "Stream setup, method and frame number", HFILL } }, { &hf_rtcp_setup_frame, { "Setup frame", "rtcp.setup-frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Frame that set up this stream", HFILL } }, { &hf_rtcp_setup_method, { "Setup Method", "rtcp.setup-method", FT_STRING, BASE_NONE, NULL, 0x0, "Method used to set up this stream", HFILL } }, { &hf_rtcp_last_sr_timestamp_frame, { "Frame matching Last SR timestamp", "rtcp.lsr-frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Frame matching LSR field (used to calculate roundtrip delay)", HFILL } }, { &hf_rtcp_time_since_last_sr, { "Time since Last SR captured", "rtcp.lsr-frame-captured", FT_UINT32, BASE_DEC, NULL, 0x0, "Time since frame matching LSR field was captured", HFILL } }, { &hf_rtcp_roundtrip_delay, { "Roundtrip Delay(ms)", "rtcp.roundtrip-delay", FT_INT32, BASE_DEC, NULL, 0x0, "Calculated roundtrip delay in ms", HFILL } }, { &hf_rtcp_xr_block_type, { "Type", "rtcp.xr.bt", FT_UINT8, BASE_DEC, VALS(rtcp_xr_type_vals), 0x0, "Block Type", HFILL } }, { &hf_rtcp_xr_block_specific, { "Type Specific", "rtcp.xr.bs", FT_UINT8, BASE_DEC, NULL, 0x0, "Reserved", HFILL } }, { &hf_rtcp_xr_block_length, { "Length", "rtcp.xr.bl", FT_UINT16, BASE_DEC, NULL, 0x0, "Block Length", HFILL } }, { &hf_rtcp_ssrc_discarded, { "Fraction discarded", "rtcp.ssrc.discarded", FT_UINT8, BASE_DEC, NULL, 0x0, "Discard Rate", HFILL } }, { &hf_rtcp_xr_voip_metrics_burst_density, { "Burst Density", "rtcp.xr.voipmetrics.burstdensity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_gap_density, { "Gap Density", "rtcp.xr.voipmetrics.gapdensity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_burst_duration, { "Burst Duration(ms)", "rtcp.xr.voipmetrics.burstduration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_gap_duration, { "Gap Duration(ms)", "rtcp.xr.voipmetrics.gapduration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_rtdelay, { "Round Trip Delay(ms)", "rtcp.xr.voipmetrics.rtdelay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_esdelay, { "End System Delay(ms)", "rtcp.xr.voipmetrics.esdelay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_siglevel, { "Signal Level", "rtcp.xr.voipmetrics.signallevel", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_noiselevel, { "Noise Level", "rtcp.xr.voipmetrics.noiselevel", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_rerl, { "Residual Echo Return Loss", "rtcp.xr.voipmetrics.rerl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_gmin, { "Gmin", "rtcp.xr.voipmetrics.gmin", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_rfactor, { "R Factor", "rtcp.xr.voipmetrics.rfactor", FT_UINT8, BASE_DEC, NULL, 0x0, "R Factor is in the range of 0 to 100", HFILL } }, { &hf_rtcp_xr_voip_metrics_extrfactor, { "External R Factor", "rtcp.xr.voipmetrics.extrfactor", FT_UINT8, BASE_DEC, NULL, 0x0, "R Factor is in the range of 0 to 100", HFILL } }, { &hf_rtcp_xr_voip_metrics_moslq, { "MOS - Listening Quality", "rtcp.xr.voipmetrics.moslq", FT_FLOAT, BASE_NONE, NULL, 0x0, "MOS is in the range of 1 to 5", HFILL } }, { &hf_rtcp_xr_voip_metrics_moscq, { "MOS - Conversational Quality", "rtcp.xr.voipmetrics.moscq", FT_FLOAT, BASE_NONE, NULL, 0x0, "MOS is in the range of 1 to 5", HFILL } }, { &hf_rtcp_xr_voip_metrics_plc, { "Packet Loss Concealment Algorithm", "rtcp.xr.voipmetrics.plc", FT_UINT8, BASE_DEC, VALS(rtcp_xr_plc_algo_vals), 0xC0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_jbadaptive, { "Adaptive Jitter Buffer Algorithm", "rtcp.xr.voipmetrics.jba", FT_UINT8, BASE_DEC, VALS(rtcp_xr_jb_adaptive_vals), 0x30, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_jbrate, { "Jitter Buffer Rate", "rtcp.xr.voipmetrics.jbrate", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_jbnominal, { "Nominal Jitter Buffer Size", "rtcp.xr.voipmetrics.jbnominal", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_jbmax, { "Maximum Jitter Buffer Size", "rtcp.xr.voipmetrics.jbmax", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_voip_metrics_jbabsmax, { "Absolute Maximum Jitter Buffer Size", "rtcp.xr.voipmetrics.jbabsmax", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_thinning, { "Thinning factor", "rtcp.xr.tf", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_rtcp_xr_stats_loss_flag, { "Loss Report Flag", "rtcp.xr.stats.lrflag", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtcp_xr_stats_dup_flag, { "Duplicates Report Flag", "rtcp.xr.stats.dupflag", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_rtcp_xr_stats_jitter_flag, { "Jitter Report Flag", "rtcp.xr.stats.jitterflag", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_rtcp_xr_stats_ttl, { "TTL or Hop Limit Flag", "rtcp.xr.stats.ttl", FT_UINT8, BASE_DEC, VALS(rtcp_xr_ip_ttl_vals), 0x18, NULL, HFILL } }, { &hf_rtcp_xr_endseq, { "End Sequence Number", "rtcp.xr.endseq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_chunk_null_terminator, { "Null Terminator", "rtcp.xr.chunk.null_terminator", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_chunk_length, { "Check length", "rtcp.xr.chunk.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_chunk_bit_vector, { "Bit Vector", "rtcp.xr.chunk.bit_vector", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_beginseq, { "Begin Sequence Number", "rtcp.xr.beginseq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_receipt_time_seq, { "Receipt Time", "rtcp.xr.receipt_time_seq", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_lost, { "Lost Packets", "rtcp.xr.stats.lost", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_dups, { "Duplicate Packets", "rtcp.xr.stats.dups", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_minjitter, { "Minimum Jitter", "rtcp.xr.stats.minjitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_maxjitter, { "Maximum Jitter", "rtcp.xr.stats.maxjitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_meanjitter, { "Mean Jitter", "rtcp.xr.stats.meanjitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_devjitter, { "Standard Deviation of Jitter", "rtcp.xr.stats.devjitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_minttl, { "Minimum TTL or Hop Limit", "rtcp.xr.stats.minttl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_maxttl, { "Maximum TTL or Hop Limit", "rtcp.xr.stats.maxttl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_meanttl, { "Mean TTL or Hop Limit", "rtcp.xr.stats.meanttl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_stats_devttl, { "Standard Deviation of TTL", "rtcp.xr.stats.devttl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_timestamp, { "Timestamp", "rtcp.xr.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_lrr, { "Last RR timestamp", "rtcp.xr.lrr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_dlrr, { "Delay since last RR timestamp", "rtcp.xr.dlrr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_length_check, { "RTCP frame length check", "rtcp.length_check", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_fmt, { "RTCP Feedback message type (FMT)", "rtcp.rtpfb.fmt", FT_UINT8, BASE_DEC, VALS(rtcp_rtpfb_fmt_vals), 0x1f, NULL, HFILL } }, { &hf_rtcp_psfb_fmt, { "RTCP Feedback message type (FMT)", "rtcp.psfb.fmt", FT_UINT8, BASE_DEC, VALS(rtcp_psfb_fmt_vals), 0x1f, NULL, HFILL } }, { &hf_rtcp_rtpfb_nack_pid, { "RTCP Transport Feedback NACK PID", "rtcp.rtpfb.nack_pid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_nack_blp, { "RTCP Transport Feedback NACK BLP", "rtcp.rtpfb.nack_blp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_fci, { "Feedback Control Information (FCI)", "rtcp.fci", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_spst, { "Synchronization Packet Sender Type", "rtcp.xr.idms.spst", FT_UINT8, BASE_DEC, VALS(rtcp_xr_idms_spst), 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_pt, { "Payload Type", "rtcp.xr.idms.pt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_msci, { "Media Stream Correlation Identifier", "rtcp.xr.idms.msci", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_source_ssrc, { "Source SSRC", "rtcp.xr.idms.source_ssrc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_ntp_rcv_ts, { "NTP Timestamp of packet reception", "rtcp.xr.idms.ntp_rcv_ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_rtp_ts, { "RTP Timestamp of packet", "rtcp.xr.idms.rtp_ts", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_idms_ntp_pres_ts, { "NTP Timestamp of presentation", "rtcp.xr.idms.ntp_pres_ts", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_fir_fci_ssrc, { "SSRC", "rtcp.psfb.fir.fci.ssrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_fir_fci_csn, { "Command Sequence Number", "rtcp.psfb.fir.fci.csn", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_fir_fci_reserved, { "Reserved", "rtcp.psfb.fir.fci.reserved", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_sli_first, { "First MB", "rtcp.psfb.fir.sli.first", FT_UINT32, BASE_DEC, NULL, 0xFFF80000, NULL, HFILL } }, { &hf_rtcp_psfb_sli_number, { "Number of MBs", "rtcp.psfb.fir.sli.number", FT_UINT32, BASE_DEC, NULL, 0x0007FFC0, NULL, HFILL } }, { &hf_rtcp_psfb_sli_picture_id, { "Picture ID", "rtcp.psfb.fir.sli.picture_id", FT_UINT32, BASE_DEC, NULL, 0x0000003F, NULL, HFILL } }, { &hf_rtcp_psfb_remb_fci_identifier, { "Unique Identifier", "rtcp.psfb.remb.identifier", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_remb_fci_ssrc, { "SSRC", "rtcp.psfb.remb.fci.ssrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_remb_fci_number_ssrcs, { "Number of Ssrcs", "rtcp.psfb.remb.fci.number_ssrcs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_remb_fci_exp, { "BR Exp", "rtcp.psfb.remb.fci.br_exp", FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL } }, { &hf_rtcp_psfb_remb_fci_mantissa, { "Br Mantissa", "rtcp.psfb.remb.fci.br_mantissa", FT_UINT32, BASE_DEC, NULL, 0x03ffff, NULL, HFILL } }, { &hf_rtcp_psfb_remb_fci_bitrate, { "Maximum bit rate", "rtcp.psfb.remb.fci.bitrate", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_tmbbr_fci_ssrc, { "SSRC", "rtcp.rtpfb.tmmbr.fci.ssrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_tmbbr_fci_exp, { "MxTBR Exp", "rtcp.rtpfb.tmmbr.fci.exp", FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL } }, { &hf_rtcp_rtpfb_tmbbr_fci_mantissa, { "MxTBR Mantissa", "rtcp.rtpfb.tmmbr.fci.mantissa", FT_UINT24, BASE_DEC, NULL, 0x03fffe, NULL, HFILL } }, { &hf_rtcp_rtpfb_tmbbr_fci_bitrate, { "Maximum total media bit rate", "rtcp.rtpfb.tmmbr.fci.bitrate", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_tmbbr_fci_measuredoverhead, { "Measured Overhead", "rtcp.rtpfb.tmmbr.fci.measuredoverhead", FT_UINT16, BASE_DEC, NULL, 0x01ff, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_base_seq, { "Base Sequence Number", "rtcp.rtpfb.transportcc.baseseq", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_pkt_stats_cnt, { "Packet Status Count", "rtcp.rtpfb.transportcc.statuscount", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_ref_time, { "Reference Time", "rtcp.rtpfb.transportcc.reftime", FT_INT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_fb_pkt_cnt, { "Feedback Packets Count", "rtcp.rtpfb.transportcc.pktcount", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_pkt_chunk, { "Packet Chunk", "rtcp.rtpfb.transportcc.pktchunk", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_recv_delta_1_byte, { "Recv Delta", "rtcp.rtpfb.transportcc.recv_delta", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_recv_delta_2_bytes, { "Recv Delta", "rtcp.rtpfb.transportcc.recv_delta", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_rtpfb_transport_cc_fci_recv_delta_padding, { "Recv Delta Padding", "rtcp.rtpfb.transportcc.recv_delta.padding", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_srtcp_e, { "SRTCP E flag", "srtcp.e", FT_BOOLEAN, 32, NULL, 0x80000000, "SRTCP Encryption Flag", HFILL } }, { &hf_srtcp_index, { "SRTCP Index", "srtcp.index", FT_UINT32, BASE_DEC_HEX, NULL, 0x7fffffff, NULL, HFILL } }, { &hf_srtcp_mki, { "SRTCP MKI", "srtcp.mki", FT_BYTES, BASE_NONE, NULL, 0, "SRTCP Master Key Index", HFILL } }, { &hf_srtcp_auth_tag, { "SRTCP Auth Tag", "srtcp.auth_tag", FT_BYTES, BASE_NONE, NULL, 0, "SRTCP Authentication Tag", HFILL } }, /* additions for BT XNQ block as defined in RFC5093 */ { &hf_rtcp_xr_btxnq_begseq, { "Starting sequence number", "rtcp.xr.btxnq.begseq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_endseq, { "Last sequence number", "rtcp.xr.btxnq.endseq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_vmaxdiff, { "Maximum IPDV difference in 1 cycle", "rtcp.xr.btxnq.vmaxdiff", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_vrange, { "Maximum IPDV difference seen to date", "rtcp.xr.btxnq.vrange", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_vsum, { "Sum of peak IPDV differences to date", "rtcp.xr.btxnq.vsum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_cycles, { "Number of cycles in calculation", "rtcp.xr.btxnq.cycles", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_jbevents, { "Number of jitter buffer adaptations to date", "rtcp.xr.btxnq.jbevents", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_spare, { "Spare/reserved bits", "rtcp.xr.btxnq.spare", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_tdegnet, { "Time degraded by packet loss or late delivery", "rtcp.xr.btxnq.tdegnet", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_tdegjit, { "Time degraded by jitter buffer adaptation events", "rtcp.xr.btxnq.tdegjit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_es, { "ES due to unavailable packet events", "rtcp.xr.btxnq.es", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_xr_btxnq_ses, { "SES due to unavailable packet events", "rtcp.xr.btxnq.ses", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* MS Profile Specific Extension Fields */ { &hf_rtcp_pse_ms_bandwidth, { "Bandwidth", "rtcp.ms_pse.bandwidth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_confidence_level, { "Confidence Level", "rtcp.ms_pse.confidence_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_seq_num, { "Sequence Number", "rtcp.ms_pse.seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_frame_resolution_width, { "Frame Resolution Width", "rtcp.ms_pse.frame_res_width", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_frame_resolution_height, { "Frame Resolution Height", "rtcp.ms_pse.frame_res_height", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_bitrate, { "Bitrate", "rtcp.ms_pse.bitrate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_frame_rate, { "Frame Rate", "rtcp.ms_pse.frame_rate", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_concealed_frames, { "Concealed Frames", "rtcp.ms_pse.concealed_frames", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_stretched_frames, { "Stretched Frames", "rtcp.ms_pse.stretched_frames", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_compressed_frames, { "Compressed Frames", "rtcp.ms_pse.compressed_frames", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_total_frames, { "Total Frames", "rtcp.ms_pse.total_frames", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_receive_quality_state, { "Received Quality State", "rtcp.ms_pse.receive_quality_state", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_fec_distance_request, { "FEC Distance Request", "rtcp.ms_pse.fec_distance_request", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_last_packet_train, { "Last Packet Train Flag", "rtcp.ms_pse.last_packet_train", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtcp_pse_ms_packet_idx, { "Packet Index", "rtcp.ms_pse.packet_index", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtcp_pse_ms_packet_cnt, { "Packet Count", "rtcp.ms_pse.packet_count", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtcp_pse_ms_packet_train_byte_cnt, { "Packet Train Byte Count", "rtcp.ms_pse.packet_train_byte_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_inbound_bandwidth, { "Inbound Link Bandwidth", "rtcp.ms_pse.inbound_bandwidth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_outbound_bandwidth, { "Outbound Link Bandwidth", "rtcp.ms_pse.outbound_bandwidth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_no_cache, { "No Cache Flag", "rtcp.ms_pse.no_cache", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtcp_pse_ms_congestion_info, { "Congestion Information", "rtcp.ms_pse.congestion_info", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_pse_ms_modality, { "Modality", "rtcp.ms_pse.modality", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Microsoft PLI */ { &hf_rtcp_psfb_pli_ms_request_id, { "Request ID", "rtcp.psfb.ms.pli.request_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_pli_ms_sfr, { "Sync Frame Request", "rtcp.psfb.ms.pli.sync_frame_request", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Microsoft Application Feedback Video Source Request */ { &hf_rtcp_psfb_ms_type, { "Application Layer Feedback Type", "rtcp.psfb.ms.afb_type", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_length, { "Length", "rtcp.psfb.ms.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_msi, { "Requested Media Source ID (MSI)", "rtcp.psfb.ms.msi", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsr_request_id, { "Request Id", "rtcp.psfb.ms.vsr.request_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsr_version, { "Version", "rtcp.psfb.ms.vsr.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsr_key_frame_request, { "Key Frame Request", "rtcp.psfb.ms.vsr.key_frame_request", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsr_num_entries, { "Number of Entries", "rtcp.psfb.ms.vsr.num_entries", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsr_entry_length, { "Entry Length", "rtcp.psfb.ms.vsr.entry_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_payload_type, { "Payload Type", "rtcp.psfb.ms.vsr.entry.payload_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_ucconfig_mode, { "UCConfig Mode", "rtcp.psfb.ms.vsr.entry.ucconfig_mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_no_sp_frames, { "No support for SP Frames (RT only)", "rtcp.psfb.ms.vsr.entry.no_sp_frames", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_baseline, { "Only Supports Constrained Baseline (H.264 only)", "rtcp.psfb.ms.vsr.entry.no_sp_baseline", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_cgs, { "Supports CGS rewrite (H.264 only)", "rtcp.psfb.ms.vsr.entry.cgs", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_bitmask, { "Aspect Ratio Bitmask", "rtcp.psfb.ms.vsr.entry.aspect_ratio", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_4by3, { "Aspect Ratio 4 by 3", "rtcp.psfb.ms.vsr.entry.aspect_ratio_4by3", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_16by9, { "Aspect Ratio 16 by 9", "rtcp.psfb.ms.vsr.entry.aspect_ratio_16by9", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_1by1, { "Aspect Ratio 1 by 1", "rtcp.psfb.ms.vsr.entry.aspect_ratio_1by1", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_3by4, { "Aspect Ratio 3 by 4", "rtcp.psfb.ms.vsr.entry.aspect_ratio_3by4", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_9by16, { "Aspect Ratio 9 by 16", "rtcp.psfb.ms.vsr.entry.aspect_ratio_9by16", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_aspect_ratio_20by3, { "Aspect Ratio 20 by 3", "rtcp.psfb.ms.vsr.entry.aspect_ratio_20by3", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_max_width, { "Max Width", "rtcp.psfb.ms.vsr.entry.max_width", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_max_height, { "Max Height", "rtcp.psfb.ms.vsr.entry.max_height", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_min_bitrate, { "Min bit rate", "rtcp.psfb.ms.vsr.entry.min_bitrate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_bitrate_per_level, { "Bit rate per level", "rtcp.psfb.ms.vsr.entry.bitrate_per_level", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_bitrate_histogram, { "Receiver Count", "rtcp.psfb.ms.vsr.entry.bitrate_histogram", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_mask, { "Frame rate mask", "rtcp.psfb.ms.vsr.entry.frame_rate_mask", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_7_5, { "7.5 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_7_5", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_12_5, { "12.5 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_12_5", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_15, { "15 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_15", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_25, { "25 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_25", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_30, { "30 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_30", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_50, { "50 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_50", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_frame_rate_60, { "60 fps", "rtcp.psfb.ms.vsr.entry.frame_rate_60", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_must_instances, { "Number of MUST instances", "rtcp.psfb.ms.vsr.entry.musts", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_may_instances, { "Number of MAY instances", "rtcp.psfb.ms.vsr.entry.mays", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_quality_histogram, { "Receiver Count", "rtcp.psfb.ms.vsr.entry.quality_histogram", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_psfb_ms_vsre_max_pixels, { "Max Pixels per Frame", "rtcp.psfb.ms.vsr.entry.max_pixels", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rtcp_mcptt_fld_id, { "Field Id", "rtcp.mcptt.fld_id", FT_UINT32, BASE_DEC, VALS(rtcp_mcpt_field_id_vals), 0x0, NULL, HFILL } }, {&hf_rtcp_mcptt_fld_len, { "Length", "rtcp.mcptt.fld_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_fld_val, { "Field value", "rtcp.mcptt.fld_val", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_granted_partys_id, { "Granted Party's Identity", "rtcp.mcptt.granted_partys_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_app_data_padding, { "Padding", "rtcp.app_data.padding", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_priority, { "Floor Priority", "rtcp.app_data.mcptt.priority", FT_UINT16, BASE_DEC, NULL, 0xff00, NULL, HFILL } }, { &hf_rtcp_mcptt_user_id, { "User ID", "rtcp.app_data.mcptt.user_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_duration, { "Duration", "rtcp.app_data.mcptt.duration", FT_UINT16, BASE_DEC | BASE_UNIT_STRING,& units_second_seconds, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_floor_ind, { "Floor Indicator", "rtcp.app_data.mcptt.floor_ind", FT_UINT16, BASE_DEC, VALS(mcptt_floor_ind_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_rej_cause, { "Reject Cause", "rtcp.app_data.mcptt.rej_cause", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_rej_cause_floor_deny, { "Reject Cause", "rtcp.app_data.mcptt.rej_cause.floor_deny", FT_UINT16, BASE_DEC, VALS(rtcp_mcptt_rej_cause_floor_deny_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_rej_cause_floor_revoke, { "Reject Cause", "rtcp.app_data.mcptt.rej_cause.floor_revoke", FT_UINT16, BASE_DEC, VALS(rtcp_mcptt_rej_cause_floor_revoke_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_rej_phrase, { "Reject Phrase", "rtcp.mcptt.rej_phrase", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_queue_pos_inf, { "Queue Position Info", "rtcp.app_data.mcptt.queue_pos_inf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_queue_pri_lev, { "Queue Priority Level", "rtcp.app_data.mcptt.queue_pri_lev", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_perm_to_req_floor, { "Permission to Request the Floor", "rtcp.app_data.mcptt.perm_to_req_floor", FT_UINT16, BASE_DEC, VALS(rtcp_mcptt_perm_to_req_floor_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_queue_size, { "Queue Size", "rtcp.app_data.mcptt.queue_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_msg_seq_num, { "Message Sequence Number", "rtcp.app_data.mcptt.msg_seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_queued_user_id, { "Queued User ID", "rtcp.mcptt.queued_user_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_source, { "Source", "rtcp.app_data.mcptt.source", FT_UINT16, BASE_DEC, VALS(rtcp_mcptt_source_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_queueing_cap, { "Queueing Capability", "rtcp.app_data.mcptt.queueing_cap", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_part_type_len, { "Participant Type Length", "rtcp.app_data.mcptt.part_type_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_participant_type, { "Participant Type", "rtcp.mcptt.participant_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_participant_ref, { "Floor Participant Reference", "rtcp.app_data.mcptt.floor_participant_ref", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_ssrc, { "SSRC", "rtcp.app_data.mcptt.rtcp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_num_users, { "Number of users", "rtcp.app_data.mcptt.num_users", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_user_id_len, { "User ID length", "rtcp.app_data.mcptt.user_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_spare16, { "Spare", "rtcp.spare16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_num_ssrc, { "Number of SSRC", "rtcp.app_data.mcptt.num_ssrc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_func_alias, { "Functional Alias", "rtcp.mcptt.func_alias", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_fa_len, { "Functional Alias length", "rtcp.app_data.mcptt.fa_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_num_fas, { "Number of Functional Alias", "rtcp.app_data.mcptt.num_fa", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_loc_type, { "Location Type", "rtcp.app_data.mcptt.loc_type", FT_UINT8, BASE_DEC, VALS(rtcp_mcptt_loc_type_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_cellid, {"CellId", "rtcp.app_data.mcptt.cellid", FT_UINT32, BASE_DEC, NULL, 0xFF, NULL, HFILL} }, { &hf_rtcp_mcptt_enodebid, { "eNodeB Id", "rtcp.app_data.mcptt.enodebid", FT_UINT32, BASE_DEC, NULL, 0x0FFFFF00, NULL, HFILL } }, { &hf_rtcp_mcptt_ecgi_eci, {"ECI (E-UTRAN Cell Identifier)", "rtcp.app_data.mcptt.ecgi_eci", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_rtcp_mcptt_tac, { "Tracking Area Code", "rtcp.app_data.mcptt.tac", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_mbms_serv_area, { "MBMS Service Area", "rtcp.app_data.mcptt.mbms_serv_area", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_mbsfn_area_id, { "MBSFN Area ID", "rtcp.app_data.mcptt.mbsfn_area_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_lat, { "Latitude value", "rtcp.app_data.mcptt.lat", FT_INT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_long, { "Longitude value", "rtcp.app_data.mcptt.long", FT_INT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_msg_type, { "Message Type", "rtcp.app_data.mcptt.msg_type", FT_UINT8, BASE_DEC, VALS(rtcp_mcpt_subtype_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_num_loc, { "Number of Locations", "rtcp.app_data.mcptt.num_loc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_str, { "String", "rtcp.app_data.mcptt.str", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_len, { "Length", "rtcp.app_data.mccp.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_field_id, { "Field id", "rtcp.app_data.mccp.field_id", FT_UINT8, BASE_DEC, VALS(rtcp_mccp_field_id_vals), 0x0, NULL, HFILL } }, { &hf_rtcp_mcptt_group_id, { "MCPTT Group Identity", "rtcp.app_data.mccp.mcptt_grp_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_audio_m_line_no, { "Audio m-line Number", "rtcp.app_data.mccp.audio_m_line_no", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL } }, { &hf_rtcp_mccp_floor_m_line_no, { "Floor m-line Number", "rtcp.app_data.mccp.floor_m_line_no", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL } }, { &hf_rtcp_mccp_ip_version, { "IP version", "rtcp.app_data.mccp.ip_version", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL } }, { &hf_rtcp_mccp_floor_port_no, { "Floor Port Number", "rtcp.app_data.mccp.floor_port_no", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_media_port_no, { "Media Port Number", "rtcp.app_data.mccp.media_port_no", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_ipv4, { "IP Address", "rtcp.app_data.mccp.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_ipv6, { "IP Address", "rtcp.app_data.mccp.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_mccp_tmgi, { "TMGI", "rtcp.app_data.mccp.tmgi", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtcp_encrypted, { "Encrypted data", "rtcp.encrypted", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_rtcp, &ett_rtcp_sr, &ett_rtcp_rr, &ett_rtcp_sdes, &ett_rtcp_bye, &ett_rtcp_app, &ett_rtcp_rtpfb, &ett_rtcp_psfb, &ett_rtcp_xr, &ett_rtcp_fir, &ett_rtcp_nack, &ett_ssrc, &ett_ssrc_item, &ett_ssrc_ext_high, &ett_sdes, &ett_sdes_item, &ett_PoC1, &ett_mux, &ett_rtcp_setup, &ett_rtcp_roundtrip_delay, &ett_xr_block, &ett_xr_block_contents, &ett_xr_ssrc, &ett_xr_loss_chunk, &ett_poc1_conn_contents, &ett_rtcp_nack_blp, &ett_pse, &ett_ms_vsr, &ett_ms_vsr_entry, &ett_ms_ds, &ett_rtcp_mcpt, &ett_rtcp_mcptt_participant_ref, &ett_rtcp_mcptt_eci, &ett_rtcp_mccp_tmgi }; static ei_register_info ei[] = { { &ei_rtcp_not_final_padding, { "rtcp.not_final_padding", PI_PROTOCOL, PI_WARN, "Padding flag set on not final packet (see RFC3550, section 6.4.1)", EXPFILL }}, { &ei_rtcp_bye_reason_not_padded, { "rtcp.bye_reason_not_padded", PI_MALFORMED, PI_WARN, "Reason string is not NULL padded (see RFC3550, section 6.6)", EXPFILL }}, { &ei_rtcp_xr_block_length_bad, { "rtcp.invalid_block_length", PI_PROTOCOL, PI_WARN, "Invalid block length, should be 2", EXPFILL }}, { &ei_rtcp_roundtrip_delay, { "rtcp.roundtrip-delay.expert", PI_SEQUENCE, PI_NOTE, "RTCP round-trip delay detected (%d ms)", EXPFILL }}, { &ei_rtcp_roundtrip_delay_negative, { "rtcp.roundtrip-delay.negative", PI_SEQUENCE, PI_ERROR, "Negative RTCP round-trip delay detected (%d ms)", EXPFILL }}, { &ei_rtcp_length_check, { "rtcp.length_check.bad", PI_MALFORMED, PI_WARN, "Incorrect RTCP packet length information (expected %u bytes, found %d)", EXPFILL }}, { &ei_rtcp_psfb_ms_type, { "rtcp.psfb.ms.afb_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown Application Layer Feedback Type", EXPFILL }}, { &ei_rtcp_missing_sender_ssrc, { "rtcp.missing_sender_ssrc", PI_PROTOCOL, PI_WARN, "Missing Sender SSRC", EXPFILL }}, { &ei_rtcp_missing_block_header, { "rtcp.missing_block_header", PI_PROTOCOL, PI_WARN, "Missing Required Block Headers", EXPFILL }}, { &ei_rtcp_block_length, { "rtcp.block_length.invalid", PI_PROTOCOL, PI_WARN, "Block length is greater than packet length", EXPFILL }}, { &ei_srtcp_encrypted_payload, { "srtcp.encrypted_payload", PI_UNDECODED, PI_WARN, "Encrypted RTCP Payload - not dissected", EXPFILL }}, { &ei_rtcp_rtpfb_transportcc_bad, { "rtcp.rtpfb.transportcc_bad", PI_MALFORMED, PI_WARN, "Too many packet chunks (more than packet status count)", EXPFILL }}, { &ei_rtcp_mcptt_unknown_fld, { "rtcp.mcptt.unknown_fld", PI_PROTOCOL, PI_WARN, "Unknown field", EXPFILL }}, { &ei_rtcp_mcptt_location_type, { "rtcp.mcptt.location_type_uk", PI_PROTOCOL, PI_WARN, "Unknown location type", EXPFILL }}, { &ei_rtcp_appl_extra_bytes, { "rtcp.appl.extra_bytes", PI_PROTOCOL, PI_ERROR, "Extra bytes detected", EXPFILL }}, { &ei_rtcp_appl_not_ascii, { "rtcp.appl.not_ascii", PI_PROTOCOL, PI_ERROR, "Application name is not a string", EXPFILL }}, { &ei_rtcp_appl_non_conformant, { "rtcp.appl.non_conformant", PI_PROTOCOL, PI_ERROR, "Data not according to standards", EXPFILL }}, { &ei_rtcp_appl_non_zero_pad, { "rtcp.appl.non_zero_pad", PI_PROTOCOL, PI_ERROR, "Non zero padding detected, faulty encoding?", EXPFILL }}, }; module_t *rtcp_module, *srtcp_module; expert_module_t* expert_rtcp; proto_rtcp = proto_register_protocol("Real-time Transport Control Protocol", "RTCP", "rtcp"); proto_srtcp = proto_register_protocol("Secure Real-time Transport Control Protocol", "SRTCP", "srtcp"); proto_register_field_array(proto_rtcp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtcp = expert_register_protocol(proto_rtcp); expert_register_field_array(expert_rtcp, ei, array_length(ei)); rtcp_handle = register_dissector("rtcp", dissect_rtcp, proto_rtcp); srtcp_handle = register_dissector("srtcp", dissect_srtcp, proto_srtcp); rtcp_module = prefs_register_protocol(proto_rtcp, NULL); srtcp_module = prefs_register_protocol(proto_srtcp, NULL); prefs_register_enum_preference(rtcp_module, "default_protocol", "Default protocol", "The default protocol assumed by the heuristic dissector, " "which does not easily distinguish between RTCP and SRTCP.", &global_rtcp_default_protocol, rtcp_default_protocol_vals, FALSE); prefs_register_bool_preference(rtcp_module, "show_setup_info", "Show stream setup information", "Where available, show which protocol and frame caused " "this RTCP stream to be created", &global_rtcp_show_setup_info); prefs_register_obsolete_preference(rtcp_module, "heuristic_rtcp"); prefs_register_bool_preference(rtcp_module, "show_roundtrip_calculation", "Show relative roundtrip calculations", "Try to work out network delay by comparing time between packets " "as captured and delays as seen by endpoint", &global_rtcp_show_roundtrip_calculation); prefs_register_uint_preference(rtcp_module, "roundtrip_min_threshhold", "Minimum roundtrip calculation to report (ms)", "Minimum (absolute) calculated roundtrip delay time in milliseconds that " "should be reported", 10, &global_rtcp_show_roundtrip_calculation_minimum); /* To get the subtype decoded for SRTP packets */ prefs_register_enum_preference(srtcp_module, "decode_application_subtype", "Decode Application subtype as", "Decode the subtype as this application", &preferences_application_specific_encoding, rtcp_application_specific_encoding_vals, FALSE); /* Register table for sub-dissetors */ rtcp_dissector_table = register_dissector_table("rtcp.app.name", "RTCP Application Name", proto_rtcp, FT_STRING, STRING_CASE_SENSITIVE); rtcp_psfb_dissector_table = register_dissector_table("rtcp.psfb.fmt", "RTCP Payload Specific Feedback Message Format", proto_rtcp, FT_UINT8, BASE_DEC); rtcp_rtpfb_dissector_table = register_dissector_table("rtcp.rtpfb.fmt", "RTCP Generic RTP Feedback Message Format", proto_rtcp, FT_UINT8, BASE_DEC); } void proto_reg_handoff_rtcp(void) { /* * Register this dissector as one that can be selected by a * UDP port number. */ dissector_add_for_decode_as_with_preference("udp.port", rtcp_handle); dissector_add_for_decode_as("flip.payload", rtcp_handle ); dissector_add_for_decode_as_with_preference("udp.port", srtcp_handle); heur_dissector_add( "udp", dissect_rtcp_heur, "RTCP over UDP", "rtcp_udp", proto_rtcp, HEURISTIC_ENABLE); heur_dissector_add("stun", dissect_rtcp_heur, "RTCP over TURN", "rtcp_stun", proto_rtcp, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-rtcp.h
/* packet-rtcp.h * * Routines for RTCP dissection * RTCP = Real-time Transport Control Protocol * * Copyright 2000, Philips Electronics N.V. * Written by Andreas Sikkema <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "ws_symbol_export.h" /* Info to save in RTCP conversation / packet-info. Note that this structure applies to the destination end of an RTP session */ #define MAX_RTCP_SETUP_METHOD_SIZE 10 struct _rtcp_conversation_info { /* Setup info is relevant to traffic whose dest is the conversation address */ guchar setup_method_set; gchar setup_method[MAX_RTCP_SETUP_METHOD_SIZE + 1]; guint32 setup_frame_number; /* Info used for roundtrip calculations */ guchar last_received_set; guint32 last_received_frame_number; nstime_t last_received_timestamp; guint32 last_received_ts; /* Stored result of calculation */ guchar lsr_matched; guint32 calculated_delay_used_frame; gint calculated_delay_report_gap; gint32 calculated_delay; /* SRTCP context */ struct srtp_info *srtcp_info; }; /* Add an RTCP conversation with the given details */ WS_DLL_PUBLIC void rtcp_add_address(packet_info *pinfo, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number); /* Add an SRTP conversation with the given details */ WS_DLL_PUBLIC void srtcp_add_address(packet_info *pinfo, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number, struct srtp_info *srtcp_info);
C
wireshark/epan/dissectors/packet-rtitcp.c
/* packet-rtitcp.c * Dissector for the RTI TCP Transport Protocol. * Layer on top of TCP used to send Control messages * to establish and maintain the connections as well as * send RTPS data. * * (c) 2005-2015 Copyright, Real-Time Innovations, Inc. * Real-Time Innovations, Inc. * 232 East Java Drive * Sunnyvale, CA 94089 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/addr_resolv.h> #include <epan/wmem_scopes.h> #include <epan/conversation.h> #include "packet-tcp.h" #define RTITCP_MAGIC_NUMBER 0xdd54dd55 #define RTPS_MAGIC_NUMBER 0x52545053 #define RTITCP_CONTROL_MAGIC_COOKIE 0x2112A442 #define RTITCP_CRC_MAGIC_NUMBER 0x43524332 /* A sample #define of the minimum length (in bytes) of the protocol data. * If data is received with fewer than this many bytes it is rejected by * the current dissector. */ #define RTITCP_MIN_LENGTH 8 #define NUMBER_2E30 1073741824 #define IDENTITY_BIND_REQUEST (0x0C01) #define IDENTITY_BIND_INDICATION (0x0C11) #define IDENTITY_BIND_RESPONSE (0x0D01) #define IDENTITY_BIND_ERROR (0x0D11) #define SERVER_LOGICAL_PORT_REQUEST (0x0C02) #define SERVER_LOGICAL_PORT_INDICATION (0x0C12) #define SERVER_LOGICAL_PORT_RESPONSE (0x0D02) #define SERVER_LOGICAL_PORT_ERROR (0x0D12) #define CLIENT_LOGICAL_PORT_REQUEST (0x0C03) #define CLIENT_LOGICAL_PORT_INDICATION (0x0C13) #define CLIENT_LOGICAL_PORT_RESPONSE (0x0D03) #define CLIENT_LOGICAL_PORT_ERROR (0x0D13) #define CONNECTION_BIND_REQUEST (0x0C04) #define CONNECTION_BIND_INDICATION (0x0C14) #define CONNECTION_BIND_RESPONSE (0x0D04) #define CONNECTION_BIND_ERROR (0x0D14) #define SESSION_ID_REQUEST (0x0C05) #define SESSION_ID_INDICATION (0x0C15) #define SESSION_ID_RESPONSE (0x0D05) #define SESSION_ID_ERROR (0x0D15) #define LIVELINESS_REQUEST (0x0C06) #define LIVELINESS_RESPONSE (0x0D06) #define FINALIZE_SESSION_REQUEST (0x0C0F) #define FINALIZE_SESSION_INDICATION (0x0C1F) #define FINALIZE_SESSION_RESPONSE (0x0D0F) #define FINALIZE_SESSION_ERRROR (0x0D1F) #define LOCATOR_KIND_IPV4 (1) #define LOCATOR_KIND_IPV6 (2) #define RTPS_LOCATOR_ADDRESS_ATTRIBUTE_TYPE (0x3D01) #define RTPS_LOCATOR_PORT_ATTRIBUTE_TYPE (0x3D02) #define CONNECTION_TYPE_ATTRIBUTE_TYPE (0x3D03) #define CONNECTION_COOKIE_ATTRIBUTE_TYPE (0x3D04) #define PORT_OPTIONS_ATTRIBUTE_TYPE (0x3D05) #define TRANSPORT_PRIORITY_ATTRIBUTE_TYPE (0x3D06) #define SESSION_ID_ATTRIBUTE_TYPE (0x3D07) #define MAPPED_ADDRESS_ATTRIBUTE_TYPE (0x0001) #define XOR_MAPPED_ADDRESS_ATTRIBUTE_TYPE (0x0020) #define ERROR_CODE_ATTRIBUTE_TYPE (0x0009) #define UNKNOWN_ATTRIBUTES_ATTRIBUTE_TYPE (0x000A) #define SOFTWARE_ATTRIBUTE_TYPE (0x8022) #define ALTERNATE_SERVER_ATTRIBUTE_TYPE (0x8023) #define CLASS_ID_TCPV4_LAN (0x00) #define CLASS_ID_TCPV4_WAN (0x40) #define CLASS_ID_TLSV4_LAN (0x80) #define CLASS_ID_TLSV4_WAN (0xC0) #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_OK 0 /* client requested a transport class not supported by the server */ #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_TRANSPORT_CLASS_MISMATCH 1 /* required attribute is missing */ #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_ATTRIBUTE_MISSING 2 /* no matching receive resource for requested port */ #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_NO_MATCHING_RECVRESOURCE 3 /* no matching cookie found on server */ #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_NO_MATCH_COOKIE 4 /* fatal internal processing error (caller is not responsible) */ #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_INTERNAL 5 /* the operation should be retried at the first occurrence */ #define NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_RETRY 6 #define NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_BAD_REQUEST_ID 400 #define NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_UNKNOWN_ATTRIBUTE_ID 420 #define NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_ALLOCATION_MISMATCH_ID 437 #define NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_UNSUPPORTED_TRANSPORT_PROTOCOL_ID 442 #define NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_CONNECTION_ALREADY_EXISTS_ID 446 #define NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_SERVER_ERROR_ID 500 /* Forward declaration that is needed below if using the * proto_reg_handoff_rtitcp function as a callback for when protocol * preferences get changed. For now we don't have preferences but we * may have them in the future.*/ void proto_reg_handoff_rtitcp(void); void proto_register_rtitcp(void); /* Initialize the protocol and registered fields */ static gint proto_rtitcp = -1; static gint hf_rtitcp_header_control_byte = -1; static gint hf_rtitcp_header_magic_number = -1; static gint hf_rtitcp_header_message_length = -1; static gint hf_rtitcp_control_transaction_id = -1; static gint hf_rtitcp_control_kind = -1; static gint hf_rtitcp_control_attribute_type = -1; static gint hf_rtitcp_control_attribute_length = -1; static gint hf_rtitcp_control_attribute_port = -1; static gint hf_rtitcp_attributes_list_length = -1; static gint hf_rtitcp_control_magic_cookie = -1; static gint hf_rtitcp_control_attribute_connection_cookie = -1; static gint hf_rtitcp_control_attribute_connection_type = -1; static gint hf_rtitcp_control_attribute_session_id = -1; static gint hf_rtitcp_control_attribute_error_code_value = -1; static gint hf_rtitcp_control_attribute_error_code_description = -1; static gint hf_rtitcp_locator_ipv4 = -1; static gint hf_rtitcp_locator_port = -1; static gint hf_rtitcp_locator_ipv6 = -1; static gint hf_rtitcp_locator_kind = -1; static gint hf_rtitcp_crc_magic_cookie = -1; static gint hf_rtitcp_control_crc_value = -1; static gint hf_rtitcp_response_in = -1; static gint hf_rtitcp_response_to = -1; static gint hf_rtitcp_response_time = -1; #define RTITCP_FLAG_NOT_REQUEST 0x0100 typedef struct _rtitcp_transaction_t { guint32 req_frame; guint32 rep_frame; nstime_t req_time; } rtitcp_transaction_t; typedef struct _rtitcp_conv_info_t { wmem_map_t *pdus; } rtitcp_conv_info_t; /* Subtree pointers */ static gint ett_rtitcp = -1; static gint ett_rtitcp_signalling_protocol = -1; static gint ett_rtitcp_message = -1; static gint ett_rtitcp_attributes_list = -1; static gint ett_rtitcp_attribute = -1; static header_field_info *hfi_rtitcp = NULL; static heur_dissector_list_t heur_subdissector_list; static const value_string ctrl_message_types_vals[] = { { IDENTITY_BIND_REQUEST, "Identity Bind Request" }, { IDENTITY_BIND_INDICATION, "Identity Bind Indication" }, { IDENTITY_BIND_RESPONSE, "Identity Bind Response" }, { IDENTITY_BIND_ERROR, "Identity Bind Error" }, { SERVER_LOGICAL_PORT_REQUEST, "Server Logical Port Request" }, { SERVER_LOGICAL_PORT_RESPONSE, "Server Logical Port Response" }, { SERVER_LOGICAL_PORT_ERROR, "Server Logical Port Error" }, { CLIENT_LOGICAL_PORT_REQUEST, "Client Logical Port Request" }, { CLIENT_LOGICAL_PORT_RESPONSE, "Client Logical Port Response" }, { CLIENT_LOGICAL_PORT_ERROR, "Client Logical Port Error" }, { CONNECTION_BIND_REQUEST, "Connection Bind Request" }, { CONNECTION_BIND_RESPONSE, "Connection Bind Response" }, { CONNECTION_BIND_ERROR, "Connection Bind Error" }, { SESSION_ID_REQUEST, "Session ID Request" }, { SESSION_ID_INDICATION, "Session ID Indication" }, { SESSION_ID_RESPONSE, "Session ID Response" }, { SESSION_ID_ERROR, "Session ID Error" }, { LIVELINESS_REQUEST, "Liveliness Request" }, { LIVELINESS_RESPONSE, "Liveliness Response" }, { FINALIZE_SESSION_INDICATION, "Finalize Session Indication" }, { 0, NULL } }; static const value_string attribute_types_vals[] = { { RTPS_LOCATOR_ADDRESS_ATTRIBUTE_TYPE, "Locator Address" }, { RTPS_LOCATOR_PORT_ATTRIBUTE_TYPE, "Locator Port" }, { CONNECTION_TYPE_ATTRIBUTE_TYPE, "Connection Type" }, { CONNECTION_COOKIE_ATTRIBUTE_TYPE, "Connection Cookie" }, { PORT_OPTIONS_ATTRIBUTE_TYPE, "Port options" }, { TRANSPORT_PRIORITY_ATTRIBUTE_TYPE, "Transport priority" }, { SESSION_ID_ATTRIBUTE_TYPE, "Session ID" }, { MAPPED_ADDRESS_ATTRIBUTE_TYPE, "Mapped Address" }, { XOR_MAPPED_ADDRESS_ATTRIBUTE_TYPE, "XOR Mapped Address" }, { ERROR_CODE_ATTRIBUTE_TYPE, "Error Code" }, { UNKNOWN_ATTRIBUTES_ATTRIBUTE_TYPE, "Unknown attribute" }, { SOFTWARE_ATTRIBUTE_TYPE, "Software" }, { ALTERNATE_SERVER_ATTRIBUTE_TYPE, "Alternate Server" }, { 0, NULL } }; static const value_string error_code_kind_vals[] = { { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_OK, "PROTOCOL_OK" }, { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_TRANSPORT_CLASS_MISMATCH, "PROTOCOL_ERROR_TRANSPORT_CLASS_MISMATCH" }, { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_ATTRIBUTE_MISSING, "PROTOCOL_ERROR_ATTRIBUTE_MISSING" }, { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_NO_MATCHING_RECVRESOURCE, "PROTOCOL_ERROR_NO_MATCHING_RECVRESOURCE" }, { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_NO_MATCH_COOKIE, "PROTOCOL_ERROR_NO_MATCH_COOKIE" }, { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_INTERNAL, "PROTOCOL_ERROR_INTERNAL" }, { NDDS_TRANSPORT_TCPV4_CONTROL_PROTOCOL_ERROR_RETRY, "PROTOCOL_ERROR_RETRY" }, { NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_BAD_REQUEST_ID, "ERROR_CODE_ATTRIBUTE_BAD_REQUEST_ID" }, { NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_UNKNOWN_ATTRIBUTE_ID, "ERROR_CODE_ATTRIBUTE_UNKNOWN_ATTRIBUTE_ID" }, { NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_ALLOCATION_MISMATCH_ID, "ERROR_CODE_ATTRIBUTE_ALLOCATION_MISMATCH_ID" }, { NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_UNSUPPORTED_TRANSPORT_PROTOCOL_ID, "ERROR_CODE_ATTRIBUTE_UNSUPPORTED_TRANSPORT_PROTOCOL_ID" }, { NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_CONNECTION_ALREADY_EXISTS_ID, "ERROR_CODE_ATTRIBUTE_CONNECTION_ALREADY_EXISTS_ID" }, { NDDS_TRANSPORT_TCP_CONTROL_ERROR_CODE_ATTRIBUTE_SERVER_ERROR_ID, "ERROR_CODE_ATTRIBUTE_SERVER_ERROR_ID" }, { 0, NULL } }; static const value_string rtitcp_locator_kind_vals[] = { { LOCATOR_KIND_IPV4, "IPV4" }, { LOCATOR_KIND_IPV6, "Unreachable peer" }, { 0, NULL } }; static const value_string rtitcp_attribute_connection_type_vals[] = { { CLASS_ID_TCPV4_LAN, "TCPV4_LAN" }, { CLASS_ID_TCPV4_WAN, "TCPV4_WAN" }, { CLASS_ID_TLSV4_LAN, "TLSV4_LAN" }, { CLASS_ID_TLSV4_WAN, "TLSV4_WAN" }, { 0, NULL } }; static void rtitcp_util_add_error_attribute(proto_tree *attribute, tvbuff_t* tvb, gint offset, guint size) { proto_tree_add_item(attribute, hf_rtitcp_control_attribute_error_code_value, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(attribute, hf_rtitcp_control_attribute_error_code_description, tvb, offset + 4, size - 4, ENC_ASCII); } static void rtitcp_util_add_locator_t(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t * tvb, gint offset, gboolean little_endian, proto_item * rtitcp_message, gboolean * first_attribute) { gint32 kind; guint16 port; kind = tvb_get_guint16(tvb, offset+8, little_endian ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN); if (kind == 0xFFFF) { kind = LOCATOR_KIND_IPV4; } else { kind = LOCATOR_KIND_IPV6; } proto_tree_add_uint(tree, hf_rtitcp_locator_kind, tvb, offset+8, 2, kind); if (kind == LOCATOR_KIND_IPV4) { proto_tree_add_item(tree, hf_rtitcp_locator_port, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_rtitcp_locator_ipv4, tvb, offset+12, 4, ENC_BIG_ENDIAN); port = tvb_get_guint16(tvb, offset+10, little_endian ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN); if (*first_attribute) { proto_item_append_text(rtitcp_message," ("); col_append_str(pinfo->cinfo, COL_INFO, " ("); } proto_item_append_text(rtitcp_message, "%s%s:%u", *first_attribute ? "" : ", ", tvb_ip_to_str(pinfo->pool, tvb, offset + 12), port); col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s:%u", *first_attribute ? "" : ", ", tvb_ip_to_str(pinfo->pool, tvb, offset + 12), port); } else { proto_tree_add_item(tree, hf_rtitcp_locator_ipv6, tvb, offset, 16, ENC_NA); if (*first_attribute) { proto_item_append_text(rtitcp_message," ("); col_append_str(pinfo->cinfo, COL_INFO, " ("); } proto_item_append_text(rtitcp_message, "%s%s", *first_attribute ? "" : ", ", tvb_ip6_to_str(pinfo->pool, tvb, offset)); col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s", *first_attribute ? "" : ", ", tvb_ip6_to_str(pinfo->pool, tvb, offset)); } } static guint dissect_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *attributes_list, guint offset, guint attributes_list_offset, proto_item * rtitcp_message, gboolean * first_attribute) { guint16 attribute_length, attribute_type; guint padding; proto_item *attribute; attribute_type = tvb_get_guint16(tvb, attributes_list_offset+offset, ENC_BIG_ENDIAN); attribute_length = tvb_get_guint16(tvb, attributes_list_offset+offset+2, ENC_BIG_ENDIAN); attribute = proto_tree_add_subtree_format(attributes_list, tvb, attributes_list_offset+offset, attribute_length+4, ett_rtitcp_attribute, NULL, "Unknown Attribute"); proto_tree_add_item(attribute, hf_rtitcp_control_attribute_type, tvb, attributes_list_offset+offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(attribute, hf_rtitcp_control_attribute_length, tvb, attributes_list_offset+offset+2, 2, ENC_BIG_ENDIAN); proto_item_set_text(attribute,"%s", val_to_str_const(attribute_type, attribute_types_vals, "Unknown attribute")); switch (attribute_type) { case RTPS_LOCATOR_PORT_ATTRIBUTE_TYPE: { guint32 port; port = tvb_get_guint32(tvb, attributes_list_offset+offset+4, ENC_BIG_ENDIAN); if (*first_attribute) { proto_item_append_text(rtitcp_message," ("); col_append_str(pinfo->cinfo, COL_INFO, " ("); } proto_item_append_text(rtitcp_message, "%s%u", *first_attribute ? "" : ", ", port); col_append_fstr(pinfo->cinfo, COL_INFO, "%s%u", *first_attribute ? "" : ", ", port); (*first_attribute) = FALSE; proto_item_append_text(attribute, " (Port = %u)", port); proto_tree_add_item(attribute, hf_rtitcp_control_attribute_port, tvb, attributes_list_offset+offset+4, attribute_length, ENC_BIG_ENDIAN); break; } case RTPS_LOCATOR_ADDRESS_ATTRIBUTE_TYPE: { rtitcp_util_add_locator_t(attribute, pinfo, tvb, attributes_list_offset+offset+4, ENC_BIG_ENDIAN, rtitcp_message, first_attribute); (*first_attribute) = FALSE; break; } case CONNECTION_COOKIE_ATTRIBUTE_TYPE: { proto_tree_add_item(attribute, hf_rtitcp_control_attribute_connection_cookie, tvb, attributes_list_offset+offset+4, attribute_length, ENC_NA); if (*first_attribute) { proto_item_append_text(rtitcp_message," ("); col_append_str(pinfo->cinfo, COL_INFO, " ("); } proto_item_append_text(rtitcp_message, "%s%s", (*first_attribute) ? "" : ", ", tvb_bytes_to_str(pinfo->pool, tvb, attributes_list_offset+offset+4, 16)); col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s", (*first_attribute) ? "" : ", ", tvb_bytes_to_str(pinfo->pool, tvb, attributes_list_offset+offset+4, 16)); (*first_attribute) = FALSE; break; } case CONNECTION_TYPE_ATTRIBUTE_TYPE: { guint8 attribute_connection_type = tvb_get_guint8(tvb, attributes_list_offset+offset+4); proto_tree_add_item(attribute, hf_rtitcp_control_attribute_connection_type, tvb, attributes_list_offset+offset+4, attribute_length, ENC_BIG_ENDIAN); if (*first_attribute) { proto_item_append_text(rtitcp_message," ("); col_append_str(pinfo->cinfo, COL_INFO, " ("); } proto_item_append_text(rtitcp_message, "%s%s", (*first_attribute) ? "" : ", ", val_to_str_const(attribute_connection_type, rtitcp_attribute_connection_type_vals, "Unknown attribute")); col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s", (*first_attribute) ? "" : ", ", val_to_str_const(attribute_connection_type, rtitcp_attribute_connection_type_vals, "Unknown attribute")); (*first_attribute) = FALSE; break; } case SESSION_ID_ATTRIBUTE_TYPE: { proto_tree_add_item(attribute, hf_rtitcp_control_attribute_session_id, tvb, attributes_list_offset+offset+4, attribute_length, ENC_NA); break; } case ERROR_CODE_ATTRIBUTE_TYPE: { rtitcp_util_add_error_attribute(attribute, tvb, attributes_list_offset+offset+4, attribute_length); break; } default: break; } padding = (4 - attribute_length%4)%4; return (attribute_length+padding+4); } static proto_tree* print_header(proto_tree *tree, proto_tree *rtitcp_message, tvbuff_t *tvb, guint offset, guint16 msg_length, gboolean printCRC, gboolean is_data) { proto_item *ti; if (is_data) { rtitcp_message = proto_tree_add_subtree_format(tree, tvb, offset, msg_length, ett_rtitcp_message, NULL, "RTI TCP Data Message"); } else { rtitcp_message = proto_tree_add_subtree_format(tree, tvb, offset, msg_length, ett_rtitcp_message, NULL, "RTI TCP Control Message"); } if (is_data) { guint32 msg_length32; proto_tree_add_item(rtitcp_message, hf_rtitcp_header_control_byte, tvb, offset, 1, ENC_BIG_ENDIAN); ti = proto_tree_add_item(rtitcp_message, hf_rtitcp_header_message_length, tvb, offset+1, 3, ENC_BIG_ENDIAN); msg_length32 = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN); msg_length32 = msg_length32 % NUMBER_2E30; proto_item_set_text(ti,"RTI TCP Message Length: %d", msg_length32); } else { proto_tree_add_item(rtitcp_message, hf_rtitcp_header_control_byte, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rtitcp_message, hf_rtitcp_header_message_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); } proto_tree_add_item(rtitcp_message, hf_rtitcp_header_magic_number, tvb, offset+4, 4, ENC_BIG_ENDIAN); if (printCRC) { proto_tree_add_item(rtitcp_message, hf_rtitcp_crc_magic_cookie, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rtitcp_message, hf_rtitcp_control_crc_value, tvb, offset+12, 4, ENC_BIG_ENDIAN); } return rtitcp_message; } static guint16 dissect_control_message(proto_tree *rtitcp_tree, tvbuff_t *tvb, packet_info *pinfo, guint offset) { /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Not Used | msg_length | * +---------------+---------------+---------------+---------------+ * | RTITCP_MAGIC_NUMBER | * +---------------+---------------+---------------+---------------+ * | control_message_kind | attributes_list_length | * +---------------+---------------+---------------+---------------+ * | RTITCP_CONTROL_MAGIC_COOKIE | * +---------------+---------------+---------------+---------------+ * | | * |- -| * | TRANSACTION_ID | * |- -| * | | * +---------------+---------------+---------------+---------------+ --------------------------------- * | attribute_type | attribute_length .. Repeat | * +---------------+---------------+---------------+---------------+ until | * | ATTRIBUTE (length) | attributes_list_length expires | * +---------------+---------------+---------------+---------------+ --------------------------------*/ proto_tree *attributes_list, *rtitcp_message = NULL; guint16 msg_length, control_message_kind, attributes_list_length, header_length; guint attributes_list_offset, attribute_offset, offset_header = offset; guint attributes_count; gboolean is_data = FALSE, printCRC = FALSE, first_attribute; gchar * transaction_id_str; guint64 seq_num; conversation_t *conversation; rtitcp_conv_info_t *rtitcp_info; rtitcp_transaction_t *rtitcp_trans; guint64 * conversation_info_key = NULL; /* The header length is 8 if it doesn't contain optional fields */ header_length = 8; msg_length = tvb_get_guint16(tvb, offset+2, ENC_BIG_ENDIAN); offset += 8; /* Check if CRC is present */ if (tvb_get_ntohl(tvb, offset) == RTITCP_CRC_MAGIC_NUMBER) { printCRC = TRUE; header_length += 8; offset += 8; /* Because of 0xCRC32 + actual CRC (4 bytes) */ } /* Time to print the header */ rtitcp_message = print_header(rtitcp_tree, rtitcp_message, tvb, offset_header, msg_length + header_length, printCRC, is_data); /* Check the control message kind */ control_message_kind = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_const(control_message_kind,ctrl_message_types_vals, "Unknown control message")); proto_tree_add_uint(rtitcp_message, hf_rtitcp_control_kind, tvb, offset, 2, control_message_kind); proto_item_set_text(rtitcp_message,"RTI TCP Control Message , Kind: %s", val_to_str_const(control_message_kind,ctrl_message_types_vals, "Unknown control message")); offset += 2; /* Take the length in bytes of the attributes list */ attributes_list_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(rtitcp_message, hf_rtitcp_attributes_list_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* We expect now the RTI TCP Control Magic Cookie */ if (tvb_get_ntohl(tvb, offset) != RTITCP_CONTROL_MAGIC_COOKIE) { return msg_length + header_length; } proto_tree_add_item(rtitcp_message, hf_rtitcp_control_magic_cookie, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Now we dissect the transaction id */ proto_tree_add_item(rtitcp_message, hf_rtitcp_control_transaction_id, tvb, offset, 12, ENC_NA); transaction_id_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, 12); /* Get the transaction identifier. Not the whole transaction but the middle part, which * shouldn't coincide */ seq_num = tvb_get_ntoh64(tvb, offset); /* * We need to track some state for this protocol on a per conversation * basis so we can do neat things like request/response tracking */ conversation = find_or_create_conversation(pinfo); rtitcp_info = (rtitcp_conv_info_t *)conversation_get_proto_data(conversation, proto_rtitcp); if (!rtitcp_info) { /* * No. Attach that information to the conversation, and add * it to the list of information structures. */ rtitcp_info = wmem_new(wmem_file_scope(), rtitcp_conv_info_t); rtitcp_info->pdus=wmem_map_new(wmem_file_scope(), g_int64_hash, g_int64_equal); conversation_add_proto_data(conversation, proto_rtitcp, rtitcp_info); } if (!pinfo->fd->visited) { if (!(control_message_kind & RTITCP_FLAG_NOT_REQUEST)) { /* This is a request */ rtitcp_trans=wmem_new(wmem_file_scope(), rtitcp_transaction_t); rtitcp_trans->req_frame = pinfo->num; rtitcp_trans->rep_frame = 0; rtitcp_trans->req_time = pinfo->abs_ts; conversation_info_key = wmem_new0(wmem_file_scope(), guint64); *conversation_info_key = seq_num; wmem_map_insert(rtitcp_info->pdus, conversation_info_key, (void *)rtitcp_trans); } else { conversation_info_key = &seq_num; rtitcp_trans=(rtitcp_transaction_t *)wmem_map_lookup(rtitcp_info->pdus, conversation_info_key); if (rtitcp_trans) { rtitcp_trans->rep_frame = pinfo->num; } } } else { conversation_info_key = &seq_num; rtitcp_trans=(rtitcp_transaction_t *)wmem_map_lookup(rtitcp_info->pdus, conversation_info_key); } if (!rtitcp_trans) { /* create a "fake" rtitcp_trans structure */ rtitcp_trans=wmem_new(pinfo->pool, rtitcp_transaction_t); rtitcp_trans->req_frame = 0; rtitcp_trans->rep_frame = 0; rtitcp_trans->req_time = pinfo->abs_ts; } /* print state tracking in the tree */ if (!(control_message_kind & RTITCP_FLAG_NOT_REQUEST)) { /* This is a request */ if (rtitcp_trans->rep_frame) { proto_item *it; it = proto_tree_add_uint(rtitcp_message, hf_rtitcp_response_in, tvb, 0, 0, rtitcp_trans->rep_frame); proto_item_set_generated(it); } } else { /* This is a reply */ if (rtitcp_trans->req_frame) { proto_item *it; nstime_t ns; it = proto_tree_add_uint(rtitcp_message, hf_rtitcp_response_to, tvb, 0, 0, rtitcp_trans->req_frame); proto_item_set_generated(it); nstime_delta(&ns, &pinfo->abs_ts, &rtitcp_trans->req_time); it = proto_tree_add_time(rtitcp_message, hf_rtitcp_response_time, tvb, 0, 0, &ns); proto_item_set_generated(it); } } /* End of feature */ offset += 12; /* Finally, dissect the list of attributes */ attributes_list_offset = 0; attributes_list = proto_tree_add_subtree_format(rtitcp_message, tvb, attributes_list_offset+offset, attributes_list_length, ett_rtitcp_attributes_list, NULL, "Attributes List"); attributes_count = 0; first_attribute = TRUE; while (attributes_list_offset < attributes_list_length) { ++attributes_count; attribute_offset = dissect_attribute(tvb, pinfo, attributes_list, offset, attributes_list_offset, rtitcp_message, &first_attribute); attributes_list_offset += attribute_offset; } if (!first_attribute) { proto_item_append_text(rtitcp_message,")"); col_append_str(pinfo->cinfo, COL_INFO, ")"); } /* Now that we have the number of attributes, update the text to show it */ proto_item_set_text(attributes_list, "Attributes list [%d attribute%s", attributes_count, attributes_count > 1 ? "s]" : "]"); proto_item_append_text(rtitcp_message,", Transaction ID: %s, Len: %d", transaction_id_str, msg_length); return msg_length + header_length; } /* This function dissects all the control messages found */ static guint dissect_rtitcp_control_protocol(proto_tree *rtitcp_tree, tvbuff_t *tvb, packet_info *pinfo) { guint offset; guint16 msg_length; guint32 tvb_len; offset = 0; tvb_len = tvb_reported_length(tvb); while (offset < tvb_len) { msg_length = dissect_control_message(rtitcp_tree, tvb, pinfo, offset); offset += msg_length; } return offset; } static gint dissect_rtitcp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* FORMAT OF THE CONTROL MESSAGE 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | control bytes | RTI TCP message length | * +---------------+---------------+---------------+---------------+ * | RTITCP_MAGIC_NUMBER | * +---------------+---------------+---------------+---------------+ * | control_message_kind | attributes_list_length | * +---------------+---------------+---------------+---------------+ * | RTITCP_CONTROL_MAGIC_COOKIE | * +---------------+---------------+---------------+---------------+ * | | * |- -| * | TRANSACTION_ID | * |- -| * | | * +---------------+---------------+---------------+---------------+ --------------------------------- * | attribute_type | attribute_length .. Repeat | * +---------------+---------------+---------------+---------------+ until | * | ATTRIBUTE (length) | attributes_list_length expires | * +---------------+---------------+---------------+---------------+ --------------------------------*/ proto_item *ti; proto_tree *rtitcp_tree, *rtitcp_message = NULL; guint offset, offset_header; guint16 rtitcp_msg_length, header_length; guint32 tvb_len, rtitcp_rtps_msg_length; gboolean printCRC = FALSE, is_data = FALSE; tvbuff_t *next_tvb; heur_dtbl_entry_t *hdtbl_entry; offset = 0; tvb_len = tvb_reported_length(tvb); /* From this point, we can consider that this is a RTI TCP message */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTI-TCP"); rtitcp_msg_length = tvb_get_guint16(tvb, offset+2, ENC_BIG_ENDIAN); ti = proto_tree_add_item(tree, proto_rtitcp, tvb, offset, -1, ENC_NA); rtitcp_tree = proto_item_add_subtree(ti, ett_rtitcp); offset_header = 0; /* Remember the offset that delimits the header */ header_length = 8; /* the header is 8 bytes length + 8 optional (CRC) */ offset += 2; /* First two bytes are CTRL bytes */ offset += 2; /* rtitcp_msg_length */ offset += 4; /* RTITCP_MAGIC_NUMBER has already been checked */ /* if bytes 8 to 12 are RTITCP_CRC_MAGIC_NUMBER, we got a CRC */ if (tvb_get_ntohl(tvb, offset) == RTITCP_CRC_MAGIC_NUMBER) { printCRC = TRUE; /* To specify later that CRC must be printed */ header_length += 8; /* header increases in 8 bytes */ offset += 8; /* Because of 0xCRC32 + actual CRC (4 bytes) */ } proto_item_set_len(ti, rtitcp_msg_length + header_length); /* At this point, offset is 8 or 16 bytes and we have now data. This data can be RTPS or RTI TCP Signaling messages */ if (tvb_get_ntohl(tvb, offset) == RTPS_MAGIC_NUMBER) { /* IMPORTANT NOTE: We assume always one RTPS message per RTITCP message */ /* If the TCP layer has provided us with garbage at the end of the buffer, process only the length specified by rtitcp_msg_length */ if (tvb_len > (guint32)(rtitcp_msg_length + header_length)) { tvb_set_reported_length(tvb, (rtitcp_msg_length + header_length)); } /* When we encapsulate RTPS, packet length is given by the 30 less significant bits of the first four bytes */ rtitcp_rtps_msg_length = tvb_get_guint32(tvb, 0, ENC_BIG_ENDIAN); rtitcp_rtps_msg_length = rtitcp_rtps_msg_length % NUMBER_2E30; /* Add RTI TCP Data Message subtree and print header */ is_data = TRUE; rtitcp_message = print_header(rtitcp_tree, rtitcp_message, tvb, offset_header, rtitcp_rtps_msg_length + header_length, printCRC, is_data); proto_item_set_text(rtitcp_message,"RTI TCP Data Message, Len: %d", rtitcp_rtps_msg_length); /* Take the payload and call the registered sub-dissectors. So far, RTPS */ next_tvb = tvb_new_subset_remaining(tvb, offset); dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL); return tvb_captured_length(tvb); } else { return dissect_rtitcp_control_protocol(rtitcp_tree, tvb, pinfo); } } static guint get_rtitcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset, void * data _U_) { guint16 plen; guint16 header_length = 8; /* * Get the length of the RTITCP packet. */ plen = tvb_get_guint16(tvb, offset+2, ENC_BIG_ENDIAN); /* * That length doesn't include the header field itself; add that in. */ if (tvb_get_ntohl(tvb, offset+8) == RTITCP_CRC_MAGIC_NUMBER) header_length += 8; /* We don't expect plen to be greater than 0xfff8 since adding the header * exceeds the size */ if (plen >= 0xfff8) return 1; return plen + header_length; } static gint dissect_rtitcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gboolean desegmentation = TRUE; if (tvb_captured_length(tvb) < 8) return 0; /* Check if the RTITCP_MAGIC_NUMBER is here */ if (tvb_get_ntohl(tvb, 4) != RTITCP_MAGIC_NUMBER) return 0; col_clear(pinfo->cinfo, COL_INFO); tcp_dissect_pdus(tvb, pinfo, tree, desegmentation, RTITCP_MIN_LENGTH, get_rtitcp_pdu_len, dissect_rtitcp_common, data); return tvb_captured_length(tvb); } /* Register the protocol with Wireshark. * * This format is required because a script is used to build the C function that * calls all the protocol registration. */ void proto_register_rtitcp(void) { /* module_t *rtitcp_module; */ /* expert_module_t* expert_rtitcp; */ static hf_register_info hf[] = { { &hf_rtitcp_header_control_byte, { "Control Byte", "rtitcp.header.control_byte", FT_UINT16, BASE_HEX, NULL, 0, 0, HFILL } }, { &hf_rtitcp_header_message_length, { "Message Length", "rtitcp.header.message_length", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL } }, { &hf_rtitcp_header_magic_number, { "Magic Cookie", "rtitcp.header.magic_cookie", FT_UINT32, BASE_HEX, NULL, 0, 0, HFILL } }, { &hf_rtitcp_crc_magic_cookie, { "CRC Magic Cookie", "rtitcp.header.crc_magic_cookie", FT_UINT32, BASE_HEX, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_kind, { "Kind", "rtitcp.control.kind", FT_UINT16, BASE_HEX, VALS(ctrl_message_types_vals), 0, NULL, HFILL } }, { &hf_rtitcp_control_magic_cookie, { "Control Magic Cookie", "rtitcp.control.magic_cookie", FT_UINT32, BASE_HEX, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_transaction_id, { "Transaction ID", "rtitcp.control.transaction_id", FT_BYTES, BASE_NONE, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_attribute_session_id, { "Session ID", "rtitcp.control.attribute.session_id", FT_BYTES, BASE_NONE, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_attribute_type, { "Attribute Type", "rtitcp.control.attribute_type", FT_UINT16, BASE_HEX, VALS(attribute_types_vals), 0, NULL, HFILL } }, { &hf_rtitcp_control_attribute_error_code_value, { "Kind", "rtitcp.control.attribute.error_code", FT_UINT32, BASE_HEX, VALS(error_code_kind_vals), 0, NULL, HFILL } }, { &hf_rtitcp_control_attribute_error_code_description, { "Description", "rtitcp.control.attribute.error_code.description", FT_STRING, BASE_NONE, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_attribute_connection_cookie, { "Connection Cookie", "rtitcp.control.attribute.connection_cookie", FT_BYTES, BASE_NONE, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_attribute_connection_type, { "Class ID", "rtitcp.control_attribute.connection_type", FT_UINT8, BASE_HEX, VALS(rtitcp_attribute_connection_type_vals), 0, 0, HFILL } }, { &hf_rtitcp_attributes_list_length, { "Attributes list length", "rtitcp.attributes_list_length", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_attribute_length, { "Attribute Length", "rtitcp.control.attribute.length", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL } }, { &hf_rtitcp_control_attribute_port, { "Port", "rtitcp.control.attribute_port", FT_UINT32, BASE_DEC, NULL, 0, 0, HFILL } }, { &hf_rtitcp_locator_kind, { "Kind", "rtitcp.locator.kind", FT_UINT16, BASE_DEC, VALS(rtitcp_locator_kind_vals), 0, NULL, HFILL } }, { &hf_rtitcp_locator_ipv4, { "Address", "rtitcp.locator.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtitcp_locator_port, { "Port", "rtitcp.locator.port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtitcp_locator_ipv6, { "Address", "rtitcp.locator.ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtitcp_control_crc_value, { "CRC", "rtitcp.control.crc", FT_UINT32, BASE_HEX, NULL, 0, 0, HFILL } }, { &hf_rtitcp_response_in, { "Response In", "rtitcp.response_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The response to this RTITCP request is in this frame", HFILL } }, { &hf_rtitcp_response_to, { "Request In", "rtitcp.response_to", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is a response to the RTITCP request in this frame", HFILL } }, { &hf_rtitcp_response_time, { "Response Time", "rtitcp.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the Request and the Reply", HFILL } }, }; static gint *ett[] = { &ett_rtitcp, &ett_rtitcp_signalling_protocol, &ett_rtitcp_message, &ett_rtitcp_attributes_list, &ett_rtitcp_attribute }; /* Setup protocol expert items */ /* static ei_register_info ei[] = {}; */ /* Register the protocol name and description */ proto_rtitcp = proto_register_protocol("RTI TCP Transport Protocol", "RTITCP", "rtitcp"); hfi_rtitcp = proto_registrar_get_nth(proto_rtitcp); /* Required function calls to register the header fields and subtrees */ proto_register_field_array(proto_rtitcp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Required function calls to register expert items */ /* expert_rtitcp = expert_register_protocol(proto_rtitcp); expert_register_field_array(expert_rtitcp, ei, array_length(ei)); */ register_dissector("rtitcp", dissect_rtitcp, proto_rtitcp); heur_subdissector_list = register_heur_dissector_list("rtitcp", proto_rtitcp); } /* Simpler form of proto_reg_handoff_rtitcp which can be used if there are * no prefs-dependent registration function calls. */ void proto_reg_handoff_rtitcp(void) { heur_dissector_add("tcp", dissect_rtitcp, "RTI TCP Layer" , "rtitcp", proto_rtitcp, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtls.c
/* packet-rtls.c * Routines for Real Time Location System dissection * Copyright 2016, Alexis La Goutte (See Authors) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * http://community.arubanetworks.com/aruba/attachments/aruba/unified-wired-wireless-access/23715/1/RTLS_integrationv6.docx */ #include <config.h> #include <epan/packet.h> #include <epan/expert.h> void proto_reg_handoff_rtls(void); void proto_register_rtls(void); static dissector_handle_t rtls_handle; static int proto_rtls = -1; static int hf_rtls_message_type = -1; static int hf_rtls_message_id = -1; static int hf_rtls_version_major = -1; static int hf_rtls_version_minor = -1; static int hf_rtls_data_length = -1; static int hf_rtls_ap_mac = -1; static int hf_rtls_padding = -1; static int hf_rtls_reserved = -1; static int hf_rtls_signature = -1; static int hf_rtls_as_tag_addr = -1; static int hf_rtls_sr_mac_address = -1; static int hf_rtls_nack_flags = -1; static int hf_rtls_nack_flags_internal_error = -1; static int hf_rtls_nack_flags_station_not_found = -1; static int hf_rtls_nack_flags_reserved = -1; static int hf_rtls_tr_bssid = -1; static int hf_rtls_tr_rssi = -1; static int hf_rtls_tr_rssi_calculated = -1; static int hf_rtls_tr_noise_floor = -1; static int hf_rtls_tr_timestamp = -1; static int hf_rtls_tr_tag_mac = -1; static int hf_rtls_tr_frame_control = -1; static int hf_rtls_tr_sequence = -1; static int hf_rtls_tr_data_rate = -1; static int hf_rtls_tr_tx_power = -1; static int hf_rtls_tr_channel = -1; static int hf_rtls_tr_battery = -1; static int hf_rtls_sr_mac = -1; static int hf_rtls_sr_noise_floor = -1; static int hf_rtls_sr_data_rate = -1; static int hf_rtls_sr_channel = -1; static int hf_rtls_sr_rssi = -1; static int hf_rtls_sr_rssi_calculated = -1; static int hf_rtls_sr_type = -1; static int hf_rtls_sr_associated = -1; static int hf_rtls_sr_radio_bssid = -1; static int hf_rtls_sr_mon_bssid = -1; static int hf_rtls_sr_age = -1; static int hf_rtls_ser_mac = -1; static int hf_rtls_ser_bssid = -1; static int hf_rtls_ser_essid = -1; static int hf_rtls_ser_channel = -1; static int hf_rtls_ser_phy_type = -1; static int hf_rtls_ser_rssi = -1; static int hf_rtls_ser_rssi_calculated = -1; static int hf_rtls_ser_duration = -1; static int hf_rtls_ser_num_packets = -1; static int hf_rtls_ser_noise_floor = -1; static int hf_rtls_ser_classification = -1; static int hf_rtls_aer_bssid = -1; static int hf_rtls_aer_essid = -1; static int hf_rtls_aer_channel = -1; static int hf_rtls_aer_phy_type = -1; static int hf_rtls_aer_rssi = -1; static int hf_rtls_aer_rssi_calculated = -1; static int hf_rtls_aer_duration = -1; static int hf_rtls_aer_num_packets = -1; static int hf_rtls_aer_noise_floor = -1; static int hf_rtls_aer_classification = -1; static int hf_rtls_aer_match_type = -1; static int hf_rtls_aer_match_method = -1; static int hf_rtls_cmr_messages = -1; static int * const rtls_nack_flags[] = { &hf_rtls_nack_flags_internal_error, &hf_rtls_nack_flags_station_not_found, &hf_rtls_nack_flags_reserved, NULL }; static expert_field ei_rtls_undecoded = EI_INIT; static gint ett_rtls = -1; static gint ett_rtls_message = -1; static gint ett_rtls_nack_flags = -1; #define RTLS_MIN_LENGTH 16 #define AR_AS_CONFIG_SET 0x0000 #define AR_STATION_REQUEST 0x0001 #define AR_ACK 0x0010 #define AR_NACK 0x0011 #define AR_TAG_REPORT 0x0012 #define AR_STATION_REPORT 0x0013 #define AR_COMPOUND_MESSAGE_REPORT 0x0014 #define AR_AP_NOTIFICATION 0x0015 #define AR_MMS_CONFIG_SET 0x0016 #define AR_STATION_EX_REPORT 0x0017 #define AR_AP_EX_REPORT 0x0018 static const value_string rtls_message_type_vals[] = { { AR_AS_CONFIG_SET, "AR_AS_CONFIG_SET" }, { AR_STATION_REQUEST, "AR_STATION_REQUEST" }, { AR_ACK, "AR_ACK"}, { AR_NACK, "AR_NACK"}, { AR_TAG_REPORT, "AR_TAG_REPORT"}, { AR_STATION_REPORT, "AR_STATION_REPORT"}, { AR_COMPOUND_MESSAGE_REPORT, "AR_COMPOUND_MESSAGE_REPORT"}, { AR_AP_NOTIFICATION, "AR_AP_NOTIFICATION"}, { AR_MMS_CONFIG_SET, "AR_MMS_CONFIG_SET"}, { AR_STATION_EX_REPORT, "AR_STATION_EX_REPORT"}, { AR_AP_EX_REPORT, "AR_AP_EX_REPORT"}, { 0, NULL } }; static const value_string rtls_sr_type_vals[] = { { 1, "AR_WLAN_CLIENT" }, { 2, "AR_WLAN_AP" }, {0, NULL} }; static const value_string rtls_sr_associated_vals[] = { { 1, "AR_WLAN_ASSOCIATED (All APs and Associated Stations)" }, { 2, "AR_WLAN_UNASSOCIATED (Unassociated Stations)" }, {0, NULL} }; static const value_string rtls_data_rate_vals[] = { { 0x00, "1 Mbits" }, { 0x01, "2 Mbits" }, { 0x02, "5.5 Mbits" }, { 0x03, "6 Mbits" }, { 0x04, "9 Mbits" }, { 0x05, "11 Mbits" }, { 0x06, "12 Mbits" }, { 0x07, "18 Mbits" }, { 0x08, "24 Mbits" }, { 0x09, "36 Mbits" }, { 0x0A, "48 Mbits" }, { 0x0B, "54 Mbits" }, {0, NULL} }; static const value_string rtls_ex_phy_type_vals[] = { { 1, "802.11b" }, { 2, "802.11a" }, { 3, "802.11g" }, { 4, "802.11ag" }, {0, NULL} }; static const value_string rtls_ex_classification_vals[] = { { 1, "Valid" }, { 2, "interfering" }, { 3, "DOS'ed" }, {0, NULL} }; static void rssi_base_custom(gchar *result, guint32 rssi) { /* Convert Hex to decimal and subtract 256 to get the signal value */ snprintf(result, ITEM_LABEL_LENGTH, "%d", rssi - 256); } static int dissect_rtls_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *rtls_tree, guint offset, guint *data_length) { proto_tree_add_item(rtls_tree, hf_rtls_message_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_message_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_version_major, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_version_minor, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_data_length, tvb, offset, 2, ENC_BIG_ENDIAN); if(data_length){ *data_length = tvb_get_ntohs(tvb, offset); } offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_ap_mac, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_padding, tvb, offset, 2, ENC_NA); offset += 2; return offset; } static int dissect_rtls_message_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *rtls_tree, guint offset, guint type) { proto_item *ti_rssi; switch(type){ case AR_AS_CONFIG_SET: proto_tree_add_item(rtls_tree, hf_rtls_as_tag_addr, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case AR_STATION_REQUEST: proto_tree_add_item(rtls_tree, hf_rtls_sr_mac_address, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case AR_ACK: case AR_AP_NOTIFICATION: /* No Payload */ break; case AR_NACK: proto_tree_add_bitmask_with_flags(rtls_tree, tvb, offset, hf_rtls_nack_flags, ett_rtls_nack_flags, rtls_nack_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case AR_TAG_REPORT: proto_tree_add_item(rtls_tree, hf_rtls_tr_bssid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_tr_rssi, tvb, offset, 1, ENC_BIG_ENDIAN); ti_rssi = proto_tree_add_item(rtls_tree, hf_rtls_tr_rssi_calculated, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_generated(ti_rssi); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_tr_noise_floor, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_tr_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(rtls_tree, hf_rtls_tr_tag_mac, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_tr_frame_control, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_tr_sequence, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_tr_data_rate, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_tr_tx_power, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_tr_channel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_tr_battery, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case AR_STATION_REPORT: proto_tree_add_item(rtls_tree, hf_rtls_sr_mac, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_sr_noise_floor, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_sr_data_rate, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_sr_channel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_sr_rssi, tvb, offset, 1, ENC_BIG_ENDIAN); ti_rssi = proto_tree_add_item(rtls_tree, hf_rtls_sr_rssi_calculated, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_generated(ti_rssi); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_sr_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_sr_associated, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_sr_radio_bssid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_sr_mon_bssid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_sr_age, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case AR_STATION_EX_REPORT: proto_tree_add_item(rtls_tree, hf_rtls_ser_mac, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_ser_bssid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_ser_essid, tvb, offset, 33, ENC_ASCII); offset += 33; proto_tree_add_item(rtls_tree, hf_rtls_ser_channel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_ser_phy_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_ser_rssi, tvb, offset, 1, ENC_BIG_ENDIAN); ti_rssi = proto_tree_add_item(rtls_tree, hf_rtls_ser_rssi_calculated, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_generated(ti_rssi); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_ser_duration, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_ser_num_packets, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_ser_noise_floor, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_ser_classification, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case AR_AP_EX_REPORT: proto_tree_add_item(rtls_tree, hf_rtls_aer_bssid, tvb, offset, 6, ENC_NA ); offset += 6; proto_tree_add_item(rtls_tree, hf_rtls_aer_essid, tvb, offset, 33, ENC_ASCII); offset += 33; proto_tree_add_item(rtls_tree, hf_rtls_aer_channel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_aer_phy_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_aer_rssi, tvb, offset, 1, ENC_BIG_ENDIAN); ti_rssi = proto_tree_add_item(rtls_tree, hf_rtls_aer_rssi_calculated, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_generated(ti_rssi); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_aer_duration, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_aer_num_packets, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_aer_noise_floor, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_aer_classification, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_aer_match_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_aer_match_method, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case AR_COMPOUND_MESSAGE_REPORT:{ guint32 cmr_messages; proto_tree *sub_tree; proto_tree_add_item_ret_uint(rtls_tree, hf_rtls_cmr_messages, tvb, offset, 2, ENC_BIG_ENDIAN, &cmr_messages); offset += 2; proto_tree_add_item(rtls_tree, hf_rtls_reserved, tvb, offset, 2, ENC_NA); offset += 2; while(cmr_messages){ guint32 data_length; type = tvb_get_ntohs(tvb, offset); sub_tree = proto_tree_add_subtree_format(rtls_tree, tvb, offset, -1, ett_rtls_message, NULL, "%s", val_to_str(type, rtls_message_type_vals, "(unknown %d)")); offset = dissect_rtls_header(tvb, pinfo, sub_tree, offset, &data_length); offset = dissect_rtls_message_type(tvb, pinfo, sub_tree, offset, type); proto_item_set_len(sub_tree, data_length + 16); cmr_messages--; } } break; default:{ guint32 remaining; remaining = tvb_reported_length_remaining(tvb, offset) - 20; /* Remove 20 of signature */ proto_tree_add_expert(rtls_tree, pinfo, &ei_rtls_undecoded, tvb, offset, remaining); offset += remaining; } break; } return offset; } static int dissect_rtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti; proto_tree *rtls_tree; guint offset = 0; guint32 type; if (tvb_reported_length(tvb) < RTLS_MIN_LENGTH) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTLS"); ti = proto_tree_add_item(tree, proto_rtls, tvb, 0, -1, ENC_NA); rtls_tree = proto_item_add_subtree(ti, ett_rtls); /* RTLS Header */ type = tvb_get_ntohs(tvb, offset); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, rtls_message_type_vals, "(unknown %d)")); offset = dissect_rtls_header(tvb, pinfo, rtls_tree, offset, NULL); offset = dissect_rtls_message_type(tvb, pinfo, rtls_tree, offset, type); /* TODO: Check signature ? HMAC-SHA1 with shared key and RTLS packet data */ proto_tree_add_item(rtls_tree, hf_rtls_signature, tvb, offset, 20, ENC_NA); offset += 20; return offset; } void proto_register_rtls(void) { expert_module_t *expert_rtls; static hf_register_info hf[] = { /* RTLS Header*/ { &hf_rtls_message_type, { "Message Type", "rtls.message_type", FT_UINT16, BASE_HEX, VALS(rtls_message_type_vals), 0x0, NULL, HFILL } }, { &hf_rtls_message_id, { "Message Id", "rtls.message_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_version_major, { "Version Major", "rtls.version_major", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_version_minor, { "Version Minor", "rtls.version_minor", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_data_length, { "Data Length", "rtls.data_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_ap_mac, { "AP MAC Address", "rtls.ap_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_padding, { "Padding", "rtls.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_reserved, { "Reserved", "rtls.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_signature, { "Signature", "rtls.signature", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* AR_AS_CONFIG_SET */ { &hf_rtls_as_tag_addr, { "AS Tag Address", "rtls.as_tag_addr", FT_ETHER, BASE_NONE, NULL, 0x0, "Tag multicast address", HFILL } }, /* AR_STATION_REQUEST */ { &hf_rtls_sr_mac_address, { "MAC Address", "rtls.sr_mac_addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* AR_NACK */ { &hf_rtls_nack_flags, { "Flags", "rtls.nack.flags", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_rtls_nack_flags_internal_error, { "Internal Error", "rtls.nack.flags.internal_errors", FT_UINT16, BASE_HEX, NULL, 0x01, NULL, HFILL } }, { &hf_rtls_nack_flags_station_not_found, { "Station Not found", "rtls.nack.flags.station_not_found", FT_UINT16, BASE_HEX, NULL, 0x02, NULL, HFILL } }, { &hf_rtls_nack_flags_reserved, { "Reserved", "rtls.nack.flags.reserved", FT_UINT16, BASE_HEX, NULL, 0xFC, NULL, HFILL } }, /* AR_TAG_REPORT */ { &hf_rtls_tr_bssid, { "BSSID", "rtls.tr.bssid", FT_ETHER, BASE_NONE, NULL, 0x0, "MAC address of the radio where the frame was received", HFILL } }, { &hf_rtls_tr_rssi, { "RSSI", "rtls.tr.rssi", FT_UINT8, BASE_DEC, NULL, 0x0, "Signal as a signed negative hex value", HFILL } }, { &hf_rtls_tr_rssi_calculated, { "RSSI (calculated)", "rtls.tr.rssi.calculated", FT_UINT8, BASE_CUSTOM, CF_FUNC(rssi_base_custom), 0x0, NULL, HFILL } }, { &hf_rtls_tr_noise_floor, { "Noise Floor", "rtls.tr.noise_floor", FT_UINT8, BASE_DEC, NULL, 0x0, "Noise floor of the radio", HFILL } }, { &hf_rtls_tr_timestamp, { "Timestamp", "rtls.tr.timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, "Millisecond granularity timestamp that represents local time in AP when message was sent", HFILL } }, { &hf_rtls_tr_tag_mac, { "Tag Mac", "rtls.tr.tag_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "MAC address of the tag", HFILL } }, { &hf_rtls_tr_frame_control, { "Frame Control", "rtls.tr.frame_control", FT_UINT16, BASE_HEX, NULL, 0x0, "Frame control from 802.11 header", HFILL } }, { &hf_rtls_tr_sequence, { "Sequence", "rtls.tr.sequence", FT_UINT16, BASE_DEC, NULL, 0x0, "Sequence number from the 802.11 header", HFILL } }, { &hf_rtls_tr_data_rate, { "Data Rate", "rtls.tr.data_rate", FT_UINT8, BASE_DEC, VALS(rtls_data_rate_vals), 0x0, "Data rate of chirp frame", HFILL } }, { &hf_rtls_tr_tx_power, { "Tx Power", "rtls.tr.tx_power", FT_UINT8, BASE_DEC, NULL, 0x0, "Transmit power in dbm", HFILL } }, { &hf_rtls_tr_channel, { "Channel", "rtls.tr.channel", FT_UINT8, BASE_DEC, NULL, 0x0, "Channel of tag transmission", HFILL } }, { &hf_rtls_tr_battery, { "Battery", "rtls.tr.battery", FT_UINT8, BASE_DEC, NULL, 0x0, "Batter level information from the chirp frame if present", HFILL } }, /* AR_STATION_REPORT */ { &hf_rtls_sr_mac, { "MAC", "rtls.sr.mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtls_sr_noise_floor, { "Noise Floor", "rtls.sr.noise_floor", FT_UINT8, BASE_DEC, NULL, 0x0, "Noise floor of the channel where the station was last heard", HFILL } }, { &hf_rtls_sr_data_rate, { "Data Rate", "rtls.sr.data_rate", FT_UINT8, BASE_DEC, VALS(rtls_data_rate_vals), 0x0, "Data rate of chirp frame", HFILL } }, { &hf_rtls_sr_channel, { "Channel", "rtls.sr.channel", FT_UINT8, BASE_DEC, NULL, 0x0, "Channel where station was last heard", HFILL } }, { &hf_rtls_sr_rssi, { "RSSI", "rtls.sr.rssi", FT_UINT8, BASE_DEC, NULL, 0x0, "Signal as a signed negative hex value", HFILL } }, { &hf_rtls_sr_rssi_calculated, { "RSSI (calculated)", "rtls.sr.rssi.calculated", FT_UINT8, BASE_CUSTOM, CF_FUNC(rssi_base_custom), 0x0, NULL, HFILL } }, { &hf_rtls_sr_type, { "Type", "rtls.sr.type", FT_UINT8, BASE_DEC, VALS(rtls_sr_type_vals), 0x0, "Type of device", HFILL } }, { &hf_rtls_sr_associated, { "Associated", "rtls.sr.associated", FT_UINT8, BASE_DEC, VALS(rtls_sr_associated_vals), 0x0, "Association status of station", HFILL } }, { &hf_rtls_sr_radio_bssid, { "Radio BSSID", "rtls.sr.radio_bssids", FT_ETHER, BASE_NONE, NULL, 0x0, "Association status of station BSSID of the radio that detected the device", HFILL } }, { &hf_rtls_sr_mon_bssid, { "Mon BSSID", "rtls.sr.mon_bssids", FT_ETHER, BASE_NONE, NULL, 0x0, "BSSID of the AP that the station is associated to", HFILL } }, { &hf_rtls_sr_age, { "Age", "rtls.sr.age", FT_UINT32, BASE_DEC, NULL, 0x0, "The number of seconds since the last packet was heard from this station", HFILL } }, /* AR_STATION_EX_REPORT */ { &hf_rtls_ser_mac, { "MAC", "rtls.ser.mac", FT_ETHER, BASE_NONE, NULL, 0x0, "MAC address of station", HFILL } }, { &hf_rtls_ser_bssid, { "BSSID", "rtls.ser.bssid", FT_ETHER, BASE_NONE, NULL, 0x0, "BSSID with which this station is associated", HFILL } }, { &hf_rtls_ser_essid, { "ESSID", "rtls.ser.essid", FT_STRING, BASE_NONE, NULL, 0x0, "ESSID with which this station is associated", HFILL } }, { &hf_rtls_ser_channel, { "Channel", "rtls.ser.channel", FT_UINT8, BASE_DEC, NULL, 0x0, "Channel where this station is active", HFILL } }, { &hf_rtls_ser_phy_type, { "Phy type", "rtls.ser.phy_type", FT_UINT8, BASE_DEC, VALS(rtls_ex_phy_type_vals), 0x0, NULL, HFILL } }, { &hf_rtls_ser_rssi, { "RSSI", "rtls.ser.rssi", FT_UINT8, BASE_DEC, NULL, 0x0, "Average RSSI during the duration", HFILL } }, { &hf_rtls_ser_rssi_calculated, { "RSSI (calculated)", "rtls.ser.rssi.calculated", FT_UINT8, BASE_CUSTOM, CF_FUNC(rssi_base_custom), 0x0, NULL, HFILL } }, { &hf_rtls_ser_duration, { "Duration", "rtls.ser.duration", FT_UINT16, BASE_DEC, NULL, 0x0, "Average calculation duration", HFILL } }, { &hf_rtls_ser_num_packets, { "Num Packets", "rtls.ser.num_packets", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of packets used in average RSSI calculation", HFILL } }, { &hf_rtls_ser_noise_floor, { "Noise Floor", "rtls.ser.noise_floor", FT_UINT8, BASE_DEC, NULL, 0x0, "Noise floor of the radio", HFILL } }, { &hf_rtls_ser_classification, { "Classification", "rtls.ser.classification", FT_UINT8, BASE_DEC, VALS(rtls_ex_classification_vals), 0x0, "Millisecond granularity timestamp that represents local time in AP when message was sent", HFILL } }, /* AR_AP_EX_REPORT */ { &hf_rtls_aer_bssid, { "BSSID", "rtls.aer.bssid", FT_ETHER, BASE_NONE, NULL, 0x0, "BSSID with which this station is associated", HFILL } }, { &hf_rtls_aer_essid, { "ESSID", "rtls.aer.essid", FT_STRING, BASE_NONE, NULL, 0x0, "ESSID with which this station is associated", HFILL } }, { &hf_rtls_aer_channel, { "Channel", "rtls.aer.channel", FT_UINT8, BASE_DEC, NULL, 0x0, "Channel where this station is active", HFILL } }, { &hf_rtls_aer_phy_type, { "Phy type", "rtls.aer.phy_type", FT_UINT8, BASE_DEC, VALS(rtls_ex_phy_type_vals), 0x0, NULL, HFILL } }, { &hf_rtls_aer_rssi, { "RSSI", "rtls.aer.rssi", FT_UINT8, BASE_DEC, NULL, 0x0, "Average RSSI during the duration", HFILL } }, { &hf_rtls_aer_rssi_calculated, { "RSSI (calculated)", "rtls.aer.rssi.calculated", FT_UINT8, BASE_CUSTOM, CF_FUNC(rssi_base_custom), 0x0, NULL, HFILL } }, { &hf_rtls_aer_duration, { "Duration", "rtls.aer.duration", FT_UINT16, BASE_DEC, NULL, 0x0, "Average calculation duration", HFILL } }, { &hf_rtls_aer_num_packets, { "Num Packets", "rtls.aer.num_packets", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of packets used in average RSSI calculation", HFILL } }, { &hf_rtls_aer_noise_floor, { "Noise Floor", "rtls.aer.noise_floor", FT_UINT8, BASE_DEC, NULL, 0x0, "Noise floor of the radio", HFILL } }, { &hf_rtls_aer_classification, { "Classification", "rtls.aer.classification", FT_UINT8, BASE_DEC, VALS(rtls_ex_classification_vals), 0x0, "Millisecond granularity timestamp that represents local time in AP when message was sent", HFILL } }, { &hf_rtls_aer_match_type, { "Match Type", "rtls.aer.match_type", FT_UINT8, BASE_HEX, NULL, 0x0, "Internal Aruba use", HFILL } }, { &hf_rtls_aer_match_method, { "Match Method", "rtls.aer.match_method", FT_UINT8, BASE_HEX, NULL, 0x0, "Internal Aruba use", HFILL } }, { &hf_rtls_cmr_messages, { "Messages", "rtls.cmr_messages", FT_UINT16, BASE_DEC, NULL, 0x0, "number of messages", HFILL } }, }; static gint *ett[] = { &ett_rtls, &ett_rtls_message, &ett_rtls_nack_flags, }; /* Setup protocol expert items */ static ei_register_info ei[] = { { &ei_rtls_undecoded, { "rtls.undecoded", PI_UNDECODED, PI_NOTE, "Undecoded Payload", EXPFILL } } }; proto_rtls = proto_register_protocol("Real Time Location System", "RTLS", "rtls"); rtls_handle = register_dissector("rtls", dissect_rtls, proto_rtls); proto_register_field_array(proto_rtls, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtls = expert_register_protocol(proto_rtls); expert_register_field_array(expert_rtls, ei, array_length(ei)); } void proto_reg_handoff_rtls(void) { dissector_add_for_decode_as_with_preference("udp.port", rtls_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtmpt.c
/* packet-rtmpt.c * Routines for Real Time Messaging Protocol packet dissection * metatech <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* This dissector is called RTMPT to avoid a conflict with * the other RTMP protocol (Routing Table Maintenance Protocol) implemented in packet-atalk.c * (RTMPT normally stands for RTMP-Tunnel via http) * * RTMP in a nutshell * * The protocol has very few "magic words" to facilitate detection, * but rather has "magic lengths". * This protocol has plenty of special cases and few general rules, * especially regarding the lengths and the structures. * * Documentation: * RTMP protocol description on Wiki of Red5 Open Source Flash Server at * * http://trac.red5.org/wiki/Codecs/RTMPSpecification * * and the pages to which it links: * * http://osflash.org/documentation/rtmp * http://wiki.gnashdev.org/RTMP * http://wiki.gnashdev.org/RTMP_Messages_Decoded * http://www.acmewebworks.com/Downloads/openCS/TheAMF.pdf * http://www.gnashdev.org/files/rtmp-decoded.pdf * * It's also available from Adobe at * * https://www.adobe.com/devnet/rtmp.html * * For AMF, see: * * http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf * * for AMF0 and * * http://amf3cplusplus.googlecode.com/svn-history/r4/trunk/doc/amf3_spec_05_05_08.pdf * * for AMF3. * * For FLV, see: * * http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf * * Default TCP port is 1935 */ #include "config.h" #include <epan/packet.h> #include <wsutil/pint.h> #include <epan/prefs.h> #include <epan/to_str.h> #include <epan/expert.h> #include "packet-tcp.h" /* #define DEBUG_RTMPT 1 */ #define MAX_AMF_ITERATIONS 1000 void proto_register_rtmpt(void); void proto_reg_handoff_rtmpt(void); void proto_register_amf(void); static int proto_rtmpt = -1; static int hf_rtmpt_handshake_c0 = -1; static int hf_rtmpt_handshake_s0 = -1; static int hf_rtmpt_handshake_c1 = -1; static int hf_rtmpt_handshake_s1 = -1; static int hf_rtmpt_handshake_c2 = -1; static int hf_rtmpt_handshake_s2 = -1; static int hf_rtmpt_header_format = -1; static int hf_rtmpt_header_csid = -1; static int hf_rtmpt_header_timestamp = -1; static int hf_rtmpt_header_timestamp_delta = -1; static int hf_rtmpt_header_body_size = -1; static int hf_rtmpt_header_typeid = -1; static int hf_rtmpt_header_streamid = -1; static int hf_rtmpt_header_ets = -1; static int hf_rtmpt_scm_chunksize = -1; static int hf_rtmpt_scm_csid = -1; static int hf_rtmpt_scm_seq = -1; static int hf_rtmpt_scm_was = -1; static int hf_rtmpt_scm_limittype = -1; static int hf_rtmpt_ucm_eventtype = -1; static int hf_rtmpt_function_call = -1; static int hf_rtmpt_function_response = -1; static int hf_rtmpt_audio_control = -1; static int hf_rtmpt_audio_format = -1; static int hf_rtmpt_audio_rate = -1; static int hf_rtmpt_audio_size = -1; static int hf_rtmpt_audio_type = -1; static int hf_rtmpt_audio_data = -1; static int hf_rtmpt_video_control = -1; static int hf_rtmpt_video_type = -1; static int hf_rtmpt_video_format = -1; static int hf_rtmpt_video_data = -1; static int hf_rtmpt_tag_type = -1; static int hf_rtmpt_tag_datasize = -1; static int hf_rtmpt_tag_timestamp = -1; static int hf_rtmpt_tag_ets = -1; static int hf_rtmpt_tag_streamid = -1; static int hf_rtmpt_tag_tagsize = -1; static expert_field ei_amf_loop = EI_INIT; static gint ett_rtmpt = -1; static gint ett_rtmpt_handshake = -1; static gint ett_rtmpt_header = -1; static gint ett_rtmpt_body = -1; static gint ett_rtmpt_ucm = -1; static gint ett_rtmpt_audio_control = -1; static gint ett_rtmpt_video_control = -1; static gint ett_rtmpt_tag = -1; static gint ett_rtmpt_tag_data = -1; static dissector_handle_t rtmpt_tcp_handle; static dissector_handle_t rtmpt_http_handle; static gboolean rtmpt_desegment = TRUE; /* Native Bandwidth Detection (using the checkBandwidth(), onBWCheck(), * onBWDone() calls) transmits a series of increasing size packets over * the course of 2 seconds. On a fast link the largest packet can just * exceed 256KB, but setting the limit there can cause massive memory * usage in some scenarios. For now make it a preference, but a better fix * is really needed. * See https://gitlab.com/wireshark/wireshark/-/issues/6898 */ static guint rtmpt_max_packet_size = 32768; #define RTMP_PORT 1935 /* Not IANA registered */ #define RTMPT_MAGIC 0x03 #define RTMPT_HANDSHAKE_OFFSET_1 1 #define RTMPT_HANDSHAKE_OFFSET_2 1538 #define RTMPT_HANDSHAKE_OFFSET_3 3074 #define RTMPT_HANDSHAKE_LENGTH_1 1537 #define RTMPT_HANDSHAKE_LENGTH_2 3073 #define RTMPT_HANDSHAKE_LENGTH_3 1536 #define RTMPT_DEFAULT_CHUNK_SIZE 128 #define RTMPT_ID_MAX 65599 #define RTMPT_TYPE_HANDSHAKE_1 0x100001 #define RTMPT_TYPE_HANDSHAKE_2 0x100002 #define RTMPT_TYPE_HANDSHAKE_3 0x100003 #define RTMPT_TYPE_CHUNK_SIZE 0x01 #define RTMPT_TYPE_ABORT_MESSAGE 0x02 #define RTMPT_TYPE_ACKNOWLEDGEMENT 0x03 #define RTMPT_TYPE_UCM 0x04 #define RTMPT_TYPE_WINDOW 0x05 #define RTMPT_TYPE_PEER_BANDWIDTH 0x06 #define RTMPT_TYPE_AUDIO_DATA 0x08 #define RTMPT_TYPE_VIDEO_DATA 0x09 #define RTMPT_TYPE_DATA_AMF3 0x0F #define RTMPT_TYPE_SHARED_AMF3 0x10 #define RTMPT_TYPE_COMMAND_AMF3 0x11 #define RTMPT_TYPE_DATA_AMF0 0x12 #define RTMPT_TYPE_SHARED_AMF0 0x13 #define RTMPT_TYPE_COMMAND_AMF0 0x14 #define RTMPT_TYPE_AGGREGATE 0x16 #define RTMPT_UCM_STREAM_BEGIN 0x00 #define RTMPT_UCM_STREAM_EOF 0x01 #define RTMPT_UCM_STREAM_DRY 0x02 #define RTMPT_UCM_SET_BUFFER 0x03 #define RTMPT_UCM_STREAM_ISRECORDED 0x04 #define RTMPT_UCM_PING_REQUEST 0x06 #define RTMPT_UCM_PING_RESPONSE 0x07 #define RTMPT_TEXT_RTMP_HEADER "RTMP Header" #define RTMPT_TEXT_RTMP_BODY "RTMP Body" static const value_string rtmpt_handshake_vals[] = { { RTMPT_TYPE_HANDSHAKE_1, "Handshake C0+C1" }, { RTMPT_TYPE_HANDSHAKE_2, "Handshake S0+S1+S2" }, { RTMPT_TYPE_HANDSHAKE_3, "Handshake C2" }, { 0, NULL } }; static const value_string rtmpt_opcode_vals[] = { { RTMPT_TYPE_CHUNK_SIZE, "Set Chunk Size" }, { RTMPT_TYPE_ABORT_MESSAGE, "Abort Message" }, { RTMPT_TYPE_ACKNOWLEDGEMENT, "Acknowledgement" }, { RTMPT_TYPE_UCM, "User Control Message" }, { RTMPT_TYPE_WINDOW, "Window Acknowledgement Size" }, { RTMPT_TYPE_PEER_BANDWIDTH, "Set Peer Bandwidth" }, { RTMPT_TYPE_AUDIO_DATA, "Audio Data" }, { RTMPT_TYPE_VIDEO_DATA, "Video Data" }, { RTMPT_TYPE_DATA_AMF3, "AMF3 Data" }, { RTMPT_TYPE_SHARED_AMF3, "AMF3 Shared Object" }, { RTMPT_TYPE_COMMAND_AMF3, "AMF3 Command" }, { RTMPT_TYPE_DATA_AMF0, "AMF0 Data" }, { RTMPT_TYPE_SHARED_AMF0, "AMF0 Shared Object" }, { RTMPT_TYPE_COMMAND_AMF0, "AMF0 Command" }, { RTMPT_TYPE_AGGREGATE, "Aggregate" }, { 0, NULL } }; static const value_string rtmpt_limit_vals[] = { /* These are a complete guess, from the order of the documented * options - the values aren't actually specified */ { 0, "Hard" }, { 1, "Soft" }, { 2, "Dynamic" }, { 0, NULL } }; static const value_string rtmpt_ucm_vals[] = { { RTMPT_UCM_STREAM_BEGIN, "Stream Begin" }, { RTMPT_UCM_STREAM_EOF, "Stream EOF" }, { RTMPT_UCM_STREAM_DRY, "Stream Dry" }, { RTMPT_UCM_SET_BUFFER, "Set Buffer Length" }, { RTMPT_UCM_STREAM_ISRECORDED, "Stream Is Recorded" }, { RTMPT_UCM_PING_REQUEST, "Ping Request" }, { RTMPT_UCM_PING_RESPONSE, "Ping Response" }, { 0, NULL } }; static const value_string rtmpt_tag_vals[] = { { RTMPT_TYPE_AUDIO_DATA, "Audio Tag" }, { RTMPT_TYPE_VIDEO_DATA, "Video Tag" }, { RTMPT_TYPE_DATA_AMF0, "Script Tag" }, { 0, NULL } }; /* [Spec] http://www.adobe.com/content/dam/Adobe/en/devnet/rtmp/pdf/rtmp_specification_1.0.pdf */ /* [DevG] http://help.adobe.com/en_US/flashmediaserver/devguide/index.html "working with Live Video" => Adding metadata to a live stream */ /* [SWF] http://www.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf_file_format_spec_v10.pdf */ static const value_string rtmpt_audio_codecs[] = { { 0, "Uncompressed" }, /* [DevG] */ { 1, "ADPCM" }, /* [DevG] */ { 2, "MP3" }, /* [DevG] */ { 3, "Uncompressed, little-endian"}, /* [SWF] */ { 4, "Nellymoser 16kHz" }, /* [SWF] */ { 5, "Nellymoser 8kHz" }, /* [DevG] [SWF]*/ { 6, "Nellymoser" }, /* [DevG] [SWF]*/ { 7, "G711A" }, /* [Spec] */ { 8, "G711U" }, /* [Spec] */ { 9, "Nellymoser 16kHz" }, /* [Spec] */ { 10, "HE-AAC" }, /* [DevG] */ { 11, "SPEEX" }, /* [DevG] */ { 0, NULL } }; static const value_string rtmpt_audio_rates[] = { { 0, "5.5 kHz" }, { 1, "11 kHz" }, { 2, "22 kHz" }, { 3, "44 kHz" }, { 0, NULL } }; static const value_string rtmpt_audio_sizes[] = { { 0, "8 bit" }, { 1, "16 bit" }, { 0, NULL } }; static const value_string rtmpt_audio_types[] = { { 0, "mono" }, { 1, "stereo" }, { 0, NULL } }; /* from FLV v10.1 section E.4.3.1 */ static const value_string rtmpt_video_types[] = { { 1, "keyframe" }, { 2, "inter-frame" }, { 3, "disposable inter-frame" }, { 4, "generated key frame" }, { 5, "video info/command frame" }, { 0, NULL } }; /* from FLV v10.1 section E.4.3.1 */ static const value_string rtmpt_video_codecs[] = { { 2, "Sorensen H.263" }, { 3, "Screen video" }, { 4, "On2 VP6" }, { 5, "On2 VP6+alpha" }, { 6, "Screen video version 2" }, { 7, "H.264" }, { 12, "H.265" }, { 0, NULL } }; static int proto_amf = -1; static int hf_amf_version = -1; static int hf_amf_header_count = -1; static int hf_amf_header_name = -1; static int hf_amf_header_must_understand = -1; static int hf_amf_header_length = -1; /* static int hf_amf_header_value_type = -1; */ static int hf_amf_message_count = -1; static int hf_amf_message_target_uri = -1; static int hf_amf_message_response_uri = -1; static int hf_amf_message_length = -1; static int hf_amf_amf0_type = -1; static int hf_amf_amf3_type = -1; static int hf_amf_number = -1; static int hf_amf_integer = -1; static int hf_amf_boolean = -1; static int hf_amf_stringlength = -1; static int hf_amf_string = -1; static int hf_amf_string_reference = -1; static int hf_amf_object_reference = -1; static int hf_amf_date = -1; /* static int hf_amf_longstringlength = -1; */ static int hf_amf_longstring = -1; static int hf_amf_xml_doc = -1; static int hf_amf_xmllength = -1; static int hf_amf_xml = -1; static int hf_amf_int64 = -1; static int hf_amf_bytearraylength = -1; static int hf_amf_bytearray = -1; static int hf_amf_object = -1; static int hf_amf_traitcount = -1; static int hf_amf_classnamelength = -1; static int hf_amf_classname = -1; static int hf_amf_membernamelength = -1; static int hf_amf_membername = -1; static int hf_amf_trait_reference = -1; static int hf_amf_ecmaarray = -1; static int hf_amf_strictarray = -1; static int hf_amf_array = -1; static int hf_amf_arraylength = -1; static int hf_amf_arraydenselength = -1; static int hf_amf_end_of_object_marker = -1; static int hf_amf_end_of_associative_part = -1; static int hf_amf_end_of_dynamic_members = -1; static gint ett_amf = -1; static gint ett_amf_headers = -1; static gint ett_amf_messages = -1; static gint ett_amf_value = -1; static gint ett_amf_property = -1; static gint ett_amf_string = -1; static gint ett_amf_array_element = -1; static gint ett_amf_traits = -1; static gint ett_amf_trait_member = -1; /* AMF0 type markers */ #define AMF0_NUMBER 0x00 #define AMF0_BOOLEAN 0x01 #define AMF0_STRING 0x02 #define AMF0_OBJECT 0x03 #define AMF0_MOVIECLIP 0x04 #define AMF0_NULL 0x05 #define AMF0_UNDEFINED 0x06 #define AMF0_REFERENCE 0x07 #define AMF0_ECMA_ARRAY 0x08 #define AMF0_END_OF_OBJECT 0x09 #define AMF0_STRICT_ARRAY 0x0A #define AMF0_DATE 0x0B #define AMF0_LONG_STRING 0x0C #define AMF0_UNSUPPORTED 0x0D #define AMF0_RECORDSET 0x0E #define AMF0_XML 0x0F #define AMF0_TYPED_OBJECT 0x10 #define AMF0_AMF3_MARKER 0x11 #define AMF0_INT64 0x22 /* AMF3 type markers */ #define AMF3_UNDEFINED 0x00 #define AMF3_NULL 0x01 #define AMF3_FALSE 0x02 #define AMF3_TRUE 0x03 #define AMF3_INTEGER 0x04 #define AMF3_DOUBLE 0x05 #define AMF3_STRING 0x06 #define AMF3_XML_DOC 0x07 #define AMF3_DATE 0x08 #define AMF3_ARRAY 0x09 #define AMF3_OBJECT 0x0A #define AMF3_XML 0x0B #define AMF3_BYTEARRAY 0x0C static const value_string amf0_type_vals[] = { { AMF0_NUMBER, "Number" }, { AMF0_BOOLEAN, "Boolean" }, { AMF0_STRING, "String" }, { AMF0_OBJECT, "Object" }, { AMF0_MOVIECLIP, "Movie clip" }, { AMF0_NULL, "Null" }, { AMF0_UNDEFINED, "Undefined" }, { AMF0_REFERENCE, "Reference" }, { AMF0_ECMA_ARRAY, "ECMA array" }, { AMF0_END_OF_OBJECT, "End of object" }, { AMF0_STRICT_ARRAY, "Strict array" }, { AMF0_DATE, "Date" }, { AMF0_LONG_STRING, "Long string" }, { AMF0_UNSUPPORTED, "Unsupported" }, { AMF0_RECORDSET, "Record set" }, { AMF0_XML, "XML" }, { AMF0_TYPED_OBJECT, "Typed object" }, { AMF0_AMF3_MARKER, "Switch to AMF3" }, { AMF0_INT64, "Int64" }, { 0, NULL } }; static const value_string amf3_type_vals[] = { { AMF3_UNDEFINED, "Undefined" }, { AMF3_NULL, "Null" }, { AMF3_FALSE, "False" }, { AMF3_TRUE, "True" }, { AMF3_INTEGER, "Integer" }, { AMF3_DOUBLE, "Double" }, { AMF3_STRING, "String" }, { AMF3_XML_DOC, "XML document" }, { AMF3_DATE, "Date" }, { AMF3_ARRAY, "Array" }, { AMF3_OBJECT, "Object" }, { AMF3_XML, "XML" }, { AMF3_BYTEARRAY, "ByteArray" }, { 0, NULL } }; /* Holds the reassembled data for a packet during un-chunking */ typedef struct rtmpt_packet { guint32 seq; guint32 lastseq; int resident; union { guint8 *p; guint32 offset; } data; /* used during unchunking */ int want; int have; int chunkwant; int chunkhave; guint8 bhlen; guint8 mhlen; /* Chunk Basic Header */ guint8 fmt; /* byte 0 */ guint32 id; /* byte 0 */ /* Chunk Message Header (offsets assume bhlen == 1) */ guint32 ts; /* bytes 1-3, or from ETS @ mhlen-4 if -1 */ guint32 len; /* bytes 4-6 */ guint8 cmd; /* byte 7 */ guint32 src; /* bytes 8-11 */ guint32 txid; gint isresponse; gint otherframe; } rtmpt_packet_t; /* Represents a header or a chunk that is split over two TCP * segments */ typedef struct rtmpt_frag { int ishdr; guint32 seq; guint32 lastseq; int have; int len; union { guint8 d[18]; /* enough for a complete header (3 + 11 + 4) */ guint32 id; } saved; } rtmpt_frag_t; /* The full message header information for the last packet on a particular * ID - used for defaulting short headers */ typedef struct rtmpt_id { guint32 ts; /* bytes 1-3 */ guint32 tsd; guint32 len; /* bytes 4-6 */ guint32 src; /* bytes 8-11 */ guint8 cmd; /* byte 7 */ wmem_tree_t *packets; } rtmpt_id_t; /* Historical view of a whole TCP connection */ typedef struct rtmpt_conv { wmem_tree_t *seqs[2]; wmem_tree_t *frags[2]; wmem_tree_t *ids[2]; wmem_tree_t *packets[2]; wmem_tree_t *chunksize[2]; wmem_tree_t *txids[2]; } rtmpt_conv_t; #ifdef DEBUG_RTMPT static void rtmpt_debug(const char *fmt, ...) { va_list args; va_start(args, fmt); vprintf(fmt, args); va_end(args); } #define RTMPT_DEBUG rtmpt_debug #else static void rtmpt_debug(const char *fmt, ...){ (void)fmt; } #define RTMPT_DEBUG 1 ? (void)0 : rtmpt_debug #endif /* Header length helpers */ static gint rtmpt_basic_header_length(gint id) { switch (id & 0x3f) { case 0: return 2; case 1: return 3; default: return 1; } } static gint rtmpt_message_header_length(gint id) { switch ((id>>6) & 3) { case 0: return 11; case 1: return 7; case 2: return 3; default: return 0; } } /* Lightweight access to AMF0 blobs - more complete dissection is done * in dissect_rtmpt_body_command */ static guint32 rtmpt_get_amf_length(tvbuff_t *tvb, gint offset, proto_item* pi) { guint8 iObjType; gint remain = tvb_reported_length_remaining(tvb, offset); guint32 depth = 0; guint32 itemlen = 0; guint32 rv = 0; guint iterations = MAX_AMF_ITERATIONS; while (rv == 0 || depth > 0) { if (--iterations) { expert_add_info(NULL, pi, &ei_amf_loop); return 0; } if (depth > 0) { if (remain-rv < 2) return remain; itemlen = tvb_get_ntohs(tvb, offset+rv) + 2; if (remain-rv<itemlen+1) return remain; rv += itemlen; } if (remain-rv < 1) return remain; iObjType = tvb_get_guint8(tvb, offset+rv); if (depth > 0 && itemlen == 2 && iObjType == AMF0_END_OF_OBJECT) { rv++; depth--; continue; } switch (iObjType) { case AMF0_NUMBER: itemlen = 9; break; case AMF0_BOOLEAN: itemlen = 2; break; case AMF0_STRING: if (remain-rv < 3) return remain; itemlen = tvb_get_ntohs(tvb, offset+rv+1) + 3; break; case AMF0_NULL: case AMF0_UNDEFINED: case AMF0_UNSUPPORTED: itemlen = 1; break; case AMF0_DATE: itemlen = 11; break; case AMF0_LONG_STRING: case AMF0_XML: if (remain-rv < 5) return remain; itemlen = tvb_get_ntohl(tvb, offset+rv+1) + 5; break; case AMF0_INT64: itemlen = 9; break; case AMF0_OBJECT: itemlen = 1; depth++; break; case AMF0_ECMA_ARRAY: itemlen = 5; depth++; break; default: return remain; } if (remain-rv < itemlen) return remain; rv += itemlen; } return rv; } static gchar * rtmpt_get_amf_param(tvbuff_t *tvb, gint offset, proto_item* pi, gint param, const gchar *prop) { guint32 remain = tvb_reported_length_remaining(tvb, offset); guint32 itemlen; guint32 iStringLength; while (remain > 0 && param > 0) { itemlen = rtmpt_get_amf_length(tvb, offset, pi); if (itemlen == 0) break; offset += itemlen; remain -= itemlen; param--; } if (remain > 0 && param == 0) { guint8 iObjType = tvb_get_guint8(tvb, offset); if (!prop && iObjType == AMF0_STRING && remain >= 3) { iStringLength = tvb_get_ntohs(tvb, offset+1); if (remain >= iStringLength+3) { return tvb_get_string_enc(wmem_packet_scope(), tvb, offset+3, iStringLength, ENC_ASCII); } } if (prop && iObjType == AMF0_OBJECT) { offset++; remain--; while (remain > 2) { guint32 iPropLength = tvb_get_ntohs(tvb, offset); if (remain < 2+iPropLength+3) break; if (tvb_strneql(tvb, offset+2, prop, strlen(prop)) == 0) { if (tvb_get_guint8(tvb, offset+2+iPropLength) != AMF0_STRING) break; iStringLength = tvb_get_ntohs(tvb, offset+2+iPropLength+1); if (remain < 2+iPropLength+3+iStringLength) break; return tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2+iPropLength+3, iStringLength, ENC_ASCII); } itemlen = rtmpt_get_amf_length(tvb, offset+2+iPropLength, pi); if (itemlen == 0) break; offset += 2+iPropLength+itemlen; remain -= 2+iPropLength+itemlen; } } } return NULL; } static guint32 rtmpt_get_amf_txid(tvbuff_t *tvb, gint offset, proto_item* pi) { guint32 remain = tvb_reported_length_remaining(tvb, offset); if (remain > 0) { guint32 itemlen = rtmpt_get_amf_length(tvb, offset, pi); if (itemlen == 0 || remain < itemlen) return 0; offset += itemlen; remain -= itemlen; } if (remain >= 9) { guint8 iObjType = tvb_get_guint8(tvb, offset); if (iObjType == AMF0_NUMBER) { return (guint32)tvb_get_ntohieee_double(tvb, offset+1); } } return 0; } /* Generate a useful description for various packet types */ static gchar * rtmpt_get_packet_desc(tvbuff_t *tvb, guint32 offset, proto_item* pi, guint32 remain, rtmpt_conv_t *rconv, int cdir, rtmpt_packet_t *tp, gint *deschasopcode) { if (tp->cmd == RTMPT_TYPE_CHUNK_SIZE || tp->cmd == RTMPT_TYPE_ABORT_MESSAGE || tp->cmd == RTMPT_TYPE_ACKNOWLEDGEMENT || tp->cmd == RTMPT_TYPE_WINDOW) { if (tp->len >= 4 && remain >= 4) { *deschasopcode = TRUE; return wmem_strdup_printf(wmem_packet_scope(), "%s %d", val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"), tvb_get_ntohl(tvb, offset)); } } else if (tp->cmd == RTMPT_TYPE_PEER_BANDWIDTH) { if (tp->len >= 5 && remain >= 5) { *deschasopcode = TRUE; return wmem_strdup_printf(wmem_packet_scope(), "%s %d,%s", val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"), tvb_get_ntohl(tvb, offset), val_to_str(tvb_get_guint8(tvb, offset+4), rtmpt_limit_vals, "Unknown (%d)")); } } else if (tp->cmd == RTMPT_TYPE_UCM) { guint16 iUCM = -1; const gchar *sFunc; const gchar *sParam = ""; if (tp->len < 2 || remain < 2) return NULL; iUCM = tvb_get_ntohs(tvb, offset); sFunc = try_val_to_str(iUCM, rtmpt_ucm_vals); if (sFunc == NULL) { *deschasopcode = TRUE; sFunc = wmem_strdup_printf(wmem_packet_scope(), "User Control Message 0x%01x", iUCM); } if (iUCM == RTMPT_UCM_STREAM_BEGIN || iUCM == RTMPT_UCM_STREAM_EOF || iUCM == RTMPT_UCM_STREAM_DRY || iUCM == RTMPT_UCM_STREAM_ISRECORDED) { if (tp->len >= 6 && remain >= 6) { sParam = wmem_strdup_printf(wmem_packet_scope(), " %d", tvb_get_ntohl(tvb, offset+2)); } } else if (iUCM == RTMPT_UCM_SET_BUFFER) { if (tp->len >= 10 && remain >= 10) { sParam = wmem_strdup_printf(wmem_packet_scope(), " %d,%dms", tvb_get_ntohl(tvb, offset+2), tvb_get_ntohl(tvb, offset+6)); } } return wmem_strdup_printf(wmem_packet_scope(), "%s%s", sFunc, sParam); } else if (tp->cmd == RTMPT_TYPE_COMMAND_AMF0 || tp->cmd == RTMPT_TYPE_COMMAND_AMF3 || tp->cmd == RTMPT_TYPE_DATA_AMF0 || tp->cmd == RTMPT_TYPE_DATA_AMF3) { guint32 slen = 0; guint32 soff = 0; gchar *sFunc = NULL; gchar *sParam = NULL; if (tp->cmd == RTMPT_TYPE_COMMAND_AMF3 || tp->cmd == RTMPT_TYPE_DATA_AMF3) { soff = 1; } if (tp->len >= 3+soff && remain >= 3+soff) { slen = tvb_get_ntohs(tvb, offset+1+soff); } if (slen > 0) { sFunc = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+3+soff, slen, ENC_ASCII); RTMPT_DEBUG("got function call '%s'\n", sFunc); if (strcmp(sFunc, "connect") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 2, "app"); } else if (strcmp(sFunc, "play") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, NULL); } else if (strcmp(sFunc, "play2") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, "streamName"); } else if (strcmp(sFunc, "releaseStream") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, NULL); } else if (strcmp(sFunc, "FCPublish") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, NULL); } else if (strcmp(sFunc, "publish") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, NULL); } else if (strcmp(sFunc, "onStatus") == 0) { if (tp->cmd == RTMPT_TYPE_COMMAND_AMF0 || tp->cmd == RTMPT_TYPE_COMMAND_AMF3) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, "code"); } else { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 1, "code"); } } else if (strcmp(sFunc, "onPlayStatus") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 1, "code"); } else if (strcmp(sFunc, "_result") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, "code"); tp->isresponse = TRUE; } else if (strcmp(sFunc, "_error") == 0) { sParam = rtmpt_get_amf_param(tvb, offset+soff, pi, 3, "code"); tp->isresponse = TRUE; } if (tp->txid != 0 && tp->otherframe == 0) { tp->otherframe = GPOINTER_TO_INT(wmem_tree_lookup32(rconv->txids[cdir^1], tp->txid)); if (tp->otherframe) { RTMPT_DEBUG("got otherframe=%d\n", tp->otherframe); } } } if (sFunc) { if (sParam) { return wmem_strdup_printf(wmem_packet_scope(), "%s('%s')", sFunc, sParam); } else { return wmem_strdup_printf(wmem_packet_scope(), "%s()", sFunc); } } } return NULL; } /* Tree dissection helpers for various packet body forms */ static void dissect_rtmpt_body_scm(tvbuff_t *tvb, gint offset, proto_tree *rtmpt_tree, guint scm) { switch (scm) { case RTMPT_TYPE_CHUNK_SIZE: proto_tree_add_item(rtmpt_tree, hf_rtmpt_scm_chunksize, tvb, offset, 4, ENC_BIG_ENDIAN); break; case RTMPT_TYPE_ABORT_MESSAGE: proto_tree_add_item(rtmpt_tree, hf_rtmpt_scm_csid, tvb, offset, 4, ENC_BIG_ENDIAN); break; case RTMPT_TYPE_ACKNOWLEDGEMENT: proto_tree_add_item(rtmpt_tree, hf_rtmpt_scm_seq, tvb, offset, 4, ENC_BIG_ENDIAN); break; case RTMPT_TYPE_UCM: proto_tree_add_item(rtmpt_tree, hf_rtmpt_ucm_eventtype, tvb, offset, 2, ENC_BIG_ENDIAN); break; case RTMPT_TYPE_WINDOW: proto_tree_add_item(rtmpt_tree, hf_rtmpt_scm_was, tvb, offset, 4, ENC_BIG_ENDIAN); break; case RTMPT_TYPE_PEER_BANDWIDTH: proto_tree_add_item(rtmpt_tree, hf_rtmpt_scm_was, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(rtmpt_tree, hf_rtmpt_scm_limittype, tvb, offset+4, 1, ENC_BIG_ENDIAN); break; } } static gint dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *amf3_encoding, proto_item *parent_ti); /* * A "property list" is a sequence of name/value pairs, terminated by * and "end of object" indicator. AMF0 "object"s and "ECMA array"s * are encoded as property lists. */ static gint dissect_amf0_property_list(tvbuff_t *tvb, gint offset, proto_tree *tree, guint *countp, gboolean *amf3_encoding) { proto_item *prop_ti; proto_tree *prop_tree; proto_tree *name_tree; guint iStringLength; gchar *iStringValue; guint count = 0; /* * XXX - at least as I read "3.1 AVM+ Type Marker" in the AMF0 * specification, the AVM+ Type Marker only affects "the following * Object". For now, we have a single "AMF3 encoding" flag, and * set it when we see the type marker, and never clear it. */ for (;;) { /* UTF-8: property name */ iStringLength = tvb_get_ntohs(tvb, offset); if (iStringLength == 0 && tvb_get_guint8(tvb, offset + 2) == AMF0_END_OF_OBJECT) break; count++; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, iStringLength, ENC_ASCII); prop_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_amf_property, &prop_ti, "Property '%s'", iStringValue); name_tree = proto_tree_add_subtree_format(prop_tree, tvb, offset, 2+iStringLength, ett_amf_string, NULL, "Name: %s", iStringValue); proto_tree_add_uint(name_tree, hf_amf_stringlength, tvb, offset, 2, iStringLength); offset += 2; proto_tree_add_item(name_tree, hf_amf_string, tvb, offset, iStringLength, ENC_UTF_8); offset += iStringLength; /* value-type: property value */ offset = dissect_amf0_value_type(tvb, offset, prop_tree, amf3_encoding, prop_ti); proto_item_set_end(prop_ti, tvb, offset); } proto_tree_add_item(tree, hf_amf_end_of_object_marker, tvb, offset, 3, ENC_NA); offset += 3; *countp = count; return offset; } static gint dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *amf3_encoding, proto_item *parent_ti) { guint8 iObjType; proto_item *ti; proto_tree *val_tree; gint iValueOffset = offset; guint32 iIntegerValue; double iDoubleValue; gboolean iBooleanValue; guint iStringLength; gchar *iStringValue; guint iArrayLength; guint i; nstime_t t; gint64 iInteger64Value; guint count; iObjType = tvb_get_guint8(tvb, offset); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %s", val_to_str_const(iObjType, amf0_type_vals, "Unknown")); switch (iObjType) { case AMF0_OBJECT: /* * For object types, make the top-level protocol tree * item a field for that type. */ ti = proto_tree_add_item(tree, hf_amf_object, tvb, offset, -1, ENC_NA); val_tree = proto_item_add_subtree(ti, ett_amf_value); break; case AMF0_ECMA_ARRAY: /* * For ECMA array types, make the top-level protocol tree * item a field for that type. */ ti = proto_tree_add_item(tree, hf_amf_ecmaarray, tvb, offset, -1, ENC_NA); val_tree = proto_item_add_subtree(ti, ett_amf_value); break; case AMF0_STRICT_ARRAY: /* * For strict array types, make the top-level protocol tree * item a field for that type. */ ti = proto_tree_add_item(tree, hf_amf_strictarray, tvb, offset, -1, ENC_NA); val_tree = proto_item_add_subtree(ti, ett_amf_value); break; default: /* * For all other types, make it just a text item; the * field for that type will be used for the value. */ val_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_amf_value, &ti, val_to_str_const(iObjType, amf0_type_vals, "Unknown")); break; } proto_tree_add_uint(val_tree, hf_amf_amf0_type, tvb, iValueOffset, 1, iObjType); iValueOffset++; switch (iObjType) { case AMF0_NUMBER: iDoubleValue = tvb_get_ntohieee_double(tvb, iValueOffset); proto_tree_add_double(val_tree, hf_amf_number, tvb, iValueOffset, 8, iDoubleValue); iValueOffset += 8; proto_item_append_text(ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue); break; case AMF0_BOOLEAN: iBooleanValue = tvb_get_guint8(tvb, iValueOffset); proto_tree_add_boolean(val_tree, hf_amf_boolean, tvb, iValueOffset, 1, iBooleanValue); iValueOffset += 1; proto_item_append_text(ti, iBooleanValue ? " true" : " false"); if (parent_ti != NULL) proto_item_append_text(parent_ti, iBooleanValue ? " true" : " false"); break; case AMF0_STRING: iStringLength = tvb_get_ntohs(tvb, iValueOffset); proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, 2, iStringLength); iValueOffset += 2; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA); if (iStringLength != 0) proto_tree_add_string(val_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; proto_item_append_text(ti, " '%s'", iStringValue); if (parent_ti != NULL) proto_item_append_text(parent_ti, " '%s'", iStringValue); break; case AMF0_OBJECT: iValueOffset = dissect_amf0_property_list(tvb, iValueOffset, val_tree, &count, amf3_encoding); proto_item_append_text(ti, " (%u items)", count); break; case AMF0_NULL: case AMF0_UNDEFINED: break; case AMF0_REFERENCE: iIntegerValue = tvb_get_ntohs(tvb, iValueOffset); proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, 2, iIntegerValue); iValueOffset += 2; proto_item_append_text(ti, " %d", iIntegerValue); break; case AMF0_ECMA_ARRAY: /* * Counted list type, with end marker. The count appears to be * more of a hint than a rule, and is sometimes sent as 0 or * invalid. * * Basically the same as OBJECT but with the extra count field. * There being many strange encoders/metadata injectors out * there, sometimes you see a valid count and no end marker. * Figuring out which you've got for a deeply nested structure * is non-trivial. */ iArrayLength = tvb_get_ntohl(tvb, iValueOffset); proto_tree_add_uint(val_tree, hf_amf_arraylength, tvb, iValueOffset, 4, iArrayLength); iValueOffset += 4; iValueOffset = dissect_amf0_property_list(tvb, iValueOffset, val_tree, &count, amf3_encoding); proto_item_append_text(ti, " (%u items)", count); break; case AMF0_END_OF_OBJECT: proto_tree_add_item(tree, hf_amf_end_of_object_marker, tvb, iValueOffset, 3, ENC_NA); iValueOffset += 3; break; case AMF0_STRICT_ARRAY: /* * Counted list type, without end marker. Number of values * is determined by count, values are assumed to form a * [0..N-1] numbered array and are presented as plain AMF * types, not OBJECT or ECMA_ARRAY style named properties. */ iArrayLength = tvb_get_ntohl(tvb, iValueOffset); proto_tree_add_uint(val_tree, hf_amf_arraylength, tvb, iValueOffset, 4, iArrayLength); iValueOffset += 4; for (i = 0; i < iArrayLength; i++) iValueOffset = dissect_amf0_value_type(tvb, iValueOffset, val_tree, amf3_encoding, NULL); proto_item_append_text(ti, " (%u items)", iArrayLength); break; case AMF0_DATE: iDoubleValue = tvb_get_ntohieee_double(tvb, iValueOffset); t.secs = (time_t)(iDoubleValue/1000); t.nsecs = (int)((iDoubleValue - 1000*(double)t.secs) * 1000000); proto_tree_add_time(val_tree, hf_amf_date, tvb, iValueOffset, 8, &t); iValueOffset += 8; proto_item_append_text(ti, " %s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); /* time-zone */ iValueOffset += 2; break; case AMF0_LONG_STRING: case AMF0_XML: /* same representation */ iStringLength = tvb_get_ntohl(tvb, iValueOffset); proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, 2, iStringLength); iValueOffset += 4; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA); if (iStringLength != 0) proto_tree_add_string(val_tree, (iObjType == AMF0_XML) ? hf_amf_xml_doc : hf_amf_longstring, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; proto_item_append_text(ti, " '%s'", iStringValue); if (parent_ti != NULL) proto_item_append_text(parent_ti, " '%s'", iStringValue); break; case AMF0_UNSUPPORTED: break; case AMF0_TYPED_OBJECT: /* class-name */ iStringLength = tvb_get_ntohs(tvb, iValueOffset); proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, 2, iStringLength); iValueOffset += 2; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA); proto_tree_add_string(val_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; iValueOffset = dissect_amf0_property_list(tvb, iValueOffset, val_tree, &count, amf3_encoding); break; case AMF0_AMF3_MARKER: *amf3_encoding = TRUE; break; case AMF0_INT64: iInteger64Value = tvb_get_ntoh64(tvb, iValueOffset); proto_tree_add_int64(val_tree, hf_amf_int64, tvb, iValueOffset, 8, iInteger64Value); iValueOffset += 8; proto_item_append_text(ti," %" PRId64, iInteger64Value); if (parent_ti != NULL) proto_item_append_text(parent_ti," %" PRId64, iInteger64Value); break; default: /* * If we can't determine the length, don't carry on; * just skip to the end of the tvbuff. */ iValueOffset = tvb_reported_length(tvb); break; } proto_item_set_end(ti, tvb, iValueOffset); return iValueOffset; } static guint32 amf_get_u29(tvbuff_t *tvb, int offset, guint *lenp) { guint len = 0; guint8 iByte; guint32 iValue; iByte = tvb_get_guint8(tvb, offset); iValue = (iByte & 0x7F); offset++; len++; if (!(iByte & 0x80)) { /* 1 byte value */ *lenp = len; return iValue; } iByte = tvb_get_guint8(tvb, offset); iValue = (iValue << 7) | (iByte & 0x7F); offset++; len++; if (!(iByte & 0x80)) { /* 2 byte value */ *lenp = len; return iValue; } iByte = tvb_get_guint8(tvb, offset); iValue = (iValue << 7) | (iByte & 0x7F); offset++; len++; if (!(iByte & 0x80)) { /* 3 byte value */ *lenp = len; return iValue; } iByte = tvb_get_guint8(tvb, offset); iValue = (iValue << 8) | iByte; len++; *lenp = len; return iValue; } static gint dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item *parent_ti) { guint8 iObjType; proto_item *ti; proto_tree *val_tree; gint iValueOffset = offset; guint iValueLength; guint32 iIntegerValue; double iDoubleValue; guint iStringLength; gchar *iStringValue; guint iArrayLength; proto_item *subval_ti; proto_tree *subval_tree; guint i; gboolean iTypeIsDynamic; guint iTraitCount; proto_item *traits_ti; proto_tree *traits_tree; proto_tree *name_tree; proto_tree *member_tree; guint8 *iByteArrayValue; iObjType = tvb_get_guint8(tvb, offset); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %s", val_to_str_const(iObjType, amf3_type_vals, "Unknown")); switch (iObjType) { case AMF3_ARRAY: /* * For array types, make the top-level protocol tree * item a field for that type. */ ti = proto_tree_add_item(tree, hf_amf_array, tvb, offset, -1, ENC_NA); val_tree = proto_item_add_subtree(ti, ett_amf_value); break; case AMF3_OBJECT: /* * For object types, make the top-level protocol tree * item a field for that type. */ ti = proto_tree_add_item(tree, hf_amf_object, tvb, offset, -1, ENC_NA); val_tree = proto_item_add_subtree(ti, ett_amf_value); break; default: /* * For all other types, make it just a text item; the * field for that type will be used for the value. */ val_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_amf_value, &ti, val_to_str_const(iObjType, amf3_type_vals, "Unknown")); break; } proto_tree_add_uint(val_tree, hf_amf_amf3_type, tvb, iValueOffset, 1, iObjType); iValueOffset++; switch (iObjType) { case AMF3_UNDEFINED: case AMF3_NULL: break; case AMF3_FALSE: proto_tree_add_boolean(val_tree, hf_amf_boolean, tvb, 0, 0, FALSE); proto_item_append_text(ti, " false"); break; case AMF3_TRUE: proto_tree_add_boolean(val_tree, hf_amf_boolean, tvb, 0, 0, TRUE); proto_item_append_text(ti, " true"); break; case AMF3_INTEGER: /* XXX - signed or unsigned? */ iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); proto_tree_add_uint(val_tree, hf_amf_integer, tvb, iValueOffset, iValueLength, iIntegerValue); proto_item_append_text(ti, " %u", iIntegerValue); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %u", iIntegerValue); iValueOffset += iValueLength; break; case AMF3_DOUBLE: iDoubleValue = tvb_get_ntohieee_double(tvb, iValueOffset); proto_tree_add_double(val_tree, hf_amf_number, tvb, iValueOffset, 8, iDoubleValue); iValueOffset += 8; proto_item_append_text(ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue); break; case AMF3_STRING: iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* the upper 28 bits of the integer value is a string length */ iStringLength = iIntegerValue >> 1; proto_tree_add_uint(val_tree, hf_amf_stringlength, tvb, iValueOffset, iValueLength, iStringLength); iValueOffset += iValueLength; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset, iStringLength, ENC_UTF_8|ENC_NA); if (iStringLength != 0) proto_tree_add_string(val_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; proto_item_append_text(ti, " '%s'", iStringValue); if (parent_ti != NULL) proto_item_append_text(parent_ti, " '%s'", iStringValue); } else { /* the upper 28 bits of the integer value are a string reference index */ proto_tree_add_uint(val_tree, hf_amf_string_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); iValueOffset += iValueLength; proto_item_append_text(ti, " reference %u", iIntegerValue >> 1); if (parent_ti != NULL) proto_item_append_text(parent_ti, " reference %u", iIntegerValue >> 1); } break; case AMF3_DATE: iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* * The upper 28 bits of the integer value are * ignored; what follows is a double * containing milliseconds since the Epoch. */ nstime_t t; iValueOffset += iValueLength; iDoubleValue = tvb_get_ntohieee_double(tvb, iValueOffset); t.secs = (time_t)(iDoubleValue/1000); t.nsecs = (int)((iDoubleValue - 1000*(double)t.secs) * 1000000); proto_tree_add_time(val_tree, hf_amf_date, tvb, iValueOffset, 8, &t); iValueOffset += 8; proto_item_append_text(ti, "%s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); if (parent_ti != NULL) proto_item_append_text(parent_ti, "%s", abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, TRUE)); } else { /* the upper 28 bits of the integer value are an object reference index */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); iValueOffset += iValueLength; proto_item_append_text(ti, " object reference %u", iIntegerValue >> 1); if (parent_ti != NULL) proto_item_append_text(parent_ti, " object reference %u", iIntegerValue >> 1); } break; case AMF3_ARRAY: iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* * The upper 28 bits of the integer value are * a count of the number of elements in * the dense portion of the array. */ iArrayLength = iIntegerValue >> 1; proto_tree_add_uint(val_tree, hf_amf_arraydenselength, tvb, iValueOffset, iValueLength, iArrayLength); iValueOffset += iValueLength; /* * The AMF3 spec bit on the Array type is slightly * confusingly written, but seems to be saying that * the associative portion of the array follows the * size of the dense portion of the array, and the * dense portion of the array follows the associative * portion. * * Dissect the associative portion. */ for (;;) { /* Fetch the name */ iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* the upper 28 bits of the integer value is a string length */ iStringLength = iIntegerValue >> 1; if (iStringLength == 0) { /* null name marks the end of the associative part */ proto_tree_add_item(val_tree, hf_amf_end_of_associative_part, tvb, iValueOffset, iValueLength, ENC_NA); iValueOffset += iValueLength; break; } iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA); subval_tree = proto_tree_add_subtree(val_tree, tvb, iValueOffset, iStringLength, ett_amf_array_element, &subval_ti, iStringValue); proto_tree_add_uint(subval_tree, hf_amf_stringlength, tvb, iValueOffset, iValueLength, iStringLength); iValueOffset += iValueLength; proto_tree_add_string(subval_tree, hf_amf_string, tvb, iValueOffset, iStringLength, iStringValue); } else { /* the upper 28 bits of the integer value are a string reference index */ subval_tree = proto_tree_add_subtree_format(val_tree, tvb, iValueOffset, iValueLength, ett_amf_array_element, &subval_ti, "Reference %u:", iIntegerValue >> 1); proto_tree_add_uint(subval_tree, hf_amf_string_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); } /* Fetch the value */ iObjType = tvb_get_guint8(tvb, offset); proto_item_append_text(subval_ti, "%s", val_to_str_const(iObjType, amf3_type_vals, "Unknown")); iValueOffset = dissect_amf3_value_type(tvb, iValueOffset, subval_tree, subval_ti); } /* * Dissect the dense portion. */ for (i = 0; i < iArrayLength; i++) iValueOffset = dissect_amf3_value_type(tvb, iValueOffset, val_tree, NULL); proto_item_set_end(ti, tvb, iValueOffset); } else { /* the upper 28 bits of the integer value are an object reference index */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); proto_item_append_text(ti, " reference %u", iIntegerValue >> 1); if (parent_ti != NULL) proto_item_append_text(parent_ti, " reference %u", iIntegerValue >> 1); } break; case AMF3_OBJECT: iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { if (iIntegerValue & 0x00000002) { if (iIntegerValue & 0x00000004) { /* * U29O-traits-ext; the rest of * iIntegerValue is not significant, * and, worse, we have idea what * follows the class name, or even * how many bytes follow the class * name - that's by convention between * the client and server. */ iValueOffset += iValueLength; } else { /* * U29O-traits; the 0x00000008 bit * specifies whether the type is * dynamic. */ iTypeIsDynamic = (iIntegerValue & 0x00000008) ? TRUE : FALSE; iTraitCount = iIntegerValue >> 4; proto_tree_add_uint(val_tree, hf_amf_traitcount, tvb, iValueOffset, iValueLength, iTraitCount); iValueOffset += iValueLength; iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* the upper 28 bits of the integer value is a string length */ iStringLength = iIntegerValue >> 1; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA); traits_tree = proto_tree_add_subtree_format(val_tree, tvb, iValueOffset, -1, ett_amf_traits, &traits_ti, "Traits for class %s (%u member names)", iStringValue, iTraitCount); name_tree = proto_tree_add_subtree_format(traits_tree, tvb, iValueOffset, iValueLength+iStringLength, ett_amf_string, NULL, "Class name: %s", iStringValue); proto_tree_add_uint(name_tree, hf_amf_classnamelength, tvb, iValueOffset, iValueLength, iStringLength); iValueOffset += iValueLength; proto_tree_add_string(name_tree, hf_amf_classname, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; } else { /* the upper 28 bits of the integer value are a string reference index */ traits_tree = proto_tree_add_subtree_format(val_tree, tvb, iValueOffset, iValueLength, ett_amf_traits, &traits_ti, "Traits for class (reference %u for name)", iIntegerValue >> 1); proto_tree_add_uint(traits_tree, hf_amf_string_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); iValueOffset += iValueLength; } for (i = 0; i < iTraitCount; i++) { iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* the upper 28 bits of the integer value is a string length */ iStringLength = iIntegerValue >> 1; iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA); member_tree = proto_tree_add_subtree_format(traits_tree, tvb, iValueOffset, iValueLength+iStringLength, ett_amf_trait_member, NULL, "Member '%s'", iStringValue); proto_tree_add_uint(member_tree, hf_amf_membernamelength, tvb, iValueOffset, iValueLength, iStringLength); iValueOffset += iValueLength; proto_tree_add_string(member_tree, hf_amf_membername, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; } else { /* the upper 28 bits of the integer value are a string reference index */ proto_tree_add_uint(traits_tree, hf_amf_string_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); iValueOffset += iValueLength; } } for (i = 0; i < iTraitCount; i++) iValueOffset = dissect_amf3_value_type(tvb, iValueOffset, traits_tree, NULL); if (iTypeIsDynamic) { for (;;) { /* Fetch the name */ iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* the upper 28 bits of the integer value is a string length */ iStringLength = iIntegerValue >> 1; if (iStringLength == 0) { /* null name marks the end of the associative part */ proto_tree_add_item(traits_tree, hf_amf_end_of_dynamic_members, tvb, iValueOffset, iValueLength, ENC_NA); iValueOffset += iValueLength; break; } iStringValue = tvb_get_string_enc(wmem_packet_scope(), tvb, iValueOffset+iValueLength, iStringLength, ENC_UTF_8|ENC_NA); subval_tree = proto_tree_add_subtree_format(traits_tree, tvb, iValueOffset, -1, ett_amf_array_element, &subval_ti, "%s:", iStringValue); name_tree = proto_tree_add_subtree_format(subval_tree, tvb, iValueOffset, iValueLength+iStringLength, ett_amf_string, NULL, "Member name: %s", iStringValue); proto_tree_add_uint(name_tree, hf_amf_membernamelength, tvb, iValueOffset, iValueLength, iStringLength); iValueOffset += iValueLength; proto_tree_add_string(name_tree, hf_amf_membername, tvb, iValueOffset, iStringLength, iStringValue); iValueOffset += iStringLength; } else { /* the upper 28 bits of the integer value are a string reference index */ subval_tree = proto_tree_add_subtree_format(traits_tree, tvb, iValueOffset, iValueLength, ett_amf_array_element, &subval_ti, "Reference %u:", iIntegerValue >> 1); proto_tree_add_uint(subval_tree, hf_amf_string_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); iValueOffset += iValueLength; } /* Fetch the value */ iValueOffset = dissect_amf3_value_type(tvb, iValueOffset, subval_tree, subval_ti); proto_item_set_end(subval_ti, tvb, iValueOffset); } } proto_item_set_end(traits_ti, tvb, iValueOffset); } } else { /* * U29O-traits-ref; the upper 27 bits of * the integer value are a traits reference * index. */ proto_tree_add_uint(val_tree, hf_amf_trait_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 2); iValueOffset += iValueLength; } } else { /* * U29O-ref; the upper 28 bits of the integer value * are an object reference index. */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); proto_item_append_text(ti, " reference %u", iIntegerValue >> 1); if (parent_ti != NULL) proto_item_append_text(parent_ti, " reference %u", iIntegerValue >> 1); } break; case AMF3_XML: iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* * The upper 28 bits of the integer value are * a count of the number of bytes in the * XML string. */ iStringLength = iIntegerValue >> 1; proto_tree_add_uint(val_tree, hf_amf_xmllength, tvb, iValueOffset, iValueLength, iStringLength); iValueOffset += iValueLength; proto_tree_add_item(val_tree, hf_amf_xml, tvb, iValueOffset, iStringLength, ENC_UTF_8); } else { /* the upper 28 bits of the integer value are a string reference index */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); proto_item_append_text(ti, " reference %u", iIntegerValue >> 1); if (parent_ti != NULL) proto_item_append_text(parent_ti, " reference %u", iIntegerValue >> 1); } break; case AMF3_BYTEARRAY: iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength); if (iIntegerValue & 0x00000001) { /* * The upper 28 bits of the integer value are * a count of the number of bytes in the * byte array. */ iArrayLength = iIntegerValue >> 1; proto_tree_add_uint(val_tree, hf_amf_bytearraylength, tvb, iValueOffset, iValueLength, iArrayLength); iValueOffset += iValueLength; iByteArrayValue = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, iValueOffset, iArrayLength); proto_tree_add_bytes(val_tree, hf_amf_bytearray, tvb, iValueOffset, iArrayLength, iByteArrayValue); proto_item_append_text(ti, " %s", bytes_to_str(wmem_packet_scope(), iByteArrayValue, iArrayLength)); if (parent_ti != NULL) proto_item_append_text(parent_ti, " %s", bytes_to_str(wmem_packet_scope(), iByteArrayValue, iArrayLength)); } else { /* the upper 28 bits of the integer value are a object reference index */ proto_tree_add_uint(val_tree, hf_amf_object_reference, tvb, iValueOffset, iValueLength, iIntegerValue >> 1); proto_item_append_text(ti, " reference %u", iIntegerValue >> 1); if (parent_ti != NULL) proto_item_append_text(parent_ti, " reference %u", iIntegerValue >> 1); } break; default: /* * If we can't determine the length, don't carry on; * just skip to the end of the tvbuff. */ iValueOffset = tvb_reported_length(tvb); break; } proto_item_set_end(ti, tvb, iValueOffset); return iValueOffset; } static gint dissect_rtmpt_body_command(tvbuff_t *tvb, gint offset, proto_tree *rtmpt_tree, gboolean amf3) { gboolean amf3_encoding = FALSE; if (amf3) { /* Looks like for the AMF3 variants we get a 0 byte here, * followed by AMF0 encoding - I've never seen actual AMF3 * encoding used, which is completely different. I speculate * that if the byte is AMF0_AMF3_MARKER then the rest * will be in AMF3. For now, assume AMF0 only. */ offset++; } while (tvb_reported_length_remaining(tvb, offset) > 0) { if (amf3_encoding) offset = dissect_amf3_value_type(tvb, offset, rtmpt_tree, NULL); else offset = dissect_amf0_value_type(tvb, offset, rtmpt_tree, &amf3_encoding, NULL); } return offset; } static void dissect_rtmpt_body_audio(tvbuff_t *tvb, gint offset, proto_tree *rtmpt_tree) { guint8 iCtl; proto_item *ai; proto_tree *at; iCtl = tvb_get_guint8(tvb, offset); ai = proto_tree_add_uint_format(rtmpt_tree, hf_rtmpt_audio_control, tvb, offset, 1, iCtl, "Control: 0x%02x (%s %s %s %s)", iCtl, val_to_str_const((iCtl & 0xf0)>>4, rtmpt_audio_codecs, "Unknown codec"), val_to_str_const((iCtl & 0x0c)>>2, rtmpt_audio_rates, "Unknown rate"), val_to_str_const((iCtl & 0x02)>>1, rtmpt_audio_sizes, "Unknown sample size"), val_to_str_const(iCtl & 0x01, rtmpt_audio_types, "Unknown channel count")); at = proto_item_add_subtree(ai, ett_rtmpt_audio_control); proto_tree_add_uint(at, hf_rtmpt_audio_format, tvb, offset, 1, iCtl); proto_tree_add_uint(at, hf_rtmpt_audio_rate, tvb, offset, 1, iCtl); proto_tree_add_uint(at, hf_rtmpt_audio_size, tvb, offset, 1, iCtl); proto_tree_add_uint(at, hf_rtmpt_audio_type, tvb, offset, 1, iCtl); proto_tree_add_item(rtmpt_tree, hf_rtmpt_audio_data, tvb, offset+1, -1, ENC_NA); } static void dissect_rtmpt_body_video(tvbuff_t *tvb, gint offset, proto_tree *rtmpt_tree) { guint8 iCtl; proto_item *vi; proto_tree *vt; iCtl = tvb_get_guint8(tvb, offset); vi = proto_tree_add_uint_format(rtmpt_tree, hf_rtmpt_video_control, tvb, offset, 1, iCtl, "Control: 0x%02x (%s %s)", iCtl, val_to_str_const((iCtl & 0xf0)>>4, rtmpt_video_types, "Unknown frame type"), val_to_str_const(iCtl & 0x0f, rtmpt_video_codecs, "Unknown codec")); vt = proto_item_add_subtree(vi, ett_rtmpt_video_control); proto_tree_add_uint(vt, hf_rtmpt_video_type, tvb, offset, 1, iCtl); proto_tree_add_uint(vt, hf_rtmpt_video_format, tvb, offset, 1, iCtl); proto_tree_add_item(rtmpt_tree, hf_rtmpt_video_data, tvb, offset+1, -1, ENC_NA); } static void dissect_rtmpt_body_aggregate(tvbuff_t *tvb, gint offset, proto_tree *rtmpt_tree) { proto_tree *tag_tree; proto_tree *data_tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { guint8 iTagType; guint iDataSize; iTagType = tvb_get_guint8(tvb, offset + 0); iDataSize = tvb_get_ntoh24(tvb, offset + 1); tag_tree = proto_tree_add_subtree(rtmpt_tree, tvb, offset, 11+iDataSize+4, ett_rtmpt_tag, NULL, val_to_str_const(iTagType, rtmpt_tag_vals, "Unknown Tag")); proto_tree_add_item(tag_tree, hf_rtmpt_tag_type, tvb, offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tag_tree, hf_rtmpt_tag_datasize, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tag_tree, hf_rtmpt_tag_timestamp, tvb, offset+4, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tag_tree, hf_rtmpt_tag_ets, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tag_tree, hf_rtmpt_tag_streamid, tvb, offset+8, 3, ENC_BIG_ENDIAN); data_tree = proto_tree_add_subtree(tag_tree, tvb, offset+11, iDataSize, ett_rtmpt_tag_data, NULL, "Data"); switch (iTagType) { case 8: dissect_rtmpt_body_audio(tvb, offset + 11, data_tree); break; case 9: dissect_rtmpt_body_video(tvb, offset + 11, data_tree); break; case 18: dissect_rtmpt_body_command(tvb, offset + 11, data_tree, FALSE); break; default: break; } proto_tree_add_item(tag_tree, hf_rtmpt_tag_tagsize, tvb, offset+11+iDataSize, 4, ENC_BIG_ENDIAN); offset += 11 + iDataSize + 4; } } /* The main dissector for unchunked packets */ static void dissect_rtmpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_conv_t *rconv, int cdir, rtmpt_packet_t *tp) { gint offset = 0; gchar *sDesc = NULL; gint deschasopcode = FALSE; gboolean haveETS = FALSE; guint32 iBodyOffset = 0; guint32 iBodyRemain = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP"); RTMPT_DEBUG("Dissect: frame=%u visited=%d len=%d tree=%p\n", pinfo->num, pinfo->fd->visited, tvb_reported_length_remaining(tvb, offset), tree); /* Clear any previous data in Info column (RTMP packets are protected by a "fence") */ col_clear(pinfo->cinfo, COL_INFO); if (tvb_reported_length_remaining(tvb, offset) < 1) return; if (tp->id <= RTMPT_ID_MAX) { if (tp->fmt < 3 && tvb_reported_length_remaining(tvb, offset) >= tp->bhlen+3 && tvb_get_ntoh24(tvb, offset+tp->bhlen) == 0xffffff) { haveETS = TRUE; } iBodyOffset = offset + tp->bhlen + tp->mhlen; iBodyRemain = tvb_reported_length_remaining(tvb, iBodyOffset); if (tp->cmd == RTMPT_TYPE_CHUNK_SIZE && tp->len >= 4 && iBodyRemain >= 4) { guint32 newchunksize = tvb_get_ntohl(tvb, iBodyOffset); if (newchunksize < rtmpt_max_packet_size) { wmem_tree_insert32(rconv->chunksize[cdir], tp->lastseq, GINT_TO_POINTER(newchunksize)); } } if (tp->cmd == RTMPT_TYPE_COMMAND_AMF0 || tp->cmd == RTMPT_TYPE_COMMAND_AMF3 || tp->cmd == RTMPT_TYPE_DATA_AMF0 || tp->cmd == RTMPT_TYPE_DATA_AMF3) { guint32 soff = 0; if (tp->cmd == RTMPT_TYPE_COMMAND_AMF3 || tp->cmd == RTMPT_TYPE_DATA_AMF3) { soff = 1; } tp->txid = rtmpt_get_amf_txid(tvb, iBodyOffset+soff, tree); if (tp->txid != 0 && !PINFO_FD_VISITED(pinfo)) { RTMPT_DEBUG("got txid=%d\n", tp->txid); wmem_tree_insert32(rconv->txids[cdir], tp->txid, GINT_TO_POINTER(pinfo->num)); } } } if (tp->id <= RTMPT_ID_MAX) { sDesc = rtmpt_get_packet_desc(tvb, iBodyOffset, tree, iBodyRemain, rconv, cdir, tp, &deschasopcode); } if (tp->id>RTMPT_ID_MAX) { col_append_sep_str(pinfo->cinfo, COL_INFO, "|", val_to_str(tp->id, rtmpt_handshake_vals, "Unknown (0x%01x)")); col_set_fence(pinfo->cinfo, COL_INFO); } else if (sDesc) { col_append_sep_str(pinfo->cinfo, COL_INFO, "|", sDesc); col_set_fence(pinfo->cinfo, COL_INFO); } else { col_append_sep_str(pinfo->cinfo, COL_INFO, "|", val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)")); col_set_fence(pinfo->cinfo, COL_INFO); } if (tree) { proto_tree *rtmpt_tree = NULL; proto_tree *rtmptroot_tree = NULL; proto_item *ti; ti = proto_tree_add_item(tree, proto_rtmpt, tvb, offset, -1, ENC_NA); if (tp->id > RTMPT_ID_MAX) { /* Dissect handshake */ proto_item_append_text(ti, " (%s)", val_to_str(tp->id, rtmpt_handshake_vals, "Unknown (0x%01x)")); rtmptroot_tree = proto_item_add_subtree(ti, ett_rtmpt); rtmpt_tree = proto_tree_add_subtree(rtmptroot_tree, tvb, offset, -1, ett_rtmpt_handshake, NULL, val_to_str(tp->id, rtmpt_handshake_vals, "Unknown (0x%01x)")); if (tp->id == RTMPT_TYPE_HANDSHAKE_1) { proto_tree_add_item(rtmpt_tree, hf_rtmpt_handshake_c0, tvb, 0, 1, ENC_NA); proto_tree_add_item(rtmpt_tree, hf_rtmpt_handshake_c1, tvb, 1, 1536, ENC_NA); } else if (tp->id == RTMPT_TYPE_HANDSHAKE_2) { proto_tree_add_item(rtmpt_tree, hf_rtmpt_handshake_s0, tvb, 0, 1, ENC_NA); proto_tree_add_item(rtmpt_tree, hf_rtmpt_handshake_s1, tvb, 1, 1536, ENC_NA); proto_tree_add_item(rtmpt_tree, hf_rtmpt_handshake_s2, tvb, 1537, 1536, ENC_NA); } else if (tp->id == RTMPT_TYPE_HANDSHAKE_3) { proto_tree_add_item(rtmpt_tree, hf_rtmpt_handshake_c2, tvb, 0, 1536, ENC_NA); } return; } if (sDesc && deschasopcode) { proto_item_append_text(ti, " (%s)", sDesc); } else if (sDesc) { proto_item_append_text(ti, " (%s %s)", val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"), sDesc); } else { proto_item_append_text(ti, " (%s)", val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)")); } rtmptroot_tree = proto_item_add_subtree(ti, ett_rtmpt); /* Function call/response matching */ if (tp->otherframe != 0) { proto_tree_add_uint(rtmptroot_tree, tp->isresponse ? hf_rtmpt_function_response : hf_rtmpt_function_call, tvb, offset, tp->bhlen+tp->mhlen+tp->len, tp->otherframe); } /* Dissect header fields */ rtmpt_tree = proto_tree_add_subtree(rtmptroot_tree, tvb, offset, tp->bhlen+tp->mhlen, ett_rtmpt_header, NULL, RTMPT_TEXT_RTMP_HEADER); /* proto_item_append_text(ti, " (%s)", val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)")); */ if (tp->fmt <= 3) proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_format, tvb, offset + 0, 1, ENC_BIG_ENDIAN); if (tp->fmt <= 3) proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_csid, tvb, offset + 0, tp->bhlen, ENC_BIG_ENDIAN); if (tp->fmt <= 2) { if (tp->fmt > 0) { proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_timestamp_delta, tvb, offset + tp->bhlen, 3, ENC_BIG_ENDIAN); } else { proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_timestamp, tvb, offset + tp->bhlen, 3, ENC_BIG_ENDIAN); } if (haveETS) { proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_ets, tvb, offset + tp->bhlen + tp->mhlen - 4, 4, ENC_BIG_ENDIAN); } } if ((tp->fmt>0 && !haveETS) || tp->fmt == 3) { proto_tree_add_uint_format_value(rtmpt_tree, hf_rtmpt_header_timestamp, tvb, offset + tp->bhlen, 0, tp->ts, "%d (calculated)", tp->ts); } if (tp->fmt <= 1) proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_body_size, tvb, offset + tp->bhlen + 3, 3, ENC_BIG_ENDIAN); if (tp->fmt <= 1) proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_typeid, tvb, offset + tp->bhlen + 6, 1, ENC_BIG_ENDIAN); if (tp->fmt <= 0) proto_tree_add_item(rtmpt_tree, hf_rtmpt_header_streamid, tvb, offset + tp->bhlen + 7, 4, ENC_LITTLE_ENDIAN); /* Dissect body */ if (tp->len == 0) return; offset = iBodyOffset; rtmpt_tree = proto_tree_add_subtree(rtmptroot_tree, tvb, offset, -1, ett_rtmpt_body, NULL, RTMPT_TEXT_RTMP_BODY); switch (tp->cmd) { case RTMPT_TYPE_CHUNK_SIZE: case RTMPT_TYPE_ABORT_MESSAGE: case RTMPT_TYPE_ACKNOWLEDGEMENT: case RTMPT_TYPE_UCM: case RTMPT_TYPE_WINDOW: case RTMPT_TYPE_PEER_BANDWIDTH: dissect_rtmpt_body_scm(tvb, offset, rtmpt_tree, tp->cmd); break; case RTMPT_TYPE_COMMAND_AMF0: case RTMPT_TYPE_DATA_AMF0: dissect_rtmpt_body_command(tvb, offset, rtmpt_tree, FALSE); break; case RTMPT_TYPE_COMMAND_AMF3: case RTMPT_TYPE_DATA_AMF3: dissect_rtmpt_body_command(tvb, offset, rtmpt_tree, TRUE); break; case RTMPT_TYPE_AUDIO_DATA: dissect_rtmpt_body_audio(tvb, offset, rtmpt_tree); break; case RTMPT_TYPE_VIDEO_DATA: dissect_rtmpt_body_video(tvb, offset, rtmpt_tree); break; case RTMPT_TYPE_AGGREGATE: dissect_rtmpt_body_aggregate(tvb, offset, rtmpt_tree); break; } } } /* Unchunk a data stream into individual RTMP packets */ static void dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_conv_t *rconv, int cdir, guint32 seq, guint32 lastackseq) { int offset = 0; int remain; int want; guint8 header_type; int basic_hlen; int message_hlen; guint32 id; guint32 ts = 0; guint32 tsd = 0; int body_len; guint8 cmd; guint32 src; int chunk_size; rtmpt_frag_t *tf; rtmpt_id_t *ti; rtmpt_packet_t *tp; tvbuff_t *pktbuf; remain = tvb_reported_length(tvb); if (!remain) return; RTMPT_DEBUG("Segment: cdir=%d seq=%d-%d\n", cdir, seq, seq+remain-1); if (pinfo->fd->visited) { /* Already done the work, so just dump the existing state */ /* XXX: If there's bogus sequence numbers and the * tcp.analyze_sequence_numbers pref is TRUE, we can't actually * assume that we processed this frame the first time around, * since the TCP dissector might not have given it to us. */ wmem_stack_t *packets; /* List all RTMP packets terminating in this TCP segment, from end to beginning */ packets = wmem_stack_new(wmem_packet_scope()); wmem_stack_push(packets, 0); tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(rconv->packets[cdir], seq+remain-1); while (tp && GE_SEQ(tp->lastseq, seq)) { /* Sequence numbers can wrap around (especially with * tcp.relative_sequence_numbers FALSE), so use the * wrap around aware comparison from packet-tcp.h */ wmem_stack_push(packets, tp); if (tp->seq == 0) { // reached first segment. /* XXX: Assuming tcp.relative_sequence_numbers * is TRUE, that is, since on TCP we just * reuse the sequence numbers from tcpinfo. */ break; } if (tp->seq > tp->lastseq) { /* XXX: There are some problems with sequence * numbers that wraparound in the middle of * a segment and using wmem_tree_lookup32_le * below. Break out here to guarantee that there * is a limit to the tree lookups and we don't * have infinite loops. Really a lot of this * code should be rewritten to deal with * sequence numbers that wrap around (especially * (SYN packets with altered sequence numbers * and out of order packets.) */ break; } tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(rconv->packets[cdir], tp->seq-1); } /* Dissect the generated list in reverse order (beginning to end) */ while ((tp=(rtmpt_packet_t *)wmem_stack_pop(packets)) != NULL) { if (tp->resident) { pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have); add_new_data_source(pinfo, pktbuf, "Unchunked RTMP"); } else { pktbuf = tvb_new_subset_length(tvb, tp->data.offset, tp->have); } dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp); } return; } while (remain>0) { tf = NULL; ti = NULL; tp = NULL; /* Check for outstanding fragmented headers/chunks first */ if (offset == 0) { tf = (rtmpt_frag_t *)wmem_tree_lookup32_le(rconv->frags[cdir], seq+offset-1); if (tf) { /* May need to reassemble cross-TCP-segment fragments */ RTMPT_DEBUG(" tf seq=%d lseq=%d h=%d l=%d\n", tf->seq, tf->lastseq, tf->have, tf->len); if (tf->have >= tf->len || seq+offset < tf->seq || seq+offset > tf->lastseq+tf->len-tf->have) { tf = NULL; } else if (!tf->ishdr) { ti = (rtmpt_id_t *)wmem_tree_lookup32(rconv->ids[cdir], tf->saved.id); if (ti) { tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(ti->packets, seq+offset-1); } if (tp && tp->chunkwant) { goto unchunk; } tf = NULL; ti = NULL; tp = NULL; } if (tf) { /* The preceding segment contained an incomplete chunk header */ want = tf->len - tf->have; if (remain<want) want = remain; tvb_memcpy(tvb, tf->saved.d+tf->have, offset, want); id = tf->saved.d[0]; header_type = (id>>6) & 3; basic_hlen = rtmpt_basic_header_length(id); if ((header_type < 3) && (tf->have < (basic_hlen+3)) && (tf->have+want >= (basic_hlen+3))) { if (pntoh24(tf->saved.d+basic_hlen) == 0xffffff) { tf->len += 4; } } tf->have += want; tf->lastseq = seq+want-1; remain -= want; offset += want; if (tf->have < tf->len) { return; } } } } if (!tf) { /* No preceeding data, get header data starting at current position */ id = tvb_get_guint8(tvb, offset); if (id == RTMPT_MAGIC && seq+offset == RTMPT_HANDSHAKE_OFFSET_1) { header_type = 4; basic_hlen = 1; message_hlen = 0; id = lastackseq == 1 ? RTMPT_TYPE_HANDSHAKE_1 : RTMPT_TYPE_HANDSHAKE_2; } else if (seq+offset == RTMPT_HANDSHAKE_OFFSET_2) { header_type = 4; basic_hlen = 0; message_hlen = 0; id = RTMPT_TYPE_HANDSHAKE_3; } else { header_type = (id>>6) & 3; basic_hlen = rtmpt_basic_header_length(id); message_hlen = rtmpt_message_header_length(id); if ((header_type < 3) && (remain >= (basic_hlen+3))) { if (tvb_get_ntoh24(tvb, offset+basic_hlen) == 0xffffff) { message_hlen += 4; } } if (remain < (basic_hlen+message_hlen)) { /* Ran out of packet mid-header, save and try again next time */ tf = wmem_new(wmem_file_scope(), rtmpt_frag_t); tf->ishdr = 1; tf->seq = seq + offset; tf->lastseq = tf->seq + remain - 1; tf->len = basic_hlen + message_hlen; tvb_memcpy(tvb, tf->saved.d, offset, remain); tf->have = remain; wmem_tree_insert32(rconv->frags[cdir], seq+offset, tf); return; } id = id & 0x3f; if (id == 0) id = tvb_get_guint8(tvb, offset+1) + 64; else if (id == 1) id = tvb_get_letohs(tvb, offset+1) + 64; } } else { /* Use reassembled header data */ id = tf->saved.d[0]; header_type = (id>>6) & 3; basic_hlen = rtmpt_basic_header_length(id); message_hlen = tf->len - basic_hlen; id = id & 0x3f; if (id == 0) id = tf->saved.d[1] + 64; else if (id == 1) id = pletoh16(tf->saved.d+1) + 64; } /* Calculate header values, defaulting from previous packets with same id */ if (id <= RTMPT_ID_MAX) ti = (rtmpt_id_t *)wmem_tree_lookup32(rconv->ids[cdir], id); if (ti) tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(ti->packets, seq+offset-1); if (header_type == 0) src = tf ? pntoh32(tf->saved.d+basic_hlen+7) : tvb_get_ntohl(tvb, offset+basic_hlen+7); else if (ti) src = ti->src; else src = 0; if (header_type < 2) cmd = tf ? tf->saved.d[basic_hlen+6] : tvb_get_guint8(tvb, offset+basic_hlen+6); else if (ti) cmd = ti->cmd; else cmd = 0; /* Calculate chunk_size now as a last-resort default payload length */ if (id > RTMPT_ID_MAX) { if (id == RTMPT_TYPE_HANDSHAKE_1) chunk_size = body_len = 1536; else if (id == RTMPT_TYPE_HANDSHAKE_2) chunk_size = body_len = 3072; else /* if (id == RTMPT_TYPE_HANDSHAKE_3) */ chunk_size = body_len = 1536; } else { chunk_size = GPOINTER_TO_INT(wmem_tree_lookup32_le(rconv->chunksize[cdir], seq+offset-1)); if (!chunk_size) chunk_size = RTMPT_DEFAULT_CHUNK_SIZE; if (header_type < 2) body_len = tf ? pntoh24(tf->saved.d+basic_hlen+3) : tvb_get_ntoh24(tvb, offset+basic_hlen+3); else if (ti) body_len = ti->len; else body_len = chunk_size; if (body_len > (gint)rtmpt_max_packet_size) { return; } } if (!ti || !tp || header_type<3 || tp->have == tp->want || tp->chunkhave != tp->chunkwant) { /* Start a new packet if: * no previous packet with same id * not a short 1-byte header * previous packet with same id was complete * previous incomplete chunk not handled by fragment handler */ RTMPT_DEBUG("New packet cdir=%d seq=%d ti=%p tp=%p header_type=%d header_len=%d id=%d tph=%d tpw=%d len=%d cs=%d\n", cdir, seq+offset, ti, tp, header_type, basic_hlen+message_hlen, id, tp?tp->have:0, tp?tp->want:0, body_len, chunk_size); if (!ti) { ti = wmem_new(wmem_file_scope(), rtmpt_id_t); ti->packets = wmem_tree_new(wmem_file_scope()); ti->ts = 0; ti->tsd = 0; wmem_tree_insert32(rconv->ids[cdir], id, ti); } if (header_type == 0) { ts = tf ? pntoh24(tf->saved.d+basic_hlen) : tvb_get_ntoh24(tvb, offset+basic_hlen); if (ts == 0xffffff) { ts = tf ? pntoh32(tf->saved.d+basic_hlen+11) : tvb_get_ntohl(tvb, offset+basic_hlen+11); } tsd = ts - ti->ts; } else if (header_type < 3) { tsd = tf ? pntoh24(tf->saved.d+basic_hlen) : tvb_get_ntoh24(tvb, offset+basic_hlen); if (tsd == 0xffffff) { ts = tf ? pntoh32(tf->saved.d+basic_hlen+message_hlen-4) : tvb_get_ntohl(tvb, offset+basic_hlen+message_hlen-4); tsd = ti->tsd; /* questionable */ } else { ts = ti->ts + tsd; } } else { ts = ti->ts + ti->tsd; tsd = ti->tsd; } /* create a new packet structure */ tp = wmem_new(wmem_file_scope(), rtmpt_packet_t); tp->seq = tp->lastseq = tf ? tf->seq : seq+offset; tp->have = 0; tp->want = basic_hlen + message_hlen + body_len; tp->chunkwant = 0; tp->chunkhave = 0; tp->bhlen = basic_hlen; tp->mhlen = message_hlen; tp->fmt = header_type; tp->id = id; tp->ts = ts; tp->len = body_len; if (id > RTMPT_ID_MAX) tp->cmd = id; else tp->cmd = cmd & 0x7f; tp->src = src; tp->txid = 0; tp->isresponse = FALSE; tp->otherframe = 0; /* Save the header information for future defaulting needs */ ti->ts = ts; ti->tsd = tsd; ti->len = body_len; ti->cmd = cmd; ti->src = src; /* store against the id only until unchunking is complete */ wmem_tree_insert32(ti->packets, tp->seq, tp); if (!tf && body_len <= chunk_size && tp->want <= remain) { /* The easy case - a whole packet contiguous and fully within this segment */ tp->resident = FALSE; tp->data.offset = offset; tp->lastseq = seq+offset+tp->want-1; tp->have = tp->want; wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp); pktbuf = tvb_new_subset_length(tvb, tp->data.offset, tp->have); dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp); offset += tp->want; remain -= tp->want; continue; } else { /* Some more reassembly required */ tp->resident = TRUE; tp->data.p = (guint8 *)wmem_alloc(wmem_file_scope(), tp->bhlen+tp->mhlen+tp->len); if (tf && tf->ishdr) { memcpy(tp->data.p, tf->saved.d, tf->len); } else { tvb_memcpy(tvb, tp->data.p, offset, basic_hlen+message_hlen); offset += basic_hlen + message_hlen; remain -= basic_hlen + message_hlen; } tp->lastseq = seq+offset-1; tp->have = basic_hlen + message_hlen; if (tp->have == tp->want) { wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp); pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have); add_new_data_source(pinfo, pktbuf, "Unchunked RTMP"); dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp); continue; } tp->chunkwant = chunk_size; if (tp->chunkwant > tp->want-tp->have) tp->chunkwant = tp->want - tp->have; } } else { if (header_type == 3 && tp->resident && tp->have > tp->bhlen + 3 && pntoh24(tp->data.p+tp->bhlen) == 0xffffff) { /* Header type 3 resends the extended time stamp if the last message on the chunk * stream had an extended timestamp. * See: https://gitlab.com/wireshark/wireshark/-/issues/15718 */ message_hlen += 4; } RTMPT_DEBUG("Old packet cdir=%d seq=%d ti=%p tp=%p header_len=%d id=%d tph=%d tpw=%d len=%d cs=%d\n", cdir, seq+offset, ti, tp, basic_hlen+message_hlen, id, tp?tp->have:0, tp?tp->want:0, body_len, chunk_size); tp->chunkwant = chunk_size; if (tp->chunkwant > tp->want-tp->have) tp->chunkwant = tp->want - tp->have; offset += basic_hlen + message_hlen; remain -= basic_hlen + message_hlen; } tf = NULL; /* Last case to deal with is unchunking the packet body */ unchunk: want = tp->chunkwant - tp->chunkhave; if (want > remain) want = remain; RTMPT_DEBUG(" cw=%d ch=%d r=%d w=%d\n", tp->chunkwant, tp->chunkhave, remain, want); tvb_memcpy(tvb, tp->data.p+tp->have, offset, want); if (tf) { tf->have += want; tf->lastseq = seq+offset+want-1; } tp->lastseq = seq+offset+want-1; tp->have += want; tp->chunkhave += want; offset += want; remain -= want; if (tp->chunkhave == tp->chunkwant) { /* Chunk is complete - wait for next header */ tp->chunkhave = 0; tp->chunkwant = 0; } if (tp->have == tp->want) { /* Whole packet is complete */ wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp); pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have); add_new_data_source(pinfo, pktbuf, "Unchunked RTMP"); dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp); } else if (tp->chunkhave < tp->chunkwant) { /* Chunk is split across segment boundary */ rtmpt_frag_t *tf2 = wmem_new(wmem_file_scope(), rtmpt_frag_t); tf2->ishdr = 0; tf2->seq = seq + offset - want; tf2->lastseq = tf2->seq + remain - 1 + want; tf2->have = tp->chunkhave; tf2->len = tp->chunkwant; tf2->saved.id = tp->id; RTMPT_DEBUG(" inserting tf @ %d\n", seq+offset-want-1); wmem_tree_insert32(rconv->frags[cdir], seq+offset-want-1, tf2); } } } static rtmpt_conv_t * rtmpt_init_rconv(conversation_t *conv) { rtmpt_conv_t *rconv = wmem_new(wmem_file_scope(), rtmpt_conv_t); conversation_add_proto_data(conv, proto_rtmpt, rconv); rconv->seqs[0] = wmem_tree_new(wmem_file_scope()); rconv->seqs[1] = wmem_tree_new(wmem_file_scope()); rconv->frags[0] = wmem_tree_new(wmem_file_scope()); rconv->frags[1] = wmem_tree_new(wmem_file_scope()); rconv->ids[0] = wmem_tree_new(wmem_file_scope()); rconv->ids[1] = wmem_tree_new(wmem_file_scope()); rconv->packets[0] = wmem_tree_new(wmem_file_scope()); rconv->packets[1] = wmem_tree_new(wmem_file_scope()); rconv->chunksize[0] = wmem_tree_new(wmem_file_scope()); rconv->chunksize[1] = wmem_tree_new(wmem_file_scope()); rconv->txids[0] = wmem_tree_new(wmem_file_scope()); rconv->txids[1] = wmem_tree_new(wmem_file_scope()); return rconv; } static int dissect_rtmpt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { conversation_t *conv; rtmpt_conv_t *rconv; int cdir; struct tcpinfo *tcpinfo; /* Reject the packet if data is NULL */ if (data == NULL) { return 0; } tcpinfo = (struct tcpinfo*)data; conv = find_or_create_conversation(pinfo); rconv = (rtmpt_conv_t*)conversation_get_proto_data(conv, proto_rtmpt); if (!rconv) { rconv = rtmpt_init_rconv(conv); } cdir = (addresses_equal(conversation_key_addr1(conv->key_ptr), &pinfo->src) && addresses_equal(conversation_key_addr2(conv->key_ptr), &pinfo->dst) && conversation_key_port1(conv->key_ptr) == pinfo->srcport && conversation_key_port2(conv->key_ptr) == pinfo->destport) ? 0 : 1; dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, tcpinfo->seq, tcpinfo->lastackseq); return tvb_reported_length(tvb); } static int dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { conversation_t *conv; rtmpt_conv_t *rconv; int cdir; guint32 seq; guint32 lastackseq; guint32 offset; gint remain; offset = 0; remain = tvb_reported_length_remaining(tvb, 0); /* * Request flow: * * POST /open/1 * request body is a single non-RTMP byte * response contains a client ID <cid> followed by NL * POST /send/<cid>/<seq> * <seq> starts at 0 after open and increments on each * subsequent post * request body is pure RTMP data * response is a single non-RTMP byte followed by RTMP data * POST /idle/<cid>/<seq> * request contains a single non-RTMP byte * response is a single non-RTMP byte followed by RTMP data * POST /close/<cid>/<seq> * request and response contain a single non-RTMP byte * * Ideally here we'd know: * * 1) Whether this is was a HTTP request or response * (this gives us cdir directly) * 2) The requested URL (for both cases) * (this tells us the type of framing bytes present, * so whether there are any real bytes present). We * could also use the client ID to identify the * conversation, since each POST is likely to be on * a different TCP connection, and there could be * multiple simultaneous sessions from a single * client (which we don't deal with here.) * * As it is, we currently have to just guess, and are * likely easily confused. */ cdir = pinfo->srcport == pinfo->match_uint; if (cdir) { conv = find_conversation(pinfo->num, &pinfo->dst, &pinfo->src, conversation_pt_to_conversation_type(pinfo->ptype), 0, pinfo->srcport, 0); if (!conv) { RTMPT_DEBUG("RTMPT new conversation\n"); conv = conversation_new(pinfo->num, &pinfo->dst, &pinfo->src, conversation_pt_to_conversation_type(pinfo->ptype), 0, pinfo->srcport, 0); } } else { conv = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), 0, pinfo->destport, 0); if (!conv) { RTMPT_DEBUG("RTMPT new conversation\n"); conv = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), 0, pinfo->destport, 0); } } rconv = (rtmpt_conv_t*)conversation_get_proto_data(conv, proto_rtmpt); if (!rconv) { rconv = rtmpt_init_rconv(conv); } /* Work out a TCP-like sequence numbers for the tunneled data stream. * If we've seen the packet before we'll have stored the seq of our * last byte against the frame number - since we know how big we are * we can work out the seq of our first byte. If this is the first * time, we use the stored seq of the last byte of the previous frame * plus one. If there is no previous frame then we must be at seq=1! * (This is per-conversation and per-direction, of course.) */ lastackseq = GPOINTER_TO_INT(wmem_tree_lookup32_le(rconv->seqs[cdir ^ 1], pinfo->num))+1; if (cdir == 1 && lastackseq < 2 && remain == 17) { /* Session startup: the client makes an /open/ request and * the server responds with a 16 bytes client * identifier followed by a newline */ offset += 17; remain -= 17; } else if (cdir || remain == 1) { /* All other server responses start with one byte which * is not part of the RTMP stream. Client /idle/ requests * contain a single byte also not part of the stream. We * must discard these */ offset++; remain--; } seq = GPOINTER_TO_INT(wmem_tree_lookup32(rconv->seqs[cdir], pinfo->num)); if (seq == 0) { seq = GPOINTER_TO_INT(wmem_tree_lookup32_le(rconv->seqs[cdir], pinfo->num)); seq += remain; wmem_tree_insert32(rconv->seqs[cdir], pinfo->num, GINT_TO_POINTER(seq)); } seq -= remain-1; RTMPT_DEBUG("RTMPT f=%d cdir=%d seq=%d lastackseq=%d len=%d\n", pinfo->num, cdir, seq, lastackseq, remain); if (remain < 1) return offset; if (offset > 0) { tvbuff_t *tvbrtmp = tvb_new_subset_length(tvb, offset, remain); dissect_rtmpt_common(tvbrtmp, pinfo, tree, rconv, cdir, seq, lastackseq); } else { dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, seq, lastackseq); } return tvb_captured_length(tvb); } static gboolean dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { conversation_t *conversation; if (tvb_reported_length(tvb) >= 12) { /* To avoid a too high rate of false positive, this heuristics only matches the protocol from the first server response packet and not from the client request packets before. Therefore it is necessary to a "Decode as" to properly decode the first packets */ struct tcpinfo *tcpinfo = (struct tcpinfo *)data; if (tcpinfo->lastackseq == RTMPT_HANDSHAKE_OFFSET_2 && tcpinfo->seq == RTMPT_HANDSHAKE_OFFSET_1 && tvb_get_guint8(tvb, 0) == RTMPT_MAGIC) { /* Register this dissector for this conversation */ conversation = find_or_create_conversation(pinfo); conversation_set_dissector(conversation, rtmpt_tcp_handle); /* Dissect the packet */ dissect_rtmpt_tcp(tvb, pinfo, tree, data); return TRUE; } } return FALSE; } static int dissect_amf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *amf_tree, *headers_tree, *messages_tree; int offset; guint header_count, message_count, i; guint string_length; guint header_length, message_length; gboolean amf3_encoding = FALSE; /* * XXX - is "application/x-amf" just AMF3? */ ti = proto_tree_add_item(tree, proto_amf, tvb, 0, -1, ENC_NA); amf_tree = proto_item_add_subtree(ti, ett_amf); offset = 0; proto_tree_add_item(amf_tree, hf_amf_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; header_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(amf_tree, hf_amf_header_count, tvb, offset, 2, header_count); offset += 2; if (header_count != 0) { headers_tree = proto_tree_add_subtree(amf_tree, tvb, offset, -1, ett_amf_headers, NULL, "Headers"); for (i = 0; i < header_count; i++) { string_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(headers_tree, hf_amf_header_name, tvb, offset, 2, ENC_UTF_8|ENC_BIG_ENDIAN); offset += 2 + string_length; proto_tree_add_item(headers_tree, hf_amf_header_must_understand, tvb, offset, 1, ENC_NA); offset += 1; header_length = tvb_get_ntohl(tvb, offset); if (header_length == 0xFFFFFFFF) proto_tree_add_uint_format_value(headers_tree, hf_amf_header_length, tvb, offset, 4, header_length, "Unknown"); else proto_tree_add_uint(headers_tree, hf_amf_header_length, tvb, offset, 4, header_length); offset += 4; if (amf3_encoding) offset = dissect_amf3_value_type(tvb, offset, headers_tree, NULL); else offset = dissect_amf0_value_type(tvb, offset, headers_tree, &amf3_encoding, NULL); } } message_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(amf_tree, hf_amf_message_count, tvb, offset, 2, message_count); offset += 2; if (message_count != 0) { messages_tree = proto_tree_add_subtree(amf_tree, tvb, offset, -1, ett_amf_messages, NULL, "Messages"); for (i = 0; i < message_count; i++) { string_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(messages_tree, hf_amf_message_target_uri, tvb, offset, 2, ENC_UTF_8|ENC_BIG_ENDIAN); offset += 2 + string_length; string_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(messages_tree, hf_amf_message_response_uri, tvb, offset, 2, ENC_UTF_8|ENC_BIG_ENDIAN); offset += 2 + string_length; message_length = tvb_get_ntohl(tvb, offset); if (message_length == 0xFFFFFFFF) proto_tree_add_uint_format_value(messages_tree, hf_amf_message_length, tvb, offset, 4, message_length, "Unknown"); else proto_tree_add_uint(messages_tree, hf_amf_message_length, tvb, offset, 4, message_length); offset += 4; offset = dissect_rtmpt_body_command(tvb, offset, messages_tree, FALSE); } } return tvb_captured_length(tvb); } void proto_register_rtmpt(void) { static hf_register_info hf[] = { /* RTMP Handshake data */ { &hf_rtmpt_handshake_c0, { "Protocol version", "rtmpt.handshake.c0", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Handshake C0", HFILL }}, { &hf_rtmpt_handshake_s0, { "Protocol version", "rtmpt.handshake.s0", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Handshake S0", HFILL }}, { &hf_rtmpt_handshake_c1, { "Handshake data", "rtmpt.handshake.c1", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Handshake C1", HFILL }}, { &hf_rtmpt_handshake_s1, { "Handshake data", "rtmpt.handshake.s1", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Handshake S1", HFILL }}, { &hf_rtmpt_handshake_c2, { "Handshake data", "rtmpt.handshake.c2", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Handshake C2", HFILL }}, { &hf_rtmpt_handshake_s2, { "Handshake data", "rtmpt.handshake.s2", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Handshake S2", HFILL }}, /* RTMP chunk/packet header */ { &hf_rtmpt_header_format, { "Format", "rtmpt.header.format", FT_UINT8, BASE_DEC, NULL, 0xC0, "RTMPT Basic Header format", HFILL }}, { &hf_rtmpt_header_csid, { "Chunk Stream ID", "rtmpt.header.csid", FT_UINT8, BASE_DEC, NULL, 0x3F, "RTMPT Basic Header chunk stream ID", HFILL }}, { &hf_rtmpt_header_timestamp, { "Timestamp", "rtmpt.header.timestamp", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Message Header timestamp", HFILL }}, { &hf_rtmpt_header_timestamp_delta, { "Timestamp delta", "rtmpt.header.timestampdelta", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Message Header timestamp delta", HFILL }}, { &hf_rtmpt_header_body_size, { "Body size", "rtmpt.header.bodysize", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Message Header body size", HFILL }}, { &hf_rtmpt_header_typeid, { "Type ID", "rtmpt.header.typeid", FT_UINT8, BASE_HEX, VALS(rtmpt_opcode_vals), 0x0, "RTMPT Message Header type ID", HFILL }}, { &hf_rtmpt_header_streamid, { "Stream ID", "rtmpt.header.streamid", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT Header stream ID", HFILL }}, { &hf_rtmpt_header_ets, { "Extended timestamp", "rtmpt.header.ets", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Message Header extended timestamp", HFILL }}, /* Stream Control Messages */ { &hf_rtmpt_scm_chunksize, { "Chunk size", "rtmpt.scm.chunksize", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT SCM chunk size", HFILL }}, { &hf_rtmpt_scm_csid, { "Chunk stream ID", "rtmpt.scm.csid", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT SCM chunk stream ID", HFILL }}, { &hf_rtmpt_scm_seq, { "Sequence number", "rtmpt.scm.seq", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT SCM acknowledgement sequence number", HFILL }}, { &hf_rtmpt_scm_was, { "Window acknowledgement size", "rtmpt.scm.was", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT SCM window acknowledgement size", HFILL }}, { &hf_rtmpt_scm_limittype, { "Limit type", "rtmpt.scm.limittype", FT_UINT8, BASE_DEC, VALS(rtmpt_limit_vals), 0x0, "RTMPT SCM window acknowledgement size", HFILL }}, /* User Control Messages */ { &hf_rtmpt_ucm_eventtype, { "Event type", "rtmpt.ucm.eventtype", FT_UINT16, BASE_DEC, VALS(rtmpt_ucm_vals), 0x0, "RTMPT UCM event type", HFILL }}, /* Frame links */ { &hf_rtmpt_function_call, { "Response to this call in frame", "rtmpt.function.call", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "RTMPT function call", HFILL }}, { &hf_rtmpt_function_response, { "Call for this response in frame", "rtmpt.function.response", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "RTMPT function response", HFILL }}, /* Audio packets */ { &hf_rtmpt_audio_control, { "Audio control", "rtmpt.audio.control", FT_UINT8, BASE_HEX, NULL, 0x0, "RTMPT Audio control", HFILL }}, { &hf_rtmpt_audio_format, { "Format", "rtmpt.audio.format", FT_UINT8, BASE_DEC, VALS(rtmpt_audio_codecs), 0xf0, "RTMPT Audio format", HFILL }}, { &hf_rtmpt_audio_rate, { "Sample rate", "rtmpt.audio.rate", FT_UINT8, BASE_DEC, VALS(rtmpt_audio_rates), 0x0c, "RTMPT Audio sample rate", HFILL }}, { &hf_rtmpt_audio_size, { "Sample size", "rtmpt.audio.size", FT_UINT8, BASE_DEC, VALS(rtmpt_audio_sizes), 0x02, "RTMPT Audio sample size", HFILL }}, { &hf_rtmpt_audio_type, { "Channels", "rtmpt.audio.type", FT_UINT8, BASE_DEC, VALS(rtmpt_audio_types), 0x01, "RTMPT Audio channel count", HFILL }}, { &hf_rtmpt_audio_data, { "Audio data", "rtmpt.audio.data", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Audio data", HFILL }}, /* Video packets */ { &hf_rtmpt_video_control, { "Video control", "rtmpt.video.control", FT_UINT8, BASE_HEX, NULL, 0x0, "RTMPT Video control", HFILL }}, { &hf_rtmpt_video_type, { "Type", "rtmpt.video.type", FT_UINT8, BASE_DEC, VALS(rtmpt_video_types), 0xf0, "RTMPT Video type", HFILL }}, { &hf_rtmpt_video_format, { "Format", "rtmpt.video.format", FT_UINT8, BASE_DEC, VALS(rtmpt_video_codecs), 0x0f, "RTMPT Video format", HFILL }}, { &hf_rtmpt_video_data, { "Video data", "rtmpt.video.data", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT Video data", HFILL }}, /* Aggregate packets */ { &hf_rtmpt_tag_type, { "Type", "rtmpt.tag.type", FT_UINT8, BASE_DEC, VALS(rtmpt_tag_vals), 0x0, "RTMPT Aggregate tag type", HFILL }}, { &hf_rtmpt_tag_datasize, { "Data size", "rtmpt.tag.datasize", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Aggregate tag data size", HFILL }}, { &hf_rtmpt_tag_timestamp, { "Timestamp", "rtmpt.tag.timestamp", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Aggregate tag timestamp", HFILL }}, { &hf_rtmpt_tag_ets, { "Timestamp Extended", "rtmpt.tag.ets", FT_UINT8, BASE_DEC, NULL, 0x0, "RTMPT Aggregate tag timestamp extended", HFILL }}, { &hf_rtmpt_tag_streamid, { "Stream ID", "rtmpt.tag.streamid", FT_UINT24, BASE_DEC, NULL, 0x0, "RTMPT Aggregate tag stream ID", HFILL }}, { &hf_rtmpt_tag_tagsize, { "Previous tag size", "rtmpt.tag.tagsize", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT Aggregate previous tag size", HFILL }} }; static gint *ett[] = { &ett_rtmpt, &ett_rtmpt_handshake, &ett_rtmpt_header, &ett_rtmpt_body, &ett_rtmpt_ucm, &ett_rtmpt_audio_control, &ett_rtmpt_video_control, &ett_rtmpt_tag, &ett_rtmpt_tag_data }; module_t *rtmpt_module; proto_rtmpt = proto_register_protocol("Real Time Messaging Protocol", "RTMPT", "rtmpt"); proto_register_field_array(proto_rtmpt, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); rtmpt_module = prefs_register_protocol(proto_rtmpt, NULL); prefs_register_bool_preference(rtmpt_module, "desegment", "Reassemble RTMPT messages spanning multiple TCP segments", "Whether the RTMPT dissector should reassemble messages spanning multiple TCP segments." " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\"" " in the TCP protocol settings.", &rtmpt_desegment); prefs_register_uint_preference(rtmpt_module, "max_packet_size", "Maximum packet size", "The largest acceptable packet size for reassembly", 10, &rtmpt_max_packet_size); } void proto_register_amf(void) { static hf_register_info hf[] = { { &hf_amf_version, { "AMF version", "amf.version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_amf_header_count, { "Header count", "amf.header_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_amf_header_name, { "Name", "amf.header.name", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_amf_header_must_understand, { "Must understand", "amf.header.must_understand", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_amf_header_length, { "Length", "amf.header.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_amf_header_value_type, { "Value type", "amf.header.value_type", FT_UINT32, BASE_HEX, VALS(rtmpt_type_vals), 0x0, NULL, HFILL }}, #endif { &hf_amf_message_count, { "Message count", "amf.message_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_amf_message_target_uri, { "Target URI", "amf.message.target_uri", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_amf_message_response_uri, { "Response URI", "amf.message.response_uri", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_amf_message_length, { "Length", "amf.message.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* AMF basic types */ { &hf_amf_amf0_type, { "AMF0 type", "amf.amf0_type", FT_UINT8, BASE_HEX, VALS(amf0_type_vals), 0x0, NULL, HFILL }}, { &hf_amf_amf3_type, { "AMF3 type", "amf.amf3_type", FT_UINT8, BASE_HEX, VALS(amf3_type_vals), 0x0, NULL, HFILL }}, { &hf_amf_number, { "Number", "amf.number", FT_DOUBLE, BASE_NONE, NULL, 0x0, "AMF number", HFILL }}, { &hf_amf_integer, { "Integer", "amf.integer", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT AMF3 integer", HFILL }}, { &hf_amf_boolean, { "Boolean", "amf.boolean", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "AMF boolean", HFILL }}, { &hf_amf_stringlength, { "String length", "amf.stringlength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF string length", HFILL }}, { &hf_amf_string, { "String", "amf.string", FT_STRING, BASE_NONE, NULL, 0x0, "AMF string", HFILL }}, { &hf_amf_string_reference, { "String reference", "amf.string_reference", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT AMF3 string reference", HFILL }}, { &hf_amf_object_reference, { "Object reference", "amf.object_reference", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF object reference", HFILL }}, { &hf_amf_date, { "Date", "amf.date", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, "AMF date", HFILL }}, #if 0 { &hf_amf_longstringlength, { "String length", "amf.longstringlength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF long string length", HFILL }}, #endif { &hf_amf_longstring, { "Long string", "amf.longstring", FT_STRING, BASE_NONE, NULL, 0x0, "AMF long string", HFILL }}, { &hf_amf_xml_doc, { "XML document", "amf.xml_doc", FT_STRING, BASE_NONE, NULL, 0x0, "AMF XML document", HFILL }}, { &hf_amf_xmllength, { "XML text length", "amf.xmllength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF E4X XML length", HFILL }}, { &hf_amf_xml, { "XML", "amf.xml", FT_STRING, BASE_NONE, NULL, 0x0, "AMF E4X XML", HFILL }}, { &hf_amf_int64, { "Int64", "amf.int64", FT_INT64, BASE_DEC, NULL, 0x0, "AMF int64", HFILL }}, { &hf_amf_bytearraylength, { "ByteArray length", "amf.bytearraylength", FT_UINT32, BASE_DEC, NULL, 0x0, "RTMPT AMF3 ByteArray length", HFILL }}, { &hf_amf_bytearray, { "ByteArray", "amf.bytearray", FT_BYTES, BASE_NONE, NULL, 0x0, "RTMPT AMF3 ByteArray", HFILL }}, /* AMF object types and subfields of the object types */ { &hf_amf_object, { "Object", "amf.object", FT_NONE, BASE_NONE, NULL, 0x0, "AMF object", HFILL }}, { &hf_amf_traitcount, { "Trait count", "amf.traitcount", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF count of traits for an object", HFILL }}, { &hf_amf_classnamelength, { "Class name length", "amf.classnamelength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF class name length", HFILL }}, { &hf_amf_classname, { "Class name", "amf.classname", FT_STRING, BASE_NONE, NULL, 0x0, "AMF class name", HFILL }}, { &hf_amf_membernamelength, { "Member name length", "amf.membernamelength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF member name length", HFILL }}, { &hf_amf_membername, { "Member name", "amf.membername", FT_STRING, BASE_NONE, NULL, 0x0, "AMF member name", HFILL }}, { &hf_amf_trait_reference, { "Trait reference", "amf.trait_reference", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF trait reference", HFILL }}, { &hf_amf_ecmaarray, { "ECMA array", "amf.ecmaarray", FT_NONE, BASE_NONE, NULL, 0x0, "AMF ECMA array", HFILL }}, { &hf_amf_strictarray, { "Strict array", "amf.strictarray", FT_NONE, BASE_NONE, NULL, 0x0, "AMF strict array", HFILL }}, { &hf_amf_array, { "Array", "amf.array", FT_NONE, BASE_NONE, NULL, 0x0, "RTMPT AMF3 array", HFILL }}, { &hf_amf_arraylength, { "Array length", "amf.arraylength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF array length", HFILL }}, { &hf_amf_arraydenselength, { "Length of dense portion", "amf.arraydenselength", FT_UINT32, BASE_DEC, NULL, 0x0, "AMF length of dense portion of array", HFILL }}, { &hf_amf_end_of_object_marker, { "End Of Object Marker", "amf.end_of_object_marker", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_amf_end_of_associative_part, { "End of associative part", "amf.end_of_associative_part", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_amf_end_of_dynamic_members, { "End Of dynamic members", "amf.end_of_dynamic_members", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static ei_register_info ei[] = { { &ei_amf_loop, { "amf.loop", PI_MALFORMED, PI_ERROR, "Loop in AMF dissection", EXPFILL }} }; static gint *ett[] = { &ett_amf, &ett_amf_headers, &ett_amf_messages, &ett_amf_value, &ett_amf_property, &ett_amf_string, &ett_amf_array_element, &ett_amf_traits, &ett_amf_trait_member, }; expert_module_t* expert_amf; proto_amf = proto_register_protocol("Action Message Format", "AMF", "amf"); proto_register_field_array(proto_amf, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_amf = expert_register_protocol(proto_amf); expert_register_field_array(expert_amf, ei, array_length(ei)); } void proto_reg_handoff_rtmpt(void) { dissector_handle_t amf_handle; heur_dissector_add("tcp", dissect_rtmpt_heur, "RTMPT over TCP", "rtmpt_tcp", proto_rtmpt, HEURISTIC_DISABLE); rtmpt_tcp_handle = create_dissector_handle(dissect_rtmpt_tcp, proto_rtmpt); dissector_add_uint_with_preference("tcp.port", RTMP_PORT, rtmpt_tcp_handle); rtmpt_http_handle = create_dissector_handle(dissect_rtmpt_http, proto_rtmpt); dissector_add_string("media_type", "application/x-fcs", rtmpt_http_handle); amf_handle = create_dissector_handle(dissect_amf, proto_amf); dissector_add_string("media_type", "application/x-amf", amf_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=8 tabstop=8 expandtab: * :indentSize=8:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtnet.c
/* packet-rtnet.c * Routines for RTnet packet disassembly * * Copyright (c) 2003 by Erwin Rol <[email protected]> * Copyright (c) 2004 by Jan Kiszka <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Include files */ #include "config.h" #include <epan/packet.h> #include <epan/addr_resolv.h> #include <epan/etypes.h> /* * See * * http://www.rtnet.org/ * * https://github.com/iocroblab/rtnet/blob/master/Documentation/RTcfg.spec * https://github.com/iocroblab/rtnet/blob/master/Documentation/RTmac.spec */ void proto_register_rtmac(void); void proto_reg_handoff_rtmac(void); void proto_register_rtcfg(void); void proto_reg_handoff_rtcfg(void); #define RTMAC_TYPE_TDMA 0x0001 /* since version 2 */ #define RTMAC_TYPE_TDMA_V1 0x9031 /* first TDMA version */ static const value_string rtmac_type_vals[] = { { RTMAC_TYPE_TDMA, "TDMA" }, { RTMAC_TYPE_TDMA_V1, "TDMA-V1" }, { 0, NULL } }; #define RTMAC_FLAG_TUNNEL 0x01 #define RTMAC_FLAGS_RES 0xFE #define RTCFG_MSG_S1_CONFIG 0x0 #define RTCFG_MSG_ANN_NEW 0x1 #define RTCFG_MSG_ANN_REPLY 0x2 #define RTCFG_MSG_S2_CONFIG 0x3 #define RTCFG_MSG_S2_FRAG 0x4 #define RTCFG_MSG_ACK 0x5 #define RTCFG_MSG_READY 0x6 #define RTCFG_MSG_HBEAT 0x7 #define RTCFG_MSG_DEAD_STN 0x8 static const value_string rtcfg_msg_vals[] = { { RTCFG_MSG_S1_CONFIG, "Stage 1 Config" }, { RTCFG_MSG_ANN_NEW, "New Announce" }, { RTCFG_MSG_ANN_REPLY, "Reply Announce" }, { RTCFG_MSG_S2_CONFIG, "Stage 2 Config" }, { RTCFG_MSG_S2_FRAG, "Stage 2 Fragment" }, { RTCFG_MSG_ACK, "Acknowledge" }, { RTCFG_MSG_READY, "Ready" }, { RTCFG_MSG_HBEAT, "Heartbeat" }, { RTCFG_MSG_DEAD_STN, "Dead Station" }, { 0, NULL } }; #define RTCFG_ADDRESS_TYPE_MAC 0x00 #define RTCFG_ADDRESS_TYPE_IP 0x01 static const value_string rtcfg_address_type_vals[] = { { RTCFG_ADDRESS_TYPE_MAC, "MAC" }, { RTCFG_ADDRESS_TYPE_IP, "IP" }, { 0, NULL } }; #define TDMA_V1_MSG_NOTIFY_MASTER 0x10 #define TDMA_V1_MSG_REQUEST_TEST 0x11 #define TDMA_V1_MSG_ACK_TEST 0x12 #define TDMA_V1_MSG_REQUEST_CONF 0x13 #define TDMA_V1_MSG_ACK_CONF 0x14 #define TDMA_V1_MSG_ACK_ACK_CONF 0x15 #define TDMA_V1_MSG_STATION_LIST 0x16 #define TDMA_V1_MSG_REQUEST_CHANGE_OFFSET 0x17 #define TDMA_V1_MSG_START_OF_FRAME 0x18 static const value_string tdma_v1_msg_vals[] = { { TDMA_V1_MSG_NOTIFY_MASTER, "Notify Master" }, { TDMA_V1_MSG_REQUEST_TEST, "Request Test" }, { TDMA_V1_MSG_ACK_TEST, "Acknowledge Test" }, { TDMA_V1_MSG_REQUEST_CONF, "Request Config" }, { TDMA_V1_MSG_ACK_CONF, "Acknowledge Config" }, { TDMA_V1_MSG_ACK_ACK_CONF, "Ack Ack Config" }, { TDMA_V1_MSG_STATION_LIST, "Station List" }, { TDMA_V1_MSG_REQUEST_CHANGE_OFFSET, "Request Change Offset" }, { TDMA_V1_MSG_START_OF_FRAME, "Start of Frame" }, { 0, NULL } }; #define TDMA_MSG_SYNC 0x0000 #define TDMA_MSG_CAL_REQUEST 0x0010 #define TDMA_MSG_CAL_REPLY 0x0011 static const value_string tdma_msg_vals[] = { { TDMA_MSG_SYNC, "Synchronisation" }, { TDMA_MSG_CAL_REQUEST, "Request Calibration" }, { TDMA_MSG_CAL_REPLY, "Reply Calibration" }, { 0, NULL } }; static dissector_table_t ethertype_table; static dissector_handle_t data_handle; /* Define the rtnet proto */ static int proto_rtmac = -1; static int proto_tdma = -1; static int proto_rtcfg = -1; /* RTmac Header */ static int hf_rtmac_header_type = -1; static int hf_rtmac_header_ver = -1; static int hf_rtmac_header_flags = -1; static int hf_rtmac_header_flags_tunnel = -1; static int hf_rtmac_header_flags_res = -1; static int hf_rtmac_header_res_v1 = -1; /* RTcfg */ static int hf_rtcfg_vers_id = -1; static int hf_rtcfg_vers = -1; static int hf_rtcfg_id = -1; static int hf_rtcfg_address_type = -1; static int hf_rtcfg_client_ip_address = -1; static int hf_rtcfg_server_ip_address = -1; static int hf_rtcfg_burst_rate = -1; static int hf_rtcfg_padding = -1; static int hf_rtcfg_s1_config_length = -1; static int hf_rtcfg_config_data = -1; static int hf_rtcfg_client_flags = -1; static int hf_rtcfg_client_flags_available = -1; static int hf_rtcfg_client_flags_ready = -1; static int hf_rtcfg_client_flags_res = -1; static int hf_rtcfg_server_flags = -1; static int hf_rtcfg_server_flags_res0 = -1; static int hf_rtcfg_server_flags_ready = -1; static int hf_rtcfg_server_flags_res2 = -1; static int hf_rtcfg_active_stations = -1; static int hf_rtcfg_heartbeat_period = -1; static int hf_rtcfg_s2_config_length = -1; static int hf_rtcfg_config_offset = -1; static int hf_rtcfg_ack_length = -1; static int hf_rtcfg_client_hw_address = -1; /* TDMA-V1 */ static int hf_tdma_v1_msg = -1; /* TDMA REQUEST_CONF */ static int hf_tdma_v1_msg_request_conf_station = -1; static int hf_tdma_v1_msg_request_conf_padding = -1; static int hf_tdma_v1_msg_request_conf_mtu = -1; static int hf_tdma_v1_msg_request_conf_cycle = -1; /* TDMA ACK_CONF */ static int hf_tdma_v1_msg_ack_conf_station = -1; static int hf_tdma_v1_msg_ack_conf_padding = -1; static int hf_tdma_v1_msg_ack_conf_mtu = -1; static int hf_tdma_v1_msg_ack_conf_cycle = -1; /* TDMA ACK_ACK_CONF */ static int hf_tdma_v1_msg_ack_ack_conf_station = -1; static int hf_tdma_v1_msg_ack_ack_conf_padding = -1; /* TDMA REQUEST_TEST */ static int hf_tdma_v1_msg_request_test_counter = -1; static int hf_tdma_v1_msg_request_test_tx = -1; /* TDMA ACK_TEST */ static int hf_tdma_v1_msg_ack_test_counter = -1; static int hf_tdma_v1_msg_ack_test_tx = -1; /* TDMA STATION_LIST */ static int hf_tdma_v1_msg_station_list_nr_stations = -1; static int hf_tdma_v1_msg_station_list_padding = -1; static int hf_tdma_v1_msg_station_list_ip = -1; static int hf_tdma_v1_msg_station_list_nr = -1; /* TDMA CHANGE_OFFSET */ static int hf_tdma_v1_msg_request_change_offset_offset = -1; /* TDMA START_OF_FRAME */ static int hf_tdma_v1_msg_start_of_frame_timestamp = -1; /* TDMA since version 2 */ static int hf_tdma_ver = -1; static int hf_tdma_id = -1; /* TDMA Sync */ static int hf_tdma_sync_cycle = -1; static int hf_tdma_sync_xmit_stamp = -1; static int hf_tdma_sync_sched_xmit = -1; /* TDMA Request Calibration */ static int hf_tdma_req_cal_xmit_stamp = -1; static int hf_tdma_req_cal_rpl_cycle = -1; static int hf_tdma_req_cal_rpl_slot = -1; /* TDMA Reply Calibration */ static int hf_tdma_rpl_cal_req_stamp = -1; static int hf_tdma_rpl_cal_rcv_stamp = -1; static int hf_tdma_rpl_cal_xmit_stamp = -1; /* Define the tree for rtnet */ static int ett_rtmac = -1; static int ett_rtmac_flags = -1; static int ett_tdma = -1; static int ett_rtcfg = -1; static guint dissect_rtnet_tdma_notify_master(tvbuff_t *tvb _U_, guint offset, proto_tree *tree _U_) { return offset; } static guint dissect_rtnet_tdma_request_test(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_request_test_counter, tvb, offset, 4, ENC_LITTLE_ENDIAN ); offset += 4; proto_tree_add_item(tree, hf_tdma_v1_msg_request_test_tx, tvb, offset, 8, ENC_LITTLE_ENDIAN ); offset += 8; return offset; } static guint dissect_rtnet_tdma_ack_test(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_ack_test_counter, tvb, offset, 4, ENC_LITTLE_ENDIAN ); offset += 4; proto_tree_add_item(tree, hf_tdma_v1_msg_ack_test_tx, tvb, offset, 8, ENC_LITTLE_ENDIAN ); offset += 8; return offset; } static guint dissect_rtnet_tdma_request_conf(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_request_conf_station, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_request_conf_padding, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_request_conf_mtu, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; proto_tree_add_item(tree, hf_tdma_v1_msg_request_conf_cycle, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; return offset; } static guint dissect_rtnet_tdma_ack_conf(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_ack_conf_station, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_ack_conf_padding, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_ack_conf_mtu, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; proto_tree_add_item(tree, hf_tdma_v1_msg_ack_conf_cycle, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; return offset; } static guint dissect_rtnet_tdma_ack_ack_conf(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_ack_ack_conf_station, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_ack_ack_conf_padding, tvb, offset, 3, ENC_NA ); offset += 3; return offset; } static guint dissect_rtnet_tdma_station_list(tvbuff_t *tvb, guint offset, proto_tree *tree) { guint8 nr_stations; guint8 i; nr_stations = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_tdma_v1_msg_station_list_nr_stations, tvb, offset, 1, nr_stations); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_station_list_padding, tvb, offset, 3, ENC_NA ); offset += 3; for( i = 0; i < nr_stations; i++ ) { proto_tree_add_item(tree, hf_tdma_v1_msg_station_list_ip, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; proto_tree_add_item(tree, hf_tdma_v1_msg_station_list_nr, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; proto_tree_add_item(tree, hf_tdma_v1_msg_station_list_padding, tvb, offset, 3, ENC_NA ); offset += 3; } return offset; } static guint dissect_rtnet_tdma_request_change_offset(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_request_change_offset_offset, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; return offset; } static guint dissect_rtnet_tdma_start_of_frame(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_v1_msg_start_of_frame_timestamp, tvb, offset, 8, ENC_BIG_ENDIAN ); offset += 8; return offset; } static void dissect_rtnet_tdma_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root) { guint offset = 0; guint32 msg; proto_tree *tree; proto_item *ti; msg = tvb_get_ntohl(tvb, offset); /* Set the protocol column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDMA-V1"); /* set the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(msg, tdma_v1_msg_vals, "Unknown (0x%04x)")); if (root) { ti = proto_tree_add_item(root, proto_tdma, tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(ti, ett_tdma); proto_item_append_text(ti, ", Version 1, %s", val_to_str(msg, tdma_v1_msg_vals, "Unknown (0x%04x)")); proto_tree_add_item(tree, hf_tdma_v1_msg, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch( msg ) { case TDMA_V1_MSG_NOTIFY_MASTER: dissect_rtnet_tdma_notify_master(tvb, offset, tree); break; case TDMA_V1_MSG_REQUEST_TEST: dissect_rtnet_tdma_request_test(tvb, offset, tree); break; case TDMA_V1_MSG_ACK_TEST: dissect_rtnet_tdma_ack_test(tvb, offset, tree); break; case TDMA_V1_MSG_REQUEST_CONF: dissect_rtnet_tdma_request_conf(tvb, offset, tree); break; case TDMA_V1_MSG_ACK_CONF: dissect_rtnet_tdma_ack_conf(tvb, offset, tree); break; case TDMA_V1_MSG_ACK_ACK_CONF: dissect_rtnet_tdma_ack_ack_conf(tvb, offset, tree); break; case TDMA_V1_MSG_STATION_LIST: dissect_rtnet_tdma_station_list (tvb, offset, tree); break; case TDMA_V1_MSG_REQUEST_CHANGE_OFFSET: dissect_rtnet_tdma_request_change_offset(tvb, offset, tree); break; case TDMA_V1_MSG_START_OF_FRAME: dissect_rtnet_tdma_start_of_frame(tvb, offset, tree); break; default: break; } } } static void dissect_tdma_sync(tvbuff_t *tvb, guint offset, proto_tree *tree) { gint64 timestamp; proto_item *ti; proto_tree_add_item(tree, hf_tdma_sync_cycle, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; ti = proto_tree_add_item(tree, hf_tdma_sync_xmit_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); timestamp = tvb_get_ntoh64(tvb, offset) - tvb_get_ntoh64(tvb, offset+8); proto_item_append_text(ti, " (%s%" PRId64 ")", (timestamp > 0) ? "+" : "", timestamp); offset += 8; proto_tree_add_item(tree, hf_tdma_sync_sched_xmit, tvb, offset, 8, ENC_BIG_ENDIAN); } static void dissect_tdma_request_cal(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_tdma_req_cal_xmit_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_tdma_req_cal_rpl_cycle, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_tdma_req_cal_rpl_slot, tvb, offset, 8, ENC_BIG_ENDIAN); } static void dissect_tdma_reply_cal(tvbuff_t *tvb, guint offset, proto_tree *tree) { gint64 timestamp; proto_item *ti; proto_tree_add_item(tree, hf_tdma_rpl_cal_req_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_tdma_rpl_cal_rcv_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); timestamp = tvb_get_ntoh64(tvb, offset+8) - tvb_get_ntoh64(tvb, offset); offset += 8; ti = proto_tree_add_item(tree, hf_tdma_rpl_cal_xmit_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); proto_item_append_text(ti, " (%s%" PRId64 ")", (timestamp > 0) ? "+" : "", timestamp); } static void dissect_rtnet_tdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root) { guint offset = 0; guint16 msg; proto_item *ti; proto_tree *tree; msg = tvb_get_ntohs(tvb, 2); /* Set the protocol column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDMA"); /* Set the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(msg, tdma_msg_vals, "Unknown (0x%04x)")); if (root) { ti = proto_tree_add_item(root, proto_tdma, tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(ti, ett_tdma); proto_item_append_text(ti, ", %s", val_to_str(msg, tdma_msg_vals, "Unknown (0x%04x)")); proto_tree_add_item(tree, hf_tdma_ver, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_tdma_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; switch (msg) { case TDMA_MSG_SYNC: dissect_tdma_sync(tvb, offset, tree); break; case TDMA_MSG_CAL_REQUEST: dissect_tdma_request_cal(tvb, offset, tree); break; case TDMA_MSG_CAL_REPLY: dissect_tdma_reply_cal(tvb, offset, tree); break; default: break; } } } static int dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset = 0; guint8 ver,flags; guint16 type; tvbuff_t *next_tvb; proto_tree *ti=NULL, *rtmac_tree=NULL; proto_item *item; dissector_handle_t dissector=NULL; const gchar *type_str=NULL; /* Read the header */ type = tvb_get_ntohs(tvb, offset); ver = tvb_get_guint8(tvb, offset+2); flags = tvb_get_guint8(tvb, offset+3); if (ver == 1) { type_str = try_val_to_str(type, rtmac_type_vals); if (!type_str) { dissector = dissector_get_uint_handle(ethertype_table, type); } } else { if (flags & RTMAC_FLAG_TUNNEL) { dissector = dissector_get_uint_handle(ethertype_table, type); } } if (!dissector) dissector = data_handle; if (tree) { ti = proto_tree_add_item(tree, proto_rtmac, tvb, offset, 4, ENC_NA); rtmac_tree = proto_item_add_subtree(ti, ett_rtmac); proto_item_append_text(ti, ", Version %d", ver); } /* Set the protocol column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTmac"); /* set the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown (0x%04x)",type); if (rtmac_tree) { if (ver == 1) { if (!type_str) { if (dissector != data_handle) type_str = dissector_handle_get_protocol_short_name(dissector); else type_str = "Unknown"; } } else { if (!(flags & RTMAC_FLAG_TUNNEL)) type_str = val_to_str_const(type, rtmac_type_vals, "Unknown"); else { if (dissector != data_handle) type_str = dissector_handle_get_protocol_short_name(dissector); else type_str = "Unknown"; } } proto_tree_add_string_format_value(rtmac_tree, hf_rtmac_header_type, tvb, offset, 2, type_str, "%s (0x%04x)", type_str, type); offset += 2; proto_tree_add_item(rtmac_tree, hf_rtmac_header_ver, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (ver == 1) proto_tree_add_item(rtmac_tree, hf_rtmac_header_res_v1, tvb, offset, 1, ENC_BIG_ENDIAN); else { item = proto_tree_add_item(rtmac_tree, hf_rtmac_header_flags, tvb, offset, 1, ENC_BIG_ENDIAN); ti = proto_item_add_subtree(item, ett_rtmac_flags); proto_tree_add_item(ti, hf_rtmac_header_flags_res, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_rtmac_header_flags_tunnel, tvb, offset, 1, ENC_BIG_ENDIAN); } offset += 1; } else offset += 4; next_tvb = tvb_new_subset_remaining(tvb, offset); if (ver == 1) { switch (type) { case RTMAC_TYPE_TDMA_V1: dissect_rtnet_tdma_v1(next_tvb, pinfo, tree); break; default: call_dissector(dissector, next_tvb, pinfo, tree); break; } } else { if (flags & RTMAC_FLAG_TUNNEL) call_dissector(dissector, next_tvb, pinfo, tree); else { switch (type) { case RTMAC_TYPE_TDMA: dissect_rtnet_tdma(next_tvb, pinfo, tree); break; default: call_dissector(data_handle, next_tvb, pinfo, tree); break; } } } return tvb_captured_length(tvb); } static int dissect_rtcfg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset = 0; proto_tree *vers_id_tree, *vers_id_item, *flags_tree, *flags_item; guint8 vers_id; guint8 addr_type; guint32 config_length,len; proto_tree *ti=NULL,*rtcfg_tree=NULL; /* Set the protocol column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTcfg"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo, COL_INFO); if (tree) { ti = proto_tree_add_item(tree, proto_rtcfg, tvb, offset, -1, ENC_NA); rtcfg_tree = proto_item_add_subtree(ti, ett_rtcfg); } vers_id = tvb_get_guint8(tvb, offset); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(vers_id, rtcfg_msg_vals, "Unknown (0x%04x)")); if( rtcfg_tree ) { vers_id_item = proto_tree_add_uint(rtcfg_tree, hf_rtcfg_vers_id, tvb, offset, 1, vers_id); vers_id_tree=proto_item_add_subtree(vers_id_item, ett_rtcfg); proto_tree_add_item(vers_id_tree, hf_rtcfg_vers, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vers_id_tree, hf_rtcfg_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_item_append_text(ti, ", Version %d, %s", (vers_id >> 5), val_to_str(vers_id, rtcfg_msg_vals, "Unknown (0x%04x)")); switch( vers_id & 0x1f ) { case RTCFG_MSG_S1_CONFIG: addr_type = tvb_get_guint8(tvb, offset); proto_tree_add_item( rtcfg_tree, hf_rtcfg_address_type, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; switch( addr_type ) { case RTCFG_ADDRESS_TYPE_MAC: /* nothing */ break; case RTCFG_ADDRESS_TYPE_IP: proto_tree_add_item( rtcfg_tree, hf_rtcfg_client_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; proto_tree_add_item( rtcfg_tree, hf_rtcfg_server_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; break; } proto_tree_add_item( rtcfg_tree, hf_rtcfg_burst_rate, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; config_length = tvb_get_ntohs( tvb, offset ); proto_tree_add_item( rtcfg_tree, hf_rtcfg_s1_config_length, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; if( config_length > 0 ) { proto_tree_add_item( rtcfg_tree, hf_rtcfg_config_data, tvb, offset, config_length, ENC_NA ); /*offset += config_length;*/ } break; case RTCFG_MSG_ANN_NEW: addr_type = tvb_get_guint8(tvb, offset); proto_tree_add_item( rtcfg_tree, hf_rtcfg_address_type, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; switch( addr_type ) { case RTCFG_ADDRESS_TYPE_MAC: /* nothing */ break; case RTCFG_ADDRESS_TYPE_IP: proto_tree_add_item( rtcfg_tree, hf_rtcfg_client_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; break; } flags_item = proto_tree_add_item(rtcfg_tree, hf_rtcfg_client_flags, tvb, offset, 1, ENC_BIG_ENDIAN); flags_tree=proto_item_add_subtree(flags_item, ett_rtcfg); proto_tree_add_item(flags_tree, hf_rtcfg_client_flags_available, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_rtcfg_client_flags_ready, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_rtcfg_client_flags_res, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item( rtcfg_tree, hf_rtcfg_burst_rate, tvb, offset, 1, ENC_BIG_ENDIAN ); /*offset += 1;*/ break; case RTCFG_MSG_ANN_REPLY: addr_type = tvb_get_guint8(tvb, offset); proto_tree_add_item( rtcfg_tree, hf_rtcfg_address_type, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; switch( addr_type ) { case RTCFG_ADDRESS_TYPE_MAC: /* nothing */ break; case RTCFG_ADDRESS_TYPE_IP: proto_tree_add_item( rtcfg_tree, hf_rtcfg_client_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; break; } flags_item = proto_tree_add_item(rtcfg_tree, hf_rtcfg_client_flags, tvb, offset, 1, ENC_BIG_ENDIAN); flags_tree=proto_item_add_subtree(flags_item, ett_rtcfg); proto_tree_add_item(flags_tree, hf_rtcfg_client_flags_available, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_rtcfg_client_flags_ready, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_rtcfg_client_flags_res, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item( rtcfg_tree, hf_rtcfg_padding, tvb, offset, 1, ENC_BIG_ENDIAN ); /*offset += 1;*/ break; case RTCFG_MSG_S2_CONFIG: flags_item = proto_tree_add_item(rtcfg_tree, hf_rtcfg_server_flags, tvb, offset, 1, ENC_BIG_ENDIAN); flags_tree=proto_item_add_subtree(flags_item, ett_rtcfg); proto_tree_add_item(flags_tree, hf_rtcfg_server_flags_res0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_rtcfg_server_flags_ready, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_rtcfg_server_flags_res2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item( rtcfg_tree, hf_rtcfg_active_stations, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; proto_tree_add_item( rtcfg_tree, hf_rtcfg_heartbeat_period, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; config_length = tvb_get_ntohl( tvb, offset ); proto_tree_add_item( rtcfg_tree, hf_rtcfg_s2_config_length, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; if( config_length > 0 ) { len = tvb_reported_length_remaining(tvb, offset); proto_tree_add_item( rtcfg_tree, hf_rtcfg_config_data, tvb, offset, len, ENC_NA ); /*offset += len;*/ } break; case RTCFG_MSG_S2_FRAG: proto_tree_add_item( rtcfg_tree, hf_rtcfg_config_offset, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; len = tvb_reported_length_remaining(tvb, offset); proto_tree_add_item( rtcfg_tree, hf_rtcfg_config_data, tvb, offset, len, ENC_NA ); /*offset += len;*/ break; case RTCFG_MSG_ACK: proto_tree_add_item( rtcfg_tree, hf_rtcfg_ack_length, tvb, offset, 4, ENC_BIG_ENDIAN ); /*offset += 4;*/ break; case RTCFG_MSG_READY: break; case RTCFG_MSG_HBEAT: break; case RTCFG_MSG_DEAD_STN: addr_type = tvb_get_guint8(tvb, offset); proto_tree_add_item( rtcfg_tree, hf_rtcfg_address_type, tvb, offset, 1, ENC_BIG_ENDIAN ); offset += 1; switch( addr_type ) { case RTCFG_ADDRESS_TYPE_MAC: /* nothing */ break; case RTCFG_ADDRESS_TYPE_IP: proto_tree_add_item( rtcfg_tree, hf_rtcfg_client_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; break; } /* * Infer the type of the physical address from the type of the * source address of this packet. */ switch( pinfo->dl_src.type ) { case AT_ETHER: proto_tree_add_bytes_format_value( rtcfg_tree, hf_rtcfg_client_hw_address, tvb, offset, 32, NULL, "%s", tvb_ether_to_str(pinfo->pool, tvb, offset)); break; default: proto_tree_add_item( rtcfg_tree, hf_rtcfg_client_hw_address, tvb, offset, 32, ENC_NA ); break; } /*offset += 32;*/ break; } } return tvb_captured_length(tvb); } void proto_register_rtmac(void) { static hf_register_info hf_array_rtmac[] = { /* RTmac header */ { &hf_rtmac_header_type, { "Type", "rtmac.header.type", FT_STRING, BASE_NONE, NULL, 0x0, "RTmac Type", HFILL }}, { &hf_rtmac_header_ver, { "Version", "rtmac.header.ver", FT_UINT16, BASE_DEC, NULL, 0x0, "RTmac Version", HFILL }}, { &hf_rtmac_header_flags, { "Flags", "rtmac.header.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "RTmac Flags", HFILL }}, { &hf_rtmac_header_flags_tunnel, { "Tunnelling Flag", "rtmac.header.flags.tunnel", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTMAC_FLAG_TUNNEL, "RTmac Tunnelling Flag", HFILL }}, { &hf_rtmac_header_flags_res, { "Reserved Flags", "rtmac.header.flags.res", FT_UINT8, BASE_HEX, NULL, RTMAC_FLAGS_RES, "RTmac Reserved Flags", HFILL }}, { &hf_rtmac_header_res_v1, { "Reserved", "rtmac.header.res", FT_UINT8, BASE_HEX, NULL, 0x0, "RTmac Reserved", HFILL }}, }; static hf_register_info hf_array_tdma[] = { /* TDMA msg */ { &hf_tdma_v1_msg, { "Message", "tdma-v1.msg", FT_UINT32, BASE_HEX, VALS(tdma_v1_msg_vals), 0x0, "TDMA-V1 Message", HFILL }}, /* TDMA request conf */ { &hf_tdma_v1_msg_request_conf_station, { "Station", "tdma-v1.msg.request_conf.station", FT_UINT8, BASE_DEC, NULL, 0x0, "TDMA Station", HFILL }}, { &hf_tdma_v1_msg_request_conf_padding, { "Padding", "tdma-v1.msg.request_conf.padding", FT_UINT8, BASE_HEX, NULL, 0x0, "TDMA Padding", HFILL }}, { &hf_tdma_v1_msg_request_conf_mtu, { "MTU", "tdma-v1.msg.request_conf.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, "TDMA MTU", HFILL }}, { &hf_tdma_v1_msg_request_conf_cycle, { "Cycle", "tdma-v1.msg.request_conf.cycle", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Cycle", HFILL }}, /* TDMA ack conf */ { &hf_tdma_v1_msg_ack_conf_station, { "Station", "tdma-v1.msg.ack_conf.station", FT_UINT8, BASE_DEC, NULL, 0x0, "TDMA Station", HFILL }}, { &hf_tdma_v1_msg_ack_conf_padding, { "Padding", "tdma-v1.msg.ack_conf.padding", FT_UINT8, BASE_HEX, NULL, 0x0, "TDMA Padding", HFILL }}, { &hf_tdma_v1_msg_ack_conf_mtu, { "MTU", "tdma-v1.msg.ack_conf.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, "TDMA MTU", HFILL }}, { &hf_tdma_v1_msg_ack_conf_cycle, { "Cycle", "tdma-v1.msg.ack_conf.cycle", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Cycle", HFILL }}, /* TDMA ack ack conf */ { &hf_tdma_v1_msg_ack_ack_conf_station, { "Station", "tdma-v1.msg.ack_ack_conf.station", FT_UINT8, BASE_DEC, NULL, 0x0, "TDMA Station", HFILL }}, { &hf_tdma_v1_msg_ack_ack_conf_padding, { "Padding", "tdma-v1.msg.ack_ack_conf.padding", FT_BYTES, BASE_NONE, NULL, 0x0, "TDMA Padding", HFILL }}, /* TDMA request test */ { &hf_tdma_v1_msg_request_test_counter, { "Counter", "tdma-v1.msg.request_test.counter", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Counter", HFILL }}, { &hf_tdma_v1_msg_request_test_tx, { "TX", "tdma-v1.msg.request_test.tx", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA TX", HFILL }}, /* TDMA ack test */ { &hf_tdma_v1_msg_ack_test_counter, { "Counter", "tdma-v1.msg.ack_test.counter", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Counter", HFILL }}, { &hf_tdma_v1_msg_ack_test_tx, { "TX", "tdma-v1.msg.ack_test.tx", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA TX", HFILL }}, /* TDMA ack test */ { &hf_tdma_v1_msg_request_change_offset_offset, { "Offset", "tdma-v1.msg.request_change_offset.offset", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Offset", HFILL }}, /* TDMA start of frame */ { &hf_tdma_v1_msg_start_of_frame_timestamp, { "Timestamp", "tdma-v1.msg.start_of_frame.timestamp", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Timestamp", HFILL }}, /* TDMA station list */ { &hf_tdma_v1_msg_station_list_nr_stations, { "Nr. Stations", "tdma-v1.msg.station_list.nr_stations", FT_UINT8, BASE_DEC, NULL, 0x0, "TDMA Nr. Stations", HFILL }}, { &hf_tdma_v1_msg_station_list_nr, { "Nr.", "tdma-v1.msg.station_list.nr", FT_UINT8, BASE_DEC, NULL, 0x0, "TDMA Station Number", HFILL }}, { &hf_tdma_v1_msg_station_list_ip, { "IP", "tdma-v1.msg.station_list.ip", FT_IPv4, BASE_NONE, NULL, 0x0, "TDMA Station IP", HFILL }}, { &hf_tdma_v1_msg_station_list_padding, { "Padding", "tdma-v1.msg.station_list.padding", FT_BYTES, BASE_NONE, NULL, 0x0, "TDMA Padding", HFILL }}, /* TDMA since version 2 */ { &hf_tdma_ver, { "Version", "tdma.ver", FT_UINT16, BASE_HEX, NULL, 0x0, "TDMA Version", HFILL }}, { &hf_tdma_id, { "Message ID", "tdma.id", FT_UINT16, BASE_HEX, VALS(tdma_msg_vals), 0x0, "TDMA Message ID", HFILL }}, /* TDMA sync */ { &hf_tdma_sync_cycle, { "Cycle Number", "tdma.sync.cycle", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Sync Cycle Number", HFILL }}, { &hf_tdma_sync_xmit_stamp, { "Transmission Time Stamp", "tdma.sync.xmit_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Sync Transmission Time Stamp", HFILL }}, { &hf_tdma_sync_sched_xmit, { "Scheduled Transmission Time", "tdma.sync.sched_xmit", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Sync Scheduled Transmission Time", HFILL }}, /* TDMA request calibration */ { &hf_tdma_req_cal_xmit_stamp, { "Transmission Time Stamp", "tdma.req_cal.xmit_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Request Calibration Transmission Time Stamp", HFILL }}, { &hf_tdma_req_cal_rpl_cycle, { "Reply Cycle Number", "tdma.req_cal.rpl_cycle", FT_UINT32, BASE_DEC, NULL, 0x0, "TDMA Request Calibration Reply Cycle Number", HFILL }}, { &hf_tdma_req_cal_rpl_slot, { "Reply Slot Offset", "tdma.req_cal.rpl_slot", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Request Calibration Reply Slot Offset", HFILL }}, /* TDMA reply calibration */ { &hf_tdma_rpl_cal_req_stamp, { "Request Transmission Time", "tdma.rpl_cal.req_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Reply Calibration Request Transmission Time", HFILL }}, { &hf_tdma_rpl_cal_rcv_stamp, { "Reception Time Stamp", "tdma.rpl_cal.rcv_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Reply Calibration Reception Time Stamp", HFILL }}, { &hf_tdma_rpl_cal_xmit_stamp, { "Transmission Time Stamp", "tdma.rpl_cal.xmit_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, "TDMA Reply Calibration Transmission Time Stamp", HFILL }}, }; static gint *ett_array_rtmac[] = { &ett_rtmac, &ett_rtmac_flags, }; static gint *ett_array_tdma[] = { &ett_tdma, }; proto_rtmac = proto_register_protocol("Real-Time Media Access Control", "RTmac", "rtmac"); proto_register_field_array(proto_rtmac, hf_array_rtmac, array_length(hf_array_rtmac)); proto_register_subtree_array(ett_array_rtmac, array_length(ett_array_rtmac)); proto_tdma = proto_register_protocol("TDMA RTmac Discipline", "TDMA", "tdma"); proto_register_field_array(proto_rtmac, hf_array_tdma, array_length(hf_array_tdma)); proto_register_subtree_array(ett_array_tdma, array_length(ett_array_tdma)); } void proto_register_rtcfg(void) { static hf_register_info hf[] = { { &hf_rtcfg_vers_id, { "Version and ID", "rtcfg.vers_id", FT_UINT8, BASE_HEX, NULL, 0x0, "RTcfg Version and ID", HFILL }}, { &hf_rtcfg_vers, { "Version", "rtcfg.vers", FT_UINT8, BASE_DEC, NULL, 0xe0, "RTcfg Version", HFILL }}, { &hf_rtcfg_id, { "ID", "rtcfg.id", FT_UINT8, BASE_HEX, VALS(rtcfg_msg_vals), 0x1f, "RTcfg ID", HFILL }}, { &hf_rtcfg_address_type, { "Address Type", "rtcfg.address_type", FT_UINT8, BASE_DEC, VALS(rtcfg_address_type_vals), 0x00, "RTcfg Address Type", HFILL }}, { &hf_rtcfg_client_ip_address, { "Client IP Address", "rtcfg.client_ip_address", FT_IPv4, BASE_NONE, NULL, 0x0, "RTcfg Client IP Address", HFILL }}, { &hf_rtcfg_server_ip_address, { "Server IP Address", "rtcfg.server_ip_address", FT_IPv4, BASE_NONE, NULL, 0x0, "RTcfg Server IP Address", HFILL }}, { &hf_rtcfg_burst_rate, { "Stage 2 Burst Rate", "rtcfg.burst_rate", FT_UINT8, BASE_DEC, NULL, 0x00, "RTcfg Stage 2 Burst Rate", HFILL }}, { &hf_rtcfg_s1_config_length, { "Stage 1 Config Length", "rtcfg.s1_config_length", FT_UINT16, BASE_DEC, NULL, 0x00, "RTcfg Stage 1 Config Length", HFILL }}, { &hf_rtcfg_config_data, { "Config Data", "rtcfg.config_data", FT_BYTES, BASE_NONE, NULL, 0x00, "RTcfg Config Data", HFILL }}, { &hf_rtcfg_padding, { "Padding", "rtcfg.padding", FT_UINT8, BASE_DEC, NULL, 0x00, "RTcfg Padding", HFILL }}, { &hf_rtcfg_client_flags, { "Flags", "rtcfg.client_flags", FT_UINT8, BASE_HEX, NULL, 0x00, "RTcfg Client Flags", HFILL }}, { &hf_rtcfg_client_flags_available, { "Req. Available", "rtcfg.client_flags.available", FT_UINT8, BASE_DEC, NULL, 0x01, "Request Available", HFILL }}, { &hf_rtcfg_client_flags_ready, { "Client Ready", "rtcfg.client_flags.ready", FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }}, { &hf_rtcfg_client_flags_res, { "Reserved", "rtcfg.client_flags.res", FT_UINT8, BASE_HEX, NULL, 0xfc, NULL, HFILL }}, { &hf_rtcfg_server_flags, { "Flags", "rtcfg.server_flags", FT_UINT8, BASE_HEX, NULL, 0x00, "RTcfg Server Flags", HFILL }}, { &hf_rtcfg_server_flags_res0, { "Reserved", "rtcfg.server_flags.res0", FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }}, { &hf_rtcfg_server_flags_ready, { "Server Ready", "rtcfg.server_flags.ready", FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }}, { &hf_rtcfg_server_flags_res2, { "Reserved", "rtcfg.server_flags.res2", FT_UINT8, BASE_HEX, NULL, 0xfc, NULL, HFILL }}, { &hf_rtcfg_active_stations, { "Active Stations", "rtcfg.active_stations", FT_UINT32, BASE_DEC, NULL, 0x00, "RTcfg Active Stations", HFILL }}, { &hf_rtcfg_heartbeat_period, { "Heartbeat Period", "rtcfg.hearbeat_period", FT_UINT16, BASE_DEC, NULL, 0x00, "RTcfg Heartbeat Period", HFILL }}, { &hf_rtcfg_s2_config_length, { "Stage 2 Config Length", "rtcfg.s2_config_length", FT_UINT32, BASE_DEC, NULL, 0x00, "RTcfg Stage 2 Config Length", HFILL }}, { &hf_rtcfg_config_offset, { "Config Offset", "rtcfg.config_offset", FT_UINT32, BASE_DEC, NULL, 0x00, "RTcfg Config Offset", HFILL }}, { &hf_rtcfg_ack_length, { "Ack Length", "rtcfg.ack_length", FT_UINT32, BASE_DEC, NULL, 0x00, "RTcfg Ack Length", HFILL }}, { &hf_rtcfg_client_hw_address, { "Client Hardware Address", "rtcfg.client_hw_address", FT_BYTES, BASE_NONE, NULL, 0x00, "RTcfg Client Hardware Address", HFILL }} }; static gint *ett[] = { &ett_rtcfg, }; proto_rtcfg = proto_register_protocol("RTcfg","RTcfg","rtcfg"); proto_register_field_array(proto_rtcfg,hf,array_length(hf)); proto_register_subtree_array(ett,array_length(ett)); } /* The registration hand-off routing */ void proto_reg_handoff_rtmac(void) { dissector_handle_t rtmac_handle; rtmac_handle = create_dissector_handle(dissect_rtmac, proto_rtmac); dissector_add_uint("ethertype", ETHERTYPE_RTMAC, rtmac_handle); ethertype_table = find_dissector_table("ethertype"); } void proto_reg_handoff_rtcfg(void) { dissector_handle_t rtcfg_handle; data_handle = find_dissector("data"); rtcfg_handle = create_dissector_handle(dissect_rtcfg, proto_rtcfg); dissector_add_uint("ethertype", ETHERTYPE_RTCFG, rtcfg_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtp-ed137.c
/* packet-rtp-ed137.c * * Routines for RTP ED-137 extensions dissection * RTP = Real time Transport Protocol * * Copyright 2000, Philips Electronics N.V. * Written by Andreas Sikkema <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This dissector tries to dissect the RTP extension headers by ED-137, ED-137A, ED-137B and ED-137C specification * of EUROCAE (The European Organisation for Civil Aviation Equipment) * * There are two packet header extension signatures. One for ED-137 and second ED-137A and later releases. Even some extensions are same in ED-137 and ED-137A, constants and code are duplicated because there are slight differences between standard release. * ED-137A and later standards share some extensions (e. g. SQI is defined in ED-137A and repeated without change in ED-137B and C). Naming convention use first standard release where extension was introduced (ED-137A in SQI case). * * Each ED-137 header extension consists of fixed part and variable part (called "extension for additional features" in standard). The code decodes fixed part and some variable part headers. The code decode only additional headers we seen (we have samples) even standard defines more of it. * To allow other developers and vendors to introduce custom decoders, there are dissector tables rtp.hdr_ext.ed137 and rtp.hdr_ext.ed137a which registers dissector for each "additional feature" header by type/length key. It allows anyone extending decoding capabilites just by adding plugin and register dissector in the table - without modifying this source. * rtp.hdr_ext.ed137 table is used for ED-137 standard release. rtp.hdr_ext.ed137a table is used for ED-137A and later standard releases. */ #include "config.h" #include <epan/packet.h> #include <epan/to_str.h> #include "packet-rtp.h" static int proto_rtp_ed137 = -1; static dissector_handle_t rtp_hdr_ext_ed137_handle; static dissector_handle_t rtp_hdr_ext_ed137a_handle; static dissector_handle_t rtp_hdr_ext_ed137a_feature_sqi_handle; static dissector_handle_t rtp_hdr_ext_ed137a_feature_climax_tdly_handle; static dissector_handle_t rtp_hdr_ext_ed137b_feature_rrc_single_handle; static dissector_handle_t rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle; static dissector_handle_t rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle; static dissector_handle_t rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle; static dissector_table_t rtp_hdr_ext_ed137a_add_features_table; /* RTP header ED-137 extension fields */ static int hf_rtp_hdr_ed137s = -1; static int hf_rtp_hdr_ed137 = -1; static int hf_rtp_hdr_ed137_add = -1; static int hf_rtp_hdr_ed137_ptt_type = -1; static int hf_rtp_hdr_ed137_squ = -1; static int hf_rtp_hdr_ed137_ptt_id = -1; static int hf_rtp_hdr_ed137_sct = -1; static int hf_rtp_hdr_ed137_x = -1; static int hf_rtp_hdr_ed137_x_nu = -1; static int hf_rtp_hdr_ed137_ft_type = -1; static int hf_rtp_hdr_ed137_ft_len = -1; static int hf_rtp_hdr_ed137_ft_value = -1; static int hf_rtp_hdr_ed137_ft_bss_qidx = -1; static int hf_rtp_hdr_ed137_ft_bss_rssi_qidx = -1; static int hf_rtp_hdr_ed137_ft_bss_qidx_ml = -1; static int hf_rtp_hdr_ed137_vf = -1; static int hf_rtp_hdr_ed137_ft_climax_delay_value = -1; /* RTP header ED-137A extension fields */ static int hf_rtp_hdr_ed137a = -1; static int hf_rtp_hdr_ed137a_add = -1; static int hf_rtp_hdr_ed137a_ptt_type = -1; static int hf_rtp_hdr_ed137a_squ = -1; static int hf_rtp_hdr_ed137a_ptt_id = -1; static int hf_rtp_hdr_ed137a_pm = -1; static int hf_rtp_hdr_ed137a_ptts = -1; static int hf_rtp_hdr_ed137a_sct = -1; static int hf_rtp_hdr_ed137a_reserved = -1; static int hf_rtp_hdr_ed137a_x = -1; static int hf_rtp_hdr_ed137a_x_nu = -1; static int hf_rtp_hdr_ed137a_ft_type = -1; static int hf_rtp_hdr_ed137a_ft_len = -1; static int hf_rtp_hdr_ed137a_ft_value = -1; static int hf_rtp_hdr_ed137a_ft_padding = -1; static int hf_rtp_hdr_ed137a_ft_sqi_qidx = -1; static int hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx = -1; static int hf_rtp_hdr_ed137a_ft_sqi_qidx_ml = -1; static int hf_rtp_hdr_ed137a_ft_climax_delay_mode = -1; static int hf_rtp_hdr_ed137a_ft_climax_delay_relative_value = -1; static int hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value = -1; /* RTP header ED-137B extension fields */ static int hf_rtp_hdr_ed137b_ft_rrc_single = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1 = -1; static int hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2 = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_unknown = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1 = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1 = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2 = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1 = -1; static int hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid = -1; /* RTP header ED-137C extension fields */ static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1 = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2 = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1 = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid = -1; static int hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2 = -1; static gint ett_hdr_ext_ed137s = -1; static gint ett_hdr_ext_ed137 = -1; static gint ett_hdr_ext_ed137_add = -1; static gint ett_hdr_ext_ed137a = -1; static gint ett_hdr_ext_ed137a_add = -1; /* Forward declaration we need below */ void proto_register_rtp_ed137(void); void proto_reg_handoff_rtp_ed137(void); /* Combine 4 bits of type with 4 bits of length to 8 bit key */ #define MAKE_KEY(type, len) \ ( ( type & 0x0F ) << 4 | ( len & 0x0f ) ) /* ED-137 signature */ #define RTP_ED137_SIG 0x0067 /* ED-137A signature */ #define RTP_ED137A_SIG 0x0167 /* ED-137 PTT */ #define RTP_ED137_ptt_mask(octet) ((octet) & 0xE0000000) #define RTP_ED137A_ptt_mask(octet) ((octet) & 0xE000) #define RTP_ED137_squ_mask(octet) ((octet) & 0x10000000) #define RTP_ED137A_squ_mask(octet) ((octet) & 0x1000) /* ED-137 extended information */ #define RTP_ED137_extended_information(octet) ((octet) & 0x00400000) #define RTP_ED137A_extended_information(octet) ((octet) & 0x0001) /* ED-137 feature type */ #define RTP_ED137_feature_type(octet) (((octet) & 0x003C0000) >> 18) #define RTP_ED137A_feature_type(octet) (((octet) & 0x0000F000) >> 12) /* ED-137 feature length */ #define RTP_ED137_feature_length(octet) (((octet) & 0x0003C000) >> 14) #define RTP_ED137A_feature_length(octet) (((octet) & 0x00000F00) >> 8) /* ED-137 feature value */ #define RTP_ED137_feature_value(octet) (((octet) & 0x00003FFE) >> 1) #define RTP_ED137A_feature_value(octet) (((octet) & 0x000000FF) >> 0) /* ED_137 None constants */ #define RTP_ED137_feature_none_type 0x0 /* ED-137 BSS constants */ #define RTP_ED137_feature_bss_type 0x1 #define RTP_ED137_feature_bss_qidx(octet) (((octet) & 0x00003FC0) >> 6) #define RTP_ED137_feature_bss_qidx_ml(octet) (((octet) & 0x00000038) >> 2) #define RTP_ED137_feature_bss_qidx_ml_rssi 0 #define RTP_ED137_feature_bss_qidx_rssi_max 15 /* ED-137 CLIMAX-Time Delay */ #define RTP_ED137_feature_climax_ot_type 0x2 #define RTP_ED137_feature_climax_ot_value(octet) (((octet) & 0x00003F00) >> 8) /* ED-137A SQI constants */ #define RTP_ED137A_feature_sqi_type 0x1 #define RTP_ED137A_feature_sqi_len 1 #define RTP_ED137A_feature_sqi_key MAKE_KEY( RTP_ED137A_feature_sqi_type, RTP_ED137A_feature_sqi_len ) #define RTP_ED137A_feature_sqi_qidx(octet) (((octet) & 0x000000F8) >> 3) #define RTP_ED137A_feature_sqi_qidx_ml(octet) (((octet) & 0x00000007) >> 0) #define RTP_ED137A_feature_sqi_qidx_ml_rssi 0 #define RTP_ED137A_feature_sqi_qidx_rssi_max 15 /* ED-137A CLIMAX-Time Delay */ #define RTP_ED137A_feature_climax_tdly_type 0x2 #define RTP_ED137A_feature_climax_tdly_len 1 #define RTP_ED137A_feature_climax_tdly_key MAKE_KEY( RTP_ED137A_feature_climax_tdly_type, RTP_ED137A_feature_climax_tdly_len ) #define RTP_ED137A_feature_climax_tdly_mode(octet) (((octet) & 0x00000080) >> 7) #define RTP_ED137A_feature_climax_tdly_value(octet) (((octet) & 0x0000007F) >> 0) #define RTP_ED137A_feature_climax_tdly_mode_relative 0 #define RTP_ED137A_feature_climax_tdly_mode_absolute 1 /* ED-137B RRC single */ #define RTP_ED137B_feature_rrc_single_type 0x3 #define RTP_ED137B_feature_rrc_single_len 1 #define RTP_ED137B_feature_rrc_single_key MAKE_KEY( RTP_ED137B_feature_rrc_single_type, RTP_ED137B_feature_rrc_single_len ) /* ED-137B CLIMAX dynamic delay compensation */ #define RTP_ED137B_feature_climax_ddc_type 0x4 #define RTP_ED137B_feature_climax_ddc_rmm_len 3 #define RTP_ED137B_feature_climax_ddc_mam_len 12 #define RTP_ED137B_feature_climax_ddc_rmm_key MAKE_KEY( RTP_ED137B_feature_climax_ddc_type, RTP_ED137B_feature_climax_ddc_rmm_len ) #define RTP_ED137B_feature_climax_ddc_mam_key MAKE_KEY( RTP_ED137B_feature_climax_ddc_type, RTP_ED137B_feature_climax_ddc_mam_len ) #define RTP_ED137B_feature_climax_ddc_rmm_tqv(octet) (((octet) & 0x00800000) >> 23) #define RTP_ED137B_feature_climax_ddc_rmm_t1(octet) (((octet) & 0x007FFFFF) >> 0) #define RTP_ED137B_feature_climax_ddc_mam_tqg(octet) (((octet) & 0x00800000) >> 23) #define RTP_ED137B_feature_climax_ddc_mam_t1(octet) (((octet) & 0x007FFFFF) >> 0) #define RTP_ED137B_feature_climax_ddc_mam_nmr(octet) (((octet) & 0x00800000) >> 23) #define RTP_ED137B_feature_climax_ddc_mam_t2(octet) (((octet) & 0x007FFFFF) >> 0) #define RTP_ED137B_feature_climax_ddc_mam_tsd(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137B_feature_climax_ddc_mam_tj1(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137B_feature_climax_ddc_mam_tid(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137B_feature_climax_ddc_rmm_tqv_relative 0 #define RTP_ED137B_feature_climax_ddc_rmm_tqv_absolute 1 #define RTP_ED137B_feature_climax_ddc_mam_tqg_relative 0 #define RTP_ED137B_feature_climax_ddc_mam_tqg_absolute 1 /* ED-137C CLIMAX dynamic delay compensation*/ #define RTP_ED137C_feature_climax_ddc_type 0x4 #define RTP_ED137C_feature_climax_ddc_mam_len 14 #define RTP_ED137C_feature_climax_ddc_mam_key MAKE_KEY( RTP_ED137C_feature_climax_ddc_type, RTP_ED137C_feature_climax_ddc_mam_len ) #define RTP_ED137C_feature_climax_ddc_rmm_tqv(octet) (((octet) & 0x00800000) >> 23) #define RTP_ED137C_feature_climax_ddc_rmm_t1(octet) (((octet) & 0x007FFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_mam_tqg(octet) (((octet) & 0x00800000) >> 23) #define RTP_ED137C_feature_climax_ddc_mam_t1(octet) (((octet) & 0x007FFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_mam_nmr(octet) (((octet) & 0x00800000) >> 23) #define RTP_ED137C_feature_climax_ddc_mam_t2(octet) (((octet) & 0x007FFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_mam_tsd(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_mam_tj1(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_mam_tid(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_mam_ts2(octet) (((octet) & 0xFFFF) >> 0) #define RTP_ED137C_feature_climax_ddc_rmm_tqv_relative 0 #define RTP_ED137C_feature_climax_ddc_rmm_tqv_absolute 1 #define RTP_ED137C_feature_climax_ddc_mam_tqg_relative 0 #define RTP_ED137C_feature_climax_ddc_mam_tqg_absolute 1 static const value_string rtp_ext_ed137_ptt_type[] = { { 0x00, "PTT OFF" }, { 0x01, "Normal PTT ON" }, { 0x02, "Coupling PTT ON" }, { 0x03, "Priority PTT ON" }, { 0x04, "Emergency PTT ON" }, { 0x05, "Reserved" }, { 0x06, "Reserved" }, { 0x07, "Reserved" }, { 0, NULL }, }; static const value_string rtp_ext_ed137_squ[] = { { 0x00, "SQ OFF" }, { 0x01, "SQ ON" }, { 0, NULL }, }; static const value_string rtp_ext_ed137_ft_type[] = { { 0x0, "No features" }, { 0x1, "Best signal selection" }, { 0x2, "CLIMAX time delay" }, { 0x3, "Reserved" }, { 0x4, "Reserved" }, { 0x5, "Reserved" }, { 0x6, "Reserved" }, { 0x7, "Reserved" }, { 0x8, "Reserved" }, { 0x9, "Reserved" }, { 0xA, "Reserved" }, { 0xB, "Vendor reserved" }, { 0xC, "Vendor reserved" }, { 0xD, "Vendor reserved" }, { 0xE, "Vendor reserved" }, { 0xF, "Vendor reserved" }, { 0, NULL }, }; static const value_string rtp_ext_ed137_x[] = { { 0x00, "No extended information with additional features is used" }, { 0x01, "Extended information with additional features is used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137_vf[] = { { 0x00, "VF OFF" }, { 0x01, "VF ON" }, { 0, NULL }, }; static const value_string rtp_ext_ed137_ft_bss_rssi_qidx[] = { { 0x00, "lower than -100.00 dBm" }, { 0x01, "lower than or equal to -97.86 dBm" }, { 0x02, "lower than or equal to -95.71 dBm" }, { 0x03, "lower than or equal to -93.57 dBm" }, { 0x04, "lower than or equal to -91.43 dBm" }, { 0x05, "lower than or equal to -89.29 dBm" }, { 0x06, "lower than or equal to -87.14 dBm" }, { 0x07, "lower than or equal to -85.00 dBm" }, { 0x08, "lower than or equal to -82.86 dBm" }, { 0x09, "lower than or equal to -80.71 dBm" }, { 0x0a, "lower than or equal to -78.57 dBm" }, { 0x0b, "lower than or equal to -76.43 dBm" }, { 0x0c, "lower than or equal to -74.29 dBm" }, { 0x0d, "lower than or equal to -72.14 dBm" }, { 0x0e, "lower than or equal to -70.00 dBm" }, { 0x0f, "higher than -70.00 dBm" }, { 0, NULL }, }; static const value_string rtp_ext_ed137_ft_bss_qidx_ml[] = { { 0x00, "RSSI" }, { 0x01, "AGC Level" }, { 0x02, "C/N" }, { 0x03, "Standardized PSD" }, { 0x04, "Vendor specific method" }, { 0x05, "Vendor specific method" }, { 0x06, "Vendor specific method" }, { 0x07, "Vendor specific method" }, { 0, NULL }, }; static const value_string rtp_ext_ed137a_ptt_type[] = { { 0x00, "PTT OFF" }, { 0x01, "Normal PTT ON" }, { 0x02, "Coupling PTT ON" }, { 0x03, "Priority PTT ON" }, { 0x04, "Emergency PTT ON" }, { 0x05, "Test PTT ON" }, { 0x06, "Reserved" }, { 0x07, "Reserved" }, { 0, NULL }, }; static const value_string rtp_ext_ed137a_squ[] = { { 0x00, "SQ OFF" }, { 0x01, "SQ ON" }, { 0, NULL }, }; static const value_string rtp_ext_ed137a_ft_type[] = { { 0x0, "No features" }, { 0x1, "Signal Quality Information" }, { 0x2, "CLIMAX time delay" }, { 0x3, "Radio remote control" }, { 0x4, "CLIMAX dynamic delay compensation" }, { 0x5, "Reserved" }, { 0x6, "Reserved" }, { 0x7, "Reserved" }, { 0x8, "Reserved" }, { 0x9, "Reserved" }, { 0xA, "Reserved" }, { 0xB, "Vendor reserved" }, { 0xC, "Vendor reserved" }, { 0xD, "Vendor reserved" }, { 0xE, "Vendor reserved" }, { 0xF, "Vendor reserved" }, { 0, NULL }, }; static const value_string rtp_ext_ed137a_ft_sqi_rssi_qidx[] = { { 0x00, "lower than -100.00 dBm" }, { 0x01, "lower than or equal to -97.86 dBm" }, { 0x02, "lower than or equal to -95.71 dBm" }, { 0x03, "lower than or equal to -93.57 dBm" }, { 0x04, "lower than or equal to -91.43 dBm" }, { 0x05, "lower than or equal to -89.29 dBm" }, { 0x06, "lower than or equal to -87.14 dBm" }, { 0x07, "lower than or equal to -85.00 dBm" }, { 0x08, "lower than or equal to -82.86 dBm" }, { 0x09, "lower than or equal to -80.71 dBm" }, { 0x0a, "lower than or equal to -78.57 dBm" }, { 0x0b, "lower than or equal to -76.43 dBm" }, { 0x0c, "lower than or equal to -74.29 dBm" }, { 0x0d, "lower than or equal to -72.14 dBm" }, { 0x0e, "lower than or equal to -70.00 dBm" }, { 0x0f, "higher than -70.00 dBm" }, { 0, NULL }, }; static const value_string rtp_ext_ed137a_ft_sqi_qidx_ml[] = { { 0x00, "RSSI" }, { 0x01, "AGC Level" }, { 0x02, "C/N" }, { 0x03, "Standardized PSD" }, { 0x04, "Vendor specific method" }, { 0x05, "Vendor specific method" }, { 0x06, "Vendor specific method" }, { 0x07, "Vendor specific method" }, { 0, NULL }, }; static const value_string rtp_ext_ed137a_ft_climax_delay_mode[] = { { 0x00, "relative" }, { 0x01, "absolute" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_ms_tx_f1[] = { { 0x00, "Main transmitter for F1 is used" }, { 0x01, "Standby transmitter for F1 is used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_ms_rx_f1[] = { { 0x00, "Main receiver for F1 is used" }, { 0x01, "Standby receiver for F1 is used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_ms_tx_f2[] = { { 0x00, "Main transmitter for F2 is used" }, { 0x01, "Standby transmitter for F2 is used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_ms_rx_f2[] = { { 0x00, "Main receiver for F2 is used" }, { 0x01, "Standby receiver for F2 is used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_sel_tx_f1[] = { { 0x00, "Active transmitter for F1 shall not be used" }, { 0x01, "Active transmitter for F1 shall be used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_sel_tx_f2[] = { { 0x00, "Active transmitter for F2 shall not be used" }, { 0x01, "Active transmitter for F2 shall be used" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_mu_rx_f1[] = { { 0x00, "Active receiver for F1 shall be unmuted" }, { 0x01, "Active receiver for F1 shall be muted" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_single_mu_rx_f2[] = { { 0x00, "Active receiver for F2 shall be unmuted" }, { 0x01, "Active receiver for F2 shall be muted" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_climax_ddc_time_quality[] = { { 0x00, "Not synchronized" }, { 0x01, "Synchronized" }, { 0, NULL }, }; static const value_string rtp_ext_ed137b_ft_climax_ddc_mam_nmr[] = { { 0x00, "No request" }, { 0x01, "GRS requests a new RTT measurement" }, { 0, NULL }, }; static const value_string rtp_ext_ed137c_ft_climax_ddc_time_quality[] = { { 0x00, "Not synchronized" }, { 0x01, "Synchronized" }, { 0, NULL }, }; static const value_string rtp_ext_ed137c_ft_climax_ddc_mam_nmr[] = { { 0x00, "No request" }, { 0x01, "GRS requests a new RTT measurement" }, { 0, NULL }, }; /* We do not need to allocate/free strings */ static char *ed137_ptt_only = "PTT"; static char *ed137_squ_only = "SQU"; static char *ed137_ptt_and_squ = "PTT+SQU"; /* Note: * Only seen/tested headers are decoded */ static int dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { unsigned int hdr_extension_len; struct _rtp_info *rtp_info=(struct _rtp_info *)data; proto_tree *rtp_hext_tree = NULL; unsigned int hdrext_offset = 0; gboolean ed137_ptt = FALSE; gboolean ed137_squ = FALSE; hdr_extension_len = tvb_reported_length(tvb); if ( hdr_extension_len > 0 ) { if (rtp_info != NULL) { rtp_info->info_is_ed137 = TRUE; } if ( tree ) { proto_item *ti; ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, 0, hdr_extension_len, ENC_NA); rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s ); } while ( hdr_extension_len > 0 ) { proto_item *ti2; proto_tree *rtp_hext_tree2; proto_item *ti3; proto_tree *rtp_hext_tree3; unsigned int ft_type; guint32 ext_value = tvb_get_ntohl( tvb, hdrext_offset ); if (RTP_ED137_ptt_mask(ext_value)) { col_append_str(pinfo->cinfo, COL_INFO, ", PTT"); ed137_ptt = TRUE; } if (RTP_ED137_squ_mask(ext_value)) { col_append_str(pinfo->cinfo, COL_INFO, ", SQU"); ed137_squ = TRUE; } /* Map PTT/SQU bits to string */ if (rtp_info != NULL) { if (ed137_ptt) { if (ed137_squ) { rtp_info->info_ed137_info = ed137_ptt_and_squ; } else { rtp_info->info_ed137_info = ed137_ptt_only; } } else { if (ed137_squ) { rtp_info->info_ed137_info = ed137_squ_only; } else { rtp_info->info_ed137_info = NULL; } } } if ( rtp_hext_tree ) { ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137, tvb, hdrext_offset, 4, ENC_NA); rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137 ); /* There are multiple formats of header - depends on direction of a flow. As it is not possible to quess flow direction, we use items from RTPRx because unused fields are empty in other formats */ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_squ, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_id, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_sct, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_x, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_vf, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); } ft_type = RTP_ED137_feature_type(ext_value); ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137_add, tvb, hdrext_offset, 4, ENC_NA); rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137_add ); if (RTP_ED137_extended_information(ext_value)) { /* Extended information is used */ if ( rtp_hext_tree ) { proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_len, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); } if ( rtp_hext_tree ) { switch (ft_type) { case RTP_ED137_feature_bss_type: { unsigned int bss_qidx; unsigned int bss_qidx_ml; bss_qidx = RTP_ED137_feature_bss_qidx(ext_value); bss_qidx_ml = RTP_ED137_feature_bss_qidx_ml(ext_value); if (RTP_ED137_feature_bss_qidx_ml_rssi == bss_qidx_ml) { /* Special handling for RSSI method */ if (bss_qidx <= RTP_ED137_feature_bss_qidx_rssi_max) { /* Correct range */ proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_rssi_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); } else { /* Handle as other method */ proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); } } else { /* Other BSS method handling */ proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); } proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_bss_qidx_ml, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); break; } case RTP_ED137_feature_climax_ot_type: { unsigned int climax_ot_value; unsigned int climax_ot_value_calc; climax_ot_value = RTP_ED137_feature_climax_ot_value(ext_value); /* Relative delay, in 2ms steps */ climax_ot_value_calc=2*climax_ot_value; proto_tree_add_uint_format_value( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_climax_delay_value, tvb, hdrext_offset, 4, climax_ot_value, "%d ms", climax_ot_value_calc); break; } default: proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_ft_value, tvb, hdrext_offset, 4, ENC_NA); break; } } /* Shift behind header */ hdrext_offset += 4; hdr_extension_len -= 4; } else { /* Extended information is not used */ if ( rtp_hext_tree ) { proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137_x_nu, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN); } /* Shift behind empty additional feature header */ hdrext_offset += 4; hdr_extension_len -= 4; } } } return tvb_captured_length(tvb); } #define NSTIME_INIT_USEC(nstime, usecs) \ nstime.secs = usecs / 1000000; \ nstime.nsecs = (usecs % 1000000) * 1000; /* Decodes and calculates relative/absolute time item */ static void process_time_value(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int time_item, unsigned int hdrext_offset, gboolean time_relative _U_, unsigned int time_value) { /* Note: even there is relative/absolute flag, value is shown same way because it is relative value derived from relative/absolute start point */ unsigned int time_calc; nstime_t tmp_time; gchar *tmp; /* Value is stored as count of 125 us ticks */ time_calc = time_value * 125; NSTIME_INIT_USEC(tmp_time, time_calc); tmp = rel_time_to_secs_str(pinfo->pool, &tmp_time); proto_tree_add_uint_format_value( tree, time_item, tvb, hdrext_offset, 3, time_value, "%s s", tmp); } /* Decodes and calculates value based on 125us tick*/ static void process_125us_based_value(tvbuff_t *tvb, proto_tree *tree, int value_item, unsigned int hdrext_offset) { guint32 value; guint32 value_calc; /* Values is stored as count of 125 us ticks */ value = tvb_get_ntohs( tvb, hdrext_offset ); value_calc = value * 125; proto_tree_add_uint_format_value( tree, value_item, tvb, hdrext_offset, 2, value, "%d us", value_calc); } static int dissect_rtp_hdr_ext_ed137a_feature_sqi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { guint32 ext_value; guint32 sqi_qidx; guint32 sqi_qidx_ml; ext_value = tvb_get_guint8( tvb, 0 ); sqi_qidx = RTP_ED137A_feature_sqi_qidx(ext_value); sqi_qidx_ml = RTP_ED137A_feature_sqi_qidx_ml(ext_value); if (RTP_ED137A_feature_sqi_qidx_ml_rssi == sqi_qidx_ml) { /* Special handling for RSSI method */ if (sqi_qidx <= RTP_ED137A_feature_sqi_qidx_rssi_max) { /* Correct range */ proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN); } else { /* Handle as other method */ proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN); } } else { /* Other SQI method handling */ proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx, tvb, 0, 1, ENC_BIG_ENDIAN); } proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_sqi_qidx_ml, tvb, 0, 1, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } static int dissect_rtp_hdr_ext_ed137a_feature_climax_tdly(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { guint32 ext_value; guint32 climax_tdly_mode; guint32 climax_tdly_value; guint32 climax_tdly_value_calc; ext_value = tvb_get_guint8( tvb, 0 ); climax_tdly_mode = RTP_ED137A_feature_climax_tdly_mode(ext_value); climax_tdly_value = RTP_ED137A_feature_climax_tdly_value(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137a_ft_climax_delay_mode, tvb, 0, 1, ENC_BIG_ENDIAN); if (RTP_ED137A_feature_climax_tdly_mode_relative == climax_tdly_mode) { /* Relative delay, in 2ms steps */ climax_tdly_value_calc=2*climax_tdly_value; proto_tree_add_uint_format_value( tree, hf_rtp_hdr_ed137a_ft_climax_delay_relative_value, tvb, 0, 1, climax_tdly_value, "%d ms", climax_tdly_value_calc); } else { /* Absolute delay, in 2ms steps */ climax_tdly_value_calc=2*climax_tdly_value; proto_tree_add_uint_format_value( tree, hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value, tvb, 0, 1, climax_tdly_value, "%d ms", climax_tdly_value_calc); } return tvb_captured_length(tvb); } static int dissect_rtp_hdr_ext_ed137b_feature_rrc_single(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { proto_tree *item; /* Generated item points really to previous byte */ item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single, tvb, -1, 1, ENC_NA); proto_item_set_generated(item); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2, tvb, 0, 1, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } static int dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 ext_value; proto_tree *item; guint32 climax_ddc_rmm_tqv; guint32 climax_ddc_rmm_t1; /* Generated item points really to previous byte */ item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm, tvb, -1, 1, ENC_NA); proto_item_set_generated(item); ext_value = tvb_get_ntoh24( tvb, 0 ); climax_ddc_rmm_tqv = RTP_ED137B_feature_climax_ddc_rmm_tqv(ext_value); climax_ddc_rmm_t1 = RTP_ED137B_feature_climax_ddc_rmm_t1(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv, tvb, 0, 3, ENC_BIG_ENDIAN); process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1, 0, (RTP_ED137B_feature_climax_ddc_rmm_tqv_relative == climax_ddc_rmm_tqv), climax_ddc_rmm_t1); return tvb_captured_length(tvb); } static int dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 ext_value; proto_tree *item; guint32 climax_ddc_mam_tqg; guint32 climax_ddc_mam_t1; guint32 climax_ddc_mam_t2; /* Generated item points really to previous byte */ item = proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam, tvb, -1, 1, ENC_NA); proto_item_set_generated(item); ext_value = tvb_get_ntoh24( tvb, 0 + 0 ); climax_ddc_mam_tqg = RTP_ED137B_feature_climax_ddc_mam_tqg(ext_value); climax_ddc_mam_t1 = RTP_ED137B_feature_climax_ddc_mam_t1(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN); process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1, 0, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1); ext_value = tvb_get_ntoh24( tvb, 0 + 3 ); climax_ddc_mam_t2 = RTP_ED137B_feature_climax_ddc_mam_t2(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN); process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd, 0 + 6); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1, 0 + 8); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid, 0 + 10); return tvb_captured_length(tvb); } static int dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 ext_value; proto_tree *item; guint32 climax_ddc_mam_tqg; guint32 climax_ddc_mam_t1; guint32 climax_ddc_mam_t2; /* Generated item points really to previous byte */ item = proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam, tvb, -1, 1, ENC_NA); proto_item_set_generated(item); ext_value = tvb_get_ntoh24( tvb, 0 + 0 ); climax_ddc_mam_tqg = RTP_ED137C_feature_climax_ddc_mam_tqg(ext_value); climax_ddc_mam_t1 = RTP_ED137C_feature_climax_ddc_mam_t1(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN); process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1, 0, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1); ext_value = tvb_get_ntoh24( tvb, 0 + 3 ); climax_ddc_mam_t2 = RTP_ED137C_feature_climax_ddc_mam_t2(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN); process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd, 0 + 6); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1, 0 + 8); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid, 0 + 10); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2, 0 + 12); return tvb_captured_length(tvb); } /* Decode ED-137A fixed part and call dissectors for variable part */ static int dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { guint32 hdr_extension_len; struct _rtp_info *rtp_info=(struct _rtp_info *)data; proto_tree *rtp_hext_tree = NULL; guint32 hdrext_offset = 0; gboolean ed137_ptt = FALSE; gboolean ed137_squ = FALSE; hdr_extension_len = tvb_reported_length(tvb); if ( hdr_extension_len > 0 ) { proto_item *ti2; proto_tree *rtp_hext_tree2; guint32 ext_value = tvb_get_ntohs( tvb, hdrext_offset ); if (rtp_info != NULL) { rtp_info->info_is_ed137 = TRUE; } if ( tree ) { proto_item *ti; ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, 0, hdr_extension_len, ENC_NA); rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s ); } if (RTP_ED137A_ptt_mask(ext_value)) { col_append_str(pinfo->cinfo, COL_INFO, ", PTT"); ed137_ptt = TRUE; } if (RTP_ED137A_squ_mask(ext_value)) { col_append_str(pinfo->cinfo, COL_INFO, ", SQU"); ed137_squ = TRUE; } /* Map PTT/SQU bits to string */ if (rtp_info != NULL) { if (ed137_ptt) { if (ed137_squ) { rtp_info->info_ed137_info = ed137_ptt_and_squ; } else { rtp_info->info_ed137_info = ed137_ptt_only; } } else { if (ed137_squ) { rtp_info->info_ed137_info = ed137_squ_only; } else { rtp_info->info_ed137_info = NULL; } } } if ( rtp_hext_tree ) { ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a, tvb, hdrext_offset, 2, ENC_NA); rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137a ); /* There are multiple formats of header - depends on direction of a flow. As it is not possible to quess flow direction, we use items from RTPRx because unused fields are empty in other formats */ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_type, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_squ, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_id, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_pm, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptts, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_sct, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_reserved, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_x, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); } /* Shift behind standard ED-137A header */ hdrext_offset += 2; hdr_extension_len -= 2; /* Do we have additional feature blocks? */ if (RTP_ED137A_extended_information(ext_value)) { /* Loop over all additional feature blocks */ /* The shortest header lenght is 2, anything shorter is padding */ while ( hdr_extension_len >= 2 ) { proto_item *ti3; proto_tree *rtp_hext_tree3; guint32 ft_type; guint32 ft_len; ext_value = tvb_get_ntohs( tvb, hdrext_offset ); ft_type = RTP_ED137A_feature_type(ext_value); ft_len = RTP_ED137A_feature_length(ext_value); /* Is it header or padding? */ if ( RTP_ED137_feature_none_type != ft_type ) { ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a_add, tvb, hdrext_offset, (ft_len > 0 ? ft_len + 1 : 2), ENC_NA); rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137a_add ); if ( rtp_hext_tree ) { proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_type, tvb, hdrext_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_len, tvb, hdrext_offset, 1, ENC_BIG_ENDIAN); } /* Shift behind feature header */ hdrext_offset += 1; hdr_extension_len -= 1; if ( rtp_hext_tree ) { tvbuff_t *newtvb; guint32 ft_table_key; /* join 4 bit type and 4 bit lenght to 8 bit key */ ft_table_key = MAKE_KEY( ft_type, ft_len ); /* pass interpretation of header extension to a registered subdissector */ /* new subset points to value (starts behind type/length pair) */ newtvb = tvb_new_subset_length(tvb, hdrext_offset, hdr_extension_len); /* try to find a dissector by type/len key and dissect additional feature header */ if ( !(dissector_try_uint(rtp_hdr_ext_ed137a_add_features_table, ft_table_key, newtvb, pinfo, rtp_hext_tree3)) ) { proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_ft_value, tvb, hdrext_offset, ft_len, ENC_NA); } } /* Shift behind feature data */ hdrext_offset += ft_len; hdr_extension_len -= ft_len; } else { /* Padding, exit while loop */ break; } } /* Process padding if any */ guint32 hdr_extension_padding; hdr_extension_padding = hdr_extension_len & 0x03; /* Calculate padding size */ if ( hdr_extension_padding > 0 ) { if ( rtp_hext_tree ) { proto_tree_add_item( rtp_hext_tree, hf_rtp_hdr_ed137a_ft_padding, tvb, hdrext_offset, hdr_extension_padding, ENC_NA); } } } else { /* Extended information is not used */ if ( rtp_hext_tree ) { proto_item *ti3; proto_tree *rtp_hext_tree3; ti3 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a_add, tvb, hdrext_offset, 2, ENC_NA); rtp_hext_tree3 = proto_item_add_subtree( ti3, ett_hdr_ext_ed137a_add ); proto_tree_add_item( rtp_hext_tree3, hf_rtp_hdr_ed137a_x_nu, tvb, hdrext_offset, 2, ENC_BIG_ENDIAN); } } } return tvb_captured_length(tvb); } /* Register RTP ED-137 */ void proto_register_rtp_ed137(void) { static hf_register_info hf[] = { /* ED-137 and ED-137A common structures */ { &hf_rtp_hdr_ed137s, { "ED137 extensions", "rtp.ext.ed137s", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* ED-137 only structures */ { &hf_rtp_hdr_ed137, { "ED137 extension", "rtp.ext.ed137", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137_add, { "ED137 extension additional feature", "rtp.ext.ed137.ft", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ptt_type, { "PTT Type", "rtp.ext.ed137.ptt_type", FT_UINT32, BASE_DEC, VALS(rtp_ext_ed137_ptt_type), 0xE0000000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_squ, { "SQU", "rtp.ext.ed137.squ", FT_UINT32, BASE_DEC, VALS(rtp_ext_ed137_squ), 0x10000000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ptt_id, { "PTT-id", "rtp.ext.ed137.ptt_id", FT_UINT32, BASE_DEC, NULL, 0x0F000000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_sct, { "Simultaneous Call Transmissions", "rtp.ext.ed137.sct", FT_UINT32, BASE_DEC, NULL, 0x00800000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_x, { "X", "rtp.ext.ed137.x", FT_UINT32, BASE_DEC, VALS(rtp_ext_ed137_x), 0x00400000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_x_nu, { "Not used", "rtp.ext.ed137.x-nu", FT_UINT32, BASE_DEC, NULL, 0x003FFFFE, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_type, { "Feature type", "rtp.ext.ed137.ft.type", FT_UINT32, BASE_HEX_DEC, VALS(rtp_ext_ed137_ft_type), 0x003C0000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_len, { "Feature length", "rtp.ext.ed137.ft.len", FT_UINT32, BASE_DEC, NULL, 0x0003C000, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_value, { "Feature value", "rtp.ext.ed137.ft.value", FT_UINT32, BASE_HEX_DEC, NULL, 0x00003FFE, NULL, HFILL } }, { &hf_rtp_hdr_ed137_vf, { "VF", "rtp.ext.ed137.vf", FT_UINT32, BASE_DEC, VALS(rtp_ext_ed137_vf), 0x00000001, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_bss_qidx, { "BSS Quality Index", "rtp.ext.ed137.ft.bss.qidx", FT_UINT32, BASE_DEC, NULL, 0x00003FC0, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_bss_rssi_qidx, { "BSS Quality Index", "rtp.ext.ed137.ft.bss.qidx", FT_UINT32, BASE_DEC, VALS(rtp_ext_ed137_ft_bss_rssi_qidx), 0x00003FC0, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_bss_qidx_ml, { "BSS Quality Index Method", "rtp.ext.ed137.ft.bss.qidx-ml", FT_UINT32, BASE_DEC, VALS(rtp_ext_ed137_ft_bss_qidx_ml), 0x00000038, NULL, HFILL } }, { &hf_rtp_hdr_ed137_ft_climax_delay_value, { "CLIMAX-Time Delay", "rtp.ext.ed137.ft.climax_delay.value", FT_UINT32, BASE_DEC, NULL, 0x00003F00, NULL, HFILL } }, /* ED-137A/B only structures */ { &hf_rtp_hdr_ed137a, { "ED137A extension", "rtp.ext.ed137a", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_add, { "ED137A extension additional feature", "rtp.ext.ed137a.ft", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ptt_type, { "PTT Type", "rtp.ext.ed137a.ptt_type", FT_UINT16, BASE_DEC, VALS(rtp_ext_ed137a_ptt_type), 0xE000, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_squ, { "SQU", "rtp.ext.ed137a.squ", FT_UINT16, BASE_DEC, VALS(rtp_ext_ed137a_squ), 0x1000, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ptt_id, { "PTT-id", "rtp.ext.ed137a.ptt_id", FT_UINT16, BASE_DEC, NULL, 0x0FC0, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_pm, { "PTT Mute", "rtp.ext.ed137a.pm", FT_UINT16, BASE_DEC, NULL, 0x0020, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ptts, { "PTT Summation", "rtp.ext.ed137a.ptts", FT_UINT16, BASE_DEC, NULL, 0x0010, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_sct, { "Simultaneous Call Transmissions", "rtp.ext.ed137a.sct", FT_UINT16, BASE_DEC, NULL, 0x0008, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_reserved, { "Reserved", "rtp.ext.ed137a.reserved", FT_UINT16, BASE_HEX_DEC, NULL, 0x0006, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_x, { "X", "rtp.ext.ed137a.x", FT_UINT16, BASE_DEC, VALS(rtp_ext_ed137_x), 0x0001, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_x_nu, { "Not used", "rtp.ext.ed137a.x-nu", FT_UINT16, BASE_DEC, NULL, 0xFFFF, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_type, { "Feature type", "rtp.ext.ed137a.ft.type", FT_UINT8, BASE_HEX_DEC, VALS(rtp_ext_ed137a_ft_type), 0xF0, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_len, { "Feature length", "rtp.ext.ed137a.ft.len", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_value, { "Feature value", "rtp.ext.ed137a.ft.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_padding, { "Padding", "rtp.ext.ed137a.ft.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_sqi_qidx, { "SQI Quality Index", "rtp.ext.ed137a.ft.sqi.qidx", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_sqi_rssi_qidx, { "SQI Quality Index", "rtp.ext.ed137a.ft.sqi.qidx", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137a_ft_sqi_rssi_qidx), 0xF8, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_sqi_qidx_ml, { "SQI Quality Index Method", "rtp.ext.ed137a.ft.sqi.qidx-ml", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137a_ft_sqi_qidx_ml), 0x07, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_climax_delay_mode, { "CLIMAX-Time Delay Mode", "rtp.ext.ed137a.ft.climax_delay.mode", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137a_ft_climax_delay_mode), 0x80, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_climax_delay_relative_value, { "CLIMAX-Time Delay Relative", "rtp.ext.ed137a.ft.climax_delay.relative_value", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL } }, { &hf_rtp_hdr_ed137a_ft_climax_delay_absolute_value, { "CLIMAX-Time Delay Absolute", "rtp.ext.ed137a.ft.climax_delay.absolute_value", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single, { "RRC for single frequency", "rtp.ext.ed137b.ft.rrc.single", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f1, { "MSTxF1", "rtp.ext.ed137b.ft.rrc.mstxf1", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_ms_tx_f1), 0x80, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f1, { "MSRxF1", "rtp.ext.ed137b.ft.rrc.msrxf1", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_ms_rx_f1), 0x40, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_ms_tx_f2, { "MSTxF2", "rtp.ext.ed137b.ft.rrc.mstxf2", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_ms_tx_f2), 0x20, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_ms_rx_f2, { "MSRxF2", "rtp.ext.ed137b.ft.rrc.msrxf2", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_ms_rx_f2), 0x10, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f1, { "SelTxF1", "rtp.ext.ed137b.ft.rrc.seltxf1", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_sel_tx_f1), 0x08, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_sel_tx_f2, { "SelTxF2", "rtp.ext.ed137b.ft.rrc.seltxf2", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_sel_tx_f2), 0x04, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f1, { "MuRxF1", "rtp.ext.ed137b.ft.rrc.murxf1", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_mu_rx_f1), 0x02, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_rrc_single_mu_rx_f2, { "MuRxF2", "rtp.ext.ed137b.ft.rrc.murxf2", FT_UINT8, BASE_DEC, VALS(rtp_ext_ed137b_ft_single_mu_rx_f2), 0x01, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_unknown, { "CLIMAX Dynamic Delay Compensation Unknown Method", "rtp.ext.ed137b.ft.climax_ddc.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm, { "CLIMAX Dynamic Delay Compensation RMM Request", "rtp.ext.ed137b.ft.climax_ddc.rmm", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv, { "Time Quality VCS", "rtp.ext.ed137b.ft.climax_ddc.rmm_tqv", FT_UINT24, BASE_DEC, VALS(rtp_ext_ed137b_ft_climax_ddc_time_quality), 0x800000, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1, { "T1", "rtp.ext.ed137b.ft.climax_ddc.rmm_t1", FT_UINT24, BASE_DEC, NULL, 0x7FFFFF, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam, { "CLIMAX Dynamic Delay Compensation MAM Response (ED-137B)", "rtp.ext.ed137b.ft.climax_ddc.mam", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg, { "Time Quality GRS", "rtp.ext.ed137b.ft.climax_ddc.mam_tqg", FT_UINT24, BASE_DEC, VALS(rtp_ext_ed137b_ft_climax_ddc_time_quality), 0x800000, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1, { "T1", "rtp.ext.ed137b.ft.climax_ddc.mam_t1", FT_UINT24, BASE_DEC, NULL, 0x7FFFFF, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr, { "New measurement requested", "rtp.ext.ed137b.ft.climax_ddc.mam_nmr", FT_UINT24, BASE_DEC, VALS(rtp_ext_ed137b_ft_climax_ddc_mam_nmr), 0x800000, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2, { "T2", "rtp.ext.ed137b.ft.climax_ddc.mam_t2", FT_UINT24, BASE_DEC, NULL, 0x7FFFFF, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd, { "Tsd", "rtp.ext.ed137b.ft.climax_ddc.mam_tsd", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1, { "Tj1", "rtp.ext.ed137b.ft.climax_ddc.mam_tj1", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tid, { "Tid", "rtp.ext.ed137b.ft.climax_ddc.mam_tid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam, { "CLIMAX Dynamic Delay Compensation MAM Response (ED-137C)", "rtp.ext.ed137c.ft.climax_ddc.mam", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg, { "Time Quality GRS", "rtp.ext.ed137c.ft.climax_ddc.mam_tqg", FT_UINT24, BASE_DEC, VALS(rtp_ext_ed137c_ft_climax_ddc_time_quality), 0x800000, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1, { "T1", "rtp.ext.ed137c.ft.climax_ddc.mam_t1", FT_UINT24, BASE_DEC, NULL, 0x7FFFFF, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr, { "New measurement requested", "rtp.ext.ed137c.ft.climax_ddc.mam_nmr", FT_UINT24, BASE_DEC, VALS(rtp_ext_ed137c_ft_climax_ddc_mam_nmr), 0x800000, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2, { "T2", "rtp.ext.ed137c.ft.climax_ddc.mam_t2", FT_UINT24, BASE_DEC, NULL, 0x7FFFFF, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd, { "Tsd", "rtp.ext.ed137c.ft.climax_ddc.mam_tsd", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1, { "Tj1", "rtp.ext.ed137c.ft.climax_ddc.mam_tj1", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tid, { "Tid", "rtp.ext.ed137c.ft.climax_ddc.mam_tid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtp_hdr_ed137c_ft_climax_ddc_mam_ts2, { "Ts2", "rtp.ext.ed137c.ft.climax_ddc.mam_ts2", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, }; static gint *ett[] = { &ett_hdr_ext_ed137s, &ett_hdr_ext_ed137, &ett_hdr_ext_ed137_add, &ett_hdr_ext_ed137a, &ett_hdr_ext_ed137a_add, }; proto_rtp_ed137 = proto_register_protocol("Real-Time Transport Protocol ED137 Extensions", "RTP-ED137", "rtp.ext.ed137"); proto_register_field_array(proto_rtp_ed137, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); rtp_hdr_ext_ed137_handle = register_dissector("rtp.ext.ed137", dissect_rtp_hdr_ext_ed137, proto_rtp_ed137); rtp_hdr_ext_ed137a_handle = register_dissector("rtp.ext.ed137a", dissect_rtp_hdr_ext_ed137a, proto_rtp_ed137); /* Table for ED-137A additional feature dissectors */ rtp_hdr_ext_ed137a_add_features_table = register_dissector_table("rtp.hdr_ext.ed137a", "RTP header ED137A additional features", proto_rtp_ed137, FT_UINT8, BASE_HEX); /* Register dissectors for tested additional headers */ /* ED-137A signal quality information */ rtp_hdr_ext_ed137a_feature_sqi_handle = register_dissector("rtp.hdr_ext.ed137a.ed137a_feature_sqi", dissect_rtp_hdr_ext_ed137a_feature_sqi, proto_rtp_ed137); dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137A_feature_sqi_key, rtp_hdr_ext_ed137a_feature_sqi_handle); /* ED-137A CLIMAX time delay */ rtp_hdr_ext_ed137a_feature_climax_tdly_handle = register_dissector("rtp.hdr_ext.ed137a.ed137a_feature_climax_tdly", dissect_rtp_hdr_ext_ed137a_feature_climax_tdly, proto_rtp_ed137); dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137A_feature_climax_tdly_key, rtp_hdr_ext_ed137a_feature_climax_tdly_handle); /* ED-137B RRC for single frequency */ rtp_hdr_ext_ed137b_feature_rrc_single_handle = register_dissector("rtp.hdr_ext.ed137a.ed137b_feature_rrc_single", dissect_rtp_hdr_ext_ed137b_feature_rrc_single, proto_rtp_ed137); dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_rrc_single_key, rtp_hdr_ext_ed137b_feature_rrc_single_handle); /* ED-137B CLIMAX request for measurement message (RMM) */ rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle = register_dissector("rtp.hdr_ext.ed137a.ed137b_feature_climax_ddc_rmm", dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm, proto_rtp_ed137); dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_climax_ddc_rmm_key, rtp_hdr_ext_ed137b_feature_climax_ddc_rmm_handle); /* ED-137B CLIMAX response message (MAM) */ rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle = register_dissector("rtp.hdr_ext.ed137a.ed137b_feature_climax_ddc_mam", dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam, proto_rtp_ed137); dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137B_feature_climax_ddc_mam_key, rtp_hdr_ext_ed137b_feature_climax_ddc_mam_handle); /* ED-137C CLIMAX response message (MAM) */ rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle = register_dissector("rtp.hdr_ext.ed137a.ed137c_feature_climax_ddc_mam", dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam, proto_rtp_ed137); dissector_add_uint("rtp.hdr_ext.ed137a", RTP_ED137C_feature_climax_ddc_mam_key, rtp_hdr_ext_ed137c_feature_climax_ddc_mam_handle); } void proto_reg_handoff_rtp_ed137(void) { static gboolean prefs_initialized = FALSE; if (!prefs_initialized) { dissector_add_uint("rtp.hdr_ext", RTP_ED137_SIG, rtp_hdr_ext_ed137_handle); dissector_add_uint("rtp.hdr_ext", RTP_ED137A_SIG, rtp_hdr_ext_ed137a_handle); prefs_initialized = TRUE; } } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtp-events.c
/* packet-rtp-events.c * * Routines for RFC 2833 RTP Events dissection * Copyright 2003, Kevin A. Noll <knoll[AT]poss.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * Ref https://tools.ietf.org/html/rfc4733 */ /* * This dissector tries to dissect RTP Events. * * Cisco NSE is now supported, additions by * Gonzalo Salgueiro <[email protected]> * Chidambaram Arunachalam <[email protected]> * Copyright 2008, Cisco Systems, Inc. */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/proto_data.h> #include "packet-rtp-events.h" #include "packet-rtp.h" #include <epan/tap.h> void proto_register_rtp_events(void); void proto_reg_handoff_rtp_events(void); /* 101 for RTP Event, 100 for Cisco NSE */ #define RTP_EVENT_DEFAULT_PT_RANGE "100-101" /* RTP Event Fields */ static int proto_rtp_events = -1; static int rtp_event_tap = -1; static int hf_rtp_events_event = -1; /* one byte */ static int hf_rtp_events_end = -1; /* one bit */ static int hf_rtp_events_reserved = -1; /* one bit */ static int hf_rtp_events_volume = -1; /* six bits */ static int hf_rtp_events_duration = -1; /* sixteen bits */ #define RTP_DTMF_0 0 #define RTP_DTMF_1 1 #define RTP_DTMF_2 2 #define RTP_DTMF_3 3 #define RTP_DTMF_4 4 #define RTP_DTMF_5 5 #define RTP_DTMF_6 6 #define RTP_DTMF_7 7 #define RTP_DTMF_8 8 #define RTP_DTMF_9 9 #define RTP_DTMF_STAR 10 #define RTP_DTMF_POUND 11 #define RTP_DTMF_A 12 #define RTP_DTMF_B 13 #define RTP_DTMF_C 14 #define RTP_DTMF_D 15 #define RTP_DTMF_FLASH 16 #define RTP_ANS 32 #define RTP_ANSREV 33 #define RTP_ANSAM 34 #define RTP_ANSAMREV 35 #define RTP_CNG 36 #define RTP_V21C1B0 37 #define RTP_V21C1B1 38 #define RTP_V21C2B0 39 #define RTP_V21C2B1 40 #define RTP_CRDI 41 #define RTP_CRDR 42 #define RTP_CRE 43 #define RTP_ESI 44 #define RTP_ESR 45 #define RTP_MRDI 46 #define RTP_MRDR 47 #define RTP_MRE 48 #define RTP_CT 49 #define RTP_OFFHOOK 64 #define RTP_ONHOOK 65 #define RTP_DIALTONE 66 #define RTP_INTDT 67 #define RTP_SPCDT 68 #define RTP_2NDDT 69 #define RTP_RGTONE 70 #define RTP_SPRGTONE 71 #define RTP_BUSYTONE 72 #define RTP_CNGTONE 73 #define RTP_SPINFOTN 74 #define RTP_CMFTTONE 75 #define RTP_HOLDTONE 76 #define RTP_RECTONE 77 #define RTP_CLRWTTONE 78 #define RTP_CWTONE 79 #define RTP_PAYTONE 80 #define RTP_POSINDTONE 81 #define RTP_NEGINDTONE 82 #define RTP_WARNTONE 83 #define RTP_INTRTONE 84 #define RTP_CALLCDTONE 85 #define RTP_PAYPHONE 86 #define RTP_CAS 87 #define RTP_OFFHKWARN 88 #define RTP_RING 89 #define RTP_ACCPTTONE 96 #define RTP_CONFIRMTN 97 #define RTP_DLTNRECALL 98 #define RTP_END3WAYTN 99 #define RTP_FACTONE 100 #define RTP_LNLOCKTN 101 #define RTP_NUMUNOBT 102 #define RTP_OFFERGTONE 103 #define RTP_PERMSIGTN 104 #define RTP_PREEMPTTN 105 #define RTP_QUETONE 106 #define RTP_REFUSALTN 107 #define RTP_ROUTETONE 108 #define RTP_VALIDTONE 109 #define RTP_WAITGTONE 110 #define RTP_WARNEOPTN 111 #define RTP_WARNPIPTN 112 #define RTP_MF0 128 #define RTP_MF1 129 #define RTP_MF2 130 #define RTP_MF3 131 #define RTP_MF4 132 #define RTP_MF5 133 #define RTP_MF6 134 #define RTP_MF7 135 #define RTP_MF8 136 #define RTP_MF9 137 #define RTP_K0 138 #define RTP_K1 139 #define RTP_K2 140 #define RTP_S0 141 #define RTP_S1 142 #define RTP_S3 143 #define RTP_WINK 160 #define RTP_WINKOFF 161 #define RTP_INCSEIZ 162 #define RTP_SEIZURE 163 #define RTP_UNSEIZE 164 #define RTP_COT 165 #define RTP_DEFCOT 166 #define RTP_COTTONE 167 #define RTP_COTSEND 168 #define RTP_COTVERFD 170 #define RTP_LOOPBACK 171 #define RTP_MWATTTONE 172 #define RTP_NEWMWATTTN 173 #define RTP_CISCO_NSE_FAX_PASSTHROUGH_IND 192 #define RTP_CISCO_NSE_MODEM_PASSTHROUGH_IND 193 #define RTP_CISCO_NSE_VOICE_MODE_IND 194 #define RTP_CISCO_NSE_MODEM_RELAY_CAP_IND 199 #define RTP_CISCO_NSE_FAX_RELAY_IND 200 #define RTP_CISCO_NSE_ACK 201 #define RTP_CISCO_NSE_NACK 202 #define RTP_CISCO_NSE_MODEM_RELAY_IND 203 /* https://www.iana.org/assignments/audio-telephone-event-registry/audio-telephone-event-registry.xml */ static const value_string rtp_event_type_values[] = { { RTP_DTMF_0, "DTMF Zero 0" }, { RTP_DTMF_1, "DTMF One 1" }, { RTP_DTMF_2, "DTMF Two 2" }, { RTP_DTMF_3, "DTMF Three 3" }, { RTP_DTMF_4, "DTMF Four 4" }, { RTP_DTMF_5, "DTMF Five 5" }, { RTP_DTMF_6, "DTMF Six 6" }, { RTP_DTMF_7, "DTMF Seven 7" }, { RTP_DTMF_8, "DTMF Eight 8" }, { RTP_DTMF_9, "DTMF Nine 9" }, { RTP_DTMF_STAR, "DTMF Star *" }, { RTP_DTMF_POUND, "DTMF Pound #" }, { RTP_DTMF_A, "DTMF A" }, { RTP_DTMF_B, "DTMF B" }, { RTP_DTMF_C, "DTMF C" }, { RTP_DTMF_D, "DTMF D" }, { RTP_DTMF_FLASH, "Flash" }, /* 17-22 Unassigned*/ { 23, "CRdSeg: second segment of V.8 bis CRd signal" }, // [RFC4734] { 24, "CReSeg : second segment of V.8 bis CRe signal" }, // [RFC4734] { 25, "MRdSeg : second segment of V.8 bis MRd signal" }, // [RFC4734] { 26, "MReSeg : second segment of V.8 bis MRe signal" }, // [RFC4734] { 27, "V32AC : A pattern of bits modulated at 4800 bits / s, emitted by a V.32 / V.32bis answering terminal upon detection of the AA pattern." }, // [RFC4734] { 28, "V8bISeg : first segment of initiating V.8 bis signal" }, // [RFC4734] { 29, "V8bRSeg : first segment of responding V.8 bis signal" }, // [RFC4734] { 30, "V21L300 : 300 bits / s low channel V.21 indication" }, // [RFC4734] { 31, "V21H300 : 300 bits / s high channel V.21 indication" }, // [RFC4734] { RTP_ANS, "Fax ANS"}, { RTP_ANSREV, "Fax /ANS"}, { RTP_ANSAM, "Fax ANSam"}, { RTP_ANSAMREV, "Fax /ANSam"}, { RTP_CNG, "Fax CNG"}, { RTP_V21C1B0, "V.21 channel 1, 0 bit"}, { RTP_V21C1B1, "V.21 channel 1, 1 bit"}, { RTP_V21C2B0, "V.21 channel 2, 0 bit"}, { RTP_V21C2B1, "V.21 channel 2, 1 bit"}, { RTP_CRDI, "Fax CRdi"}, { RTP_CRDR, "Fax CRdr"}, { RTP_CRE, "Fax CRe"}, { RTP_ESI, "Fax ESi"}, { RTP_ESR, "Fax ESr"}, { RTP_MRDI, "Fax MRdi"}, { RTP_MRDR, "Fax MRdr"}, { RTP_MRE, "Fax MRe"}, { RTP_CT, "Fax CT"}, /* 50-51 Unassigned*/ { 52, "ANS2225: 2225 Hz indication for text telephony" }, // [RFC4734] { 53, "CI(V.8 Call Indicator signal preamble)" }, // [RFC4734] { 54, "V.21 preamble flag(T.30)" }, // [RFC4734] { 55, "V21L110 : 110 bits / s V.21 indication for text telephony" }, // [RFC4734] { 56, "B103L300 : Bell 103 low channel indication for text telephony" }, // [RFC4734] { 57, "V23Main : V.23 main channel indication for text telephony" }, // [RFC4734] { 58, "V23Back : V.23 back channel indication for text telephony" }, // [RFC4734] { 59, "Baud4545 : 45.45 bits / s Baudot indication for text telephony" }, // [RFC4734] { 60, "Baud50 : 50 bits / s Baudot indication for text telephony" }, // [RFC4734] { 61, "VBDGen : Tone patterns indicative of use of an unidentified modem type" }, // [RFC4734] { 62, "XCIMark : A pattern of bits modulated in the V.23 main channel, emitted by a V.18 calling terminal" }, // [RFC4734] { 63, "V32AA : A pattern of bits modulated at 4800 bits / s, emitted by a V.32 / V.23bis calling terminal" }, // [RFC4734] { RTP_OFFHOOK, "Off Hook"}, { RTP_ONHOOK, "On Hook"}, { RTP_DIALTONE, "Dial tone"}, { RTP_INTDT, "PABX internal dial tone"}, { RTP_SPCDT, "Special dial tone"}, { RTP_2NDDT, "Second dial tone"}, { RTP_RGTONE, "Ringing tone"}, { RTP_SPRGTONE, "Special ringing tone"}, { RTP_BUSYTONE, "Busy tone"}, { RTP_CNGTONE, "Congestion tone"}, { RTP_SPINFOTN, "Special information tone"}, { RTP_CMFTTONE, "Comfort tone"}, { RTP_HOLDTONE, "Hold tone"}, { RTP_RECTONE, "Record tone"}, { RTP_CLRWTTONE, "Caller waiting tone"}, { RTP_CWTONE, "Call waiting tone"}, { RTP_PAYTONE, "Pay tone"}, { RTP_POSINDTONE, "Positive indication tone"}, { RTP_NEGINDTONE, "Negative indication tone"}, { RTP_WARNTONE, "Warning tone"}, { RTP_INTRTONE, "Intrusion tone"}, { RTP_CALLCDTONE, "Calling card service tone"}, { RTP_PAYPHONE, "Payphone recognition tone"}, { RTP_CAS, "CPE alerting signal (CAS)"}, { RTP_OFFHKWARN, "Off-hook warning tone"}, { RTP_RING, "Ring"}, { RTP_ACCPTTONE, "Acceptance tone"}, { RTP_CONFIRMTN, "Confirmation tone"}, { RTP_DLTNRECALL, "Dial tone, recall"}, { RTP_END3WAYTN, "End of three party service tone"}, { RTP_FACTONE, "Facilities tone"}, { RTP_LNLOCKTN, "Line lockout tone"}, { RTP_NUMUNOBT, "Number unobtainable tone"}, { RTP_OFFERGTONE, "Offering tone"}, { RTP_PERMSIGTN, "Permanent signal tone"}, { RTP_PREEMPTTN, "Preemption tone"}, { RTP_QUETONE, "Queue tone"}, { RTP_REFUSALTN, "Refusal tone"}, { RTP_ROUTETONE, "Route tone"}, { RTP_VALIDTONE, "Valid tone"}, { RTP_WAITGTONE, "Waiting tone"}, { RTP_WARNEOPTN, "Warning tone (end of period)"}, { RTP_WARNPIPTN, "Warning Tone (PIP tone)"}, { 115, "North American SIT Segment 1 Low" }, // [GR - 674] { 116, "North American SIT Segment 1 High" }, // [GR - 674] { 117, "North American SIT Segment 2 Low" }, // [GR - 674] { 118, "North American SIT Segment 2 High" }, // [GR - 674] { 119, "North American SIT Segment 3" }, // [GR - 674] { 120, "North American Coin Deposit" }, // [GR - 506] { 121, "Continuity check - tone" }, // [RFC5244] { 122, "Continuity verify - tone" }, // [RFC5244] { 123, "MF Code 11 (SS No. 5) or KP3P / ST3P(R1) or North American Ringback" }, // [GR-506] { 124, "MF KP(SS No. 5) or KP1(R1) or North American Coin Return" }, // [GR-506] { 125, "MF KP2(SS No. 5) or KP2P / ST2P(R1)" }, // [RFC5244] { 126, "MF ST(SS No. 5 and R1) or North American Coin Collect / Operator Released" }, // [GR-506] { 127, "MF Code 12 (SS No. 5) or KP'/STP (R1)" }, { RTP_MF0, "MF 0"}, { RTP_MF1, "MF 1"}, { RTP_MF2, "MF 2"}, { RTP_MF3, "MF 3"}, { RTP_MF4, "MF 4"}, { RTP_MF5, "MF 5"}, { RTP_MF6, "MF 6"}, { RTP_MF7, "MF 7"}, { RTP_MF8, "MF 8"}, { RTP_MF9, "MF 9"}, { RTP_K0, "MF K0 or KP (start-of-pulsing)"}, { RTP_K1, "MF K1"}, { RTP_K2, "MF K2"}, { RTP_S0, "MF S0 to ST (end-of-pulsing)"}, { RTP_S1, "MF S1"}, { RTP_S3, "MF S3"}, { 144, "ABCD signalling state '0000'" }, // [RFC5244] { 145, "ABCD signalling state '0001'" }, // [RFC5244] { 146, "ABCD signalling state '0010'" }, // [RFC5244] { 147, "ABCD signalling state '0011'" }, // [RFC5244] { 148, "ABCD signalling state '0100'" }, // [RFC5244] { 149, "ABCD signalling state '0101'" }, // [RFC5244] { 150, "ABCD signalling state '0110'" }, // [RFC5244] { 151, "ABCD signalling state '0111'" }, // [RFC5244] { 152, "ABCD signalling state '1000'" }, // [RFC5244] { 153, "ABCD signalling state '1001'" }, // [RFC5244] { 154, "ABCD signalling state '1010'" }, // [RFC5244] { 155, "ABCD signalling state '1011'" }, // [RFC5244] { 156, "ABCD signalling state '1100'" }, // [RFC5244] { 157, "ABCD signalling state '1101'" }, // [RFC5244] { 158, "ABCD signalling state '1110'" }, // [RFC5244] { 159, "ABCD signalling state '1111'" }, // [RFC5244] { RTP_WINK, "Wink"}, { RTP_WINKOFF, "Wink off"}, { RTP_INCSEIZ, "Incoming seizure"}, { RTP_SEIZURE, "Seizure"}, { RTP_UNSEIZE, "Unseize circuit"}, { RTP_COT, "Continuity test"}, { RTP_DEFCOT, "Default continuity tone"}, { RTP_COTTONE, "Continuity tone (single tone)"}, { RTP_COTSEND, "Continuity test send"}, { RTP_COTVERFD, "Continuity verified"}, { RTP_LOOPBACK, "Loopback"}, { RTP_MWATTTONE, "Old milliwatt tone (1000 Hz)"}, { RTP_NEWMWATTTN, "New milliwatt tone (1004 Hz)"}, { 174, "Metering pulse" }, // [RFC5244] { 175, "Trunk unavailable" }, // [RFC5244] { 176, "MFC forward signal 1" }, // [RFC5244] { 177, "MFC forward signal 2" }, // [RFC5244] { 178, "MFC forward signal 3" }, // [RFC5244] { 179, "MFC forward signal 4" }, // [RFC5244] { 180, "MFC forward signal 5" }, // [RFC5244] { 181, "MFC forward signal 6" }, // [RFC5244] { 182, "MFC forward signal 7" }, // [RFC5244] { 183, "MFC forward signal 8" }, // [RFC5244] { 184, "MFC forward signal 9" }, // [RFC5244] { 185, "MFC forward signal 10" }, // [RFC5244] { 186, "MFC forward signal 11" }, // [RFC5244] { 187, "MFC forward signal 12" }, // [RFC5244] { 188, "MFC forward signal 13" }, // [RFC5244] { 189, "MFC forward signal 14" }, // [RFC5244] { 190, "MFC forward signal 15" }, // [RFC5244] { 191, "MFC backward signal 1" }, // [RFC5244] { 192, "MFC backward signal 2" }, // [RFC5244] //193 MFC backward signal 3[RFC5244] //194 MFC backward signal 4[RFC5244] //195 MFC backward signal 5[RFC5244] //196 MFC backward signal 6[RFC5244] //197 MFC backward signal 7[RFC5244] //198 MFC backward signal 8[RFC5244] //199 MFC backward signal 9[RFC5244] //200 MFC backward signal 10[RFC5244] //201 MFC backward signal 11[RFC5244] //202 MFC backward signal 12[RFC5244] //203 MFC backward signal 13[RFC5244] //204 MFC backward signal 14[RFC5244] //205 MFC backward signal 15[RFC5244] //206 A bit signalling state '0'[RFC5244] //207 A bit signalling state '1'[RFC5244] //208 AB bit signalling state '00'[RFC5244] //209 AB bit signalling state '01'[RFC5244] //210 AB bit signalling state '10'[RFC5244] //211 AB bit signalling state '11' [RFC5244] { RTP_CISCO_NSE_FAX_PASSTHROUGH_IND, "Cisco NSE: Shift to voiceband data mode"}, { RTP_CISCO_NSE_MODEM_PASSTHROUGH_IND, "Cisco NSE: Disable echo cancellation"}, { RTP_CISCO_NSE_VOICE_MODE_IND, "Cisco NSE: Shift to voice mode"}, { RTP_CISCO_NSE_MODEM_RELAY_CAP_IND, "Cisco NSE: Advertise Modem relay capability"}, { RTP_CISCO_NSE_FAX_RELAY_IND, "Cisco NSE: Shift to fax relay mode"}, { RTP_CISCO_NSE_ACK, "Positive acknowledgement of Cisco NSE"}, { RTP_CISCO_NSE_NACK, "Negative acknowledgement of Cisco NSE"}, { RTP_CISCO_NSE_MODEM_RELAY_IND , "Cisco NSE: Shift to modem relay mode"}, { 0, NULL }, }; value_string_ext rtp_event_type_values_ext = VALUE_STRING_EXT_INIT(rtp_event_type_values); /* RTP Events fields defining a subtree */ static gint ett_rtp_events = -1; static dissector_handle_t rtp_events_handle; static struct _rtp_event_info rtp_event_info; static int dissect_rtp_events( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ ) { proto_item *ti; proto_tree *rtp_events_tree; unsigned int offset = 0; struct _rtp_packet_info *p_packet_data; guint8 rtp_evt; guint8 octet; static int * const events[] = { &hf_rtp_events_end, &hf_rtp_events_reserved, &hf_rtp_events_volume, NULL }; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTP EVENT"); col_clear(pinfo->cinfo, COL_INFO); /* Get event fields */ rtp_evt = tvb_get_guint8(tvb, offset ); /* get tap info */ rtp_event_info.info_rtp_evt = rtp_evt; p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_get_id_by_filter_name("rtp"), 0); if (p_packet_data) rtp_event_info.info_setup_frame_num = p_packet_data->frame_number; else rtp_event_info.info_setup_frame_num = 0; col_add_fstr( pinfo->cinfo, COL_INFO, "Payload type=RTP Event, %s", val_to_str_ext( rtp_evt, &rtp_event_type_values_ext, "Unknown (%u)" )); ti = proto_tree_add_item( tree, proto_rtp_events, tvb, offset, -1, ENC_NA ); rtp_events_tree = proto_item_add_subtree( ti, ett_rtp_events ); proto_tree_add_uint ( rtp_events_tree, hf_rtp_events_event, tvb, offset, 1, rtp_evt); offset++; octet = tvb_get_guint8(tvb, offset); proto_tree_add_bitmask_list(rtp_events_tree, tvb, offset, 1, events, ENC_NA); offset++; /* The duration field indicates the duration of the event or segment * being reported, in timestamp units. */ rtp_event_info.info_duration = tvb_get_ntohs(tvb, offset); proto_tree_add_item ( rtp_events_tree, hf_rtp_events_duration, tvb, offset, 2, ENC_BIG_ENDIAN); /* set the end info for the tap */ if (octet & 0x80) { rtp_event_info.info_end = TRUE; } else { rtp_event_info.info_end = FALSE; } /* Make end-of-event packets obvious in the info column */ if ((octet & 0x80)) { col_append_str(pinfo->cinfo, COL_INFO, " (end)"); } tap_queue_packet(rtp_event_tap, pinfo, &rtp_event_info); return tvb_captured_length(tvb); } void proto_register_rtp_events(void) { module_t *rtp_events_module; static hf_register_info hf[] = { { &hf_rtp_events_event, { "Event ID", "rtpevent.event_id", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_event_type_values_ext, 0x0, NULL, HFILL } }, { &hf_rtp_events_end, { "End of Event", "rtpevent.end_of_event", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtp_events_reserved, { "Reserved", "rtpevent.reserved", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_rtp_events_volume, { "Volume", "rtpevent.volume", FT_UINT8, BASE_DEC, NULL, 0x3F, NULL, HFILL } }, { &hf_rtp_events_duration, { "Event Duration", "rtpevent.duration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_rtp_events, }; proto_rtp_events = proto_register_protocol("RFC 2833 RTP Event", "RTP Event", "rtpevent"); proto_register_field_array(proto_rtp_events, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register preferences */ rtp_events_module = prefs_register_protocol (proto_rtp_events, NULL); prefs_register_obsolete_preference(rtp_events_module, "event_payload_type_value"); prefs_register_obsolete_preference(rtp_events_module, "cisco_nse_payload_type_value"); rtp_events_handle = register_dissector("rtpevent", dissect_rtp_events, proto_rtp_events); rtp_event_tap = register_tap("rtpevent"); } void proto_reg_handoff_rtp_events(void) { dissector_add_string("rtp_dyn_payload_type", "telephone-event", rtp_events_handle); dissector_add_string("rtp_dyn_payload_type", "X-NSE", rtp_events_handle); dissector_add_uint_range_with_preference("rtp.pt", RTP_EVENT_DEFAULT_PT_RANGE, rtp_events_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-rtp-events.h
/* packet-rtp-events.h * * Defines for RFC 2833 RTP Events dissection * Copyright 2003, Kevin A. Noll <knoll[AT]poss.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ WS_DLL_PUBLIC value_string_ext rtp_event_type_values_ext; struct _rtp_event_info { guint8 info_rtp_evt; guint32 info_setup_frame_num; /* the frame num of the packet that set this RTP connection */ guint16 info_duration; gboolean info_end; };
C
wireshark/epan/dissectors/packet-rtp-midi.c
/* packet-rtp-midi.c * * Routines for RFC 4695/6295 RTP-MIDI dissection * Copyright 2006-2012, Tobias Erichsen <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]>' * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * RTP-MIDI ( RFC 4695/6295 ) is a payload type for transmitting MIDI-data over * RTP-packets. This payload type can be used on an RTP-conversation that has been * established either by means of a session establishment-protocol like SIP or * something more lightweight like the Apple network-midi session establishment. * * This dissector is built based on the RTP-MIDI-specification RFC 4695 from * August 13, 2008, the superseding version RFC 6295 and the MIDI-specification 96.1 * * Here are some links: * * http://www.cs.berkeley.edu/~lazzaro/rtpmidi/ * https://tools.ietf.org/html/rfc4695 * https://tools.ietf.org/html/rfc6295 * http://www.midi.org/ * * 2012-02-24 * - Initial version of dissector * * Open topics: * - reassembly of large sysex-fields going over multiple RTP-packets - this would be a major task, though! * - MIDI Show-Control * - MIDI Machine-Control * */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/prefs.h> void proto_register_rtp_midi(void); /* Definitions for protocol name during dissector-register */ #define RTP_MIDI_DISSECTOR_NAME "RFC 4695/6295 RTP-MIDI" #define RTP_MIDI_DISSECTOR_SHORTNAME "RTP-MIDI" #define RTP_MIDI_DISSECTOR_ABBREVIATION "rtpmidi" #define RTP_MIDI_NO_RUNNING_STATUS 0xffff /* * MIDI Controller Numbers */ #define RTP_MIDI_CTRL_BANK_SELECT_MSB 0 #define RTP_MIDI_CTRL_MODULATION_WHEEL_OR_LEVER_MSB 1 #define RTP_MIDI_CTRL_BREATH_CONTROLLER_MSB 2 /* #define RTP_MIDI_CTRL 3 */ #define RTP_MIDI_CTRL_FOOT_CONTROLLER_MSB 4 #define RTP_MIDI_CTRL_PORTAMENTO_TIME_MSB 5 #define RTP_MIDI_CTRL_DATA_ENTRY_MSB 6 #define RTP_MIDI_CTRL_CHANNEL_VOLUME_MSB 7 #define RTP_MIDI_CTRL_BALANCE_MSB 8 /* #define RTP_MIDI_CTRL 9 */ #define RTP_MIDI_CTRL_PAN_MSB 10 #define RTP_MIDI_CTRL_EXPRESSION_CONTROLLER_MSB 11 #define RTP_MIDI_CTRL_EFFECT_CONTROL_1_MSB 12 #define RTP_MIDI_CTRL_EFFECT_CONTROL_2_MSB 13 /* #define RTP_MIDI_CTRL_ 14 #define RTP_MIDI_CTRL_ 15 */ #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_1_MSB 16 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_2_MSB 17 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_3_MSB 18 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_4_MSB 19 /* #define RTP_MIDI_CTRL_ 20 #define RTP_MIDI_CTRL_ 21 #define RTP_MIDI_CTRL_ 22 #define RTP_MIDI_CTRL_ 23 #define RTP_MIDI_CTRL_ 24 #define RTP_MIDI_CTRL_ 25 #define RTP_MIDI_CTRL_ 26 #define RTP_MIDI_CTRL_ 27 #define RTP_MIDI_CTRL_ 28 #define RTP_MIDI_CTRL_ 29 #define RTP_MIDI_CTRL_ 30 #define RTP_MIDI_CTRL_ 31 */ #define RTP_MIDI_CTRL_BANK_SELECT_LSB 32 #define RTP_MIDI_CTRL_MODULATION_WHEEL_OR_LEVER_LSB 33 #define RTP_MIDI_CTRL_BREATH_CONTROLLER_LSB 34 /* #define RTP_MIDI_CTRL_ 35 */ #define RTP_MIDI_CTRL_FOOT_CONTROLLER_LSB 36 #define RTP_MIDI_CTRL_PORTAMENTO_TIME_LSB 37 #define RTP_MIDI_CTRL_DATA_ENTRY_LSB 38 #define RTP_MIDI_CTRL_CHANNEL_VOLUME_LSB 39 #define RTP_MIDI_CTRL_BALANCE_LSB 40 /* #define RTP_MIDI_CTRL_ 41 */ #define RTP_MIDI_CTRL_PAN_LSB 42 #define RTP_MIDI_CTRL_EXPRESSION_CONTROLLER_LSB 43 #define RTP_MIDI_CTRL_EFFECT_CONTROL_1_LSB 44 #define RTP_MIDI_CTRL_EFFECT_CONTROL_2_LSB 45 /* #define RTP_MIDI_CTRL_ 46 #define RTP_MIDI_CTRL_ 47 */ #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_1_LSB 48 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_2_LSB 49 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_3_LSB 50 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_4_LSB 51 /* #define RTP_MIDI_CTRL_ 52 #define RTP_MIDI_CTRL_ 53 #define RTP_MIDI_CTRL_ 54 #define RTP_MIDI_CTRL_ 55 #define RTP_MIDI_CTRL_ 56 #define RTP_MIDI_CTRL_ 57 #define RTP_MIDI_CTRL_ 58 #define RTP_MIDI_CTRL_ 59 #define RTP_MIDI_CTRL_ 60 #define RTP_MIDI_CTRL_ 61 #define RTP_MIDI_CTRL_ 62 #define RTP_MIDI_CTRL_ 63 */ #define RTP_MIDI_CTRL_DAMPER_PEDAL 64 #define RTP_MIDI_CTRL_PORTAMENTO_ON_OFF 65 #define RTP_MIDI_CTRL_SUSTENUTO 66 #define RTP_MIDI_CTRL_SOFT_PEDAL 67 #define RTP_MIDI_CTRL_LEGATO_FOOTSWITCH 68 #define RTP_MIDI_CTRL_HOLD_2 69 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_1 70 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_2 71 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_3 72 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_4 73 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_5 74 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_6 75 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_7 76 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_8 77 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_9 78 #define RTP_MIDI_CTRL_SOUND_CONTROLLER_10 79 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_5 80 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_6 81 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_7 82 #define RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_8 83 #define RTP_MIDI_CTRL_PORTAMENTO_CONTROL 84 /* #define RTP_MIDI_CTRL_ 85 #define RTP_MIDI_CTRL_ 86 #define RTP_MIDI_CTRL_ 87 #define RTP_MIDI_CTRL_ 88 #define RTP_MIDI_CTRL_ 89 #define RTP_MIDI_CTRL_ 90 */ #define RTP_MIDI_CTRL_EFFECTS_1_DEPTH 91 #define RTP_MIDI_CTRL_EFFECTS_2_DEPTH 92 #define RTP_MIDI_CTRL_EFFECTS_3_DEPTH 93 #define RTP_MIDI_CTRL_EFFECTS_4_DEPTH 94 #define RTP_MIDI_CTRL_EFFECTS_5_DEPTH 95 #define RTP_MIDI_CTRL_DATA_INCREMENT 96 #define RTP_MIDI_CTRL_DATA_DECREMENT 97 #define RTP_MIDI_CTRL_NON_REGISTERED_PARAM_LSB 98 #define RTP_MIDI_CTRL_NON_REGISTERED_PARAM_MSB 99 #define RTP_MIDI_CTRL_REGISTERED_PARAM_LSB 100 #define RTP_MIDI_CTRL_REGISTERED_PARAM_MSB 101 /* #define RTP_MIDI_CTRL_ 102 #define RTP_MIDI_CTRL_ 103 #define RTP_MIDI_CTRL_ 104 #define RTP_MIDI_CTRL_ 105 #define RTP_MIDI_CTRL_ 106 #define RTP_MIDI_CTRL_ 107 #define RTP_MIDI_CTRL_ 108 #define RTP_MIDI_CTRL_ 109 #define RTP_MIDI_CTRL_ 110 #define RTP_MIDI_CTRL_ 111 #define RTP_MIDI_CTRL_ 112 #define RTP_MIDI_CTRL_ 113 #define RTP_MIDI_CTRL_ 114 #define RTP_MIDI_CTRL_ 115 #define RTP_MIDI_CTRL_ 116 #define RTP_MIDI_CTRL_ 117 #define RTP_MIDI_CTRL_ 118 #define RTP_MIDI_CTRL_ 119 */ /* MIDI Channel Mode Messages */ #define RTP_MIDI_CTRL_ALL_SOUND_OFF 120 #define RTP_MIDI_CTRL_RESET_ALL_CONTROLLERS 121 #define RTP_MIDI_CTRL_LOCAL_CONTROL_ON_OFF 122 #define RTP_MIDI_CTRL_ALL_NOTES_OFF 123 #define RTP_MIDI_CTRL_OMNI_MODE_OFF 124 #define RTP_MIDI_CTRL_OMNI_MODE_ON 125 #define RTP_MIDI_CTRL_MONO_MODE_ON 126 #define RTP_MIDI_CTRL_POLY_MODE_ON 127 /* * MIDI Status Bytes (Channel Voice Messages) */ #define RTP_MIDI_STATUS_CHANNEL_NOTE_OFF 0x08 /* 0x8n n->channel */ #define RTP_MIDI_STATUS_CHANNEL_NOTE_ON 0x09 /* 0x9n n->channel */ #define RTP_MIDI_STATUS_CHANNEL_POLYPHONIC_KEY_PRESSURE 0x0a /* 0xan n->channel */ #define RTP_MIDI_STATUS_CHANNEL_CONTROL_CHANGE 0x0b /* 0xbn n->channel */ #define RTP_MIDI_STATUS_CHANNEL_PROGRAM_CHANGE 0x0c /* 0xcn n->channel */ #define RTP_MIDI_STATUS_CHANNEL_CHANNEL_PRESSURE 0x0d /* 0xdn n->channel */ #define RTP_MIDI_STATUS_CHANNEL_PITCH_BEND_CHANGE 0x0e /* 0xen n->channel */ /* * MIDI-Channels */ #define RTP_MIDI_CHANNEL_1 0x00 #define RTP_MIDI_CHANNEL_2 0x01 #define RTP_MIDI_CHANNEL_3 0x02 #define RTP_MIDI_CHANNEL_4 0x03 #define RTP_MIDI_CHANNEL_5 0x04 #define RTP_MIDI_CHANNEL_6 0x05 #define RTP_MIDI_CHANNEL_7 0x06 #define RTP_MIDI_CHANNEL_8 0x07 #define RTP_MIDI_CHANNEL_9 0x08 #define RTP_MIDI_CHANNEL_10 0x09 #define RTP_MIDI_CHANNEL_11 0x0a #define RTP_MIDI_CHANNEL_12 0x0b #define RTP_MIDI_CHANNEL_13 0x0c #define RTP_MIDI_CHANNEL_14 0x0d #define RTP_MIDI_CHANNEL_15 0x0e #define RTP_MIDI_CHANNEL_16 0x0f #define RTP_MIDI_CHANNEL_MASK 0x0f /* * MIDI Status Bytes (System Exclusive Messages, System Common Messages, System Realtime Messages ) */ #define RTP_MIDI_STATUS_COMMON_SYSEX_START 0xf0 #define RTP_MIDI_STATUS_COMMON_MTC_QUARTER_FRAME 0xf1 #define RTP_MIDI_STATUS_COMMON_SONG_POSITION_POINTER 0xf2 #define RTP_MIDI_STATUS_COMMON_SONG_SELECT 0xf3 #define RTP_MIDI_STATUS_COMMON_UNDEFINED_F4 0xf4 #define RTP_MIDI_STATUS_COMMON_UNDEFINED_F5 0xf5 #define RTP_MIDI_STATUS_COMMON_TUNE_REQUEST 0xf6 #define RTP_MIDI_STATUS_COMMON_SYSEX_END 0xf7 #define RTP_MIDI_STATUS_COMMON_REALTIME_TIMING_CLOCK 0xf8 #define RTP_MIDI_STATUS_COMMON_REALTIME_MIDI_TICK 0xf9 /* Spec says undefined */ #define RTP_MIDI_STATUS_COMMON_REALTIME_START 0xfa #define RTP_MIDI_STATUS_COMMON_REALTIME_CONTINUE 0xfb #define RTP_MIDI_STATUS_COMMON_REALTIME_STOP 0xfc #define RTP_MIDI_STATUS_COMMON_REALTIME_UNDEFINED_FD 0xfd #define RTP_MIDI_STATUS_COMMON_REALTIME_ACTIVE_SENSING 0xfe #define RTP_MIDI_STATUS_COMMON_REALTIME_SYSTEM_RESET 0xff /* * MIDI Universal Non-Realtime System Exclusive Messages (sysex-manu-id=0x7e) */ #define RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_HEADER 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DATA_PACKET 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_REQUEST 0x03 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC 0x04 #define RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_EXTENSIONS 0x05 #define RTP_MIDI_SYSEX_COMMON_NRT_GENERAL_INFORMATION 0x06 #define RTP_MIDI_SYSEX_COMMON_NRT_FILE_DUMP 0x07 #define RTP_MIDI_SYSEX_COMMON_NRT_MIDI_TUNING_STANDARD 0x08 #define RTP_MIDI_SYSEX_COMMON_NRT_GENERAL_MIDI 0x09 #define RTP_MIDI_SYSEX_COMMON_NRT_DOWNLOADABLE_SOUNDS 0x0a #define RTP_MIDI_SYSEX_COMMON_NRT_END_OF_FILE 0x7b #define RTP_MIDI_SYSEX_COMMON_NRT_WAIT 0x7c #define RTP_MIDI_SYSEX_COMMON_NRT_CANCEL 0x7d #define RTP_MIDI_SYSEX_COMMON_NRT_NAK 0x7e #define RTP_MIDI_SYSEX_COMMON_NRT_ACK 0x7f /* * MIDI Universal Realtime System Exclusive Messages (sysex-manu-id=0x7f) */ #define RTP_MIDI_SYSEX_COMMON_RT_MIDI_TIME_CODE 0x01 #define RTP_MIDI_SYSEX_COMMON_RT_MIDI_SHOW_CONTROL 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_NOTATION_INFORMATION 0x03 #define RTP_MIDI_SYSEX_COMMON_RT_DEVICE_CONTROL 0x04 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUEING 0x05 #define RTP_MIDI_SYSEX_COMMON_RT_MIDI_MACHINE_CONTROL_COMMAND 0x06 #define RTP_MIDI_SYSEX_COMMON_RT_MIDI_MACHINE_CONTROL_RESPONSE 0x07 #define RTP_MIDI_SYSEX_COMMON_RT_MIDI_TUNING_STANDARD 0x08 /* List of short MIDI-manufacturer-IDs - needs to be completed! */ #define RTP_MIDI_MANU_SHORT_ISLONG 0x00 #define RTP_MIDI_MANU_SHORT_SEQUENTIAL_CIRCUITS 0x01 #define RTP_MIDI_MANU_SHORT_BIG_BRIAR_IDP 0x02 #define RTP_MIDI_MANU_SHORT_OCTAVE_PLATEAU_VOYETRA 0x03 #define RTP_MIDI_MANU_SHORT_MOOG 0x04 #define RTP_MIDI_MANU_SHORT_PASSPORT_DESIGNS 0x05 #define RTP_MIDI_MANU_SHORT_LEXICON 0x06 #define RTP_MIDI_MANU_SHORT_KURZWEIL 0x07 #define RTP_MIDI_MANU_SHORT_FENDER 0x08 #define RTP_MIDI_MANU_SHORT_GULBRANSEN 0x09 #define RTP_MIDI_MANU_SHORT_AKG_ACOUSTICS 0x0a #define RTP_MIDI_MANU_SHORT_VOYCE_MUSIC 0x0b #define RTP_MIDI_MANU_SHORT_WAVEFRAME 0x0c #define RTP_MIDI_MANU_SHORT_ADA_SIGNAL_PROCESSORS 0x0d #define RTP_MIDI_MANU_SHORT_GARFIELD_ELECTRONICS 0x0e #define RTP_MIDI_MANU_SHORT_ENSONIQ 0x0f #define RTP_MIDI_MANU_SHORT_OBERHEIM_GIBSON_LABS 0x10 #define RTP_MIDI_MANU_SHORT_APPLE_COMPUTERS 0x11 #define RTP_MIDI_MANU_SHORT_GREY_MATTER_RESPONSE 0x12 #define RTP_MIDI_MANU_SHORT_DIGIDESIGN 0x13 #define RTP_MIDI_MANU_SHORT_PALMTREE_INSTRUMENTS 0x14 #define RTP_MIDI_MANU_SHORT_JL_COOPER 0x15 #define RTP_MIDI_MANU_SHORT_LOWREY 0x16 #define RTP_MIDI_MANU_SHORT_LINN_ADAMS_SMITH 0x17 #define RTP_MIDI_MANU_SHORT_EMU_SYSTEMS 0x18 #define RTP_MIDI_MANU_SHORT_HARMONY_SYSTEMS 0x19 #define RTP_MIDI_MANU_SHORT_ART 0x1a #define RTP_MIDI_MANU_SHORT_BALDWIN 0x1b #define RTP_MIDI_MANU_SHORT_EVENTIDE 0x1c #define RTP_MIDI_MANU_SHORT_INVENTRONICS 0x1d #define RTP_MIDI_MANU_SHORT_KEY_CONCEPTS 0x1e #define RTP_MIDI_MANU_SHORT_CLARITY 0x1f #define RTP_MIDI_MANU_SHORT_PASSAC 0x20 #define RTP_MIDI_MANU_SHORT_SIEL 0x21 #define RTP_MIDI_MANU_SHORT_SYNTHE_AXE 0x22 #define RTP_MIDI_MANU_SHORT_STEPP 0x23 #define RTP_MIDI_MANU_SHORT_HOHNER 0x24 #define RTP_MIDI_MANU_SHORT_CRUMAR_TWISTER 0x25 #define RTP_MIDI_MANU_SHORT_SOLTON 0x26 #define RTP_MIDI_MANU_SHORT_JELLINGHAUS_MS 0x27 #define RTP_MIDI_MANU_SHORT_SOUTHWORK_MUSIC_SYSTEMS 0x28 #define RTP_MIDI_MANU_SHORT_PPG 0x29 #define RTP_MIDI_MANU_SHORT_JEN 0x2a #define RTP_MIDI_MANU_SHORT_SSL 0x2b #define RTP_MIDI_MANU_SHORT_AUDIO_VERITRIEB 0x2c #define RTP_MIDI_MANU_SHORT_NEVE_HINTON_INSTRUMENTS 0x2d #define RTP_MIDI_MANU_SHORT_SOUNDTRACS 0x2e #define RTP_MIDI_MANU_SHORT_ELKA_GENERAL_MUSIC 0x2f #define RTP_MIDI_MANU_SHORT_DYNACORD 0x30 #define RTP_MIDI_MANU_SHORT_VISCOUNT 0x31 #define RTP_MIDI_MANU_SHORT_DRAWMER 0x32 #define RTP_MIDI_MANU_SHORT_CLAVIA_DIGITAL_INSTRUMENTS 0x33 #define RTP_MIDI_MANU_SHORT_AUDIO_ARCHITECTURE 0x34 #define RTP_MIDI_MANU_SHORT_GENERAL_MUSIC_CORP 0x35 #define RTP_MIDI_MANU_SHORT_CHEETAH 0x36 #define RTP_MIDI_MANU_SHORT_CTM 0x37 #define RTP_MIDI_MANU_SHORT_SIMMONS_UK 0x38 #define RTP_MIDI_MANU_SHORT_SOUNDCRAFT_ELECTRONICS 0x39 #define RTP_MIDI_MANU_SHORT_STEINBERG_GMBH 0x3a #define RTP_MIDI_MANU_SHORT_WERSI 0x3b #define RTP_MIDI_MANU_SHORT_AVAB_ELEKTRONIK_AB 0x3c #define RTP_MIDI_MANU_SHORT_DIGIGRAM 0x3d #define RTP_MIDI_MANU_SHORT_WALDORF 0x3e #define RTP_MIDI_MANU_SHORT_QUASIMIDI 0x3f #define RTP_MIDI_MANU_SHORT_KAWAI 0x40 #define RTP_MIDI_MANU_SHORT_ROLAND 0x41 #define RTP_MIDI_MANU_SHORT_KORG 0x42 #define RTP_MIDI_MANU_SHORT_YAMAHA 0x43 #define RTP_MIDI_MANU_SHORT_CASIO 0x44 #define RTP_MIDI_MANU_SHORT_MORIDAIRA 0x45 #define RTP_MIDI_MANU_SHORT_KAMIYA_STUDIO 0x46 #define RTP_MIDI_MANU_SHORT_AKAI 0x47 #define RTP_MIDI_MANU_SHORT_JAPAN_VICTOR 0x48 #define RTP_MIDI_MANU_SHORT_MEISOSHA 0x49 #define RTP_MIDI_MANU_SHORT_HOSHINO_GAKKI 0x4a #define RTP_MIDI_MANU_SHORT_FUJITSU 0x4b #define RTP_MIDI_MANU_SHORT_SONY 0x4c #define RTP_MIDI_MANU_SHORT_NISSHIN_ONPA 0x4d #define RTP_MIDI_MANU_SHORT_TEAC 0x4e /* #define RTP_MIDI_MANU_SHORT_ 0x4f */ #define RTP_MIDI_MANU_SHORT_MATSUSHITA_ELECTRIC 0x50 #define RTP_MIDI_MANU_SHORT_FOSTEX 0x51 #define RTP_MIDI_MANU_SHORT_ZOOM 0x52 #define RTP_MIDI_MANU_SHORT_MIDORI_ELECTRONICS 0x53 #define RTP_MIDI_MANU_SHORT_MATSUSHITA_COMMUNICATION 0x54 #define RTP_MIDI_MANU_SHORT_SUZUKI 0x55 #define RTP_MIDI_MANU_SHORT_FUJI 0x56 #define RTP_MIDI_MANU_SHORT_ACOUSTIC_TECHNICAL_LAB 0x57 /* #define RTP_MIDI_MANU_SHORT_ 0x58 */ #define RTP_MIDI_MANU_SHORT_FAITH 0x59 #define RTP_MIDI_MANU_SHORT_INTERNET_CORPORATION 0x5a /* #define RTP_MIDI_MANU_SHORT_ 0x5b */ #define RTP_MIDI_MANU_SHORT_SEEKERS_CO 0x5c /* #define RTP_MIDI_MANU_SHORT_ 0x5d */ /* #define RTP_MIDI_MANU_SHORT_ 0x5e */ #define RTP_MIDI_MANU_SHORT_SD_CARD_ASSOCIATION 0x5f /* #define RTP_MIDI_MANU_SHORT_ 0x60 #define RTP_MIDI_MANU_SHORT_ 0x61 #define RTP_MIDI_MANU_SHORT_ 0x62 #define RTP_MIDI_MANU_SHORT_ 0x63 #define RTP_MIDI_MANU_SHORT_ 0x64 #define RTP_MIDI_MANU_SHORT_ 0x65 #define RTP_MIDI_MANU_SHORT_ 0x66 #define RTP_MIDI_MANU_SHORT_ 0x67 #define RTP_MIDI_MANU_SHORT_ 0x68 #define RTP_MIDI_MANU_SHORT_ 0x69 #define RTP_MIDI_MANU_SHORT_ 0x6a #define RTP_MIDI_MANU_SHORT_ 0x6b #define RTP_MIDI_MANU_SHORT_ 0x6c #define RTP_MIDI_MANU_SHORT_ 0x6d #define RTP_MIDI_MANU_SHORT_ 0x6e #define RTP_MIDI_MANU_SHORT_ 0x6f #define RTP_MIDI_MANU_SHORT_ 0x70 #define RTP_MIDI_MANU_SHORT_ 0x71 #define RTP_MIDI_MANU_SHORT_ 0x72 #define RTP_MIDI_MANU_SHORT_ 0x73 #define RTP_MIDI_MANU_SHORT_ 0x74 #define RTP_MIDI_MANU_SHORT_ 0x75 #define RTP_MIDI_MANU_SHORT_ 0x76 #define RTP_MIDI_MANU_SHORT_ 0x77 #define RTP_MIDI_MANU_SHORT_ 0x78 #define RTP_MIDI_MANU_SHORT_ 0x79 #define RTP_MIDI_MANU_SHORT_ 0x7a #define RTP_MIDI_MANU_SHORT_ 0x7b #define RTP_MIDI_MANU_SHORT_ 0x7c */ #define RTP_MIDI_MANU_SHORT_EDUCATIONAL_USE 0x7d #define RTP_MIDI_MANU_SHORT_NON_REALTIME_UNIVERSAL 0x7e #define RTP_MIDI_MANU_SHORT_REALTIME_UNIVERSAL 0x7f /* List of long MIDI-manufacturer-IDs - needs to be completed! */ /* North American Manufacturers */ /* #define RTP_MIDI_MANU_LONG_TIME_ 0x0000 */ #define RTP_MIDI_MANU_LONG_TIME_WARNER_INTERACTIVE 0x0001 #define RTP_MIDI_MANU_LONG_ADVANCED_GRAVIS_COMP 0x0002 #define RTP_MIDI_MANU_LONG_MEDIA_VISION 0x0003 #define RTP_MIDI_MANU_LONG_DORNES_RESEARCH_GROUP 0x0004 #define RTP_MIDI_MANU_LONG_KMUSE 0x0005 #define RTP_MIDI_MANU_LONG_STYPHER 0x0006 #define RTP_MIDI_MANU_LONG_DIGITAL_MUSIC_CORPORATION 0x0007 #define RTP_MIDI_MANU_LONG_IOTA_SYSTEMS 0x0008 #define RTP_MIDI_MANU_LONG_NEW_ENGLAND_DIGITAL 0x0009 #define RTP_MIDI_MANU_LONG_ARTISYN 0x000a #define RTP_MIDI_MANU_LONG_IVL_TECHNOLOGIES 0x000b #define RTP_MIDI_MANU_LONG_SOUTHERN_MUSIC_SYSTEMS 0x000c #define RTP_MIDI_MANU_LONG_LAKE_BUTLER_SOUND_COMPANY 0x000d #define RTP_MIDI_MANU_LONG_ALESIS 0x000e #define RTP_MIDI_MANU_LONG_SOUND_CREATION 0x000f #define RTP_MIDI_MANU_LONG_DOD_ELECTRONICS 0x0010 #define RTP_MIDI_MANU_LONG_STUDER_EDITECH 0x0011 #define RTP_MIDI_MANU_LONG_SONUS 0x0012 #define RTP_MIDI_MANU_LONG_TEMPORAL_ACUITY_PRODUCTS 0x0013 #define RTP_MIDI_MANU_LONG_PERFECT_FRETWORKS 0x0014 #define RTP_MIDI_MANU_LONG_KAT 0x0015 #define RTP_MIDI_MANU_LONG_OPCODE 0x0016 #define RTP_MIDI_MANU_LONG_RANE_CORP 0x0017 #define RTP_MIDI_MANU_LONG_SPATIAL_SOUND_ANADI_INC 0x0018 #define RTP_MIDI_MANU_LONG_KMX 0x0019 #define RTP_MIDI_MANU_LONG_ALLEN_AND_HEATH_BRENNEL 0x001a #define RTP_MIDI_MANU_LONG_PEAVEY 0x001b #define RTP_MIDI_MANU_LONG_360_SYSTEMS 0x001c #define RTP_MIDI_MANU_LONG_SPECTRUM_DESIGN_DEVELOPMENT 0x001d #define RTP_MIDI_MANU_LONG_MARQUIS_MUSIC 0x001e #define RTP_MIDI_MANU_LONG_ZETA_SYSTEMS 0x001f #define RTP_MIDI_MANU_LONG_AXXES 0x0020 #define RTP_MIDI_MANU_LONG_ORBAN 0x0021 #define RTP_MIDI_MANU_LONG_INDIAN_VALLEY 0x0022 #define RTP_MIDI_MANU_LONG_TRITON 0x0023 #define RTP_MIDI_MANU_LONG_KTI 0x0024 #define RTP_MIDI_MANU_LONG_BREAKAWAY_TECHNOLOGIES 0x0025 #define RTP_MIDI_MANU_LONG_CAE 0x0026 #define RTP_MIDI_MANU_LONG_HARRISON_SYSTEMS_INC 0x0027 #define RTP_MIDI_MANU_LONG_FUTURE_LAB_MARK_KUO 0x0028 #define RTP_MIDI_MANU_LONG_ROCKTRON_CORP 0x0029 #define RTP_MIDI_MANU_LONG_PIANODISC 0x002a #define RTP_MIDI_MANU_LONG_CANNON_RESEARCH_GROUP 0x002b /* #define RTP_MIDI_MANU_LONG_ 0x002c */ #define RTP_MIDI_MANU_LONG_RODGERS_INSTRUMENTS_CORP 0x002d #define RTP_MIDI_MANU_LONG_BLUE_SKY_LOGIC 0x002e #define RTP_MIDI_MANU_LONG_ENCORE_ELECTRONICS 0x002f #define RTP_MIDI_MANU_LONG_UPTOWN 0x0030 #define RTP_MIDI_MANU_LONG_VOCE 0x0031 #define RTP_MIDI_MANU_LONG_CTI_AUDIO_INC 0x0032 #define RTP_MIDI_MANU_LONG_SS_RESEARCH 0x0033 #define RTP_MIDI_MANU_LONG_BRODERBUND_SOFTWARE 0x0034 #define RTP_MIDI_MANU_LONG_ALLEN_ORGAN_CO 0x0035 /* #define RTP_MIDI_MANU_LONG_ 0x0036 */ #define RTP_MIDI_MANU_LONG_MUSIC_QUEST 0x0037 #define RTP_MIDI_MANU_LONG_APHEX 0x0038 #define RTP_MIDI_MANU_LONG_GALLIEN_KRUEGER 0x0039 #define RTP_MIDI_MANU_LONG_IBM 0x003a #define RTP_MIDI_MANU_LONG_MARK_OF_THE_UNICORN 0x003b #define RTP_MIDI_MANU_LONG_HOTZ_INSTRUMENTS_TECH 0x003c #define RTP_MIDI_MANU_LONG_ETA_LIGHTING 0x003d #define RTP_MIDI_MANU_LONG_NSI_CORPORATION 0x003e #define RTP_MIDI_MANU_LONG_ADLIB_INC 0x003f #define RTP_MIDI_MANU_LONG_RICHMOND_SOUND_DESIGN 0x0040 #define RTP_MIDI_MANU_LONG_MICROSOFT 0x0041 #define RTP_MIDI_MANU_LONG_THE_SOFTWARE_TOOLWORKS 0x0042 #define RTP_MIDI_MANU_LONG_RJMG_NICHE 0x0043 #define RTP_MIDI_MANU_LONG_INTONE 0x0044 #define RTP_MIDI_MANU_LONG_ADVANCED_REMOTE_TECH 0x0045 /* #define RTP_MIDI_MANU_LONG_ 0x0046 */ #define RTP_MIDI_MANU_LONG_GT_ELECTRONICS_GROOVE_TUBES 0x0047 #define RTP_MIDI_MANU_LONG_INTERMIDI 0x0048 #define RTP_MIDI_MANU_LONG_TIMELINE_VISTA 0x0049 #define RTP_MIDI_MANU_LONG_MESA_BOOGIE 0x004a /* #define RTP_MIDI_MANU_LONG_ 0x004b */ #define RTP_MIDI_MANU_LONG_SEQUOIA_DEVELOPMENT 0x004c #define RTP_MIDI_MANU_LONG_STUDIO_ELECTRONICS 0x004d #define RTP_MIDI_MANU_LONG_EUPHONIX 0x004e #define RTP_MIDI_MANU_LONG_INTERMIDI2 0x004f #define RTP_MIDI_MANU_LONG_MIDI_SOLUTIONS 0x0050 #define RTP_MIDI_MANU_LONG_3DO_COMPANY 0x0051 #define RTP_MIDI_MANU_LONG_LIGHTWAVE_RESEARCH 0x0052 #define RTP_MIDI_MANU_LONG_MICROW 0x0053 #define RTP_MIDI_MANU_LONG_SPECTRAL_SYNTHESIS 0x0054 #define RTP_MIDI_MANU_LONG_LONE_WOLF 0x0055 #define RTP_MIDI_MANU_LONG_STUDIO_TECHNOLOGIES 0x0056 #define RTP_MIDI_MANU_LONG_PETERSON_EMP 0x0057 #define RTP_MIDI_MANU_LONG_ATARI 0x0058 #define RTP_MIDI_MANU_LONG_MARION_SYSTEMS 0x0059 #define RTP_MIDI_MANU_LONG_DESIGN_EVENT 0x005a #define RTP_MIDI_MANU_LONG_WINJAMMER_SOFTWARE 0x005b #define RTP_MIDI_MANU_LONG_ATT_BELL_LABS 0x005c /*# define RTP_MIDI_MANU_LONG_ 0x005d */ #define RTP_MIDI_MANU_LONG_SYMETRIX 0x005e #define RTP_MIDI_MANU_LONG_MIDI_THE_WORLD 0x005f #define RTP_MIDI_MANU_LONG_DESPER_PRODUCTS 0x0060 #define RTP_MIDI_MANU_LONG_MICROS_N_MIDI 0x0061 #define RTP_MIDI_MANU_LONG_ACCORDIANS_INTL 0x0062 #define RTP_MIDI_MANU_LONG_EUPHONICS 0x0063 #define RTP_MIDI_MANU_LONG_MUSONIX 0x0064 #define RTP_MIDI_MANU_LONG_TURTLE_BEACH_SYSTEMS 0x0065 #define RTP_MIDI_MANU_LONG_MACKIE_DESIGNS 0x0066 #define RTP_MIDI_MANU_LONG_COMPUSERVE 0x0067 #define RTP_MIDI_MANU_LONG_BES_TECHNOLOGIES 0x0068 #define RTP_MIDI_MANU_LONG_QRS_MUSIC_ROLLS 0x0069 #define RTP_MIDI_MANU_LONG_P_G_MUSIC 0x006a #define RTP_MIDI_MANU_LONG_SIERRA_SEMICONDUCTOR 0x006b #define RTP_MIDI_MANU_LONG_EPIGRAF_AUDIO_VISUAL 0x006c #define RTP_MIDI_MANU_LONG_ELECTRONICS_DIVERSIFIED 0x006d #define RTP_MIDI_MANU_LONG_TUNE_1000 0x006e #define RTP_MIDI_MANU_LONG_ADVANCED_MICRO_DEVICES 0x006f #define RTP_MIDI_MANU_LONG_MEDIAMATION 0x0070 #define RTP_MIDI_MANU_LONG_SABINE_MUSIC 0x0071 #define RTP_MIDI_MANU_LONG_WOOG_LABS 0x0072 #define RTP_MIDI_MANU_LONG_MIRCOPOLIS 0x0073 #define RTP_MIDI_MANU_LONG_TA_HORNG_MUSICAL_INSTRUMENT 0x0074 #define RTP_MIDI_MANU_LONG_ETEK_LABS_FORTE_TECH 0x0075 #define RTP_MIDI_MANU_LONG_ELECTRO_VOICE 0x0076 #define RTP_MIDI_MANU_LONG_MIDISOFT_CORPORATION 0x0077 #define RTP_MIDI_MANU_LONG_QSOUND_LABS 0x0078 #define RTP_MIDI_MANU_LONG_WESTREX 0x0079 #define RTP_MIDI_MANU_LONG_NVIDIA 0x007a #define RTP_MIDI_MANU_LONG_ESS_TECHNOLOGY 0x007b #define RTP_MIDI_MANU_LONG_MEDIATRIX_PERIPHERALS 0x007c #define RTP_MIDI_MANU_LONG_BROOKTREE_CORP 0x007d #define RTP_MIDI_MANU_LONG_OTARI_CORP 0x007e #define RTP_MIDI_MANU_LONG_KEY_ELECTRONICS 0x007f /* ---break--- */ #define RTP_MIDI_MANU_LONG_SHURE_INCORPORATED 0x0100 #define RTP_MIDI_MANU_LONG_AURA_SOUND 0x0101 #define RTP_MIDI_MANU_LONG_CRYSTAL_SEMICONDUCTOR 0x0102 #define RTP_MIDI_MANU_LONG_CONEXANT_ROCKWELL 0x0103 #define RTP_MIDI_MANU_LONG_SILICON_GRAPHICS 0x0104 #define RTP_MIDI_MANU_LONG_MAUDIO_MIDIMAN 0x0105 #define RTP_MIDI_MANU_LONG_PRESONUS 0x0106 /* #define RTP_MIDI_MANU_LONG_ 0x0107 */ #define RTP_MIDI_MANU_LONG_TOPAZ_ENTERPRISES 0x0108 #define RTP_MIDI_MANU_LONG_CAST_LIGHTING 0x0109 #define RTP_MIDI_MANU_LONG_MICROSOFT_CONSUMER_DIVISION 0x010a #define RTP_MIDI_MANU_LONG_SONIC_FOUNDRY 0x010b #define RTP_MIDI_MANU_LONG_LINE6_FAST_FORWARD 0x010c #define RTP_MIDI_MANU_LONG_BEATNIK_INC 0x010d #define RTP_MIDI_MANU_LONG_VAN_KOEVERING_COMPANY 0x010e #define RTP_MIDI_MANU_LONG_ALTECH_SYSTEMS 0x010f #define RTP_MIDI_MANU_LONG_S_S_RESEARCH 0x0110 #define RTP_MIDI_MANU_LONG_VLSI_TECHNOLOGY 0x0111 #define RTP_MIDI_MANU_LONG_CHROMATIC_RESEARCH 0x0112 #define RTP_MIDI_MANU_LONG_SAPPHIRE 0x0113 #define RTP_MIDI_MANU_LONG_IDRC 0x0114 #define RTP_MIDI_MANU_LONG_JUSTONIC_TUNING 0x0115 #define RTP_MIDI_MANU_LONG_TORCOMP_RESEARCH_INC 0x0116 #define RTP_MIDI_MANU_LONG_NEWTEK_INC 0x0117 #define RTP_MIDI_MANU_LONG_SOUND_SCULPTURE 0x0118 #define RTP_MIDI_MANU_LONG_WALKER_TECHNICAL 0x0119 #define RTP_MIDI_MANU_LONG_DIGITAL_HARMONY 0x011a #define RTP_MIDI_MANU_LONG_INVISION_INTERACTIVE 0x011b #define RTP_MIDI_MANU_LONG_TSQUARE_DESIGN 0x011c #define RTP_MIDI_MANU_LONG_NEMESYS_MUSIC_TECHNOLOGY 0x011d #define RTP_MIDI_MANU_LONG_DBX_PROFESSIONAL_HARMAN_INTL 0x011e #define RTP_MIDI_MANU_LONG_SYNDYNE_CORPORATION 0x011f #define RTP_MIDI_MANU_LONG_BITHEADZ 0x0120 #define RTP_MIDI_MANU_LONG_CAKEWALK_MUSIC_SOFTWARE 0x0121 #define RTP_MIDI_MANU_LONG_ANALOG_DEVICES 0x0122 #define RTP_MIDI_MANU_LONG_NATIONAL_SEMICONDUCTOR 0x0123 #define RTP_MIDI_MANU_LONG_BOOM_THEORY 0x0124 #define RTP_MIDI_MANU_LONG_VIRTUAL_DSP_CORPORATION 0x0125 #define RTP_MIDI_MANU_LONG_ANTARES_SYSTEMS 0x0126 #define RTP_MIDI_MANU_LONG_ANGEL_SOFTWARE 0x0127 #define RTP_MIDI_MANU_LONG_ST_LOUIS_MUSIC 0x0128 #define RTP_MIDI_MANU_LONG_LYRRUS_DBA_GVOX 0x0129 #define RTP_MIDI_MANU_LONG_ASHLEY_AUDIO_INC 0x012a #define RTP_MIDI_MANU_LONG_VARILITE_INC 0x012b #define RTP_MIDI_MANU_LONG_SUMMIT_AUDIO_INC 0x012c #define RTP_MIDI_MANU_LONG_AUREAL_SEMICONDUCTOR_INC 0x012d #define RTP_MIDI_MANU_LONG_SEASOUND_LLC 0x012e #define RTP_MIDI_MANU_LONG_US_ROBOTICS 0x012f #define RTP_MIDI_MANU_LONG_AURISIS_RESEARCH 0x0130 #define RTP_MIDI_MANU_LONG_NEARFIELD_MULTIMEDIA 0x0131 #define RTP_MIDI_MANU_LONG_FM7_INC 0x0132 #define RTP_MIDI_MANU_LONG_SWIVEL_SYSTEMS 0x0133 #define RTP_MIDI_MANU_LONG_HYPERACTIVE_AUDIO_SYSTEMS 0x0134 #define RTP_MIDI_MANU_LONG_MIDILITE_CASTE_STUDIO_PROD 0x0135 #define RTP_MIDI_MANU_LONG_RADIKAL_TECHNOLOGIES 0x0136 #define RTP_MIDI_MANU_LONG_ROGER_LINN_DESIGN 0x0137 #define RTP_MIDI_MANU_LONG_TCHELION_VOCAL_TECHNOLOGIES 0x0138 #define RTP_MIDI_MANU_LONG_EVENT_ELECTRONICS 0x0139 #define RTP_MIDI_MANU_LONG_SONIC_NETWORK_INC 0x013a #define RTP_MIDI_MANU_LONG_REALTIME_MUSIC_SOLUTIONS 0x013b #define RTP_MIDI_MANU_LONG_APOGEE_DIGITAL 0x013c #define RTP_MIDI_MANU_LONG_CLASSICAL_ORGANS_INC 0x013d #define RTP_MIDI_MANU_LONG_MICROTOOLS_INC 0x013e #define RTP_MIDI_MANU_LONG_NUMARK_INDUSTRIES 0x013f #define RTP_MIDI_MANU_LONG_FRONTIER_DESIGN_GROUP_LLC 0x0140 #define RTP_MIDI_MANU_LONG_RECORDARE_LLC 0x0141 #define RTP_MIDI_MANU_LONG_STARR_LABS 0x0142 #define RTP_MIDI_MANU_LONG_VOYAGER_SOUND_INC 0x0143 #define RTP_MIDI_MANU_LONG_MANIFOLD_LABS 0x0144 #define RTP_MIDI_MANU_LONG_AVIOM_INC 0x0145 #define RTP_MIDI_MANU_LONG_MIXMEISTER_TECHNOLOGY 0x0146 #define RTP_MIDI_MANU_LONG_NOTATION_SOFTWARE 0x0147 #define RTP_MIDI_MANU_LONG_MERCURIAL_COMMUNICATIONS 0x0148 #define RTP_MIDI_MANU_LONG_WAVE_ARTS 0x0149 #define RTP_MIDI_MANU_LONG_LOGIC_SEQUENCING_DEVICES 0x014a #define RTP_MIDI_MANU_LONG_AXESS_ELECTRONICS 0x014b #define RTP_MIDI_MANU_LONG_MUSE_RESEARCH 0x014c #define RTP_MIDI_MANU_LONG_OPEN_LABS 0x014d #define RTP_MIDI_MANU_LONG_GUILLEMOT_RD_INC 0x014e #define RTP_MIDI_MANU_LONG_SAMSON_TECHNOLOGIES 0x014f #define RTP_MIDI_MANU_LONG_ELECTRONIC_THEATRE_CONTROLS 0x0150 #define RTP_MIDI_MANU_LONG_RESEARCH_IN_MOTION 0x0151 #define RTP_MIDI_MANU_LONG_MOBILEER 0x0152 #define RTP_MIDI_MANU_LONG_SYNTHOGY 0x0153 #define RTP_MIDI_MANU_LONG_LYNX_STUDIO_TECHNOLOGY_INC 0x0154 #define RTP_MIDI_MANU_LONG_DAMAGE_CONTROL_ENGINEERING 0x0155 #define RTP_MIDI_MANU_LONG_YOST_ENGINEERING_INC 0x0156 #define RTP_MIDI_MANU_LONG_BROOKS_FORSMAN_DESIGNS_LLC 0x0157 #define RTP_MIDI_MANU_LONG_MAGNEKEY 0x0158 #define RTP_MIDI_MANU_LONG_GARRITAN_CORP 0x0159 #define RTP_MIDI_MANU_LONG_PLOQUE_ART_ET_TECHNOLOGIE 0x015a #define RTP_MIDI_MANU_LONG_RJM_MUSIC_TECHNOLOGY 0x015b #define RTP_MIDI_MANU_LONG_CUSTOM_SOLUTIONS_SOFTWARE 0x015c #define RTP_MIDI_MANU_LONG_SONARCANA_LLC 0x015d #define RTP_MIDI_MANU_LONG_CENTRANCE 0x015e #define RTP_MIDI_MANU_LONG_KESUMO_LLC 0x015f #define RTP_MIDI_MANU_LONG_STANTON 0x0160 #define RTP_MIDI_MANU_LONG_LIVID_INSTRUMENTS 0x0161 #define RTP_MIDI_MANU_LONG_FIRST_ACT_745_MEDIA 0x0162 #define RTP_MIDI_MANU_LONG_PYGRAPHICS_INC 0x0163 #define RTP_MIDI_MANU_LONG_PANADIGM_INNOVATIONS_LTD 0x0164 #define RTP_MIDI_MANU_LONG_AVEDIS_ZILDJIAN_CO 0x0165 #define RTP_MIDI_MANU_LONG_AUVITAL_MUSIC_CORP 0x0166 #define RTP_MIDI_MANU_LONG_INSPIRED_INSTRUMENTS_INC 0x0167 #define RTP_MIDI_MANU_LONG_CHRIS_GRIGG_DESIGNS 0x0168 #define RTP_MIDI_MANU_LONG_SLATE_DIGITAL_LLC 0x0169 #define RTP_MIDI_MANU_LONG_MIXWARE 0x016a #define RTP_MIDI_MANU_LONG_SOCIAL_ENTROPY 0x016b #define RTP_MIDI_MANU_LONG_SOURCE_AUDIO_LLC 0x016c #define RTP_MIDI_MANU_LONG_RESERVED_016d 0x016d #define RTP_MIDI_MANU_LONG_RESERVED_016e 0x016e #define RTP_MIDI_MANU_LONG_RESERVED_016f 0x016f #define RTP_MIDI_MANU_LONG_AMERICAN_AUDIO_DJ 0x0170 #define RTP_MIDI_MANU_LONG_MEGA_CONTROL_SYSTEMS 0x0171 #define RTP_MIDI_MANU_LONG_KILPATRICK_AUDIO 0x0172 #define RTP_MIDI_MANU_LONG_IKINGDOM_CORP 0x0173 #define RTP_MIDI_MANU_LONG_FRACTAL_AUDIO 0x0174 #define RTP_MIDI_MANU_LONG_NETLOGIC_MICROSYSTEMS 0x0175 #define RTP_MIDI_MANU_LONG_MUSIC_COMPUTING 0x0176 #define RTP_MIDI_MANU_LONG_NEKTAR_TECHNOLOGY_INC 0x0177 #define RTP_MIDI_MANU_LONG_ZENPH_SOUND_INNOVATIONS 0x0178 #define RTP_MIDI_MANU_LONG_DJTECHTOOLS_COM 0x0179 #define RTP_MIDI_MANU_LONG_RESERVED_017a 0x017a /* European manufacturers */ #define RTP_MIDI_MANU_LONG_DREAM 0x2000 #define RTP_MIDI_MANU_LONG_STRAND_LIGHTING 0x2001 #define RTP_MIDI_MANU_LONG_AMEK_SYSTEMS 0x2002 #define RTP_MIDI_MANU_LONG_CASA_DI_RISPARMIO_DI_LORETO 0x2003 #define RTP_MIDI_MANU_LONG_BOHM_ELECTRONIC 0x2004 #define RTP_MIDI_MANU_LONG_SYNTEC_DIGITAL_AUDIO 0x2005 #define RTP_MIDI_MANU_LONG_TRIDENT_AUDIO 0x2006 #define RTP_MIDI_MANU_LONG_REAL_WORLD_STUDIO 0x2007 #define RTP_MIDI_MANU_LONG_EVOLUTION_SYNTHESIS 0x2008 #define RTP_MIDI_MANU_LONG_YES_TECHNOLOGY 0x2009 #define RTP_MIDI_MANU_LONG_AUDIOMATICA 0x200a #define RTP_MIDI_MANU_LONG_BONTEMPI_FARFISA 0x200b #define RTP_MIDI_MANU_LONG_FBT_ELETTRONICA 0x200c #define RTP_MIDI_MANU_LONG_MIDITEMP 0x200d #define RTP_MIDI_MANU_LONG_LA_AUDIO_LARKING_AUDIO 0x200e #define RTP_MIDI_MANU_LONG_ZERO_88_LIGHTING_LIMITED 0x200f #define RTP_MIDI_MANU_LONG_MICON_AUDIO_ELECTRONICS_GMBH 0x2010 #define RTP_MIDI_MANU_LONG_FOREFRONT_TECHNOLOGY 0x2011 #define RTP_MIDI_MANU_LONG_STUDIO_AUDIO_AND_VIDEO_LTD 0x2012 #define RTP_MIDI_MANU_LONG_KENTON_ELECTRONICS 0x2013 #define RTP_MIDI_MANU_LONG_CELCO_DIVISON_OF_ELECTRONICS 0x2014 #define RTP_MIDI_MANU_LONG_ADB 0x2015 #define RTP_MIDI_MANU_LONG_MARSHALL_PRODUCTS 0x2016 #define RTP_MIDI_MANU_LONG_DDA 0x2017 #define RTP_MIDI_MANU_LONG_BBS 0x2018 #define RTP_MIDI_MANU_LONG_MA_LIGHTING_TECHNOLOGY 0x2019 #define RTP_MIDI_MANU_LONG_FATAR 0x201a #define RTP_MIDI_MANU_LONG_QSC_AUDIO 0x201b #define RTP_MIDI_MANU_LONG_ARTISAN_CLASSIC_ORGAN 0x201c #define RTP_MIDI_MANU_LONG_ORLA_SPA 0x201d #define RTP_MIDI_MANU_LONG_PINNACLE_AUDIO 0x201e #define RTP_MIDI_MANU_LONG_TC_ELECTRONICS 0x201f #define RTP_MIDI_MANU_LONG_DOEPFER_MUSIKELEKTRONIK 0x2020 #define RTP_MIDI_MANU_LONG_CREATIVE_TECHNOLOGY_PTE 0x2021 #define RTP_MIDI_MANU_LONG_MINAMI_SEIYDDO 0x2022 #define RTP_MIDI_MANU_LONG_GOLDSTAR 0x2023 #define RTP_MIDI_MANU_LONG_MIDISOFT_SAS_DI_M_CIMA 0x2024 #define RTP_MIDI_MANU_LONG_SAMICK 0x2025 #define RTP_MIDI_MANU_LONG_PENNY_AND_GILES 0x2026 #define RTP_MIDI_MANU_LONG_ACORN_COMPUTER 0x2027 #define RTP_MIDI_MANU_LONG_LSC_ELECTRONICS 0x2028 #define RTP_MIDI_MANU_LONG_NOVATION_EMS 0x2029 #define RTP_MIDI_MANU_LONG_SAMKYUNG_MECHATRONICS 0x202a #define RTP_MIDI_MANU_LONG_MEDELI_ELECTRONICS_CO 0x202b #define RTP_MIDI_MANU_LONG_CHARLIE_LAB_SRL 0x202c #define RTP_MIDI_MANU_LONG_BLUE_CHIP_MUSIC_TECHNOLOGY 0x202d #define RTP_MIDI_MANU_LONG_BEE_OH_CORP 0x202e #define RTP_MIDI_MANU_LONG_LG_SEMICON_AMERICA 0x202f #define RTP_MIDI_MANU_LONG_TESI 0x2030 #define RTP_MIDI_MANU_LONG_EMAGIC 0x2031 #define RTP_MIDI_MANU_LONG_BEHRINGER_GMBH 0x2032 #define RTP_MIDI_MANU_LONG_ACCESS_MUSIC_ELECTRONICS 0x2033 #define RTP_MIDI_MANU_LONG_SYNOPTIC 0x2034 #define RTP_MIDI_MANU_LONG_HANMESOFT_CORP 0x2035 #define RTP_MIDI_MANU_LONG_TERRATEC_ELECTRONIC_GMBH 0x2036 #define RTP_MIDI_MANU_LONG_PROEL_SPA 0x2037 #define RTP_MIDI_MANU_LONG_IBK_MIDI 0x2038 #define RTP_MIDI_MANU_LONG_IRCAM 0x2039 #define RTP_MIDI_MANU_LONG_PROPELLERHEAD_SOFTWARE 0x203a #define RTP_MIDI_MANU_LONG_RED_SOUND_SYSTEMS_LTD 0x203b #define RTP_MIDI_MANU_LONG_ELEKTRON_ESI_AB 0x203c #define RTP_MIDI_MANU_LONG_SINTEFEX_AUDIO 0x203d #define RTP_MIDI_MANU_LONG_MAM_MUSIC_AND_MORE 0x203e #define RTP_MIDI_MANU_LONG_AMSARO_GMBH 0x203f #define RTP_MIDI_MANU_LONG_CDS_ADVANCED_TECHNOLOGY_BV 0x2040 #define RTP_MIDI_MANU_LONG_TOUCHED_BY_SOUND_GMBH 0x2041 #define RTP_MIDI_MANU_LONG_DSP_ARTS 0x2042 #define RTP_MIDI_MANU_LONG_PHIL_REES_MUSIC_TECH 0x2043 #define RTP_MIDI_MANU_LONG_STAMER_MUSIKANLAGEN_GMBH 0x2044 #define RTP_MIDI_MANU_LONG_MUSICAL_MUNTANER_SA_DBA 0x2045 #define RTP_MIDI_MANU_LONG_CMEXX_SOFTWARE 0x2046 #define RTP_MIDI_MANU_LONG_KLAVIS_TECHNOLOGIES 0x2047 #define RTP_MIDI_MANU_LONG_NOTEHEADS_AB 0x2048 #define RTP_MIDI_MANU_LONG_ALGORITHMIX 0x2049 #define RTP_MIDI_MANU_LONG_SKRYDSTRUP_RD 0x204a #define RTP_MIDI_MANU_LONG_PROFRESSIONAL_AUDIO_COMPANY 0x204b #define RTP_MIDI_MANU_LONG_DBTECH_MADWAVES 0x204c #define RTP_MIDI_MANU_LONG_VERMONA 0x204d #define RTP_MIDI_MANU_LONG_NOKIA 0x204e #define RTP_MIDI_MANU_LONG_WAVE_IDEA 0x204f #define RTP_MIDI_MANU_LONG_HARTMANN_GMBH 0x2050 #define RTP_MIDI_MANU_LONG_LIONS_TRACK 0x2051 #define RTP_MIDI_MANU_LONG_ANALOGUE_SYSTEMS 0x2052 #define RTP_MIDI_MANU_LONG_FOCAL_JMLAB 0x2053 #define RTP_MIDI_MANU_LONG_RINGWAY_ELECTRONICS 0x2054 #define RTP_MIDI_MANU_LONG_FAITH_TECHNOLOGIES_DIGIPLUG 0x2055 #define RTP_MIDI_MANU_LONG_SHOWWORKS 0x2056 #define RTP_MIDI_MANU_LONG_MANIKIN_ELECTRONIC 0x2057 #define RTP_MIDI_MANU_LONG_1_COME_TECH 0x2058 #define RTP_MIDI_MANU_LONG_PHONIC_CORP 0x2059 #define RTP_MIDI_MANU_LONG_LAKE_TECHNOLOGY 0x205a #define RTP_MIDI_MANU_LONG_SILANSYS_TECHNOLOGIES 0x205b #define RTP_MIDI_MANU_LONG_WINBOND_ELECTRONICS 0x205c #define RTP_MIDI_MANU_LONG_CINETIX_MEDIEN_UND_INTERFACE 0x205d #define RTP_MIDI_MANU_LONG_AG_SOLUTIONI_DIGITALI 0x205e #define RTP_MIDI_MANU_LONG_SEQUENTIX_MUSIC_SYSTEMS 0x205f #define RTP_MIDI_MANU_LONG_ORAM_PRO_AUDIO 0x2060 #define RTP_MIDI_MANU_LONG_BE4_LTD 0x2061 #define RTP_MIDI_MANU_LONG_INFECTION_MUSIC 0x2062 #define RTP_MIDI_MANU_LONG_CENTRAL_MUSIC_CO_CME 0x2063 #define RTP_MIDI_MANU_LONG_GENOQS_MACHINES 0x2064 #define RTP_MIDI_MANU_LONG_MEDIALON 0x2065 #define RTP_MIDI_MANU_LONG_WAVES_AUDIO_LTD 0x2066 #define RTP_MIDI_MANU_LONG_JERASH_LABS 0x2067 #define RTP_MIDI_MANU_LONG_DA_FACT 0x2068 #define RTP_MIDI_MANU_LONG_ELBY_DESIGNS 0x2069 #define RTP_MIDI_MANU_LONG_SPECTRAL_AUDIO 0x206a #define RTP_MIDI_MANU_LONG_ARTURIA 0x206b #define RTP_MIDI_MANU_LONG_VIXID 0x206c #define RTP_MIDI_MANU_LONG_C_THRU_MUSIC 0x206d #define RTP_MIDI_MANU_LONG_YA_HORNG_ELECTRONIC_CO_LTD 0x206e #define RTP_MIDI_MANU_LONG_SM_PRO_AUDIO 0x206f #define RTP_MIDI_MANU_LONG_OTO_MACHINES 0x2070 #define RTP_MIDI_MANU_LONG_ELZAB_SA_G_LAB 0x2071 #define RTP_MIDI_MANU_LONG_BLACKSTAR_AMPLIFICATION_LTD 0x2072 #define RTP_MIDI_MANU_LONG_M3I_TECHNOLOGIES_GMBH 0x2073 #define RTP_MIDI_MANU_LONG_GEMALTO 0x2074 #define RTP_MIDI_MANU_LONG_PROSTAGE_SL 0x2075 #define RTP_MIDI_MANU_LONG_TEENAGE_ENGINEERING 0x2076 #define RTP_MIDI_MANU_LONG_TOBIAS_ERICHSEN 0x2077 #define RTP_MIDI_MANU_LONG_NIXER_LTD 0x2078 #define RTP_MIDI_MANU_LONG_HANPIN_ELECTRON_CO_LTD 0x2079 #define RTP_MIDI_MANU_LONG_MIDI_HARDWARE_R_SOWA 0x207a #define RTP_MIDI_MANU_LONG_BEYOND_MUSIC_INDUSTRIAL_LTD 0x207b #define RTP_MIDI_MANU_LONG_KISS_BOX_BV 0x207c #define RTP_MIDI_MANU_LONG_MISA_DIGITAL_TECHNOLOGIES_LTD 0x207d #define RTP_MIDI_MANU_LONG_AI_MUSICS_TECHNOLOGY_INC 0x207e #define RTP_MIDI_MANU_LONG_SERATO_INC_LP 0x207f #define RTP_MIDI_MANU_LONG_LIMEX_MUSIC_HANDLES_GMBH 0x2100 #define RTP_MIDI_MANU_LONG_KYODDAY_TOKAI 0x2101 #define RTP_MIDI_MANU_LONG_MUTABLE_INSTRUMENTS 0x2102 #define RTP_MIDI_MANU_LONG_PRESONUS_SOFTWARE_LTD 0x2103 #define RTP_MIDI_MANU_LONG_XIRING 0x2104 #define RTP_MIDI_MANU_LONG_FAIRLIGHT_INTRUMENTS_PTY_LTD 0x2105 #define RTP_MIDI_MANU_LONG_MUSICOM_LAB 0x2106 #define RTP_MIDI_MANU_LONG_VACO_LOCO 0x2107 #define RTP_MIDI_MANU_LONG_RWA_HONG_KONG_LIMITED 0x2108 /* Japanese Manufacturers */ #define RTP_MIDI_MANU_LONG_CRIMSON_TECHNOLOGY_INC 0x4000 #define RTP_MIDI_MANU_LONG_SOFTBANK_MOBILE_CORP 0x4001 /*#define RTP_MIDI_MANU_LONG_*/ #define RTP_MIDI_MANU_LONG_DM_HOLDINGS_INC 0x4003 #define RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_ON 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_OFF 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_VOICE_ALLOCATION_OFF 0x03 #define RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_VOICE_ALLOCATION_ON 0x04 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_SPECIAL 0x00 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_PUNCH_IN_POINTS 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_PUNGH_OUT_POINTS 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_PUNCH_IN_POINTS 0x03 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_PUNCH_OUT_POINTS 0x04 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_START_POINT 0x05 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_STOP_POINT 0x06 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_START_POINT_ADD 0x07 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_STOP_POINT_ADD 0x08 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_EVENT_START_POINT 0x09 #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_EVENT_STOP_POINT 0x0a #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_CUE_POINTS 0x0b #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_CUE_POINTS_ADD 0x0c #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_CUE_POINT 0x0d #define RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_NAME_IN_ADD 0x0e #define RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINT_TRANSMISSION 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINTS_REQUEST 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LP_UNI 0x00 #define RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LP_BI 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LP_OFF 0x7f #define RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REQUEST 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REPLY 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_FD_HEADER 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_FD_DATA_PACKET 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_FD_REQUEST 0x03 #define RTP_MIDI_SYSEX_COMMON_TUNING_BULK_DUMP_REQUEST 0x00 #define RTP_MIDI_SYSEX_COMMON_TUNING_BULK_DUMP_REPLY 0x01 #define RTP_MIDI_SYSEX_COMMON_TUNING_NOTE_CHANGE 0x02 #define RTP_MIDI_SYSEX_COMMON_NRT_GM_ON 0x01 #define RTP_MIDI_SYSEX_COMMON_NRT_GM_OFF 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_FULL_MESSAGE 0x01 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_USER_BITS 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_SCL_EXTENSIONS 0x00 #define RTP_MIDI_SYSEX_COMMON_RT_SC_LIGHTING 0x01 #define RTP_MIDI_SYSEX_COMMON_RT_SC_MOVING_LIGHTS 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_SC_COLOR_CHANGERS 0x03 #define RTP_MIDI_SYSEX_COMMON_RT_SC_STROBES 0x04 #define RTP_MIDI_SYSEX_COMMON_RT_SCL_LASERS 0x05 #define RTP_MIDI_SYSEX_COMMON_RT_SCL_CHASERS 0x06 #define RTP_MIDI_SYSEX_COMMON_RT_SC_SOUND 0x10 #define RTP_MIDI_SYSEX_COMMON_RT_SC_MUSIC 0x11 #define RTP_MIDI_SYSEX_COMMON_RT_SC_CD_PLAYERS 0x12 #define RTP_MIDI_SYSEX_COMMON_RT_SC_EPROM_PLAYBACK 0x13 #define RTP_MIDI_SYSEX_COMMON_RT_SCL_AUDIO_TAPE_MACHINE 0x14 #define RTP_MIDI_SYSEX_COMMON_RT_SC_INTERCOMS 0x15 #define RTP_MIDI_SYSEX_COMMON_RT_SC_AMPLIFIERS 0x16 #define RTP_MIDI_SYSEX_COMMON_RT_SC_AUDIO_EFFECTS 0x17 #define RTP_MIDI_SYSEX_COMMON_RT_SC_EQUALIZERS 0x18 #define RTP_MIDI_SYSEX_COMMON_RT_SC_MACHINERY 0x20 #define RTP_MIDI_SYSEX_COMMON_RT_SC_RIGGING 0x21 #define RTP_MIDI_SYSEX_COMMON_RT_SC_FLYS 0x22 #define RTP_MIDI_SYSEX_COMMON_RT_SC_LIFTS 0x23 #define RTP_MIDI_SYSEX_COMMON_RT_SC_TURNTABLES 0x24 #define RTP_MIDI_SYSEX_COMMON_RT_SC_TRUSSES 0x25 #define RTP_MIDI_SYSEX_COMMON_RT_SC_ROBOTS 0x26 #define RTP_MIDI_SYSEX_COMMON_RT_SC_ANIMATION 0x27 #define RTP_MIDI_SYSEX_COMMON_RT_SC_FLOATS 0x28 #define RTP_MIDI_SYSEX_COMMON_RT_SC_BREAKAWAYS 0x29 #define RTP_MIDI_SYSEX_COMMON_RT_SC_BARGES 0x2a #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO 0x30 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_TAPE_MACHINES 0x31 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_CASSETTE_MACHINES 0x32 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_DISC_PLAYERS 0x33 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_SWITCHERS 0x34 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_EFFECT 0x35 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_CHARACTER_GENERATORS 0x36 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_STIL_STORES 0x37 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_MONITORS 0x38 #define RTP_MIDI_SYSEX_COMMON_RT_SC_PROJECTION 0x40 #define RTP_MIDI_SYSEX_COMMON_RT_SC_FILM_PROJECTORS 0x41 #define RTP_MIDI_SYSEX_COMMON_RT_SC_SLIDE_PROJECTORS 0x42 #define RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_PROJECTORS 0x43 #define RTP_MIDI_SYSEX_COMMON_RT_SC_DISSOLVERS 0x44 #define RTP_MIDI_SYSEX_COMMON_RT_SC_SHUTTER_CONTROLS 0x45 #define RTP_MIDI_SYSEX_COMMON_RT_SC_PROCESS_CONTROL 0x50 #define RTP_MIDI_SYSEX_COMMON_RT_SC_HYDRAULIC_OIL 0x51 #define RTP_MIDI_SYSEX_COMMON_RT_SC_H2O 0x52 #define RTP_MIDI_SYSEX_COMMON_RT_SC_CO2 0x53 #define RTP_MIDI_SYSEX_COMMON_RT_SC_COMPRESSED_AIR 0x54 #define RTP_MIDI_SYSEX_COMMON_RT_SC_NATURAL_GAS 0x55 #define RTP_MIDI_SYSEX_COMMON_RT_SC_FOG 0x56 #define RTP_MIDI_SYSEX_COMMON_RT_SC_SMOKE 0x57 #define RTP_MIDI_SYSEX_COMMON_RT_SC_CRACKED_HAZE 0x58 #define RTP_MIDI_SYSEX_COMMON_RT_SC_PYRO 0x60 #define RTP_MIDI_SYSEX_COMMON_RT_SC_FIREWORKS 0x61 #define RTP_MIDI_SYSEX_COMMON_RT_SC_EXPLOSIONS 0x62 #define RTP_MIDI_SYSEX_COMMON_RT_SC_FLAME 0x63 #define RTP_MIDI_SYSEX_COMMON_RT_SC_SMOKE_POTS 0x64 #define RTP_MIDI_SYSEX_COMMON_RT_SC_ALL_TYPES 0x7f #define RTP_MIDI_SYSEX_COMMON_RT_NT_BAR_NUMBER 0x01 #define RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_IMMEDIATE 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_DELAYED 0x42 #define RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_VOLUME 0x01 #define RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_BALANCE 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_SPECIAL 0x00 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_PUNCH_IN_POINTS 0x01 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_PUNCH_OUT_POINTS 0x02 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_03 0x03 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_04 0x04 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_START_POINTS 0x05 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_STOP_POINTS 0x06 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_START_POINTS_ADD 0x07 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_STOP_POINTS_ADD 0x08 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_09 0x09 #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_0A 0x0a #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_CUE_POINTS 0x0b #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_CUE_POINTS_ADD 0x0c #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_0D 0x0d #define RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_NAME_ADD 0x0e /* TODO: Add MMC Commands */ /* TODO: Add MMC Responses */ #define RTP_MIDI_COMMON_MTC_QF_FRAME_LS_NIBBLE 0x00 #define RTP_MIDI_COMMON_MTC_QF_FRAME_MS_NIBBLE 0x01 #define RTP_MIDI_COMMON_MTC_QF_SECONDS_LS_NIBBLE 0x02 #define RTP_MIDI_COMMON_MTC_QF_SECONDS_MS_NIBBLE 0x03 #define RTP_MIDI_COMMON_MTC_QF_MINUTES_LS_NIBBLE 0x04 #define RTP_MIDI_COMMON_MTC_QF_MINUTES_MS_NIBBLE 0x05 #define RTP_MIDI_COMMON_MTC_QF_HOURS_LS_NIBBLE 0x06 #define RTP_MIDI_COMMON_MTC_QF_HOURS_MS_NIBBLE 0x07 #define RTP_MIDI_TREE_NAME_COMMAND "Command Section" #define RTP_MIDI_TREE_NAME_COMMAND_SYSEX_MANU "Manufacturer specific data" #define RTP_MIDI_TREE_NAME_COMMAND_SYSEX_EDU "Educational data" #define RTP_MIDI_TREE_NAME_JOURNAL "Journal Section" #define RTP_MIDI_TREE_NAME_SYSTEM_JOURNAL "System-Journal" #define RTP_MIDI_TREE_NAME_SYSTEM_CHAPTERS "System-Chapters" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_J "System Common 0xF4" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_K "System Common 0xF5" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_Y "System Common 0xF9" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_Z "System Common 0xFD" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_Q "Sequencer State Commands" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_F "MIDI Time Code Tape Position" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_X "System Exclusive" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_X_DATA "Data field (sysex commands)" #define RTP_MIDI_TREE_NAME_SJ_CHAPTER_X_INVALID_DATA "Data field (invalid sysex commands)" #define RTP_MIDI_TREE_NAME_CHANNEL_JOURNAL "Channel-Journal" #define RTP_MIDI_TREE_NAME_CHANNEL_CHAPTERS "Channel-Chapters" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_P "Program Change" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_C "Control Change" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_C_LOGLIST "Log List" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_C_LOGITEM "Log Item" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_M "Parameter System" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_M_LOGLIST "Log List" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_M_LOGITEM "Log Item" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_M_LOG_COUNT "Count" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_W "Pitch Wheel" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_N "Note on/off" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_N_LOGLIST "Log List" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_N_LOGITEM "Note On" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_N_OCTETS "Offbit Octets" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_E "Note Command Extras" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_E_LOGLIST "Log List" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_E_LOGITEM1 "Note Off" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_E_LOGITEM2 "Note On/Off" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_A "Poly Aftertouch" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_A_LOGLIST "Log List" #define RTP_MIDI_TREE_NAME_CJ_CHAPTER_A_LOGITEM "Pressure" /* used to mask the most significant bit, which flags the start of a new midi-command! */ #define RTP_MIDI_COMMAND_STATUS_FLAG 0x80 /* used to mask the lower 7 bits of the single octets that make up the delta-time */ #define RTP_MIDI_DELTA_TIME_OCTET_MASK 0x7f /* used to mask the most significant bit, which flags the extension of the delta-time */ #define RTP_MIDI_DELTA_TIME_EXTENSION 0x80 #define RTP_MIDI_CS_FLAG_B 0x80 #define RTP_MIDI_CS_FLAG_J 0x40 #define RTP_MIDI_CS_FLAG_Z 0x20 #define RTP_MIDI_CS_FLAG_P 0x10 #define RTP_MIDI_CS_MASK_SHORTLEN 0x0f #define RTP_MIDI_CS_MASK_LONGLEN 0x0fff #define RTP_MIDI_CJ_CHAPTER_M_FLAG_J 0x80 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_K 0x40 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_L 0x20 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_M 0x10 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_N 0x08 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_T 0x04 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_V 0x02 #define RTP_MIDI_CJ_CHAPTER_M_FLAG_R 0x01 #define RTP_MIDI_JS_FLAG_S 0x80 #define RTP_MIDI_JS_FLAG_Y 0x40 #define RTP_MIDI_JS_FLAG_A 0x20 #define RTP_MIDI_JS_FLAG_H 0x10 #define RTP_MIDI_JS_MASK_TOTALCHANNELS 0x0f #define RTP_MIDI_SJ_FLAG_S 0x8000 #define RTP_MIDI_SJ_FLAG_D 0x4000 #define RTP_MIDI_SJ_FLAG_V 0x2000 #define RTP_MIDI_SJ_FLAG_Q 0x1000 #define RTP_MIDI_SJ_FLAG_F 0x0800 #define RTP_MIDI_SJ_FLAG_X 0x0400 #define RTP_MIDI_SJ_MASK_LENGTH 0x03ff #define RTP_MIDI_SJ_CHAPTER_D_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_B 0x40 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_G 0x20 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_H 0x10 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_J 0x08 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_K 0x04 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_Y 0x02 #define RTP_MIDI_SJ_CHAPTER_D_FLAG_Z 0x01 #define RTP_MIDI_SJ_CHAPTER_D_RESET_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_D_RESET_COUNT 0x7f #define RTP_MIDI_SJ_CHAPTER_D_TUNE_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_D_TUNE_COUNT 0x7f #define RTP_MIDI_SJ_CHAPTER_D_SONG_SEL_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_D_SONG_SEL_VALUE 0x7f #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_S 0x8000 #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_C 0x4000 #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_V 0x2000 #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_L 0x1000 #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_DSZ 0x0c00 #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_LENGTH 0x03ff #define RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_COUNT 0xff #define RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_C 0x40 #define RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_L 0x20 #define RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_LENGTH 0x1f #define RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_COUNT 0xff #define RTP_MIDI_SJ_CHAPTER_Q_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_Q_FLAG_N 0x40 #define RTP_MIDI_SJ_CHAPTER_Q_FLAG_D 0x20 #define RTP_MIDI_SJ_CHAPTER_Q_FLAG_C 0x10 #define RTP_MIDI_SJ_CHAPTER_Q_FLAG_T 0x80 #define RTP_MIDI_SJ_CHAPTER_Q_MASK_TOP 0x07 #define RTP_MIDI_SJ_CHAPTER_Q_MASK_CLOCK 0x07ffff #define RTP_MIDI_SJ_CHAPTER_Q_MASK_TIMETOOLS 0xffffff #define RTP_MIDI_SJ_CHAPTER_F_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_F_FLAG_C 0x40 #define RTP_MIDI_SJ_CHAPTER_F_FLAG_P 0x20 #define RTP_MIDI_SJ_CHAPTER_F_FLAG_Q 0x10 #define RTP_MIDI_SJ_CHAPTER_F_FLAG_D 0x08 #define RTP_MIDI_SJ_CHAPTER_F_MASK_POINT 0x07 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT0 0xf0000000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT1 0x0f000000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT2 0x00f00000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT3 0x000f0000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT4 0x0000f000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT5 0x00000f00 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT6 0x000000f0 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MT7 0x0000000f #define RTP_MIDI_SJ_CHAPTER_F_MASK_HR 0xff000000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_MN 0x00ff0000 #define RTP_MIDI_SJ_CHAPTER_F_MASK_SC 0x0000ff00 #define RTP_MIDI_SJ_CHAPTER_F_MASK_FR 0x000000ff #define RTP_MIDI_SJ_CHAPTER_X_FLAG_S 0x80 #define RTP_MIDI_SJ_CHAPTER_X_FLAG_T 0x40 #define RTP_MIDI_SJ_CHAPTER_X_FLAG_C 0x20 #define RTP_MIDI_SJ_CHAPTER_X_FLAG_F 0x10 #define RTP_MIDI_SJ_CHAPTER_X_FLAG_D 0x08 #define RTP_MIDI_SJ_CHAPTER_X_FLAG_L 0x04 #define RTP_MIDI_SJ_CHAPTER_X_MASK_STA 0x03 #define RTP_MIDI_SJ_CHAPTER_X_MASK_TCOUNT 0xff #define RTP_MIDI_SJ_CHAPTER_X_MASK_COUNT 0xff #define RTP_MIDI_CJ_FLAG_S 0x800000 #define RTP_MIDI_CJ_FLAG_H 0x040000 #define RTP_MIDI_CJ_FLAG_P 0x000080 #define RTP_MIDI_CJ_FLAG_C 0x000040 #define RTP_MIDI_CJ_FLAG_M 0x000020 #define RTP_MIDI_CJ_FLAG_W 0x000010 #define RTP_MIDI_CJ_FLAG_N 0x000008 #define RTP_MIDI_CJ_FLAG_E 0x000004 #define RTP_MIDI_CJ_FLAG_T 0x000002 #define RTP_MIDI_CJ_FLAG_A 0x000001 #define RTP_MIDI_CJ_MASK_LENGTH 0x03ff00 #define RTP_MIDI_CJ_MASK_CHANNEL 0x780000 #define RTP_MIDI_CJ_CHANNEL_SHIFT 19 #define RTP_MIDI_CJ_CHAPTER_M_MASK_LENGTH 0x3f #define RTP_MIDI_CJ_CHAPTER_N_MASK_LENGTH 0x7f00 #define RTP_MIDI_CJ_CHAPTER_N_MASK_LOW 0x00f0 #define RTP_MIDI_CJ_CHAPTER_N_MASK_HIGH 0x000f #define RTP_MIDI_CJ_CHAPTER_E_MASK_LENGTH 0x7f #define RTP_MIDI_CJ_CHAPTER_A_MASK_LENGTH 0x7f static const char rtp_midi_unknown_value_dec[] = "unknown value: %d"; static const char rtp_midi_unknown_value_hex[] = "unknown value: 0x%x"; static const value_string rtp_midi_note_values[] = { { 0, "C-1" }, { 1, "C#-1" }, { 2, "D-1" }, { 3, "D#-1" }, { 4, "E-1" }, { 5, "F-1" }, { 6, "F#-1" }, { 7, "G-1" }, { 8, "G#-1" }, { 9, "A-1" }, { 10, "A#-1" }, { 11, "B-1" }, { 12, "C0" }, { 13, "C#0" }, { 14, "D0" }, { 15, "D#0" }, { 16, "E0" }, { 17, "F0" }, { 18, "F#0" }, { 19, "G0" }, { 20, "G#0" }, { 21, "A0" }, { 22, "A#0" }, { 23, "B0" }, { 24, "C1" }, { 25, "C#1" }, { 26, "D1" }, { 27, "D#1" }, { 28, "E1" }, { 29, "F1" }, { 30, "F#1" }, { 31, "G1" }, { 32, "G#1" }, { 33, "A1" }, { 34, "A#1" }, { 35, "B1" }, { 36, "C2" }, { 37, "C#2" }, { 38, "D2" }, { 39, "D#2" }, { 40, "E2" }, { 41, "F2" }, { 42, "F#2" }, { 43, "G2" }, { 44, "G#2" }, { 45, "A2" }, { 46, "A#2" }, { 47, "B2" }, { 48, "C3" }, { 49, "C#3" }, { 50, "D3" }, { 51, "D#3" }, { 52, "E3" }, { 53, "F3" }, { 54, "F#3" }, { 55, "G3" }, { 56, "G#3" }, { 57, "A3" }, { 58, "A#3" }, { 59, "B3" }, { 60, "C4" }, { 61, "C#4" }, { 62, "D4" }, { 63, "D#4" }, { 64, "E4" }, { 65, "F4" }, { 66, "F#4" }, { 67, "G4" }, { 68, "G#4" }, { 69, "A4" }, { 70, "A#4" }, { 71, "B4" }, { 72, "C5" }, { 73, "C#5" }, { 74, "D5" }, { 75, "D#5" }, { 76, "E5" }, { 77, "F5" }, { 78, "F#5" }, { 79, "G5" }, { 80, "G#5" }, { 81, "A5" }, { 82, "A#5" }, { 83, "B5" }, { 84, "C6" }, { 85, "C#6" }, { 86, "D6" }, { 87, "D#6" }, { 88, "E6" }, { 89, "F6" }, { 90, "F#6" }, { 91, "G6" }, { 92, "G#6" }, { 93, "A6" }, { 94, "A#6" }, { 95, "B6" }, { 96, "C7" }, { 97, "C#7" }, { 98, "D7" }, { 99, "D#7" }, { 100, "E7" }, { 101, "F7" }, { 102, "F#7" }, { 103, "G7" }, { 104, "G#7" }, { 105, "A7" }, { 106, "A#7" }, { 107, "B7" }, { 108, "C8" }, { 109, "C#8" }, { 110, "D8" }, { 111, "D#8" }, { 112, "E8" }, { 113, "F8" }, { 114, "F#8" }, { 115, "G8" }, { 116, "G#8" }, { 117, "A8" }, { 118, "A#8" }, { 119, "B8" }, { 120, "C9" }, { 121, "C#9" }, { 122, "D9" }, { 123, "D#9" }, { 124, "E9" }, { 125, "F9" }, { 126, "F#9" }, { 127, "G9" }, { 0, NULL } }; static value_string_ext rtp_midi_note_values_ext = VALUE_STRING_EXT_INIT(rtp_midi_note_values); static const value_string rtp_midi_controller_values[] = { { RTP_MIDI_CTRL_BANK_SELECT_MSB, "Bank Select (msb)" }, { RTP_MIDI_CTRL_MODULATION_WHEEL_OR_LEVER_MSB, "Modulation Wheel Or Lever (msb)" }, { RTP_MIDI_CTRL_BREATH_CONTROLLER_MSB, "Breath Controller (msb)" }, { RTP_MIDI_CTRL_FOOT_CONTROLLER_MSB, "Foot Controller (msb)" }, { RTP_MIDI_CTRL_PORTAMENTO_TIME_MSB, "Portamento Time (msb)" }, { RTP_MIDI_CTRL_DATA_ENTRY_MSB, "Data Entry (msb)" }, { RTP_MIDI_CTRL_CHANNEL_VOLUME_MSB, "Channel Volume (msb)" }, { RTP_MIDI_CTRL_BALANCE_MSB, "Balance (msb)" }, { RTP_MIDI_CTRL_PAN_MSB, "Pan (msb)" }, { RTP_MIDI_CTRL_EXPRESSION_CONTROLLER_MSB, "Expression Controller (msb)" }, { RTP_MIDI_CTRL_EFFECT_CONTROL_1_MSB, "Effect Control 1 (msb)" }, { RTP_MIDI_CTRL_EFFECT_CONTROL_2_MSB, "Effect Control 2 (msb)" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_1_MSB, "General Purpose Controller 1 (msb)" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_2_MSB, "General Purpose Controller 2 (msb)" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_3_MSB, "General Purpose Controller 3 (msb)" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_4_MSB, "General Purpose Controller 4 (msb)" }, { RTP_MIDI_CTRL_BANK_SELECT_LSB, "Bank Select (lsb)" }, { RTP_MIDI_CTRL_MODULATION_WHEEL_OR_LEVER_LSB, "Modulation Wheel Or Lever (lsb)" }, { RTP_MIDI_CTRL_BREATH_CONTROLLER_LSB, "Breath Controller (lsb)" }, { RTP_MIDI_CTRL_FOOT_CONTROLLER_LSB, "Foot Controller (lsb)" }, { RTP_MIDI_CTRL_PORTAMENTO_TIME_LSB, "Portamento Time (lsb)" }, { RTP_MIDI_CTRL_DATA_ENTRY_LSB, "Data Entry (lsb)" }, { RTP_MIDI_CTRL_CHANNEL_VOLUME_LSB, "Volume (lsb)" }, { RTP_MIDI_CTRL_BALANCE_LSB, "Balance (lsb)" }, { RTP_MIDI_CTRL_PAN_LSB, "Pan (lsb)" }, { RTP_MIDI_CTRL_EXPRESSION_CONTROLLER_LSB, "Expression Controller (lsb)" }, { RTP_MIDI_CTRL_EFFECT_CONTROL_1_LSB, "Effect Control 1 (lsb)" }, { RTP_MIDI_CTRL_EFFECT_CONTROL_2_LSB, "Effect Control 2 (lsb)" }, { RTP_MIDI_CTRL_DAMPER_PEDAL, "Damper Pedal" }, { RTP_MIDI_CTRL_PORTAMENTO_ON_OFF, "Portamento On/Off" }, { RTP_MIDI_CTRL_SUSTENUTO, "Sustenuto" }, { RTP_MIDI_CTRL_SOFT_PEDAL, "Soft Pedal" }, { RTP_MIDI_CTRL_LEGATO_FOOTSWITCH, "Legato Footswitch" }, { RTP_MIDI_CTRL_HOLD_2, "Hold 2" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_1, "Sound Controller 1 (default: Sound Variation)" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_2, "Sound Controller 2 (default: Timbre/Harmonic Intensity)" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_3, "Sound Controller 3 (default: Release Time)" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_4, "Sound Controller 4 (default: Attack Time)" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_5, "Sound Controller 5 (default: Brightness)" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_6, "Sound Controller 6" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_7, "Sound Controller 7" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_8, "Sound Controller 8" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_9, "Sound Controller 9" }, { RTP_MIDI_CTRL_SOUND_CONTROLLER_10, "Sound Controller 10" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_5, "General Purpose Controller 5" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_6, "General Purpose Controller 6" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_7, "General Purpose Controller 7" }, { RTP_MIDI_CTRL_GENERAL_PURPOSE_CONTROLLER_8, "General Purpose Controller 8" }, { RTP_MIDI_CTRL_PORTAMENTO_CONTROL, "Portamento Control" }, { RTP_MIDI_CTRL_EFFECTS_1_DEPTH, "Effects 1 Depth (formerly: External Effects Depth)" }, { RTP_MIDI_CTRL_EFFECTS_2_DEPTH, "Effects 2 Depth (formerly: Tremolo Depth)" }, { RTP_MIDI_CTRL_EFFECTS_3_DEPTH, "Effects 3 Depth (formerly: Chorus Depth)" }, { RTP_MIDI_CTRL_EFFECTS_4_DEPTH, "Effects 4 Depth (formerly: Celeste (Detune) Depth)" }, { RTP_MIDI_CTRL_EFFECTS_5_DEPTH, "Effects 5 Depth (formerly: Phaser Depth)" }, { RTP_MIDI_CTRL_DATA_INCREMENT, "Data Increment" }, { RTP_MIDI_CTRL_DATA_DECREMENT, "Data Decrement" }, { RTP_MIDI_CTRL_NON_REGISTERED_PARAM_LSB, "Non-Registered Parameter (lsb)" }, { RTP_MIDI_CTRL_NON_REGISTERED_PARAM_MSB, "Non-Registered Parameter (msb)" }, { RTP_MIDI_CTRL_REGISTERED_PARAM_LSB, "Registered Parameter (lsb)" }, { RTP_MIDI_CTRL_REGISTERED_PARAM_MSB, "Registered Parameter (msb)" }, { RTP_MIDI_CTRL_ALL_SOUND_OFF, "All Sound Off" }, { RTP_MIDI_CTRL_RESET_ALL_CONTROLLERS, "Reset All Controllers" }, { RTP_MIDI_CTRL_LOCAL_CONTROL_ON_OFF, "Local Control" }, { RTP_MIDI_CTRL_ALL_NOTES_OFF, "All Notes Off" }, { RTP_MIDI_CTRL_OMNI_MODE_OFF, "Omni Mode Off" }, { RTP_MIDI_CTRL_OMNI_MODE_ON, "Omni Mode On" }, { RTP_MIDI_CTRL_MONO_MODE_ON, "Mono Mode On" }, { RTP_MIDI_CTRL_POLY_MODE_ON, "Poly Mode On" }, { 0, NULL } }; static value_string_ext rtp_midi_controller_values_ext = VALUE_STRING_EXT_INIT(rtp_midi_controller_values); static const value_string rtp_midi_manu_short_values[] = { { RTP_MIDI_MANU_SHORT_ISLONG, "< long id >" }, { RTP_MIDI_MANU_SHORT_SEQUENTIAL_CIRCUITS, "Sequential Circuits" }, { RTP_MIDI_MANU_SHORT_BIG_BRIAR_IDP, "Big Briar / IDP" }, { RTP_MIDI_MANU_SHORT_OCTAVE_PLATEAU_VOYETRA, "Voyetra / Octave-Plateau" }, { RTP_MIDI_MANU_SHORT_MOOG, "Moog" }, { RTP_MIDI_MANU_SHORT_PASSPORT_DESIGNS, "Passport Designs" }, { RTP_MIDI_MANU_SHORT_LEXICON, "Lexicon" }, { RTP_MIDI_MANU_SHORT_KURZWEIL, "Kurzweil" }, { RTP_MIDI_MANU_SHORT_FENDER, "Fender" }, { RTP_MIDI_MANU_SHORT_GULBRANSEN, "Gulbransen" }, { RTP_MIDI_MANU_SHORT_AKG_ACOUSTICS, "AKG Acoustics" }, { RTP_MIDI_MANU_SHORT_VOYCE_MUSIC, "Voyce Music" }, { RTP_MIDI_MANU_SHORT_WAVEFRAME, "Waveframe Corp" }, { RTP_MIDI_MANU_SHORT_ADA_SIGNAL_PROCESSORS, "ADA Signal Processors" }, { RTP_MIDI_MANU_SHORT_GARFIELD_ELECTRONICS, "Garfield Electronics" }, { RTP_MIDI_MANU_SHORT_ENSONIQ, "Ensoniq" }, { RTP_MIDI_MANU_SHORT_OBERHEIM_GIBSON_LABS, "Oberheim / Gibson Labs" }, { RTP_MIDI_MANU_SHORT_APPLE_COMPUTERS, "Apple Computer" }, { RTP_MIDI_MANU_SHORT_GREY_MATTER_RESPONSE, "Grey Matter Response / Simmons" }, { RTP_MIDI_MANU_SHORT_DIGIDESIGN, "DigiDesign" }, { RTP_MIDI_MANU_SHORT_PALMTREE_INSTRUMENTS, "Fairlight / Palmtree Instruments" }, { RTP_MIDI_MANU_SHORT_JL_COOPER, "JL Cooper" }, { RTP_MIDI_MANU_SHORT_LOWREY, "Lowrey" }, { RTP_MIDI_MANU_SHORT_LINN_ADAMS_SMITH, "Linn / Adams-Smith" }, { RTP_MIDI_MANU_SHORT_EMU_SYSTEMS, "Emu Systems" }, { RTP_MIDI_MANU_SHORT_HARMONY_SYSTEMS, "Harmony Systems" }, { RTP_MIDI_MANU_SHORT_ART, "ART" }, { RTP_MIDI_MANU_SHORT_BALDWIN, "Baldwin" }, { RTP_MIDI_MANU_SHORT_EVENTIDE, "Eventide" }, { RTP_MIDI_MANU_SHORT_INVENTRONICS, "Inventronics" }, { RTP_MIDI_MANU_SHORT_CLARITY, "Clarity" }, { RTP_MIDI_MANU_SHORT_PASSAC, "Passac" }, { RTP_MIDI_MANU_SHORT_SIEL, "S.I.E.L." }, { RTP_MIDI_MANU_SHORT_SYNTHE_AXE, "SyntheAxe" }, { RTP_MIDI_MANU_SHORT_STEPP, "Stepp" }, { RTP_MIDI_MANU_SHORT_HOHNER, "Hohner" }, { RTP_MIDI_MANU_SHORT_CRUMAR_TWISTER, "Crumar / Twister" }, { RTP_MIDI_MANU_SHORT_SOLTON, "Solton" }, { RTP_MIDI_MANU_SHORT_JELLINGHAUS_MS, "Jellinghaus MS" }, { RTP_MIDI_MANU_SHORT_SOUTHWORK_MUSIC_SYSTEMS, "Southworks Music Systems" }, { RTP_MIDI_MANU_SHORT_PPG, "PPG" }, { RTP_MIDI_MANU_SHORT_JEN, "JEN" }, { RTP_MIDI_MANU_SHORT_SSL, "SSL (Solid States Logic)" }, { RTP_MIDI_MANU_SHORT_AUDIO_VERITRIEB, "Audio Veritrieb" }, { RTP_MIDI_MANU_SHORT_NEVE_HINTON_INSTRUMENTS, "Neve / Hinton Instruments" }, { RTP_MIDI_MANU_SHORT_SOUNDTRACS, "Soundtracs Ltd" }, { RTP_MIDI_MANU_SHORT_ELKA_GENERAL_MUSIC, "Elka / General Music" }, { RTP_MIDI_MANU_SHORT_DYNACORD, "Dynacord" }, { RTP_MIDI_MANU_SHORT_VISCOUNT, "Viscount" }, { RTP_MIDI_MANU_SHORT_DRAWMER, "Drawmer" }, { RTP_MIDI_MANU_SHORT_CLAVIA_DIGITAL_INSTRUMENTS, "Clavia Digital Instruments" }, { RTP_MIDI_MANU_SHORT_AUDIO_ARCHITECTURE, "Audio Architecture" }, { RTP_MIDI_MANU_SHORT_GENERAL_MUSIC_CORP, "General Music Corp" }, { RTP_MIDI_MANU_SHORT_CHEETAH, "Cheetah Marketing" }, { RTP_MIDI_MANU_SHORT_CTM, "C.T.M" }, { RTP_MIDI_MANU_SHORT_SIMMONS_UK, "Simmons UK" }, { RTP_MIDI_MANU_SHORT_SOUNDCRAFT_ELECTRONICS, "Soundcraft Electronics" }, { RTP_MIDI_MANU_SHORT_STEINBERG_GMBH, "Steinberg GmbH" }, { RTP_MIDI_MANU_SHORT_WERSI, "Wersi" }, { RTP_MIDI_MANU_SHORT_AVAB_ELEKTRONIK_AB, "Avab Electronik Ab" }, { RTP_MIDI_MANU_SHORT_DIGIGRAM, "Digigram" }, { RTP_MIDI_MANU_SHORT_WALDORF, "Waldorf Electronics" }, { RTP_MIDI_MANU_SHORT_QUASIMIDI, "Quasimidi" }, { RTP_MIDI_MANU_SHORT_KAWAI, "Kawai" }, { RTP_MIDI_MANU_SHORT_ROLAND, "Roland" }, { RTP_MIDI_MANU_SHORT_KORG, "Korg" }, { RTP_MIDI_MANU_SHORT_YAMAHA, "Yamaha" }, { RTP_MIDI_MANU_SHORT_CASIO, "Casio" }, { RTP_MIDI_MANU_SHORT_MORIDAIRA, "Moridaira" }, { RTP_MIDI_MANU_SHORT_KAMIYA_STUDIO, "Kamiya Studio" }, { RTP_MIDI_MANU_SHORT_AKAI, "Akai" }, { RTP_MIDI_MANU_SHORT_JAPAN_VICTOR, "Japan Victor" }, { RTP_MIDI_MANU_SHORT_MEISOSHA, "Meisosha" }, { RTP_MIDI_MANU_SHORT_HOSHINO_GAKKI, "Hoshino Gakki" }, { RTP_MIDI_MANU_SHORT_FUJITSU, "Fujitsu" }, { RTP_MIDI_MANU_SHORT_SONY, "Sony" }, { RTP_MIDI_MANU_SHORT_NISSHIN_ONPA, "Nisshin Onpa" }, { RTP_MIDI_MANU_SHORT_TEAC, "TEAC" }, { RTP_MIDI_MANU_SHORT_MATSUSHITA_ELECTRIC, "Matsushita Electric" }, { RTP_MIDI_MANU_SHORT_FOSTEX, "Fostex" }, { RTP_MIDI_MANU_SHORT_ZOOM, "Zoom" }, { RTP_MIDI_MANU_SHORT_MIDORI_ELECTRONICS, "Midori Electronics" }, { RTP_MIDI_MANU_SHORT_MATSUSHITA_COMMUNICATION, "Matsushita Communication" }, { RTP_MIDI_MANU_SHORT_SUZUKI, "Suzuki" }, { RTP_MIDI_MANU_SHORT_FUJI, "Fuji" }, { RTP_MIDI_MANU_SHORT_ACOUSTIC_TECHNICAL_LAB, "Acoustic Technical Lab" }, { RTP_MIDI_MANU_SHORT_FAITH, "Faith" }, { RTP_MIDI_MANU_SHORT_INTERNET_CORPORATION, "Internet Corporation" }, { RTP_MIDI_MANU_SHORT_SEEKERS_CO, "Seekers Co" }, { RTP_MIDI_MANU_SHORT_SD_CARD_ASSOCIATION, "SD Card Assoc" }, { RTP_MIDI_MANU_SHORT_EDUCATIONAL_USE, "Educational Use" }, { RTP_MIDI_MANU_SHORT_NON_REALTIME_UNIVERSAL, "Non-Realtime Universal" }, { RTP_MIDI_MANU_SHORT_REALTIME_UNIVERSAL, "Realtime Universal" }, { 0, NULL } }; static value_string_ext rtp_midi_manu_short_values_ext = VALUE_STRING_EXT_INIT(rtp_midi_manu_short_values); static const value_string rtp_midi_manu_long_values[] = { /* North American Manufacturers */ { RTP_MIDI_MANU_LONG_TIME_WARNER_INTERACTIVE, "Time Warner Interactive" }, { RTP_MIDI_MANU_LONG_ADVANCED_GRAVIS_COMP, "Advanced Gravis Comp" }, { RTP_MIDI_MANU_LONG_MEDIA_VISION, "Media Vision" }, { RTP_MIDI_MANU_LONG_DORNES_RESEARCH_GROUP, "Dornes Research Group" }, { RTP_MIDI_MANU_LONG_KMUSE, "K-Muse" }, { RTP_MIDI_MANU_LONG_STYPHER, "Stypher" }, { RTP_MIDI_MANU_LONG_DIGITAL_MUSIC_CORPORATION, "Digital Music Corporation" }, { RTP_MIDI_MANU_LONG_IOTA_SYSTEMS, "IOTA Systems" }, { RTP_MIDI_MANU_LONG_NEW_ENGLAND_DIGITAL, "New England Digital" }, { RTP_MIDI_MANU_LONG_ARTISYN, "Artisyn" }, { RTP_MIDI_MANU_LONG_IVL_TECHNOLOGIES, "IVL Technologies" }, { RTP_MIDI_MANU_LONG_SOUTHERN_MUSIC_SYSTEMS, "Southern Music Systems" }, { RTP_MIDI_MANU_LONG_LAKE_BUTLER_SOUND_COMPANY, "Lake Butler Sound Company" }, { RTP_MIDI_MANU_LONG_ALESIS, "Alesis" }, { RTP_MIDI_MANU_LONG_SOUND_CREATION, "Sound Creation" }, { RTP_MIDI_MANU_LONG_DOD_ELECTRONICS, "DOD Electronics" }, { RTP_MIDI_MANU_LONG_STUDER_EDITECH, "Studer-Editech" }, { RTP_MIDI_MANU_LONG_SONUS, "Sonus" }, { RTP_MIDI_MANU_LONG_TEMPORAL_ACUITY_PRODUCTS, "Temporal Acuity Products" }, { RTP_MIDI_MANU_LONG_PERFECT_FRETWORKS, "Perfect Fretworks" }, { RTP_MIDI_MANU_LONG_KAT, "KAT" }, { RTP_MIDI_MANU_LONG_OPCODE, "Opcode" }, { RTP_MIDI_MANU_LONG_RANE_CORP, "Rane Corp" }, { RTP_MIDI_MANU_LONG_SPATIAL_SOUND_ANADI_INC, "Spatial Sound / Anadi Inc" }, { RTP_MIDI_MANU_LONG_KMX, "KMX" }, { RTP_MIDI_MANU_LONG_ALLEN_AND_HEATH_BRENNEL, "Allen & Heath Brenell" }, { RTP_MIDI_MANU_LONG_PEAVEY, "Peavey" }, { RTP_MIDI_MANU_LONG_360_SYSTEMS, "360 Systems" }, { RTP_MIDI_MANU_LONG_SPECTRUM_DESIGN_DEVELOPMENT, "Spectrum Design and Development" }, { RTP_MIDI_MANU_LONG_MARQUIS_MUSIC, "Marquis Music" }, { RTP_MIDI_MANU_LONG_ZETA_SYSTEMS, "Zeta Systems" }, { RTP_MIDI_MANU_LONG_AXXES, "Axxes" }, { RTP_MIDI_MANU_LONG_ORBAN, "Orban" }, { RTP_MIDI_MANU_LONG_INDIAN_VALLEY, "Indian Valley Mfg" }, { RTP_MIDI_MANU_LONG_TRITON, "Triton" }, { RTP_MIDI_MANU_LONG_KTI, "KTI" }, { RTP_MIDI_MANU_LONG_BREAKAWAY_TECHNOLOGIES, "Breakaway Technologies" }, { RTP_MIDI_MANU_LONG_CAE, "CAE" }, { RTP_MIDI_MANU_LONG_HARRISON_SYSTEMS_INC, "Harrison Systems Inc" }, { RTP_MIDI_MANU_LONG_FUTURE_LAB_MARK_KUO, "Future Lab / Mark Kuo" }, { RTP_MIDI_MANU_LONG_ROCKTRON_CORP, "Rocktron Corp" }, { RTP_MIDI_MANU_LONG_PIANODISC, "PianoDisc" }, { RTP_MIDI_MANU_LONG_CANNON_RESEARCH_GROUP, "Cannon Research Group" }, { RTP_MIDI_MANU_LONG_RODGERS_INSTRUMENTS_CORP, "Rodgers Instrument Corp" }, { RTP_MIDI_MANU_LONG_BLUE_SKY_LOGIC, "Blue Sky Logic" }, { RTP_MIDI_MANU_LONG_ENCORE_ELECTRONICS, "Encore Electronics" }, { RTP_MIDI_MANU_LONG_UPTOWN, "Uptown" }, { RTP_MIDI_MANU_LONG_VOCE, "Voce" }, { RTP_MIDI_MANU_LONG_CTI_AUDIO_INC, "CTI Audio, Inc / Music Intel Dev" }, { RTP_MIDI_MANU_LONG_SS_RESEARCH, "S&S Research" }, { RTP_MIDI_MANU_LONG_BRODERBUND_SOFTWARE, "Broderbund Software Inc" }, { RTP_MIDI_MANU_LONG_ALLEN_ORGAN_CO, "Allen Organ Co" }, { RTP_MIDI_MANU_LONG_MUSIC_QUEST, "Music Quest" }, { RTP_MIDI_MANU_LONG_APHEX, "APHEX" }, { RTP_MIDI_MANU_LONG_GALLIEN_KRUEGER, "Gallien Krueger" }, { RTP_MIDI_MANU_LONG_IBM, "IBM" }, { RTP_MIDI_MANU_LONG_MARK_OF_THE_UNICORN, "Mark of the Unicorn" }, { RTP_MIDI_MANU_LONG_HOTZ_INSTRUMENTS_TECH, "Hotz Instruments Technologies" }, { RTP_MIDI_MANU_LONG_ETA_LIGHTING, "ETA Lighting" }, { RTP_MIDI_MANU_LONG_NSI_CORPORATION, "NSI Corporation" }, { RTP_MIDI_MANU_LONG_ADLIB_INC, "PAd Lib, Inc" }, { RTP_MIDI_MANU_LONG_RICHMOND_SOUND_DESIGN, "Richmond Sound Design" }, { RTP_MIDI_MANU_LONG_MICROSOFT, "Microsoft" }, { RTP_MIDI_MANU_LONG_THE_SOFTWARE_TOOLWORKS, "The Software Toolworks" }, { RTP_MIDI_MANU_LONG_RJMG_NICHE, "RJMG / Niche" }, { RTP_MIDI_MANU_LONG_INTONE, "Intone" }, { RTP_MIDI_MANU_LONG_ADVANCED_REMOTE_TECH, "Advanced Remote Tech" }, { RTP_MIDI_MANU_LONG_GT_ELECTRONICS_GROOVE_TUBES, "GT Electronics / Groove Tubes" }, { RTP_MIDI_MANU_LONG_INTERMIDI, "InterMIDI" }, { RTP_MIDI_MANU_LONG_TIMELINE_VISTA, "Timeline Vista" }, { RTP_MIDI_MANU_LONG_MESA_BOOGIE, "Mesa Boogie" }, { RTP_MIDI_MANU_LONG_SEQUOIA_DEVELOPMENT, "Sequoia Development" }, { RTP_MIDI_MANU_LONG_STUDIO_ELECTRONICS, "Studio Electronics" }, { RTP_MIDI_MANU_LONG_EUPHONIX, "Euphonix" }, { RTP_MIDI_MANU_LONG_INTERMIDI2, "InterMIDI" }, { RTP_MIDI_MANU_LONG_MIDI_SOLUTIONS, "MIDI Solutions" }, { RTP_MIDI_MANU_LONG_3DO_COMPANY, "3DO Company" }, { RTP_MIDI_MANU_LONG_LIGHTWAVE_RESEARCH, "Lightwave Research" }, { RTP_MIDI_MANU_LONG_MICROW, "Micro-W" }, { RTP_MIDI_MANU_LONG_SPECTRAL_SYNTHESIS, "Spectral Synthesis" }, { RTP_MIDI_MANU_LONG_LONE_WOLF, "Lone Wolf" }, { RTP_MIDI_MANU_LONG_STUDIO_TECHNOLOGIES, "Studio Technologies" }, { RTP_MIDI_MANU_LONG_PETERSON_EMP, "Peterson EMP" }, { RTP_MIDI_MANU_LONG_ATARI, "Atari" }, { RTP_MIDI_MANU_LONG_MARION_SYSTEMS, "Marion Systems" }, { RTP_MIDI_MANU_LONG_DESIGN_EVENT, "Design Event" }, { RTP_MIDI_MANU_LONG_WINJAMMER_SOFTWARE, "Winjammer Software" }, { RTP_MIDI_MANU_LONG_ATT_BELL_LABS, "AT&T Bell Labs" }, { RTP_MIDI_MANU_LONG_SYMETRIX, "Symetrix" }, { RTP_MIDI_MANU_LONG_MIDI_THE_WORLD, "MIDI the world" }, { RTP_MIDI_MANU_LONG_DESPER_PRODUCTS, "Desper Products" }, { RTP_MIDI_MANU_LONG_MICROS_N_MIDI, "Micros 'n MIDI" }, { RTP_MIDI_MANU_LONG_ACCORDIANS_INTL, "Accodians Intl" }, { RTP_MIDI_MANU_LONG_EUPHONICS, "EuPhonics" }, { RTP_MIDI_MANU_LONG_MUSONIX, "Musonix" }, { RTP_MIDI_MANU_LONG_TURTLE_BEACH_SYSTEMS, "Turtle Beach Systems" }, { RTP_MIDI_MANU_LONG_MACKIE_DESIGNS, "Mackie Designs" }, { RTP_MIDI_MANU_LONG_COMPUSERVE, "Compuserve" }, { RTP_MIDI_MANU_LONG_BES_TECHNOLOGIES, "BES Technologies" }, { RTP_MIDI_MANU_LONG_QRS_MUSIC_ROLLS, "QRS Music Rolls" }, { RTP_MIDI_MANU_LONG_P_G_MUSIC, "P G Music" }, { RTP_MIDI_MANU_LONG_SIERRA_SEMICONDUCTOR, "Sierra Semiconductor" }, { RTP_MIDI_MANU_LONG_EPIGRAF_AUDIO_VISUAL, "EpiGraf Audio Visual" }, { RTP_MIDI_MANU_LONG_ELECTRONICS_DIVERSIFIED, "Electronics Diversified" }, { RTP_MIDI_MANU_LONG_TUNE_1000, "Tune 1000" }, { RTP_MIDI_MANU_LONG_ADVANCED_MICRO_DEVICES, "Advanced Micro Devices" }, { RTP_MIDI_MANU_LONG_MEDIAMATION, "Mediamation" }, { RTP_MIDI_MANU_LONG_SABINE_MUSIC, "Sabine Music" }, { RTP_MIDI_MANU_LONG_WOOG_LABS, "Woog Labs" }, { RTP_MIDI_MANU_LONG_MIRCOPOLIS, "Micropolis" }, { RTP_MIDI_MANU_LONG_TA_HORNG_MUSICAL_INSTRUMENT, "Ta Horng Musical Instrument" }, { RTP_MIDI_MANU_LONG_ETEK_LABS_FORTE_TECH, "e-Tek Labs (Forte Tech)" }, { RTP_MIDI_MANU_LONG_ELECTRO_VOICE, "Electro-Voice" }, { RTP_MIDI_MANU_LONG_MIDISOFT_CORPORATION, "Midisoft Corporation" }, { RTP_MIDI_MANU_LONG_QSOUND_LABS, "Q-Sound Labs" }, { RTP_MIDI_MANU_LONG_WESTREX, "Westrex" }, { RTP_MIDI_MANU_LONG_NVIDIA, "NVidia" }, { RTP_MIDI_MANU_LONG_ESS_TECHNOLOGY, "ESS Technology" }, { RTP_MIDI_MANU_LONG_MEDIATRIX_PERIPHERALS, "MediaTrix Peripherals" }, { RTP_MIDI_MANU_LONG_BROOKTREE_CORP, "Brooktree Corp" }, { RTP_MIDI_MANU_LONG_OTARI_CORP, "Otari Corp" }, { RTP_MIDI_MANU_LONG_KEY_ELECTRONICS, "Key Electronics" }, { RTP_MIDI_MANU_LONG_SHURE_INCORPORATED, "Shure Incorporated" }, { RTP_MIDI_MANU_LONG_AURA_SOUND, "Aura Sound" }, { RTP_MIDI_MANU_LONG_CRYSTAL_SEMICONDUCTOR, "Crystal Semiconductor" }, { RTP_MIDI_MANU_LONG_CONEXANT_ROCKWELL, "Conexant (Rockwell)" }, { RTP_MIDI_MANU_LONG_SILICON_GRAPHICS, "Silicon Graphics" }, { RTP_MIDI_MANU_LONG_MAUDIO_MIDIMAN, "M-Audio (Midiman)" }, { RTP_MIDI_MANU_LONG_PRESONUS, "PreSonus" }, { RTP_MIDI_MANU_LONG_TOPAZ_ENTERPRISES, "Topaz Enterprises" }, { RTP_MIDI_MANU_LONG_CAST_LIGHTING, "Cast Lighting" }, { RTP_MIDI_MANU_LONG_MICROSOFT_CONSUMER_DIVISION, "Microsoft (Consumer Division)" }, { RTP_MIDI_MANU_LONG_SONIC_FOUNDRY, "Sonic Foundry" }, { RTP_MIDI_MANU_LONG_LINE6_FAST_FORWARD, "Line 6 (Fast Forward)" }, { RTP_MIDI_MANU_LONG_BEATNIK_INC, "Beatnik Inc" }, { RTP_MIDI_MANU_LONG_VAN_KOEVERING_COMPANY, "Van Koevering Company" }, { RTP_MIDI_MANU_LONG_ALTECH_SYSTEMS, "DiAltech Systemsgit" }, { RTP_MIDI_MANU_LONG_S_S_RESEARCH, "S&S Research" }, { RTP_MIDI_MANU_LONG_VLSI_TECHNOLOGY, "VLSI Technology" }, { RTP_MIDI_MANU_LONG_CHROMATIC_RESEARCH, "Chromatic Research" }, { RTP_MIDI_MANU_LONG_SAPPHIRE, "Sapphire" }, { RTP_MIDI_MANU_LONG_IDRC, "IDRC" }, { RTP_MIDI_MANU_LONG_JUSTONIC_TUNING, "Justonic Tuning" }, { RTP_MIDI_MANU_LONG_TORCOMP_RESEARCH_INC, "TorComp Research Inc" }, { RTP_MIDI_MANU_LONG_NEWTEK_INC, "NewTek Inc" }, { RTP_MIDI_MANU_LONG_SOUND_SCULPTURE, "Sound Sculpture" }, { RTP_MIDI_MANU_LONG_WALKER_TECHNICAL, "Walker Technical" }, { RTP_MIDI_MANU_LONG_DIGITAL_HARMONY, "Digital Harmony" }, { RTP_MIDI_MANU_LONG_INVISION_INTERACTIVE, "InVision Interactive" }, { RTP_MIDI_MANU_LONG_TSQUARE_DESIGN, "T-Square Design" }, { RTP_MIDI_MANU_LONG_NEMESYS_MUSIC_TECHNOLOGY, "Nemesys Music Technology" }, { RTP_MIDI_MANU_LONG_DBX_PROFESSIONAL_HARMAN_INTL, "DBX Professional (Harman Intl)" }, { RTP_MIDI_MANU_LONG_SYNDYNE_CORPORATION, "Syndyne Corporation" }, { RTP_MIDI_MANU_LONG_BITHEADZ, "Bitheadz" }, { RTP_MIDI_MANU_LONG_CAKEWALK_MUSIC_SOFTWARE, "Cakewalk Music Software" }, { RTP_MIDI_MANU_LONG_ANALOG_DEVICES, "Analog Devices" }, { RTP_MIDI_MANU_LONG_NATIONAL_SEMICONDUCTOR, "National Semiconductor" }, { RTP_MIDI_MANU_LONG_BOOM_THEORY, "Boom Theory" }, { RTP_MIDI_MANU_LONG_VIRTUAL_DSP_CORPORATION, "Virtual DSP Corporation" }, { RTP_MIDI_MANU_LONG_ANTARES_SYSTEMS, "Antares Systems" }, { RTP_MIDI_MANU_LONG_ANGEL_SOFTWARE, "Angel Software" }, { RTP_MIDI_MANU_LONG_ST_LOUIS_MUSIC, "St Louis Music" }, { RTP_MIDI_MANU_LONG_LYRRUS_DBA_GVOX, "Lyrrus dba G-VOX" }, { RTP_MIDI_MANU_LONG_ASHLEY_AUDIO_INC, "Ashley Audio Inc" }, { RTP_MIDI_MANU_LONG_VARILITE_INC, "Vari-Lite Inc" }, { RTP_MIDI_MANU_LONG_SUMMIT_AUDIO_INC, "Summit Audio Inc" }, { RTP_MIDI_MANU_LONG_AUREAL_SEMICONDUCTOR_INC, "Aureal Semiconductor Inc" }, { RTP_MIDI_MANU_LONG_SEASOUND_LLC, "SeaSound LLC" }, { RTP_MIDI_MANU_LONG_US_ROBOTICS, "U.S. Robotics" }, { RTP_MIDI_MANU_LONG_AURISIS_RESEARCH, "Aurisis Research" }, { RTP_MIDI_MANU_LONG_NEARFIELD_MULTIMEDIA, "Nearfield Multimedia" }, { RTP_MIDI_MANU_LONG_FM7_INC, "FM7 Inc" }, { RTP_MIDI_MANU_LONG_SWIVEL_SYSTEMS, "Swivel Systems" }, { RTP_MIDI_MANU_LONG_HYPERACTIVE_AUDIO_SYSTEMS, "Hyperactive Audio Systems" }, { RTP_MIDI_MANU_LONG_MIDILITE_CASTE_STUDIO_PROD, "MidiLite (Castle Studios Productions)" }, { RTP_MIDI_MANU_LONG_RADIKAL_TECHNOLOGIES, "Radikal Technologies" }, { RTP_MIDI_MANU_LONG_ROGER_LINN_DESIGN, "Roger Linn Design" }, { RTP_MIDI_MANU_LONG_TCHELION_VOCAL_TECHNOLOGIES, "TC-Helicon Vocal Technologies" }, { RTP_MIDI_MANU_LONG_EVENT_ELECTRONICS, "Event Electronics" }, { RTP_MIDI_MANU_LONG_SONIC_NETWORK_INC, "Sonic Network Inc" }, { RTP_MIDI_MANU_LONG_REALTIME_MUSIC_SOLUTIONS, "Realtime Music Solutions" }, { RTP_MIDI_MANU_LONG_APOGEE_DIGITAL, "Apogee Digital" }, { RTP_MIDI_MANU_LONG_CLASSICAL_ORGANS_INC, "Classical Organs, Inc" }, { RTP_MIDI_MANU_LONG_MICROTOOLS_INC, "Microtools Inc" }, { RTP_MIDI_MANU_LONG_NUMARK_INDUSTRIES, "Numark Industries" }, { RTP_MIDI_MANU_LONG_FRONTIER_DESIGN_GROUP_LLC, "Frontier Design Group LLC" }, { RTP_MIDI_MANU_LONG_RECORDARE_LLC, "Recordare LLC" }, { RTP_MIDI_MANU_LONG_STARR_LABS, "Starr Labs" }, { RTP_MIDI_MANU_LONG_VOYAGER_SOUND_INC, "Voyager Sound Inc" }, { RTP_MIDI_MANU_LONG_MANIFOLD_LABS, "Manifold Labs" }, { RTP_MIDI_MANU_LONG_AVIOM_INC, "Aviom Inc" }, { RTP_MIDI_MANU_LONG_MIXMEISTER_TECHNOLOGY, "Mixmeister Technology" }, { RTP_MIDI_MANU_LONG_NOTATION_SOFTWARE, "Notation Software" }, { RTP_MIDI_MANU_LONG_MERCURIAL_COMMUNICATIONS, "Mercurial Communications" }, { RTP_MIDI_MANU_LONG_WAVE_ARTS, "Wave Arts" }, { RTP_MIDI_MANU_LONG_LOGIC_SEQUENCING_DEVICES, "Logic Sequencing Devices" }, { RTP_MIDI_MANU_LONG_AXESS_ELECTRONICS, "Axess Electronics" }, { RTP_MIDI_MANU_LONG_MUSE_RESEARCH, "Muse Research" }, { RTP_MIDI_MANU_LONG_OPEN_LABS, "Open Labs" }, { RTP_MIDI_MANU_LONG_GUILLEMOT_RD_INC, "Guillemot R&D Inc" }, { RTP_MIDI_MANU_LONG_SAMSON_TECHNOLOGIES, "Samson Technologies" }, { RTP_MIDI_MANU_LONG_ELECTRONIC_THEATRE_CONTROLS, "Electronic Theatre Controls" }, { RTP_MIDI_MANU_LONG_RESEARCH_IN_MOTION, "Research In Motion" }, { RTP_MIDI_MANU_LONG_MOBILEER, "Mobileer" }, { RTP_MIDI_MANU_LONG_SYNTHOGY, "Synthogy" }, { RTP_MIDI_MANU_LONG_LYNX_STUDIO_TECHNOLOGY_INC, "Lynx Studio Technology Inc" }, { RTP_MIDI_MANU_LONG_DAMAGE_CONTROL_ENGINEERING, "Damage Control Engineering LLC" }, { RTP_MIDI_MANU_LONG_YOST_ENGINEERING_INC, "Yost Engineering Inc" }, { RTP_MIDI_MANU_LONG_BROOKS_FORSMAN_DESIGNS_LLC, "Brooks & Forsman Designs LLC" }, { RTP_MIDI_MANU_LONG_MAGNEKEY, "Magnekey" }, { RTP_MIDI_MANU_LONG_GARRITAN_CORP, "Garritan Corp" }, { RTP_MIDI_MANU_LONG_PLOQUE_ART_ET_TECHNOLOGIE, "Ploque Art et Technologie, Inc" }, { RTP_MIDI_MANU_LONG_RJM_MUSIC_TECHNOLOGY, "RJM Music Technology" }, { RTP_MIDI_MANU_LONG_CUSTOM_SOLUTIONS_SOFTWARE, "Custom Solutions Software" }, { RTP_MIDI_MANU_LONG_SONARCANA_LLC, "Sonarcana LLC" }, { RTP_MIDI_MANU_LONG_CENTRANCE, "Centrance" }, { RTP_MIDI_MANU_LONG_KESUMO_LLC, "Kesumo LLC" }, { RTP_MIDI_MANU_LONG_STANTON, "Stanton" }, { RTP_MIDI_MANU_LONG_LIVID_INSTRUMENTS, "Livid Instruments" }, { RTP_MIDI_MANU_LONG_FIRST_ACT_745_MEDIA, "First Act / 745 Media" }, { RTP_MIDI_MANU_LONG_PYGRAPHICS_INC, "Pygraphics, Inc" }, { RTP_MIDI_MANU_LONG_PANADIGM_INNOVATIONS_LTD, "Panadigm Innovations Ltd" }, { RTP_MIDI_MANU_LONG_AVEDIS_ZILDJIAN_CO, "Avedis Zildjian Co" }, { RTP_MIDI_MANU_LONG_AUVITAL_MUSIC_CORP, "Auvital Music Corp" }, { RTP_MIDI_MANU_LONG_INSPIRED_INSTRUMENTS_INC, "Inspired Instruments Inc" }, { RTP_MIDI_MANU_LONG_CHRIS_GRIGG_DESIGNS, "Chris Grigg Designs" }, { RTP_MIDI_MANU_LONG_SLATE_DIGITAL_LLC, "Slate Digital LLC" }, { RTP_MIDI_MANU_LONG_MIXWARE, "Mixware" }, { RTP_MIDI_MANU_LONG_SOCIAL_ENTROPY, "Social Entropy" }, { RTP_MIDI_MANU_LONG_SOURCE_AUDIO_LLC, "Source Audio LLC" }, { RTP_MIDI_MANU_LONG_RESERVED_016d, "reserved" }, { RTP_MIDI_MANU_LONG_RESERVED_016e, "reserved" }, { RTP_MIDI_MANU_LONG_RESERVED_016f, "reserved" }, { RTP_MIDI_MANU_LONG_AMERICAN_AUDIO_DJ, "American Audio/DJ" }, { RTP_MIDI_MANU_LONG_MEGA_CONTROL_SYSTEMS, "Mega Control Systems" }, { RTP_MIDI_MANU_LONG_KILPATRICK_AUDIO, "Kilpatrick Audio" }, { RTP_MIDI_MANU_LONG_IKINGDOM_CORP, "iKingdom Corp" }, { RTP_MIDI_MANU_LONG_FRACTAL_AUDIO, "Fractal Audio" }, { RTP_MIDI_MANU_LONG_NETLOGIC_MICROSYSTEMS, "NetLogic Microsystems" }, { RTP_MIDI_MANU_LONG_MUSIC_COMPUTING, "Music Computing" }, { RTP_MIDI_MANU_LONG_NEKTAR_TECHNOLOGY_INC, "Nektar Technology Inc" }, { RTP_MIDI_MANU_LONG_ZENPH_SOUND_INNOVATIONS, "Zenph Sound Innovations" }, { RTP_MIDI_MANU_LONG_DJTECHTOOLS_COM, "DJTechTools.com" }, { RTP_MIDI_MANU_LONG_RESERVED_017a, "reserved" }, /* European Manufacturers */ { RTP_MIDI_MANU_LONG_DREAM, "Dream" }, { RTP_MIDI_MANU_LONG_STRAND_LIGHTING, "Strand Lighting" }, { RTP_MIDI_MANU_LONG_AMEK_SYSTEMS, "Amek Systems" }, { RTP_MIDI_MANU_LONG_CASA_DI_RISPARMIO_DI_LORETO, "Cas Di Risparmio Di Loreto" }, { RTP_MIDI_MANU_LONG_BOHM_ELECTRONIC, "Bohm electronic" }, { RTP_MIDI_MANU_LONG_SYNTEC_DIGITAL_AUDIO, "Syntec Digital Audio" }, { RTP_MIDI_MANU_LONG_TRIDENT_AUDIO, "Trident Audio" }, { RTP_MIDI_MANU_LONG_REAL_WORLD_STUDIO, "Real World Studio" }, { RTP_MIDI_MANU_LONG_EVOLUTION_SYNTHESIS, "Evolution Synthesis" }, { RTP_MIDI_MANU_LONG_YES_TECHNOLOGY, "Yes Technology" }, { RTP_MIDI_MANU_LONG_AUDIOMATICA, "Audiomatica" }, { RTP_MIDI_MANU_LONG_BONTEMPI_FARFISA, "Bontempi / Farfisa" }, { RTP_MIDI_MANU_LONG_FBT_ELETTRONICA, "F.B.T. Elettronica" }, { RTP_MIDI_MANU_LONG_MIDITEMP, "Miditemp" }, { RTP_MIDI_MANU_LONG_LA_AUDIO_LARKING_AUDIO, "LA Audio (Larking Audio)" }, { RTP_MIDI_MANU_LONG_ZERO_88_LIGHTING_LIMITED, "Zero 88 Lighting Limited" }, { RTP_MIDI_MANU_LONG_MICON_AUDIO_ELECTRONICS_GMBH, "Micon Audio Electronics GmbH" }, { RTP_MIDI_MANU_LONG_FOREFRONT_TECHNOLOGY, "Forefront Technology" }, { RTP_MIDI_MANU_LONG_STUDIO_AUDIO_AND_VIDEO_LTD, "Studio Audio and Video Ltd" }, { RTP_MIDI_MANU_LONG_KENTON_ELECTRONICS, "Kenton Electronics" }, { RTP_MIDI_MANU_LONG_CELCO_DIVISON_OF_ELECTRONICS, "Celco Division of Electrosonic" }, { RTP_MIDI_MANU_LONG_ADB, "ADB" }, { RTP_MIDI_MANU_LONG_MARSHALL_PRODUCTS, "Marshall Products" }, { RTP_MIDI_MANU_LONG_DDA, "DDA" }, { RTP_MIDI_MANU_LONG_BBS, "BSS" }, { RTP_MIDI_MANU_LONG_MA_LIGHTING_TECHNOLOGY, "MA Lighting Technology" }, { RTP_MIDI_MANU_LONG_FATAR, "Fatar" }, { RTP_MIDI_MANU_LONG_QSC_AUDIO, "QSC Audio" }, { RTP_MIDI_MANU_LONG_ARTISAN_CLASSIC_ORGAN, "Artisan Classic Organ" }, { RTP_MIDI_MANU_LONG_ORLA_SPA, "Rola Spa" }, { RTP_MIDI_MANU_LONG_PINNACLE_AUDIO, "Pinnacle Audio" }, { RTP_MIDI_MANU_LONG_TC_ELECTRONICS, "TC Electronics" }, { RTP_MIDI_MANU_LONG_DOEPFER_MUSIKELEKTRONIK, "Doepfer Musikelektronik" }, { RTP_MIDI_MANU_LONG_CREATIVE_TECHNOLOGY_PTE, "Creative Technology Pte" }, { RTP_MIDI_MANU_LONG_MINAMI_SEIYDDO, "Minami / Seiyddo" }, { RTP_MIDI_MANU_LONG_MIDISOFT_SAS_DI_M_CIMA, "Goldstar" }, { RTP_MIDI_MANU_LONG_SAMICK, "Samick" }, { RTP_MIDI_MANU_LONG_PENNY_AND_GILES, "Penny and Giles" }, { RTP_MIDI_MANU_LONG_ACORN_COMPUTER, "Acorn Computer" }, { RTP_MIDI_MANU_LONG_LSC_ELECTRONICS, "LSC Electronics" }, { RTP_MIDI_MANU_LONG_NOVATION_EMS, "Novation EMS" }, { RTP_MIDI_MANU_LONG_SAMKYUNG_MECHATRONICS, "Samkyung Mechatronics" }, { RTP_MIDI_MANU_LONG_MEDELI_ELECTRONICS_CO, "Medeli Electronics Co" }, { RTP_MIDI_MANU_LONG_CHARLIE_LAB_SRL, "Charlie Lab SRL" }, { RTP_MIDI_MANU_LONG_BLUE_CHIP_MUSIC_TECHNOLOGY, "Blue Chip Music Technology" }, { RTP_MIDI_MANU_LONG_BEE_OH_CORP, "BEE OH Corp" }, { RTP_MIDI_MANU_LONG_LG_SEMICON_AMERICA, "LG Semicon America" }, { RTP_MIDI_MANU_LONG_TESI, "TESI" }, { RTP_MIDI_MANU_LONG_EMAGIC, "EMAGIC" }, { RTP_MIDI_MANU_LONG_BEHRINGER_GMBH, "Behringer GmbH" }, { RTP_MIDI_MANU_LONG_ACCESS_MUSIC_ELECTRONICS, "Access Music Electronics" }, { RTP_MIDI_MANU_LONG_SYNOPTIC, "Synoptic" }, { RTP_MIDI_MANU_LONG_HANMESOFT_CORP, "Hanmesoft Corp" }, { RTP_MIDI_MANU_LONG_TERRATEC_ELECTRONIC_GMBH, "Terratec Electronic GmbH" }, { RTP_MIDI_MANU_LONG_PROEL_SPA, "Proel SpA" }, { RTP_MIDI_MANU_LONG_IBK_MIDI, "IBK MIDI" }, { RTP_MIDI_MANU_LONG_IRCAM, "IRCAM" }, { RTP_MIDI_MANU_LONG_PROPELLERHEAD_SOFTWARE, "Propellerhead Software" }, { RTP_MIDI_MANU_LONG_RED_SOUND_SYSTEMS_LTD, "Red Sound Systems Ltd" }, { RTP_MIDI_MANU_LONG_ELEKTRON_ESI_AB, "Elektron ESI AB" }, { RTP_MIDI_MANU_LONG_SINTEFEX_AUDIO, "Sintefex Audio" }, { RTP_MIDI_MANU_LONG_MAM_MUSIC_AND_MORE, "MAM (Music and More)" }, { RTP_MIDI_MANU_LONG_AMSARO_GMBH, "Amsaro GmbH" }, { RTP_MIDI_MANU_LONG_CDS_ADVANCED_TECHNOLOGY_BV, "CDS Advanced Technology BV" }, { RTP_MIDI_MANU_LONG_TOUCHED_BY_SOUND_GMBH, "Touched By Sound GmbH" }, { RTP_MIDI_MANU_LONG_DSP_ARTS, "DSP Arts" }, { RTP_MIDI_MANU_LONG_PHIL_REES_MUSIC_TECH, "Phil Rees Music Tech" }, { RTP_MIDI_MANU_LONG_STAMER_MUSIKANLAGEN_GMBH, "Stamer Musikanlagen GmbH" }, { RTP_MIDI_MANU_LONG_MUSICAL_MUNTANER_SA_DBA, "Musical Muntaner S.A. dba Soundart" }, { RTP_MIDI_MANU_LONG_CMEXX_SOFTWARE, "C-Mexx Software" }, { RTP_MIDI_MANU_LONG_KLAVIS_TECHNOLOGIES, "Klavis Technologies" }, { RTP_MIDI_MANU_LONG_NOTEHEADS_AB, "Noteheads AB" }, { RTP_MIDI_MANU_LONG_ALGORITHMIX, "Algorithmix" }, { RTP_MIDI_MANU_LONG_SKRYDSTRUP_RD, "Skrydstrup R&D" }, { RTP_MIDI_MANU_LONG_PROFRESSIONAL_AUDIO_COMPANY, "Professional Audio Company" }, { RTP_MIDI_MANU_LONG_DBTECH_MADWAVES, "DBTECH/MadWaves" }, { RTP_MIDI_MANU_LONG_VERMONA, "Vermona" }, { RTP_MIDI_MANU_LONG_NOKIA, "Nokia" }, { RTP_MIDI_MANU_LONG_WAVE_IDEA, "Wave Idea" }, { RTP_MIDI_MANU_LONG_HARTMANN_GMBH, "Hartmann GmbH" }, { RTP_MIDI_MANU_LONG_LIONS_TRACK, "Lion's Track" }, { RTP_MIDI_MANU_LONG_ANALOGUE_SYSTEMS, "Analogue Systems" }, { RTP_MIDI_MANU_LONG_FOCAL_JMLAB, "Focal-JMlab" }, { RTP_MIDI_MANU_LONG_RINGWAY_ELECTRONICS, "Ringway Electronics" }, { RTP_MIDI_MANU_LONG_FAITH_TECHNOLOGIES_DIGIPLUG, "Faith Technologies (Digiplug)" }, { RTP_MIDI_MANU_LONG_SHOWWORKS, "Showworks" }, { RTP_MIDI_MANU_LONG_MANIKIN_ELECTRONIC, "Manikin Electronic" }, { RTP_MIDI_MANU_LONG_1_COME_TECH, "1 Come Tech" }, { RTP_MIDI_MANU_LONG_PHONIC_CORP, "Phonic Corp" }, { RTP_MIDI_MANU_LONG_LAKE_TECHNOLOGY, "Lake Technology" }, { RTP_MIDI_MANU_LONG_SILANSYS_TECHNOLOGIES, "Silansys Technologies" }, { RTP_MIDI_MANU_LONG_WINBOND_ELECTRONICS, "Winbond Electronics" }, { RTP_MIDI_MANU_LONG_CINETIX_MEDIEN_UND_INTERFACE, "Cinetix Medien und Interface GmbH" }, { RTP_MIDI_MANU_LONG_AG_SOLUTIONI_DIGITALI, "A&G Soluzioni Digitali" }, { RTP_MIDI_MANU_LONG_SEQUENTIX_MUSIC_SYSTEMS, "Sequentix Music Systems" }, { RTP_MIDI_MANU_LONG_ORAM_PRO_AUDIO, "Oram Pro Audio" }, { RTP_MIDI_MANU_LONG_BE4_LTD, "Be4 Ltd" }, { RTP_MIDI_MANU_LONG_INFECTION_MUSIC, "Infection Music" }, { RTP_MIDI_MANU_LONG_CENTRAL_MUSIC_CO_CME, "Central Music Co. (CME)" }, { RTP_MIDI_MANU_LONG_GENOQS_MACHINES, "GenoQs Machines" }, { RTP_MIDI_MANU_LONG_MEDIALON, "Medialon" }, { RTP_MIDI_MANU_LONG_WAVES_AUDIO_LTD, "Waves Audio Ltd" }, { RTP_MIDI_MANU_LONG_JERASH_LABS, "Jerash Labs" }, { RTP_MIDI_MANU_LONG_DA_FACT, "Da Fact" }, { RTP_MIDI_MANU_LONG_ELBY_DESIGNS, "Elby Designs" }, { RTP_MIDI_MANU_LONG_SPECTRAL_AUDIO, "Spectral Audio" }, { RTP_MIDI_MANU_LONG_ARTURIA, "Arturia" }, { RTP_MIDI_MANU_LONG_VIXID, "Vixid" }, { RTP_MIDI_MANU_LONG_C_THRU_MUSIC, "C-Thru Music" }, { RTP_MIDI_MANU_LONG_YA_HORNG_ELECTRONIC_CO_LTD, "Ya Horng Electronic Co LTD" }, { RTP_MIDI_MANU_LONG_SM_PRO_AUDIO, "SM Pro Audio" }, { RTP_MIDI_MANU_LONG_OTO_MACHINES, "OTO MACHINES" }, { RTP_MIDI_MANU_LONG_ELZAB_SA_G_LAB, "ELZAB S.A., G LAB" }, { RTP_MIDI_MANU_LONG_BLACKSTAR_AMPLIFICATION_LTD, "Blackstar Amplification Ltd" }, { RTP_MIDI_MANU_LONG_M3I_TECHNOLOGIES_GMBH, "M3i Technologies GmbH" }, { RTP_MIDI_MANU_LONG_GEMALTO, "Gemalto" }, { RTP_MIDI_MANU_LONG_PROSTAGE_SL, "Prostage SL" }, { RTP_MIDI_MANU_LONG_TEENAGE_ENGINEERING, "Teenage Engineering" }, { RTP_MIDI_MANU_LONG_TOBIAS_ERICHSEN, "Tobias Erichsen" }, { RTP_MIDI_MANU_LONG_NIXER_LTD, "Nixer Ltd" }, { RTP_MIDI_MANU_LONG_HANPIN_ELECTRON_CO_LTD, "Hanpin Electron Co Ltd" }, { RTP_MIDI_MANU_LONG_MIDI_HARDWARE_R_SOWA, "MIDI-hardware R.Sowa" }, { RTP_MIDI_MANU_LONG_BEYOND_MUSIC_INDUSTRIAL_LTD, "Beyond Music Industrial Ltd" }, { RTP_MIDI_MANU_LONG_KISS_BOX_BV, "Kiss Box B.V." }, { RTP_MIDI_MANU_LONG_MISA_DIGITAL_TECHNOLOGIES_LTD, "Misa Digital Technologies Ltd" }, { RTP_MIDI_MANU_LONG_AI_MUSICS_TECHNOLOGY_INC, "AI Musics Technology Inc" }, { RTP_MIDI_MANU_LONG_SERATO_INC_LP, "Serato Inc LP" }, { RTP_MIDI_MANU_LONG_LIMEX_MUSIC_HANDLES_GMBH, "Limex Music Handles GmbH" }, { RTP_MIDI_MANU_LONG_KYODDAY_TOKAI, "Kyodday/Tokai" }, { RTP_MIDI_MANU_LONG_MUTABLE_INSTRUMENTS, "Mutable Instruments" }, { RTP_MIDI_MANU_LONG_PRESONUS_SOFTWARE_LTD, "PreSonus Software Ltd" }, { RTP_MIDI_MANU_LONG_XIRING, "Xiring" }, { RTP_MIDI_MANU_LONG_FAIRLIGHT_INTRUMENTS_PTY_LTD, "Fairlight Instruments Pty Ltd" }, { RTP_MIDI_MANU_LONG_MUSICOM_LAB, "Musicom Lab" }, { RTP_MIDI_MANU_LONG_VACO_LOCO, "VacoLoco" }, { RTP_MIDI_MANU_LONG_RWA_HONG_KONG_LIMITED, "RWA (Hong Kong) Limited" }, /* Japanese Manufacturers */ { RTP_MIDI_MANU_LONG_CRIMSON_TECHNOLOGY_INC, "Crimson Technology Inc" }, { RTP_MIDI_MANU_LONG_SOFTBANK_MOBILE_CORP, "Softbank Mobile Corp" }, { RTP_MIDI_MANU_LONG_DM_HOLDINGS_INC, "D&M Holdings Inc." }, { 0, NULL } }; static value_string_ext rtp_midi_manu_long_values_ext = VALUE_STRING_EXT_INIT(rtp_midi_manu_long_values); static const value_string rtp_midi_channels[] = { { RTP_MIDI_CHANNEL_1, "Channel 1" }, { RTP_MIDI_CHANNEL_2, "Channel 2" }, { RTP_MIDI_CHANNEL_3, "Channel 3" }, { RTP_MIDI_CHANNEL_4, "Channel 4" }, { RTP_MIDI_CHANNEL_5, "Channel 5" }, { RTP_MIDI_CHANNEL_6, "Channel 6" }, { RTP_MIDI_CHANNEL_7, "Channel 7" }, { RTP_MIDI_CHANNEL_8, "Channel 8" }, { RTP_MIDI_CHANNEL_9, "Channel 9" }, { RTP_MIDI_CHANNEL_10, "Channel 10" }, { RTP_MIDI_CHANNEL_11, "Channel 11" }, { RTP_MIDI_CHANNEL_12, "Channel 12" }, { RTP_MIDI_CHANNEL_13, "Channel 13" }, { RTP_MIDI_CHANNEL_14, "Channel 14" }, { RTP_MIDI_CHANNEL_15, "Channel 15" }, { RTP_MIDI_CHANNEL_16, "Channel 16" }, { 0, NULL } }; static const char rtp_midi_channel_status_special_off[] = "Note Off*"; static const char rtp_midi_common_status_sysex_segment_end[] = "End of Sysex-Segment"; static const char rtp_midi_common_status_sysex_segment_start[] = "Start of Sysex-Segment"; static const char rtp_midi_common_status_sysex_segment[] = "Middle Sysex-Segment"; static const char rtp_midi_common_status_sysex_segment_complete[] = "Full Sysex-Command"; static const char rtp_midi_common_status_sysex_cancel[] = "Sysex-Cancel"; static const value_string rtp_midi_channel_status[] = { /* Channel */ { RTP_MIDI_STATUS_CHANNEL_NOTE_OFF, "Note Off" }, { RTP_MIDI_STATUS_CHANNEL_NOTE_ON, "Note On" }, { RTP_MIDI_STATUS_CHANNEL_POLYPHONIC_KEY_PRESSURE, "Polyphonic Key Pressure" }, { RTP_MIDI_STATUS_CHANNEL_CONTROL_CHANGE, "Control Change" }, { RTP_MIDI_STATUS_CHANNEL_PROGRAM_CHANGE, "Program Change" }, { RTP_MIDI_STATUS_CHANNEL_CHANNEL_PRESSURE, "Channel Pressure" }, { RTP_MIDI_STATUS_CHANNEL_PITCH_BEND_CHANGE, "Pitch Bend Change" }, { 0, NULL } }; static const value_string rtp_midi_common_status[] = { /* Common 0xf0 - 0xf7 */ { RTP_MIDI_STATUS_COMMON_SYSEX_START, "SOX: Start Of System-Exclusive / End of System-Exclusive Segment" }, { RTP_MIDI_STATUS_COMMON_MTC_QUARTER_FRAME, "MTC Quarter Frame" }, { RTP_MIDI_STATUS_COMMON_SONG_POSITION_POINTER, "Song Position Pointer" }, { RTP_MIDI_STATUS_COMMON_SONG_SELECT, "Song Select" }, { RTP_MIDI_STATUS_COMMON_UNDEFINED_F4, "Systems Exclusive Cancel" }, /* not defined, special use in RTP-MIDI */ { RTP_MIDI_STATUS_COMMON_UNDEFINED_F5, "Undefined 0xf5" }, /* not defined */ { RTP_MIDI_STATUS_COMMON_TUNE_REQUEST, "Tune Request" }, { RTP_MIDI_STATUS_COMMON_SYSEX_END, "EOX: Start of System-Exclusive Segment / End of System-Exclusive" }, /* Realtime 0xf8 - 0xff */ { RTP_MIDI_STATUS_COMMON_REALTIME_TIMING_CLOCK, "RT: Timing Clock" }, { RTP_MIDI_STATUS_COMMON_REALTIME_MIDI_TICK, "RT: Midi Tick" }, /* undefined ??? */ { RTP_MIDI_STATUS_COMMON_REALTIME_START, "RT: Start" }, { RTP_MIDI_STATUS_COMMON_REALTIME_CONTINUE, "RT: Continue" }, { RTP_MIDI_STATUS_COMMON_REALTIME_STOP, "RT: Stop" }, { RTP_MIDI_STATUS_COMMON_REALTIME_UNDEFINED_FD, "RT: Undefined 0xfd" }, { RTP_MIDI_STATUS_COMMON_REALTIME_ACTIVE_SENSING, "RT: Active sensing" }, { RTP_MIDI_STATUS_COMMON_REALTIME_SYSTEM_RESET, "RT: Systems reset" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_rt_mtc_cue[] = { { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_SPECIAL, "Special" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_PUNCH_IN_POINTS, "Punch In Points" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_PUNCH_OUT_POINTS, "Punch Out Points" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_03, "(Reserved 0x03)" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_04, "(Reserved 0x04)" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_START_POINTS, "Event Start Points" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_STOP_POINTS, "Event Stop Points" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_START_POINTS_ADD, "Event Start Points with additional Info" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_STOP_POINTS_ADD, "Event Stop Points with additional Info" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_09, "(Reserved 0x09)" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_0A, "(Reserved 0x0a)" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_CUE_POINTS, "Cue Points" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_CUE_POINTS_ADD, "Cue Points with additional Info" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_RESERVED_0D, "(Reserved 0x0d)" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUE_EVENT_NAME_ADD, "Event Name in additional Info" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_mtc[] = { { RTP_MIDI_SYSEX_COMMON_NRT_MTC_SPECIAL, "Special" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_PUNCH_IN_POINTS, "Punch In Points" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_PUNGH_OUT_POINTS, "Punch Out Points" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_PUNCH_IN_POINTS, "Delete Punch In Points" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_PUNCH_OUT_POINTS, "Delete Punch Out Points" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_START_POINT, "Event Start Point" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_STOP_POINT, "Event Stop Point" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_START_POINT_ADD, "Event Start Point with additional Info" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_STOP_POINT_ADD, "Event Stop Point with additional Info" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_EVENT_START_POINT, "Delete Event Start Point" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_EVENT_STOP_POINT, "Delete Event Stop Point" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_CUE_POINTS, "Cue Points" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_CUE_POINTS_ADD, "Cue Points with additional Info" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_DELETE_CUE_POINT, "Delete Cue Point" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC_EVENT_NAME_IN_ADD, "Event Name in additional Info" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_sd_ext[] = { { RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINT_TRANSMISSION, "Loop Point Transmission" }, { RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINTS_REQUEST, "Loop Points Request" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_sd_lt[] = { { RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LP_UNI, "Forwards only (unidirectional)" }, { RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LP_BI, "Backwards/Forwards (bi-directional)" }, { RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LP_OFF, "Off" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_gi[] = { { RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REQUEST, "Identity Request" }, { RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REPLY, "Identity Reply" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_fd[] = { { RTP_MIDI_SYSEX_COMMON_NRT_FD_HEADER, "Header" }, { RTP_MIDI_SYSEX_COMMON_NRT_FD_DATA_PACKET, "Data Packet" }, { RTP_MIDI_SYSEX_COMMON_NRT_FD_REQUEST, "Request" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_tuning[] = { { RTP_MIDI_SYSEX_COMMON_TUNING_BULK_DUMP_REQUEST, "Bulk Dump Request" }, { RTP_MIDI_SYSEX_COMMON_TUNING_BULK_DUMP_REPLY, "Bulk Dump Reply" }, { RTP_MIDI_SYSEX_COMMON_TUNING_NOTE_CHANGE, "Note Change" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_gm[] = { { RTP_MIDI_SYSEX_COMMON_NRT_GM_ON, "General MIDI System On" }, { RTP_MIDI_SYSEX_COMMON_NRT_GM_OFF, "General MIDI System Off" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt_dls[] = { { RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_ON, "DLS Level 1 On" }, { RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_OFF, "DLS Level 1 Off" }, { RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_VOICE_ALLOCATION_OFF, "DLS Level 1 Voice Allocation Off" }, { RTP_MIDI_SYSEX_COMMON_NRT_DLS_LEVEL1_VOICE_ALLOCATION_ON, "DLS Level 1 Voice Allocation On" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_rt_mtc[] = { { RTP_MIDI_SYSEX_COMMON_RT_MTC_FULL_MESSAGE, "Full Message" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_USER_BITS, "User Bits" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_rt_show_control[] = { { RTP_MIDI_SYSEX_COMMON_RT_SCL_EXTENSIONS, "Extensions" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_LIGHTING, "Lighting (General Category)" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_MOVING_LIGHTS, "Moving Lights" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_COLOR_CHANGERS, "Color Changers" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_STROBES, "Strobes" }, { RTP_MIDI_SYSEX_COMMON_RT_SCL_LASERS, "Lasers" }, { RTP_MIDI_SYSEX_COMMON_RT_SCL_CHASERS, "Chasers" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_SOUND, "Sound (General Category)" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_MUSIC, "Music" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_CD_PLAYERS, "CD Players" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_EPROM_PLAYBACK, "EPROM Playback" }, { RTP_MIDI_SYSEX_COMMON_RT_SCL_AUDIO_TAPE_MACHINE, "Audio Tape Machine" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_INTERCOMS, "Intercoms" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_AMPLIFIERS, "Amplifiers" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_AUDIO_EFFECTS, "Audio Effects Devices" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_EQUALIZERS, "Equalizers" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_MACHINERY, "Machinery (General Category" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_RIGGING, "Rigging" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_FLYS, "Flys" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_LIFTS, "Lifts" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_TURNTABLES, "Turntables" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_TRUSSES, "Trusses" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_ROBOTS, "Robots" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_ANIMATION, "Animation" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_FLOATS, "Floats" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_BREAKAWAYS, "Breakaways" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_BARGES, "Barges" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO, "Video (General Category" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_TAPE_MACHINES, "Video Tape Machines" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_CASSETTE_MACHINES, "Video Cassette Machines" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_DISC_PLAYERS, "Video Disc Players" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_SWITCHERS, "Video Switchers" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_EFFECT, "Video Effects" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_CHARACTER_GENERATORS, "Video Character Generators" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_STIL_STORES, "Video Still Stores" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_MONITORS, "Video Monitors" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_PROJECTION, "Projections (General)" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_FILM_PROJECTORS, "Film Projectors" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_SLIDE_PROJECTORS, "Slide Projectors" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_VIDEO_PROJECTORS, "Video Projectors" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_DISSOLVERS, "Dissolvers" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_SHUTTER_CONTROLS, "Shutter Controls" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_PROCESS_CONTROL, "Process Control (General)" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_HYDRAULIC_OIL, "Hydraulic Oil" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_H2O, "H2O" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_CO2, "CO2" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_COMPRESSED_AIR, "Compressed Air" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_NATURAL_GAS, "Natural Gas" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_FOG, "Fog" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_SMOKE, "Smoke" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_CRACKED_HAZE, "Cracked Haze" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_PYRO, "Pyro (General Category)" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_FIREWORKS, "Fireworks" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_EXPLOSIONS, "Explosions" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_FLAME, "Flame" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_SMOKE_POTS, "Smoke Pots" }, { RTP_MIDI_SYSEX_COMMON_RT_SC_ALL_TYPES, "All Types" }, { 0, NULL } }; static value_string_ext rtp_midi_sysex_common_rt_show_control_ext = VALUE_STRING_EXT_INIT(rtp_midi_sysex_common_rt_show_control); static const value_string rtp_midi_sysex_common_rt_notations[] = { { RTP_MIDI_SYSEX_COMMON_RT_NT_BAR_NUMBER, "Bar Number" }, { RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_IMMEDIATE, "Time Signature (Immediate)" }, { RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_DELAYED, "Time Signature (Delayed)" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_rt_device_control[] = { { RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_VOLUME, "Master Volume" }, { RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_BALANCE, "Master Balance" }, { 0, NULL } }; /* TODO: Add MMC Commands */ static const value_string rtp_midi_sysex_common_rt_mmc_commands[] = { { 0, NULL } }; /* TODO: Add MMC Responses */ static const value_string rtp_midi_sysex_common_rt_mmc_responses[] = { { 0, NULL } }; static const value_string rtp_midi_sysex_common_nrt[] = { { RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_HEADER, "Common NRT: Sample Dump Header" }, { RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DATA_PACKET, "Common NRT: Sample Data Packet" }, { RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_REQUEST, "Common NRT: Sample Dump Request" }, { RTP_MIDI_SYSEX_COMMON_NRT_MTC, "Common NRT: MIDI Time Code (MTC)" }, { RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_EXTENSIONS, "Common NRT: Sample Dump Extensions" }, { RTP_MIDI_SYSEX_COMMON_NRT_GENERAL_INFORMATION, "Common NRT: General Information" }, { RTP_MIDI_SYSEX_COMMON_NRT_FILE_DUMP, "Common NRT: File Dump" }, { RTP_MIDI_SYSEX_COMMON_NRT_MIDI_TUNING_STANDARD, "Common NRT: Midi Tuning Standard" }, { RTP_MIDI_SYSEX_COMMON_NRT_GENERAL_MIDI, "Common NRT: General MIDI (GM)" }, { RTP_MIDI_SYSEX_COMMON_NRT_DOWNLOADABLE_SOUNDS, "Common NRT: Downloadable Sounds (DLS)" }, { RTP_MIDI_SYSEX_COMMON_NRT_END_OF_FILE, "Common NRT: End Of File" }, { RTP_MIDI_SYSEX_COMMON_NRT_WAIT, "Common NRT: Wait" }, { RTP_MIDI_SYSEX_COMMON_NRT_CANCEL, "Common NRT: Cancel" }, { RTP_MIDI_SYSEX_COMMON_NRT_NAK, "Common NRT: NAK" }, { RTP_MIDI_SYSEX_COMMON_NRT_ACK, "Common NRT: ACK" }, { 0, NULL } }; static const value_string rtp_midi_sysex_common_rt[] = { { RTP_MIDI_SYSEX_COMMON_RT_MIDI_TIME_CODE, "Common RT: MIDI Time Code (MTC)" }, { RTP_MIDI_SYSEX_COMMON_RT_MIDI_SHOW_CONTROL, "Common RT: MIDI Show Control" }, { RTP_MIDI_SYSEX_COMMON_RT_NOTATION_INFORMATION, "Common RT: Notation Information" }, { RTP_MIDI_SYSEX_COMMON_RT_DEVICE_CONTROL, "Common RT: Device Control" }, { RTP_MIDI_SYSEX_COMMON_RT_MTC_CUEING, "Common RT: Real Time MTC Cueing" }, { RTP_MIDI_SYSEX_COMMON_RT_MIDI_MACHINE_CONTROL_COMMAND, "Common RT: MIDI Machine Control Command" }, { RTP_MIDI_SYSEX_COMMON_RT_MIDI_MACHINE_CONTROL_RESPONSE, "Common RT: MIDI Machine Control Response" }, { RTP_MIDI_SYSEX_COMMON_RT_MIDI_TUNING_STANDARD, "Common RT: MIDI Tuning Standard" }, { 0, NULL } }; static const value_string rtp_midi_js_tot_channels[] = { { 0, "1 channel" }, { 1, "2 channels" }, { 2, "3 channels" }, { 3, "4 channels" }, { 4, "5 channels" }, { 5, "6 channels" }, { 6, "7 channels" }, { 7, "8 channels" }, { 8, "9 channels" }, { 9, "10 channels" }, { 10, "11 channels" }, { 11, "12 channels" }, { 12, "13 channels" }, { 13, "14 channels" }, { 14, "15 channels" }, { 15, "16 channels" }, { 0, NULL } }; static const value_string rtp_midi_qft_values[] = { { RTP_MIDI_COMMON_MTC_QF_FRAME_LS_NIBBLE, "Frame count LS nibble" }, { RTP_MIDI_COMMON_MTC_QF_FRAME_MS_NIBBLE, "Frame count MS nibble" }, { RTP_MIDI_COMMON_MTC_QF_SECONDS_LS_NIBBLE, "Seconds count LS nibble" }, { RTP_MIDI_COMMON_MTC_QF_SECONDS_MS_NIBBLE, "Seconds count MS nibble" }, { RTP_MIDI_COMMON_MTC_QF_MINUTES_LS_NIBBLE, "Minutes count LS nibble" }, { RTP_MIDI_COMMON_MTC_QF_MINUTES_MS_NIBBLE, "Minutes count MS nibble" }, { RTP_MIDI_COMMON_MTC_QF_HOURS_LS_NIBBLE, "Hours count LS nibble" }, { RTP_MIDI_COMMON_MTC_QF_HOURS_MS_NIBBLE, "Hours count MS nibble" }, { 0, NULL } }; static const value_string rtp_midi_sj_chapter_d_syscom_dsz_values[] = { { 0, "Command has 0 octets" }, { 1, "Command has 1 octet" }, { 2, "Command has 2 octets" }, { 3, "Command has 3 or more octets" }, { 0, NULL } }; static const value_string rtp_midi_mtc_fm_type_values[] = { { 0, "24 Frames/Second" }, { 1, "25 Frames/Second" }, { 2, "30 Frames/Second (drop frame)" }, { 3, "30 Frames/Second (non-drop frame)" }, { 0, NULL } }; static const true_false_string rtp_midi_cs_flag_b= { "Long Header: 2 octets", "Short Header: 1 octet" }; static const true_false_string rtp_midi_cs_flag_j= { "Journal present", "No Journal present" }; static const true_false_string rtp_midi_cs_flag_z= { "Delta-Time present for first MIDI-command", "No Delta-Time for first MIDI-command" }; static const true_false_string rtp_midi_cs_flag_p= { "Status byte was NOT present in original MIDI-command", "Status byte was present in original MIDI-command" }; static const true_false_string rtp_midi_js_flag_y = { "System-journal present", "System-journal NOT present" }; static const true_false_string rtp_midi_js_flag_s = { "Standard journal behaviour", "Journal encodes data in preceding RTP-packet" }; static const true_false_string rtp_midi_js_flag_a = { "Channel-journal present", "Channel-journal NOT present" }; static const true_false_string rtp_midi_js_flag_h = { "Enhanced Encoding", "Standard Encoding" }; static const true_false_string rtp_midi_sj_flag_d = { "Chapter D journal present", "Chapter D journal NOT present" }; static const true_false_string rtp_midi_sj_flag_v = { "Chapter V journal present", "Chapter V journal NOT present" }; static const true_false_string rtp_midi_sj_flag_q = { "Chapter Q journal present", "Chapter Q journal NOT present" }; static const true_false_string rtp_midi_sj_flag_f = { "Chapter F journal present", "Chapter F journal NOT present" }; static const true_false_string rtp_midi_sj_flag_x = { "Chapter X journal present", "Chapter X journal NOT present" }; static const true_false_string rtp_midi_cj_flag_p = { "Chapter P journal present", "Chapter P journal NOT present" }; static const true_false_string rtp_midi_cj_flag_c = { "Chapter C journal present", "Chapter C journal NOT present" }; static const true_false_string rtp_midi_cj_flag_m = { "Chapter M journal present", "Chapter M journal NOT present" }; static const true_false_string rtp_midi_cj_flag_w = { "Chapter W journal present", "Chapter W journal NOT present" }; static const true_false_string rtp_midi_cj_flag_n = { "Chapter N journal present", "Chapter N journal NOT present" }; static const true_false_string rtp_midi_cj_flag_e = { "Chapter E journal present", "Chapter E journal NOT present" }; static const true_false_string rtp_midi_cj_flag_t = { "Chapter T journal present", "Chapter T journal NOT present" }; static const true_false_string rtp_midi_cj_flag_a = { "Chapter A journal present", "Chapter A journal NOT present" }; static const true_false_string rtp_midi_cj_chapter_c_flag_a = { "Alternative Coding", "Value Coding" }; static const true_false_string rtp_midi_cj_chapter_m_flag_p = { "Pending field is encoded", "Pending field is NOT encoded" }; static const true_false_string rtp_midi_cj_chapter_m_flag_e = { "Initiated transaction is in progress", "NO transaction in progress" }; static const true_false_string rtp_midi_cj_chapter_m_flag_u = { "All parameters are RPNs", "Parameters may include NRPNs" }; static const true_false_string rtp_midi_cj_chapter_m_flag_w = { "All parameters are NRPNs", "Parameters may include RPNs" }; static const true_false_string rtp_midi_cj_chapter_m_flag_z = { "Only LSB parameters", "Parameters may have LSB & MSB" }; static const true_false_string rtp_midi_cj_chapter_m_flag_q = { "Pending encodes NRPN MSB", "Pending encodes RPN MSB" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_q = { "NRPN parameter encoded", "RPN parameter encoded" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_j = { "ENTRY-MSB field present", "ENTRY-MSB field NOT present" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_k = { "ENTRY-LSB field present", "ENTRY-LSB field NOT present" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_l = { "A-Button field present", "A-Button field NOT present" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_m = { "C-Button field present", "C-Button field NOT present" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_n = { "Count field present", "Count field NOT present" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_t = { "Count Tool used", "Count Tool NOT used" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_v = { "Value Tool used", "Value Tool NOT used" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_r = { "Reserved-Flag set", "Reserved-Flag NOT set" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_x = { "Precedes most recent Control Change command for ctrl=121", "Does not precede most recent Control Change command for ctrl=121" }; static const true_false_string rtp_midi_cj_chapter_m_log_flag_g = { "negative value", "positive value" }; static const true_false_string rtp_midi_cj_chapter_n_log_flag_y = { "Execute Note-On", "Skip Note-On" }; static const true_false_string rtp_midi_cj_chapter_e_log_flag_v = { "Encodes Note-Off velocity", "Encodes Note-On/Off count" }; static const true_false_string rtp_midi_cj_chapter_a_log_flag_x = { "Precedes most recent Control Change command for ctrl=123-127", "Does not precede most recent Control Change command for ctrl=123-127" }; static const true_false_string rtp_midi_cj_chapter_p_log_flag_x = { "Reset all controllers received between MSB and LSB", "NO Reset all controllers received between MSB and LSB" }; static const true_false_string rtp_midi_sj_chapter_d_flag_b = { "Reset field present", "Reset field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_flag_g = { "Tune request field present", "Tune request field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_flag_h = { "Song select field present", "Song select field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_flag_j = { "Undefined system common 0xF4 field present", "Undefined system common 0xF4 field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_flag_k = { "Undefined system common 0xF5 field present", "Undefined system common 0xF5 field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_flag_y = { "Undefined system common 0xF9 field present", "Undefined system common 0xF9 field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_flag_z = { "Undefined system common 0xFD field present", "Undefined system common 0xFD field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_syscom_flag_c = { "Count field present", "Count field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_syscom_flag_v = { "Value field present", "Value field NOT present" }; static const true_false_string rtp_midi_sj_chapter_d_syscom_flag_l = { "Legal field present", "Legal field NOT present" }; static const true_false_string rtp_midi_sj_chapter_q_flag_n = { "Active Start / Continue", "NO active Start / Stop Continue" }; static const true_false_string rtp_midi_sj_chapter_q_flag_d = { "Song position already reached", "Song position yet to be reached" }; static const true_false_string rtp_midi_sj_chapter_q_flag_c = { "Clock field present", "Clock field NOT present" }; static const true_false_string rtp_midi_sj_chapter_q_flag_t = { "Timetools field present", "Timetools field NOT present" }; static const true_false_string rtp_midi_sj_chapter_f_flag_c = { "Complete field present", "Complete field NOT present" }; static const true_false_string rtp_midi_sj_chapter_f_flag_p = { "Partial field present", "Partial field NOT present" }; static const true_false_string rtp_midi_sj_chapter_f_flag_q = { "Complete field contains quarter frames", "Complete field contains full frame format" }; static const true_false_string rtp_midi_sj_chapter_f_flag_d = { "Tape head is moving reverse", "Tape head is moving forward or undefined" }; static const true_false_string rtp_midi_sj_chapter_x_flag_t = { "TCOUNT field present", "TCOUNT field NOT present" }; static const true_false_string rtp_midi_sj_chapter_x_flag_c = { "COUNT field present", "COUNT field NOT present" }; static const true_false_string rtp_midi_sj_chapter_x_flag_f = { "FIRST field present", "FIRST field NOT present" }; static const true_false_string rtp_midi_sj_chapter_x_flag_d = { "DATA field present", "DATA field not present" }; static const true_false_string rtp_midi_sj_chapter_x_flag_l = { "List Tool used", "Recency Tool used" }; static int hf_rtp_midi_bflag = -1; static int hf_rtp_midi_jflag = -1; static int hf_rtp_midi_zflag = -1; static int hf_rtp_midi_pflag = -1; static int hf_rtp_midi_shortlen = -1; static int hf_rtp_midi_longlen = -1; static int hf_rtp_midi_sflag = -1; static int hf_rtp_midi_yflag = -1; static int hf_rtp_midi_aflag = -1; static int hf_rtp_midi_hflag = -1; static int hf_rtp_midi_totchan = -1; static int hf_rtp_midi_check_seq_num = -1; static int hf_rtp_midi_deltatime1 = -1; static int hf_rtp_midi_deltatime2 = -1; static int hf_rtp_midi_deltatime3 = -1; static int hf_rtp_midi_deltatime4 = -1; static int hf_rtp_midi_channel_status = -1; static int hf_rtp_midi_common_status = -1; static int hf_rtp_midi_channel = -1; static int hf_rtp_midi_note = -1; static int hf_rtp_midi_velocity = -1; static int hf_rtp_midi_pressure = -1; static int hf_rtp_midi_controller = -1; static int hf_rtp_midi_controller_value = -1; static int hf_rtp_midi_program = -1; static int hf_rtp_midi_channel_pressure = -1; static int hf_rtp_midi_pitch_bend = -1; /* static int hf_rtp_midi_pitch_bend_truncated = -1; */ static int hf_rtp_midi_manu_short = -1; static int hf_rtp_midi_manu_long = -1; static int hf_rtp_midi_sysjour_toc_s = -1; static int hf_rtp_midi_sysjour_toc_d = -1; static int hf_rtp_midi_sysjour_toc_v = -1; static int hf_rtp_midi_sysjour_toc_q = -1; static int hf_rtp_midi_sysjour_toc_f = -1; static int hf_rtp_midi_sysjour_toc_x = -1; static int hf_rtp_midi_sysjour_len = -1; static int hf_rtp_midi_chanjour_sflag = -1; static int hf_rtp_midi_chanjour_chan = -1; static int hf_rtp_midi_chanjour_hflag = -1; static int hf_rtp_midi_chanjour_len = -1; static int hf_rtp_midi_chanjour_toc_p = -1; static int hf_rtp_midi_chanjour_toc_c = -1; static int hf_rtp_midi_chanjour_toc_m = -1; static int hf_rtp_midi_chanjour_toc_w = -1; static int hf_rtp_midi_chanjour_toc_n = -1; static int hf_rtp_midi_chanjour_toc_e = -1; static int hf_rtp_midi_chanjour_toc_t = -1; static int hf_rtp_midi_chanjour_toc_a = -1; static int hf_rtp_midi_cj_chapter_p_sflag = -1; static int hf_rtp_midi_cj_chapter_p_program = -1; static int hf_rtp_midi_cj_chapter_p_bflag = -1; static int hf_rtp_midi_cj_chapter_p_bank_msb = -1; static int hf_rtp_midi_cj_chapter_p_xflag = -1; static int hf_rtp_midi_cj_chapter_p_bank_lsb = -1; static int hf_rtp_midi_cj_chapter_c_sflag = -1; static int hf_rtp_midi_cj_chapter_c_length = -1; static int hf_rtp_midi_cj_chapter_c_number = -1; static int hf_rtp_midi_cj_chapter_c_aflag = -1; static int hf_rtp_midi_cj_chapter_c_value = -1; static int hf_rtp_midi_cj_chapter_c_tflag = -1; static int hf_rtp_midi_cj_chapter_c_alt = -1; static int hf_rtp_midi_cj_chapter_m_sflag = -1; static int hf_rtp_midi_cj_chapter_m_pflag = -1; static int hf_rtp_midi_cj_chapter_m_eflag = -1; static int hf_rtp_midi_cj_chapter_m_uflag = -1; static int hf_rtp_midi_cj_chapter_m_wflag = -1; static int hf_rtp_midi_cj_chapter_m_zflag = -1; static int hf_rtp_midi_cj_chapter_m_length = -1; static int hf_rtp_midi_cj_chapter_m_qflag = -1; static int hf_rtp_midi_cj_chapter_m_pending = -1; static int hf_rtp_midi_cj_chapter_m_log_sflag = -1; static int hf_rtp_midi_cj_chapter_m_log_pnum_lsb = -1; static int hf_rtp_midi_cj_chapter_m_log_qflag = -1; static int hf_rtp_midi_cj_chapter_m_log_pnum_msb = -1; static int hf_rtp_midi_cj_chapter_m_log_jflag = -1; static int hf_rtp_midi_cj_chapter_m_log_kflag = -1; static int hf_rtp_midi_cj_chapter_m_log_lflag = -1; static int hf_rtp_midi_cj_chapter_m_log_mflag = -1; static int hf_rtp_midi_cj_chapter_m_log_nflag = -1; static int hf_rtp_midi_cj_chapter_m_log_tflag = -1; static int hf_rtp_midi_cj_chapter_m_log_vflag = -1; static int hf_rtp_midi_cj_chapter_m_log_rflag = -1; static int hf_rtp_midi_cj_chapter_m_log_msb = -1; static int hf_rtp_midi_cj_chapter_m_log_msb_x = -1; static int hf_rtp_midi_cj_chapter_m_log_msb_entry = -1; static int hf_rtp_midi_cj_chapter_m_log_lsb = -1; static int hf_rtp_midi_cj_chapter_m_log_lsb_x = -1; static int hf_rtp_midi_cj_chapter_m_log_lsb_entry = -1; static int hf_rtp_midi_cj_chapter_m_log_a_button_g = -1; static int hf_rtp_midi_cj_chapter_m_log_a_button_x = -1; static int hf_rtp_midi_cj_chapter_m_log_a_button = -1; static int hf_rtp_midi_cj_chapter_m_log_a_button_full = -1; static int hf_rtp_midi_cj_chapter_m_log_c_button = -1; static int hf_rtp_midi_cj_chapter_m_log_c_button_g = -1; static int hf_rtp_midi_cj_chapter_m_log_c_button_r = -1; static int hf_rtp_midi_cj_chapter_m_log_c_button_full = -1; static int hf_rtp_midi_cj_chapter_m_log_count = -1; static int hf_rtp_midi_cj_chapter_m_log_count_x = -1; static int hf_rtp_midi_cj_chapter_m_log_count_full = -1; static int hf_rtp_midi_cj_chapter_w_sflag = -1; static int hf_rtp_midi_cj_chapter_w_first = -1; static int hf_rtp_midi_cj_chapter_w_rflag = -1; static int hf_rtp_midi_cj_chapter_w_second = -1; static int hf_rtp_midi_cj_chapter_n_bflag = -1; static int hf_rtp_midi_cj_chapter_n_len = -1; static int hf_rtp_midi_cj_chapter_n_low = -1; static int hf_rtp_midi_cj_chapter_n_high = -1; static int hf_rtp_midi_cj_chapter_n_log_sflag = -1; static int hf_rtp_midi_cj_chapter_n_log_notenum = -1; static int hf_rtp_midi_cj_chapter_n_log_yflag = -1; static int hf_rtp_midi_cj_chapter_n_log_velocity = -1; static int hf_rtp_midi_cj_chapter_n_log_octet = -1; static int hf_rtp_midi_cj_chapter_e_sflag = -1; static int hf_rtp_midi_cj_chapter_e_len = -1; static int hf_rtp_midi_cj_chapter_e_log_sflag = -1; static int hf_rtp_midi_cj_chapter_e_log_notenum = -1; static int hf_rtp_midi_cj_chapter_e_log_vflag = -1; static int hf_rtp_midi_cj_chapter_e_log_velocity = -1; static int hf_rtp_midi_cj_chapter_e_log_count = -1; static int hf_rtp_midi_cj_chapter_t_channel_aftertouch = -1; static int hf_rtp_midi_cj_chapter_t_sflag = -1; static int hf_rtp_midi_cj_chapter_t_pressure = -1; static int hf_rtp_midi_cj_chapter_a_sflag = -1; static int hf_rtp_midi_cj_chapter_a_len = -1; static int hf_rtp_midi_cj_chapter_a_log_sflag = -1; static int hf_rtp_midi_cj_chapter_a_log_notenum = -1; static int hf_rtp_midi_cj_chapter_a_log_xflag = -1; static int hf_rtp_midi_cj_chapter_a_log_pressure = -1; static int hf_rtp_midi_sj_chapter_v = -1; static int hf_rtp_midi_sj_chapter_v_sflag = -1; static int hf_rtp_midi_sj_chapter_v_count = -1; static int hf_rtp_midi_sj_chapter_d_simple_system_commands = -1; static int hf_rtp_midi_sj_chapter_d_sflag = -1; static int hf_rtp_midi_sj_chapter_d_bflag = -1; static int hf_rtp_midi_sj_chapter_d_gflag = -1; static int hf_rtp_midi_sj_chapter_d_hflag = -1; static int hf_rtp_midi_sj_chapter_d_jflag = -1; static int hf_rtp_midi_sj_chapter_d_kflag = -1; static int hf_rtp_midi_sj_chapter_d_yflag = -1; static int hf_rtp_midi_sj_chapter_d_zflag = -1; static int hf_rtp_midi_sj_chapter_d_reset = -1; static int hf_rtp_midi_sj_chapter_d_reset_sflag = -1; static int hf_rtp_midi_sj_chapter_d_reset_count = -1; static int hf_rtp_midi_sj_chapter_d_tune = -1; static int hf_rtp_midi_sj_chapter_d_tune_sflag = -1; static int hf_rtp_midi_sj_chapter_d_tune_count = -1; static int hf_rtp_midi_sj_chapter_d_song_sel = -1; static int hf_rtp_midi_sj_chapter_d_song_sel_sflag = -1; static int hf_rtp_midi_sj_chapter_d_song_sel_value = -1; static int hf_rtp_midi_sj_chapter_d_syscom_sflag = -1; static int hf_rtp_midi_sj_chapter_d_syscom_cflag = -1; static int hf_rtp_midi_sj_chapter_d_syscom_vflag = -1; static int hf_rtp_midi_sj_chapter_d_syscom_lflag = -1; static int hf_rtp_midi_sj_chapter_d_syscom_dsz = -1; static int hf_rtp_midi_sj_chapter_d_syscom_length = -1; static int hf_rtp_midi_sj_chapter_d_syscom_count = -1; static int hf_rtp_midi_sj_chapter_d_syscom_value = -1; static int hf_rtp_midi_sj_chapter_d_syscom_legal = -1; static int hf_rtp_midi_sj_chapter_d_syscom_data = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_sflag = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_cflag = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_lflag = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_length = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_count = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_legal = -1; static int hf_rtp_midi_sj_chapter_d_sysreal_data = -1; static int hf_rtp_midi_sj_chapter_q_sflag = -1; static int hf_rtp_midi_sj_chapter_q_nflag = -1; static int hf_rtp_midi_sj_chapter_q_dflag = -1; static int hf_rtp_midi_sj_chapter_q_cflag = -1; static int hf_rtp_midi_sj_chapter_q_tflag = -1; static int hf_rtp_midi_sj_chapter_q_top = -1; static int hf_rtp_midi_sj_chapter_q_clock = -1; static int hf_rtp_midi_sj_chapter_q_timetools = -1; static int hf_rtp_midi_sj_chapter_f_sflag = -1; static int hf_rtp_midi_sj_chapter_f_cflag = -1; static int hf_rtp_midi_sj_chapter_f_pflag = -1; static int hf_rtp_midi_sj_chapter_f_qflag = -1; static int hf_rtp_midi_sj_chapter_f_dflag = -1; static int hf_rtp_midi_sj_chapter_f_point = -1; static int hf_rtp_midi_sj_chapter_f_complete = -1; static int hf_rtp_midi_sj_chapter_f_partial = -1; static int hf_rtp_midi_sj_chapter_f_mt0 = -1; static int hf_rtp_midi_sj_chapter_f_mt1 = -1; static int hf_rtp_midi_sj_chapter_f_mt2 = -1; static int hf_rtp_midi_sj_chapter_f_mt3 = -1; static int hf_rtp_midi_sj_chapter_f_mt4 = -1; static int hf_rtp_midi_sj_chapter_f_mt5 = -1; static int hf_rtp_midi_sj_chapter_f_mt6 = -1; static int hf_rtp_midi_sj_chapter_f_mt7 = -1; static int hf_rtp_midi_sj_chapter_f_hr = -1; static int hf_rtp_midi_sj_chapter_f_mn = -1; static int hf_rtp_midi_sj_chapter_f_sc = -1; static int hf_rtp_midi_sj_chapter_f_fr = -1; static int hf_rtp_midi_sj_chapter_x_sflag = -1; static int hf_rtp_midi_sj_chapter_x_tflag = -1; static int hf_rtp_midi_sj_chapter_x_cflag = -1; static int hf_rtp_midi_sj_chapter_x_fflag = -1; static int hf_rtp_midi_sj_chapter_x_dflag = -1; static int hf_rtp_midi_sj_chapter_x_lflag = -1; static int hf_rtp_midi_sj_chapter_x_sta = -1; static int hf_rtp_midi_sj_chapter_x_tcount = -1; static int hf_rtp_midi_sj_chapter_x_count = -1; static int hf_rtp_midi_sj_chapter_x_first1 = -1; static int hf_rtp_midi_sj_chapter_x_first2 = -1; static int hf_rtp_midi_sj_chapter_x_first3 = -1; static int hf_rtp_midi_sj_chapter_x_first4 = -1; static int hf_rtp_midi_sj_chapter_x_data = -1; static int hf_rtp_midi_sj_chapter_x_invalid_data = -1; static int hf_rtp_midi_quarter_frame_type = -1; static int hf_rtp_midi_quarter_frame_value = -1; /* static int hf_rtp_midi_spp_truncated = -1; */ static int hf_rtp_midi_spp = -1; static int hf_rtp_midi_song_select = -1; static int hf_rtp_midi_manu_data = -1; static int hf_rtp_midi_edu_data = -1; static int hf_rtp_midi_unknown_data = -1; static int hf_rtp_midi_sysex_common_non_realtime = -1; static int hf_rtp_midi_sysex_common_realtime = -1; static int hf_rtp_midi_sysex_common_device_id = -1; static int hf_rtp_midi_sysex_common_nrt_mtc = -1; static int hf_rtp_midi_sysex_common_nrt_sd_ext = -1; static int hf_rtp_midi_sysex_common_nrt_gi = -1; static int hf_rtp_midi_sysex_common_nrt_fd = -1; static int hf_rtp_midi_sysex_common_tuning = -1; static int hf_rtp_midi_sysex_common_nrt_gm = -1; static int hf_rtp_midi_sysex_common_nrt_dls = -1; static int hf_rtp_midi_sysex_common_rt_mtc = -1; static int hf_rtp_midi_sysex_common_rt_sc = -1; static int hf_rtp_midi_sysex_common_rt_ni = -1; static int hf_rtp_midi_sysex_common_rt_dc = -1; static int hf_rtp_midi_sysex_common_rt_mtc_cueing = -1; static int hf_rtp_midi_sysex_common_rt_mmc_commands = -1; static int hf_rtp_midi_sysex_common_rt_mmc_responses = -1; static int hf_rtp_midi_sysex_common_nrt_gi_device_family = -1; static int hf_rtp_midi_sysex_common_nrt_gi_device_family_member = -1; static int hf_rtp_midi_sysex_common_nrt_gi_software_rev = -1; static int hf_rtp_midi_sysex_common_nrt_sd_packet_number = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_sn = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_sf = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_sp = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_sl = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_ls = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_le = -1; static int hf_rtp_midi_sysex_common_nrt_sd_header_lt = -1; static int hf_rtp_midi_sysex_common_nrt_sd_packet_count = -1; static int hf_rtp_midi_sysex_common_nrt_sd_packet_check = -1; static int hf_rtp_midi_sysex_common_nrt_sd_packet_data = -1; static int hf_rtp_midi_sysex_common_nrt_sd_ext_ln = -1; static int hf_rtp_midi_sysex_common_nrt_fd_device_id = -1; static int hf_rtp_midi_sysex_common_nrt_fd_type = -1; static int hf_rtp_midi_sysex_common_nrt_fd_name = -1; static int hf_rtp_midi_sysex_common_nrt_fd_length = -1; static int hf_rtp_midi_sysex_common_nrt_fd_packet_num = -1; static int hf_rtp_midi_sysex_common_nrt_fd_byte_count = -1; static int hf_rtp_midi_sysex_common_nrt_fd_packet_data = -1; static int hf_rtp_midi_sysex_common_nrt_fd_checksum = -1; static int hf_rtp_midi_sysex_common_tune_program = -1; static int hf_rtp_midi_sysex_common_tune_name = -1; static int hf_rtp_midi_sysex_common_tune_freq = -1; static int hf_rtp_midi_sysex_common_tune_checksum = -1; static int hf_rtp_midi_sysex_common_tune_changes = -1; static int hf_rtp_midi_sysex_common_tune_note = -1; static int hf_rtp_midi_sysex_common_rt_mtc_fm_type = -1; static int hf_rtp_midi_sysex_common_rt_mtc_fm_hr = -1; static int hf_rtp_midi_sysex_common_rt_mtc_fm_mn = -1; static int hf_rtp_midi_sysex_common_rt_mtc_fm_sc = -1; static int hf_rtp_midi_sysex_common_rt_mtc_fm_fr = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u1 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u2 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u3 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u4 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u5 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u6 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u7 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u8 = -1; static int hf_rtp_midi_sysex_common_rt_mtc_ub_u9 = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_type = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_hr = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_mn = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_sc = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_fr = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_ff = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_enl = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_enm = -1; static int hf_rtp_midi_sysex_common_nrt_mtc_add = -1; static int hf_rtp_midi_sysex_common_rt_mtc_cue_enl = -1; static int hf_rtp_midi_sysex_common_rt_mtc_cue_enm = -1; static int hf_rtp_midi_sysex_common_rt_mtc_cue_add = -1; static int hf_rtp_midi_sysex_common_rt_ni_bar_num = -1; static int hf_rtp_midi_sysex_common_rt_ni_bytes = -1; static int hf_rtp_midi_sysex_common_rt_ni_numerator = -1; static int hf_rtp_midi_sysex_common_rt_ni_denominator = -1; static int hf_rtp_midi_sysex_common_rt_ni_midi_clocks = -1; static int hf_rtp_midi_sysex_common_rt_ni_32nds = -1; static int hf_rtp_midi_sysex_common_rt_dc_volume = -1; static int hf_rtp_midi_sysex_common_rt_dc_balance = -1; /* RTP MIDI fields defining a subtree */ static gint ett_rtp_midi = -1; static gint ett_rtp_midi_commands = -1; static gint ett_rtp_midi_journal = -1; static gint ett_rtp_midi_command = -1; static gint ett_rtp_midi_systemjournal = -1; static gint ett_rtp_midi_channeljournals = -1; static gint ett_rtp_midi_systemchapters = -1; static gint ett_rtp_midi_sj_chapter_d = -1; static gint ett_rtp_midi_sj_chapter_d_field_b = -1; static gint ett_rtp_midi_sj_chapter_d_field_g = -1; static gint ett_rtp_midi_sj_chapter_d_field_h = -1; static gint ett_rtp_midi_sj_chapter_d_field_j = -1; static gint ett_rtp_midi_sj_chapter_d_field_k = -1; static gint ett_rtp_midi_sj_chapter_d_field_y = -1; static gint ett_rtp_midi_sj_chapter_d_field_z = -1; static gint ett_rtp_midi_sj_chapter_v = -1; static gint ett_rtp_midi_sj_chapter_q = -1; static gint ett_rtp_midi_sj_chapter_f = -1; static gint ett_rtp_midi_sj_chapter_f_complete = -1; static gint ett_rtp_midi_sj_chapter_f_partial = -1; static gint ett_rtp_midi_sj_chapter_x = -1; static gint ett_rtp_midi_sj_chapter_x_first = -1; static gint ett_rtp_midi_sj_chapter_x_data = -1; static gint ett_rtp_midi_channeljournal = -1; static gint ett_rtp_midi_channelchapters = -1; static gint ett_rtp_midi_cj_chapter_p = -1; static gint ett_rtp_midi_cj_chapter_c = -1; static gint ett_rtp_midi_cj_chapter_c_loglist = -1; static gint ett_rtp_midi_cj_chapter_c_logitem = -1; static gint ett_rtp_midi_cj_chapter_m = -1; static gint ett_rtp_midi_cj_chapter_m_loglist = -1; static gint ett_rtp_midi_cj_chapter_m_logitem = -1; static gint ett_rtp_midi_cj_chapter_m_log_msb = -1; static gint ett_rtp_midi_cj_chapter_m_log_lsb = -1; static gint ett_rtp_midi_cj_chapter_m_log_a_button = -1; static gint ett_rtp_midi_cj_chapter_m_log_c_button = -1; static gint ett_rtp_midi_cj_chapter_m_log_count = -1; static gint ett_rtp_midi_cj_chapter_w = -1; static gint ett_rtp_midi_cj_chapter_n = -1; static gint ett_rtp_midi_cj_chapter_n_loglist = -1; static gint ett_rtp_midi_cj_chapter_n_logitem = -1; static gint ett_rtp_midi_cj_chapter_n_octets = -1; static gint ett_rtp_midi_cj_chapter_e = -1; static gint ett_rtp_midi_cj_chapter_e_loglist = -1; static gint ett_rtp_midi_cj_chapter_e_logitem = -1; static gint ett_rtp_midi_cj_chapter_t = -1; static gint ett_rtp_midi_cj_chapter_a = -1; static gint ett_rtp_midi_cj_chapter_a_loglist = -1; static gint ett_rtp_midi_cj_chapter_a_logitem = -1; static gint ett_rtp_midi_sysex_data = -1; static gint ett_rtp_midi_sysex_edu = -1; static gint ett_rtp_midi_sysex_manu = -1; static gint ett_rtp_midi_sysex_common_rt = -1; static gint ett_rtp_midi_sysex_common_nrt = -1; static gint ett_rtp_midi_sysex_common_tune_note = -1; static int proto_rtp_midi = -1; static dissector_handle_t rtp_midi_handle; void proto_reg_handoff_rtp_midi( void ); /* * This decodes the delta-time before a MIDI-command */ static int decodetime(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset) { guint8 octet; unsigned int consumed; unsigned int i; unsigned int deltatime; consumed = 0; deltatime = 0; /* RTP-MIDI deltatime is "compressed" using only the necessary amount of octets */ for ( i=0; i < 4; i++ ) { octet = tvb_get_guint8( tvb, offset + consumed ); deltatime = ( deltatime << 7 ) | ( octet & RTP_MIDI_DELTA_TIME_OCTET_MASK ); consumed++; if ( ( octet & RTP_MIDI_DELTA_TIME_EXTENSION ) == 0 ) { break; } } switch (consumed) { case 1: proto_tree_add_uint ( tree, hf_rtp_midi_deltatime1, tvb, offset, consumed, deltatime ); break; case 2: proto_tree_add_uint ( tree, hf_rtp_midi_deltatime2, tvb, offset, consumed, deltatime ); break; case 3: proto_tree_add_uint ( tree, hf_rtp_midi_deltatime3, tvb, offset, consumed, deltatime ); break; case 4: proto_tree_add_uint ( tree, hf_rtp_midi_deltatime4, tvb, offset, consumed, deltatime ); break; } return consumed; } /* * Here a Note-Off command is decoded. */ static int decode_note_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 note; guint8 velocity; const gchar *status_str; const gchar *note_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); note = tvb_get_guint8( tvb, offset ); note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); velocity = tvb_get_guint8( tvb, offset + 1 ); if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 2, ett_rtp_midi_command, NULL, "%s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_note, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_velocity, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 3, ett_rtp_midi_command , NULL, "%s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_note, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_velocity, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); } return 2; } /* * Here a Note-On command is decoded. */ static int decode_note_on(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 note; guint8 velocity; const gchar *status_str; const gchar *note_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); note = tvb_get_guint8( tvb, offset ); note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); velocity = tvb_get_guint8( tvb, offset + 1 ); /* special case velocity=0 for Note-On means Note-Off (to preserve running-status!) */ if ( velocity == 0 ) { status_str = rtp_midi_channel_status_special_off; } if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 2, ett_rtp_midi_command, NULL, "%s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_note, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_velocity, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 3, ett_rtp_midi_command, NULL, "%s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_note, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_velocity, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, n=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, velocity ); } return 2; } /* * Here polyphonic aftertouch is decoded. */ static int decode_poly_pressure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 note; guint8 pressure; const gchar *status_str; const gchar *note_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); note = tvb_get_guint8( tvb, offset ); note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); pressure = tvb_get_guint8( tvb, offset + 1 ); if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 2, ett_rtp_midi_command, NULL, "%s (c=%d, n=%s, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, pressure ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_note, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_pressure, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 3, ett_rtp_midi_command, NULL, "%s (c=%d, n=%s, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, pressure ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_note, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_pressure, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, n=%s, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, pressure ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, n=%s, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, note_str, pressure ); } return 2; } /* * Here channel aftertouch is decoded. */ static int decode_channel_pressure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 pressure; const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); pressure = tvb_get_guint8( tvb, offset ); if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 1, ett_rtp_midi_command, NULL, "%s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pressure ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_pressure, tvb, offset, 1, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 2, ett_rtp_midi_command, NULL, "%s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pressure ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_pressure, tvb, offset, 1, ENC_BIG_ENDIAN); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pressure ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pressure ); } return 1; } /* * Here pitch-bend is decoded. */ static int decode_pitch_bend_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 octet1; guint8 octet2; guint8 pitch; const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); octet1 = tvb_get_guint8( tvb, offset ); octet2 = tvb_get_guint8( tvb, offset + 1 ); pitch = ( octet1 << 7 ) | octet2; if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 2, ett_rtp_midi_command, NULL, "%s (c=%d, pb=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pitch ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_pitch_bend, tvb, offset, 2, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 3, ett_rtp_midi_command, NULL, "%s (c=%d, pb=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pitch ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_pitch_bend, tvb, offset, 2, ENC_BIG_ENDIAN ); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, pb=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pitch ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, pb=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, pitch ); } return 2; } /* * Here program_change is decoded. */ static int decode_program_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 program; const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); program = tvb_get_guint8( tvb, offset ); if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 1, ett_rtp_midi_command, NULL, "%s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, program ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_program, tvb, offset, 1, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 2, ett_rtp_midi_command, NULL, "%s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, program ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_program, tvb, offset, 1, ENC_BIG_ENDIAN); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, program ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, program ); } return 1; } /* * Here control change is decoded. */ static int decode_control_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned int cmd_count, unsigned int offset, guint8 status, unsigned int rsoffset, gboolean using_rs ) { guint8 controller; guint8 value; const gchar *status_str; const gchar *ctrl_str; proto_tree *command_tree; status_str = val_to_str( status >> 4, rtp_midi_channel_status, rtp_midi_unknown_value_hex ); controller = tvb_get_guint8( tvb, offset ); ctrl_str = val_to_str_ext( controller, &rtp_midi_controller_values_ext, "Unknown: %d" ); value = tvb_get_guint8( tvb, offset + 1 ); if ( using_rs ) { command_tree = proto_tree_add_subtree_format( tree, tvb, offset, 2, ett_rtp_midi_command, NULL, "%s (c=%d, ctrl=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, ctrl_str, value ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, rsoffset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_controller, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_controller_value, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); } else { command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 3, ett_rtp_midi_command, NULL, "%s (c=%d, ctrl=%s, v=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, ctrl_str, value ); proto_tree_add_item( command_tree, hf_rtp_midi_channel_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_channel, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_controller, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_controller_value, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (c=%d, ctrl=%s, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, ctrl_str, value ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (c=%d, ctrl=%s, p=%d)", status_str, ( status & RTP_MIDI_CHANNEL_MASK ) + 1, ctrl_str, value ); } return 2; } /* * Here a Sysex-Common Non-Realtime Sample Dump Header command is decoded. */ static unsigned int decode_sysex_common_nrt_sd_hdr( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { unsigned int start_offset = offset; /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* sample format */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sf, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* sample period */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sp, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* sample length */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sl, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* loop start */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_ls, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* loop end */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_le, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* loop type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_lt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; return offset-start_offset; } /* * Here a Sysex-Common Non-Realtime Sample Dump Packet command is decoded. */ static unsigned int decode_sysex_common_nrt_sd_packet( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { unsigned int start_offset = offset; /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* do we have sample-data? */ if ( data_len - 1 > 1 ) { proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_data, tvb, offset, data_len - 2, ENC_NA ); offset += ( data_len - 2 ); } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_check, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; return offset-start_offset; } /* * Here a Sysex-Common Non-Realtime Sample Dump Request command is decoded. */ static unsigned int decode_sysex_common_nrt_sd_req( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset) { /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); return 2; } /* * Here a Sysex-Common Non-Realtime Sample Dump Extension command is decoded. */ static unsigned int decode_sysex_common_nrt_sd_ext( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 sub_id; unsigned int start_offset = offset; if ( data_len < 1 ) return 0; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_ext, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINT_TRANSMISSION ) { /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* loop number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_ext_ln, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* loop type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_lt, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* loop start */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_ls, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; /* loop end */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_le, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_SD_EXT_LOOP_POINTS_REQUEST ) { /* sample number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_header_sn, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* loop number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_ext_ln, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; } return offset-start_offset; } /* * Here a Sysex-Common Non-Realtime General Information command is decoded. */ static unsigned int decode_sysex_common_nrt_gi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 sub_id; int consumed = 0; if ( data_len < 1 ) return consumed; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; consumed++; /* This is the only sub-command that we know that we can decode, * the Identity Request has already been decoded up to this point. */ if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REQUEST ) { /* nothing more to do... */ } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_GI_IDENTITY_REPLY ) { guint8 manu_short; if ( data_len < 1 ) { return consumed; } /* the manu-id should follow */ proto_tree_add_item( tree, hf_rtp_midi_manu_short, tvb, offset, 1, ENC_BIG_ENDIAN ); manu_short = tvb_get_guint8( tvb, offset ); offset++; data_len--; consumed++; /* possibly escaped to be a long manu-id */ if ( manu_short == RTP_MIDI_MANU_SHORT_ISLONG ) { if ( data_len < 2 ) { return consumed; } proto_tree_add_item( tree, hf_rtp_midi_manu_long, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2 ; data_len -= 2; consumed += 2; } /* lets see if we can get the device family for this unit */ if ( data_len < 2 ) { return consumed; } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi_device_family, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2 ; data_len -= 2; consumed += 2; /* ...also get the detailed member of this family... */ if ( data_len < 2 ) { return consumed; } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi_device_family_member, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2 ; data_len -= 2; consumed += 2; /* and even the software-revision-level */ if ( data_len < 4 ) { return consumed; } proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gi_software_rev, tvb, offset, 4, ENC_BIG_ENDIAN ); consumed += 4; } return consumed; } /* * Here a Sysex-Common Non-Realtime File Dump command is decoded. */ static unsigned int decode_sysex_common_nrt_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 sub_id; unsigned int start_offset = offset; if ( data_len < 1 ) return 0; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_FD_HEADER ) { /* type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_device_id, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* file type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_type, tvb, offset, 4, ENC_ASCII ); offset += 4; data_len -= 4; /* file length */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_length, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; data_len -= 4; if ( data_len ) { /* file-name */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_name, tvb, offset, data_len, ENC_ASCII ); offset += data_len; } } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_FD_DATA_PACKET ) { /* packet-num */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_packet_num, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* byte count */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_byte_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* do we have file-data? */ if ( data_len > 1 ) { proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_packet_data, tvb, offset, data_len - 1, ENC_NA ); offset += ( data_len - 1 ); } proto_tree_add_checksum(tree, tvb, offset, hf_rtp_midi_sysex_common_nrt_fd_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset++; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_NRT_FD_REQUEST ) { /* type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_device_id, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* file type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_type, tvb, offset, 4, ENC_ASCII ); offset += 4; data_len -= 4; if ( data_len ) { /* file-name */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_fd_name, tvb, offset, data_len, ENC_ASCII ); offset += data_len; } } return offset-start_offset; } /* * Here a Sysex-Common (Non-)Realtime MIDI Tuning Standard command is decoded. * As the code-points do not overlap, both RT and NRT are decoded here... */ static unsigned int decode_sysex_common_tuning( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { proto_tree *tune_tree; const gchar *note_str; guint8 sub_id; unsigned int start_offset = offset; unsigned int i; if ( data_len < 1 ) return 0; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tuning, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( sub_id == RTP_MIDI_SYSEX_COMMON_TUNING_BULK_DUMP_REQUEST ) { /* type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tune_program, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_TUNING_BULK_DUMP_REPLY ) { /* type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tune_program, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* file length */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tune_name, tvb, offset, 16, ENC_ASCII ); offset += 16; for ( i=0; i < 128; i++ ) { note_str = val_to_str_ext( i, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); tune_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3, ett_rtp_midi_sysex_common_tune_note, NULL, "Note: %s", note_str ); /* frequency */ proto_tree_add_item( tune_tree, hf_rtp_midi_sysex_common_tune_freq, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; } /* checksum */ proto_tree_add_checksum(tree, tvb, offset, hf_rtp_midi_sysex_common_tune_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset++; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_TUNING_NOTE_CHANGE ) { guint8 changes; /* type */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tune_program, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* changes */ changes = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_tune_changes, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; for ( i=0; i < changes; i++ ) { guint8 note; note = tvb_get_guint8( tvb, offset ); note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); tune_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3, ett_rtp_midi_sysex_common_tune_note, NULL, "Note: %s", note_str ); /* note */ proto_tree_add_item( tune_tree, hf_rtp_midi_sysex_common_tune_note, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* frequency */ proto_tree_add_item( tune_tree, hf_rtp_midi_sysex_common_tune_freq, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; } } return offset-start_offset; } /* * Here a Sysex-Common Non-Realtime General MIDI command is decoded. */ static unsigned int decode_sysex_common_nrt_gm( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_gm, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * Here a Sysex-Common Non-Realtime Downloadable Sounds command is decoded. */ static unsigned int decode_sysex_common_nrt_dls( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_dls, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * Here a Sysex-Common Non-Realtime End Of File command is decoded. */ static unsigned int decode_sysex_common_nrt_eof( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; /* we only have a packet-number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_number, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * Here a Sysex-Common Non-Realtime Wait command is decoded. */ static unsigned int decode_sysex_common_nrt_wait( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; /* we only have a packet-number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_number, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * Here a Sysex-Common Non-Realtime Cancel command is decoded. */ static unsigned int decode_sysex_common_nrt_cancel( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; /* we only have a packet-number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_number, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * Here a Sysex-Common Non-Realtime NAK command is decoded. */ static unsigned int decode_sysex_common_nrt_nak( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; /* we only have a packet-number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_number, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * Here a Sysex-Common Non-Realtime ACK command is decoded. */ static unsigned int decode_sysex_common_nrt_ack( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; /* we only have a packet-number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_sd_packet_number, tvb, offset, 1, ENC_BIG_ENDIAN ); return 1; } /* * here a sysex-common non-realtime midi time code cueing command is decoded. * as the codepoints are the same, we decode both realtime and non-realtime here. */ static unsigned int decode_sysex_common_nrt_mtc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { unsigned int start_offset = offset; if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* type and hours */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_type, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_hr, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* minutes */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_mn, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* seconds */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_sc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* frames */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_fr, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* fractional frames */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_ff, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* event-number (lsb) */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_enl, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* event-number (msb) */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_enm, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; if ( data_len ) { /* additional data */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_nrt_mtc_add, tvb, offset, data_len, ENC_NA ); offset += data_len; } return offset-start_offset; } /* * Here a Sysex-Common Realtime MIDI Time Code Cueing command is decoded. * As the codepoints are the same, we decode both realtime and non-realtime here. */ static unsigned int decode_sysex_common_rt_mtc_cue( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { unsigned int start_offset = offset; if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_cueing, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* event-number (lsb) */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_cue_enl, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; /* event-number (msb) */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_cue_enm, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; if ( data_len ) { /* additional data */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_cue_add, tvb, offset, data_len, ENC_NA ); offset += data_len; } return offset-start_offset; } /* * Here a Sysex-Common Non-Realtime command is decoded. */ static unsigned int decode_sysex_common_nrt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 common_nrt; const gchar *nrt_str; proto_tree *command_tree; int consumed = 0; int ext_consumed = 0; if ( data_len < 1 ) return consumed; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_device_id, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; consumed++; if ( data_len < 1 ) { return consumed; } common_nrt = tvb_get_guint8( tvb, offset ); nrt_str = val_to_str( common_nrt, rtp_midi_sysex_common_nrt, "Unknown 0x%02x" ); command_tree = proto_tree_add_subtree(tree, tvb, offset, data_len, ett_rtp_midi_sysex_common_nrt, NULL, nrt_str ); proto_tree_add_item( command_tree, hf_rtp_midi_sysex_common_non_realtime, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; consumed++; switch ( common_nrt ) { case RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_HEADER: ext_consumed = decode_sysex_common_nrt_sd_hdr( tvb, pinfo, command_tree, offset); break; case RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DATA_PACKET: ext_consumed = decode_sysex_common_nrt_sd_packet( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_REQUEST: ext_consumed = decode_sysex_common_nrt_sd_req( tvb, pinfo, command_tree, offset); break; case RTP_MIDI_SYSEX_COMMON_NRT_MTC: ext_consumed = decode_sysex_common_nrt_mtc( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_SAMPLE_DUMP_EXTENSIONS: ext_consumed = decode_sysex_common_nrt_sd_ext( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_GENERAL_INFORMATION: ext_consumed = decode_sysex_common_nrt_gi( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_FILE_DUMP: ext_consumed = decode_sysex_common_nrt_fd( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_MIDI_TUNING_STANDARD: ext_consumed = decode_sysex_common_tuning( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_GENERAL_MIDI: ext_consumed = decode_sysex_common_nrt_gm( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_DOWNLOADABLE_SOUNDS: /* ??? not in Spec */ ext_consumed = decode_sysex_common_nrt_dls( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_END_OF_FILE: ext_consumed = decode_sysex_common_nrt_eof( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_WAIT: ext_consumed = decode_sysex_common_nrt_wait( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_CANCEL: ext_consumed = decode_sysex_common_nrt_cancel( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_NAK: ext_consumed = decode_sysex_common_nrt_nak( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_NRT_ACK: ext_consumed = decode_sysex_common_nrt_ack( tvb, pinfo, command_tree, offset, data_len ); break; } if ( ext_consumed < 0 ) { return -1; } /* set our pointers correct to move past already decoded data */ offset += ext_consumed; data_len -= ext_consumed; consumed += ext_consumed; if ( data_len > 0 ) { proto_tree_add_item( command_tree, hf_rtp_midi_unknown_data, tvb, offset, data_len, ENC_NA ); consumed += data_len; } return consumed; } /* * Here a Sysex-Common Realtime MIDI Time Code command is decoded. */ static unsigned int decode_sysex_common_rt_mtc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 sub_id; unsigned int start_offset = offset; if ( data_len < 1 ) return 0; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_MTC_FULL_MESSAGE ) { /* type and hours */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_fm_type, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_fm_hr, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* minutes */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_fm_mn, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* seconds */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_fm_sc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* frames */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_fm_fr, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_MTC_USER_BITS ) { /* U1 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u1, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U2 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u2, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U3 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u3, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U4 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u4, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U5 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u5, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U6 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u6, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U7 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u7, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U8 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u8, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* U9 */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mtc_ub_u9, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } return offset-start_offset; } /* * Here a Sysex-Common Realtime MIDI Show Control command is decoded. */ static unsigned int decode_sysex_common_rt_sc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_sc, tvb, offset, 1, ENC_BIG_ENDIAN ); /* TODO: decode Show Control stuff */ return 1; } /* * Here a Sysex-Common Realtime Notation Information command is decoded. */ static unsigned int decode_sysex_common_rt_ni( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 sub_id; unsigned int start_offset = offset; if ( data_len < 1 ) return 0; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_NT_BAR_NUMBER ) { /* bar number */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_bar_num, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; } else if ( ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_IMMEDIATE ) || ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_NT_TIME_SIGNATURE_DELAYED ) ) { int bytes; /* bytes */ bytes = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_bytes, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* beats / numerator */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_numerator, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; bytes--; /* beats / denominator */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_denominator, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; bytes--; /* clocks */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_midi_clocks, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; bytes--; /* 32nds */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_32nds, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; bytes--; while ( bytes > 0 ) { /* beats / numerator */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_numerator, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; bytes--; /* beats / denominator */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_ni_denominator, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; bytes--; } } return offset-start_offset; } /* * Here a Sysex-Common Realtime Device Control command is decoded. */ static unsigned int decode_sysex_common_rt_dc( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 sub_id; unsigned int start_offset = offset; if ( data_len < 1 ) return 0; /* first we retrieve the sub-command */ sub_id = tvb_get_guint8( tvb, offset ); proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_dc, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_VOLUME ) { /* volume */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_dc_volume, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; } else if ( sub_id == RTP_MIDI_SYSEX_COMMON_RT_DC_MASTER_BALANCE ) { /* balance */ proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_dc_balance, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; } return offset-start_offset; } /* * Here a Sysex-Common Realtime MIDI Machine Control command is decoded. */ static unsigned int decode_sysex_common_rt_mmc_command( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mmc_commands, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; /* TODO: decode MMC stuff */ return 1; } /* * Here a Sysex-Common Realtime MIDI Machine Control response is decoded. */ static unsigned int decode_sysex_common_rt_mmc_response( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { if ( data_len < 1 ) return 0; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_rt_mmc_responses, tvb, offset, 1, ENC_BIG_ENDIAN ); /* TODO: decode MMC stuff */ return 1; } /* * Here a Sysex-Common Realtime command is decoded. */ static unsigned int decode_sysex_common_rt( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { guint8 common_rt; const gchar *rt_str; proto_tree *command_tree; int consumed = 0; int ext_consumed = 0; if ( data_len < 1 ) return consumed; proto_tree_add_item( tree, hf_rtp_midi_sysex_common_device_id, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; data_len--; consumed++; if ( data_len < 1 ) { return consumed; } common_rt = tvb_get_guint8( tvb, offset ); rt_str = val_to_str( common_rt, rtp_midi_sysex_common_rt, "Unknown 0x%02x" ); command_tree = proto_tree_add_subtree(tree, tvb, offset, data_len, ett_rtp_midi_sysex_common_rt, NULL, rt_str ); proto_tree_add_item( command_tree, hf_rtp_midi_sysex_common_realtime, tvb, offset, 1, ENC_BIG_ENDIAN ); data_len--; offset++; consumed++; switch ( common_rt ) { case RTP_MIDI_SYSEX_COMMON_RT_MIDI_TIME_CODE: ext_consumed = decode_sysex_common_rt_mtc( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_MIDI_SHOW_CONTROL: ext_consumed = decode_sysex_common_rt_sc( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_NOTATION_INFORMATION: ext_consumed = decode_sysex_common_rt_ni( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_DEVICE_CONTROL: ext_consumed = decode_sysex_common_rt_dc( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_MTC_CUEING: ext_consumed = decode_sysex_common_rt_mtc_cue( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_MIDI_MACHINE_CONTROL_COMMAND: ext_consumed = decode_sysex_common_rt_mmc_command( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_MIDI_MACHINE_CONTROL_RESPONSE: ext_consumed = decode_sysex_common_rt_mmc_response( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_SYSEX_COMMON_RT_MIDI_TUNING_STANDARD: ext_consumed = decode_sysex_common_tuning( tvb, pinfo, command_tree, offset, data_len ); break; } if ( ext_consumed < 0 ) { return -1; } /* set our pointers correct to move past already decoded data */ offset += ext_consumed; data_len -= ext_consumed; consumed += ext_consumed; if ( data_len > 0 ) { proto_tree_add_item( command_tree, hf_rtp_midi_unknown_data, tvb, offset, data_len, ENC_NA ); consumed += data_len; } return consumed; } /* * Here a Sysex-Common Educational command is decoded. * According to the MIDI-specification, this should never be found "in the wild". * We don't know what this data encodes, so we just dump it. */ static unsigned int decode_sysex_common_educational( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len ) { proto_tree *command_tree; int consumed = 0; if ( data_len < 1 ) return consumed; command_tree = proto_tree_add_subtree(tree, tvb, offset, data_len, ett_rtp_midi_sysex_edu, NULL, RTP_MIDI_TREE_NAME_COMMAND_SYSEX_EDU ); proto_tree_add_item( command_tree, hf_rtp_midi_edu_data, tvb, offset, data_len, ENC_NA ); /* We consumed everything */ return data_len; } /* * Here a Sysex-Common Manufacturer command is decoded. * We don't know what this data encodes, so we just dump it. */ static unsigned int decode_sysex_common_manufacturer( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int data_len, unsigned int manu_code _U_) { proto_tree *command_tree; int consumed = 0; if ( data_len < 1 ) return consumed; /* Instead of dumping, at this point we could implement to start manufacturer-specific decoding * of the sysex-data... */ command_tree = proto_tree_add_subtree(tree, tvb, offset, data_len, ett_rtp_midi_sysex_manu, NULL, RTP_MIDI_TREE_NAME_COMMAND_SYSEX_MANU ); proto_tree_add_item( command_tree, hf_rtp_midi_manu_data, tvb, offset, data_len, ENC_NA ); /* We consumed everything */ return data_len; } /* * Here a Sysex-Start command is decoded. */ static unsigned int decode_sysex_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { const gchar *status_str; proto_tree *command_tree; int consumed = 0; int data_len; int ext_consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SYSEX_END, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; /* * lets check if we have a "normal" end - * if so, the last status-byte is consumed * as it belongs to the message */ if ( octet == RTP_MIDI_STATUS_COMMON_SYSEX_END ) { status_str = rtp_midi_common_status_sysex_segment_complete; } else if ( octet == RTP_MIDI_STATUS_COMMON_SYSEX_START ) { status_str = rtp_midi_common_status_sysex_segment_start; } else if ( octet == RTP_MIDI_STATUS_COMMON_UNDEFINED_F4 ) { status_str = rtp_midi_common_status_sysex_cancel; } /* Is this command through? */ if ( octet & RTP_MIDI_COMMAND_STATUS_FLAG ) { break; } } /* the unknown data we have does not include the trailing status-command */ data_len = consumed - 1; command_tree = proto_tree_add_subtree(tree, tvb, offset - 1, 1 + consumed, ett_rtp_midi_command, NULL, status_str ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); /* lets see if we have enough data for the sysex-id */ if ( data_len > 1 ) { guint8 manu_short; guint16 manufacturer; manufacturer = tvb_get_guint8( tvb, offset ); proto_tree_add_item( command_tree, hf_rtp_midi_manu_short, tvb, offset, 1, ENC_BIG_ENDIAN ); manu_short = tvb_get_guint8( tvb, offset ); offset++; data_len--; switch( manu_short ) { case RTP_MIDI_MANU_SHORT_NON_REALTIME_UNIVERSAL: ext_consumed = decode_sysex_common_nrt( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_MANU_SHORT_REALTIME_UNIVERSAL: ext_consumed = decode_sysex_common_rt( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_MANU_SHORT_EDUCATIONAL_USE: ext_consumed = decode_sysex_common_educational( tvb, pinfo, command_tree, offset, data_len ); break; case RTP_MIDI_MANU_SHORT_ISLONG: /* lets see if we have enough data to decode a long sysex-id and if we have a long id at all */ if ( data_len > 2 ) { manufacturer = tvb_get_ntohs( tvb, offset ); proto_tree_add_item( command_tree, hf_rtp_midi_manu_long, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2 ; data_len -= 2; ext_consumed = decode_sysex_common_manufacturer( tvb, pinfo, command_tree, offset, data_len, manufacturer ); } else { ext_consumed = -1; } break; default: ext_consumed = decode_sysex_common_manufacturer( tvb, pinfo, command_tree, offset, data_len, manufacturer ); break; } } if ( ext_consumed < 0 ) { return -1; } /* set our pointers correct to move past already decoded data */ offset += ext_consumed; proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s", status_str ); } else { col_append_str(pinfo->cinfo, COL_INFO, status_str ); } return consumed; } /* * Here the MIDI-Time-Code (MTC) Quarter Frame command is decoded. */ static int decode_mtc_quarter_frame(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset) { const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_MTC_QUARTER_FRAME, rtp_midi_common_status, rtp_midi_unknown_value_hex ); command_tree = proto_tree_add_subtree(tree, tvb, offset - 1, 2, ett_rtp_midi_command, NULL, status_str ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_quarter_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_quarter_frame_value, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", status_str ); } else { col_append_str(pinfo->cinfo, COL_INFO, status_str ); } return 1; } /* * Here the Song Position Pointer command is decoded. */ static int decode_song_position_pointer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset) { guint8 octet1; guint8 octet2; guint8 position; const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SONG_POSITION_POINTER, rtp_midi_common_status, rtp_midi_unknown_value_hex ); octet1 = tvb_get_guint8( tvb, offset ); octet2 = tvb_get_guint8( tvb, offset + 1 ); position = ( octet1 << 7 ) | octet2; command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 3, ett_rtp_midi_command, NULL, "%s (p=%d)", status_str, position ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_spp, tvb, offset, 2, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (p=%d)", status_str, position ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (p=%d)", status_str, position ); } return 2; } /* * Here a Song-Select command is decoded. */ static int decode_song_select(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset) { guint8 song_nr; const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SONG_SELECT, rtp_midi_common_status, rtp_midi_unknown_value_hex ); song_nr = tvb_get_guint8( tvb, offset ); command_tree = proto_tree_add_subtree_format(tree, tvb, offset - 1, 2, ett_rtp_midi_command, NULL, "%s (s=%d)", status_str, song_nr ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_song_select, tvb, offset, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s (s=%d)", status_str, song_nr ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (s=%d)", status_str, song_nr ); } return 1; } /* * Here the undefined common-command 0xf4 is decoded. */ static int decode_undefined_f4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { const gchar *status_str; proto_tree *command_tree; int consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_UNDEFINED_F4, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; /* Is this command through? */ if ( octet & RTP_MIDI_COMMAND_STATUS_FLAG ) { break; } } command_tree = proto_tree_add_subtree(tree, tvb, offset - 1, 1 + consumed, ett_rtp_midi_command, NULL, status_str ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); /* just add the unknown data to the tree */ proto_tree_add_item( command_tree, hf_rtp_midi_unknown_data, tvb, offset, consumed, ENC_NA ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset + consumed - 1, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s", status_str ); } else { col_append_str(pinfo->cinfo, COL_INFO, status_str ); } return consumed; } /* * Here the undefined common-command 0xf5 is decoded. */ static int decode_undefined_f5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { const gchar *status_str; proto_tree *command_tree; int consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_UNDEFINED_F5, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; /* Is this command done? */ if ( octet & RTP_MIDI_COMMAND_STATUS_FLAG ) { break; } } command_tree = proto_tree_add_subtree(tree, tvb, offset - 1, 1 + consumed, ett_rtp_midi_command, NULL, status_str ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); /* just add the unknown data to the tree */ proto_tree_add_item( command_tree, hf_rtp_midi_unknown_data, tvb, offset, consumed, ENC_NA ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset + consumed - 1, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s", status_str ); } else { col_append_str(pinfo->cinfo, COL_INFO, status_str ); } return consumed; } /* * Here a Tune-Request command is decoded. */ static int decode_tune_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len _U_ ) { const gchar *status_str; proto_tree *command_tree; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_TUNE_REQUEST, rtp_midi_common_status, rtp_midi_unknown_value_hex ); command_tree = proto_tree_add_subtree(tree, tvb, offset - 1, 1, ett_rtp_midi_command, NULL, status_str ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s)", status_str ); } else { col_append_str(pinfo->cinfo, COL_INFO, status_str ); } return 0; } /* * Here a Sysex-End command is decoded - in RTP-MIDI this has a special semantic, it either starts a segmented Sysex-frame or a Sysex-Cancel */ static int decode_sysex_end(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len ) { const gchar *status_str; proto_tree *command_tree; int consumed = 0; status_str = val_to_str( RTP_MIDI_STATUS_COMMON_SYSEX_END, rtp_midi_common_status, rtp_midi_unknown_value_hex ); /* we need to parse "away" data until the next command */ while ( cmd_len ) { guint8 octet; octet = tvb_get_guint8( tvb, offset + consumed ); consumed++; /* * lets check if we have a "normal" end - * if so, the last status-byte is consumed * as it belongs to the message */ if ( octet == RTP_MIDI_STATUS_COMMON_SYSEX_END ) { status_str = rtp_midi_common_status_sysex_segment_end; } else if ( octet == RTP_MIDI_STATUS_COMMON_SYSEX_START ) { status_str = rtp_midi_common_status_sysex_segment; } else if ( octet == RTP_MIDI_STATUS_COMMON_UNDEFINED_F4 ) { status_str = rtp_midi_common_status_sysex_cancel; } /* Is this command through? */ if ( octet & RTP_MIDI_COMMAND_STATUS_FLAG ) { break; } } command_tree = proto_tree_add_subtree(tree, tvb, offset - 1, 1 + consumed, ett_rtp_midi_command, NULL, status_str ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset - 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( command_tree, hf_rtp_midi_unknown_data, tvb, offset, consumed - 1, ENC_NA ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset + consumed - 1, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_append_fstr(pinfo->cinfo, COL_INFO,", %s", status_str ); } else { col_append_str(pinfo->cinfo, COL_INFO, status_str ); } return consumed; } /* * Here each single MIDI-command is decoded. * The Status-octet is read and then the decoding * of the individual MIDI-commands is punted to * external decoders. */ static int decodemidi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset, unsigned int cmd_len, guint8 *runningstatus, unsigned int *rsoffset ) { int consumed = 0; int ext_consumed = 0; guint8 octet; gboolean using_rs; #if 0 guint8 octet2; guint8 octet3; guint8 cmd; guint8 channel; proto_tree *sysexdata_tree = NULL; gboolean foundend; guint16 wordvalue; char helptext[200]; char entry[200]; char segtype[200]; guint8 manu1; guint16 manu2; guint8 subid1; guint8 subid2; guint8 sysexchan; unsigned int helpoffset; #endif octet = tvb_get_guint8( tvb, offset ); /* midi realtime-data -> one octet -- unlike serial-wired MIDI realtime-commands in RTP-MIDI will * not be intermingled with other MIDI-commands, so we handle this case right here and return */ if ( octet >= 0xf8 ) { proto_tree *command_tree; const gchar *valstr; valstr = val_to_str( octet, rtp_midi_common_status, rtp_midi_unknown_value_hex ); command_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_rtp_midi_command, NULL, valstr ); proto_tree_add_item( command_tree, hf_rtp_midi_common_status, tvb, offset, 1, ENC_BIG_ENDIAN ); if ( cmd_count ) { col_add_fstr(pinfo->cinfo, COL_INFO,", %s", valstr ); } else { col_add_str(pinfo->cinfo, COL_INFO, valstr ); } return 1; } /* see if this first octet is a status message */ if ( ( octet & RTP_MIDI_COMMAND_STATUS_FLAG ) == 0 ) { /* if we have no running status yet -> error */ if ( ( ( *runningstatus ) & RTP_MIDI_COMMAND_STATUS_FLAG ) == 0 ) { return -1; } /* our first octet is "virtual" coming from a preceding MIDI-command, * so actually we have not really consumed anything yet */ octet = *runningstatus; using_rs = TRUE; } else { /* We have a "real" status-byte */ using_rs = FALSE; /* Let's see how this octet influences our running-status */ /* if we have a "normal" MIDI-command then the new status replaces the current running-status */ if ( octet < 0xf0 ) { *rsoffset = offset ; *runningstatus = octet; } else { /* system-realtime-commands maintain the current running-status * other system-commands clear the running-status, since we * already handled realtime, we can reset it here */ *runningstatus = 0; } /* lets update our pointers */ consumed++; cmd_len--; offset++; } /* non-system MIDI-commands encode the command in the high nibble and the channel * in the low nibble - so we will take care of those cases next */ if ( octet < 0xf0 ) { switch ( octet >> 4 ) { case RTP_MIDI_STATUS_CHANNEL_NOTE_OFF: ext_consumed = decode_note_off( tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; case RTP_MIDI_STATUS_CHANNEL_NOTE_ON: ext_consumed = decode_note_on( tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; case RTP_MIDI_STATUS_CHANNEL_POLYPHONIC_KEY_PRESSURE: ext_consumed = decode_poly_pressure(tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; case RTP_MIDI_STATUS_CHANNEL_CONTROL_CHANGE: ext_consumed = decode_control_change(tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; case RTP_MIDI_STATUS_CHANNEL_PROGRAM_CHANGE: ext_consumed = decode_program_change(tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; case RTP_MIDI_STATUS_CHANNEL_CHANNEL_PRESSURE: ext_consumed = decode_channel_pressure(tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; case RTP_MIDI_STATUS_CHANNEL_PITCH_BEND_CHANGE: ext_consumed = decode_pitch_bend_change(tvb, pinfo, tree, cmd_count, offset, octet, *rsoffset, using_rs ); break; } /* external decoder informed us of error -> pass this through */ if ( ext_consumed < 0 ) { return ext_consumed; } return consumed + ext_consumed; } /* Here we catch the remaining system-common commands */ switch ( octet ) { case RTP_MIDI_STATUS_COMMON_SYSEX_START: ext_consumed = decode_sysex_start( tvb, pinfo, tree, cmd_count, offset, cmd_len ); break; case RTP_MIDI_STATUS_COMMON_MTC_QUARTER_FRAME: ext_consumed = decode_mtc_quarter_frame( tvb, pinfo, tree, cmd_count, offset); break; case RTP_MIDI_STATUS_COMMON_SONG_POSITION_POINTER: ext_consumed = decode_song_position_pointer( tvb, pinfo, tree, cmd_count, offset); break; case RTP_MIDI_STATUS_COMMON_SONG_SELECT: ext_consumed = decode_song_select( tvb, pinfo, tree, cmd_count, offset); break; case RTP_MIDI_STATUS_COMMON_UNDEFINED_F4: ext_consumed = decode_undefined_f4( tvb, pinfo, tree, cmd_count, offset, cmd_len ); break; case RTP_MIDI_STATUS_COMMON_UNDEFINED_F5: ext_consumed = decode_undefined_f5( tvb, pinfo, tree, cmd_count, offset, cmd_len ); break; case RTP_MIDI_STATUS_COMMON_TUNE_REQUEST: ext_consumed = decode_tune_request( tvb, pinfo, tree, cmd_count, offset, cmd_len ); break; case RTP_MIDI_STATUS_COMMON_SYSEX_END: ext_consumed = decode_sysex_end( tvb, pinfo, tree, cmd_count, offset, cmd_len ); break; } /* external decoder informed us of error -> pass this through */ if ( ext_consumed < 0 ) { return ext_consumed; } return consumed + ext_consumed; } /* * Here the chapter c of the channel-journal is decoded. */ static int decode_cj_chapter_c( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_cj_chapter_tree; proto_tree *rtp_midi_loglist_tree; proto_tree *loglist_tree; unsigned int start_offset = offset; guint8 octet; int count; int i; octet = tvb_get_guint8( tvb, offset ); count = octet & 0x7f; /* count encoded is n+1 */ count++; rtp_midi_cj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, 1 + 2 * count, ett_rtp_midi_cj_chapter_c, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_C ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_c_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_c_length, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; rtp_midi_loglist_tree = proto_tree_add_subtree( rtp_midi_cj_chapter_tree, tvb, offset, count * 2, ett_rtp_midi_cj_chapter_c_loglist, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_C_LOGLIST ); for ( i = 0; i < count; i++ ) { loglist_tree = proto_tree_add_subtree(rtp_midi_loglist_tree, tvb, offset, 2, ett_rtp_midi_cj_chapter_c_logitem, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_C_LOGITEM ); proto_tree_add_item(loglist_tree, hf_rtp_midi_cj_chapter_c_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item(loglist_tree, hf_rtp_midi_cj_chapter_c_number, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; octet = tvb_get_guint8( tvb, offset ); proto_tree_add_item(loglist_tree, hf_rtp_midi_cj_chapter_c_aflag, tvb, offset, 1, ENC_BIG_ENDIAN ); /* do we have a value or alternative coding? */ if ( octet & 0x80 ) { proto_tree_add_item(loglist_tree, hf_rtp_midi_cj_chapter_c_tflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item(loglist_tree, hf_rtp_midi_cj_chapter_c_alt, tvb, offset, 1, ENC_BIG_ENDIAN ); } else { proto_tree_add_item(loglist_tree, hf_rtp_midi_cj_chapter_c_value, tvb, offset, 1, ENC_BIG_ENDIAN ); } offset++; } return offset-start_offset; } /* * Here the chapter m of the channel-journal is decoded, possibly the most complex part of the RTP-MIDI stuff ;-) */ static int decode_cj_chapter_m( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_cj_chapter_tree; proto_tree *rtp_midi_loglist_tree; proto_tree *rtp_midi_loglist_item_tree; guint16 header; guint8 logitemheader; int length; int logitemhdrlen; int logitemlen; gboolean no_pnum_msb; unsigned int start_offset = offset; /* first we need to get the flags & length of this chapter */ header = tvb_get_ntohs( tvb, offset ); length = header & RTP_MIDI_CJ_CHAPTER_M_MASK_LENGTH; /* take of length of header */ length -= 2; rtp_midi_cj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, length, ett_rtp_midi_cj_chapter_m, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_M ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_sflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_pflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_eflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_uflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_wflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_zflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_length, tvb, offset, 2, ENC_BIG_ENDIAN ); /* done with header */ offset += 2; /* do we have the pending field? */ if ( header & 0x4000 ) { proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_qflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_m_pending, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } /* * lets find out if we need to decode the pnum_msb: * if Z = 1 and either U = 1 or W = 1 we don't */ no_pnum_msb = ( header & 0x0400 ) && ( ( header & 0x0800 ) || ( header & 0x1000 ) ); logitemhdrlen = no_pnum_msb ? 2 : 3; rtp_midi_loglist_tree = proto_tree_add_subtree( rtp_midi_cj_chapter_tree, tvb, offset, length, ett_rtp_midi_cj_chapter_m_loglist, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_M_LOGLIST ); /* lets step through the loglist */ while ( length > 0 ) { if ( no_pnum_msb ) { logitemheader = tvb_get_guint8( tvb, offset + 1 ); } else { logitemheader = tvb_get_guint8( tvb, offset + 2 ); } logitemlen = logitemhdrlen; /* do we have a msb field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_J ) { logitemlen++; } /* do we have a lsb field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_K ) { logitemlen++; } /* do we have an a-button field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_L ) { logitemlen +=2; } /* do we have a c-button field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_M ) { logitemlen +=2; } /* do we have a count field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_N ) { logitemlen++; } /* now that we have the length of the logitem, we can create the tree... */ rtp_midi_loglist_item_tree = proto_tree_add_subtree( rtp_midi_loglist_tree, tvb, offset, logitemlen, ett_rtp_midi_cj_chapter_m_logitem, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_M_LOGITEM ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_pnum_lsb, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; length--; /* if we have the msb, we need to decode it */ if ( !no_pnum_msb ) { proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_qflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_pnum_msb, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; length--; } proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_jflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_kflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_lflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_mflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_nflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_tflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_vflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_item_tree, hf_rtp_midi_cj_chapter_m_log_rflag, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; length--; /* do we have a entry-msb field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_J ) { static int * const msb_flags[] = { &hf_rtp_midi_cj_chapter_m_log_msb_x, &hf_rtp_midi_cj_chapter_m_log_msb, NULL }; proto_tree_add_bitmask(rtp_midi_loglist_tree, tvb, offset, hf_rtp_midi_cj_chapter_m_log_msb_entry, ett_rtp_midi_cj_chapter_m_log_msb, msb_flags, ENC_NA); offset++; length--; } /* do we have a entry-lsb field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_K ) { static int * const lsb_flags[] = { &hf_rtp_midi_cj_chapter_m_log_lsb_x, &hf_rtp_midi_cj_chapter_m_log_lsb, NULL }; proto_tree_add_bitmask(rtp_midi_loglist_tree, tvb, offset, hf_rtp_midi_cj_chapter_m_log_lsb_entry, ett_rtp_midi_cj_chapter_m_log_lsb, lsb_flags, ENC_NA); offset++; length--; } /* do we have an a-button field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_L ) { static int * const button_flags[] = { &hf_rtp_midi_cj_chapter_m_log_a_button_g, &hf_rtp_midi_cj_chapter_m_log_a_button_x, &hf_rtp_midi_cj_chapter_m_log_a_button, NULL }; proto_tree_add_bitmask(rtp_midi_loglist_tree, tvb, offset, hf_rtp_midi_cj_chapter_m_log_a_button_full, ett_rtp_midi_cj_chapter_m_log_a_button, button_flags, ENC_BIG_ENDIAN); offset += 2; length -= 2; } /* do we have a c-button field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_M ) { static int * const button_flags[] = { &hf_rtp_midi_cj_chapter_m_log_c_button_g, &hf_rtp_midi_cj_chapter_m_log_c_button_r, &hf_rtp_midi_cj_chapter_m_log_c_button, NULL }; proto_tree_add_bitmask(rtp_midi_loglist_tree, tvb, offset, hf_rtp_midi_cj_chapter_m_log_c_button_full, ett_rtp_midi_cj_chapter_m_log_c_button, button_flags, ENC_BIG_ENDIAN); offset += 2; length -= 2; } /* do we have a count field? */ if ( logitemheader & RTP_MIDI_CJ_CHAPTER_M_FLAG_N ) { static int * const log_flags[] = { &hf_rtp_midi_cj_chapter_m_log_count_x, &hf_rtp_midi_cj_chapter_m_log_count, NULL }; proto_tree_add_bitmask(rtp_midi_loglist_tree, tvb, offset, hf_rtp_midi_cj_chapter_m_log_count_full, ett_rtp_midi_cj_chapter_m_log_count, log_flags, ENC_BIG_ENDIAN); offset++; length--; } } return offset-start_offset; } /* * Here the chapter n of the channel-journal is decoded. */ static int decode_cj_chapter_n( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_cj_chapter_tree; proto_tree *rtp_midi_loglist_tree; const gchar *note_str; unsigned int start_offset = offset; guint16 header; guint8 note; guint8 velocity; int log_count; int octet_count; int low; int high; int i; /* first we need to get the flags & length of this chapter */ header = tvb_get_ntohs( tvb, offset ); log_count = ( header & RTP_MIDI_CJ_CHAPTER_N_MASK_LENGTH ) >> 8; low = ( header & RTP_MIDI_CJ_CHAPTER_N_MASK_LOW ) >> 4; high = header & RTP_MIDI_CJ_CHAPTER_N_MASK_HIGH; /* how many offbits octets do we have? */ if ( low <= high ) { octet_count = high - low + 1; } else if ( ( low == 15 ) && ( high == 0 ) ) { octet_count = 0; } else if ( ( low == 15 ) && ( high == 1 ) ) { octet_count = 0; } else { return -1; } /* special case -> no offbit octets, but 128 note-logs */ if ( ( log_count == 127 ) && ( low == 15) && ( high == 0 ) ) { log_count++; } rtp_midi_cj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, 2 + ( log_count * 2 ) + octet_count, ett_rtp_midi_cj_chapter_n, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_N ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_n_bflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_n_len, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_n_low, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_n_high, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; if ( log_count > 0 ) { rtp_midi_loglist_tree = proto_tree_add_subtree( rtp_midi_cj_chapter_tree, tvb, offset, log_count * 2, ett_rtp_midi_cj_chapter_n_loglist, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_N_LOGLIST ); for ( i = 0; i < log_count; i++ ) { note = tvb_get_guint8( tvb, offset ) & 0x7f; velocity = tvb_get_guint8( tvb, offset + 1 ) & 0x7f; note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); rtp_midi_loglist_tree = proto_tree_add_subtree_format(rtp_midi_loglist_tree, tvb, offset, 2, ett_rtp_midi_cj_chapter_n_logitem, NULL, "%s (n=%s, v=%d)", RTP_MIDI_TREE_NAME_CJ_CHAPTER_N_LOGITEM, note_str, velocity ); proto_tree_add_item( rtp_midi_loglist_tree, hf_rtp_midi_cj_chapter_n_log_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_tree, hf_rtp_midi_cj_chapter_n_log_notenum, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; proto_tree_add_item( rtp_midi_loglist_tree, hf_rtp_midi_cj_chapter_n_log_yflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_loglist_tree, hf_rtp_midi_cj_chapter_n_log_velocity, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } } if ( octet_count > 0 ) { rtp_midi_loglist_tree = proto_tree_add_subtree( rtp_midi_cj_chapter_tree, tvb, offset, log_count, ett_rtp_midi_cj_chapter_n_octets, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_N_OCTETS ); for ( i = 0; i < octet_count; i++ ) { proto_tree_add_item(rtp_midi_loglist_tree, hf_rtp_midi_cj_chapter_n_log_octet, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } } return offset-start_offset; } /* * Here the chapter e of the channel-journal is decoded. */ static int decode_cj_chapter_e( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_cj_chapter_tree; proto_tree *rtp_midi_loglist_tree, *log_tree; const gchar *note_str; unsigned int start_offset = offset; guint8 header; guint8 note; guint8 count_vel; guint8 octet; int log_count; int i; /* first we need to get the flags & length of this chapter */ header = tvb_get_guint8( tvb, offset ); log_count = header & RTP_MIDI_CJ_CHAPTER_E_MASK_LENGTH; /* count is encoded n+1 */ log_count++; rtp_midi_cj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, 1 + ( log_count * 2 ), ett_rtp_midi_cj_chapter_e, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_E ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_e_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_e_len, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; rtp_midi_loglist_tree = proto_tree_add_subtree( rtp_midi_cj_chapter_tree, tvb, offset, log_count * 2, ett_rtp_midi_cj_chapter_e_loglist, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_E_LOGLIST ); for ( i = 0; i < log_count; i++ ) { note = tvb_get_guint8( tvb, offset ) & 0x7f; octet = tvb_get_guint8( tvb, offset + 1 ); count_vel = octet & 0x7f; note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); if ( octet & 0x80 ) { log_tree = proto_tree_add_subtree_format(rtp_midi_loglist_tree, tvb, offset, 2, ett_rtp_midi_cj_chapter_e_logitem, NULL, "%s (n=%s, v=%d)", RTP_MIDI_TREE_NAME_CJ_CHAPTER_E_LOGITEM1, note_str, count_vel ); } else { log_tree = proto_tree_add_subtree_format(rtp_midi_loglist_tree, tvb, offset, 2, ett_rtp_midi_cj_chapter_e_logitem, NULL, "%s (n=%s, c=%d)", RTP_MIDI_TREE_NAME_CJ_CHAPTER_E_LOGITEM2, note_str, count_vel ); } proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_e_log_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_e_log_notenum, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_e_log_vflag, tvb, offset, 1, ENC_BIG_ENDIAN ); if ( octet & 0x80 ) { proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_e_log_velocity, tvb, offset, 1, ENC_BIG_ENDIAN ); } else { proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_e_log_count, tvb, offset, 1, ENC_BIG_ENDIAN ); } offset++; } return offset-start_offset; } /* * Here the chapter a of the channel-journal is decoded. */ static int decode_cj_chapter_a( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_cj_chapter_tree; proto_tree *rtp_midi_loglist_tree, *log_tree; const gchar *note_str; unsigned int start_offset = offset; guint8 header; guint8 note; guint8 pressure; int log_count; int i; /* first we need to get the flags & length of this chapter */ header = tvb_get_guint8( tvb, offset ); log_count = header & RTP_MIDI_CJ_CHAPTER_A_MASK_LENGTH; /* count is encoded n+1 */ log_count++; rtp_midi_cj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, 1 + ( log_count * 2 ), ett_rtp_midi_cj_chapter_a, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_A ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_a_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_a_len, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; rtp_midi_loglist_tree = proto_tree_add_subtree( rtp_midi_cj_chapter_tree, tvb, offset, log_count * 2, ett_rtp_midi_cj_chapter_a_loglist, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_A_LOGLIST ); for ( i = 0; i < log_count; i++ ) { note = tvb_get_guint8( tvb, offset ) & 0x7f; pressure = tvb_get_guint8( tvb, offset + 1 ) & 0x7f; note_str = val_to_str_ext( note, &rtp_midi_note_values_ext, rtp_midi_unknown_value_dec ); log_tree = proto_tree_add_subtree_format(rtp_midi_loglist_tree, tvb, offset, 2, ett_rtp_midi_cj_chapter_a_logitem, NULL, "%s (n=%s, p=%d)", RTP_MIDI_TREE_NAME_CJ_CHAPTER_A_LOGITEM, note_str, pressure ); proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_a_log_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_a_log_notenum, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_a_log_xflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( log_tree, hf_rtp_midi_cj_chapter_a_log_pressure, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } return offset-start_offset; } /* * Here a channel-journal is decoded. */ static int decode_channel_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_chanjournal_tree; proto_tree *rtp_midi_cj_chapters_tree; proto_tree *rtp_midi_cj_chapter_tree; guint32 chanflags; guint16 chanjourlen; int consumed = 0; int ext_consumed = 0; /* first we need to get the flags & length of this channel-journal */ chanflags = tvb_get_ntoh24( tvb, offset ); chanjourlen = ( chanflags & RTP_MIDI_CJ_MASK_LENGTH ) >> 8; rtp_midi_chanjournal_tree = proto_tree_add_subtree( tree, tvb, offset, chanjourlen, ett_rtp_midi_channeljournal, NULL, val_to_str( ( chanflags & RTP_MIDI_CJ_MASK_CHANNEL ) >> RTP_MIDI_CJ_CHANNEL_SHIFT, rtp_midi_channels, rtp_midi_unknown_value_hex ) ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_sflag, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_chan, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_hflag, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_len, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_p, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_c, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_m, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_w, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_n, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_e, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_t, tvb, offset, 3, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_chanjournal_tree, hf_rtp_midi_chanjour_toc_a, tvb, offset, 3, ENC_BIG_ENDIAN ); rtp_midi_cj_chapters_tree = proto_tree_add_subtree( rtp_midi_chanjournal_tree, tvb, offset + 3, chanjourlen - 3, ett_rtp_midi_channelchapters, NULL, RTP_MIDI_TREE_NAME_CHANNEL_CHAPTERS ); /* take care of length of header */ offset += 3; consumed += 3; /* Do we have a program change chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_P ) { rtp_midi_cj_chapter_tree = proto_tree_add_subtree( rtp_midi_cj_chapters_tree, tvb, offset, 3, ett_rtp_midi_cj_chapter_p, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_P ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_program, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_bflag, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_bank_msb, tvb, offset + 1, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_xflag, tvb, offset + 2, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_p_bank_lsb, tvb, offset + 2, 1, ENC_BIG_ENDIAN ); offset += 3; consumed += 3; } /* Do we have a control chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_C ) { ext_consumed = decode_cj_chapter_c( tvb, pinfo, rtp_midi_cj_chapters_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } consumed += ext_consumed; offset += ext_consumed; } /* Do we have a parameter changes? */ if ( chanflags & RTP_MIDI_CJ_FLAG_M ) { ext_consumed = decode_cj_chapter_m( tvb, pinfo, rtp_midi_cj_chapters_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } consumed += ext_consumed; offset += ext_consumed; } /* Do we have a pitch-wheel chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_W ) { rtp_midi_cj_chapter_tree = proto_tree_add_subtree( rtp_midi_cj_chapters_tree, tvb, offset, 2, ett_rtp_midi_cj_chapter_w, NULL, RTP_MIDI_TREE_NAME_CJ_CHAPTER_W ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_w_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_w_first, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; consumed++; proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_w_rflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_cj_chapter_tree, hf_rtp_midi_cj_chapter_w_second, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; consumed++; } /* Do we have a note on/off chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_N ) { ext_consumed = decode_cj_chapter_n( tvb, pinfo, rtp_midi_cj_chapters_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } consumed += ext_consumed; offset += ext_consumed; } /* Do we have a note command extras chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_E ) { ext_consumed = decode_cj_chapter_e( tvb, pinfo, rtp_midi_cj_chapters_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } consumed += ext_consumed; offset += ext_consumed; } /* Do we have channel aftertouch chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_T ) { static int * const flags_t[] = { &hf_rtp_midi_cj_chapter_t_sflag, &hf_rtp_midi_cj_chapter_t_pressure, NULL }; proto_tree_add_bitmask(rtp_midi_cj_chapters_tree, tvb, offset, hf_rtp_midi_cj_chapter_t_channel_aftertouch, ett_rtp_midi_cj_chapter_t, flags_t, ENC_NA); offset++; consumed++; } /* Do we have a poly aftertouch chapter? */ if ( chanflags & RTP_MIDI_CJ_FLAG_A ) { ext_consumed = decode_cj_chapter_a( tvb, pinfo, rtp_midi_cj_chapters_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } consumed += ext_consumed; } /* Make sanity check for consumed data vs. stated length of this channels journal */ if ( consumed != chanjourlen ) { return -1; } return consumed; } /* * Here the chapter D F4-field of the system-journal is decoded. */ static int decode_sj_chapter_d_f4( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_field_tree; unsigned int start_offset = offset; guint16 f4flags; guint16 f4length; /* Get flags & length */ f4flags = tvb_get_ntohs( tvb, offset ); f4length = f4flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_LENGTH; /* now we can display our tree, as we now have the full length */ rtp_midi_field_tree = proto_tree_add_subtree( tree, tvb, offset, f4length, ett_rtp_midi_sj_chapter_d_field_j, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_J ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_sflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_cflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_vflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_lflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_dsz, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_length, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; f4length -= 2; if ( f4flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_C ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; f4length--; } if ( f4flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_V ) { int valuelen = 0; guint8 octet; /* variable length field - ends with an octet with MSB set */ for (;;) { octet = tvb_get_guint8( tvb, offset+valuelen ); valuelen++; if ( octet & 0x80 ) { break; } } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_value, tvb, offset, valuelen, ENC_NA ); offset += valuelen; f4length -= valuelen; } if ( f4flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_L ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_legal, tvb, offset, f4length, ENC_NA ); offset += f4length; } /* if we still have data, the length-field was incorrect we dump the data here and abort! */ if ( f4length > 0 ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_data, tvb, offset, f4length, ENC_NA ); offset += f4length; /* must be a protocol error - since we have a length, we can recover...*/ } return offset-start_offset; } /* * Here the chapter D F5-field of the system-journal is decoded. */ static int decode_sj_chapter_d_f5( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_field_tree; unsigned int start_offset = offset; guint16 f5flags; guint16 f5length; /* Get flags & length */ f5flags = tvb_get_ntohs( tvb, offset ); f5length = f5flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_LENGTH; /* now we can display our tree, as we now have the full length */ rtp_midi_field_tree = proto_tree_add_subtree( tree, tvb, offset, f5length, ett_rtp_midi_sj_chapter_d_field_k, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_K ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_sflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_cflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_vflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_lflag, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_dsz, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_length, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; f5length -= 2; if ( f5flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_C ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; f5length--; } if ( f5flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_V ) { int valuelen = 0; guint8 octet; /* variable length field - ends with an octet with MSB set */ for (;;) { octet = tvb_get_guint8( tvb, offset+valuelen ); valuelen++; if ( octet & 0x80 ) { break; } } proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_value, tvb, offset, valuelen, ENC_NA ); offset += valuelen; f5length -= valuelen; } if ( f5flags & RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_L ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_legal, tvb, offset, f5length, ENC_NA ); offset += f5length; f5length = 0; } /* if we still have data, we dump it here - see above! */ if ( f5length > 0 ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_syscom_data, tvb, offset, f5length, ENC_NA ); offset += f5length; /* must be a protocol error - since we have a length, we can recover...*/ } return offset-start_offset; } /* * Here the chapter D F9-field of the system-journal is decoded. */ static int decode_sj_chapter_d_f9( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_field_tree; unsigned int start_offset = offset; guint8 f9flags; guint8 f9length; /* Get flags & length */ f9flags = tvb_get_guint8( tvb, offset ); f9length = f9flags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_LENGTH; /* now we can display our tree, as we now have the full length */ rtp_midi_field_tree = proto_tree_add_subtree( tree, tvb, offset, f9length, ett_rtp_midi_sj_chapter_d_field_y, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_Y ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_cflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_lflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_length, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; f9length--; if ( f9flags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_C ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; f9length--; } if ( f9flags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_L ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_legal, tvb, offset, f9length, ENC_NA ); offset += f9length; f9length = 0; } /* if we still have data, the length-field was incorrect we dump the data here and abort! */ if ( f9length > 0 ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_data, tvb, offset, f9length, ENC_NA ); offset += f9length; /* must be a protocol error - since we have a length, we can recover...*/ } return offset-start_offset; } /* * Here the chapter D FD-field of the system-journal is decoded. */ static int decode_sj_chapter_d_fd( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_field_tree; unsigned int start_offset = offset; guint8 fdflags; guint8 fdlength; /* Get flags & length */ fdflags = tvb_get_guint8( tvb, offset ); fdlength = fdflags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_LENGTH; /* now we can display our tree, as we now have the full length */ rtp_midi_field_tree = proto_tree_add_subtree( tree, tvb, offset, fdlength, ett_rtp_midi_sj_chapter_d_field_z, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_D_FIELD_Z ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_cflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_lflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_length, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; fdlength--; if ( fdflags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_C ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_count, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; fdlength--; } if ( fdflags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_L ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_legal, tvb, offset, fdlength, ENC_NA ); offset += fdlength; fdlength = 0; } /* if we still have data, the length-field was incorrect we dump the data here and abort! */ if ( fdlength > 0 ) { proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_data, tvb, offset, fdlength, ENC_NA ); offset += fdlength; /* must be a protocol error - since we have a length, we can recover...*/ } return offset-start_offset; } /* * Here the chapter D of the channel-journal is decoded. */ static int decode_sj_chapter_d( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_item *tix; proto_tree *rtp_midi_sj_chapter_tree; guint8 header; unsigned int start_offset = offset; int ext_consumed; static int * const chapter_d_flags[] = { &hf_rtp_midi_sj_chapter_d_sflag, &hf_rtp_midi_sj_chapter_d_bflag, &hf_rtp_midi_sj_chapter_d_gflag, &hf_rtp_midi_sj_chapter_d_hflag, &hf_rtp_midi_sj_chapter_d_jflag, &hf_rtp_midi_sj_chapter_d_kflag, &hf_rtp_midi_sj_chapter_d_yflag, &hf_rtp_midi_sj_chapter_d_zflag, NULL }; /* first we need to get the flags of this chapter */ header = tvb_get_guint8( tvb, offset ); /* * we don't know the complete length yet - we know that we have at least the header -> 1. * At the end we set the real length... */ tix = proto_tree_add_bitmask(tree, tvb, offset, hf_rtp_midi_sj_chapter_d_simple_system_commands, ett_rtp_midi_sj_chapter_d, chapter_d_flags, ENC_NA); rtp_midi_sj_chapter_tree = proto_item_add_subtree( tix, ett_rtp_midi_sj_chapter_d ); /* done with header */ offset++; /* do we have Reset field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_B ) { static int * const reset_flags[] = { &hf_rtp_midi_sj_chapter_d_reset_sflag, &hf_rtp_midi_sj_chapter_d_reset_count, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapter_tree, tvb, offset, hf_rtp_midi_sj_chapter_d_reset, ett_rtp_midi_sj_chapter_d_field_b, reset_flags, ENC_NA); offset++; } /* do we have Tune request field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_G ) { static int * const tune_flags[] = { &hf_rtp_midi_sj_chapter_d_tune_sflag, &hf_rtp_midi_sj_chapter_d_tune_count, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapter_tree, tvb, offset, hf_rtp_midi_sj_chapter_d_tune, ett_rtp_midi_sj_chapter_d_field_g, tune_flags, ENC_BIG_ENDIAN); offset++; } /* do we have Song select field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_H ) { static int * const song_flags[] = { &hf_rtp_midi_sj_chapter_d_song_sel_sflag, &hf_rtp_midi_sj_chapter_d_song_sel_value, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapter_tree, tvb, offset, hf_rtp_midi_sj_chapter_d_song_sel, ett_rtp_midi_sj_chapter_d_field_h, song_flags, ENC_BIG_ENDIAN); offset++; } /* do we have 0xF4 field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_J ) { ext_consumed = decode_sj_chapter_d_f4( tvb, pinfo, rtp_midi_sj_chapter_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } offset += ext_consumed; } /* do we have 0xF5 field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_K ) { ext_consumed = decode_sj_chapter_d_f5( tvb, pinfo, rtp_midi_sj_chapter_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } offset += ext_consumed; } /* do we have 0xF9 field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_Y ) { ext_consumed = decode_sj_chapter_d_f9( tvb, pinfo, rtp_midi_sj_chapter_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } offset += ext_consumed; } /* do we have 0xFD field? */ if ( header & RTP_MIDI_SJ_CHAPTER_D_FLAG_Z ) { ext_consumed = decode_sj_chapter_d_fd( tvb, pinfo, rtp_midi_sj_chapter_tree, offset ); if ( ext_consumed < 0 ) { return ext_consumed; } offset += ext_consumed; } /* now we know the complete length and set it. */ proto_item_set_len( tix, offset-start_offset ); return offset-start_offset; } /* * Here the chapter Q of the channel-journal is decoded. */ static int decode_sj_chapter_q( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_sj_chapter_tree; guint8 header; unsigned int start_offset = offset; int len = 1; /* first we need to get the flags of this chapter */ header = tvb_get_guint8( tvb, offset ); if ( header & RTP_MIDI_SJ_CHAPTER_Q_FLAG_C ) { len += 2; } if ( header & RTP_MIDI_SJ_CHAPTER_Q_FLAG_T ) { len += 3; } /* now we have the length... */ rtp_midi_sj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, len, ett_rtp_midi_sj_chapter_q, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_Q ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_nflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_dflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_cflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_tflag, tvb, offset, 1, ENC_BIG_ENDIAN ); if ( header & RTP_MIDI_SJ_CHAPTER_Q_FLAG_C ) { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_clock, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; } else { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_top, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } if ( header & RTP_MIDI_SJ_CHAPTER_Q_FLAG_T ) { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_q_timetools, tvb, offset, 3, ENC_BIG_ENDIAN ); offset += 3; } return offset-start_offset; } /* * Here the chapter F of the channel-journal is decoded. */ static int decode_sj_chapter_f( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_sj_chapter_tree; guint8 header; unsigned int start_offset = offset; int len = 1; /* first we need to get the flags of this chapter */ header = tvb_get_guint8( tvb, offset ); if ( header & RTP_MIDI_SJ_CHAPTER_F_FLAG_C ) { len += 4; } if ( header & RTP_MIDI_SJ_CHAPTER_F_FLAG_P ) { len += 4; } /* now we have the length... */ rtp_midi_sj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, len, ett_rtp_midi_sj_chapter_f, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_F ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_f_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_f_cflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_f_pflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_f_qflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_f_dflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_f_point, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; if ( header & RTP_MIDI_SJ_CHAPTER_F_FLAG_C ) { if ( header & RTP_MIDI_SJ_CHAPTER_F_FLAG_Q ) { static int * const fq_flags[] = { &hf_rtp_midi_sj_chapter_f_mt0, &hf_rtp_midi_sj_chapter_f_mt1, &hf_rtp_midi_sj_chapter_f_mt2, &hf_rtp_midi_sj_chapter_f_mt3, &hf_rtp_midi_sj_chapter_f_mt4, &hf_rtp_midi_sj_chapter_f_mt5, &hf_rtp_midi_sj_chapter_f_mt6, &hf_rtp_midi_sj_chapter_f_mt7, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapter_tree, tvb, offset, hf_rtp_midi_sj_chapter_f_complete, ett_rtp_midi_sj_chapter_f_complete, fq_flags, ENC_BIG_ENDIAN); } else { static int * const f_flags[] = { &hf_rtp_midi_sj_chapter_f_hr, &hf_rtp_midi_sj_chapter_f_mn, &hf_rtp_midi_sj_chapter_f_sc, &hf_rtp_midi_sj_chapter_f_fr, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapter_tree, tvb, offset, hf_rtp_midi_sj_chapter_f_complete, ett_rtp_midi_sj_chapter_f_complete, f_flags, ENC_BIG_ENDIAN); } offset += 4; } if ( header & RTP_MIDI_SJ_CHAPTER_F_FLAG_P ) { static int * const fp_flags[] = { &hf_rtp_midi_sj_chapter_f_mt0, &hf_rtp_midi_sj_chapter_f_mt1, &hf_rtp_midi_sj_chapter_f_mt2, &hf_rtp_midi_sj_chapter_f_mt3, &hf_rtp_midi_sj_chapter_f_mt4, &hf_rtp_midi_sj_chapter_f_mt5, &hf_rtp_midi_sj_chapter_f_mt6, &hf_rtp_midi_sj_chapter_f_mt7, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapter_tree, tvb, offset, hf_rtp_midi_sj_chapter_f_partial, ett_rtp_midi_sj_chapter_f_partial, fp_flags, ENC_BIG_ENDIAN); offset += 4; } return offset-start_offset; } /* * Here the chapter X of the channel-journal is decoded. */ static int decode_sj_chapter_x( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset, unsigned int max_length ) { proto_tree *rtp_midi_sj_chapter_tree; proto_tree *rtp_midi_sj_data_tree; guint8 header; guint8 octet; unsigned int consumed = 0; unsigned int cmdlen = 0; unsigned int i; /* first we need to get the flags of this chapter */ header = tvb_get_guint8( tvb, offset ); rtp_midi_sj_chapter_tree = proto_tree_add_subtree( tree, tvb, offset, max_length, ett_rtp_midi_sj_chapter_x, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_X ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_tflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_cflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_fflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_dflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_lflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_sta, tvb, offset, 1, ENC_BIG_ENDIAN ); consumed++; offset++; if ( header & RTP_MIDI_SJ_CHAPTER_X_FLAG_T ) { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_tcount, tvb, offset, 1, ENC_BIG_ENDIAN ); consumed++; offset++; } if ( header & RTP_MIDI_SJ_CHAPTER_X_FLAG_C ) { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_count, tvb, offset, 1, ENC_BIG_ENDIAN ); consumed++; offset++; } if ( header & RTP_MIDI_SJ_CHAPTER_X_FLAG_F ) { unsigned int field = 0; unsigned int fieldlen = 0; /* FIRST is "compressed" using only the necessary amount of octets, like delta-time */ for ( i=0; i < 4; i++ ) { /* do we still fit in the dissected packet & in the length restriction of this chapter? */ if ( ( !( consumed >= max_length ) ) || ( !tvb_bytes_exist( tvb, offset + fieldlen, 1 ) ) ) { return -1; } octet = tvb_get_guint8( tvb, offset + fieldlen ); field = ( field << 7 ) | ( octet & RTP_MIDI_DELTA_TIME_OCTET_MASK ); fieldlen++; if ( ( octet & RTP_MIDI_DELTA_TIME_EXTENSION ) == 0 ) { break; } } switch (fieldlen) { case 1: proto_tree_add_uint ( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_first1, tvb, offset, fieldlen, field ); break; case 2: proto_tree_add_uint ( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_first2, tvb, offset, fieldlen, field ); break; case 3: proto_tree_add_uint ( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_first3, tvb, offset, fieldlen, field ); break; case 4: proto_tree_add_uint ( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_first4, tvb, offset, fieldlen, field ); break; } consumed += fieldlen; offset += fieldlen; } if ( header & RTP_MIDI_SJ_CHAPTER_X_FLAG_D ) { rtp_midi_sj_data_tree = proto_tree_add_subtree( rtp_midi_sj_chapter_tree, tvb, offset, max_length - consumed, ett_rtp_midi_sj_chapter_x_data, NULL, RTP_MIDI_TREE_NAME_SJ_CHAPTER_X_DATA ); while ( consumed < max_length ) { octet = tvb_get_guint8( tvb, offset + cmdlen ); if ( octet & 0x80 ) { proto_tree_add_item( rtp_midi_sj_data_tree, hf_rtp_midi_sj_chapter_x_data, tvb, offset, cmdlen, ENC_NA ); offset += cmdlen; cmdlen = 0; } else { cmdlen += 1; } consumed += 1; } /* unfinished command still to put into tree */ if ( cmdlen ) { proto_tree_add_item( rtp_midi_sj_data_tree, hf_rtp_midi_sj_chapter_x_invalid_data, tvb, offset, cmdlen, ENC_NA ); offset += cmdlen; } } /* this should not ever enter - we still have data, but flag d was apparently not set... */ if ( consumed < max_length ) { proto_tree_add_item( rtp_midi_sj_chapter_tree, hf_rtp_midi_sj_chapter_x_invalid_data, tvb, offset, max_length - consumed, ENC_NA ); consumed = max_length; } return consumed; } /* * Here the system-journal is decoded. */ static int decode_system_journal( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset ) { proto_tree *rtp_midi_sysjournal_tree; proto_tree *rtp_midi_sj_chapters_tree; unsigned int start_offset = offset; int ext_consumed = 0; guint16 sysjourlen; guint16 systemflags; systemflags = tvb_get_ntohs( tvb, offset ); sysjourlen = systemflags & RTP_MIDI_SJ_MASK_LENGTH; rtp_midi_sysjournal_tree = proto_tree_add_subtree( tree, tvb, offset, sysjourlen, ett_rtp_midi_systemjournal, NULL, RTP_MIDI_TREE_NAME_SYSTEM_JOURNAL ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_s, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_d, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_v, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_q, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_f, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_toc_x, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_sysjournal_tree, hf_rtp_midi_sysjour_len, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; rtp_midi_sj_chapters_tree = proto_tree_add_subtree( rtp_midi_sysjournal_tree, tvb, offset, sysjourlen - 2, ett_rtp_midi_systemchapters, NULL, RTP_MIDI_TREE_NAME_SYSTEM_CHAPTERS ); /* Do we have a simple system commands chapter? */ if ( systemflags & RTP_MIDI_SJ_FLAG_D ) { offset += decode_sj_chapter_d( tvb, pinfo, rtp_midi_sj_chapters_tree, offset ); } /* Do we have a active sensing chapter? */ if ( systemflags & RTP_MIDI_SJ_FLAG_V ) { static int * const v_flags[] = { &hf_rtp_midi_sj_chapter_v_sflag, &hf_rtp_midi_sj_chapter_v_count, NULL }; proto_tree_add_bitmask(rtp_midi_sj_chapters_tree, tvb, offset, hf_rtp_midi_sj_chapter_v, ett_rtp_midi_sj_chapter_v, v_flags, ENC_BIG_ENDIAN); offset++; } /* Do we have a sequencer state commands chapter? */ if ( systemflags & RTP_MIDI_SJ_FLAG_Q ) { offset += decode_sj_chapter_q( tvb, pinfo, rtp_midi_sj_chapters_tree, offset ); } /* Do we have a MTC chapter? */ if ( systemflags & RTP_MIDI_SJ_FLAG_F ) { offset += decode_sj_chapter_f( tvb, pinfo, rtp_midi_sj_chapters_tree, offset ); } /* Do we have a Sysex chapter? */ if ( systemflags & RTP_MIDI_SJ_FLAG_X ) { ext_consumed = decode_sj_chapter_x( tvb, pinfo, rtp_midi_sj_chapters_tree, offset, sysjourlen - (offset-start_offset) ); if ( ext_consumed < 0 ) { return ext_consumed; } offset += ext_consumed; } /* Make sanity check for consumed data vs. stated length of system journal */ if ( offset-start_offset != sysjourlen ) { return -1; } return offset-start_offset; } /* * This is the main dissector function for the RTP-MIDI protocol * It decodes the wrapper of the command-section and punts * decoding of delta-time and the actual MIDI-command itself to * external decoders. Afterwards the journal-section is decoded. */ static int dissect_rtp_midi( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_ ) { proto_item *ti; proto_tree *rtp_midi_tree; unsigned int offset = 0; guint8 flags; /* used for command-section and journal-section*/ unsigned int cmd_len; unsigned int cmd_count; guint8 runningstatus; int consumed; unsigned int rsoffset = 0; guint8 totchan; unsigned int i; col_set_str( pinfo->cinfo, COL_PROTOCOL, RTP_MIDI_DISSECTOR_SHORTNAME ); col_clear( pinfo->cinfo, COL_INFO ); /* * MIDI command section */ /* RTP-MIDI starts with 4 bits of flags... */ flags = tvb_get_guint8( tvb, offset ); ti = proto_tree_add_item( tree, proto_rtp_midi, tvb, 0, -1, ENC_NA ); rtp_midi_tree = proto_item_add_subtree( ti, ett_rtp_midi); /* Decode those four flags */ proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_bflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_jflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_zflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_pflag, tvb, offset, 1, ENC_BIG_ENDIAN ); /* ...followed by a length-field of at least 4 bits */ cmd_len = flags & RTP_MIDI_CS_MASK_SHORTLEN; /* see if we have small or large len-field */ if (flags & RTP_MIDI_CS_FLAG_B) { cmd_len = tvb_get_ntohs( tvb, offset) & RTP_MIDI_CS_MASK_LONGLEN; proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_longlen, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; } else { proto_tree_add_item( rtp_midi_tree, hf_rtp_midi_shortlen, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; } /* if we have a command-section -> dissect it */ if ( cmd_len ) { proto_tree *rtp_midi_commands_tree; rtp_midi_commands_tree = proto_tree_add_subtree( rtp_midi_tree, tvb, offset, cmd_len, ett_rtp_midi_commands, NULL, RTP_MIDI_TREE_NAME_COMMAND ); /* No commands decoded yet */ cmd_count = 0; /* RTP-MIDI-pdus always start with no running status */ runningstatus = 0; /* Multiple MIDI-commands might follow - the exact number can only be discovered by really decoding the commands! */ while ( cmd_len) { /* for the first command we only have a delta-time if Z-Flag is set */ if ( ( cmd_count ) || ( flags & RTP_MIDI_CS_FLAG_Z ) ) { /* Decode a delta-time */ consumed = decodetime( tvb, pinfo, rtp_midi_commands_tree, offset ); /* seek to next command and set remaining length */ offset += consumed; cmd_len -= consumed; } /* Only decode MIDI-command if there is any data left - it is valid to only have delta-time! */ if ( cmd_len ) { /* Decode a MIDI-command - if 0 is returned something went wrong */ consumed = decodemidi( tvb, pinfo, rtp_midi_commands_tree, cmd_count, offset, cmd_len, &runningstatus, &rsoffset ); if ( -1 == consumed ) { return offset; } /* seek to next delta-time and set remaining length */ offset += consumed; cmd_len -= consumed; /* as we have successfully decoded another command, increment count */ cmd_count++; } } } /* * Journal section */ /* if we have a journal-section -> dissect it */ if ( flags & RTP_MIDI_CS_FLAG_J ) { proto_tree *rtp_midi_journal_tree; rtp_midi_journal_tree = proto_tree_add_subtree( rtp_midi_tree, tvb, offset, -1, ett_rtp_midi_journal, NULL, RTP_MIDI_TREE_NAME_JOURNAL ); /* lets get the main flags from the recovery journal header */ flags = tvb_get_guint8( tvb, offset ); proto_tree_add_item( rtp_midi_journal_tree, hf_rtp_midi_sflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_journal_tree, hf_rtp_midi_yflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_journal_tree, hf_rtp_midi_aflag, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_item( rtp_midi_journal_tree, hf_rtp_midi_hflag, tvb, offset, 1, ENC_BIG_ENDIAN ); /* At the same place we find the total channels encoded in the channel journal */ totchan = flags & RTP_MIDI_JS_MASK_TOTALCHANNELS; proto_tree_add_item( rtp_midi_journal_tree, hf_rtp_midi_totchan, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* the checkpoint-sequence-number can be used to see if the recovery journal covers all lost events */ proto_tree_add_item( rtp_midi_journal_tree, hf_rtp_midi_check_seq_num, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; /* do we have system journal? */ if ( flags & RTP_MIDI_JS_FLAG_Y ) { /* first we need to get the flags & length from the system-journal */ consumed = decode_system_journal( tvb, pinfo, rtp_midi_journal_tree, offset ); if ( -1 == consumed ) { return offset; } /* seek to optional channel-journals-section */ offset += consumed; } /* do we have channel journal(s)? */ if ( flags & RTP_MIDI_JS_FLAG_A ) { proto_tree *rtp_midi_chanjournals_tree; rtp_midi_chanjournals_tree = proto_tree_add_subtree( rtp_midi_journal_tree, tvb, offset, -1, ett_rtp_midi_channeljournals, NULL, RTP_MIDI_TREE_NAME_CHANNEL_JOURNAL ); /* iterate through all the channels specified in header */ for ( i = 0; i <= totchan; i++ ) { consumed = decode_channel_journal( tvb, pinfo, rtp_midi_chanjournals_tree, offset ); if ( -1 == consumed ) { return offset; } /* seek to next channel-journal */ offset += consumed; } } } return tvb_captured_length(tvb); } void proto_register_rtp_midi( void ) { module_t *rtp_midi_module; static hf_register_info hf[] = { { &hf_rtp_midi_bflag, { "B-Flag", "rtpmidi.b_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_cs_flag_b), RTP_MIDI_CS_FLAG_B, NULL, HFILL } }, { &hf_rtp_midi_jflag, { "J-Flag", "rtpmidi.j_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_cs_flag_j), RTP_MIDI_CS_FLAG_J, NULL, HFILL } }, { &hf_rtp_midi_zflag, { "Z-Flag", "rtpmidi.z_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_cs_flag_z), RTP_MIDI_CS_FLAG_Z, NULL, HFILL } }, { &hf_rtp_midi_pflag, { "P-Flag", "rtpmidi.p_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_cs_flag_p), RTP_MIDI_CS_FLAG_P, NULL, HFILL } }, { &hf_rtp_midi_shortlen, { "Command length (short)", "rtpmidi.cmd_length_short", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_CS_MASK_SHORTLEN, NULL, HFILL } }, { &hf_rtp_midi_longlen, { "Command length (long)", "rtpmidi.cmd_length_long", FT_UINT16, BASE_DEC, NULL, RTP_MIDI_CS_MASK_LONGLEN, NULL, HFILL } }, { &hf_rtp_midi_sflag, { "S-Flag", "rtpmidi.s_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_JS_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_yflag, { "Y-Flag", "rtpmidi.y_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_y), RTP_MIDI_JS_FLAG_Y, NULL, HFILL } }, { &hf_rtp_midi_aflag, { "A-Flag", "rtpmidi.a_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_a), RTP_MIDI_JS_FLAG_A, NULL, HFILL } }, { &hf_rtp_midi_hflag, { "H-Flag", "rtpmidi.h_flag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_h), RTP_MIDI_JS_FLAG_H, NULL, HFILL } }, { &hf_rtp_midi_totchan, { "Total channels", "rtpmidi.total_channels", FT_UINT8, BASE_DEC, VALS(rtp_midi_js_tot_channels), RTP_MIDI_JS_MASK_TOTALCHANNELS, NULL, HFILL } }, { &hf_rtp_midi_check_seq_num, { "Checkpoint Packet Seqnum", "rtpmidi.check_Seq_num", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_deltatime1, { "Delta Time (one octet)", "rtpmidi.deltatime_1", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_deltatime2, { "Delta Time (two octets)", "rtpmidi.deltatime_2", FT_UINT16, BASE_HEX, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_deltatime3, { "Delta Time (three octets)", "rtpmidi.deltatime_3", FT_UINT24, BASE_HEX, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_deltatime4, { "Delta Time (four octets)", "rtpmidi.deltatime_4", FT_UINT32, BASE_HEX, NULL, 0x7f7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_channel_status, { "Channel Status", "rtpmidi.channel_status", FT_UINT8, BASE_HEX, VALS(rtp_midi_channel_status), 0xf0, NULL, HFILL } }, { &hf_rtp_midi_common_status, { "Common Status", "rtpmidi.common_status", FT_UINT8, BASE_HEX, VALS(rtp_midi_common_status), 0xff, NULL, HFILL } }, { &hf_rtp_midi_channel, { "Channel", "rtpmidi.channel", FT_UINT8, BASE_HEX, VALS(rtp_midi_channels), 0x0f, NULL, HFILL } }, { &hf_rtp_midi_note, { "Note", "rtpmidi.note", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_note_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_velocity, { "Velocity", "rtpmidi.velocity", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_pressure, { "Pressure", "rtpmidi.pressure", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_controller, { "Controller", "rtpmidi.controller", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_controller_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_controller_value, { "Value", "rtpmidi.controller_value", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_program, { "Program", "rtpmidi.program", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_channel_pressure, { "Pressure", "rtpmidi.channel_pressure", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_pitch_bend, { "Pitch Bend", "rtpmidi.pitch_bend", FT_UINT16, BASE_DEC, NULL, 0x7f7f, NULL, HFILL } }, #if 0 { &hf_rtp_midi_pitch_bend_truncated, { "Pitch Bend (truncated)", "rtpmidi.pitch_bend_truncated", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, #endif { &hf_rtp_midi_manu_short, { "Manufacturer (short)", "rtpmidi.manufacturer_short", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rtp_midi_manu_short_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_manu_long, { "Manufacturer (long)", "rtpmidi.manufacturer_long", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &rtp_midi_manu_long_values_ext, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysjour_toc_s, { "System-Journal TOC-S-Flag", "rtpmidi.sysjour_toc_s", FT_BOOLEAN, 16, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sysjour_toc_d, { "System-Journal TOC-D-Flag", "rtpmidi.sysjour_toc_d", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_flag_d), RTP_MIDI_SJ_FLAG_D, NULL, HFILL } }, { &hf_rtp_midi_sysjour_toc_v, { "System-Journal TOC-V-Flag", "rtpmidi.sysjour_toc_v", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_flag_v), RTP_MIDI_SJ_FLAG_V, NULL, HFILL } }, { &hf_rtp_midi_sysjour_toc_q, { "System-Journal TOC-Q-Flag", "rtpmidi.sysjour_toc_q", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_flag_q), RTP_MIDI_SJ_FLAG_Q, NULL, HFILL } }, { &hf_rtp_midi_sysjour_toc_f, { "System-Journal TOC-F-Flag", "rtpmidi.sysjour_toc_f", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_flag_f), RTP_MIDI_SJ_FLAG_F, NULL, HFILL } }, { &hf_rtp_midi_sysjour_toc_x, { "System-Journal TOC-X-Flag", "rtpmidi.sysjour_toc_x", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_flag_x), RTP_MIDI_SJ_FLAG_X, NULL, HFILL } }, { &hf_rtp_midi_sysjour_len, { "System-Journal-Length", "rtpmidi.cmd_sysjour_len", FT_UINT16, BASE_DEC, NULL, RTP_MIDI_SJ_MASK_LENGTH, NULL, HFILL } }, { &hf_rtp_midi_chanjour_sflag, { "Channel-Journal S-Flag", "rtpmidi.chanjour_s", FT_BOOLEAN, 24, TFS(&rtp_midi_js_flag_s), 0x800000, NULL, HFILL } }, { &hf_rtp_midi_chanjour_chan, { "Channel", "rtpmidi.chanjour_channel", FT_UINT24, BASE_HEX, VALS(rtp_midi_channels), 0x780000, NULL, HFILL } }, { &hf_rtp_midi_chanjour_hflag, { "Channel-Journal H-Flag", "rtpmidi.chanjour_h", FT_BOOLEAN, 24, TFS(&rtp_midi_js_flag_h), 0x040000, NULL, HFILL } }, { &hf_rtp_midi_chanjour_len, { "Channel-Journal-Length", "rtpmidi.cmd_chanjour_len", FT_UINT24, BASE_DEC, NULL, 0x03FF00, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_p, { "Channel-Journal TOC-P-Flag", "rtpmidi.chanjour_toc_p", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_p), 0x000080, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_c, { "Channel-Journal TOC-C-Flag", "rtpmidi.chanjour_toc_c", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_c), 0x000040, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_m, { "Channel-Journal TOC-M-Flag", "rtpmidi.chanjour_toc_m", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_m), 0x000020, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_w, { "Channel-Journal TOC-W-Flag", "rtpmidi.chanjour_toc_w", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_w), 0x000010, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_n, { "Channel-Journal TOC-N-Flag", "rtpmidi.chanjour_toc_n", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_n), 0x000008, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_e, { "Channel-Journal TOC-E-Flag", "rtpmidi.chanjour_toc_e", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_e), 0x000004, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_t, { "Channel-Journal TOC-T-Flag", "rtpmidi.chanjour_toc_t", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_t), 0x000002, NULL, HFILL } }, { &hf_rtp_midi_chanjour_toc_a, { "Channel-Journal TOC-A-Flag", "rtpmidi.chanjour_toc_a", FT_BOOLEAN, 24, TFS(&rtp_midi_cj_flag_a), 0x000001, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_p_sflag, { "Chapter P S-Flag", "rtpmidi.cj_chapter_p_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_p_program, { "Chapter P Program", "rtpmidi.cj_chapter_p_program", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_p_bflag, { "Chapter P B-Flag", "rtpmidi.cj_chapter_p_bflag", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_p_bank_msb, { "Chapter P Bank-MSB", "rtpmidi.cj_chapter_p_bank_msb", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_p_xflag, { "Chapter P X-Flag", "rtpmidi.cj_chapter_p_xflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_p_log_flag_x), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_p_bank_lsb, { "Chapter P Bank-LSB", "rtpmidi.cj_chapter_p_bank_lsb", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_sflag, { "Chapter C S-Flag", "rtpmidi.cj_chapter_c_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_length, { "Chapter C Length", "rtpmidi.cj_chapter_c_length", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_number, { "Chapter C Number", "rtpmidi.cj_chapter_c_number", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_controller_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_aflag, { "Chapter C A-Flag", "rtpmidi.cj_chapter_c_aflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_c_flag_a), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_tflag, { "Chapter C T-Flag", "rtpmidi.cj_chapter_c_tflag", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_value, { "Chapter C Value", "rtpmidi.cj_chapter_c_value", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_c_alt, { "Chapter C Alt", "rtpmidi.cj_chapter_c_alt", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_sflag, { "Chapter M S-Flag", "rtpmidi.cj_chapter_m_sflag", FT_BOOLEAN, 16, TFS(&rtp_midi_js_flag_s), 0x8000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_pflag, { "Chapter M P-Flag", "rtpmidi.cj_chapter_m_pflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_flag_p), 0x4000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_eflag, { "Chapter M E-Flag", "rtpmidi.cj_chapter_m_eflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_flag_e), 0x2000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_uflag, { "Chapter M U-Flag", "rtpmidi.cj_chapter_m_uflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_flag_u), 0x1000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_wflag, { "Chapter M W-Flag", "rtpmidi.cj_chapter_m_wflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_flag_w), 0x0800, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_zflag, { "Chapter M Z-Flag", "rtpmidi.cj_chapter_m_zflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_flag_z), 0x0400, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_length, { "Chapter M Length", "rtpmidi.cj_chapter_m_length", FT_UINT16, BASE_DEC, NULL, 0x03ff, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_qflag, { "Chapter M Q-Flag", "rtpmidi.cj_chapter_m_qflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_flag_q), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_pending, { "Chapter M Pending", "rtpmidi.cj_chapter_m_pending", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_sflag, { "Chapter M Log S-Flag", "rtpmidi.cj_chapter_m_log_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_pnum_lsb, { "Chapter M Log PNUM-LSB", "rtpmidi.cj_chapter_m_log_pnum_lsb", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_qflag, { "Chapter M Log Q-Flag", "rtpmidi.cj_chapter_m_log_qflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_q), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_pnum_msb, { "Chapter M Log PNUM-MSB", "rtpmidi.cj_chapter_m_log_pnum_msb", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_jflag, { "Chapter M Log J-Flag", "rtpmidi.cj_chapter_m_log_jflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_j), RTP_MIDI_CJ_CHAPTER_M_FLAG_J, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_kflag, { "Chapter M Log K-Flag", "rtpmidi.cj_chapter_m_log_kflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_k), RTP_MIDI_CJ_CHAPTER_M_FLAG_K, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_lflag, { "Chapter M Log L-Flag", "rtpmidi.cj_chapter_m_log_lflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_l), RTP_MIDI_CJ_CHAPTER_M_FLAG_L, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_mflag, { "Chapter M Log M-Flag", "rtpmidi.cj_chapter_m_log_mflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_m), RTP_MIDI_CJ_CHAPTER_M_FLAG_M, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_nflag, { "Chapter M Log N-Flag", "rtpmidi.cj_chapter_m_log_nflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_n), RTP_MIDI_CJ_CHAPTER_M_FLAG_N, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_tflag, { "Chapter M Log T-Flag", "rtpmidi.cj_chapter_m_log_tflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_t), RTP_MIDI_CJ_CHAPTER_M_FLAG_T, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_vflag, { "Chapter M Log V-Flag", "rtpmidi.cj_chapter_m_log_vflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_v), RTP_MIDI_CJ_CHAPTER_M_FLAG_V, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_rflag, { "Chapter M Log R-Flag", "rtpmidi.cj_chapter_m_log_rflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_r), RTP_MIDI_CJ_CHAPTER_M_FLAG_R, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_msb_entry, { "Entry MSB", "rtpmidi.cj_chapter_m_log_msb_entry", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_msb_x, { "Chapter M Log MSB X-Flag", "rtpmidi.cj_chapter_m_log_msb_xflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_x), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_msb, { "Chapter M Log MSB", "rtpmidi.cj_chapter_m_log_msb", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_lsb_entry, { "Entry LSB", "rtpmidi.cj_chapter_m_log_lsb_entry", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_lsb_x, { "Chapter M Log LSB X-Flag", "rtpmidi.cj_chapter_m_log_lsb_xflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_x), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_lsb, { "Chapter M Log LSB", "rtpmidi.cj_chapter_m_log_lsb", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_a_button_g, { "Chapter M Log A-Button G-Flag", "rtpmidi.cj_chapter_m_log_a_button_gflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_log_flag_g), 0x8000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_a_button_x, { "Chapter M Log A-Button X-Flag", "rtpmidi.cj_chapter_m_log_a_button_xflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_log_flag_x), 0x4000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_a_button, { "Chapter M Log A-Button", "rtpmidi.cj_chapter_m_log_a_button", FT_UINT16, BASE_HEX, NULL, 0x3fff, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_a_button_full, { "A-Button", "rtpmidi.cj_chapter_m_log_a_button_full", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_c_button_g, { "Chapter M Log C-Button G-Flag", "rtpmidi.cj_chapter_m_log_c_button_gflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_log_flag_g), 0x8000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_c_button_r, { "Chapter M Log C-Button R-Flag", "rtpmidi.cj_chapter_m_log_c_button_rflag", FT_BOOLEAN, 16, TFS(&rtp_midi_cj_chapter_m_log_flag_r), 0x4000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_c_button, { "Chapter M Log C-Button", "rtpmidi.cj_chapter_m_log_c_button", FT_UINT16, BASE_HEX, NULL, 0x3fff, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_c_button_full, { "C-Button", "rtpmidi.cj_chapter_m_log_c_button_full", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_count_x, { "Chapter M Log Count X-Flag", "rtpmidi.cj_chapter_m_log_count_xflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_x), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_count, { "Chapter M Log Count", "rtpmidi.cj_chapter_m_log_count", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_m_log_count_full, { "Count", "rtpmidi.cj_chapter_m_log_count_full", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_w_sflag, { "Chapter W S-Flag", "rtpmidi.cj_chapter_w_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_w_first, { "Chapter W First", "rtpmidi.cj_chapter_w_first", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_w_rflag, { "Chapter W R-Flag", "rtpmidi.cj_chapter_w_rflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_m_log_flag_r), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_w_second, { "Chapter W Second", "rtpmidi.cj_chapter_w_second", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_bflag, { "Chapter N B-Flag", "rtpmidi.cj_chapter_n_bflag", FT_BOOLEAN, 16, TFS(&rtp_midi_js_flag_s), 0x8000, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_len, { "Chapter N Length", "rtpmidi.cj_chapter_n_length", FT_UINT16, BASE_DEC, NULL, 0x7f00, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_low, { "Chapter N Low", "rtpmidi.cj_chapter_n_low", FT_UINT16, BASE_DEC, NULL, 0x00f0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_high, { "Chapter N High", "rtpmidi.cj_chapter_n_high", FT_UINT16, BASE_DEC, NULL, 0x000f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_log_sflag, { "Chapter N Log S-Flag", "rtpmidi.cj_chapter_n_log_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_log_notenum, { "Chapter N Log Note", "rtpmidi.cj_chapter_n_log_note", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_note_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_log_yflag, { "Chapter N Log Y-Flag", "rtpmidi.cj_chapter_n_log_yflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_n_log_flag_y), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_log_velocity, { "Chapter N Log Velocity", "rtpmidi.cj_chapter_n_log_velocity", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_n_log_octet, { "Chapter N Log Octet", "rtpmidi.cj_chapter_n_log_octet", FT_UINT8, BASE_HEX, NULL, 0xff, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_sflag, { "Chapter E S-Flag", "rtpmidi.cj_chapter_e_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_len, { "Chapter E Length", "rtpmidi.cj_chapter_e_length", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_log_sflag, { "Chapter E Log S-Flag", "rtpmidi.cj_chapter_e_log_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_log_notenum, { "Chapter E Log Note", "rtpmidi.cj_chapter_e_log_note", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_note_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_log_vflag, { "Chapter N Log V-Flag", "rtpmidi.cj_chapter_n_log_vflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_e_log_flag_v), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_log_velocity, { "Chapter E Log Velocity", "rtpmidi.cj_chapter_e_log_velocity", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_e_log_count, { "Chapter E Log Count", "rtpmidi.cj_chapter_e_log_count", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_t_channel_aftertouch, { "Channel Aftertouch", "rtpmidi.cj_chapter_t_channel_aftertouch", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_t_sflag, { "Chapter T S-Flag", "rtpmidi.cj_chapter_t_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_t_pressure, { "Chapter T Pressure", "rtpmidi.cj_chapter_t_pressure", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_a_sflag, { "Chapter A S-Flag", "rtpmidi.cj_chapter_a_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_a_len, { "Chapter A Length", "rtpmidi.cj_chapter_a_length", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_a_log_sflag, { "Chapter A Log S-Flag", "rtpmidi.cj_chapter_a_log_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_a_log_notenum, { "Chapter A Log Note", "rtpmidi.cj_chapter_a_log_note", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_note_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_a_log_xflag, { "Chapter A Log X-Flag", "rtpmidi.cj_chapter_a_log_xflag", FT_BOOLEAN, 8, TFS(&rtp_midi_cj_chapter_a_log_flag_x), 0x80, NULL, HFILL } }, { &hf_rtp_midi_cj_chapter_a_log_pressure, { "Chapter A Log Pressure", "rtpmidi.cj_chapter_a_log_pressure", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_v, { "Active Sensing", "rtpmidi.sj_chapter_v", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_v_sflag, { "Chapter V S-Flag", "rtpmidi.sj_chapter_v_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), 0x80, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_v_count, { "Chapter V Count", "rtpmidi.sj_chapter_v_count", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_simple_system_commands, { "Simple System Commands", "rtpmidi.sj_chapter_d_simple_system_commands", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sflag, { "Chapter D S-Flag", "rtpmidi.sj_chapter_d_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_D_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_bflag, { "Chapter D B-Flag", "rtpmidi.sj_chapter_d_bflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_b), RTP_MIDI_SJ_CHAPTER_D_FLAG_B, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_gflag, { "Chapter D G-Flag", "rtpmidi.sj_chapter_d_gflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_g), RTP_MIDI_SJ_CHAPTER_D_FLAG_G, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_hflag, { "Chapter D H-Flag", "rtpmidi.sj_chapter_d_hflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_h), RTP_MIDI_SJ_CHAPTER_D_FLAG_H, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_jflag, { "Chapter D J-Flag", "rtpmidi.sj_chapter_d_jflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_j), RTP_MIDI_SJ_CHAPTER_D_FLAG_J, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_kflag, { "Chapter D K-Flag", "rtpmidi.sj_chapter_d_kflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_k), RTP_MIDI_SJ_CHAPTER_D_FLAG_K, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_yflag, { "Chapter D Y-Flag", "rtpmidi.sj_chapter_d_yflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_y), RTP_MIDI_SJ_CHAPTER_D_FLAG_Y, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_zflag, { "Chapter D Z-Flag", "rtpmidi.sj_chapter_d_zflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_flag_z), RTP_MIDI_SJ_CHAPTER_D_FLAG_Z, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_reset, { "Reset Field", "rtpmidi.cj_chapter_d_reset", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_reset_sflag, { "Chapter D Reset S-Flag", "rtpmidi.sj_chapter_d_reset_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_D_RESET_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_reset_count, { "Chapter D Reset Count", "rtpmidi.cj_chapter_d_reset_count", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_RESET_COUNT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_tune, { "Tune Request Field", "rtpmidi.cj_chapter_d_tune", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_tune_sflag, { "Chapter D Tune Request S-Flag", "rtpmidi.sj_chapter_d_tune_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_D_TUNE_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_tune_count, { "Chapter D Tune Request Count", "rtpmidi.cj_chapter_d_tune_count", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_TUNE_COUNT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_song_sel, { "Song Select Field", "rtpmidi.cj_chapter_d_song_sel", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_song_sel_sflag, { "Chapter D Song Select S-Flag", "rtpmidi.sj_chapter_d_song_sel_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_D_SONG_SEL_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_song_sel_value, { "Chapter D Song Select Value", "rtpmidi.cj_chapter_d_song_sel_value", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_SONG_SEL_VALUE, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_sflag, { "Chapter D System Common (F4/F5) S-Flag", "rtpmidi.sj_chapter_d_syscom_sflag", FT_BOOLEAN, 16, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_cflag, { "Chapter D System Common (F4/F5) C-Flag", "rtpmidi.sj_chapter_d_syscom_cflag", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_chapter_d_syscom_flag_c), RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_C, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_vflag, { "Chapter D System Common (F4/F5) V-Flag", "rtpmidi.sj_chapter_d_syscom_vflag", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_chapter_d_syscom_flag_v), RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_V, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_lflag, { "Chapter D System Common (F4/F5) L-Flag", "rtpmidi.sj_chapter_d_syscom_lflag", FT_BOOLEAN, 16, TFS(&rtp_midi_sj_chapter_d_syscom_flag_l), RTP_MIDI_SJ_CHAPTER_D_SYSCOM_FLAG_L, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_dsz, { "Chapter D System Common (F4/F5) DSZ", "rtpmidi.sj_chapter_d_syscom_dsz", FT_UINT16, BASE_DEC, VALS(rtp_midi_sj_chapter_d_syscom_dsz_values), RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_DSZ, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_length, { "Chapter D System Common (F4/F5) Length", "rtpmidi.sj_chapter_d_syscom_len", FT_UINT16, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_LENGTH, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_count, { "Chapter D System Common (F4/F5) Count", "rtpmidi.sj_chapter_d_syscom_count", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_SYSCOM_MASK_COUNT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_value, { "Chapter D System Common (F4/F5) Value", "rtpmidi.sj_chapter_d_syscom_value", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_legal, { "Chapter D System Common (F4/F5) Legal - for future extension", "rtpmidi.sj_chapter_d_syscom_legal", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_syscom_data, { "Chapter D System Common (F4/F5) Erroneous Data", "rtpmidi.sj_chapter_d_syscom_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_sflag, { "Chapter D System Realtime (F9/FD) S-Flag", "rtpmidi.sj_chapter_d_sysreal_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_cflag, { "Chapter D System Realtime (F9/FF) C-Flag", "rtpmidi.sj_chapter_d_sysreal_cflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_syscom_flag_c), RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_C, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_lflag, { "Chapter D System Realtime (F9/FD) L-Flag", "rtpmidi.sj_chapter_d_sysreal_lflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_d_syscom_flag_l), RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_L, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_length, { "Chapter D System Realtime (F9/FD) Length", "rtpmidi.sj_chapter_d_sysreal_len", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_LENGTH, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_count, { "Chapter D System Realtime (F9/FD) Count", "rtpmidi.sj_chapter_d_sysreal_count", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_D_SYSREAL_MASK_COUNT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_legal, { "Chapter D System Realtime (F9/FD) Legal - for future extension", "rtpmidi.sj_chapter_d_sysreal_legal", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_d_sysreal_data, { "Chapter D System Realtime (F9/FD) Erroneous Data", "rtpmidi.sj_chapter_d_sysreal_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_sflag, { "Chapter Q Sequencer State S-Flag", "rtpmidi.sj_chapter_q_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_Q_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_nflag, { "Chapter Q Sequencer State N-Flag", "rtpmidi.sj_chapter_q_nflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_q_flag_n), RTP_MIDI_SJ_CHAPTER_Q_FLAG_N, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_dflag, { "Chapter Q Sequencer State D-Flag", "rtpmidi.sj_chapter_q_dflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_q_flag_d), RTP_MIDI_SJ_CHAPTER_Q_FLAG_D, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_cflag, { "Chapter Q Sequencer State C-Flag", "rtpmidi.sj_chapter_q_cflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_q_flag_c), RTP_MIDI_SJ_CHAPTER_Q_FLAG_C, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_tflag, { "Chapter Q Sequencer State T-Flag", "rtpmidi.sj_chapter_q_tflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_q_flag_t), RTP_MIDI_SJ_CHAPTER_Q_FLAG_T, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_top, { "Chapter Q Sequencer State Top", "rtpmidi.sj_chapter_q_top", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_Q_MASK_TOP, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_clock, { "Chapter Q Sequencer State Clock", "rtpmidi.sj_chapter_q_clock", FT_UINT24, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_Q_MASK_CLOCK, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_q_timetools, { "Chapter Q Sequencer State Timetools", "rtpmidi.sj_chapter_q_timetools", FT_UINT24, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_Q_MASK_TIMETOOLS, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_sflag, { "Chapter F MTC S-Flag", "rtpmidi.sj_chapter_f_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_F_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_cflag, { "Chapter F MTC C-Flag", "rtpmidi.sj_chapter_f_cflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_f_flag_c), RTP_MIDI_SJ_CHAPTER_F_FLAG_C, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_pflag, { "Chapter F MTC P-Flag", "rtpmidi.sj_chapter_f_pflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_f_flag_p), RTP_MIDI_SJ_CHAPTER_F_FLAG_P, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_qflag, { "Chapter F MTC Q-Flag", "rtpmidi.sj_chapter_f_qflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_f_flag_q), RTP_MIDI_SJ_CHAPTER_F_FLAG_Q, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_dflag, { "Chapter F MTC D-Flag", "rtpmidi.sj_chapter_f_dflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_f_flag_d), RTP_MIDI_SJ_CHAPTER_F_FLAG_D, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_point, { "Chapter F MTC Point", "rtpmidi.sj_chapter_f_point", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_POINT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_complete, { "Complete field", "rtpmidi.sj_chapter_f_complete", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_partial, { "Partial field", "rtpmidi.sj_chapter_f_partial", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt0, { "Chapter F MTC MT0", "rtpmidi.sj_chapter_f_mt0", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT0, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt1, { "Chapter F MTC MT1", "rtpmidi.sj_chapter_f_mt1", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT1, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt2, { "Chapter F MTC MT2", "rtpmidi.sj_chapter_f_mt2", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT2, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt3, { "Chapter F MTC MT3", "rtpmidi.sj_chapter_f_mt3", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT3, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt4, { "Chapter F MTC MT4", "rtpmidi.sj_chapter_f_mt4", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT4, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt5, { "Chapter F MTC MT5", "rtpmidi.sj_chapter_f_mt5", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT5, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt6, { "Chapter F MTC MT6", "rtpmidi.sj_chapter_f_mt6", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT6, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mt7, { "Chapter F MTC MT7", "rtpmidi.sj_chapter_f_mt7", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MT7, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_hr, { "Chapter F MTC Hour", "rtpmidi.sj_chapter_f_hr", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_HR, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_mn, { "Chapter F MTC Minute", "rtpmidi.sj_chapter_f_mn", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_MN, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_sc, { "Chapter F MTC Second", "rtpmidi.sj_chapter_f_sc", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_SC, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_f_fr, { "Chapter F MTC Frame", "rtpmidi.sj_chapter_f_fr", FT_UINT32, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_F_MASK_FR, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_sflag, { "Chapter X Sysex S-Flag", "rtpmidi.sj_chapter_x_sflag", FT_BOOLEAN, 8, TFS(&rtp_midi_js_flag_s), RTP_MIDI_SJ_CHAPTER_X_FLAG_S, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_tflag, { "Chapter X Sysex T-Flag", "rtpmidi.sj_chapter_x_tflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_x_flag_t), RTP_MIDI_SJ_CHAPTER_X_FLAG_T, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_cflag, { "Chapter X Sysex C-Flag", "rtpmidi.sj_chapter_x_cflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_x_flag_c), RTP_MIDI_SJ_CHAPTER_X_FLAG_C, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_fflag, { "Chapter X Sysex F-Flag", "rtpmidi.sj_chapter_x_fflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_x_flag_f), RTP_MIDI_SJ_CHAPTER_X_FLAG_F, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_dflag, { "Chapter X Sysex D-Flag", "rtpmidi.sj_chapter_x_dflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_x_flag_d), RTP_MIDI_SJ_CHAPTER_X_FLAG_D, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_lflag, { "Chapter X Sysex L-Flag", "rtpmidi.sj_chapter_x_lflag", FT_BOOLEAN, 8, TFS(&rtp_midi_sj_chapter_x_flag_l), RTP_MIDI_SJ_CHAPTER_X_FLAG_L, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_sta, { "Chapter X Sysex STA", "rtpmidi.sj_chapter_x_sta", FT_UINT8, BASE_HEX, NULL, RTP_MIDI_SJ_CHAPTER_X_MASK_STA, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_tcount, { "Chapter X Sysex TCOUT", "rtpmidi.sj_chapter_x_tcount", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_X_MASK_TCOUNT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_count, { "Chapter X Sysex COUNT", "rtpmidi.sj_chapter_x_count", FT_UINT8, BASE_DEC, NULL, RTP_MIDI_SJ_CHAPTER_X_MASK_COUNT, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_first1, { "Chapter X Sysex FIRST (one octet)", "rtpmidi.sj_chapter_x_first_1", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_first2, { "Chapter X Sysex FIRST (two octets)", "rtpmidi.sj_chapter_x_first_2", FT_UINT16, BASE_HEX, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_first3, { "Chapter X Sysex FIRST (three octets)", "rtpmidi.sj_chapter_x_first_3", FT_UINT24, BASE_HEX, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_first4, { "Chapter X Sysex FIRST (four octets)", "rtpmidi.sj_chapter_x_first_4", FT_UINT32, BASE_HEX, NULL, 0x7f7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_data, { "Chapter X Sysex Data", "rtpmidi.sj_chapter_x_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sj_chapter_x_invalid_data, { "Chapter X Invalid Sysex Data", "rtpmidi.sj_chapter_x_invalid_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_quarter_frame_type, { "MTC-quarter-frame-type", "rtpmidi.mtc_quarter_frame_type", FT_UINT8, BASE_HEX, VALS(rtp_midi_qft_values), 0x70, NULL, HFILL } }, { &hf_rtp_midi_quarter_frame_value, { "MTC-quarter-frame-value", "rtpmidi.mtc_quarter_frame_value", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_spp, { "Song Position Pointer", "rtpmidi.song_position_pointer", FT_UINT16, BASE_DEC, NULL, 0x7f7f, NULL, HFILL } }, #if 0 { &hf_rtp_midi_spp_truncated, { "Song Position Pointer (truncated)", "rtpmidi.song_position_pointer_truncated", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, #endif { &hf_rtp_midi_song_select, { "Song Select", "rtpmidi.song_select", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_manu_data, { "Manufacturer specific data", "rtpmidi.manu_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_edu_data, { "Educational command data", "rtpmidi.edu_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_unknown_data, { "Unknown Data", "rtpmidi.unknown_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_realtime, { "Sysex Common Realtime", "rtpmidi.sysex_common_realtime", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_non_realtime, { "Sysex Common Non-Realtime", "rtpmidi.sysex_common_non_realtime", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_device_id, { "Sysex Common Device ID", "rtpmidi.sysex_common_device_id", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_ext, { "Sysex Common Non-Realtime Sample Dump Extension", "rtpmidi.sysex_common_non_realtime_sample_dump_ext", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt_sd_ext), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_gi, { "Sysex Common Non-Realtime General Information", "rtpmidi.sysex_common_non_realtime_general_information", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt_gi), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd, { "Sysex Common Non-Realtime File Dump", "rtpmidi.sysex_common_non_realtime_file_dump", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt_fd), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tuning, { "Sysex Common (Non-)Realtime Tuning", "rtpmidi.sysex_common_tuning", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_tuning), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_gm, { "Sysex Common Non-Realtime General MIDI (GM)", "rtpmidi.sysex_common_non_realtime_gm", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt_gm), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_dls, { "Sysex Common Non-Realtime Downloadable Sounds (DLS)", "rtpmidi.sysex_common_non_realtime_dls", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt_dls), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc, { "Sysex Common Realtime MTC", "rtpmidi.sysex_common_realtime_mtc", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt_mtc), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_sc, { "Sysex Common Realtime Show Control", "rtpmidi.sysex_common_realtime_sc", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rtp_midi_sysex_common_rt_show_control_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni, { "Sysex Common Realtime Notation Information", "rtpmidi.sysex_common_realtime_ni", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt_notations), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_dc, { "Sysex Common Realtime Device Control", "rtpmidi.sysex_common_realtime_dc", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt_device_control), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_cueing, { "Sysex Common Realtime MTC Cueing", "rtpmidi.sysex_common_rt_mtc_cue", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt_mtc_cue), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc, { "Sysex Common Non-Realtime MTC", "rtpmidi.sysex_common_nrt_mtc", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_nrt_mtc), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mmc_commands, { "Sysex Common Realtime Machine Control Commands", "rtpmidi.sysex_common_realtime_mmc_cmds", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt_mmc_commands), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mmc_responses, { "Sysex Common Realtime Machine Control Responses", "rtpmidi.sysex_common_realtime_mmc_resps", FT_UINT8, BASE_HEX, VALS(rtp_midi_sysex_common_rt_mmc_responses), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_gi_device_family, { "Sysex Common Non-Realtime General Information Device Family", "rtpmidi.sysex_common_non_realtime_general_information_device_family", FT_UINT16, BASE_HEX, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_gi_device_family_member, { "Sysex Common Non-Realtime General Information Device Family Member", "rtpmidi.sysex_common_non_realtime_general_information_device_family_member", FT_UINT16, BASE_HEX, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_gi_software_rev, { "Sysex Common Non-Realtime General Information Software Revision", "rtpmidi.sysex_common_non_realtime_general_information_software_revision", FT_UINT32, BASE_HEX, NULL, 0x7f7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_packet_number, { "Sysex Common Non-Realtime Sample Dump Packet Number", "rtpmidi.sysex_common_non_realtime_sample_dump_packet_number", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_sn, { "Sysex Common Non-Realtime Sample Dump Sample Number", "rtpmidi.sysex_common_non_realtime_sample_dump_sample_number", FT_UINT16, BASE_DEC, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_sf, { "Sysex Common Non-Realtime Sample Dump Sample Format", "rtpmidi.sysex_common_non_realtime_sample_dump_sample_format", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_sp, { "Sysex Common Non-Realtime Sample Dump Sample Period", "rtpmidi.sysex_common_non_realtime_sample_dump_sample_period", FT_UINT24, BASE_DEC, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_sl, { "Sysex Common Non-Realtime Sample Dump Sample Length", "rtpmidi.sysex_common_non_realtime_sample_dump_sample_length", FT_UINT24, BASE_DEC, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_ls, { "Sysex Common Non-Realtime Sample Dump Loop Start", "rtpmidi.sysex_common_non_realtime_sample_dump_loop_start", FT_UINT24, BASE_DEC, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_le, { "Sysex Common Non-Realtime Sample Dump Loop End", "rtpmidi.sysex_common_non_realtime_sample_dump_loop_end", FT_UINT24, BASE_DEC, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_header_lt, { "Sysex Common Non-Realtime Sample Dump Loop Type", "rtpmidi.sysex_common_non_realtime_sample_dump_loop_type", FT_UINT8, BASE_DEC, VALS(rtp_midi_sysex_common_nrt_sd_lt), 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_packet_count, { "Sysex Common Non-Realtime Sample Dump Running Packet Count", "rtpmidi.sysex_common_non_realtime_sample_dump_packet_count", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_packet_check, { "Sysex Common Non-Realtime Sample Dump Checksum", "rtpmidi.sysex_common_non_realtime_sample_dump_checksum", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_packet_data, { "Sysex Common Non-Realtime Sample Dump Data Byte", "rtpmidi.sysex_common_non_realtime_sample_dump_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_sd_ext_ln, { "Sysex Common Non-Realtime Sample Dump LP Transmission Loop Number", "rtpmidi.sysex_common_non_realtime_sample_dump_lp_trans_ln", FT_UINT16, BASE_DEC, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_device_id, { "Sysex Common Non-Realtime File Dump Device ID", "rtpmidi.sysex_common_non_realtime_fd_device_id", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_type, { "Sysex Common Non-Realtime File Dump File Type", "rtpmidi.sysex_common_non_realtime_fd_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_name, { "Sysex Common Non-Realtime File Dump File Name", "rtpmidi.sysex_common_non_realtime_fd_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_length, { "Sysex Common Non-Realtime File Dump Length", "rtpmidi.sysex_common_non_realtime_fd_length", FT_UINT32, BASE_DEC, NULL, 0x7f7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_packet_num, { "Sysex Common Non-Realtime File Packet Number", "rtpmidi.sysex_common_non_realtime_fd_packet_num", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_byte_count, { "Sysex Common Non-Realtime File Byte Count", "rtpmidi.sysex_common_non_realtime_fd_byte_count", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_packet_data, { "Sysex Common Non-Realtime File Packet Data", "rtpmidi.sysex_common_non_realtime_fd_packet_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_fd_checksum, { "Sysex Common Non-Realtime File Checksum", "rtpmidi.sysex_common_non_realtime_fd_checksum", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tune_program, { "Sysex Common (Non-)Realtime Tuning Program", "rtpmidi.sysex_common_tune_program", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tune_name, { "Sysex Common (Non-)Realtime Tuning Name", "rtpmidi.sysex_common_tune_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tune_freq, { "Sysex Common (Non-)Realtime Tuning Frequency", "rtpmidi.sysex_common_tune_freq", FT_UINT24, BASE_HEX, NULL, 0x7f7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tune_checksum, { "Sysex Common (Non-)Realtime Tuning Checksum", "rtpmidi.sysex_common_tune_checksum", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tune_changes, { "Sysex Common (Non-)Realtime Tuning Changes", "rtpmidi.sysex_common_tune_changes", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_tune_note, { "Sysex Common (Non-)Realtime Tuning Note", "rtpmidi.sysex_common_tune_note", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rtp_midi_note_values_ext, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_fm_type, { "Sysex Common Realtime MTC Full Message Type", "rtpmidi.sysex_common_rt_mtc_fm_type", FT_UINT8, BASE_HEX, VALS(rtp_midi_mtc_fm_type_values), 0x60, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_fm_hr, { "Sysex Common Realtime MTC Full Message Hour", "rtpmidi.sysex_common_rt_mtc_fm_hour", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_fm_mn, { "Sysex Common Realtime MTC Full Message Minute", "rtpmidi.sysex_common_rt_mtc_fm_minute", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_fm_sc, { "Sysex Common Realtime MTC Full Message Second", "rtpmidi.sysex_common_rt_mtc_fm_second", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_fm_fr, { "Sysex Common Realtime MTC Full Message Frame", "rtpmidi.sysex_common_rt_mtc_fm_frame", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u1, { "Sysex Common Realtime MTC User Bits U1", "rtpmidi.sysex_common_rt_mtc_ub_u1", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u2, { "Sysex Common Realtime MTC User Bits U2", "rtpmidi.sysex_common_rt_mtc_ub_u2", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u3, { "Sysex Common Realtime MTC User Bits U3", "rtpmidi.sysex_common_rt_mtc_ub_u3", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u4, { "Sysex Common Realtime MTC User Bits U4", "rtpmidi.sysex_common_rt_mtc_ub_u4", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u5, { "Sysex Common Realtime MTC User Bits U5", "rtpmidi.sysex_common_rt_mtc_ub_u5", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u6, { "Sysex Common Realtime MTC User Bits U6", "rtpmidi.sysex_common_rt_mtc_ub_u6", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u7, { "Sysex Common Realtime MTC User Bits U7", "rtpmidi.sysex_common_rt_mtc_ub_u7", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u8, { "Sysex Common Realtime MTC User Bits U8", "rtpmidi.sysex_common_rt_mtc_ub_u8", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_ub_u9, { "Sysex Common Realtime MTC User Bits U9", "rtpmidi.sysex_common_rt_mtc_ub_u9", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_type, { "Sysex Common Non-Realtime MTC Type", "rtpmidi.sysex_common_nrt_mtc_type", FT_UINT8, BASE_HEX, VALS(rtp_midi_mtc_fm_type_values), 0x60, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_hr, { "Sysex Common Non-Realtime MTC Hour", "rtpmidi.sysex_common_nrt_mtc_hour", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_mn, { "Sysex Common Non-Realtime MTCMinute", "rtpmidi.sysex_common_nrt_mtc_minute", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_sc, { "Sysex Common Non-Realtime MTC Second", "rtpmidi.sysex_common_nrt_mtc_second", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_fr, { "Sysex Common Non-Realtime MTC Frame", "rtpmidi.sysex_common_nrt_mtc_frame", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_ff, { "Sysex Common Non-Realtime MTC Fractional Frame", "rtpmidi.sysex_common_nrt_mtc_fract_frame", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_enl, { "Sysex Common Non-Realtime MTC Event Number (LSB)", "rtpmidi.sysex_common_nrt_mtc_en_lsb", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_enm, { "Sysex Common Non-Realtime MTC Event Number (MSB)", "rtpmidi.sysex_common_nrt_mtc_en_msb", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_nrt_mtc_add, { "Sysex Common Non-Realtime MTC Additional Info", "rtpmidi.sysex_common_nrt_mtc_add", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_cue_enl, { "Sysex Common Realtime MTC Cue Event Number (LSB)", "rtpmidi.sysex_common_rt_mtc_cue_en_lsb", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_cue_enm, { "Sysex Common Realtime MTC Cue Event Number (MSB)", "rtpmidi.sysex_common_rt_mtc_cue_en_msb", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_mtc_cue_add, { "Sysex Common Realtime MTC Cue Additional Info", "rtpmidi.sysex_common_rt_mtc_cue_add", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni_bar_num, { "Sysex Common Realtime NI Bar Number", "rtpmidi.sysex_common_rt_ni_barnum", FT_UINT16, BASE_HEX, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni_bytes, { "Sysex Common Realtime NI Bytes", "rtpmidi.sysex_common_rt_ni_bytes", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni_numerator, { "Sysex Common Realtime NI Numerator", "rtpmidi.sysex_common_rt_ni_numerator", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni_denominator, { "Sysex Common Realtime NI Denominator", "rtpmidi.sysex_common_rt_ni_denominator", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni_midi_clocks, { "Sysex Common Realtime NI MIDI clocks in click", "rtpmidi.sysex_common_rt_ni_midiclock", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_ni_32nds, { "Sysex Common Realtime NI 32nd notes in MIDI quarter note", "rtpmidi.sysex_common_rt_ni_32nds", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_dc_volume, { "Sysex Common Realtime DC Volume", "rtpmidi.sysex_common_rt_dc_volume", FT_UINT16, BASE_DEC, NULL, 0x7f7f, NULL, HFILL } }, { &hf_rtp_midi_sysex_common_rt_dc_balance, { "Sysex Common Realtime DC Balance", "rtpmidi.sysex_common_rt_dc_balance", FT_UINT16, BASE_DEC, NULL, 0x7f7f, NULL, HFILL } } }; static gint *ett[] = { &ett_rtp_midi, &ett_rtp_midi_commands, &ett_rtp_midi_journal, &ett_rtp_midi_command, &ett_rtp_midi_systemjournal, &ett_rtp_midi_channeljournals, &ett_rtp_midi_channelchapters, &ett_rtp_midi_cj_chapter_p, &ett_rtp_midi_cj_chapter_c, &ett_rtp_midi_cj_chapter_c_loglist, &ett_rtp_midi_cj_chapter_c_logitem, &ett_rtp_midi_cj_chapter_m, &ett_rtp_midi_cj_chapter_m_loglist, &ett_rtp_midi_cj_chapter_m_logitem, &ett_rtp_midi_cj_chapter_m_log_msb, &ett_rtp_midi_cj_chapter_m_log_lsb, &ett_rtp_midi_cj_chapter_m_log_a_button, &ett_rtp_midi_cj_chapter_m_log_c_button, &ett_rtp_midi_cj_chapter_m_log_count, &ett_rtp_midi_cj_chapter_w, &ett_rtp_midi_cj_chapter_n, &ett_rtp_midi_cj_chapter_n_loglist, &ett_rtp_midi_cj_chapter_n_logitem, &ett_rtp_midi_cj_chapter_n_octets, &ett_rtp_midi_cj_chapter_e, &ett_rtp_midi_cj_chapter_e_loglist, &ett_rtp_midi_cj_chapter_e_logitem, &ett_rtp_midi_cj_chapter_t, &ett_rtp_midi_cj_chapter_a, &ett_rtp_midi_cj_chapter_a_loglist, &ett_rtp_midi_cj_chapter_a_logitem, &ett_rtp_midi_systemchapters, &ett_rtp_midi_sj_chapter_d, &ett_rtp_midi_sj_chapter_d_field_b, &ett_rtp_midi_sj_chapter_d_field_g, &ett_rtp_midi_sj_chapter_d_field_h, &ett_rtp_midi_sj_chapter_d_field_j, &ett_rtp_midi_sj_chapter_d_field_k, &ett_rtp_midi_sj_chapter_d_field_y, &ett_rtp_midi_sj_chapter_d_field_z, &ett_rtp_midi_sj_chapter_v, &ett_rtp_midi_sj_chapter_q, &ett_rtp_midi_sj_chapter_f, &ett_rtp_midi_sj_chapter_f_complete, &ett_rtp_midi_sj_chapter_f_partial, &ett_rtp_midi_sj_chapter_x, &ett_rtp_midi_sj_chapter_x_first, &ett_rtp_midi_sj_chapter_x_data, &ett_rtp_midi_channeljournal, &ett_rtp_midi_sysex_data, &ett_rtp_midi_sysex_common_rt, &ett_rtp_midi_sysex_common_nrt, &ett_rtp_midi_sysex_common_tune_note, &ett_rtp_midi_sysex_manu, &ett_rtp_midi_sysex_edu }; proto_rtp_midi = proto_register_protocol( RTP_MIDI_DISSECTOR_NAME, RTP_MIDI_DISSECTOR_SHORTNAME, RTP_MIDI_DISSECTOR_ABBREVIATION ); proto_register_field_array( proto_rtp_midi, hf, array_length( hf ) ); proto_register_subtree_array( ett, array_length( ett ) ); rtp_midi_module = prefs_register_protocol( proto_rtp_midi, NULL ); prefs_register_obsolete_preference( rtp_midi_module, "midi_payload_type_value"); rtp_midi_handle = register_dissector( RTP_MIDI_DISSECTOR_ABBREVIATION, dissect_rtp_midi, proto_rtp_midi ); } void proto_reg_handoff_rtp_midi( void ) { dissector_add_string("rtp_dyn_payload_type", "rtp-midi", rtp_midi_handle); dissector_add_uint_range_with_preference( "rtp.pt", "", rtp_midi_handle ); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-rtp.c
/* packet-rtp.c * * Routines for RTP dissection * RTP = Real time Transport Protocol * * Copyright 2000, Philips Electronics N.V. * Written by Andreas Sikkema <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This dissector tries to dissect the RTP protocol according to Annex A * of ITU-T Recommendation H.225.0 (02/98) or RFC 3550 (obsoleting 1889). * * RTP traffic is traditionally handled by an even UDP portnumber. This can * be any port number, but there is a registered port available, port 5004 * See Annex B of ITU-T Recommendation H.225.0, section B.7 * * Note that nowadays RTP and RTCP are often multiplexed onto a single port, * per RFC 5671. * * This doesn't dissect older versions of RTP, such as: * * the vat protocol ("version 0") - see * * ftp://ftp.ee.lbl.gov/conferencing/vat/alpha-test/vatsrc-4.0b2.tar.gz * * and look in "session-vat.cc" if you want to write a dissector * (have fun - there aren't any nice header files showing the packet * format); * * version 1, as documented in * * ftp://gaia.cs.umass.edu/pub/hgschulz/rtp/draft-ietf-avt-rtp-04.txt * * It also dissects PacketCable CCC-encapsulated RTP data, as described in * chapter 5 of the PacketCable Electronic Surveillance Specification: * * http://www.packetcable.com/downloads/specs/PKT-SP-ESP1.5-I01-050128.pdf */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/show_exception.h> #include <epan/expert.h> #include <epan/proto_data.h> #include <epan/decode_as.h> #include "packet-rtp.h" #include "packet-rtcp.h" #include "packet-tcp.h" #include <epan/rtp_pt.h> #include <epan/tap.h> #include <epan/prefs.h> /* un-comment the following as well as this line in conversation.c, to enable debug printing */ /* #define DEBUG_CONVERSATION */ #include "conversation_debug.h" /* uncomment this to enable debugging of fragment reassembly */ /* #define DEBUG 1 */ /* #define DEBUG_FRAGMENTS 1 */ typedef struct _rfc2198_hdr { unsigned int pt; int offset; int len; const char* payload_type_str; int payload_rate; unsigned payload_channels; wmem_map_t *payload_fmtp_map; struct _rfc2198_hdr *next; } rfc2198_hdr; /* we have one of these for each pdu which spans more than one segment */ typedef struct _rtp_multisegment_pdu { /* the seqno of the segment where the pdu starts */ guint32 startseq; /* the seqno of the segment where the pdu ends */ guint32 endseq; } rtp_multisegment_pdu; typedef struct _rtp_private_conv_info { /* This tree is indexed by sequence number and keeps track of all * all pdus spanning multiple segments for this flow. */ wmem_tree_t *multisegment_pdus; } rtp_private_conv_info; typedef struct _rtp_number_space { uint32_t extended_seqno; uint64_t extended_timestamp; } rtp_number_space; /** Info to save in RTP conversation */ struct _rtp_conversation_info { gchar method[MAX_RTP_SETUP_METHOD_SIZE + 1]; guint32 frame_number; /**> the frame where this conversation is started */ guint32 media_types; rtp_dyn_payload_t* rtp_dyn_payload; /**> the dynamic RTP payload info - see comments above */ wmem_map_t* ssrc_number_space; /**> maps the SSRCs to the last seen seqno and timestamp * for that SSRC in the conversation */ struct _rtp_private_conv_info* rtp_conv_info; /**> conversation info private * to the rtp dissector */ struct srtp_info* srtp_info; /* SRTP context */ bta2dp_codec_info_t* bta2dp_info; btvdp_codec_info_t* btvdp_info; wmem_array_t* rtp_sdp_setup_info_list; /**> List with data from all SDP occurencies for this steram holding a call ID)*/ }; typedef struct { char *encoding_name; int sample_rate; unsigned channels; wmem_map_t *fmtp_map; } encoding_name_and_rate_t; struct _rtp_dyn_payload_t { GHashTable *table; size_t ref_count; }; static reassembly_table rtp_reassembly_table; static int hf_rtp_fragments = -1; static int hf_rtp_fragment = -1; static int hf_rtp_fragment_overlap = -1; static int hf_rtp_fragment_overlap_conflict = -1; static int hf_rtp_fragment_multiple_tails = -1; static int hf_rtp_fragment_too_long_fragment = -1; static int hf_rtp_fragment_error = -1; static int hf_rtp_fragment_count = -1; static int hf_rtp_reassembled_in = -1; static int hf_rtp_reassembled_length = -1; static gint ett_rtp_fragment = -1; static gint ett_rtp_fragments = -1; static const fragment_items rtp_fragment_items = { &ett_rtp_fragment, &ett_rtp_fragments, &hf_rtp_fragments, &hf_rtp_fragment, &hf_rtp_fragment_overlap, &hf_rtp_fragment_overlap_conflict, &hf_rtp_fragment_multiple_tails, &hf_rtp_fragment_too_long_fragment, &hf_rtp_fragment_error, &hf_rtp_fragment_count, &hf_rtp_reassembled_in, &hf_rtp_reassembled_length, /* Reassembled data field */ NULL, "RTP fragments" }; static dissector_handle_t rtp_handle; static dissector_handle_t rtp_rfc4571_handle; static dissector_handle_t rtcp_handle; static dissector_handle_t classicstun_handle; static dissector_handle_t stun_handle; static dissector_handle_t classicstun_heur_handle; static dissector_handle_t stun_heur_handle; static dissector_handle_t t38_handle; static dissector_handle_t zrtp_handle; static dissector_handle_t dtls_handle; static dissector_handle_t rtp_rfc2198_handle; static dissector_handle_t sprt_handle; static dissector_handle_t v150fw_handle; static dissector_handle_t bta2dp_content_protection_header_scms_t; static dissector_handle_t btvdp_content_protection_header_scms_t; static dissector_handle_t bta2dp_handle; static dissector_handle_t btvdp_handle; static dissector_handle_t sbc_handle; static int rtp_tap = -1; static dissector_table_t rtp_pt_dissector_table; static dissector_table_t rtp_dyn_pt_dissector_table; static dissector_table_t rtp_hdr_ext_dissector_table; static dissector_table_t rtp_hdr_ext_rfc5285_dissector_table; /* Used for storing data to be retreived by the SDP dissector*/ static int proto_sdp = -1; /* RTP header fields */ static int proto_rtp = -1; static int proto_rtp_rfc2198 = -1; static int hf_rtp_version = -1; static int hf_rtp_padding = -1; static int hf_rtp_extension = -1; static int hf_rtp_csrc_count = -1; static int hf_rtp_marker = -1; static int hf_rtp_payload_type = -1; static int hf_rtp_seq_nr = -1; static int hf_rtp_ext_seq_nr = -1; static int hf_rtp_timestamp = -1; static int hf_rtp_ssrc = -1; static int hf_rtp_csrc_items = -1; static int hf_rtp_csrc_item = -1; static int hf_rtp_data = -1; static int hf_rtp_padding_data = -1; static int hf_rtp_padding_count= -1; static int hf_rtp_rfc2198_follow= -1; static int hf_rtp_rfc2198_tm_off= -1; static int hf_rtp_rfc2198_bl_len= -1; /* RTP header extension fields */ static int hf_rtp_prof_define = -1; static int hf_rtp_length = -1; static int hf_rtp_hdr_exts = -1; static int hf_rtp_hdr_ext = -1; /* RTP setup fields */ static int hf_rtp_setup = -1; static int hf_rtp_setup_frame = -1; static int hf_rtp_setup_method = -1; /* RTP fields defining a sub tree */ static gint ett_rtp = -1; static gint ett_csrc_list = -1; static gint ett_hdr_ext = -1; static gint ett_hdr_ext_rfc5285 = -1; static gint ett_rtp_setup = -1; static gint ett_rtp_rfc2198 = -1; static gint ett_rtp_rfc2198_hdr = -1; /* SRTP fields */ static int hf_srtp_encrypted_payload = -1; /* static int hf_srtp_null_encrypted_payload = -1; */ static int hf_srtp_mki = -1; static int hf_srtp_auth_tag = -1; /* PacketCable CCC header fields */ static int proto_pkt_ccc = -1; static int hf_pkt_ccc_id = -1; static int hf_pkt_ccc_ts = -1; /* PacketCable CCC field defining a sub tree */ static gint ett_pkt_ccc = -1; static expert_field ei_rtp_fragment_unfinished = EI_INIT; static expert_field ei_rtp_padding_missing = EI_INIT; /* RFC 5285 Header extensions */ static int hf_rtp_ext_rfc5285_id = -1; static int hf_rtp_ext_rfc5285_length = -1; static int hf_rtp_ext_rfc5285_appbits = -1; static int hf_rtp_ext_rfc5285_data = -1; /* RFC 4571 Header extension */ static int hf_rfc4571_header_len = -1; #define RTP0_INVALID 0 #define RTP0_STUN 1 #define RTP0_CLASSICSTUN 2 #define RTP0_T38 3 #define RTP0_SPRT 4 #define RTP0_RFC7983 5 static const enum_val_t rtp_version0_types[] = { { "invalid", "Invalid or ZRTP packets", RTP0_INVALID }, { "stun", "STUN packets", RTP0_STUN }, { "classicstun", "CLASSIC-STUN packets", RTP0_CLASSICSTUN }, { "t38", "T.38 packets", RTP0_T38 }, { "sprt", "SPRT packets", RTP0_SPRT }, { "rfc7983", "Multiplexed as in RFC 7983", RTP0_RFC7983 }, { NULL, NULL, 0 } }; static gint global_rtp_version0_type = 5; /* Forward declaration we need below */ void proto_register_rtp(void); void proto_reg_handoff_rtp(void); void proto_register_pkt_ccc(void); void proto_reg_handoff_pkt_ccc(void); static gint dissect_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data); static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static struct _rtp_packet_info *get_rtp_packet_info(packet_info *pinfo, struct _rtp_info *rtp_info); /* Preferences bool to control whether or not setup info should be shown */ static gboolean global_rtp_show_setup_info = TRUE; /* desegment RTP streams */ static gboolean desegment_rtp = TRUE; /* RFC2198 Redundant Audio Data */ #define RFC2198_DEFAULT_PT_RANGE "99" static gboolean rfc2198_deencapsulate = TRUE; /* Proto data key values */ #define RTP_CONVERSATION_PROTO_DATA 0 #define RTP_DECODE_AS_PROTO_DATA 1 /* * Fields in the first octet of the RTP header. */ /* Version is the first 2 bits of the first octet*/ #define RTP_VERSION(octet) ((octet) >> 6) /* Padding is the third bit; No need to shift, because true is any value other than 0! */ #define RTP_PADDING(octet) ((octet) & 0x20) /* Extension bit is the fourth bit */ #define RTP_EXTENSION(octet) ((octet) & 0x10) /* ED137 signature */ #define RTP_ED137_SIG 0x0067 /* ED137A signature */ #define RTP_ED137A_SIG 0x0167 /* RFC 5285 one byte header signature */ #define RTP_RFC5285_ONE_BYTE_SIG 0xBEDE /* RFC 5285 two byte header mask and signature */ #define RTP_RFC5285_TWO_BYTE_MASK 0xFFF0 #define RTP_RFC5285_TWO_BYTE_SIG 0x1000 /* CSRC count is the last four bits */ #define RTP_CSRC_COUNT(octet) ((octet) & 0xF) static const value_string rtp_version_vals[] = { { 2, "RFC 1889 Version" }, /* First for speed */ { 0, "Old VAT Version" }, { 1, "First Draft Version" }, { 0, NULL }, }; static const range_string rtp_ext_profile_rvals[] = { { RTP_ED137_SIG, RTP_ED137_SIG, "ED137" }, { RTP_ED137A_SIG, RTP_ED137A_SIG, "ED137A" }, { RTP_RFC5285_TWO_BYTE_SIG, RTP_RFC5285_TWO_BYTE_SIG + 0xF, "RFC 5285 Two-Byte Header Extensions" }, { RTP_RFC5285_ONE_BYTE_SIG, RTP_RFC5285_ONE_BYTE_SIG, "RFC 5285 One-Byte Header Extensions" }, { 0, 0, NULL }, }; /* * Fields in the second octet of the RTP header. */ /* Marker is the first bit of the second octet */ #define RTP_MARKER(octet) ((octet) & 0x80) /* Payload type is the last 7 bits */ #define RTP_PAYLOAD_TYPE(octet) ((octet) & 0x7F) /* https://www.iana.org/assignments/rtp-parameters/ */ #define FIRST_RTCP_CONFLICT_PAYLOAD_TYPE 64 #define LAST_RTCP_CONFLICT_PAYLOAD_TYPE 95 static const value_string rtp_payload_type_vals[] = { /* 0 */ { PT_PCMU, "ITU-T G.711 PCMU" }, /* 1 */ { PT_1016, "USA Federal Standard FS-1016" }, /* 2 */ { PT_G721, "ITU-T G.721" }, /* 3 */ { PT_GSM, "GSM 06.10" }, /* 4 */ { PT_G723, "ITU-T G.723" }, /* 5 */ { PT_DVI4_8000, "DVI4 8000 samples/s" }, /* 6 */ { PT_DVI4_16000, "DVI4 16000 samples/s" }, /* 7 */ { PT_LPC, "Experimental linear predictive encoding from Xerox PARC" }, /* 8 */ { PT_PCMA, "ITU-T G.711 PCMA" }, /* 9 */ { PT_G722, "ITU-T G.722" }, /* 10 */ { PT_L16_STEREO, "16-bit uncompressed audio, stereo" }, /* 11 */ { PT_L16_MONO, "16-bit uncompressed audio, monaural" }, /* 12 */ { PT_QCELP, "Qualcomm Code Excited Linear Predictive coding" }, /* 13 */ { PT_CN, "Comfort noise" }, /* 14 */ { PT_MPA, "MPEG-I/II Audio"}, /* 15 */ { PT_G728, "ITU-T G.728" }, /* 16 */ { PT_DVI4_11025, "DVI4 11025 samples/s" }, /* 17 */ { PT_DVI4_22050, "DVI4 22050 samples/s" }, /* 18 */ { PT_G729, "ITU-T G.729" }, /* 19 */ { PT_CN_OLD, "Comfort noise (old)" }, /* 20 */ { 20, "Unassigned" }, /* 21 */ { 21, "Unassigned" }, /* 22 */ { 22, "Unassigned" }, /* 23 */ { 23, "Unassigned" }, /* 24 */ { 24, "Unassigned" }, /* 25 */ { PT_CELB, "Sun CellB video encoding" }, /* 26 */ { PT_JPEG, "JPEG-compressed video" }, /* 27 */ { 27, "Unassigned" }, /* 28 */ { PT_NV, "'nv' program" }, /* 29 */ { 29, "Unassigned" }, /* 30 */ { 30, "Unassigned" }, /* 31 */ { PT_H261, "ITU-T H.261" }, /* 32 */ { PT_MPV, "MPEG-I/II Video"}, /* 33 */ { PT_MP2T, "MPEG-II transport streams"}, /* 34 */ { PT_H263, "ITU-T H.263" }, /* 35-71 Unassigned */ /* 35 */ { 35, "Unassigned" }, /* 36 */ { 36, "Unassigned" }, /* 37 */ { 37, "Unassigned" }, /* 38 */ { 38, "Unassigned" }, /* 39 */ { 39, "Unassigned" }, /* 40 */ { 40, "Unassigned" }, /* 41 */ { 41, "Unassigned" }, /* 42 */ { 42, "Unassigned" }, /* 43 */ { 43, "Unassigned" }, /* 44 */ { 44, "Unassigned" }, /* 45 */ { 45, "Unassigned" }, /* 46 */ { 46, "Unassigned" }, /* 47 */ { 47, "Unassigned" }, /* 48 */ { 48, "Unassigned" }, /* 49 */ { 49, "Unassigned" }, /* 50 */ { 50, "Unassigned" }, /* 51 */ { 51, "Unassigned" }, /* 52 */ { 52, "Unassigned" }, /* 53 */ { 53, "Unassigned" }, /* 54 */ { 54, "Unassigned" }, /* 55 */ { 55, "Unassigned" }, /* 56 */ { 56, "Unassigned" }, /* 57 */ { 57, "Unassigned" }, /* 58 */ { 58, "Unassigned" }, /* 59 */ { 59, "Unassigned" }, /* 60 */ { 60, "Unassigned" }, /* 61 */ { 61, "Unassigned" }, /* 62 */ { 62, "Unassigned" }, /* 63 */ { 63, "Unassigned" }, /* 64 */ { 64, "Unassigned" }, /* 65 */ { 65, "Unassigned" }, /* 66 */ { 66, "Unassigned" }, /* 67 */ { 67, "Unassigned" }, /* 68 */ { 68, "Unassigned" }, /* 69 */ { 69, "Unassigned" }, /* 70 */ { 70, "Unassigned" }, /* 71 */ { 71, "Unassigned" }, /* 72-76 Reserved for RTCP conflict avoidance [RFC3551] */ /* 72 */ { 72, "Reserved for RTCP conflict avoidance" }, /* 73 */ { 73, "Reserved for RTCP conflict avoidance" }, /* 74 */ { 74, "Reserved for RTCP conflict avoidance" }, /* 75 */ { 75, "Reserved for RTCP conflict avoidance" }, /* 76 */ { 76, "Reserved for RTCP conflict avoidance" }, /* 77-95 Unassigned, MAY be used if > 32 PT are used */ /* 77 */ { 77, "Unassigned" }, /* 78 */ { 78, "Unassigned" }, /* 79 */ { 79, "Unassigned" }, /* 80 */ { 80, "Unassigned" }, /* 81 */ { 81, "Unassigned" }, /* 82 */ { 82, "Unassigned" }, /* 83 */ { 83, "Unassigned" }, /* 84 */ { 84, "Unassigned" }, /* 85 */ { 85, "Unassigned" }, /* 86 */ { 86, "Unassigned" }, /* 87 */ { 87, "Unassigned" }, /* 88 */ { 88, "Unassigned" }, /* 89 */ { 89, "Unassigned" }, /* 90 */ { 90, "Unassigned" }, /* 91 */ { 91, "Unassigned" }, /* 92 */ { 92, "Unassigned" }, /* 93 */ { 93, "Unassigned" }, /* 94 */ { 94, "Unassigned" }, /* 95 */ { 95, "Unassigned" }, /* Added to support additional RTP payload types * See epan/rtp_pt.h */ { PT_UNDF_96, "DynamicRTP-Type-96" }, { PT_UNDF_97, "DynamicRTP-Type-97" }, { PT_UNDF_98, "DynamicRTP-Type-98" }, { PT_UNDF_99, "DynamicRTP-Type-99" }, { PT_UNDF_100, "DynamicRTP-Type-100" }, { PT_UNDF_101, "DynamicRTP-Type-101" }, { PT_UNDF_102, "DynamicRTP-Type-102" }, { PT_UNDF_103, "DynamicRTP-Type-103" }, { PT_UNDF_104, "DynamicRTP-Type-104" }, { PT_UNDF_105, "DynamicRTP-Type-105" }, { PT_UNDF_106, "DynamicRTP-Type-106" }, { PT_UNDF_107, "DynamicRTP-Type-107" }, { PT_UNDF_108, "DynamicRTP-Type-108" }, { PT_UNDF_109, "DynamicRTP-Type-109" }, { PT_UNDF_110, "DynamicRTP-Type-110" }, { PT_UNDF_111, "DynamicRTP-Type-111" }, { PT_UNDF_112, "DynamicRTP-Type-112" }, { PT_UNDF_113, "DynamicRTP-Type-113" }, { PT_UNDF_114, "DynamicRTP-Type-114" }, { PT_UNDF_115, "DynamicRTP-Type-115" }, { PT_UNDF_116, "DynamicRTP-Type-116" }, { PT_UNDF_117, "DynamicRTP-Type-117" }, { PT_UNDF_118, "DynamicRTP-Type-118" }, { PT_UNDF_119, "DynamicRTP-Type-119" }, { PT_UNDF_120, "DynamicRTP-Type-120" }, { PT_UNDF_121, "DynamicRTP-Type-121" }, { PT_UNDF_122, "DynamicRTP-Type-122" }, { PT_UNDF_123, "DynamicRTP-Type-123" }, { PT_UNDF_124, "DynamicRTP-Type-124" }, { PT_UNDF_125, "DynamicRTP-Type-125" }, { PT_UNDF_126, "DynamicRTP-Type-126" }, { PT_UNDF_127, "DynamicRTP-Type-127" }, { 0, NULL }, }; value_string_ext rtp_payload_type_vals_ext = VALUE_STRING_EXT_INIT(rtp_payload_type_vals); static const value_string rtp_payload_type_short_vals[] = { { PT_PCMU, "g711U" }, { PT_1016, "fs-1016" }, { PT_G721, "g721" }, { PT_GSM, "GSM" }, { PT_G723, "g723" }, { PT_DVI4_8000, "DVI4 8k" }, { PT_DVI4_16000, "DVI4 16k" }, { PT_LPC, "Exp. from Xerox PARC" }, { PT_PCMA, "g711A" }, { PT_G722, "g722" }, { PT_L16_STEREO, "16-bit audio, stereo" }, { PT_L16_MONO, "16-bit audio, monaural" }, { PT_QCELP, "Qualcomm" }, { PT_CN, "CN" }, { PT_MPA, "MPEG-I/II Audio"}, { PT_G728, "g728" }, { PT_DVI4_11025, "DVI4 11k" }, { PT_DVI4_22050, "DVI4 22k" }, { PT_G729, "g729" }, { PT_CN_OLD, "CN(old)" }, { 20, "Unassigned" }, { 21, "Unassigned" }, { 22, "Unassigned" }, { 23, "Unassigned" }, { 24, "Unassigned" }, { PT_CELB, "CellB" }, { PT_JPEG, "JPEG" }, { 27, "Unassigned" }, { PT_NV, "NV" }, { 29, "Unassigned" }, { 30, "Unassigned" }, { PT_H261, "h261" }, { PT_MPV, "MPEG-I/II Video"}, { PT_MP2T, "MPEG-II streams"}, { PT_H263, "h263" }, /* 35-71 Unassigned */ { 35, "Unassigned" }, { 36, "Unassigned" }, { 37, "Unassigned" }, { 38, "Unassigned" }, { 39, "Unassigned" }, { 40, "Unassigned" }, { 41, "Unassigned" }, { 42, "Unassigned" }, { 43, "Unassigned" }, { 44, "Unassigned" }, { 45, "Unassigned" }, { 46, "Unassigned" }, { 47, "Unassigned" }, { 48, "Unassigned" }, { 49, "Unassigned" }, { 50, "Unassigned" }, { 51, "Unassigned" }, { 52, "Unassigned" }, { 53, "Unassigned" }, { 54, "Unassigned" }, { 55, "Unassigned" }, { 56, "Unassigned" }, { 57, "Unassigned" }, { 58, "Unassigned" }, { 59, "Unassigned" }, { 60, "Unassigned" }, { 61, "Unassigned" }, { 62, "Unassigned" }, { 63, "Unassigned" }, { 64, "Unassigned" }, { 65, "Unassigned" }, { 66, "Unassigned" }, { 67, "Unassigned" }, { 68, "Unassigned" }, { 69, "Unassigned" }, { 70, "Unassigned" }, { 71, "Unassigned" }, /* 72-76 Reserved for RTCP conflict avoidance - [RFC3551] */ { 72, "Reserved for RTCP conflict avoidance" }, { 73, "Reserved for RTCP conflict avoidance" }, { 74, "Reserved for RTCP conflict avoidance" }, { 75, "Reserved for RTCP conflict avoidance" }, { 76, "Reserved for RTCP conflict avoidance" }, /* 77-95 Unassigned, MAY be used if > 32 PT are used */ { 77, "Unassigned" }, { 78, "Unassigned" }, { 79, "Unassigned" }, { 80, "Unassigned" }, { 81, "Unassigned" }, { 82, "Unassigned" }, { 83, "Unassigned" }, { 84, "Unassigned" }, { 85, "Unassigned" }, { 86, "Unassigned" }, { 87, "Unassigned" }, { 88, "Unassigned" }, { 89, "Unassigned" }, { 90, "Unassigned" }, { 91, "Unassigned" }, { 92, "Unassigned" }, { 93, "Unassigned" }, { 94, "Unassigned" }, { 95, "Unassigned" }, /* Short RTP types */ { PT_UNDF_96, "RTPType-96" }, { PT_UNDF_97, "RTPType-97" }, { PT_UNDF_98, "RTPType-98" }, { PT_UNDF_99, "RTPType-99" }, { PT_UNDF_100, "RTPType-100" }, { PT_UNDF_101, "RTPType-101" }, { PT_UNDF_102, "RTPType-102" }, { PT_UNDF_103, "RTPType-103" }, { PT_UNDF_104, "RTPType-104" }, { PT_UNDF_105, "RTPType-105" }, { PT_UNDF_106, "RTPType-106" }, { PT_UNDF_107, "RTPType-107" }, { PT_UNDF_108, "RTPType-108" }, { PT_UNDF_109, "RTPType-109" }, { PT_UNDF_110, "RTPType-110" }, { PT_UNDF_111, "RTPType-111" }, { PT_UNDF_112, "RTPType-112" }, { PT_UNDF_113, "RTPType-113" }, { PT_UNDF_114, "RTPType-114" }, { PT_UNDF_115, "RTPType-115" }, { PT_UNDF_116, "RTPType-116" }, { PT_UNDF_117, "RTPType-117" }, { PT_UNDF_118, "RTPType-118" }, { PT_UNDF_119, "RTPType-119" }, { PT_UNDF_120, "RTPType-120" }, { PT_UNDF_121, "RTPType-121" }, { PT_UNDF_122, "RTPType-122" }, { PT_UNDF_123, "RTPType-123" }, { PT_UNDF_124, "RTPType-124" }, { PT_UNDF_125, "RTPType-125" }, { PT_UNDF_126, "RTPType-126" }, { PT_UNDF_127, "RTPType-127" }, { 0, NULL }, }; value_string_ext rtp_payload_type_short_vals_ext = VALUE_STRING_EXT_INIT(rtp_payload_type_short_vals); #if 0 static const value_string srtp_encryption_alg_vals[] = { { SRTP_ENC_ALG_NULL, "Null Encryption" }, { SRTP_ENC_ALG_AES_CM, "AES-128 Counter Mode" }, { SRTP_ENC_ALG_AES_F8, "AES-128 F8 Mode" }, { 0, NULL }, }; static const value_string srtp_auth_alg_vals[] = { { SRTP_AUTH_ALG_NONE, "No Authentication" }, { SRTP_AUTH_ALG_HMAC_SHA1, "HMAC-SHA1" }, { 0, NULL }, }; #endif static void rtp_prompt(packet_info *pinfo _U_, gchar* result) { guint payload_type = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_rtp, RTP_DECODE_AS_PROTO_DATA)); /* Dynamic payload range, don't expose value as it may change within conversation */ if (payload_type > 95) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RTP payload type as"); } else { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RTP payload type %d as", payload_type); } } static gpointer rtp_value(packet_info *pinfo) { guint payload_type = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_rtp, RTP_DECODE_AS_PROTO_DATA)); return GUINT_TO_POINTER(payload_type); } #ifdef DEBUG_CONVERSATION /* Called for each entry in the rtp_dyn_payload hash table. */ static void rtp_dyn_payload_table_foreach_func(gpointer key, gpointer value, gpointer user_data _U_) { guint pt = GPOINTER_TO_UINT(key); encoding_name_and_rate_t *encoding = (encoding_name_and_rate_t*) value; DPRINT2(("pt=%d", pt)); if (encoding) { DPRINT2(("encoding_name=%s", encoding->encoding_name ? encoding->encoding_name : "NULL")); DPRINT2(("sample_rate=%d", encoding->sample_rate)); DPRINT2(("channels=%u", encoding->channels)); } else { DPRINT2(("encoding=NULL")); } } void rtp_dump_dyn_payload(rtp_dyn_payload_t *rtp_dyn_payload) { DPRINT2(("rtp_dyn_payload hash table contents:")); DINDENT(); if (!rtp_dyn_payload) { DPRINT2(("null pointer to rtp_dyn_payload")); DENDENT(); return; } DPRINT2(("ref_count=%zu", rtp_dyn_payload->ref_count)); if (!rtp_dyn_payload->table) { DPRINT2(("null rtp_dyn_payload table")); DENDENT(); return; } if (g_hash_table_size(rtp_dyn_payload->table) == 0) { DPRINT2(("rtp_dyn_payload has no entries")); } else { g_hash_table_foreach(rtp_dyn_payload->table, rtp_dyn_payload_table_foreach_func, NULL); } DENDENT(); } #endif /* DEBUG_CONVERSATION */ /* A single hash table to hold pointers to all the rtp_dyn_payload_t's we create/destroy. This is necessary because we need to g_hash_table_destroy() them, either individually or all at once at the end of the wmem file scope. Since rtp_dyn_payload_free() removes them individually, we need to remove those then; and when the file scope is over, we have a single registered callback walk this GHashTable and destroy each member as well as this GHashTable. */ static GHashTable *rtp_dyn_payloads = NULL; static gboolean fmtp_free(gpointer key, gpointer value, gpointer user_data) { wmem_allocator_t *scope = (wmem_allocator_t*)user_data; wmem_free(scope, key); wmem_free(scope, value); return TRUE; } /* the following is the GDestroyNotify function used when the individual rtp_dyn_payload_t GHashTables are destroyed */ static void rtp_dyn_payload_value_destroy(gpointer data) { encoding_name_and_rate_t *encoding_name_and_rate_pt = (encoding_name_and_rate_t*) data; wmem_free(wmem_file_scope(), encoding_name_and_rate_pt->encoding_name); wmem_map_foreach_remove(encoding_name_and_rate_pt->fmtp_map, fmtp_free, wmem_file_scope()); wmem_free(wmem_file_scope(), encoding_name_and_rate_pt->fmtp_map); wmem_free(wmem_file_scope(), encoding_name_and_rate_pt); } /* this gets called by wmem_rtp_dyn_payload_destroy_cb */ static gboolean rtp_dyn_payloads_table_steal_func(gpointer key _U_, gpointer value, gpointer user_data _U_) { rtp_dyn_payload_t *rtp_dyn_payload = (rtp_dyn_payload_t *)value; #ifdef DEBUG_CONVERSATION DPRINT(("about to steal_all and destroy the following:")); DINDENT(); rtp_dump_dyn_payload(rtp_dyn_payload); DENDENT(); #endif if (rtp_dyn_payload->ref_count == 0) { /* this shouldn't happen */ DPRINT(("rtp_dyn_payload cannot be free'd because it should already have been!\n")); } else if (rtp_dyn_payload->table) { /* each member was created with a wmem file scope, so there's no point in calling the destroy functions for the GHashTable entries, so we steal them instead */ g_hash_table_steal_all(rtp_dyn_payload->table); g_hash_table_destroy(rtp_dyn_payload->table); } return TRUE; } /* the following is used as the wmem callback to destroy *all* alive rtp_dyn_payload_t's, which are pointed to by the single rtp_dyn_payloads GHashTable above. */ static bool wmem_rtp_dyn_payload_destroy_cb(wmem_allocator_t *allocator _U_, wmem_cb_event_t event _U_, void *user_data _U_) { DPRINT(("destroying %u remaining rtp_dyn_payload_t's", g_hash_table_size(rtp_dyn_payloads))); /* each member was created with a wmem file scope, so there's no point in calling the destroy functions for the GHashTable entries, so we steal them instead */ g_hash_table_foreach_steal(rtp_dyn_payloads, rtp_dyn_payloads_table_steal_func, NULL); g_hash_table_destroy(rtp_dyn_payloads); rtp_dyn_payloads = NULL; /* remove this callback? */ return FALSE; } /* the following initializes the single GHashTable - this is invoked as an init_routine, but those are called both at init and cleanup times, and the cleanup time is before wmem scope is exited, so we ignore this if rtp_dyn_payloads is not NULL. */ static void rtp_dyn_payloads_init(void) { if (rtp_dyn_payloads == NULL) { rtp_dyn_payloads = g_hash_table_new(NULL, NULL); wmem_register_callback(wmem_file_scope(), wmem_rtp_dyn_payload_destroy_cb, NULL); } } /* creates a new hashtable and sets ref_count to 1, returning the newly created object */ rtp_dyn_payload_t* rtp_dyn_payload_new(void) { /* create the new entry */ rtp_dyn_payload_t * rtp_dyn_payload = wmem_new(wmem_file_scope(), rtp_dyn_payload_t); rtp_dyn_payload->table = g_hash_table_new_full(NULL, NULL, NULL, rtp_dyn_payload_value_destroy); rtp_dyn_payload->ref_count = 1; /* now put it in our single rtp_dyn_payloads GHashTable */ g_hash_table_insert(rtp_dyn_payloads, rtp_dyn_payload, rtp_dyn_payload); return rtp_dyn_payload; } /* Creates a copy of the given dynamic payload information. */ rtp_dyn_payload_t* rtp_dyn_payload_dup(rtp_dyn_payload_t *rtp_dyn_payload) { rtp_dyn_payload_t *rtp_dyn_payload2 = rtp_dyn_payload_new(); GHashTableIter iter; gpointer key, value; g_hash_table_iter_init(&iter, rtp_dyn_payload->table); while (g_hash_table_iter_next(&iter, &key, &value)) { const guint pt = GPOINTER_TO_UINT(key); encoding_name_and_rate_t *encoding_name_and_rate_pt = (encoding_name_and_rate_t *)value; rtp_dyn_payload_insert_full(rtp_dyn_payload2, pt, encoding_name_and_rate_pt->encoding_name, encoding_name_and_rate_pt->sample_rate, encoding_name_and_rate_pt->channels, encoding_name_and_rate_pt->fmtp_map); } return rtp_dyn_payload2; } static rtp_dyn_payload_t* rtp_dyn_payload_ref(rtp_dyn_payload_t *rtp_dyn_payload) { if (rtp_dyn_payload) { rtp_dyn_payload->ref_count++; } return rtp_dyn_payload; } static void rtp_dyn_payload_add_fmtp_int(gpointer key, gpointer value, gpointer user_data) { wmem_map_t *fmtp_map = (wmem_map_t*)user_data; const char *k = (const char*)key; const char *v = (const char*)value; wmem_map_insert(fmtp_map, wmem_strdup(wmem_file_scope(), k), wmem_strdup(wmem_file_scope(), v)); } /* Inserts the given payload type key, for the encoding name and sample rate, into the hash table. Copy all the format parameters in the map given into the format parameter map for the new entry. This makes copies of the encoding name and the format parameters, scoped to the life of the capture file or sooner if rtp_dyn_payload_free is called. */ void rtp_dyn_payload_insert_full(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar* encoding_name, const int sample_rate, const unsigned channels, wmem_map_t *fmtp_map) { if (rtp_dyn_payload && rtp_dyn_payload->table) { encoding_name_and_rate_t *encoding_name_and_rate_pt = (encoding_name_and_rate_t*)g_hash_table_lookup(rtp_dyn_payload->table, GUINT_TO_POINTER(pt)); if (!encoding_name_and_rate_pt) { encoding_name_and_rate_pt = wmem_new(wmem_file_scope(), encoding_name_and_rate_t); encoding_name_and_rate_pt->fmtp_map = wmem_map_new(wmem_file_scope(), wmem_str_hash, g_str_equal); g_hash_table_insert(rtp_dyn_payload->table, GUINT_TO_POINTER(pt), encoding_name_and_rate_pt); } encoding_name_and_rate_pt->encoding_name = wmem_strdup(wmem_file_scope(), encoding_name); encoding_name_and_rate_pt->sample_rate = sample_rate; encoding_name_and_rate_pt->channels = channels; if (fmtp_map) { wmem_map_foreach(fmtp_map, rtp_dyn_payload_add_fmtp_int, encoding_name_and_rate_pt->fmtp_map); } } } /* Inserts the given payload type key, for the encoding name and sample rate, into the hash table. This makes copies of the encoding name, scoped to the life of the capture file or sooner if rtp_dyn_payload_free is called. */ void rtp_dyn_payload_insert(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar* encoding_name, const int sample_rate, const unsigned channels) { rtp_dyn_payload_insert_full(rtp_dyn_payload, pt, encoding_name, sample_rate, channels, NULL); } /* Adds the given format parameter to the fmtp_map for the given payload type in the RTP dynamic payload hashtable, if that payload type has been inserted with rtp_dyn_payload_insert. The format parameter name and value are copied, with scope the lifetime of the capture file. */ void rtp_dyn_payload_add_fmtp(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const char *key, const char *value) { if (rtp_dyn_payload && rtp_dyn_payload->table) { encoding_name_and_rate_t *encoding_name_and_rate_pt = (encoding_name_and_rate_t*)g_hash_table_lookup(rtp_dyn_payload->table, GUINT_TO_POINTER(pt)); if (!encoding_name_and_rate_pt) { rtp_dyn_payload_insert(rtp_dyn_payload, pt, "Unknown", 0, 1); encoding_name_and_rate_pt = (encoding_name_and_rate_t*)g_hash_table_lookup(rtp_dyn_payload->table, GUINT_TO_POINTER(pt)); } rtp_dyn_payload_add_fmtp_int((void*)key, (void*)value, encoding_name_and_rate_pt->fmtp_map); } } /* Replaces the given payload type key in the hash table, with the encoding name and sample rate. This makes copies of the encoding name, scoped to the life of the capture file or sooner if rtp_dyn_payload_free is called. */ /* Not used anymore void rtp_dyn_payload_replace(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar* encoding_name, const int sample_rate) { if (rtp_dyn_payload && rtp_dyn_payload->table) { encoding_name_and_rate_t *encoding_name_and_rate_pt = wmem_new(wmem_file_scope(), encoding_name_and_rate_t); encoding_name_and_rate_pt->encoding_name = wmem_strdup(wmem_file_scope(), encoding_name); encoding_name_and_rate_pt->sample_rate = sample_rate; g_hash_table_replace(rtp_dyn_payload->table, GUINT_TO_POINTER(pt), encoding_name_and_rate_pt); } } */ /* removes the given payload type */ /* Not used anymore gboolean rtp_dyn_payload_remove(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt) { return (rtp_dyn_payload && rtp_dyn_payload->table && g_hash_table_remove(rtp_dyn_payload->table, GUINT_TO_POINTER(pt))); } */ /* retrieves the encoding name for the given payload type */ const gchar* rtp_dyn_payload_get_name(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt) { encoding_name_and_rate_t *encoding_name_and_rate_pt; if (!rtp_dyn_payload || !rtp_dyn_payload->table) return NULL; encoding_name_and_rate_pt = (encoding_name_and_rate_t*)g_hash_table_lookup(rtp_dyn_payload->table, GUINT_TO_POINTER(pt)); return (encoding_name_and_rate_pt ? encoding_name_and_rate_pt->encoding_name : NULL); } /* Retrieves the encoding name, sample rate, and format parameters map for the given payload type. The encoding string pointed to is only valid until the entry is replaced, removed, or the hash table is destroyed, so duplicate it if you need it long. Each of the three output parameters are optional and can be NULL. */ gboolean rtp_dyn_payload_get_full(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar **encoding_name, int *sample_rate, unsigned *channels, wmem_map_t **fmtp_map) { encoding_name_and_rate_t *encoding_name_and_rate_pt; if (encoding_name) { *encoding_name = NULL; } if (sample_rate) { *sample_rate = 0; } if (channels) { *channels = 0; } if (fmtp_map) { *fmtp_map = NULL; } if (!rtp_dyn_payload || !rtp_dyn_payload->table) return FALSE; encoding_name_and_rate_pt = (encoding_name_and_rate_t*)g_hash_table_lookup(rtp_dyn_payload->table, GUINT_TO_POINTER(pt)); if (encoding_name_and_rate_pt) { if (encoding_name) { *encoding_name = encoding_name_and_rate_pt->encoding_name; } if (sample_rate) { *sample_rate = encoding_name_and_rate_pt->sample_rate; } if (channels) { *channels = encoding_name_and_rate_pt->channels; } if (fmtp_map) { *fmtp_map = encoding_name_and_rate_pt->fmtp_map; } } return (encoding_name_and_rate_pt != NULL); } /* Free's and destroys the dyn_payload hash table; internally this decrements the ref_count and only free's it if the ref_count == 0. */ void rtp_dyn_payload_free(rtp_dyn_payload_t *rtp_dyn_payload) { if (!rtp_dyn_payload) return; if (rtp_dyn_payload->ref_count > 0) --(rtp_dyn_payload->ref_count); if (rtp_dyn_payload->ref_count == 0) { #ifdef DEBUG_CONVERSATION DPRINT(("free'ing the following rtp_dyn_payload:")); DINDENT(); rtp_dump_dyn_payload(rtp_dyn_payload); DENDENT(); #endif /* remove it from the single rtp_dyn_payloads GHashTable */ if (!g_hash_table_remove(rtp_dyn_payloads, rtp_dyn_payload)) { DPRINT(("rtp_dyn_payload not found in rtp_dyn_payloads table to remove!")); } /* destroy the table GHashTable in it - this automatically deletes the members too, because we used destroy function callbacks */ if (rtp_dyn_payload->table) g_hash_table_destroy(rtp_dyn_payload->table); /* free the object itself */ wmem_free(wmem_file_scope(), rtp_dyn_payload); } } void bluetooth_add_address(packet_info *pinfo, address *addr, guint32 stream_number, const gchar *setup_method, guint32 setup_frame_number, guint32 media_types, void *data) { address null_addr; conversation_t* p_conv; struct _rtp_conversation_info *p_conv_data = NULL; /* * If this isn't the first time this packet has been processed, * we've already done this work, so we don't need to do it * again. */ if ((pinfo->fd->visited) || (rtp_handle == NULL)) { return; } clear_address(&null_addr); /* * Check if the ip address and port combination is not * already registered as a conversation. */ p_conv = find_conversation(setup_frame_number, addr, &null_addr, CONVERSATION_BLUETOOTH, stream_number, stream_number, NO_ADDR_B | NO_PORT_B); /* * If not, create a new conversation. */ if (!p_conv || p_conv->setup_frame != setup_frame_number) { p_conv = conversation_new(setup_frame_number, addr, &null_addr, CONVERSATION_BLUETOOTH, stream_number, stream_number, NO_ADDR2 | NO_PORT2); } /* Set dissector */ conversation_set_dissector(p_conv, rtp_handle); /* * Check if the conversation has data associated with it. */ p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp); /* * If not, add a new data item. */ if (! p_conv_data) { /* Create conversation data */ p_conv_data = wmem_new0(wmem_file_scope(), struct _rtp_conversation_info); p_conv_data->ssrc_number_space = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); p_conv_data->rtp_conv_info = wmem_new(wmem_file_scope(), rtp_private_conv_info); p_conv_data->rtp_conv_info->multisegment_pdus = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(p_conv, proto_rtp, p_conv_data); if (media_types == RTP_MEDIA_AUDIO) { p_conv_data->bta2dp_info = (bta2dp_codec_info_t *) wmem_memdup(wmem_file_scope(), data, sizeof(bta2dp_codec_info_t)); } else if (media_types == RTP_MEDIA_VIDEO) { p_conv_data->btvdp_info = (btvdp_codec_info_t *) wmem_memdup(wmem_file_scope(), data, sizeof(btvdp_codec_info_t)); } } /* * Update the conversation data. */ /* Free the hash if already exists */ rtp_dyn_payload_free(p_conv_data->rtp_dyn_payload); (void) g_strlcpy(p_conv_data->method, setup_method, MAX_RTP_SETUP_METHOD_SIZE+1); p_conv_data->frame_number = setup_frame_number; p_conv_data->media_types = media_types; p_conv_data->rtp_dyn_payload = NULL; p_conv_data->srtp_info = NULL; } static void rtp_add_setup_info_if_no_duplicate(sdp_setup_info_t *setup_info, wmem_array_t *sdp_conv_info_list) { sdp_setup_info_t *stored_setup_info; guint i; for (i = 0; i < wmem_array_get_count(sdp_conv_info_list); i++) { stored_setup_info = (sdp_setup_info_t *)wmem_array_index(sdp_conv_info_list, i); /* Check if we have the call id allready */ if ((stored_setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_STR) && (setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_STR)) { if (strcmp(stored_setup_info->trace_id.str, setup_info->trace_id.str) == 0) { return; /* Do not store the call id */ } } else if ((stored_setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_GUINT32) && (setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_GUINT32)) { if (stored_setup_info->trace_id.num == setup_info->trace_id.num) { return; /* Do not store the call id */ } } } wmem_array_append(sdp_conv_info_list, setup_info, 1); } /* Set up an SRTP conversation */ void srtp_add_address(packet_info *pinfo, const port_type ptype, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number, guint32 media_types _U_, rtp_dyn_payload_t *rtp_dyn_payload, struct srtp_info *srtp_info, sdp_setup_info_t *setup_info) { address null_addr; conversation_t* p_conv, *sdp_conv; struct _rtp_conversation_info *p_conv_data; wmem_array_t *rtp_conv_info_list = NULL; /* * If this isn't the first time this packet has been processed, * we've already done this work, so we don't need to do it * again. */ if ((pinfo->fd->visited) || (rtp_handle == NULL) || (rtp_rfc4571_handle == NULL)) { return; } DPRINT(("#%u: %srtp_add_address(%d, %s, %u, %u, %s, %u)", pinfo->num, (srtp_info)?"s":"", ptype, address_to_str(pinfo->pool, addr), port, other_port, setup_method, setup_frame_number)); DINDENT(); clear_address(&null_addr); /* * Check if the ip address and port combination is not * already registered as a conversation. */ p_conv = find_conversation(setup_frame_number, addr, &null_addr, conversation_pt_to_conversation_type(ptype), port, other_port, NO_ADDR_B | (!other_port ? NO_PORT_B : 0)); if (p_conv) { /* * Check if the conversation has data associated with it. */ p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp); if (p_conv_data) { rtp_conv_info_list = p_conv_data->rtp_sdp_setup_info_list; } } DENDENT(); DPRINT(("did %sfind conversation", p_conv?"":"NOT ")); /* * If not, create a new conversation. */ if (!p_conv || p_conv->setup_frame != setup_frame_number) { p_conv = conversation_new(setup_frame_number, addr, &null_addr, conversation_pt_to_conversation_type(ptype), (guint32)port, (guint32)other_port, NO_ADDR2 | (!other_port ? NO_PORT2 : 0)); } /* Set dissector */ if (ptype == PT_UDP) { /* For RFC 5761 multiplexing, go ahead and create/update [S]RTCP * info for the conversation, since this dissector will pass RTCP PTs * to the RTCP dissector anyway. * XXX: We only do this on UDP, as RFC 4571 specifies RTP and RTCP on * different ports, but the RTCP dissector (like SDP) doesn't support * RFC 4571 currently anyway. */ srtcp_add_address(pinfo, addr, port, other_port, setup_method, setup_frame_number, srtp_info); /* Set the dissector afterwards, since RTCP will set the conversation * to its dissector, but packets should go to RTP first. */ conversation_set_dissector(p_conv, rtp_handle); } else if (ptype == PT_TCP) { conversation_set_dissector(p_conv, rtp_rfc4571_handle); } else { DISSECTOR_ASSERT(FALSE); } /* * Check if the conversation has data associated with it. */ p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp); /* * If not, add a new data item. */ if (! p_conv_data) { DPRINT(("creating new conversation data")); /* Create conversation data */ p_conv_data = wmem_new0(wmem_file_scope(), struct _rtp_conversation_info); p_conv_data->ssrc_number_space = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); p_conv_data->rtp_conv_info = wmem_new(wmem_file_scope(), rtp_private_conv_info); p_conv_data->rtp_conv_info->multisegment_pdus = wmem_tree_new(wmem_file_scope()); DINDENT(); conversation_add_proto_data(p_conv, proto_rtp, p_conv_data); DENDENT(); } #ifdef DEBUG_CONVERSATION else { DPRINT(("conversation already exists")); } #endif /* * Update the conversation data. */ /* Free the hash if a different one already exists */ if (p_conv_data->rtp_dyn_payload != rtp_dyn_payload) { rtp_dyn_payload_free(p_conv_data->rtp_dyn_payload); p_conv_data->rtp_dyn_payload = rtp_dyn_payload_ref(rtp_dyn_payload); } else { DPRINT(("passed-in rtp_dyn_payload is the same as in the conversation")); } (void) g_strlcpy(p_conv_data->method, setup_method, MAX_RTP_SETUP_METHOD_SIZE+1); p_conv_data->frame_number = setup_frame_number; p_conv_data->media_types = media_types; p_conv_data->srtp_info = srtp_info; p_conv_data->bta2dp_info = NULL; p_conv_data->btvdp_info = NULL; /* If we had a sdp setup info list put it back in the potentially new conversation*/ p_conv_data->rtp_sdp_setup_info_list = rtp_conv_info_list; if (setup_info) { /* If we have new setup info add it to the list*/ if (p_conv_data->rtp_sdp_setup_info_list) { /* Add info to the SDP conversation */ rtp_add_setup_info_if_no_duplicate(setup_info, p_conv_data->rtp_sdp_setup_info_list); } else { p_conv_data->rtp_sdp_setup_info_list = wmem_array_new(wmem_file_scope(), sizeof(sdp_setup_info_t)); wmem_array_append(p_conv_data->rtp_sdp_setup_info_list, setup_info, 1); } } sdp_conv = find_or_create_conversation(pinfo); if (sdp_conv && p_conv_data->rtp_sdp_setup_info_list) { /* Add the collected information to the SDP conversation */ conversation_add_proto_data(sdp_conv, proto_sdp, p_conv_data->rtp_sdp_setup_info_list); } } /* Set up an RTP conversation */ void rtp_add_address(packet_info *pinfo, const port_type ptype, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number, guint32 media_types , rtp_dyn_payload_t *rtp_dyn_payload) { srtp_add_address(pinfo, ptype, addr, port, other_port, setup_method, setup_frame_number, media_types, rtp_dyn_payload, NULL, NULL); } static gboolean dissect_rtp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { guint8 octet1, octet2; unsigned int version, payload_type; unsigned int offset = 0; gint padding_count; if (tvb_captured_length_remaining(tvb, offset) < 2) { return FALSE; } /* Get the fields in the first octet */ octet1 = tvb_get_guint8( tvb, offset ); version = RTP_VERSION( octet1 ); /* XXX: Why are we calling these dissectors from the *heuristic* * RTP dissector? These almost all have their own heuristic dissector, * enabled by default (unlike RTP, which has a much less accurate * heuristic.) We should just reject and let the protocols' own heuristic * dissectors handle this. */ if (version == 0) { if (!(tvb_memeql(tvb, 4, (const guint8*)"ZRTP", 4))) { call_dissector_only(zrtp_handle, tvb, pinfo, tree, NULL); return TRUE; } else { switch (global_rtp_version0_type) { case RTP0_STUN: return call_dissector_only(stun_heur_handle, tvb, pinfo, tree, NULL); case RTP0_CLASSICSTUN: return call_dissector_only(classicstun_heur_handle, tvb, pinfo, tree, NULL); case RTP0_T38: /* XXX: Should really be calling a heuristic dissector for T38 ??? */ call_dissector_only(t38_handle, tvb, pinfo, tree, NULL); return TRUE; case RTP0_SPRT: call_dissector_only(sprt_handle, tvb, pinfo, tree, NULL); return TRUE; case RTP0_INVALID: case RTP0_RFC7983: default: return FALSE; /* Unknown or unsupported version */ } } } else if (version != 2) { /* Unknown or unsupported version */ return FALSE; } octet2 = tvb_get_guint8( tvb, offset + 1 ); payload_type = RTP_PAYLOAD_TYPE( octet2 ); if (payload_type >= 72 && payload_type <= 76) { /* XXX: This range is definitely excluded by RFCs 3550, 3551. * There's an argument, per RFC 5761, for expanding the * excluded range to [FIRST_RTCP_CONFLICT_PAYLOAD_TYPE, * LAST_RTCP_CONFLICT_PAYLOAD_TYPE] in the heuristic dissector, * leaving those values only when specificed by other means * (SDP, Decode As, etc.) */ return FALSE; } /* Skip fixed header */ offset += 12; offset += 4 * RTP_CSRC_COUNT( octet1 ); if (RTP_EXTENSION( octet1 )) { if (tvb_captured_length_remaining(tvb, offset) < 4) { return FALSE; } offset += 4 + 4*tvb_get_guint16(tvb, offset+2, ENC_BIG_ENDIAN); } if (tvb_reported_length(tvb) < offset) { return FALSE; } if (RTP_PADDING( octet1 )) { if (tvb_captured_length(tvb) == tvb_reported_length(tvb)) { /* We can test the padding if the last octet is present. */ padding_count = tvb_get_guint8(tvb, tvb_reported_length(tvb) - 1); if (tvb_reported_length_remaining(tvb, offset) < padding_count || padding_count == 0) { return FALSE; } } } /* Create a conversation in case none exists so as to allow reassembly code to work */ if (!find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B)) { conversation_t *p_conv; struct _rtp_conversation_info *p_conv_data; p_conv = conversation_new(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR2); p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp); if (! p_conv_data) { /* Create conversation data */ p_conv_data = wmem_new0(wmem_file_scope(), struct _rtp_conversation_info); p_conv_data->ssrc_number_space = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); p_conv_data->rtp_conv_info = wmem_new(wmem_file_scope(), rtp_private_conv_info); p_conv_data->rtp_conv_info->multisegment_pdus = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(p_conv, proto_rtp, p_conv_data); } (void) g_strlcpy(p_conv_data->method, "HEUR RTP", MAX_RTP_SETUP_METHOD_SIZE+1); p_conv_data->frame_number = pinfo->num; p_conv_data->media_types = 0; p_conv_data->srtp_info = NULL; p_conv_data->bta2dp_info = NULL; p_conv_data->btvdp_info = NULL; } dissect_rtp( tvb, pinfo, tree, data ); return TRUE; } /* * Process the payload of the RTP packet, hand it to the subdissector */ static void process_rtp_payload(tvbuff_t *newtvb, packet_info *pinfo, proto_tree *tree, proto_tree *rtp_tree, unsigned int payload_type, struct _rtp_info *rtp_info) { struct _rtp_packet_info *p_packet_data; int payload_len; struct srtp_info *srtp_info; int offset = 0; proto_item *rtp_data; payload_len = tvb_captured_length_remaining(newtvb, offset); /* first check if this is added as an SRTP stream - if so, don't try to dissector the payload data for now */ p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, RTP_CONVERSATION_PROTO_DATA); if (p_packet_data && p_packet_data->srtp_info) { srtp_info = p_packet_data->srtp_info; payload_len -= srtp_info->mki_len + srtp_info->auth_tag_len; #if 0 #error Currently the srtp_info structure contains no cipher data, see packet-sdp.c adding dummy_srtp_info structure if (p_conv_data->srtp_info->encryption_algorithm == SRTP_ENC_ALG_NULL) { if (rtp_tree) proto_tree_add_item(rtp_tree, hf_srtp_null_encrypted_payload, newtvb, offset, payload_len, ENC_NA); } else #endif { if (rtp_tree) proto_tree_add_item(rtp_tree, hf_srtp_encrypted_payload, newtvb, offset, payload_len, ENC_NA); } offset += payload_len; if (srtp_info->mki_len) { proto_tree_add_item(rtp_tree, hf_srtp_mki, newtvb, offset, srtp_info->mki_len, ENC_NA); offset += srtp_info->mki_len; } if (srtp_info->auth_tag_len) { proto_tree_add_item(rtp_tree, hf_srtp_auth_tag, newtvb, offset, srtp_info->auth_tag_len, ENC_NA); /*offset += srtp_info->auth_tag_len;*/ } return; } if (p_packet_data && p_packet_data->bta2dp_info) { tvbuff_t *nexttvb; gint suboffset = 0; if (p_packet_data->bta2dp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) { nexttvb = tvb_new_subset_length(newtvb, 0, 1); call_dissector(bta2dp_content_protection_header_scms_t, nexttvb, pinfo, tree); suboffset = 1; } nexttvb = tvb_new_subset_remaining(newtvb, suboffset); if (p_packet_data->bta2dp_info->codec_dissector) call_dissector_with_data(p_packet_data->bta2dp_info->codec_dissector, nexttvb, pinfo, tree, p_packet_data->bta2dp_info); else call_data_dissector(nexttvb, pinfo, tree); return; } if (p_packet_data && p_packet_data->btvdp_info) { tvbuff_t *nexttvb; gint suboffset = 0; if (p_packet_data->btvdp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) { nexttvb = tvb_new_subset_length(newtvb, 0, 1); call_dissector(btvdp_content_protection_header_scms_t, nexttvb, pinfo, tree); suboffset = 1; } nexttvb = tvb_new_subset_remaining(newtvb, suboffset); if (p_packet_data->btvdp_info->codec_dissector) call_dissector_with_data(p_packet_data->btvdp_info->codec_dissector, nexttvb, pinfo, tree, p_packet_data->btvdp_info); else call_data_dissector(nexttvb, pinfo, tree); return; } rtp_data = proto_tree_add_item(rtp_tree, hf_rtp_data, newtvb, 0, -1, ENC_NA); /* We have checked for !p_conv_data->bta2dp_info && !p_conv_data->btvdp_info above*/ if (p_packet_data && payload_type >= PT_UNDF_96 && payload_type <= PT_UNDF_127) { /* if the payload type is dynamic, we check if the conv is set and we look for the pt definition */ if (p_packet_data->rtp_dyn_payload) { const gchar *payload_type_str = rtp_dyn_payload_get_name(p_packet_data->rtp_dyn_payload, payload_type); if (payload_type_str) { int len; len = dissector_try_string(rtp_dyn_pt_dissector_table, payload_type_str, newtvb, pinfo, tree, rtp_info); /* If payload type string set from conversation and * no matching dissector found it's probably because no subdissector * exists. Don't call the dissectors based on payload number * as that'd probably be the wrong dissector in this case. * Just add it as data. */ if (len > 0) proto_item_set_hidden(rtp_data); return; } } } /* if we don't found, it is static OR could be set static from the preferences */ if (dissector_try_uint_new(rtp_pt_dissector_table, payload_type, newtvb, pinfo, tree, TRUE, rtp_info)) proto_item_set_hidden(rtp_data); } /* Rtp payload reassembly * * This handles the reassembly of PDUs for higher-level protocols. * * We're a bit limited on how we can cope with out-of-order packets, because * we don't have any idea of where the datagram boundaries are. So if we see * packets A, C, B (all of which comprise a single datagram), we cannot know * that C should be added to the same datagram as A, until we come to B (which * may or may not actually be present...). * * What we end up doing in this case is passing A+B to the subdissector as one * datagram, and make out that a new one starts on C. */ static void dissect_rtp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *rtp_tree, int offset, unsigned int data_len, unsigned int data_reported_len, unsigned int payload_type, struct _rtp_info *rtp_info) { tvbuff_t *newtvb; struct _rtp_packet_info *p_packet_data; gboolean must_desegment = FALSE; rtp_private_conv_info *finfo = NULL; rtp_multisegment_pdu *msp; guint32 seqno; /* Retrieve RTPs idea of a conversation */ p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, RTP_CONVERSATION_PROTO_DATA); if(p_packet_data != NULL) finfo = p_packet_data->rtp_conv_info; if(finfo == NULL || !desegment_rtp) { /* Hand the whole lot off to the subdissector */ newtvb = tvb_new_subset_length_caplen(tvb, offset, data_len, data_reported_len); process_rtp_payload(newtvb, pinfo, tree, rtp_tree, payload_type, rtp_info); return; } seqno = p_packet_data->extended_seqno; pinfo->can_desegment = 2; pinfo->desegment_offset = 0; pinfo->desegment_len = 0; #ifdef DEBUG_FRAGMENTS ws_debug("%d: RTP Part of convo %d(%p); seqno %d", pinfo->num, p_packet_data->frame_number, p_packet_data, seqno ); #endif /* look for a pdu which we might be extending */ msp = (rtp_multisegment_pdu *)wmem_tree_lookup32_le(finfo->multisegment_pdus, seqno-1); if(msp && msp->startseq < seqno && msp->endseq >= seqno) { guint32 fid = msp->startseq; fragment_head *fd_head; #ifdef DEBUG_FRAGMENTS ws_debug("\tContinues fragment %d", fid); #endif /* we always assume the datagram is complete; if this is the * first pass, that's our best guess, and if it's not, what we * say gets ignored anyway. */ fd_head = fragment_add_seq(&rtp_reassembly_table, tvb, offset, pinfo, fid, NULL, seqno-msp->startseq, data_len, FALSE, 0); newtvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled RTP", fd_head, &rtp_fragment_items, NULL, tree); #ifdef DEBUG_FRAGMENTS ws_debug("\tFragment Coalesced; fd_head=%p, newtvb=%p (len %d)", fd_head, newtvb, newtvb?tvb_reported_length(newtvb):0); #endif if(newtvb != NULL) { /* Hand off to the subdissector */ process_rtp_payload(newtvb, pinfo, tree, rtp_tree, payload_type, rtp_info); /* * Check to see if there were any complete fragments within the chunk */ if( pinfo->desegment_len ) { if (pinfo->desegment_offset == 0) { #ifdef DEBUG_FRAGMENTS ws_debug("\tNo complete pdus in payload" ); #endif /* Mark the fragments as not complete yet */ fragment_set_partial_reassembly(&rtp_reassembly_table, pinfo, fid, NULL); /* we must need another segment */ msp->endseq = MIN(msp->endseq, seqno) + 1; } /* the higher-level dissector has asked for some more data - ie, the end of this segment does not coincide with the end of a higher-level PDU. */ must_desegment = TRUE; } } } else { /* * The segment is not the continuation of a fragmented segment * so process it as normal */ #ifdef DEBUG_FRAGMENTS ws_debug("\tRTP non-fragment payload"); #endif newtvb = tvb_new_subset_length_caplen( tvb, offset, data_len, data_reported_len ); /* Hand off to the subdissector */ process_rtp_payload(newtvb, pinfo, tree, rtp_tree, payload_type, rtp_info); if(pinfo->desegment_len) { /* the higher-level dissector has asked for some more data - ie, the end of this segment does not coincide with the end of a higher-level PDU. */ must_desegment = TRUE; } } /* * There were bytes left over that the higher protocol couldn't dissect so save them */ if(must_desegment) { guint32 deseg_offset = pinfo->desegment_offset; guint32 frag_len = tvb_reported_length_remaining(newtvb, deseg_offset); fragment_head *fd_head; #ifdef DEBUG_FRAGMENTS ws_debug("\tRTP Must Desegment: tvb_len=%d ds_len=%d %d frag_len=%d ds_off=%d", tvb_reported_length(newtvb), pinfo->desegment_len, pinfo->fd->visited, frag_len, deseg_offset); #endif /* allocate a new msp for this pdu */ if (!PINFO_FD_VISITED(pinfo)) { msp = wmem_new(wmem_file_scope(), rtp_multisegment_pdu); msp->startseq = seqno; msp->endseq = seqno+1; wmem_tree_insert32(finfo->multisegment_pdus, seqno, msp); } /* * Add the fragment to the fragment table */ fd_head = fragment_add_seq(&rtp_reassembly_table, newtvb, deseg_offset, pinfo, seqno, NULL, 0, frag_len, TRUE, 0); if(fd_head != NULL) { if( fd_head->reassembled_in != 0 && !(fd_head->flags & FD_PARTIAL_REASSEMBLY) ) { proto_item *rtp_tree_item; rtp_tree_item = proto_tree_add_uint( tree, hf_rtp_reassembled_in, newtvb, deseg_offset, tvb_reported_length_remaining(newtvb, deseg_offset), fd_head->reassembled_in); proto_item_set_generated(rtp_tree_item); #ifdef DEBUG_FRAGMENTS ws_debug("\tReassembled in %d", fd_head->reassembled_in); #endif } else if (fd_head->reassembled_in == 0) { #ifdef DEBUG_FRAGMENTS ws_debug("\tUnfinished fragment"); #endif /* this fragment is never reassembled */ proto_tree_add_expert(tree, pinfo, &ei_rtp_fragment_unfinished, tvb, deseg_offset, -1); } } else { /* * This fragment was the first fragment in a new entry in the * frag_table; we don't yet know where it is reassembled */ #ifdef DEBUG_FRAGMENTS ws_debug("\tnew pdu"); #endif } if( pinfo->desegment_offset == 0 ) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTP"); col_set_str(pinfo->cinfo, COL_INFO, "[RTP segment of a reassembled PDU]"); } } pinfo->can_desegment = 0; pinfo->desegment_offset = 0; pinfo->desegment_len = 0; } static int dissect_rtp_rfc2198(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { volatile gint offset = 0; int cnt; gboolean hdr_follow = TRUE; proto_tree *rfc2198_tree; rfc2198_hdr *hdr_last; rfc2198_hdr *hdr_chain = NULL; struct _rtp_packet_info *p_packet_data; struct _rtp_info* rtp_info = NULL; struct _rtp_info rfc2198_rtp_info; volatile unsigned rtp_info_offset = 0; if (data) { rtp_info = (struct _rtp_info*)data; rfc2198_rtp_info = *rtp_info; rtp_info_offset = rtp_info->info_payload_offset; } /* Retrieve RTPs idea of a conversation */ p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, RTP_CONVERSATION_PROTO_DATA); /* Add try to RFC 2198 data */ rfc2198_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtp_rfc2198, NULL, "RFC 2198: Redundant Audio Data"); hdr_last = NULL; cnt = 0; while (hdr_follow) { proto_item *ti; proto_tree *rfc2198_hdr_tree; const gchar *payload_type_str; rfc2198_hdr *hdr_new; guint8 octet1; cnt++; payload_type_str = NULL; /* Allocate and fill in header */ hdr_new = wmem_new0(pinfo->pool, rfc2198_hdr); hdr_new->next = NULL; octet1 = tvb_get_guint8(tvb, offset); hdr_new->pt = RTP_PAYLOAD_TYPE(octet1); hdr_follow = (octet1 & 0x80); /* Save the payload type for Decode As */ p_add_proto_data(pinfo->pool, pinfo, proto_rtp, RTP_DECODE_AS_PROTO_DATA, GUINT_TO_POINTER(hdr_new->pt)); /* if it is dynamic payload, let use the conv data to see if it is defined */ if ((hdr_new->pt > 95) && (hdr_new->pt < 128)) { if (p_packet_data && p_packet_data->rtp_dyn_payload){ rtp_dyn_payload_get_full(p_packet_data->rtp_dyn_payload, hdr_new->pt, &payload_type_str, &hdr_new->payload_rate, &hdr_new->payload_channels, &hdr_new->payload_fmtp_map); hdr_new->payload_type_str = payload_type_str; } else { /* See if we have a dissector tied to the dynamic payload * through preferences / Decode As */ dissector_handle_t pt_dissector_handle; pt_dissector_handle = dissector_get_uint_handle(rtp_pt_dissector_table, hdr_new->pt); if (pt_dissector_handle) { hdr_new->payload_type_str = dissector_handle_get_dissector_name(pt_dissector_handle); } } } /* Add a subtree for this header and add items */ rfc2198_hdr_tree = proto_tree_add_subtree_format(rfc2198_tree, tvb, offset, (hdr_follow)?4:1, ett_rtp_rfc2198_hdr, &ti, "Header %u", cnt); proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_follow, tvb, offset, 1, ENC_BIG_ENDIAN ); proto_tree_add_uint_format_value(rfc2198_hdr_tree, hf_rtp_payload_type, tvb, offset, 1, octet1, "%s (%u)", payload_type_str ? payload_type_str : val_to_str_ext_const(hdr_new->pt, &rtp_payload_type_vals_ext, "Unknown"), hdr_new->pt); proto_item_append_text(ti, ": PT=%s", payload_type_str ? payload_type_str : val_to_str_ext(hdr_new->pt, &rtp_payload_type_vals_ext, "Unknown (%u)")); offset += 1; /* Timestamp offset and block length don't apply to last header */ if (hdr_follow) { proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_tm_off, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_bl_len, tvb, offset + 1, 2, ENC_BIG_ENDIAN ); hdr_new->len = tvb_get_ntohs(tvb, offset + 1) & 0x03FF; proto_item_append_text(ti, ", len=%u", hdr_new->len); offset += 3; } else { hdr_new->len = -1; hdr_follow = FALSE; } if (hdr_last) { hdr_last->next = hdr_new; } else { hdr_chain = hdr_new; } hdr_last = hdr_new; } /* Dissect each data block according to the header info */ hdr_last = hdr_chain; while (hdr_last) { hdr_last->offset = offset; if (!hdr_last->next) { hdr_last->len = tvb_reported_length_remaining(tvb, offset); } if (rtp_info) { rfc2198_rtp_info.info_payload_offset = rtp_info_offset + hdr_last->offset; rfc2198_rtp_info.info_payload_len = hdr_last->len; rfc2198_rtp_info.info_payload_type = hdr_last->pt; rfc2198_rtp_info.info_payload_type_str = hdr_last->payload_type_str; rfc2198_rtp_info.info_payload_rate = hdr_last->payload_rate; rfc2198_rtp_info.info_payload_channels = hdr_last->payload_channels; rfc2198_rtp_info.info_payload_fmtp_map = hdr_last->payload_fmtp_map; } const char *saved_proto = pinfo->current_proto; TRY { dissect_rtp_data(tvb, pinfo, tree, rfc2198_tree, hdr_last->offset, hdr_last->len, hdr_last->len, hdr_last->pt, &rfc2198_rtp_info); } CATCH_NONFATAL_ERRORS { show_exception(tvb, pinfo, rfc2198_tree, EXCEPT_CODE, GET_MESSAGE); pinfo->current_proto = saved_proto; } ENDTRY; if (rtp_info && rfc2198_deencapsulate && !hdr_last->next) { /* Set the payload for the tap to that of the primary encoding * to remove the RFC 2198 encapsulation. (Since this is the * last encoding in the packet, the calculated length includes * the padding and padding stays the same.) * Ideally we should process the redundant encoding or FEC, * but just treating the primary encoding as the only payload * for the tap is closer than doing nothing, and at least has * some chance of playing or saving the primary media payload. * * XXX: WebRTC/Chromium, when using RED with ULPFEC (RFC 5109), * violates the RFCs by having the FEC set in separate packets * as a different primary encoding (using duplicate sequence * numbers already used by the video.) This is done because of * a concern that the combined payload size of FEC plus video * encodings like VP8 could push a packet over the MTU size, * also a problem. * See RFC 8872 3.2.4 "RTP Payload Type" and Appendix A * "Dismissing Payload Type Multiplexing," also * https://bugs.chromium.org/p/webrtc/issues/detail?id=9188 * https://bugs.chromium.org/p/webrtc/issues/detail?id=12530 * https://bugs.chromium.org/p/webrtc/issues/detail?id=1467 * However, since duplicate sequence numbers as used, a user * Ignoring all the FEC packets could be a workaround. * RFC 2198 in WebRTC/Chromium with actual redundant audio is * RFC-compliant, though: * https://bugs.chromium.org/p/webrtc/issues/detail?id=11640 */ *rtp_info = rfc2198_rtp_info; } offset += hdr_last->len; hdr_last = hdr_last->next; } return tvb_captured_length(tvb); } static int dissect_full_rfc4571(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { /* rfc4571 packet frame 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 --------------------------------------------------------------- | LENGTH | RTP or RTCP packet ... | --------------------------------------------------------------- */ gint offset = 0; guint32 length = 0; proto_tree_add_item_ret_uint(tree, hf_rfc4571_header_len, tvb, offset, 2, ENC_NA, &length); if (length == 0) { return 2; } offset += 2; tvbuff_t *tvb_sub; tvb_sub = tvb_new_subset_remaining(tvb, offset); dissect_rtp(tvb_sub, pinfo, tree, data); return tvb_reported_length(tvb); } static guint get_rtp_rfc4571_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint16 rtp_length = tvb_get_ntohs(tvb, offset); /* length field is at the beginning, 2 bytes */ return (guint)rtp_length + 2; /* plus the length field */ } #define RTP_RFC4571_HEADER_LEN 2 static int dissect_rtp_rfc4571(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, RTP_RFC4571_HEADER_LEN, get_rtp_rfc4571_len, dissect_full_rfc4571, data); return tvb_captured_length(tvb); } static void dissect_rtp_hext_rfc5285_onebyte( tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtp_hext_tree ) { proto_tree *rtp_hext_rfc5285_tree = NULL; guint ext_offset = 0; while (ext_offset < tvb_captured_length (tvb)) { guint8 ext_hdr_hdr; guint8 ext_id; guint8 ext_length; guint start_ext_offset; tvbuff_t *subtvb; /* Skip bytes with the value 0, they are padding */ start_ext_offset = ext_offset; while (tvb_get_guint8 (tvb, ext_offset) == 0) { ext_offset ++; if (ext_offset >= tvb_captured_length (tvb)) return; } /* Add padding */ if (ext_offset > start_ext_offset) proto_tree_add_item(rtp_hext_tree, hf_rtp_padding_data, tvb, start_ext_offset, ext_offset-start_ext_offset, ENC_NA ); ext_hdr_hdr = tvb_get_guint8 (tvb, ext_offset); ext_id = ext_hdr_hdr >> 4; /* 15 is for future extensibility, ignore length, etc and stop processing packet if it shows up */ if (ext_id == 15) return; ext_length = (ext_hdr_hdr & 0x0F) + 1; /* Exit on malformed extension headers */ if (ext_offset + ext_length + 1 > tvb_captured_length (tvb)) { return; } if (rtp_hext_tree) { rtp_hext_rfc5285_tree = proto_tree_add_subtree(rtp_hext_tree, tvb, ext_offset, ext_length + 1, ett_hdr_ext_rfc5285, NULL, "RFC 5285 Header Extension (One-Byte Header)"); proto_tree_add_uint( rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_id, tvb, ext_offset, 1, ext_id); proto_tree_add_uint( rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_length, tvb, ext_offset, 1, ext_length); } ext_offset ++; subtvb = tvb_new_subset_length(tvb, ext_offset, ext_length); if (!dissector_try_uint (rtp_hdr_ext_rfc5285_dissector_table, ext_id, subtvb, pinfo, rtp_hext_rfc5285_tree)) { if (rtp_hext_tree) proto_tree_add_item(rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_data, subtvb, 0, ext_length, ENC_NA ); } ext_offset += ext_length; } } static void dissect_rtp_hext_rfc5285_twobytes(tvbuff_t *parent_tvb, guint id_offset, guint8 id, tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtp_hext_tree) { proto_tree *rtp_hext_rfc5285_tree = NULL; guint ext_offset = 0, start_ext_offset; while (ext_offset + 2 < tvb_captured_length (tvb)) { guint8 ext_id; guint8 ext_length; tvbuff_t *subtvb; /* Skip bytes with the value 0, they are padding */ start_ext_offset = ext_offset; while (tvb_get_guint8 (tvb, ext_offset) == 0) { if (ext_offset + 2 >= tvb_captured_length (tvb)) return; ext_offset ++; } /* Add padding */ if (ext_offset > start_ext_offset) proto_tree_add_item(rtp_hext_tree, hf_rtp_padding_data, tvb, start_ext_offset, ext_offset-start_ext_offset, ENC_NA ); ext_id = tvb_get_guint8 (tvb, ext_offset); ext_length = tvb_get_guint8 (tvb, ext_offset + 1); if (rtp_hext_tree) { rtp_hext_rfc5285_tree = proto_tree_add_subtree(rtp_hext_tree, tvb, ext_offset, ext_length + 2, ett_hdr_ext_rfc5285, NULL, "RFC 5285 Header Extension (Two-Byte Header)"); proto_tree_add_uint( rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_appbits, parent_tvb, id_offset + 1, 1, id & 0x000F); proto_tree_add_uint( rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_id, tvb, ext_offset, 1, ext_id); proto_tree_add_uint( rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_length, tvb, ext_offset + 1, 1, ext_length); } ext_offset += 2; subtvb = tvb_new_subset_length(tvb, ext_offset, ext_length); if (ext_length && !dissector_try_uint (rtp_hdr_ext_rfc5285_dissector_table, ext_id, subtvb, pinfo, rtp_hext_rfc5285_tree)) { proto_tree_add_item(rtp_hext_rfc5285_tree, hf_rtp_ext_rfc5285_data, subtvb, 0, ext_length, ENC_NA ); } ext_offset += ext_length; } } static gint dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti = NULL; proto_tree *volatile rtp_tree = NULL; guint8 octet1, octet2; unsigned int version; gboolean padding_set; gboolean extension_set; unsigned int csrc_count; gboolean marker_set; unsigned int payload_type; const gchar *payload_type_str = NULL; gboolean is_srtp = FALSE; unsigned int i; gint length, reported_length; int data_len; volatile unsigned int offset = 0; guint16 seq_num; guint32 timestamp; guint32 sync_src; struct _rtp_packet_info *p_packet_data; /*struct srtp_info *srtp_info = NULL;*/ /*unsigned int srtp_offset;*/ const char *pt = NULL; /* Can tap up to 4 RTP packets within same packet */ static struct _rtp_info rtp_info_arr[4]; static int rtp_info_current = 0; struct _rtp_info *rtp_info; static int * const octet1_fields[] = { &hf_rtp_version, &hf_rtp_padding, &hf_rtp_extension, &hf_rtp_csrc_count, NULL }; rtp_info_current++; if (rtp_info_current == 4) { rtp_info_current = 0; } rtp_info = &rtp_info_arr[rtp_info_current]; /* Get the fields in the first octet */ octet1 = tvb_get_guint8( tvb, offset ); version = RTP_VERSION( octet1 ); /* RFC 7983 gives current best practice in demultiplexing RTP packets: * Examine the first byte of the packet: * +----------------+ * | [0..3] -+--> forward to STUN * | | * | [16..19] -+--> forward to ZRTP * | | * packet --> | [20..63] -+--> forward to DTLS * | | * | [64..79] -+--> forward to TURN Channel * | | * | [128..191] -+--> forward to RTP/RTCP * +----------------+ * * DTLS-SRTP MUST support multiplexing of DTLS and RTP over the same * port pair (RFCs 5764, 8835), and this frequently occurs after SDP * has been used to set up a RTP conversation and set the conversation * dissector RTP. In addition, STUN packets sharing one port are common * as well. * * In practice, RTP0_INVALID rejects packets and lets heuristic dissectors * take a look. The STUN, ZRTP, and DTLS heuristic dissectors are all * enabled by default so out of the box it more or less looks correct - at * least on the second pass, on tshark there's incorrect RTP information in * the tree. However, the STUN heuristic dissector can change the * dissector for the conversation to itself (the non-heuristic dissector * does not), see #18832, and TURN ChannelData messages are impossible to * heuristically detect. */ if (global_rtp_version0_type == RTP0_RFC7983) { switch (version) { case 0: if (octet1 < 4) { call_dissector(stun_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); } else if ((octet1 & 0xfc) == 0x10) { call_dissector(zrtp_handle, tvb,pinfo, tree); return tvb_captured_length(tvb); } else if (octet1 > 19) { call_dissector(dtls_handle, tvb,pinfo, tree); return tvb_captured_length(tvb); } break; case 1: if (octet1 < 80) { /* The STUN dissector will dissect TURN ChannelData * XXX: Maybe we should call the turnchannel dissector? * * Should we be assuming we have TURN ChannelData for * the RTP0_STUN and option too? */ call_dissector(stun_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); } break; case 3: if (octet1 == 0xFF) { if (tvb_get_guint8( tvb, offset + 1 ) == 0x10) { /* Special MS-TURN Multiplexed TURN Channel */ call_dissector(stun_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); } } /* FALLTHROUGH */ case 2: default: break; } } else if (version == 0) { switch (global_rtp_version0_type) { case RTP0_STUN: call_dissector(stun_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); case RTP0_CLASSICSTUN: call_dissector(classicstun_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); case RTP0_T38: call_dissector(t38_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); case RTP0_SPRT: call_dissector(sprt_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); case RTP0_INVALID: if (!(tvb_memeql(tvb, 4, (const guint8*)"ZRTP", 4))) { call_dissector(zrtp_handle, tvb,pinfo, tree); return tvb_captured_length(tvb); } default: ; /* Unknown or unsupported version (let it fall through) */ } } /* fill in the rtp_info structure */ rtp_info->info_version = version; if (version != 2) { /* * Unknown or unsupported version. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTP"); col_add_fstr( pinfo->cinfo, COL_INFO, "Unknown RTP version %u", version); if ( tree ) { ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, -1, ENC_NA ); rtp_tree = proto_item_add_subtree( ti, ett_rtp ); proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb, offset, 1, octet1); } /* XXX: Offset is zero here, so in practice this rejects the packet * and lets heuristic dissectors make an attempt, though after * adding entries to the tree (at least on a first pass in tshark.) */ return offset; } padding_set = RTP_PADDING( octet1 ); extension_set = RTP_EXTENSION( octet1 ); csrc_count = RTP_CSRC_COUNT( octet1 ); /* Get the fields in the second octet */ octet2 = tvb_get_guint8( tvb, offset + 1 ); marker_set = RTP_MARKER( octet2 ); payload_type = RTP_PAYLOAD_TYPE( octet2 ); /* Save the payload type for Decode As */ p_add_proto_data(pinfo->pool, pinfo, proto_rtp, RTP_DECODE_AS_PROTO_DATA, GUINT_TO_POINTER(payload_type)); if (marker_set && payload_type >= FIRST_RTCP_CONFLICT_PAYLOAD_TYPE && payload_type <= LAST_RTCP_CONFLICT_PAYLOAD_TYPE) { call_dissector(rtcp_handle, tvb, pinfo, tree); return tvb_captured_length(tvb); } /* Get the subsequent fields */ seq_num = tvb_get_ntohs( tvb, offset + 2 ); timestamp = tvb_get_ntohl( tvb, offset + 4 ); sync_src = tvb_get_ntohl( tvb, offset + 8 ); /* fill in the rtp_info structure */ rtp_info->info_padding_set = padding_set; rtp_info->info_padding_count = 0; rtp_info->info_marker_set = marker_set; rtp_info->info_media_types = 0; rtp_info->info_payload_type = payload_type; rtp_info->info_seq_num = seq_num; rtp_info->info_extended_seq_num = seq_num; /* initial with seq_number */ rtp_info->info_timestamp = timestamp; rtp_info->info_extended_timestamp = timestamp; /* initial with timestamp */ rtp_info->info_sync_src = sync_src; rtp_info->info_is_srtp = FALSE; rtp_info->info_setup_frame_num = 0; rtp_info->info_payload_type_str = NULL; rtp_info->info_payload_rate = 0; rtp_info->info_payload_fmtp_map = NULL; rtp_info->info_is_ed137 = FALSE; rtp_info->info_ed137_info = NULL; /* * Do we have all the data? */ length = tvb_captured_length_remaining(tvb, offset); reported_length = tvb_reported_length_remaining(tvb, offset); if (reported_length >= 0 && length >= reported_length) { /* * Yes. */ rtp_info->info_all_data_present = TRUE; rtp_info->info_data_len = reported_length; /* * Save the pointer to raw rtp data (header + payload incl. * padding). * That should be safe because the "epan_dissect_t" * constructed for the packet has not yet been freed when * the taps are called. * (Destroying the "epan_dissect_t" will end up freeing * all the tvbuffs and hence invalidating pointers to * their data.) * See "add_packet_to_packet_list()" for details. */ rtp_info->info_data = tvb_get_ptr(tvb, 0, -1); } else { /* * No - packet was cut short at capture time. */ rtp_info->info_all_data_present = FALSE; rtp_info->info_data_len = 0; rtp_info->info_data = NULL; } /* Look for conv and add to the frame if found */ p_packet_data = get_rtp_packet_info(pinfo, rtp_info); if (p_packet_data && p_packet_data->srtp_info) is_srtp = TRUE; rtp_info->info_is_srtp = is_srtp; col_set_str( pinfo->cinfo, COL_PROTOCOL, (is_srtp) ? "SRTP" : "RTP" ); #if 0 /* XXX: srtp_offset never actually used ?? */ /* check if this is added as an SRTP stream - if so, don't try to dissect the payload data for now */ if (p_conv_data && p_conv_data->srtp_info) { srtp_info = p_conv_data->srtp_info; if (rtp_info->info_all_data_present) { srtp_offset = rtp_info->info_data_len - srtp_info->mki_len - srtp_info->auth_tag_len; } } #endif if (p_packet_data && p_packet_data->bta2dp_info && p_packet_data->bta2dp_info->codec_dissector) { rtp_info->info_payload_type_str = (const char *) dissector_handle_get_protocol_short_name(p_packet_data->bta2dp_info->codec_dissector); } else if (p_packet_data && p_packet_data->btvdp_info && p_packet_data->btvdp_info->codec_dissector) { rtp_info->info_payload_type_str = (const char *) dissector_handle_get_protocol_short_name(p_packet_data->btvdp_info->codec_dissector); } /* if it is dynamic payload, let use the conv data to see if it is defined */ if ( (payload_type>95) && (payload_type<128) ) { if (p_packet_data && p_packet_data->rtp_dyn_payload) { int sample_rate = 0; unsigned channels = 1; wmem_map_t *fmtp_map; #ifdef DEBUG_CONVERSATION rtp_dump_dyn_payload(p_conv_data->rtp_dyn_payload); #endif DPRINT(("looking up conversation data for dyn_pt=%d", payload_type)); if (rtp_dyn_payload_get_full(p_packet_data->rtp_dyn_payload, payload_type, &payload_type_str, &sample_rate, &channels, &fmtp_map)) { DPRINT(("found conversation data for dyn_pt=%d, enc_name=%s", payload_type, payload_type_str)); rtp_info->info_payload_type_str = payload_type_str; rtp_info->info_payload_rate = sample_rate; rtp_info->info_payload_channels = channels; rtp_info->info_payload_fmtp_map = fmtp_map; } } else { /* See if we have a dissector tied to the dynamic payload trough preferences*/ dissector_handle_t pt_dissector_handle; const char *name; pt_dissector_handle = dissector_get_uint_handle(rtp_pt_dissector_table, payload_type); if (pt_dissector_handle) { name = dissector_handle_get_dissector_name(pt_dissector_handle); if (name) { rtp_info->info_payload_type_str = name; } } } } if (p_packet_data && p_packet_data->bta2dp_info) { pt = (p_packet_data->bta2dp_info->codec_dissector) ? dissector_handle_get_protocol_short_name(p_packet_data->bta2dp_info->codec_dissector) : "Unknown"; } else if (p_packet_data && p_packet_data->btvdp_info) { pt = (p_packet_data->btvdp_info->codec_dissector) ? dissector_handle_get_protocol_short_name(p_packet_data->btvdp_info->codec_dissector) : "Unknown"; } else { pt = (payload_type_str ? payload_type_str : val_to_str_ext(payload_type, &rtp_payload_type_vals_ext, "Unknown (%u)")); } col_add_fstr( pinfo->cinfo, COL_INFO, "PT=%s, SSRC=0x%X, Seq=%u, Time=%u%s", pt, sync_src, seq_num, timestamp, marker_set ? ", Mark" : ""); if ( tree ) { proto_tree *item; /* Create RTP protocol tree */ ti = proto_tree_add_item(tree, proto_rtp, tvb, offset, -1, ENC_NA ); rtp_tree = proto_item_add_subtree(ti, ett_rtp ); /* Conversation setup info */ if (global_rtp_show_setup_info) { show_setup_info(tvb, pinfo, rtp_tree); } proto_tree_add_bitmask_list(rtp_tree, tvb, offset, 1, octet1_fields, ENC_NA); offset++; proto_tree_add_boolean( rtp_tree, hf_rtp_marker, tvb, offset, 1, octet2 ); proto_tree_add_uint_format( rtp_tree, hf_rtp_payload_type, tvb, offset, 1, octet2, "Payload type: %s (%u)", pt, payload_type); offset++; /* Sequence number 16 bits (2 octets) */ proto_tree_add_uint( rtp_tree, hf_rtp_seq_nr, tvb, offset, 2, seq_num ); if(p_packet_data != NULL) { item = proto_tree_add_uint(rtp_tree, hf_rtp_ext_seq_nr, tvb, offset, 2, p_packet_data->extended_seqno); proto_item_set_generated(item); } offset += 2; /* Timestamp 32 bits (4 octets) */ proto_tree_add_uint( rtp_tree, hf_rtp_timestamp, tvb, offset, 4, timestamp ); offset += 4; /* Synchronization source identifier 32 bits (4 octets) */ proto_tree_add_uint( rtp_tree, hf_rtp_ssrc, tvb, offset, 4, sync_src ); offset += 4; } else { offset += 12; } /* CSRC list*/ if ( csrc_count > 0 ) { proto_tree *rtp_csrc_tree; guint32 csrc_item; ti = proto_tree_add_item(rtp_tree, hf_rtp_csrc_items, tvb, offset, csrc_count * 4, ENC_NA); proto_item_append_text(ti, " (%u items)", csrc_count); rtp_csrc_tree = proto_item_add_subtree( ti, ett_csrc_list ); for (i = 0; i < csrc_count; i++ ) { csrc_item = tvb_get_ntohl( tvb, offset ); proto_tree_add_uint_format( rtp_csrc_tree, hf_rtp_csrc_item, tvb, offset, 4, csrc_item, "CSRC item %d: 0x%X", i, csrc_item ); offset += 4; } } /* Optional RTP header extension */ if ( extension_set ) { unsigned int hdr_extension_len; unsigned int hdr_extension_id; /* Defined by profile field is 16 bits (2 octets) */ hdr_extension_id = tvb_get_ntohs( tvb, offset ); proto_tree_add_uint( rtp_tree, hf_rtp_prof_define, tvb, offset, 2, hdr_extension_id ); offset += 2; hdr_extension_len = tvb_get_ntohs( tvb, offset ); proto_tree_add_uint( rtp_tree, hf_rtp_length, tvb, offset, 2, hdr_extension_len); offset += 2; if ( hdr_extension_len > 0 ) { proto_tree *rtp_hext_tree = NULL; tvbuff_t *newtvb; ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension_len * 4, ENC_NA); rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext ); /* pass interpretation of header extension to a registered subdissector */ newtvb = tvb_new_subset_length(tvb, offset, hdr_extension_len * 4); if (hdr_extension_id == RTP_RFC5285_ONE_BYTE_SIG) { dissect_rtp_hext_rfc5285_onebyte (newtvb, pinfo, rtp_hext_tree); } else if ((hdr_extension_id & RTP_RFC5285_TWO_BYTE_MASK) == RTP_RFC5285_TWO_BYTE_SIG) { dissect_rtp_hext_rfc5285_twobytes(tvb, offset - 4, hdr_extension_id, newtvb, pinfo, rtp_hext_tree); } else { if ( !(dissector_try_uint_new(rtp_hdr_ext_dissector_table, hdr_extension_id, newtvb, pinfo, rtp_hext_tree, FALSE, rtp_info)) ) { unsigned int hdrext_offset; hdrext_offset = offset; for ( i = 0; i < hdr_extension_len; i++ ) { proto_tree_add_item( rtp_hext_tree, hf_rtp_hdr_ext, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN ); hdrext_offset += 4; } } } } offset += hdr_extension_len * 4; } if ( padding_set ) { /* * This RTP frame has padding - find it. * * The padding count is found in the LAST octet of * the packet; it contains the number of octets * that can be ignored at the end of the packet. */ volatile unsigned int padding_count; if (tvb_captured_length(tvb) < tvb_reported_length(tvb)) { /* * We don't *have* the last octet of the * packet, so we can't get the padding * count. * * Put an indication of that into the * tree, and just put in a raw data * item. */ proto_tree_add_expert(rtp_tree, pinfo, &ei_rtp_padding_missing, tvb, 0, 0); call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, rtp_tree); return tvb_captured_length(tvb); } padding_count = tvb_get_guint8( tvb, tvb_reported_length( tvb ) - 1 ); data_len = tvb_reported_length_remaining( tvb, offset ) - padding_count; rtp_info->info_payload_offset = offset; rtp_info->info_payload_len = tvb_captured_length_remaining(tvb, offset); rtp_info->info_padding_count = padding_count; if (p_packet_data && p_packet_data->bta2dp_info) { if (p_packet_data->bta2dp_info->codec_dissector == sbc_handle) { rtp_info->info_payload_offset += 1; rtp_info->info_payload_len -= 1; } if (p_packet_data->bta2dp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) { rtp_info->info_payload_offset += 1; rtp_info->info_payload_len -= 1; } } if (p_packet_data && p_packet_data->btvdp_info && p_packet_data->btvdp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) { rtp_info->info_payload_offset += 1; rtp_info->info_payload_len -= 1; } if (data_len > 0) { /* * There's data left over when you take out * the padding; dissect it. */ struct _rtp_pkt_info *rtp_pkt_info = wmem_new(pinfo->pool, struct _rtp_pkt_info); rtp_pkt_info->payload_len = data_len; rtp_pkt_info->padding_len = padding_count - 1; p_add_proto_data(pinfo->pool, pinfo, proto_rtp, pinfo->curr_layer_num, rtp_pkt_info); /* Ensure that tap is called after packet dissection, even in case of exception */ TRY { dissect_rtp_data( tvb, pinfo, tree, rtp_tree, offset, data_len, data_len, payload_type, rtp_info); } CATCH_ALL { if (!pinfo->flags.in_error_pkt) tap_queue_packet(rtp_tap, pinfo, rtp_info); RETHROW; } ENDTRY; offset += data_len; } else if (data_len < 0) { /* * The padding count is bigger than the * amount of RTP payload in the packet! * Clip the padding count. * * XXX - put an item in the tree to indicate * that the padding count is bogus? */ padding_count = tvb_reported_length_remaining(tvb, offset); } if (padding_count > 1) { /* * There's more than one byte of padding; * show all but the last byte as padding * data. */ proto_tree_add_item( rtp_tree, hf_rtp_padding_data, tvb, offset, padding_count - 1, ENC_NA ); offset += padding_count - 1; } /* * Show the last byte in the PDU as the padding * count. */ proto_tree_add_item( rtp_tree, hf_rtp_padding_count, tvb, offset, 1, ENC_BIG_ENDIAN ); } else { /* * No padding. */ rtp_info->info_payload_offset = offset; rtp_info->info_payload_len = tvb_captured_length_remaining(tvb, offset); if (p_packet_data && p_packet_data->bta2dp_info) { if (p_packet_data->bta2dp_info->codec_dissector == sbc_handle) { rtp_info->info_payload_offset += 1; rtp_info->info_payload_len -= 1; } if (p_packet_data->bta2dp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) { rtp_info->info_payload_offset += 1; rtp_info->info_payload_len -= 1; } } if (p_packet_data && p_packet_data->btvdp_info && p_packet_data->btvdp_info->content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T) { rtp_info->info_payload_offset += 1; rtp_info->info_payload_len -= 1; } if (tvb_reported_length_remaining(tvb, offset) > 0) { struct _rtp_pkt_info *rtp_pkt_info = wmem_new(pinfo->pool, struct _rtp_pkt_info); rtp_pkt_info->payload_len = tvb_captured_length_remaining(tvb, offset); rtp_pkt_info->padding_len = 0; p_set_proto_data(pinfo->pool, pinfo, proto_rtp, pinfo->curr_layer_num, rtp_pkt_info); /* Ensure that tap is called after packet dissection, even in case of exception */ TRY { dissect_rtp_data( tvb, pinfo, tree, rtp_tree, offset, tvb_captured_length_remaining( tvb, offset ), tvb_reported_length_remaining( tvb, offset ), payload_type, rtp_info); } CATCH_ALL { if (!pinfo->flags.in_error_pkt) tap_queue_packet(rtp_tap, pinfo, rtp_info); RETHROW; } ENDTRY; } } if (!pinfo->flags.in_error_pkt) tap_queue_packet(rtp_tap, pinfo, rtp_info); return offset; } gint dissect_rtp_shim_header(tvbuff_t *tvb, gint start, packet_info *pinfo _U_, proto_tree *tree, struct _rtp_info *rtp_info) { proto_item *rtp_ti = NULL; proto_tree *rtp_tree = NULL; proto_item *ti; guint8 octet1, octet2; unsigned int version; gboolean padding_set; gboolean extension_set; unsigned int csrc_count; gboolean marker_set; unsigned int payload_type; unsigned int i; gint offset = start; guint16 seq_num; guint32 timestamp; guint32 sync_src; const char *pt = NULL; static int * const octet1_fields[] = { &hf_rtp_version, &hf_rtp_padding, &hf_rtp_extension, &hf_rtp_csrc_count, NULL }; /* Get the fields in the first octet */ octet1 = tvb_get_guint8( tvb, offset ); version = RTP_VERSION( octet1 ); /* fill in the rtp_info structure */ if (rtp_info) rtp_info->info_version = version; if (version != 2) { /* * Unknown or unsupported version. */ if ( tree ) { ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, 1, ENC_NA ); rtp_tree = proto_item_add_subtree( ti, ett_rtp ); proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb, offset, 1, octet1); } return offset; } padding_set = RTP_PADDING( octet1 ); extension_set = RTP_EXTENSION( octet1 ); csrc_count = RTP_CSRC_COUNT( octet1 ); /* Get the fields in the second octet */ octet2 = tvb_get_guint8( tvb, offset + 1 ); marker_set = RTP_MARKER( octet2 ); payload_type = RTP_PAYLOAD_TYPE( octet2 ); /* Get the subsequent fields */ seq_num = tvb_get_ntohs( tvb, offset + 2 ); timestamp = tvb_get_ntohl( tvb, offset + 4 ); sync_src = tvb_get_ntohl( tvb, offset + 8 ); /* fill in the rtp_info structure */ if (rtp_info) { rtp_info->info_padding_set = padding_set; rtp_info->info_padding_count = 0; rtp_info->info_marker_set = marker_set; rtp_info->info_media_types = 0; rtp_info->info_payload_type = payload_type; rtp_info->info_seq_num = seq_num; rtp_info->info_timestamp = timestamp; rtp_info->info_sync_src = sync_src; rtp_info->info_data_len = 0; rtp_info->info_all_data_present = FALSE; rtp_info->info_payload_offset = 0; rtp_info->info_payload_len = 0; rtp_info->info_is_srtp = FALSE; rtp_info->info_setup_frame_num = 0; rtp_info->info_data = NULL; rtp_info->info_payload_type_str = NULL; rtp_info->info_payload_rate = 0; rtp_info->info_payload_fmtp_map = NULL; rtp_info->info_is_ed137 = FALSE; rtp_info->info_ed137_info = NULL; } if ( tree ) { /* Create RTP protocol tree */ rtp_ti = proto_tree_add_item(tree, proto_rtp, tvb, offset, 0, ENC_NA ); rtp_tree = proto_item_add_subtree(rtp_ti, ett_rtp ); proto_tree_add_bitmask_list(rtp_tree, tvb, offset, 1, octet1_fields, ENC_NA); offset++; proto_tree_add_boolean( rtp_tree, hf_rtp_marker, tvb, offset, 1, octet2 ); pt = val_to_str_ext(payload_type, &rtp_payload_type_vals_ext, "Unknown (%u)"); proto_tree_add_uint_format( rtp_tree, hf_rtp_payload_type, tvb, offset, 1, octet2, "Payload type: %s (%u)", pt, payload_type); offset++; /* Sequence number 16 bits (2 octets) */ proto_tree_add_uint( rtp_tree, hf_rtp_seq_nr, tvb, offset, 2, seq_num ); offset += 2; /* Timestamp 32 bits (4 octets) */ proto_tree_add_uint( rtp_tree, hf_rtp_timestamp, tvb, offset, 4, timestamp ); offset += 4; /* Synchronization source identifier 32 bits (4 octets) */ proto_tree_add_uint( rtp_tree, hf_rtp_ssrc, tvb, offset, 4, sync_src ); offset += 4; } else { offset += 12; } /* CSRC list*/ if ( csrc_count > 0 ) { proto_tree *rtp_csrc_tree; guint32 csrc_item; ti = proto_tree_add_item(rtp_tree, hf_rtp_csrc_items, tvb, offset, csrc_count * 4, ENC_NA); proto_item_append_text(ti, " (%u items)", csrc_count); rtp_csrc_tree = proto_item_add_subtree( ti, ett_csrc_list ); for (i = 0; i < csrc_count; i++ ) { csrc_item = tvb_get_ntohl( tvb, offset ); proto_tree_add_uint_format( rtp_csrc_tree, hf_rtp_csrc_item, tvb, offset, 4, csrc_item, "CSRC item %d: 0x%X", i, csrc_item ); offset += 4; } } /* Optional RTP header extension */ if ( extension_set ) { unsigned int hdr_extension_len; unsigned int hdr_extension_id; /* Defined by profile field is 16 bits (2 octets) */ hdr_extension_id = tvb_get_ntohs( tvb, offset ); proto_tree_add_uint( rtp_tree, hf_rtp_prof_define, tvb, offset, 2, hdr_extension_id ); offset += 2; hdr_extension_len = tvb_get_ntohs( tvb, offset ); proto_tree_add_uint( rtp_tree, hf_rtp_length, tvb, offset, 2, hdr_extension_len); offset += 2; if ( hdr_extension_len > 0 ) { proto_tree *rtp_hext_tree = NULL; ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension_len * 4, ENC_NA); rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext ); for ( i = 0; i < hdr_extension_len; i++ ) { proto_tree_add_item( rtp_hext_tree, hf_rtp_hdr_ext, tvb, offset, 4, ENC_BIG_ENDIAN ); offset += 4; } } } proto_item_set_len(rtp_ti, offset - start); return (offset - start); } /* calculate the extended sequence number - top 16 bits of the previous sequence number, * plus our own; then correct for wrapping */ static guint32 calculate_extended_seqno(guint32 previous_seqno, guint16 raw_seqno) { guint32 seqno = (previous_seqno & 0xffff0000) | raw_seqno; if (seqno + 0x8000 < previous_seqno) { seqno += 0x10000; } else if (previous_seqno + 0x8000 < seqno) { /* we got an out-of-order packet which happened to go backwards over the * wrap boundary */ seqno -= 0x10000; } return seqno; } /* calculate the extended sequence number - top 16 bits of the previous sequence number, * plus our own; then correct for wrapping */ static guint64 calculate_extended_timestamp(guint64 previous_timestamp, guint32 raw_timestamp) { guint64 timestamp = (previous_timestamp & 0xffffffff00000000) | raw_timestamp; if (timestamp + 0x80000000 < previous_timestamp) { timestamp += 0x100000000; } else if (previous_timestamp + 0x80000000 < timestamp) { /* we got an out-of-order packet which happened to go backwards over the * wrap boundary */ timestamp -= 0x100000000; } return timestamp; } /* Look for conversation info */ static struct _rtp_packet_info * get_rtp_packet_info(packet_info *pinfo, struct _rtp_info *rtp_info) { /* Conversation and current data */ struct _rtp_packet_info *p_packet_data; /* Use existing packet info if available */ p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, RTP_CONVERSATION_PROTO_DATA); if (!p_packet_data) { conversation_t *p_conv; /* First time, get info from conversation */ p_conv = find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (!p_conv) { /* Create a conversation in case none exists (decode as is used for marking the packet as RTP) */ p_conv = conversation_new(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR2); } /* Create space for packet info */ struct _rtp_conversation_info *p_conv_data; p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp); if (!p_conv_data) { /* Create conversation data. If RTP was set up by an SDP or by * the heuristic dissector, conversation data should already * have been created. Therefore, we should only reach this * case if Decode As is being used (See Issue #18829). */ p_conv_data = wmem_new0(wmem_file_scope(), struct _rtp_conversation_info); p_conv_data->ssrc_number_space = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); p_conv_data->rtp_conv_info = wmem_new(wmem_file_scope(), rtp_private_conv_info); p_conv_data->rtp_conv_info->multisegment_pdus = wmem_tree_new(wmem_file_scope()); (void)g_strlcpy(p_conv_data->method, "DECODE AS", MAX_RTP_SETUP_METHOD_SIZE + 1); p_conv_data->frame_number = pinfo->num; p_conv_data->media_types = 0; p_conv_data->srtp_info = NULL; p_conv_data->bta2dp_info = NULL; p_conv_data->btvdp_info = NULL; conversation_add_proto_data(p_conv, proto_rtp, p_conv_data); } guint32 seqno; guint64 timestamp; /* Save this conversation info into packet info */ /* This is file scoped because we only do this on the first pass. * On nonsequential passes, the conversation data has the values * from the last dissected frame, which is not necessarily the * immediately previous frame. */ p_packet_data = wmem_new(wmem_file_scope(), struct _rtp_packet_info); (void)g_strlcpy(p_packet_data->method, p_conv_data->method, MAX_RTP_SETUP_METHOD_SIZE + 1); p_packet_data->frame_number = p_conv_data->frame_number; p_packet_data->media_types = p_conv_data->media_types; /* do not increment ref count for the rtp_dyn_payload */ p_packet_data->rtp_dyn_payload = p_conv_data->rtp_dyn_payload; p_packet_data->rtp_conv_info = p_conv_data->rtp_conv_info; p_packet_data->srtp_info = p_conv_data->srtp_info; p_packet_data->rtp_sdp_setup_info_list = p_conv_data->rtp_sdp_setup_info_list; p_packet_data->bta2dp_info = p_conv_data->bta2dp_info; p_packet_data->btvdp_info = p_conv_data->btvdp_info; p_add_proto_data(wmem_file_scope(), pinfo, proto_rtp, RTP_CONVERSATION_PROTO_DATA, p_packet_data); rtp_number_space* number_space = wmem_map_lookup(p_conv_data->ssrc_number_space, GUINT_TO_POINTER(rtp_info->info_sync_src)); if (number_space == NULL) { /* Start the extended numbers up one cycle, to cope gracefully with the first few packets being out of order. */ number_space = wmem_new0(wmem_file_scope(), rtp_number_space); number_space->extended_seqno = 0x10000; number_space->extended_timestamp = 0x100000000; wmem_map_insert(p_conv_data->ssrc_number_space, GUINT_TO_POINTER(rtp_info->info_sync_src), number_space); } /* calculate extended sequence number */ seqno = calculate_extended_seqno(number_space->extended_seqno, rtp_info->info_seq_num); p_packet_data->extended_seqno = seqno; number_space->extended_seqno = seqno; /* calculate extended timestamp */ timestamp = calculate_extended_timestamp(number_space->extended_timestamp, rtp_info->info_timestamp); p_packet_data->extended_timestamp = timestamp; number_space->extended_timestamp = timestamp; } rtp_info->info_setup_frame_num = p_packet_data->frame_number; rtp_info->info_media_types = p_packet_data->media_types; rtp_info->info_extended_seq_num = p_packet_data->extended_seqno; rtp_info->info_extended_timestamp = p_packet_data->extended_timestamp; return p_packet_data; } /* Display setup info */ static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Conversation and current data */ struct _rtp_packet_info *p_packet_data; proto_tree *rtp_setup_tree; proto_item *ti; /* Use existing packet info if available */ p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, RTP_CONVERSATION_PROTO_DATA); if (!p_packet_data) return; /* Create setup info subtree with summary info. */ ti = proto_tree_add_string_format(tree, hf_rtp_setup, tvb, 0, 0, "", "Stream setup by %s (frame %u)", p_packet_data->method, p_packet_data->frame_number); proto_item_set_generated(ti); rtp_setup_tree = proto_item_add_subtree(ti, ett_rtp_setup); if (rtp_setup_tree) { /* Add details into subtree */ proto_item* item = proto_tree_add_uint(rtp_setup_tree, hf_rtp_setup_frame, tvb, 0, 0, p_packet_data->frame_number); proto_item_set_generated(item); item = proto_tree_add_string(rtp_setup_tree, hf_rtp_setup_method, tvb, 0, 0, p_packet_data->method); proto_item_set_generated(item); if (p_packet_data->rtp_sdp_setup_info_list){ guint i; sdp_setup_info_t *stored_setup_info; for (i = 0; i < wmem_array_get_count(p_packet_data->rtp_sdp_setup_info_list); i++) { stored_setup_info = (sdp_setup_info_t *)wmem_array_index(p_packet_data->rtp_sdp_setup_info_list, i); if (stored_setup_info->hf_id) { if (stored_setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_STR) { item = proto_tree_add_string(rtp_setup_tree, stored_setup_info->hf_id, tvb, 0, 0, stored_setup_info->trace_id.str); proto_item_set_generated(item); if (stored_setup_info->add_hidden == TRUE) { proto_item_set_hidden(item); } } else if (stored_setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_GUINT32) { item = proto_tree_add_uint(rtp_setup_tree, stored_setup_info->hf_id, tvb, 0, 0, stored_setup_info->trace_id.num); proto_item_set_generated(item); if (stored_setup_info->add_hidden == TRUE) { proto_item_set_hidden(item); } } } } } } } /* Dissect PacketCable CCC header */ static int dissect_pkt_ccc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { if ( tree ) { proto_item *ti; proto_tree *pkt_ccc_tree; ti = proto_tree_add_item(tree, proto_pkt_ccc, tvb, 0, 12, ENC_NA); pkt_ccc_tree = proto_item_add_subtree(ti, ett_pkt_ccc); proto_tree_add_item(pkt_ccc_tree, hf_pkt_ccc_id, tvb, 0, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pkt_ccc_tree, hf_pkt_ccc_ts, tvb, 4, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); } return dissect_rtp(tvb, pinfo, tree, data); } /* Register PacketCable CCC */ void proto_register_pkt_ccc(void) { static hf_register_info hf[] = { { &hf_pkt_ccc_id, { "PacketCable CCC Identifier", "pkt_ccc.ccc_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pkt_ccc_ts, { "PacketCable CCC Timestamp", "pkt_ccc.ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_pkt_ccc, }; proto_pkt_ccc = proto_register_protocol("PacketCable Call Content Connection", "PKT CCC", "pkt_ccc"); proto_register_field_array(proto_pkt_ccc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("pkt_ccc", dissect_pkt_ccc, proto_pkt_ccc); } void proto_reg_handoff_pkt_ccc(void) { /* * Register this dissector as one that can be selected by a * UDP port number. */ dissector_handle_t pkt_ccc_handle; pkt_ccc_handle = find_dissector("pkt_ccc"); dissector_add_for_decode_as_with_preference("udp.port", pkt_ccc_handle); } /* Register RTP */ void proto_register_rtp(void) { static hf_register_info hf[] = { { &hf_rtp_version, { "Version", "rtp.version", FT_UINT8, BASE_DEC, VALS(rtp_version_vals), 0xC0, NULL, HFILL } }, { &hf_rtp_padding, { "Padding", "rtp.padding", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_rtp_extension, { "Extension", "rtp.ext", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_rtp_csrc_count, { "Contributing source identifiers count", "rtp.cc", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_rtp_marker, { "Marker", "rtp.marker", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rtp_payload_type, { "Payload type", "rtp.p_type", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL } }, { &hf_rtp_seq_nr, { "Sequence number", "rtp.seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_ext_seq_nr, { "Extended sequence number", "rtp.extseq", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_timestamp, { "Timestamp", "rtp.timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_ssrc, { "Synchronization Source identifier", "rtp.ssrc", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_prof_define, { "Defined by profile", "rtp.ext.profile", FT_UINT16, BASE_HEX_DEC | BASE_RANGE_STRING, RVALS(rtp_ext_profile_rvals), 0x0, NULL, HFILL } }, { &hf_rtp_length, { "Extension length", "rtp.ext.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_csrc_items, { "Contributing Source identifiers", "rtp.csrc.items", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_csrc_item, { "CSRC item", "rtp.csrc.item", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_hdr_exts, { "Header extensions", "rtp.hdr_exts", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Other RTP structures */ { &hf_rtp_hdr_ext, { "Header extension", "rtp.hdr_ext", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_data, { "Payload", "rtp.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_padding_data, { "Padding data", "rtp.padding.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_padding_count, { "Padding count", "rtp.padding.count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtp_setup, { "Stream setup", "rtp.setup", FT_STRING, BASE_NONE, NULL, 0x0, "Stream setup, method and frame number", HFILL } }, { &hf_rtp_setup_frame, { "Setup frame", "rtp.setup-frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Frame that set up this stream", HFILL } }, { &hf_rtp_setup_method, { "Setup Method", "rtp.setup-method", FT_STRING, BASE_NONE, NULL, 0x0, "Method used to set up this stream", HFILL } }, { &hf_rtp_rfc2198_follow, { "Follow", "rtp.follow", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, "Next header follows", HFILL } }, { &hf_rtp_rfc2198_tm_off, { "Timestamp offset", "rtp.timestamp-offset", FT_UINT16, BASE_DEC, NULL, 0xFFFC, NULL, HFILL } }, { &hf_rtp_rfc2198_bl_len, { "Block length", "rtp.block-length", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, { &hf_rtp_ext_rfc5285_id, { "Identifier", "rtp.ext.rfc5285.id", FT_UINT8, BASE_DEC, NULL, 0x0, "RFC 5285 Header Extension Identifier", HFILL } }, { &hf_rtp_ext_rfc5285_length, { "Length", "rtp.ext.rfc5285.len", FT_UINT8, BASE_DEC, NULL, 0x0, "RFC 5285 Header Extension length", HFILL } }, { &hf_rtp_ext_rfc5285_appbits, { "Application Bits", "rtp.ext.rfc5285.appbits", FT_UINT8, BASE_DEC, NULL, 0x0, "RFC 5285 2-bytes header application bits", HFILL } }, { &hf_rtp_ext_rfc5285_data, { "Extension Data", "rtp.ext.rfc5285.data", FT_BYTES, BASE_NONE, NULL, 0x0, "RFC 5285 Extension Data", HFILL } }, { &hf_rfc4571_header_len, { "RFC 4571 packet len", "rtp.rfc4571.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* reassembly stuff */ {&hf_rtp_fragments, {"RTP Fragments", "rtp.fragments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rtp_fragment, {"RTP Fragment data", "rtp.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_rtp_fragment_overlap, {"Fragment overlap", "rtp.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL } }, {&hf_rtp_fragment_overlap_conflict, {"Conflicting data in fragment overlap", "rtp.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL } }, {&hf_rtp_fragment_multiple_tails, {"Multiple tail fragments found", "rtp.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL } }, {&hf_rtp_fragment_too_long_fragment, {"Fragment too long", "rtp.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL } }, {&hf_rtp_fragment_error, {"Defragmentation error", "rtp.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL } }, {&hf_rtp_fragment_count, {"Fragment count", "rtp.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_rtp_reassembled_in, {"RTP fragment, reassembled in frame", "rtp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This RTP packet is reassembled in this frame", HFILL } }, {&hf_rtp_reassembled_length, {"Reassembled RTP length", "rtp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL } }, {&hf_srtp_encrypted_payload, {"SRTP Encrypted Payload", "srtp.enc_payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #if 0 {&hf_srtp_null_encrypted_payload, {"SRTP Payload with NULL encryption", "srtp.null_enc_payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif {&hf_srtp_mki, {"SRTP MKI", "srtp.mki", FT_BYTES, BASE_NONE, NULL, 0x0, "SRTP Master Key Index", HFILL } }, {&hf_srtp_auth_tag, {"SRTP Auth Tag", "srtp.auth_tag", FT_BYTES, BASE_NONE, NULL, 0x0, "SRTP Authentication Tag", HFILL } } }; static gint *ett[] = { &ett_rtp, &ett_csrc_list, &ett_hdr_ext, &ett_hdr_ext_rfc5285, &ett_rtp_setup, &ett_rtp_rfc2198, &ett_rtp_rfc2198_hdr, &ett_rtp_fragment, &ett_rtp_fragments }; static ei_register_info ei[] = { { &ei_rtp_fragment_unfinished, { "rtp.fragment_unfinished", PI_REASSEMBLE, PI_CHAT, "RTP fragment, unfinished", EXPFILL }}, { &ei_rtp_padding_missing, { "rtp.padding_missing", PI_MALFORMED, PI_ERROR, "Frame has padding, but not all the frame data was captured", EXPFILL }}, }; /* Decode As handling */ static build_valid_func rtp_da_build_value[1] = {rtp_value}; static decode_as_value_t rtp_da_values = {rtp_prompt, 1, rtp_da_build_value}; static decode_as_t rtp_da = {"rtp", "rtp.pt", 1, 0, &rtp_da_values, NULL, NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; module_t *rtp_module; expert_module_t *expert_rtp; proto_rtp = proto_register_protocol("Real-Time Transport Protocol", "RTP", "rtp"); proto_rtp_rfc2198 = proto_register_protocol_in_name_only("RTP Payload for Redundant Audio Data (RFC 2198)", "RAD (RFC2198)", "rtp_rfc2198", proto_rtp, FT_PROTOCOL); proto_register_field_array(proto_rtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtp = expert_register_protocol(proto_rtp); expert_register_field_array(expert_rtp, ei, array_length(ei)); rtp_handle = register_dissector("rtp", dissect_rtp, proto_rtp); rtp_rfc2198_handle = register_dissector("rtp.rfc2198", dissect_rtp_rfc2198, proto_rtp_rfc2198); rtp_rfc4571_handle = register_dissector("rtp.rfc4571", dissect_rtp_rfc4571, proto_rtp); rtp_tap = register_tap("rtp"); rtp_pt_dissector_table = register_dissector_table("rtp.pt", "RTP payload type", proto_rtp, FT_UINT8, BASE_DEC); rtp_dyn_pt_dissector_table = register_dissector_table("rtp_dyn_payload_type", "Dynamic RTP payload type", proto_rtp, FT_STRING, STRING_CASE_INSENSITIVE); rtp_hdr_ext_dissector_table = register_dissector_table("rtp.hdr_ext", "RTP header extension", proto_rtp, FT_UINT32, BASE_HEX); rtp_hdr_ext_rfc5285_dissector_table = register_dissector_table("rtp.ext.rfc5285.id", "RTP Generic header extension (RFC 5285)", proto_rtp, FT_UINT8, BASE_DEC); rtp_module = prefs_register_protocol(proto_rtp, NULL); prefs_register_bool_preference(rtp_module, "show_setup_info", "Show stream setup information", "Where available, show which protocol and frame caused " "this RTP stream to be created", &global_rtp_show_setup_info); prefs_register_obsolete_preference(rtp_module, "heuristic_rtp"); prefs_register_bool_preference(rtp_module, "desegment_rtp_streams", "Allow subdissector to reassemble RTP streams", "Whether subdissector can request RTP streams to be reassembled", &desegment_rtp); prefs_register_enum_preference(rtp_module, "version0_type", "Treat RTP version 0 packets as", "If an RTP version 0 packet is encountered, it can be treated as " "an invalid or ZRTP packet, a CLASSIC-STUN packet, or a T.38 packet", &global_rtp_version0_type, rtp_version0_types, FALSE); prefs_register_obsolete_preference(rtp_module, "rfc2198_payload_type"); prefs_register_bool_preference(rtp_module, "rfc2198_deencapsulate", "De-encapsulate RFC 2198 primary encoding", "De-encapsulate the primary encoding from " "the RAD header for RTP analysis and " "playback", &rfc2198_deencapsulate); reassembly_table_register(&rtp_reassembly_table, &addresses_reassembly_table_functions); register_init_routine(rtp_dyn_payloads_init); register_decode_as(&rtp_da); } void proto_reg_handoff_rtp(void) { dissector_add_for_decode_as("udp.port", rtp_handle); dissector_add_for_decode_as("tcp.port", rtp_rfc4571_handle); dissector_add_string("rtp_dyn_payload_type", "red", rtp_rfc2198_handle); heur_dissector_add( "udp", dissect_rtp_heur, "RTP over UDP", "rtp_udp", proto_rtp, HEURISTIC_DISABLE); heur_dissector_add("stun", dissect_rtp_heur, "RTP over TURN", "rtp_stun", proto_rtp, HEURISTIC_DISABLE); heur_dissector_add("classicstun", dissect_rtp_heur, "RTP over CLASSICSTUN", "rtp_classicstun", proto_rtp, HEURISTIC_DISABLE); heur_dissector_add("rtsp", dissect_rtp_heur, "RTP over RTSP", "rtp_rtsp", proto_rtp, HEURISTIC_DISABLE); dissector_add_for_decode_as("flip.payload", rtp_handle ); rtcp_handle = find_dissector_add_dependency("rtcp", proto_rtp); stun_handle = find_dissector_add_dependency("stun-udp", proto_rtp); classicstun_handle = find_dissector_add_dependency("classicstun", proto_rtp); classicstun_heur_handle = find_dissector_add_dependency("classicstun-heur", proto_rtp); stun_heur_handle = find_dissector_add_dependency("stun-heur", proto_rtp); t38_handle = find_dissector_add_dependency("t38_udp", proto_rtp); zrtp_handle = find_dissector_add_dependency("zrtp", proto_rtp); dtls_handle = find_dissector_add_dependency("dtls", proto_rtp); sprt_handle = find_dissector_add_dependency("sprt", proto_rtp); v150fw_handle = find_dissector("v150fw"); bta2dp_content_protection_header_scms_t = find_dissector_add_dependency("bta2dp_content_protection_header_scms_t", proto_rtp); btvdp_content_protection_header_scms_t = find_dissector_add_dependency("btvdp_content_protection_header_scms_t", proto_rtp); bta2dp_handle = find_dissector_add_dependency("bta2dp", proto_rtp); btvdp_handle = find_dissector_add_dependency("btvdp", proto_rtp); sbc_handle = find_dissector_add_dependency("sbc", proto_rtp); dissector_add_string("rtp_dyn_payload_type", "v150fw", v150fw_handle); dissector_add_for_decode_as("rtp.pt", v150fw_handle); dissector_add_for_decode_as("btl2cap.cid", rtp_handle); dissector_add_uint_range_with_preference("rtp.pt", RFC2198_DEFAULT_PT_RANGE, rtp_rfc2198_handle); proto_sdp = proto_get_id_by_filter_name("sdp"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-rtp.h
/* packet-rtp.h * * Routines for RTP dissection * RTP = Real time Transport Protocol * * Copyright 2000, Philips Electronics N.V. * Written by Andreas Sikkema <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_RTP_H__ #define __PACKET_RTP_H__ #include "epan/packet.h" #include "ws_symbol_export.h" #include "packet-btavdtp.h" #include "packet-sdp.h" #define RTP_MEDIA_AUDIO 1 #define RTP_MEDIA_VIDEO 2 #define RTP_MEDIA_OTHER 4 struct _rtp_info { unsigned int info_version; gboolean info_padding_set; gboolean info_marker_set; guint32 info_media_types; unsigned int info_payload_type; unsigned int info_padding_count; guint16 info_seq_num; guint32 info_extended_seq_num; guint32 info_timestamp; guint64 info_extended_timestamp; guint32 info_sync_src; guint info_data_len; /* length of raw rtp data as reported */ gboolean info_all_data_present; /* FALSE if data is cut off */ guint info_payload_offset; /* start of payload relative to info_data */ guint info_payload_len; /* length of payload (incl padding) */ gboolean info_is_srtp; guint32 info_setup_frame_num; /* the frame num of the packet that set this RTP connection */ const guint8* info_data; /* pointer to raw rtp data */ const gchar *info_payload_type_str; gint info_payload_rate; unsigned info_payload_channels; wmem_map_t *info_payload_fmtp_map; gboolean info_is_ed137; const gchar *info_ed137_info; /* pointer to static string, no freeing is required */ /* * info_data: pointer to raw rtp data = header + payload incl. padding. * That should be safe because the "epan_dissect_t" constructed for the packet * has not yet been freed when the taps are called. * (destroying the "epan_dissect_t" will end up freeing all the tvbuffs * and hence invalidating pointers to their data). * See "add_packet_to_packet_list()" for details. */ }; /* definitions for SRTP dissection */ /* https://www.iana.org/assignments/srtp-protection/srtp-protection.xhtml */ /* Encryption algorithms */ #define SRTP_ENC_ALG_NOT_SET 0 /* Data not available/empty record */ #define SRTP_ENC_ALG_NULL 1 /* non-encrypted SRTP payload - may still be authenticated */ #define SRTP_ENC_ALG_AES_CM 2 /* SRTP default algorithm */ #define SRTP_ENC_ALG_AES_F8 3 #define SRTP_ENC_ALG_AES_GCM 4 /* RFC 7714 */ /* Authentication algorithms */ #define SRTP_AUTH_ALG_NONE 0 /* no auth tag in SRTP/RTP payload */ #define SRTP_AUTH_ALG_HMAC_SHA1 1 /* SRTP default algorithm */ #define SRTP_AUTH_ALG_GMAC 2 /* RFC 7714 */ #if 0 /* these are only needed once the dissector include the crypto functions to decrypt and/or authenticate */ struct srtp_key_info { guint8 *master_key; /* pointer to an wmem_file_scope'ed master key */ guint8 *master_salt; /* pointer to an wmem_file_scope'ed salt for this master key - NULL if no salt */ guint8 key_generation_rate; /* encoded as the power of 2, 0..24, or 255 (=zero rate) */ /* Either the MKI value is used (in which case from=to=0), or the <from,to> values are used (and MKI=0) */ guint32 from_roc; /* 32 MSBs of a 48 bit value - frame from which this key is valid (roll-over counter part) */ guint16 from_seq; /* 16 LSBs of a 48 bit value - frame from which this key is valid (sequence number part) */ guint32 to_roc; /* 32 MSBs of a 48 bit value - frame to which this key is valid (roll-over counter part) */ guint16 to_seq; /* 16 LSBs of a 48 bit value - frame to which this key is valid (sequence number part) */ guint32 mki; /* the MKI value associated with this key */ }; #endif struct srtp_info { guint encryption_algorithm; /* at present only NULL vs non-NULL matter */ guint auth_algorithm; /* at present only NULL vs non-NULL matter */ guint mki_len; /* number of octets used for the MKI in the RTP payload */ guint auth_tag_len; /* number of octets used for the Auth Tag in the RTP payload */ #if 0 /* these are only needed once the dissector include the crypto functions to decrypt and/or authenticate */ struct srtp_key_info **master_keys; /* an array of pointers to master keys and their info, the array and each key struct being wmem_file_scope'ed */ void *enc_alg_info, /* algorithm-dependent info struct - may be void for default alg with default params */ void *auth_alg_info /* algorithm-dependent info struct - void for default alg with default params */ #endif }; /* an opaque object holding the hash table - use accessor functions to create/destroy/find */ typedef struct _rtp_dyn_payload_t rtp_dyn_payload_t; /* RTP dynamic payload handling - use the following to create, insert, lookup, and free the dynamic payload information. Internally, RTP creates the GHashTable with a wmem file scope and increments the ref_count when it saves the info to conversations later. The calling dissector (SDP, H.245, etc.) uses these functions as an interface. If the calling dissector is done with the rtp_dyn_payload_t* for good, it should call rtp_dyn_payload_free() which will decrement the ref_count and free's it if the ref_count is 0. In the worst case, it will get free'd when the wmem file scope is over. This was changed because there were too many bugs with SDP's handling of memory ownership of the GHashTable, with RTP freeing things SDP didn't think were free'ed. And also because the GHashTables never got free'd in many cases by several dissectors. */ /* creates a new hashtable and sets ref_count to 1, returning the newly created object */ WS_DLL_PUBLIC rtp_dyn_payload_t* rtp_dyn_payload_new(void); /* Creates a copy of the given dynamic payload information. */ rtp_dyn_payload_t* rtp_dyn_payload_dup(rtp_dyn_payload_t *rtp_dyn_payload); /* Inserts the given payload type key, for the encoding name, sample rate and audio channels, into the hash table. Copy all the format parameters in the map given into the format parameter map for the new entry. This makes copies of the encoding name and the format parameters, scoped to the life of the capture file or sooner if rtp_dyn_payload_free is called. @param rtp_dyn_payload The hashtable of dynamic payload information @param pt The RTP dynamic payload type number to insert @param encoding_name The encoding name to assign to the payload type @param sample_rate The sample rate to assign to the payload type @param channels The number of audio channels to assign to the payload type (unnecessary for video) @param fmtp_map A map of format parameters to add to the new entry (can be NULL) */ WS_DLL_PUBLIC void rtp_dyn_payload_insert_full(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar* encoding_name, const int sample_rate, const unsigned channels, wmem_map_t* fmtp_map); /* Inserts the given payload type key, for the encoding name, sample rate, and channels, into the hash table. This makes copies of the encoding name, scoped to the life of the capture file or sooner if rtp_dyn_payload_free is called. @param rtp_dyn_payload The hashtable of dynamic payload information @param pt The RTP dynamic payload type number to insert @param encoding_name The encoding name to assign to the payload type @param sample_rate The sample rate to assign to the payload type @param channels The number of audio channels to assign to the payload type (unnecessary for video) */ WS_DLL_PUBLIC void rtp_dyn_payload_insert(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar* encoding_name, const int sample_rate, const unsigned channels); /* * Adds the given format parameter to the fmtp_map for the given payload type * in the RTP dynamic payload hashtable, if that payload type has been * inserted with rtp_dyn_payload_insert. The format parameter name and value * are copied, with scope the lifetime of the capture file. * * @param rtp_dyn_payload The hashtable of dynamic payload information * @param pt The RTP payload type number the parameter is for * @param name The name of the format parameter to add * @param value The value of the format parameter to add */ WS_DLL_PUBLIC void rtp_dyn_payload_add_fmtp(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const char* name, const char* value); /* Replaces the given payload type key in the hash table, with the encoding name and sample rate. This makes copies of the encoding name, scoped to the life of the capture file or sooner if rtp_dyn_payload_free is called. The replaced encoding name is free'd immediately. */ /* Not used anymore WS_DLL_PUBLIC void rtp_dyn_payload_replace(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar* encoding_name, const int sample_rate); */ /* removes the given payload type */ /* Not used anymore WS_DLL_PUBLIC gboolean rtp_dyn_payload_remove(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt); */ /* retrieves the encoding name for the given payload type; the string returned is only valid until the entry is replaced, removed, or the hash table is destroyed, so duplicate it if you need it long. */ WS_DLL_PUBLIC const gchar* rtp_dyn_payload_get_name(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt); /* Retrieves the encoding name, sample rate, and format parameters map for the given payload type. The encoding string pointed to is only valid until the entry is replaced, removed, or the hash table is destroyed, so duplicate it if you need it long. Each of the three output parameters are optional and can be NULL. @param rtp_dyn_payload The hashtable of dynamic payload information @param pt The RTP payload type number to look up @param[out] encoding_name The encoding name assigned to that payload type @param[out] sample_rate The sample rate assigned to that payload type @param[out] channels The number of audio channels for that payload type @param[out] fmtp_map The map of format parameters assigned to that type @return TRUE if successful, FALSE if there is no entry for that payload type */ WS_DLL_PUBLIC gboolean rtp_dyn_payload_get_full(rtp_dyn_payload_t *rtp_dyn_payload, const guint pt, const gchar **encoding_name, int *sample_rate, unsigned *channels, wmem_map_t **fmtp_map); /* Free's and destroys the dyn_payload hash table; internally this decrements the ref_count and only free's it if the ref_count == 0. */ WS_DLL_PUBLIC void rtp_dyn_payload_free(rtp_dyn_payload_t *rtp_dyn_payload); #ifdef DEBUG_CONVERSATION /* used for printing out debugging info, if DEBUG_CONVERSATION is defined */ void rtp_dump_dyn_payload(rtp_dyn_payload_t *rtp_dyn_payload); #endif #define MAX_RTP_SETUP_METHOD_SIZE 11 /** Info to save in RTP packet-info */ /** XXX: This is wasteful of memory. The only things that really need * to be saved per-packet, as opposed to once per conversation, are the * extended seqno and timestamp. */ struct _rtp_packet_info { gchar method[MAX_RTP_SETUP_METHOD_SIZE + 1]; guint32 frame_number; /**> the frame where this conversation is started */ guint32 media_types; rtp_dyn_payload_t *rtp_dyn_payload; /**> the dynamic RTP payload info - see comments above */ guint32 extended_seqno; /**> the sequence number, extended to a 32-bit * int to guarantee it increasing monotonically */ guint64 extended_timestamp; /**> timestamp extended to 64-bit */ struct _rtp_private_conv_info *rtp_conv_info; /**> conversation info private * to the rtp dissector */ struct srtp_info *srtp_info; /* SRTP context */ bta2dp_codec_info_t *bta2dp_info; btvdp_codec_info_t *btvdp_info; wmem_array_t *rtp_sdp_setup_info_list; /**> List with data from all SDP occurencies for this steram holding a call ID)*/ }; /* Add an RTP conversation with the given details */ WS_DLL_PUBLIC void rtp_add_address(packet_info *pinfo, const port_type ptype, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number, guint32 media_types, rtp_dyn_payload_t *rtp_dyn_payload); /* Add an SRTP conversation with the given details */ WS_DLL_PUBLIC void srtp_add_address(packet_info *pinfo, const port_type ptype, address *addr, int port, int other_port, const gchar *setup_method, guint32 setup_frame_number, guint32 media_types, rtp_dyn_payload_t *rtp_dyn_payload, struct srtp_info *srtp_info, sdp_setup_info_t *setup_info); /* Add an Bluetooth conversation with the given details */ void bluetooth_add_address(packet_info *pinfo, address *addr, guint32 stream_number, const gchar *setup_method, guint32 setup_frame_number, guint32 media_types, void *data); /* Dissect the header only, without side effects */ WS_DLL_PUBLIC gint dissect_rtp_shim_header(tvbuff_t *tvb, gint start, packet_info *pinfo, proto_tree *tree, struct _rtp_info *rtp_info); struct _rtp_pkt_info { guint payload_len; guint8 padding_len; /* without padding count byte */ }; #endif /*__PACKET_RTP_H__*/
C
wireshark/epan/dissectors/packet-rtpproxy.c
/* packet-rtpproxy.c * RTPproxy command protocol dissector * Copyright 2013, Peter Lemenkov <[email protected]> * * This dissector tries to dissect rtpproxy control protocol. Please visit this * link for brief details on the command format: * * http://www.rtpproxy.org/wiki/RTPproxy/Protocol * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <stdlib.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/expert.h> #include <epan/rtp_pt.h> #include <epan/addr_resolv.h> #include <epan/strutil.h> /* For setting up RTP/RTCP dissectors based on the RTPproxy's answers */ #include "packet-rtp.h" #include "packet-rtcp.h" void proto_register_rtpproxy(void); static dissector_handle_t rtpproxy_handle; static int proto_rtpproxy = -1; static int hf_rtpproxy_cookie = -1; static int hf_rtpproxy_error = -1; static int hf_rtpproxy_status = -1; static int hf_rtpproxy_ok = -1; static int hf_rtpproxy_ipv4 = -1; static int hf_rtpproxy_ipv6 = -1; static int hf_rtpproxy_port = -1; static int hf_rtpproxy_lf = -1; static int hf_rtpproxy_request = -1; static int hf_rtpproxy_command = -1; static int hf_rtpproxy_command_parameters = -1; static int hf_rtpproxy_command_parameter = -1; static int hf_rtpproxy_command_parameter_codec = -1; static int hf_rtpproxy_command_parameter_local_ipv4 = -1; static int hf_rtpproxy_command_parameter_remote_ipv4 = -1; static int hf_rtpproxy_command_parameter_repacketize = -1; static int hf_rtpproxy_command_parameter_dtmf = -1; /* static int hf_rtpproxy_command_parameter_cmap = -1; TODO */ static int hf_rtpproxy_command_parameter_proto = -1; static int hf_rtpproxy_command_parameter_transcode = -1; static int hf_rtpproxy_command_parameter_acc = -1; static int hf_rtpproxy_callid = -1; static int hf_rtpproxy_copy_target = -1; static int hf_rtpproxy_playback_filename = -1; static int hf_rtpproxy_playback_codec = -1; static int hf_rtpproxy_notify = -1; static int hf_rtpproxy_notify_ipv4 = -1; static int hf_rtpproxy_notify_ipv6 = -1; static int hf_rtpproxy_notify_port = -1; static int hf_rtpproxy_notify_tag = -1; static int hf_rtpproxy_tag = -1; static int hf_rtpproxy_mediaid = -1; static int hf_rtpproxy_reply = -1; static int hf_rtpproxy_version_request = -1; static int hf_rtpproxy_version_supported = -1; static int hf_rtpproxy_ng_bencode = -1; /* Expert fields */ static expert_field ei_rtpproxy_timeout = EI_INIT; static expert_field ei_rtpproxy_notify_no_ip = EI_INIT; static expert_field ei_rtpproxy_bad_ipv4 = EI_INIT; static expert_field ei_rtpproxy_bad_ipv6 = EI_INIT; /* Request/response tracking */ static int hf_rtpproxy_request_in = -1; static int hf_rtpproxy_response_in = -1; static int hf_rtpproxy_response_time = -1; typedef struct _rtpproxy_info { guint32 req_frame; guint32 resp_frame; nstime_t req_time; gchar* callid; } rtpproxy_info_t; static dissector_handle_t rtcp_handle; static dissector_handle_t rtp_events_handle; static dissector_handle_t rtp_handle; static dissector_handle_t bencode_handle; typedef struct _rtpproxy_conv_info { wmem_tree_t *trans; } rtpproxy_conv_info_t; static const string_string versiontypenames[] = { { "20040107", "Basic RTP proxy functionality" }, { "20050322", "Support for multiple RTP streams and MOH" }, { "20060704", "Support for extra parameter in the V command" }, { "20071116", "Support for RTP re-packetization" }, { "20071218", "Support for forking (copying) RTP stream" }, { "20080403", "Support for RTP statistics querying" }, { "20081102", "Support for setting codecs in the update/lookup command" }, { "20081224", "Support for session timeout notifications" }, { "20090810", "Support for automatic bridging" }, { "20140323", "Support for tracking/reporting load" }, { "20140617", "Support for anchoring session connect time" }, { "20141004", "Support for extendable performance counters" }, { "20150330", "Support for allocating a new port (\"Un\"/\"Ln\" commands)" }, { 0, NULL } }; static const value_string commandtypenames[] = { { 'V', "Handshake/Ping" }, { 'v', "Handshake/Ping" }, { 'U', "Offer/Update" }, { 'u', "Offer/Update" }, { 'L', "Answer/Lookup" }, { 'l', "Answer/Lookup" }, { 'I', "Information"}, { 'i', "Information"}, { 'X', "Close all active sessions"}, { 'x', "Close all active sessions"}, { 'D', "Delete an active session (Bye/Cancel/Error)"}, { 'd', "Delete an active session (Bye/Cancel/Error)"}, { 'P', "Start playback (music-on-hold)"}, { 'p', "Start playback (music-on-hold)"}, { 'S', "Stop playback (music-on-hold)"}, { 's', "Stop playback (music-on-hold)"}, { 'R', "Start recording"}, { 'r', "Start recording"}, { 'C', "Copy stream"}, { 'c', "Copy stream"}, { 'Q', "Query info about a session"}, { 'q', "Query info about a session"}, { 0, NULL } }; static const value_string paramtypenames[] = { /* Official command parameters */ {'4', "Remote address is IPv4"}, {'6', "Remote address is IPv6"}, {'a', "Asymmetric stream"}, {'A', "Asymmetric stream"}, {'b', "Brief stats"}, {'B', "Brief stats"}, {'c', "Codecs"}, {'C', "Codecs"}, {'e', "External network (non RFC 1918)"}, {'E', "External network (non RFC 1918)"}, {'i', "Internal network (RFC 1918)"}, {'I', "Internal network (RFC 1918)"}, {'l', "Local address / Load average"}, {'L', "Local address / Load average"}, {'n', "request New port"}, {'N', "request New port"}, {'r', "Remote address"}, {'R', "Remote address"}, {'s', "Symmetric stream / Single file"}, {'S', "Symmetric stream / Single file"}, {'w', "Weak connection (allows roaming)"}, {'W', "Weak connection (allows roaming)"}, {'z', "repacketiZe"}, {'Z', "repacketiZe"}, /* Unofficial command parameters / expensions */ {'d', "DTMF payload ID (unofficial extension)"}, {'D', "DTMF payload ID (unofficial extension)"}, {'m', "codec Mapping (unofficial extension)"}, {'M', "codec Mapping (unofficial extension)"}, {'p', "Protocol type (unofficial extension)"}, {'P', "Protocol type (unofficial extension)"}, {'t', "Transcode to (unofficial extension)"}, {'T', "Transcode to (unofficial extension)"}, {'u', "accoUnting (unofficial extension)"}, {'U', "accoUnting (unofficial extension)"}, {0, NULL} }; static const value_string prototypenames[] = { { '0', "UDP (default)"}, { '1', "TCP"}, { '2', "SCTP"}, { 0, NULL } }; static const value_string acctypenames[] = { { '0', "Start"}, { '1', "Interim update"}, { '2', "Stop"}, { 0, NULL } }; static const value_string oktypenames[] = { { '0', "Ok"}, { '1', "Version Supported"}, { 0, NULL } }; static const string_string errortypenames[] = { { "E0", "Syntax error: unknown command (CMDUNKN)" }, { "E1", "Syntax error: invalid number of arguments (PARSE_NARGS)" }, { "E2", "Syntax error: modifiers are not supported by the command (PARSE_MODS)" }, { "E3", "Syntax error: subcommand is not supported (PARSE_SUBC)" }, { "E5", "PARSE_1" }, { "E6", "PARSE_2" }, { "E7", "PARSE_3" }, { "E8", "PARSE_4" }, { "E9", "PARSE_5" }, { "E10", "PARSE_10" }, { "E11", "PARSE_11" }, { "E12", "PARSE_12" }, { "E13", "PARSE_13" }, { "E14", "PARSE_14" }, { "E15", "PARSE_15" }, { "E16", "PARSE_16" }, { "E17", "PARSE_6" }, { "E18", "PARSE_7" }, { "E19", "PARSE_8" }, { "E25", "Software error: output buffer overflow (RTOOBIG_1)" }, { "E26", "Software error: output buffer overflow (RTOOBIG_2)" }, { "E31", "Syntax error: invalid local address (INVLARG_1)" }, { "E32", "Syntax error: invalid remote address (INVLARG_2)" }, { "E33", "Syntax error: can't find local address for remote address (INVLARG_3)" }, { "E34", "Syntax error: invalid local address (INVLARG_4)" }, { "E35", "Syntax error: no codecs (INVLARG_5)" }, { "E36", "Syntax error: cannot match local address for the session (INVLARG_6)" }, { "E50", "Software error: session not found (SESUNKN)" }, { "E60", "PLRFAIL" }, { "E62", "Software error: unsupported/invalid counter name (QRYFAIL)" }, { "E65", "CPYFAIL" }, { "E68", "STSFAIL" }, { "E71", "Software error: can't create listener (LSTFAIL_1)" }, { "E72", "Software error: can't create listener (LSTFAIL_2)" }, { "E75", "Software error: must permit notification socket with -n (NSOFF)" }, { "E81", "Out of memory (NOMEM_1)" }, { "E82", "Out of memory (NOMEM_2)" }, { "E83", "Out of memory (NOMEM_3)" }, { "E84", "Out of memory (NOMEM_4)" }, { "E85", "Out of memory (NOMEM_5)" }, { "E86", "Out of memory (NOMEM_6)" }, { "E87", "Out of memory (NOMEM_7)" }, { "E88", "Out of memory (NOMEM_8)" }, { "E89", "Out of memory (NOMEM_9)" }, { "E98", "OVERLOAD" }, { "E99", "Software error: proxy is in the deorbiting-burn mode, new session rejected (SLOWSHTDN)" }, { 0, NULL } }; static gint ett_rtpproxy = -1; static gint ett_rtpproxy_request = -1; static gint ett_rtpproxy_command = -1; static gint ett_rtpproxy_command_parameters = -1; static gint ett_rtpproxy_command_parameters_codecs = -1; static gint ett_rtpproxy_command_parameters_local = -1; static gint ett_rtpproxy_command_parameters_remote = -1; static gint ett_rtpproxy_command_parameters_repacketize = -1; static gint ett_rtpproxy_command_parameters_dtmf = -1; static gint ett_rtpproxy_command_parameters_cmap = -1; static gint ett_rtpproxy_command_parameters_proto = -1; static gint ett_rtpproxy_command_parameters_transcode = -1; static gint ett_rtpproxy_command_parameters_acc = -1; static gint ett_rtpproxy_tag = -1; static gint ett_rtpproxy_notify = -1; static gint ett_rtpproxy_reply = -1; static gint ett_rtpproxy_ng_bencode = -1; /* Default values */ #define RTPPROXY_PORT "22222" /* Not IANA registered */ static range_t* rtpproxy_tcp_range = NULL; static range_t* rtpproxy_udp_range = NULL; static gboolean rtpproxy_establish_conversation = TRUE; /* See - https://www.opensips.org/html/docs/modules/1.10.x/rtpproxy.html#id293555 */ /* See - http://www.kamailio.org/docs/modules/4.3.x/modules/rtpproxy.html#idp15794952 */ static guint rtpproxy_timeout = 1000; static nstime_t rtpproxy_timeout_ns = NSTIME_INIT_ZERO; void proto_reg_handoff_rtpproxy(void); static gint rtpproxy_add_tag(tvbuff_t *tvb, packet_info* pinfo, proto_tree* rtpproxy_tree, guint begin, guint realsize) { proto_item *ti = NULL; proto_tree *another_tree = NULL; gint new_offset; guint end; const guint8* tmpstr; new_offset = tvb_find_guint8(tvb, begin, -1, ' '); if(new_offset < 0) end = realsize; /* No more parameters */ else end = new_offset; /* SER/OpenSER/OpenSIPS/Kamailio adds Media-ID right after the Tag * separated by a semicolon */ new_offset = tvb_find_guint8(tvb, begin, end, ';'); if(new_offset == -1){ ti = proto_tree_add_item_ret_string(rtpproxy_tree, hf_rtpproxy_tag, tvb, begin, end - begin, ENC_ASCII | ENC_NA, pinfo->pool, &tmpstr); col_append_fstr(pinfo->cinfo, COL_INFO, ", Tag: %s", tmpstr); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_tag); ti = proto_tree_add_item(another_tree, hf_rtpproxy_mediaid, tvb, new_offset+1, 0, ENC_ASCII | ENC_NA); proto_item_append_text(ti, "<skipped>"); proto_item_set_generated(ti); } else{ ti = proto_tree_add_item_ret_string(rtpproxy_tree, hf_rtpproxy_tag, tvb, begin, new_offset - begin, ENC_ASCII | ENC_NA, pinfo->pool, &tmpstr); col_append_fstr(pinfo->cinfo, COL_INFO, ", Tag: %s", tmpstr); if ((guint)new_offset == begin){ proto_item_append_text(ti, "<skipped>"); /* A very first Offer/Update command */ proto_item_set_generated(ti); } another_tree = proto_item_add_subtree(ti, ett_rtpproxy_tag); proto_tree_add_item_ret_string(another_tree, hf_rtpproxy_mediaid, tvb, new_offset+1, end - (new_offset+1), ENC_ASCII | ENC_NA, pinfo->pool, &tmpstr); col_append_fstr(pinfo->cinfo, COL_INFO, ", Media id: %s", tmpstr); } return (end == realsize ? -1 : (gint)end); } static void rtpproxy_add_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_tree, guint begin, guint realsize) { proto_item *ti; proto_tree *another_tree = NULL; guint offset = 0; guint new_offset = 0; gint i; guint pt = 0; gchar** codecs = NULL; guint codec_len; guint8* rawstr = NULL; guint32 ipaddr[4]; /* Enough room for IPv4 or IPv6 */ /* Extract the entire parameters line. */ /* Something like "t4p1iic8,0,2,4,18,96,97,98,100,101" */ rawstr = tvb_get_string_enc(pinfo->pool, tvb, begin, realsize, ENC_ASCII); while(offset < realsize){ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_command_parameter, tvb, begin + offset, 1, ENC_ASCII | ENC_NA); offset++; /* Skip 1-byte parameter's type */ switch (g_ascii_tolower(tvb_get_guint8(tvb, begin+offset-1))) { /* Official long parameters */ case 'c': new_offset = (gint)strspn(rawstr+offset, "0123456789,"); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_codecs); codecs = wmem_strsplit(pinfo->pool, tvb_get_string_enc(pinfo->pool, tvb, begin+offset, new_offset, ENC_ASCII), ",", 0); i = 0; while(codecs[i]){ /* We assume strings < 2^32-1 bytes long. :-) */ codec_len = (guint)strlen(codecs[i]); ti = proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_codec, tvb, begin+offset, codec_len, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, begin+offset, codec_len, ENC_ASCII), NULL, 10)); proto_item_append_text(ti, " (%s)", val_to_str_ext_const((guint)strtoul(tvb_format_text(pinfo->pool, tvb,begin+offset,codec_len),NULL,10), &rtp_payload_type_vals_ext, "Unknown")); offset += codec_len; if(codecs[i+1]) offset++; /* skip comma */ i++; }; break; case 'l': /* That's another one protocol shortcoming - the same parameter used twice. */ /* https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#createupdatelookup-session */ /* https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#get-information */ new_offset = (gint)strspn(rawstr+offset, "0123456789."); if(new_offset){ another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_local); if(str_to_ip((char*)tvb_get_string_enc(pinfo->pool, tvb, begin+offset, new_offset, ENC_ASCII), ipaddr)) proto_tree_add_ipv4(another_tree, hf_rtpproxy_command_parameter_local_ipv4, tvb, begin+offset, new_offset, ipaddr[0]); else proto_tree_add_expert(another_tree, pinfo, &ei_rtpproxy_bad_ipv4, tvb, begin+offset, new_offset); offset += new_offset; } break; case 'r': new_offset = (gint)strspn(rawstr+offset, "0123456789."); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_remote); if(str_to_ip((char*)tvb_get_string_enc(pinfo->pool, tvb, begin+offset, new_offset, ENC_ASCII), ipaddr)) proto_tree_add_ipv4(another_tree, hf_rtpproxy_command_parameter_remote_ipv4, tvb, begin+offset, new_offset, ipaddr[0]); else proto_tree_add_expert(another_tree, pinfo, &ei_rtpproxy_bad_ipv4, tvb, begin+offset, new_offset); offset += new_offset; break; case 'z': new_offset = (gint)strspn(rawstr+offset, "0123456789"); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_repacketize); proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_repacketize, tvb, begin+offset, new_offset, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, begin+offset, new_offset, ENC_ASCII), NULL, 10)); offset += new_offset; break; /* Unofficial long parameters */ case 'd': new_offset = (gint)strspn(rawstr+offset, "0123456789"); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_dtmf); proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_dtmf, tvb, begin+offset, new_offset, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, begin+offset, new_offset, ENC_ASCII), NULL, 10)); if(rtpproxy_establish_conversation){ pt = (guint)strtoul(tvb_format_text(pinfo->pool, tvb,begin+offset,new_offset),NULL,10); dissector_add_uint("rtp.pt", pt, rtp_events_handle); } offset += new_offset; break; case 'm': new_offset = (gint)strspn(rawstr+offset, "0123456789=,"); /* TODO */ offset += new_offset; break; case 'p': another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_proto); proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_proto, tvb, begin+offset, 1, ENC_ASCII | ENC_NA); offset++; break; case 't': new_offset = (gint)strspn(rawstr+offset, "0123456789"); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_transcode); ti = proto_tree_add_uint(another_tree, hf_rtpproxy_command_parameter_transcode, tvb, begin+offset, new_offset, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, begin+offset, new_offset, ENC_ASCII), NULL, 10)); proto_item_append_text(ti, " (%s)", val_to_str_ext_const((guint)strtoul(tvb_format_text(pinfo->pool, tvb,begin+offset, new_offset),NULL,10), &rtp_payload_type_vals_ext, "Unknown")); offset += new_offset; break; case 'u': another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_acc); proto_tree_add_item(another_tree, hf_rtpproxy_command_parameter_acc, tvb, begin+offset, 1, ENC_ASCII | ENC_NA); offset++; break; default: break; } } } static rtpproxy_info_t * rtpproxy_add_tid(gboolean is_request, tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_tree, rtpproxy_conv_info_t *rtpproxy_conv, const guint8* cookie) { rtpproxy_info_t *rtpproxy_info; proto_item *pi; if (!PINFO_FD_VISITED(pinfo)) { if (is_request){ rtpproxy_info = wmem_new0(wmem_file_scope(), rtpproxy_info_t); rtpproxy_info->req_frame = pinfo->num; rtpproxy_info->req_time = pinfo->abs_ts; wmem_tree_insert_string(rtpproxy_conv->trans, cookie, rtpproxy_info, 0); } else { rtpproxy_info = (rtpproxy_info_t *)wmem_tree_lookup_string(rtpproxy_conv->trans, cookie, 0); if (rtpproxy_info) { rtpproxy_info->resp_frame = pinfo->num; } } } else { rtpproxy_info = (rtpproxy_info_t *)wmem_tree_lookup_string(rtpproxy_conv->trans, cookie, 0); if (rtpproxy_info && (is_request ? rtpproxy_info->resp_frame : rtpproxy_info->req_frame)) { nstime_t ns; pi = proto_tree_add_uint(rtpproxy_tree, is_request ? hf_rtpproxy_response_in : hf_rtpproxy_request_in, tvb, 0, 0, is_request ? rtpproxy_info->resp_frame : rtpproxy_info->req_frame); proto_item_set_generated(pi); /* If not a request (so it's a reply) then calculate response time */ if (!is_request){ nstime_delta(&ns, &pinfo->abs_ts, &rtpproxy_info->req_time); pi = proto_tree_add_time(rtpproxy_tree, hf_rtpproxy_response_time, tvb, 0, 0, &ns); proto_item_set_generated(pi); if (nstime_cmp(&rtpproxy_timeout_ns, &ns) < 0) expert_add_info_format(pinfo, rtpproxy_tree, &ei_rtpproxy_timeout, "Response timeout %.3f seconds", nstime_to_sec(&ns)); } } } /* Could be NULL so we should check it before dereferencing */ return rtpproxy_info; } static void rtpproxy_add_notify_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_tree, guint begin, guint end) { gint offset = 0; gint tmp; gboolean ipv6 = FALSE; guint32 ipaddr[4]; /* Enough room for IPv4 or IPv6 */ /* Check for at least one colon */ offset = tvb_find_guint8(tvb, begin, end, ':'); if(offset != -1){ /* Find if it's the latest colon (not in case of a IPv6) */ while((tmp = tvb_find_guint8(tvb, offset+1, end, ':')) != -1){ ipv6 = TRUE; offset = tmp; } /* We have ip:port */ if(ipv6){ if(str_to_ip6((char*)tvb_get_string_enc(pinfo->pool, tvb, begin, offset - begin, ENC_ASCII), ipaddr)) proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, offset - begin, (const ws_in6_addr*)ipaddr); else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv6, tvb, begin, offset - begin); } else{ if(str_to_ip((char*)tvb_get_string_enc(pinfo->pool, tvb, begin, offset - begin, ENC_ASCII), ipaddr)) proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, offset - begin, ipaddr[0]); else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv4, tvb, begin, offset - begin); } proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, offset+1, end - (offset+1), (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, offset+1, end - (offset+1), ENC_ASCII), NULL, 10)); } else{ proto_item *ti = NULL; /* Only port is supplied - take IPv4/IPv6 from ip.src/ipv6.src respectively */ expert_add_info(pinfo, rtpproxy_tree, &ei_rtpproxy_notify_no_ip); if (pinfo->src.type == AT_IPv4) { ti = proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, 0, *(const guint32*)(pinfo->src.data)); } else if (pinfo->src.type == AT_IPv6) { ti = proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, 0, (const ws_in6_addr *)(pinfo->src.data)); } if (ti) { proto_item_set_generated(ti); proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, begin, end - begin, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, begin, end - begin, ENC_ASCII), NULL, 10)); } } } static int dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gboolean has_lf = FALSE; gint offset = 0; gint new_offset = 0; guint tmp; guint tmp2; gint realsize = 0; guint8* rawstr; const guint8* tmpstr; proto_item *ti; proto_item *ti2; proto_tree *rtpproxy_tree; conversation_t *conversation; rtpproxy_conv_info_t *rtpproxy_conv; const guint8* cookie = NULL; /* For RT(C)P setup */ address addr; guint16 port; guint32 ipaddr[4]; /* Enough room for IPv4 or IPv6 */ rtpproxy_info_t *rtpproxy_info = NULL; tvbuff_t *subtvb; /* If it does not start with a printable character it's not RTPProxy */ if(!g_ascii_isprint(tvb_get_guint8(tvb, 0))) return 0; /* Extract Cookie */ offset = tvb_find_guint8(tvb, offset, -1, ' '); if(offset == -1) return 0; /* We believe it's likely a RTPproxy / RTPproxy-ng protocol */ /* Note: we no longer distinct between packets with or w/o LF - it turned * out to be useless */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPproxy"); /* Clear out stuff in the info column - we'll set it later */ col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_rtpproxy, tvb, 0, -1, ENC_NA); rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy); proto_tree_add_item_ret_string(rtpproxy_tree, hf_rtpproxy_cookie, tvb, 0, offset, ENC_ASCII | ENC_NA, pinfo->pool, &cookie); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, offset+1, -1); /* Calculate size to prevent recalculation in the future */ realsize = tvb_reported_length(tvb); /* Don't count trailing zeroes (inserted by some SIP-servers sometimes) */ while (tvb_get_guint8(tvb, realsize - 1) == 0){ realsize -= 1; } /* Check for LF (required for TCP connection, optional for UDP) */ if (tvb_get_guint8(tvb, realsize - 1) == '\n'){ /* Don't count trailing LF */ realsize -= 1; has_lf = TRUE; } /* Try to create conversation */ conversation = find_or_create_conversation(pinfo); rtpproxy_conv = (rtpproxy_conv_info_t *)conversation_get_proto_data(conversation, proto_rtpproxy); if (!rtpproxy_conv) { rtpproxy_conv = wmem_new(wmem_file_scope(), rtpproxy_conv_info_t); rtpproxy_conv->trans = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(conversation, proto_rtpproxy, rtpproxy_conv); } /* Get payload string */ rawstr = tvb_format_text_wsp(pinfo->pool, tvb, offset, realsize - offset); /* Extract command */ tmp = g_ascii_tolower(tvb_get_guint8(tvb, offset)); switch (tmp) { case 's': /* A specific case - long info answer */ /* %COOKIE% sessions created %NUM0% active sessions: %NUM1% */ /* FIXME https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#information */ rtpproxy_add_tid(FALSE, tvb, pinfo, rtpproxy_tree, rtpproxy_conv, cookie); if ('e' == tvb_get_guint8(tvb, offset+1)){ col_add_fstr(pinfo->cinfo, COL_INFO, "Reply: %s", rawstr); ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_reply, tvb, offset, -1, ENC_NA); rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_reply); proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_status, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); break; } /* FALL THROUGH */ case 'i': case 'x': case 'u': case 'l': case 'd': tmp2 = tvb_get_guint8(tvb, offset+1); if(('1' <= tmp2) && (tmp2 <= '9') && (tvb_get_guint8(tvb, offset+2) == ':')){ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPproxy-ng"); col_add_fstr(pinfo->cinfo, COL_INFO, "RTPproxy-ng: %s", rawstr); ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ng_bencode, tvb, offset, -1, ENC_ASCII | ENC_NA); rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_ng_bencode); subtvb = tvb_new_subset_remaining(tvb, offset); call_dissector(bencode_handle, subtvb, pinfo, rtpproxy_tree); break; } /* FALL THROUGH */ case 'p': case 'v': case 'r': case 'c': case 'q': rtpproxy_info = rtpproxy_add_tid(TRUE, tvb, pinfo, rtpproxy_tree, rtpproxy_conv, cookie); col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", val_to_str_const(tvb_get_guint8(tvb, offset), commandtypenames, "Unknown command code")); ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_request, tvb, offset, -1, ENC_NA); rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_request); /* A specific case - version request: * https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#get-list-of-veatures * * In this case a command size must be bigger or equal to a "VF YYYYMMDD" string size. * It's bigger if there is more than one space inserted between "VF" and "YYYYMMDD" tokens. */ if ((tmp == 'v') && (offset + (gint)strlen("VF YYYYMMDD") <= realsize)){ /* Skip whitespace between "VF" and "YYYYMMDD" tokens */ new_offset = tvb_skip_wsp(tvb, offset + ((guint)strlen("VF") + 1), -1); ti = proto_tree_add_item_ret_string(rtpproxy_tree, hf_rtpproxy_version_request, tvb, new_offset, (gint)strlen("YYYYMMDD"), ENC_ASCII | ENC_NA, pinfo->pool, &tmpstr); proto_item_append_text(ti, " (%s)", str_to_str(tmpstr, versiontypenames, "Unknown")); break; } /* All other commands */ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_command, tvb, offset, 1, ENC_ASCII | ENC_NA); /* A specific case - handshake/ping */ if (tmp == 'v') break; /* No more parameters */ /* A specific case - close all calls */ if (tmp == 'x') break; /* No more parameters */ /* Extract parameters */ /* Parameters should be right after the command and before EOL (in case of Info command) or before whitespace */ new_offset = (tmp == 'i' ? (realsize - 1 > offset ? offset + (gint)strlen("Ib") : offset + (gint)strlen("I")) : tvb_find_guint8(tvb, offset, -1, ' ')); if (new_offset != offset + 1){ rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_command); ti2 = proto_tree_add_item_ret_string(rtpproxy_tree, hf_rtpproxy_command_parameters, tvb, offset+1, new_offset - (offset+1), ENC_ASCII | ENC_NA, pinfo->pool, &tmpstr); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tmpstr); rtpproxy_add_parameter(tvb, pinfo, proto_item_add_subtree(ti2, ett_rtpproxy_command_parameters), offset+1, new_offset - (offset+1)); rtpproxy_tree = proto_item_get_parent(ti); } /* A specific case - query information */ if (tmp == 'i') break; /* No more parameters */ /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract Call-ID */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); proto_tree_add_item_ret_string(rtpproxy_tree, hf_rtpproxy_callid, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA, pinfo->pool, &tmpstr); col_append_fstr(pinfo->cinfo, COL_INFO, ", Call-ID: %s", tmpstr); if(rtpproxy_info && !rtpproxy_info->callid) rtpproxy_info->callid = tvb_get_string_enc(wmem_file_scope(), tvb, offset, new_offset - offset, ENC_ASCII); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract IP and Port in case of Offer/Answer */ if ((tmp == 'u') || (tmp == 'l')){ /* Extract IP */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); if (tvb_find_guint8(tvb, offset, new_offset - offset, ':') == -1){ tmpstr = tvb_get_string_enc(pinfo->pool, tvb, offset, new_offset - offset, ENC_ASCII); if (str_to_ip(tmpstr, ipaddr)) { col_append_fstr(pinfo->cinfo, COL_INFO, ", IP: %s", tmpstr); proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, new_offset - offset, ipaddr[0]); } else { proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv4, tvb, offset, new_offset - offset); } } else{ tmpstr = tvb_get_string_enc(pinfo->pool, tvb, offset, new_offset - offset, ENC_ASCII); if (str_to_ip6(tmpstr, ipaddr)) { col_append_fstr(pinfo->cinfo, COL_INFO, ", IP: [%s]", tmpstr); proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, new_offset - offset, (const ws_in6_addr*)ipaddr); } else { proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv6, tvb, offset, new_offset - offset); } } /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract Port */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); tmpstr = tvb_get_string_enc(pinfo->pool, tvb, offset, new_offset - offset, ENC_ASCII); col_append_fstr(pinfo->cinfo, COL_INFO, ":%s", tmpstr); proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_port, tvb, offset, new_offset - offset, (guint16) g_ascii_strtoull((gchar*)tmpstr, NULL, 10)); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); } /* Extract Copy target */ if (tmp == 'c'){ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_copy_target, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); } /* Extract Playback file and codecs */ if (tmp == 'p'){ /* Extract filename */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_playback_filename, tvb, offset, new_offset - offset, ENC_ASCII | ENC_NA); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract codec */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_playback_codec, tvb, offset, new_offset - offset, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, offset, new_offset - offset, ENC_ASCII), NULL, 10)); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); } /* Extract first tag */ new_offset = rtpproxy_add_tag(tvb, pinfo, rtpproxy_tree, offset, realsize); if(new_offset == -1) break; /* No more parameters */ /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract second tag */ new_offset = rtpproxy_add_tag(tvb, pinfo, rtpproxy_tree, offset, realsize); if(new_offset == -1) break; /* No more parameters */ /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract Notification address */ if (tmp == 'u'){ ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); proto_item_set_text(ti, "Notify"); rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_notify); /* Check for NotifyTag parameter (separated by space) */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); if(new_offset == -1){ /* NotifyTag wasn't found (we should re-use Call-ID instead) */ rtpproxy_add_notify_addr(tvb, pinfo, rtpproxy_tree, offset, realsize); break; /* No more parameters */ } /* NotifyTag was found */ rtpproxy_add_notify_addr(tvb, pinfo, rtpproxy_tree, offset, new_offset); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_notify_tag, tvb, offset, realsize - offset, ENC_ASCII | ENC_NA); } break; case 'e': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': rtpproxy_info = rtpproxy_add_tid(FALSE, tvb, pinfo, rtpproxy_tree, rtpproxy_conv, cookie); if (tmp == 'e') col_add_fstr(pinfo->cinfo, COL_INFO, "Error reply: %s", rawstr); else col_add_fstr(pinfo->cinfo, COL_INFO, "Reply: %s", rawstr); ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_reply, tvb, offset, -1, ENC_NA); rtpproxy_tree = proto_item_add_subtree(ti, ett_rtpproxy_reply); if(rtpproxy_info && rtpproxy_info->callid){ ti = proto_tree_add_string(rtpproxy_tree, hf_rtpproxy_callid, tvb, offset, 0, rtpproxy_info->callid); proto_item_set_generated(ti); } if (tmp == 'e'){ tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); tmpstr = tvb_get_string_enc(pinfo->pool, tvb, offset, tmp, ENC_ASCII); ti = proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_error, tvb, offset, (gint)strlen(tmpstr), ENC_ASCII | ENC_NA); proto_item_append_text(ti, " (%s)", str_to_str(tmpstr, errortypenames, "Unknown")); break; } /* Check for a single '0' or '1' character followed by the end-of-line. * These both are positive replies - either a 'positive reply' or a 'version ack'. * * https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#positive-reply * https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#version-reply */ if (((tmp == '0') || (tmp == '1')) && (realsize == offset + (gint)strlen("X"))){ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_ok, tvb, offset, 1, ENC_ASCII | ENC_NA); break; } /* Check for the VERSION_NUMBER string reply: * https://github.com/sippy/rtpproxy/wiki/RTPP-%28RTPproxy-protocol%29-technical-specification#version-reply * * If a total size equals to a current offset + size of "YYYYMMDD" string * then it's a version reply. */ if (realsize == offset + (gint)strlen("YYYYMMDD")){ proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_version_supported, tvb, offset, (guint32)strlen("YYYYMMDD"), ENC_ASCII | ENC_NA); break; } /* Extract Port */ new_offset = tvb_find_guint8(tvb, offset, -1, ' '); /* Convert port to unsigned 16-bit number */ port = (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(pinfo->pool, tvb, offset, new_offset - offset, ENC_ASCII), NULL, 10); proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_port, tvb, offset, new_offset - offset, port); /* Skip whitespace */ offset = tvb_skip_wsp(tvb, new_offset+1, -1); /* Extract IP */ memset(&addr, 0, sizeof(address)); /* Try rtpengine bogus extension first. It appends 4 or * 6 depending on type of the IP. See * https://github.com/sipwise/rtpengine/blob/eea3256/daemon/call_interfaces.c#L74 * for further details */ tmp = tvb_find_guint8(tvb, offset, -1, ' '); if(tmp == (guint)(-1)){ /* No extension - operate normally */ tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); } else { tmp -= offset; } if (tvb_find_guint8(tvb, offset, -1, ':') == -1){ if (str_to_ip((char*)tvb_get_string_enc(pinfo->pool, tvb, offset, tmp, ENC_ASCII), ipaddr)){ addr.type = AT_IPv4; addr.len = 4; addr.data = wmem_memdup(pinfo->pool, ipaddr, 4); proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_ipv4, tvb, offset, tmp, ipaddr[0]); } else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv4, tvb, offset, tmp); } else{ if (str_to_ip6((char*)tvb_get_string_enc(pinfo->pool, tvb, offset, tmp, ENC_ASCII), ipaddr)){ addr.type = AT_IPv6; addr.len = 16; addr.data = wmem_memdup(pinfo->pool, ipaddr, 16); proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, tmp, (const ws_in6_addr *)ipaddr); } else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv6, tvb, offset, tmp); } if(rtpproxy_establish_conversation){ if (rtp_handle) { /* FIXME tell if isn't a video stream, and setup codec mapping */ if (addr.len) rtp_add_address(pinfo, PT_UDP, &addr, port, 0, "RTPproxy", pinfo->num, 0, NULL); } if (rtcp_handle) { if (addr.len) rtcp_add_address(pinfo, &addr, port+1, 0, "RTPproxy", pinfo->num); } } break; default: break; } /* TODO add an expert warning about packets w/o LF sent over TCP */ if (has_lf) proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_lf, tvb, realsize, 1, ENC_NA); return tvb_captured_length(tvb); } /* Preference callbacks */ static void rtpproxy_prefs_apply(void) { rtpproxy_tcp_range = prefs_get_range_value("rtpproxy", "tcp.port"); rtpproxy_udp_range = prefs_get_range_value("rtpproxy", "udp.port"); } void proto_register_rtpproxy(void) { module_t *rtpproxy_module; expert_module_t* expert_rtpproxy_module; static hf_register_info hf[] = { { &hf_rtpproxy_cookie, { "Cookie", "rtpproxy.cookie", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_version_request, { "Version Request", "rtpproxy.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_version_supported, { "Version Supported", "rtpproxy.version_supported", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_error, { "Error", "rtpproxy.error", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_ok, { "Ok", "rtpproxy.ok", FT_CHAR, BASE_HEX, VALS(oktypenames), 0x0, NULL, HFILL } }, { &hf_rtpproxy_status, { "Status", "rtpproxy.status", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_ipv4, { "IPv4", "rtpproxy.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_ipv6, { "IPv6", "rtpproxy.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_port, { "Port", "rtpproxy.port", FT_UINT16, /* 0 - 65535 */ BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_request, { "Request", "rtpproxy.request", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command, { "Command", "rtpproxy.command", FT_CHAR, BASE_HEX, VALS(commandtypenames), 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameters, { "Command parameters", "rtpproxy.command_parameters", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter, { "Parameter", "rtpproxy.command_parameter", FT_CHAR, BASE_HEX, VALS(paramtypenames), 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_codec, { "Allowed codec", "rtpproxy.command_parameter_codec", FT_UINT8, /* 0 - 127 */ BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_local_ipv4, { "Local IPv4 address", "rtpproxy.command_parameter_local_ipv4", FT_IPv4, /* FIXME - is it ever possible to see IPv6 here? */ BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_remote_ipv4, { "Remote IPv4 address", "rtpproxy.command_parameter_remote_ipv4", FT_IPv4, /* FIXME - is it ever possible to see IPv6 here? */ BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_repacketize, { "Repacketize (ms)", "rtpproxy.command_parameter_repacketize", FT_UINT16, /* 0 - 1000 milliseconds */ BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_dtmf, { "DTMF payload ID", "rtpproxy.command_parameter_dtmf", FT_UINT8, /* 0 - 127 */ BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_proto, { "RTP transmission protocol", "rtpproxy.command_parameter_proto", FT_CHAR, BASE_HEX, VALS(prototypenames), 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_transcode, { "Transcode to", "rtpproxy.command_parameter_transcode", FT_UINT8, /* 0 - 127 */ BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_command_parameter_acc, { "Accounting", "rtpproxy.command_parameter_acc", FT_CHAR, BASE_HEX, VALS(acctypenames), 0x0, NULL, HFILL } }, { &hf_rtpproxy_copy_target, { "Copy target", "rtpproxy.copy_target", FT_STRING, /* Filename or UDP address, e.g. /var/tmp/fileXXXX.yyy or IP:Port */ BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_playback_filename, { "Playback filename", "rtpproxy.playback_filename", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_playback_codec, { "Playback codec", "rtpproxy.playback_codec", FT_UINT8, /* 0 - 127 */ BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_callid, { "Call-ID", "rtpproxy.callid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_notify, { "Notify", "rtpproxy.notify", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_tag, { "Tag", "rtpproxy.tag", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_mediaid, { "Media-ID", "rtpproxy.mediaid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_notify_ipv4, { "Notification IPv4", "rtpproxy.notify_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_notify_ipv6, { "Notification IPv6", "rtpproxy.notify_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_notify_port, { "Notification Port", "rtpproxy.notify_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_notify_tag, { "Notification Tag", "rtpproxy.notify_tag", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_reply, { "Reply", "rtpproxy.reply", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_lf, { "LF", "rtpproxy.lf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_request_in, { "Request In", "rtpproxy.request_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_response_in, { "Response In", "rtpproxy.response_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtpproxy_response_time, { "Response Time", "rtpproxy.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the Request and the Reply", HFILL } }, { &hf_rtpproxy_ng_bencode, { "RTPproxy-ng bencode packet", "rtpproxy.ng.bencode", FT_STRING, BASE_NONE, NULL, 0x0, "Serialized structure of integers, dictionaries, strings and lists.", HFILL } } }; static ei_register_info ei[] = { { &ei_rtpproxy_timeout, { "rtpproxy.response_timeout", PI_RESPONSE_CODE, PI_WARN, "TIMEOUT", EXPFILL }}, { &ei_rtpproxy_notify_no_ip, { "rtpproxy.notify_no_ip", PI_RESPONSE_CODE, PI_COMMENT, "No notification IP address provided. Using ip.src or ipv6.src as a value.", EXPFILL }}, { &ei_rtpproxy_bad_ipv4, { "rtpproxy.bad_ipv4", PI_MALFORMED, PI_ERROR, "Bad IPv4", EXPFILL }}, { &ei_rtpproxy_bad_ipv6, { "rtpproxy.bad_ipv6", PI_MALFORMED, PI_ERROR, "Bad IPv6", EXPFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_rtpproxy, &ett_rtpproxy_request, &ett_rtpproxy_command, &ett_rtpproxy_command_parameters, &ett_rtpproxy_command_parameters_codecs, &ett_rtpproxy_command_parameters_local, &ett_rtpproxy_command_parameters_remote, &ett_rtpproxy_command_parameters_repacketize, &ett_rtpproxy_command_parameters_dtmf, &ett_rtpproxy_command_parameters_cmap, &ett_rtpproxy_command_parameters_proto, &ett_rtpproxy_command_parameters_transcode, &ett_rtpproxy_command_parameters_acc, &ett_rtpproxy_tag, &ett_rtpproxy_notify, &ett_rtpproxy_reply, &ett_rtpproxy_ng_bencode }; proto_rtpproxy = proto_register_protocol ("Sippy RTPproxy Protocol", "RTPproxy", "rtpproxy"); rtpproxy_handle = register_dissector("rtpproxy", dissect_rtpproxy, proto_rtpproxy); proto_register_field_array(proto_rtpproxy, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtpproxy_module = expert_register_protocol(proto_rtpproxy); expert_register_field_array(expert_rtpproxy_module, ei, array_length(ei)); rtpproxy_module = prefs_register_protocol(proto_rtpproxy, rtpproxy_prefs_apply); prefs_register_bool_preference(rtpproxy_module, "establish_conversation", "Establish Media Conversation", "Specifies that RTP/RTCP/T.38/MSRP/etc streams are decoded based " "upon port numbers found in RTPproxy answers", &rtpproxy_establish_conversation); prefs_register_uint_preference(rtpproxy_module, "reply.timeout", "RTPproxy reply timeout", /* Title */ "Maximum timeout value in waiting for reply from RTPProxy (in milliseconds).", /* Descr */ 10, &rtpproxy_timeout); } void proto_reg_handoff_rtpproxy(void) { static gboolean rtpproxy_initialized = FALSE; if(!rtpproxy_initialized){ /* Register TCP port for dissection */ dissector_add_uint_range_with_preference("tcp.port", RTPPROXY_PORT, rtpproxy_handle); dissector_add_uint_range_with_preference("udp.port", RTPPROXY_PORT, rtpproxy_handle); rtpproxy_prefs_apply(); rtpproxy_initialized = TRUE; } rtcp_handle = find_dissector_add_dependency("rtcp", proto_rtpproxy); rtp_events_handle = find_dissector_add_dependency("rtpevent", proto_rtpproxy); rtp_handle = find_dissector_add_dependency("rtp", proto_rtpproxy); bencode_handle = find_dissector_add_dependency("bencode", proto_rtpproxy); /* Calculate nstime_t struct for the timeout from the rtpproxy_timeout value in milliseconds */ rtpproxy_timeout_ns.secs = (rtpproxy_timeout - rtpproxy_timeout % 1000) / 1000; rtpproxy_timeout_ns.nsecs = (rtpproxy_timeout % 1000) * 1000; } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtps-processed.c
/* packet-rtps-processed.c * Dissector for the Real-Time Publish-Subscribe (RTPS) Processed Protocol. * * (c) 2020 Copyright, Real-Time Innovations, Inc. * Real-Time Innovations, Inc. * 232 East Java Drive * Sunnyvale, CA 94089 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * ----------------------------------------------------------------------------- * RTI Connext DDS can capture RTPS-related traffic by using the Network Capture * Utility. The generated .pcap capture files will follow a format that * defines how information must be saved, and then parsed. * * The format is divided into two layers/protocols: virtual transport * (packet-rtps-virtual-transport.c) and processed (packet-rtps-processed.c). * This file is about the processed dissector. For a general introduction and * information about the virtual transport dissector, read the documentation at * the beginning of packet-rtps-virtual-transport.c. * * The processed dissector is called by the transport dissector. It should never * be called directly by Wireshark without going through the transport * dissector first. * * The advanced information contains one parameter that it is really important * (and compulsory). This parameter is the "main frame", i.e. the frame that * would usually be captured over the wire. This frame is encrypted if security * applies. * * Then we have two optional fields: advanced frame0 and frame1. * - frame0: Contains the RTPS frame with submessage protection (but * decrypted at the RTPS level). * - frame1: * - Inbound traffic: A list of decrypted RTPS submessages (the protected * ones from frame0). * - Outbound traffic: The RTPS message before any kind of protection. * The contents encrypted at RTPS message level can be found in the main frame. * * We can see there is a difference between frame1 (the parameter containing the * decrypted RTPS submessages): inbound traffic has a list of submessages (no * RTPS header) but outbound traffic has a RTPS message. The reason behind * this is related to how RTI Connext DDS handles protected inbound traffic. * * An alternative would be to build the RTPS message from frame0 and frame1 and * then pass it to the RTPS dissector. This solution would be cleaner but would * require to keep a buffer and information between parameters. * The current solution is kept for the moment. */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/addr_resolv.h> #include <epan/wmem_scopes.h> #include <epan/conversation.h> #include "packet-tcp.h" #include "packet-rtps.h" #define PARAM_ID_ADVANCED_FRAME0 0x000C1 #define PARAM_ID_ADVANCED_FRAME1 0x000C2 void proto_reg_handoff_rtps_processed(void); void proto_register_rtps_processed(void); static gint dissect_rtps_processed( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data); static void get_new_colinfo_w_submessages( wmem_strbuf_t *out, wmem_strbuf_t *frame, const gchar *submessages); /* Subtree pointers */ static gint rtpsproc_tree = -1; static gint rtpsproc_ett = -1; static gint rtpsproc_ett_security = -1; static gint rtpsproc_ett_advanced_frame0 = -1; static gint rtpsproc_ett_advanced_frame1 = -1; /* Initialize the protocol and registered fields */ static header_field_info *rtpsproc_hf = NULL; static gint rtpsproc_hf_param_id = -1; static gint rtpsproc_hf_param_length = -1; /* Used for caching a handle to the RTPS dissector */ static dissector_handle_t rtps_handle = NULL; /* ========================================================================== */ /* Dissector */ /* ========================================================================== */ /* * Parameters must be in the right order or dissector will fail. * This was done instead of looping for all parameters (like in * packet-rtps-virtual-transport.c) because: * - The number of parameters is small. * - This way we can skip creating some headings if they are not needed (by * using zeros instead). */ static gint dissect_rtps_processed( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree *rtpsproc_tree_general = NULL; proto_tree *rtpsproc_tree_security = NULL; proto_item *rtpsproc_ti = NULL; guint16 param_id; guint16 param_length; gint offset = 0; gint offset_version = 4; /* 'R', 'T', 'P', 'S' */ tvbuff_t *rtps_payload = NULL; tvbuff_t *message_payload = NULL; struct rtpsvt_data *transport_data = (struct rtpsvt_data *) data; const gchar *title_security; guint16 rtps_version = 0x0203; guint16 rtps_vendor_id = 0x0101; endpoint_guid guid; if (transport_data == NULL) { /* Reject the packet if no transport information */ return 0; } param_length = transport_data->rtps_length; title_security = transport_data->direction == 1 ? "RTPS Security decoding" : "RTPS Security pre-encoding"; /* ***************************** MAIN ***********************************/ /* * The contents passed to the rtpsproc dissector must start with the RTPS * frame. */ rtps_version = tvb_get_guint16( tvb, offset + offset_version, ENC_BIG_ENDIAN); rtps_vendor_id = tvb_get_guint16( tvb, offset + offset_version + 2, ENC_BIG_ENDIAN); guid.host_id = tvb_get_ntohl(tvb, offset + offset_version + 4); guid.app_id = tvb_get_ntohl(tvb, offset + offset_version + 8); guid.instance_id = tvb_get_ntohl(tvb, offset + offset_version + 12); guid.fields_present = GUID_HAS_HOST_ID | GUID_HAS_APP_ID | GUID_HAS_INSTANCE_ID; rtps_payload = tvb_new_subset_length(tvb, offset, param_length); if (rtps_handle != NULL) { call_dissector(rtps_handle, rtps_payload, pinfo, tree); } offset += param_length; /* *********** Add subtree used for the fields of our rtpsproc_tree *******/ rtpsproc_ti = proto_tree_add_item( tree, rtpsproc_tree, tvb, offset, -1, ENC_BIG_ENDIAN); rtpsproc_tree_general = proto_item_add_subtree(rtpsproc_ti, rtpsproc_ett); /* *************************** ADVANCED 0 *******************************/ param_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); if (param_id == PARAM_ID_ADVANCED_FRAME0) { proto_tree *rtpsproc_tree_frame0 = NULL; param_length = tvb_get_guint16(tvb, offset + 2, ENC_BIG_ENDIAN); rtpsproc_tree_security = proto_tree_add_subtree_format( rtpsproc_tree_general, tvb, offset, 0, rtpsproc_ett_security, NULL, "%s", title_security); rtpsproc_tree_frame0 = proto_tree_add_subtree_format( rtpsproc_tree_security, tvb, offset, 0, rtpsproc_ett_advanced_frame0, NULL, "%s", "RTPS level"); proto_tree_add_uint( rtpsproc_tree_frame0, rtpsproc_hf_param_id, tvb, offset, 2, /* length */ param_id); offset += 2; proto_tree_add_uint( rtpsproc_tree_frame0, rtpsproc_hf_param_length, tvb, offset, 2, /* length */ param_length); offset += 2; message_payload = tvb_new_subset_length(tvb, offset, param_length); if (rtps_handle != NULL) { call_dissector( rtps_handle, message_payload, pinfo, rtpsproc_tree_frame0); } offset += param_length; } else { /* * If there is no security information, param_id is zeroed. * In that case the length is also zero, so we move 4 Bytes in total. */ offset += 4; } /* *************************** ADVANCED 1 *******************************/ param_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); if (param_id == PARAM_ID_ADVANCED_FRAME1) { proto_tree *rtpsproc_tree_frame1 = NULL; const gchar *title = transport_data->direction ? "Submessage level" : "RTPS and Submessage level (no protection)"; param_length = tvb_get_guint16(tvb, offset + 2, ENC_BIG_ENDIAN); if (rtpsproc_tree_security == NULL) { rtpsproc_tree_security = proto_tree_add_subtree_format( rtpsproc_tree_general, tvb, offset, 0, rtpsproc_ett_security, NULL, "%s", title_security); } rtpsproc_tree_frame1 = proto_tree_add_subtree_format( rtpsproc_tree_security, tvb, offset, 0, rtpsproc_ett_advanced_frame1, NULL, "%s", title); proto_tree_add_uint( rtpsproc_tree_frame1, rtpsproc_hf_param_id, tvb, offset, 2, /* length */ param_id); offset += 2; proto_tree_add_uint( rtpsproc_tree_frame1, rtpsproc_hf_param_length, tvb, offset, 2, /* length */ param_length); offset += 2; /* * Depending on the direction we have: * - Inbound: List of decrypted submessages. * - Outbound: The RTPS message before any kind of protection. * So, we handle them differently. */ if (transport_data->direction) { tvbuff_t *rtps_submessages = NULL; wmem_strbuf_t *info_w_encrypted = NULL; /* Current info */ wmem_strbuf_t *info_w_decrypted = NULL; /* New info */ /* * Get the current column info. This has the RTPS frames with the * encrypted submessages. We are going to update the text so that * it has the decrypted information, which is more useful to the * user. */ if (pinfo->cinfo) { const gchar *colinfo = col_get_text(pinfo->cinfo, COL_INFO); if (colinfo) { info_w_encrypted = wmem_strbuf_new( pinfo->pool, colinfo); col_clear(pinfo->cinfo, COL_INFO); } } /* Dissect the submessages using the RTPS dissector */ rtps_submessages = tvb_new_subset_length(tvb, offset, param_length); dissect_rtps_submessages( rtps_submessages, 0, /* offset */ pinfo, rtpsproc_tree_frame1, rtps_version, rtps_vendor_id, &guid); /* * Get the decrypted submessages and update the column information. */ if (pinfo->cinfo) { const gchar *colinfo = col_get_text(pinfo->cinfo, COL_INFO); info_w_decrypted = wmem_strbuf_new(pinfo->pool, ""); if (colinfo) { get_new_colinfo_w_submessages( info_w_decrypted, /* out */ info_w_encrypted, /* in */ colinfo); /* in */ col_clear(pinfo->cinfo, COL_INFO); col_set_str( pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(info_w_decrypted)); } } } else { message_payload = tvb_new_subset_length(tvb, offset, param_length); if (rtps_handle != NULL) { call_dissector( rtps_handle, message_payload, pinfo, rtpsproc_tree_frame1); } } } return tvb_captured_length(tvb); } /* ========================================================================== */ /* Other */ /* ========================================================================== */ /* * This function is called at startup and caches the handle for the register. * That way we don't have to find the dissector for each packet. */ void proto_reg_handoff_rtps_processed(void) { rtps_handle = find_dissector("rtps"); } static void get_new_colinfo_w_submessages( wmem_strbuf_t *out, wmem_strbuf_t *frame, const gchar *submessages) { const gchar *pattern = "SEC_PREFIX, SEC_BODY, SEC_POSTFIX"; const gchar *frame_str = wmem_strbuf_get_str(frame); gsize idx = 0; /* index for iterating frame_str */ gchar *submessages_dup = g_strdup(submessages); /* First decrypted submessage in submessages list */ gchar *submessage_current = strtok(submessages_dup, ", "); /* First encrypted submessage. Found by searching the RTPS colinfo */ gchar *encrypted_current = strstr(&frame_str[idx], pattern); while (encrypted_current != NULL) { /* Copy the RTPS frame up to the newly found encrypted submessage */ gsize length_to_copy = encrypted_current - &frame_str[idx]; wmem_strbuf_append_len(out, &frame_str[idx], length_to_copy); /* Copy the decrypted contents that replace the encrypted submessage */ wmem_strbuf_append(out, submessage_current); /* Advance the index and continue searching */ idx += length_to_copy + strlen(pattern); encrypted_current = strstr(&frame_str[idx], pattern); } /* Copy the remaining from the RTPS frame */ wmem_strbuf_append(out, &frame_str[idx]); } /* ========================================================================== */ /* Protocol egistration */ /* ========================================================================== */ void proto_register_rtps_processed(void) { static hf_register_info hf[] = { { &rtpsproc_hf_param_id, { "Parameter Identifier", "rtpsproc.param.id", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL }, }, { &rtpsproc_hf_param_length, { "Parameter Length", "rtpsproc.param.length", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL } }, }; static gint *ett[] = { &rtpsproc_ett, &rtpsproc_ett_security, &rtpsproc_ett_advanced_frame0, &rtpsproc_ett_advanced_frame1 }; /* Register the protocol name and description */ rtpsproc_tree = proto_register_protocol( "Real-Time Publish-Subscribe Wire Protocol (processed)", "RTPS-PROC", "rtpsproc"); /* Required function calls to register the header fields and subtrees */ rtpsproc_hf = proto_registrar_get_nth(rtpsproc_tree); proto_register_field_array(rtpsproc_tree, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("rtpsproc", dissect_rtps_processed, rtpsproc_tree); } // /* // * Editor modelines - https://www.wireshark.org/tools/modelines.html // * // * Local variables: // * c-basic-offset: 4 // * tab-width: 8 // * indent-tabs-mode: nil // * End: // * // * vi: set shiftwidth=4 tabstop=8 expandtab: // * :indentSize=4:tabSize=8:noTabs=true: // */
C
wireshark/epan/dissectors/packet-rtps-virtual-transport.c
/* packet-rtps-virtual-transport.c * Dissector for the Real-Time Publish-Subscribe (RTPS) Virtual Transport * Protocol. * * (c) 2020 Copyright, Real-Time Innovations, Inc. * Real-Time Innovations, Inc. * 232 East Java Drive * Sunnyvale, CA 94089 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * ----------------------------------------------------------------------------- * RTI Connext DDS can capture RTPS-related traffic by using the Network Capture * Utility. The generated .pcap capture files will follow the RTPS-VT protocol, * which establishes a format for how information must be saved, and then * parsed. * * The protocol is divided into two layers: transport * (packet-rtps-virtual-transport.c) and advanced (packet-rtps-processed.c). * This file is about the transport dissector. For more information about the * advanced dissector, read the documentation at the beginning of * packet-rtps-processed.c. * * Every packet saved in the capture file follows the PCAP file format. * As a consequence, there are two headers: a global one (unique per file) and * a per-packet header. These headers have the typical content described in the * PCAP format: a magic number, version number, some timestamps, information * describing the length of the packet and the data link layer (0x000000fc, i.e. * custom protocol), etc. Then, we have a header that indicates Wireshark the * name of the protocol: "rtpsvt". The transport dissector is called when * Wireshark finds "rtpsvt" as the protocol name. * * After the RTPS-VT header, we have the frame type. The frame type determines * what kind of information has the dumped packet. RTPS-VT data comes as a * series of [parameter identifier, content length, content]. Depending on the * type of frame (RTPS or lossInfo), the dissector will expect some parameters * or others. * * If the frame type is RTPS, we will continue parsing transport-layer data. * The transport layer contains all information about the source and destination * of a packet. This corresponds to data typically found on Network or Transport * protocols. However, because RTI Connext DDS generates the capture file * directly at application-level, this information is added at the moment of * writing the capture file. * After the transport-layer information, we will call the advanced dissector. * * If the frame type is lossInfo, the dissector will generate a packet * indicating that there were missing frames (and the range of sequence * numbers). */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/addr_resolv.h> #include <epan/wmem_scopes.h> #include <epan/conversation.h> #include "packet-tcp.h" #include "packet-rtps.h" #define CONTENT_KIND_RTPS 0x01 #define CONTENT_KIND_LOSS_INFO 0x02 #define PARAM_ID_TRANSPORT_CLASS 0x0001 #define PARAM_ID_MONITORING_GUID 0x0002 #define PARAM_ID_MONITORING_SN 0x0003 #define PARAM_ID_SOURCE_IP_ADDRESS 0x0004 #define PARAM_ID_SOURCE_PORT 0x0005 #define PARAM_ID_DESTINATION_IP_ADDRESS 0x0006 #define PARAM_ID_DESTINATION_RTPS_PORT 0x0007 #define PARAM_ID_DESTINATION_PORT 0x0008 #define PARAM_ID_DIRECTION 0x0009 #define FIRST_PARAM_ID_RTPS PARAM_ID_TRANSPORT_CLASS #define LAST_PARAM_ID_RTPS PARAM_ID_DIRECTION /* First parameter Identifier that the "rtpsproc" protocol accepts */ #define PARAM_ID_MAIN_FRAME 0x00C0 #define PARAM_ID_LOST_MESSAGES 0x0001 void proto_register_rtps_virtual_transport(void); static gint dissect_rtps_virtual_transport( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_); static gint dissect_rtps_virtual_transport_rtps_type( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tree_transport, gint offset, struct rtpsvt_data *transport_data); static gint dissect_parameter_transport_rtps_type( tvbuff_t *tvb, proto_tree *rtpsvt_tree_general, proto_tree *rtpsvt_tree_identifier, proto_tree *rtpsvt_tree_information, gint offset, packet_info *pinfo, struct rtpsvt_data *transport_data); static gint dissect_rtps_virtual_transport_loss_info_type( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree_transport, gint offset); /* Subtree pointers */ static gint proto_rtpsvt = -1; static gint rtpsvt_ett = -1; static gint rtpsvt_ett_version = -1; static gint rtpsvt_ett_identifier = -1; static gint rtpsvt_ett_information = -1; static gint rtpsvt_ett_information_class = -1; static gint rtpsvt_ett_information_src_port = -1; static gint rtpsvt_ett_information_dst_port = -1; static gint rtpsvt_ett_information_src_addr = -1; static gint rtpsvt_ett_information_dst_addr = -1; static gint rtpsvt_ett_information_direction = -1; static gint rtpsvt_ett_monitoring_sn = -1; static gint rtpsvt_ett_frame = -1; /* Initialize the protocol and registered fields */ static header_field_info *rtpsvt_hf = NULL; static gint rtpsvt_hf_version = -1; static gint rtpsvt_hf_version_major = -1; static gint rtpsvt_hf_version_minor = -1; static gint rtpsvt_hf_content_kind = -1; static gint rtpsvt_hf_param_id = -1; static gint rtpsvt_hf_param_length = -1; static gint rtpsvt_hf_packet_identifier = -1; static gint rtpsvt_hf_monitoring_guid = -1; static gint rtpsvt_hf_monitoring_seqNr = -1; static gint rtpsvt_hf_information = -1; static gint rtpsvt_hf_class = -1; static gint rtpsvt_hf_source_port = -1; static gint rtpsvt_hf_source_address = -1; static gint rtpsvt_hf_source_pid = -1; static gint rtpsvt_hf_destination_port = -1; static gint rtpsvt_hf_destination_rtps_port = -1; static gint rtpsvt_hf_destination_address = -1; static gint rtpsvt_hf_direction = -1; static gint rtpsvt_hf_destination_pid = -1; static gint rtpsvt_hf_missing_messages = -1; /* expert info fields */ static expert_field ei_missing_msg = EI_INIT; /* 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_UDPv4_WAN, "UDPv4_WAN"}, { NDDS_TRANSPORT_CLASSID_SHMEM, "SHMEM" }, { NDDS_TRANSPORT_CLASSID_INTRA, "INTRA" }, { NDDS_TRANSPORT_CLASSID_UDPv6, "UDPv6" }, { NDDS_TRANSPORT_CLASSID_DTLS, "DTLS" }, { NDDS_TRANSPORT_CLASSID_WAN, "WAN" }, { NDDS_TRANSPORT_CLASSID_TCPV4_LAN, "TCPv4_LAN" }, { NDDS_TRANSPORT_CLASSID_TCPV4_WAN, "TCPv4_WAN" }, { NDDS_TRANSPORT_CLASSID_TLSV4_LAN, "TLSv4_LAN" }, { NDDS_TRANSPORT_CLASSID_TLSV4_WAN, "TLSv4_WAN" }, { NDDS_TRANSPORT_CLASSID_PCIE, "PCIE" }, { NDDS_TRANSPORT_CLASSID_ITP, "ITP" }, { 0, NULL } }; static gint dissect_rtps_virtual_transport( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_tree *rtpsvt_tree_transport; proto_item *rtpsvt_ti_transport; proto_item *rtpsvt_ti_version; proto_tree *rtpsvt_tree_version; proto_item *rtpsvt_ti_content_kind; struct rtpsvt_data transport_data; guint16 version; guint8 content_type; const gchar *content_type_label; gint offset = 0; gint output = 0; /* Add transport tree, used for the fields of our proto_rtpsvt */ rtpsvt_ti_transport = proto_tree_add_item( tree, proto_rtpsvt, tvb, offset, -1, ENC_BIG_ENDIAN); rtpsvt_tree_transport = proto_item_add_subtree(rtpsvt_ti_transport, rtpsvt_ett); /* Add the version to the transport protocol */ version = tvb_get_ntohs(tvb, offset); transport_data.version_major = version >> 8; transport_data.version_minor = version & 0xff; rtpsvt_ti_version = proto_tree_add_uint_format( rtpsvt_tree_transport, rtpsvt_hf_version, tvb, offset, 2, /* 2B: sizeof(guint16) */ version, "Version: %d.%d", transport_data.version_major, transport_data.version_minor); rtpsvt_tree_version = proto_item_add_subtree( rtpsvt_ti_version, rtpsvt_ett_version); proto_tree_add_item( rtpsvt_tree_version, rtpsvt_hf_version_major, tvb, offset, 1, /* length: sizeof(guint8) */ ENC_NA); proto_tree_add_item( rtpsvt_tree_version, rtpsvt_hf_version_minor, tvb, offset + 1, 1, /* length: sizeof(guint8) */ ENC_NA); offset += 2; /* Add the content kind. */ content_type = tvb_get_guint8(tvb, offset); rtpsvt_ti_content_kind = proto_tree_add_item( rtpsvt_ti_transport, rtpsvt_hf_content_kind, tvb, offset, 1, /* length: sizeof(guint8) */ ENC_NA); if (content_type == CONTENT_KIND_RTPS) { content_type_label = "RTPS"; } else { content_type_label = "LOST_INFO"; } proto_item_append_text(rtpsvt_ti_content_kind, " (%s)", content_type_label); offset += 1; switch(content_type) { case CONTENT_KIND_RTPS: output = dissect_rtps_virtual_transport_rtps_type( tvb, pinfo, tree, rtpsvt_tree_transport, offset, &transport_data); break; case CONTENT_KIND_LOSS_INFO: output = dissect_rtps_virtual_transport_loss_info_type( tvb, pinfo, rtpsvt_tree_transport, offset); break; } return output; } static gint dissect_rtps_virtual_transport_rtps_type( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tree_transport, gint offset, struct rtpsvt_data *transport_data) { proto_item *rtpsvt_ti_identifier; proto_tree *rtpsvt_tree_identifier; proto_item *rtpsvt_ti_information; proto_tree *rtpsvt_tree_information; tvbuff_t *advanced_payload; static dissector_handle_t advanced_handle = NULL; unsigned int idx = FIRST_PARAM_ID_RTPS; guint16 param_id; guint16 param_length; /* * Add the tree for the packet identifier, which will be populated in * dissect_parameter_transport_rtps_type. */ rtpsvt_ti_identifier = proto_tree_add_item( tree_transport, rtpsvt_hf_packet_identifier, tvb, offset, -1, ENC_NA); rtpsvt_tree_identifier = proto_item_add_subtree( rtpsvt_ti_identifier, rtpsvt_ett_identifier); /* * Add the tree for the transport information, which will be populated in * dissect_parameter_transport_rtps_type. */ rtpsvt_ti_information = proto_tree_add_item( tree_transport, rtpsvt_hf_information, tvb, offset, -1, ENC_NA); rtpsvt_tree_information = proto_item_add_subtree( rtpsvt_ti_information, rtpsvt_ett_information); /* * Each parameter has an id, a length and a value. */ for (idx = FIRST_PARAM_ID_RTPS; idx <= LAST_PARAM_ID_RTPS; idx++) { offset = dissect_parameter_transport_rtps_type( tvb, tree_transport, rtpsvt_tree_identifier, rtpsvt_tree_information, offset, pinfo, transport_data); } /* * In the future we may have more transport parameters. * These parameters will have an identifier less than PARAM_ID_MAIN_FRAME * (which is parsed by the rtpsproc dissector). * If we open a "future" capture file with this dissector, we will skip all * of those parameters and parse only the ones we know about. */ do { param_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); offset += 2; param_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); offset += 2; if (param_id == PARAM_ID_MAIN_FRAME) { proto_tree *rtpsvt_tree_frame; transport_data->rtps_length = param_length; rtpsvt_tree_frame = proto_tree_add_subtree_format( tree_transport, tvb, offset, 0, rtpsvt_ett_frame, NULL, "Real-Time Publish-Subscribe Wire Protocol (content)"); proto_tree_add_uint( rtpsvt_tree_frame, rtpsvt_hf_param_id, tvb, offset, 2, /* 2B: sizeof(guint16) */ param_id); proto_tree_add_uint( rtpsvt_tree_frame, rtpsvt_hf_param_length, tvb, offset + 2, 2, param_length); break; } offset += param_length; } while (tvb_reported_length_remaining(tvb, offset) > 0); if (param_id != PARAM_ID_MAIN_FRAME || param_length <= 0) { /* * Reject the packet if we don't have an RTPS frame. * The rtpsproc dissector assumes that the contents start with the * RTPS frame (parameter value; the length is obtained from * transport_data). */ return 0; } advanced_payload = tvb_new_subset_length(tvb, offset, -1); advanced_handle = find_dissector("rtpsproc"); call_dissector_with_data( advanced_handle, advanced_payload, pinfo, tree, (void *) transport_data); return tvb_captured_length(tvb); } static gint dissect_parameter_transport_rtps_type( tvbuff_t *tvb, proto_tree *rtpsvt_tree_general, proto_tree *rtpsvt_tree_identifier, proto_tree *rtpsvt_tree_information, gint offset, packet_info *pinfo, struct rtpsvt_data *transport_data) { /* * We will add the parameter id and length later, as part of a subtree * dependent of the parameter. * That is why value of the parameter is now at offset + 4 * (i.e. offset + sizeof(param_id) + sizeof(param_length)) */ guint16 param_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); guint16 param_length = tvb_get_guint16(tvb, offset + 2, ENC_BIG_ENDIAN); const gint OFFSET_TO_VAL = offset + 4; if (param_length <=0) { /* Length not valid: skip parameter (id + length) */ return OFFSET_TO_VAL; } switch(param_id) { case PARAM_ID_TRANSPORT_CLASS: { proto_tree *rtpsvt_tree_information_class; gint32 classId = tvb_get_gint32(tvb, OFFSET_TO_VAL, ENC_BIG_ENDIAN); const gchar *className = val_to_str( classId, ndds_transport_class_id_vals, "%d"); rtpsvt_tree_information_class = proto_tree_add_subtree_format( rtpsvt_tree_information, tvb, offset, 0, rtpsvt_ett_information_class, NULL, "Class: %s", className); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_information_class, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_class, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; /* * Add transport class as item to the tree. * This is useful to apply as column or filter. */ proto_tree_add_string( rtpsvt_tree_information_class, rtpsvt_hf_class, tvb, offset, param_length, className); offset += param_length; /* Add summary to protocol header */ proto_item_append_text(rtpsvt_tree_general, ", %s", className); /* Add summary to the transport information header */ proto_item_append_text( rtpsvt_tree_information, ", %s", className); } break; case PARAM_ID_MONITORING_GUID: { proto_tree *rtpsvt_tree_monitoring_guid; const guint8 *guid_bytes = tvb_get_ptr( tvb, OFFSET_TO_VAL, param_length); const gchar *guid_string = bytes_to_str_punct( pinfo->pool, guid_bytes, MIN(param_length, 12), 0); rtpsvt_tree_monitoring_guid = proto_tree_add_subtree_format( rtpsvt_tree_identifier, tvb, offset, 0, rtpsvt_ett_information_src_addr, NULL, "Monitoring GUID Prefix: %s", guid_string); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_monitoring_guid, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_monitoring_guid, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; proto_tree_add_item( rtpsvt_tree_monitoring_guid, rtpsvt_hf_monitoring_guid, tvb, offset, param_length, ENC_NA); offset += param_length; /* Add summary to packet identifier header */ proto_item_append_text( rtpsvt_tree_identifier, ", GUID: %s", guid_string); } break; case PARAM_ID_MONITORING_SN: { proto_tree *rtpsvt_tree_seqNr; guint64 seqNr = tvb_get_guint64(tvb, OFFSET_TO_VAL, ENC_BIG_ENDIAN); rtpsvt_tree_seqNr = proto_tree_add_subtree_format( rtpsvt_tree_identifier, tvb, offset, 0, rtpsvt_ett_monitoring_sn, NULL, "Monitoring Sequence Number: %" PRIu64, seqNr); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_seqNr, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_seqNr, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; proto_tree_add_uint64( rtpsvt_tree_seqNr, rtpsvt_hf_monitoring_seqNr, tvb, offset, param_length, seqNr); offset += param_length; /* Add summary to packet identifier header */ proto_item_append_text( rtpsvt_tree_identifier, ", SeqNum: %" PRIu64, seqNr); } break; case PARAM_ID_SOURCE_IP_ADDRESS: { proto_tree *rtpsvt_tree_information_address; gint temporary_hf = rtpsvt_hf_source_address; const gchar *prefix = "shmem_prefix"; const gchar *title_tree = "Source address"; gchar addr[COL_MAX_LEN]; ws_in6_addr addr_raw; const guint8 bytes_zeroed[12] = {0}; tvb_get_ipv6(tvb, OFFSET_TO_VAL, &addr_raw); /* shared memory pid or address? */ if (memcmp(&addr_raw.bytes, prefix, strlen(prefix)) == 0) { temporary_hf = rtpsvt_hf_source_pid; title_tree = "Source process ID"; guint32 pid = tvb_get_guint32( tvb, OFFSET_TO_VAL + (gint) (strlen(prefix)), ENC_BIG_ENDIAN); snprintf(addr, sizeof(addr), "%u", pid); } else if (memcmp( &addr_raw.bytes, bytes_zeroed, sizeof(bytes_zeroed)) == 0){ snprintf( addr, sizeof(addr), "%s", tvb_ip_to_str(pinfo->pool, tvb, OFFSET_TO_VAL + sizeof(bytes_zeroed))); } else { snprintf( addr, sizeof(addr), "%s", tvb_ip6_to_str(pinfo->pool, tvb, OFFSET_TO_VAL)); } /* Add source to destination column field */ if (pinfo->cinfo) { col_append_str(pinfo->cinfo, COL_DEF_SRC, addr); } rtpsvt_tree_information_address = proto_tree_add_subtree_format( rtpsvt_tree_information, tvb, offset, 0, rtpsvt_ett_information_src_addr, NULL, "%s: %s", title_tree, addr); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_information_address, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_address, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; /* Add source to the transport information tree */ proto_tree_add_string( rtpsvt_tree_information_address, temporary_hf, tvb, offset, param_length, addr); offset += param_length; /* Add summary to protocol header */ proto_item_append_text(rtpsvt_tree_general, ", Src: (%s", addr); /* Add summary to transport information header */ proto_item_append_text( rtpsvt_tree_information, ", Src: (%s", addr); } break; case PARAM_ID_SOURCE_PORT: { proto_tree *rtpsvt_tree_information_port; guint32 port = tvb_get_guint32( tvb, OFFSET_TO_VAL, ENC_BIG_ENDIAN); rtpsvt_tree_information_port = proto_tree_add_subtree_format( rtpsvt_tree_information, tvb, offset, 0, rtpsvt_ett_information_src_port, NULL, "Source port: %d", port); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_information_port, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_port, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_port, rtpsvt_hf_source_port, tvb, offset, param_length, port); offset += param_length; /* Add summary to protocol header */ proto_item_append_text(rtpsvt_tree_general, ":%d)", port); /* Add summary to transport information header */ proto_item_append_text( rtpsvt_tree_information, ":%d)", port); /* * Add the source port to pinfo. * This is used by the RTPS dissector to get the domainId and * participantIdx information displayed in discovery packets. */ pinfo->srcport = port; } break; case PARAM_ID_DESTINATION_IP_ADDRESS: { proto_tree *rtpsvt_tree_information_address; gint temporary_hf= rtpsvt_hf_destination_address; const gchar *prefix = "shmem_prefix"; const gchar *title_tree = "Destination address"; gchar addr[COL_MAX_LEN]; ws_in6_addr addr_raw; const guint8 bytes_zeroed[12] = {0}; tvb_get_ipv6(tvb, OFFSET_TO_VAL, &addr_raw); /* shared memory pid or address? */ if (memcmp(&addr_raw.bytes, prefix, strlen(prefix)) == 0) { temporary_hf = rtpsvt_hf_destination_pid; title_tree = "Destination process ID"; guint32 pid = tvb_get_guint32( tvb, OFFSET_TO_VAL + (gint) (strlen(prefix)), ENC_BIG_ENDIAN); snprintf(addr, sizeof(addr), "%u", pid); } else if (memcmp( &addr_raw.bytes, bytes_zeroed, sizeof(bytes_zeroed)) == 0){ snprintf( addr, sizeof(addr), "%s", tvb_ip_to_str(pinfo->pool, tvb, OFFSET_TO_VAL + sizeof(bytes_zeroed))); } else { snprintf( addr, sizeof(addr), "%s", tvb_ip6_to_str(pinfo->pool, tvb, OFFSET_TO_VAL)); } /* Add address to destination column field */ if (pinfo->cinfo) { col_append_str(pinfo->cinfo, COL_DEF_DST, addr); } rtpsvt_tree_information_address = proto_tree_add_subtree_format( rtpsvt_tree_information, tvb, offset, 0, rtpsvt_ett_information_dst_addr, NULL, "%s: %s", title_tree, addr); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_information_address, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_address, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; /* Add destination to the transport information tree */ proto_tree_add_string( rtpsvt_tree_information_address, temporary_hf, tvb, offset, param_length, addr); offset += param_length; /* Add summary to protocol header */ proto_item_append_text(rtpsvt_tree_general, ", Dst: (%s", addr); /* Add summary to transport information header */ proto_item_append_text( rtpsvt_tree_information, ", Dst: (%s", addr); } break; case PARAM_ID_DESTINATION_RTPS_PORT: { guint32 port = tvb_get_guint32(tvb, OFFSET_TO_VAL, ENC_BIG_ENDIAN); proto_tree_add_uint( rtpsvt_tree_information, rtpsvt_hf_destination_rtps_port, tvb, OFFSET_TO_VAL, param_length, port); offset = OFFSET_TO_VAL + param_length; } break; case PARAM_ID_DESTINATION_PORT: { proto_tree *rtpsvt_tree_information_port; guint32 port = tvb_get_guint32(tvb, OFFSET_TO_VAL, ENC_BIG_ENDIAN); rtpsvt_tree_information_port = proto_tree_add_subtree_format( rtpsvt_tree_information, tvb, offset, 0, rtpsvt_ett_information_dst_port, NULL, "Destination port: %d", port); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_information_port, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_port, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); offset += 2; proto_tree_add_uint( rtpsvt_tree_information_port, rtpsvt_hf_destination_port, tvb, offset, param_length, port); offset += param_length; /* Add summary to protocol header */ proto_item_append_text(rtpsvt_tree_general, ":%d)", port); /* Add summary to transport information header */ proto_item_append_text( rtpsvt_tree_information, ":%d)", port); /* * Add the destination port to pinfo. * This is used by the RTPS dissector to get the domainId and * participantIdx information displayed in discovery packets. */ pinfo->destport = port; } break; case PARAM_ID_DIRECTION: { proto_tree *rtpsvt_tree_direction; guint8 value = tvb_get_guint8(tvb, OFFSET_TO_VAL); const gchar *direction = value ? "INBOUND" : "OUTBOUND"; rtpsvt_tree_direction = proto_tree_add_subtree_format( rtpsvt_tree_general, tvb, offset, 0, rtpsvt_ett_information_src_addr, NULL, "Traffic Direction: %s", direction); /* Add parameter identifier and length */ proto_tree_add_uint( rtpsvt_tree_direction, rtpsvt_hf_param_id, tvb, offset, 2, /* length: sizeof(guint16) */ param_id); offset += 2; proto_tree_add_uint( rtpsvt_tree_direction, rtpsvt_hf_param_length, tvb, offset, 2, /* length: sizeof(guint16) */ param_length); proto_tree_add_string( rtpsvt_tree_direction, rtpsvt_hf_direction, tvb, OFFSET_TO_VAL, param_length, direction); offset = OFFSET_TO_VAL + param_length; /* Save transport direction for the RTPS-PROC protocol */ transport_data->direction = value; } break; } return offset; } static gint dissect_rtps_virtual_transport_loss_info_type( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree_transport, gint offset) { guint16 param_id; param_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); offset += 2; offset += 2; /* parameter length */ if (param_id == PARAM_ID_LOST_MESSAGES) { guint64 first_lost = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN); guint64 last_lost = tvb_get_guint64(tvb, offset+8, ENC_BIG_ENDIAN); if (pinfo->cinfo) { char info[COL_MAX_INFO_LEN] = {'\0'}; snprintf( info, sizeof(info), "Missing RTPS messages [%" PRIu64 "-%" PRIu64 "]", first_lost, last_lost); col_append_str(pinfo->cinfo, COL_INFO, info); } expert_add_info(NULL, tree_transport, &ei_missing_msg); } return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ void proto_register_rtps_virtual_transport(void) { expert_module_t* expert_info; static hf_register_info hf[] = { { &rtpsvt_hf_version, { "Version", "rtpsvt.version", FT_UINT16, BASE_HEX, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_version_major, { "Major", "rtpsvt.version.major", FT_INT8, BASE_DEC, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_version_minor, { "Minor", "rtpsvt.version.minor", FT_INT8, BASE_DEC, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_content_kind, { "Content kind", "rtpsvt.content.kind", FT_INT8, BASE_DEC, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_param_id, { "Parameter Identifier", "rtpsvt.param.id", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL }, }, { &rtpsvt_hf_param_length, { "Parameter Length", "rtpsvt.param.length", FT_UINT16, BASE_DEC, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_direction, { "Traffic Direction", "rtpsvt.direction", FT_STRING, BASE_NONE, NULL, 0x0, 0, HFILL } }, { &rtpsvt_hf_packet_identifier, { "Packet identifier", "rtpsvt.identifier", FT_NONE, BASE_NONE, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_monitoring_guid, { "GUID", "rtpsvt.monitoring_guid", FT_BYTES, BASE_NONE, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_monitoring_seqNr, { "SeqNum", "rtpsvt.seqNr", FT_UINT64, BASE_DEC, NULL, 0x0, 0, HFILL } }, { &rtpsvt_hf_information, { "Transport Information", "rtpsvt.information", FT_NONE, BASE_NONE, NULL, 0x0, 0, HFILL } }, { &rtpsvt_hf_source_port, { "Source Port", "rtpsvt.source_port", FT_UINT32, BASE_DEC, NULL, 0x0, 0, HFILL } }, { &rtpsvt_hf_source_address, { "Source address", "rtpsvt.source_address", FT_STRING, BASE_NONE, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_source_pid, { "Source process ID", "rtpsvt.source_pid", FT_STRING, BASE_NONE, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_destination_port, { "Destination Port", "rtpsvt.port", FT_UINT32, BASE_DEC, NULL, 0x0, 0, HFILL } }, { &rtpsvt_hf_destination_rtps_port, { "Destination RTPS Port", "rtpsvt.rtps_port", FT_UINT32, BASE_DEC, NULL, 0x0, 0, HFILL } }, { &rtpsvt_hf_destination_address, { "Destination address", "rtpsvt.destination_address", FT_STRING, BASE_NONE, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_destination_pid, { "Destination process ID", "rtpsvt.destination_pid", FT_STRING, BASE_NONE, NULL, 0, 0, HFILL } }, { &rtpsvt_hf_class, { "Transport class", "rtpsvt.class", FT_STRING, BASE_NONE, NULL, 0, 0, HFILL } }, { /* Information related to the 'lost' content type */ &rtpsvt_hf_missing_messages, { "Packets lost", "rtpsvt.missing_messages", FT_UINT64, BASE_DEC, NULL, 0x0, 0, HFILL } } }; static gint *ett[] = { &rtpsvt_ett, &rtpsvt_ett_version, &rtpsvt_ett_identifier, &rtpsvt_ett_information, &rtpsvt_ett_information_class, &rtpsvt_ett_information_src_port, &rtpsvt_ett_information_dst_port, &rtpsvt_ett_information_src_addr, &rtpsvt_ett_information_dst_addr, &rtpsvt_ett_information_direction, &rtpsvt_ett_monitoring_sn, &rtpsvt_ett_frame }; static ei_register_info ei[] = { { &ei_missing_msg, { "rtpsvt.expert.missing_messages", PI_PROTOCOL, PI_NOTE, "Missing RTPS Messages because of full buffer pool", EXPFILL } }, }; /* Register the protocol name and description */ proto_rtpsvt = proto_register_protocol( "Real-Time Publish-Subscribe Virtual Transport", "RTPS-VT", "rtpsvt"); /* Required function calls to register the header fields and subtrees */ rtpsvt_hf = proto_registrar_get_nth(proto_rtpsvt); proto_register_field_array(proto_rtpsvt, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register expert information */ expert_info = expert_register_protocol(proto_rtpsvt); expert_register_field_array(expert_info, ei, array_length(ei)); register_dissector("rtpsvt", dissect_rtps_virtual_transport, proto_rtpsvt); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtps.c
/* 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 <[email protected]> * PETR SMOLIK <[email protected]> * ZDENEK SEBEK <[email protected]> * * Czech Technical University in Prague * Faculty of Electrical Engineering <www.fel.cvut.cz> * Department of Control Engineering <dce.felk.cvut.cz> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * 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 <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include "packet-rtps.h" #include <epan/addr_resolv.h> #include <epan/exceptions.h> #include <epan/proto_data.h> #include <epan/reassemble.h> #include <epan/strutil.h> #include "zlib.h" #include <epan/crc32-tvb.h> #include <wsutil/crc32.h> #include <gcrypt.h> 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 typedef struct _union_member_mapping { guint64 union_type_id; guint64 member_type_id; gint32 discriminator; gchar member_name[MAX_MEMBER_NAME]; } union_member_mapping; typedef struct _mutable_member_mapping { gint64 key; guint64 struct_type_id; guint64 member_type_id; guint32 member_id; gchar member_name[MAX_MEMBER_NAME]; } mutable_member_mapping; typedef struct _dissection_element { guint64 type_id; guint16 flags; guint32 member_id; gchar member_name[MAX_MEMBER_NAME]; } dissection_element; typedef enum { EXTENSIBILITY_INVALID = 1, EXTENSIBILITY_FINAL, EXTENSIBILITY_EXTENSIBLE, EXTENSIBILITY_MUTABLE } RTICdrTypeObjectExtensibility; typedef struct _dissection_info { guint64 type_id; gint member_kind; guint64 base_type_id; guint32 member_length; gchar member_name[MAX_MEMBER_NAME]; RTICdrTypeObjectExtensibility extensibility; gint32 bound; guint32 num_elements; dissection_element* elements; } dissection_info; typedef struct _submessage_col_info { const gchar* status_info; const gchar* topic_name; const gchar* 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 { guint16 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) */ gint position_in_batch; } rtps_dissector_data; typedef struct _rtps_tvb_field { tvbuff_t *tvb; gint tvb_offset; gint 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 = NULL; static wmem_map_t * builtin_dissection_infos = NULL; static wmem_map_t * union_member_mappings = NULL; static wmem_map_t * mutable_member_mappings = NULL; /***************************************************************************/ /* Preferences */ /***************************************************************************/ static guint rtps_max_batch_samples_dissected = 16; static guint rtps_max_data_type_elements = DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE; static guint rtps_max_array_data_type_elements = DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE; static gboolean enable_topic_info = TRUE; static gboolean enable_rtps_reassembly = FALSE; static gboolean enable_user_data_dissection = FALSE; static gboolean enable_max_array_data_type_elements = TRUE; static gboolean enable_max_data_type_elements = TRUE; static gboolean enable_rtps_crc_check = 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_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 (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 (guint16) 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 (G_MAXUINT32) /* 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 = -1; static int hf_rtps_dissection_byte = -1; static int hf_rtps_dissection_int16 = -1; static int hf_rtps_dissection_uint16 = -1; static int hf_rtps_dissection_int32 = -1; static int hf_rtps_dissection_uint32 = -1; static int hf_rtps_dissection_int64 = -1; static int hf_rtps_dissection_uint64 = -1; static int hf_rtps_dissection_float = -1; static int hf_rtps_dissection_double = -1; static int hf_rtps_dissection_int128 = -1; static int hf_rtps_dissection_string = -1; static const char *const SM_EXTRA_RPLUS = "(r+)"; static const char *const SM_EXTRA_RMINUS = "(r-)"; static const char *const SM_EXTRA_WPLUS = "(w+)"; static const char *const SM_EXTRA_WMINUS = "(w-)"; static const char *const SM_EXTRA_PPLUS = "(p+)"; static const char *const SM_EXTRA_PMINUS = "(p-)"; static const char *const SM_EXTRA_TPLUS = "(t+)"; static const char *const SM_EXTRA_TMINUS = "(t-)"; /***************************************************************************/ /* Protocol Fields Identifiers */ static int proto_rtps = -1; static int hf_rtps_magic = -1; static int hf_rtps_ping = -1; static int hf_rtps_protocol_version = -1; static int hf_rtps_protocol_version_major = -1; static int hf_rtps_protocol_version_minor = -1; static int hf_rtps_vendor_id = -1; static int hf_rtps_domain_id = -1; static int hf_rtps_domain_tag = -1; static int hf_rtps_participant_idx = -1; static int hf_rtps_nature_type = -1; static int hf_rtps_guid_prefix_v1 = -1; static int hf_rtps_guid_prefix = -1; static int hf_rtps_guid_prefix_src = -1; static int hf_rtps_guid_prefix_dst = -1; static int hf_rtps_host_id = -1; static int hf_rtps_app_id = -1; static int hf_rtps_app_id_instance_id = -1; static int hf_rtps_app_id_app_kind = -1; static int hf_rtps_sm_id = -1; static int hf_rtps_sm_idv2 = -1; static int hf_rtps_sm_flags = -1; static int hf_rtps_sm_flags2 = -1; static int hf_rtps_sm_octets_to_next_header = -1; static int hf_rtps_sm_guid_prefix_v1 = -1; static int hf_rtps_sm_guid_prefix = -1; static int hf_rtps_sm_host_id = -1; static int hf_rtps_sm_app_id = -1; static int hf_rtps_sm_instance_id_v1 = -1; static int hf_rtps_sm_app_kind = -1; static int hf_rtps_sm_instance_id = -1; static int hf_rtps_sm_entity_id = -1; static int hf_rtps_sm_entity_id_key = -1; static int hf_rtps_sm_entity_id_kind = -1; static int hf_rtps_sm_rdentity_id = -1; static int hf_rtps_sm_rdentity_id_key = -1; static int hf_rtps_sm_rdentity_id_kind = -1; static int hf_rtps_sm_wrentity_id = -1; static int hf_rtps_sm_wrentity_id_key = -1; static int hf_rtps_sm_wrentity_id_kind = -1; static int hf_rtps_sm_seq_number = -1; static int hf_rtps_info_src_ip = -1; static int hf_rtps_info_src_unused = -1; static int hf_rtps_parameter_id = -1; static int hf_rtps_parameter_id_v2 = -1; static int hf_rtps_parameter_id_inline_rti = -1; static int hf_rtps_parameter_id_toc = -1; static int hf_rtps_parameter_id_rti = -1; static int hf_rtps_parameter_id_adl = -1; static int hf_rtps_parameter_length = -1; static int hf_rtps_coherent_set_start = -1; static int hf_rtps_coherent_set_end = -1; static int hf_rtps_param_topic_name = -1; static int hf_rtps_param_strength = -1; static int hf_rtps_param_type_name = -1; static int hf_rtps_param_user_data = -1; static int hf_rtps_param_group_data = -1; static int hf_rtps_param_topic_data = -1; static int hf_rtps_param_content_filter_topic_name = -1; static int hf_rtps_param_related_topic_name = -1; static int hf_rtps_param_filter_class_name = -1; static int hf_rtps_issue_data = -1; static int hf_rtps_durability_service_cleanup_delay = -1; static int hf_rtps_liveliness_lease_duration = -1; static int hf_rtps_participant_lease_duration = -1; static int hf_rtps_time_based_filter_minimum_separation = -1; static int hf_rtps_reliability_max_blocking_time = -1; static int hf_rtps_deadline_period = -1; static int hf_rtps_latency_budget_duration = -1; static int hf_rtps_lifespan_duration = -1; static int hf_rtps_persistence = -1; static int hf_rtps_info_ts_timestamp = -1; static int hf_rtps_timestamp = -1; static int hf_rtps_locator_kind = -1; static int hf_rtps_locator_port = -1; /* static int hf_rtps_logical_port = -1; */ static int hf_rtps_locator_public_address_port = -1; static int hf_rtps_locator_ipv4 = -1; static int hf_rtps_locator_ipv6 = -1; static int hf_rtps_participant_builtin_endpoints = -1; static int hf_rtps_participant_manual_liveliness_count = -1; static int hf_rtps_history_depth = -1; static int hf_rtps_resource_limit_max_samples = -1; static int hf_rtps_resource_limit_max_instances = -1; static int hf_rtps_resource_limit_max_samples_per_instances = -1; static int hf_rtps_filter_bitmap = -1; static int hf_rtps_type_checksum = -1; static int hf_rtps_queue_size = -1; static int hf_rtps_acknack_count = -1; static int hf_rtps_durability_service_history_kind = -1; static int hf_rtps_durability_service_history_depth = -1; static int hf_rtps_durability_service_max_samples = -1; static int hf_rtps_durability_service_max_instances = -1; static int hf_rtps_durability_service_max_samples_per_instances = -1; static int hf_rtps_liveliness_kind = -1; static int hf_rtps_manager_key = -1; static int hf_rtps_locator_udp_v4 = -1; static int hf_rtps_locator_udp_v4_port = -1; static int hf_param_ip_address = -1; static int hf_rtps_param_port = -1; static int hf_rtps_expects_inline_qos = -1; static int hf_rtps_presentation_coherent_access = -1; static int hf_rtps_presentation_ordered_access = -1; static int hf_rtps_expects_ack = -1; static int hf_rtps_reliability_kind = -1; static int hf_rtps_durability = -1; static int hf_rtps_ownership = -1; static int hf_rtps_presentation_access_scope = -1; static int hf_rtps_destination_order = -1; static int hf_rtps_history_kind = -1; static int hf_rtps_data_status_info = -1; static int hf_rtps_param_serialize_encap_kind = -1; static int hf_rtps_param_serialize_encap_len = -1; static int hf_rtps_param_transport_priority = -1; static int hf_rtps_param_type_max_size_serialized = -1; static int hf_rtps_param_entity_name = -1; static int hf_rtps_param_role_name = -1; static int hf_rtps_disable_positive_ack = -1; static int hf_rtps_participant_guid_v1 = -1; static int hf_rtps_participant_guid = -1; static int hf_rtps_group_guid_v1 = -1; static int hf_rtps_group_guid = -1; static int hf_rtps_endpoint_guid = -1; static int hf_rtps_param_host_id = -1; static int hf_rtps_param_app_id = -1; static int hf_rtps_param_instance_id = -1; static int hf_rtps_param_instance_id_v1 = -1; static int hf_rtps_param_app_kind = -1; static int hf_rtps_param_entity = -1; static int hf_rtps_param_entity_key = -1; static int hf_rtps_param_hf_entity_kind = -1; static int hf_rtps_data_frag_number = -1; static int hf_rtps_data_frag_num_fragments = -1; static int hf_rtps_data_frag_size = -1; static int hf_rtps_data_frag_sample_size = -1; static int hf_rtps_nokey_data_frag_number = -1; static int hf_rtps_nokey_data_frag_num_fragments= -1; static int hf_rtps_nokey_data_frag_size = -1; static int hf_rtps_nack_frag_count = -1; static int hf_rtps_heartbeat_frag_number = -1; static int hf_rtps_heartbeat_frag_count = -1; static int hf_rtps_heartbeat_batch_count = -1; static int hf_rtps_data_serialize_data = -1; static int hf_rtps_data_batch_timestamp = -1; static int hf_rtps_data_batch_offset_to_last_sample_sn = -1; static int hf_rtps_data_batch_sample_count = -1; static int hf_rtps_data_batch_offset_sn = -1; static int hf_rtps_data_batch_octets_to_sl_encap_id = -1; static int hf_rtps_data_batch_serialized_data_length = -1; static int hf_rtps_data_batch_octets_to_inline_qos = -1; static int hf_rtps_fragment_number_base64 = -1; static int hf_rtps_fragment_number_base = -1; static int hf_rtps_fragment_number_num_bits = -1; static int hf_rtps_bitmap_num_bits = -1; static int hf_rtps_param_partition_num = -1; static int hf_rtps_param_partition = -1; static int hf_rtps_param_filter_expression = -1; static int hf_rtps_param_expression_parameters_num = -1; static int hf_rtps_param_expression_parameters = -1; static int hf_rtps_locator_filter_list_num_channels = -1; static int hf_rtps_locator_filter_list_filter_name = -1; static int hf_rtps_locator_filter_list_filter_exp = -1; static int hf_rtps_extra_flags = -1; static int hf_rtps_param_builtin_endpoint_set_flags = -1; static int hf_rtps_param_vendor_builtin_endpoint_set_flags = -1; static int hf_rtps_param_endpoint_security_attributes = -1; static int hf_rtps_param_plugin_promiscuity_kind = -1; static int hf_rtps_param_service_kind = -1; static int hf_rtps_param_sample_signature_epoch = -1; static int hf_rtps_param_sample_signature_nonce = -1; static int hf_rtps_param_sample_signature_length = -1; static int hf_rtps_param_sample_signature_signature = -1; static int hf_rtps_secure_secure_data_length = -1; static int hf_rtps_secure_secure_data = -1; static int hf_rtps_param_enable_authentication = -1; static int hf_rtps_param_builtin_endpoint_qos = -1; static int hf_rtps_secure_dataheader_transformation_kind = -1; static int hf_rtps_secure_dataheader_transformation_key_revision_id = -1; static int hf_rtps_secure_dataheader_transformation_key_id = -1; static int hf_rtps_secure_dataheader_plugin_sec_header = -1; static int hf_rtps_secure_datatag_plugin_sec_tag = -1; static int hf_rtps_pgm = -1; static int hf_rtps_pgm_dst_participant_guid = -1; static int hf_rtps_pgm_dst_endpoint_guid = -1; static int hf_rtps_pgm_src_endpoint_guid = -1; static int hf_rtps_source_participant_guid = -1; static int hf_rtps_message_identity_source_guid = -1; static int hf_rtps_pgm_message_class_id = -1; static int hf_rtps_pgm_data_holder_class_id = -1; /* static int hf_rtps_pgm_data_holder_stringseq_size = -1; */ /* static int hf_rtps_pgm_data_holder_stringseq_name = -1; */ /* static int hf_rtps_pgm_data_holder_long_long = -1; */ static int hf_rtps_param_timestamp_sec = -1; static int hf_rtps_param_timestamp_fraction = -1; static int hf_rtps_transportInfo_classId = -1; static int hf_rtps_transportInfo_messageSizeMax = -1; static int hf_rtps_param_app_ack_count = -1; static int hf_rtps_param_app_ack_virtual_writer_count = -1; static int hf_rtps_param_app_ack_conf_virtual_writer_count = -1; static int hf_rtps_param_app_ack_conf_count = -1; static int hf_rtps_param_app_ack_interval_payload_length = -1; static int hf_rtps_param_app_ack_interval_flags = -1; static int hf_rtps_param_app_ack_interval_count = -1; static int hf_rtps_param_app_ack_octets_to_next_virtual_writer = -1; static int hf_rtps_expects_virtual_heartbeat = -1; static int hf_rtps_direct_communication = -1; static int hf_rtps_param_peer_host_epoch = -1; static int hf_rtps_param_endpoint_property_change_epoch = -1; static int hf_rtps_virtual_heartbeat_count = -1; static int hf_rtps_virtual_heartbeat_num_virtual_guids = -1; static int hf_rtps_virtual_heartbeat_num_writers = -1; static int hf_rtps_param_extended_parameter = -1; static int hf_rtps_param_extended_pid_length = -1; static int hf_rtps_param_type_consistency_kind = -1; static int hf_rtps_param_data_representation = -1; static int hf_rtps_param_ignore_sequence_bounds = -1; static int hf_rtps_param_ignore_string_bounds = -1; static int hf_rtps_param_ignore_member_names = -1; static int hf_rtps_param_prevent_type_widening = -1; static int hf_rtps_param_force_type_validation = -1; static int hf_rtps_param_ignore_enum_literal_names = -1; static int hf_rtps_parameter_data = -1; static int hf_rtps_param_product_version_major = -1; static int hf_rtps_param_product_version_minor = -1; static int hf_rtps_param_product_version_release = -1; static int hf_rtps_param_product_version_release_as_char = -1; static int hf_rtps_param_product_version_revision = -1; static int hf_rtps_param_acknowledgment_kind = -1; static int hf_rtps_param_topic_query_publication_enable = -1; static int hf_rtps_param_topic_query_publication_sessions = -1; static int hf_rtps_srm = -1; static int hf_rtps_srm_service_id = -1; static int hf_rtps_srm_request_body = -1; static int hf_rtps_srm_instance_id = -1; static int hf_rtps_topic_query_selection_filter_class_name = -1; static int hf_rtps_topic_query_selection_filter_expression = -1; static int hf_rtps_topic_query_selection_num_parameters = -1; static int hf_rtps_topic_query_selection_filter_parameter = -1; static int hf_rtps_topic_query_topic_name = -1; static int hf_rtps_topic_query_original_related_reader_guid = -1; static int hf_rtps_encapsulation_id = -1; static int hf_rtps_encapsulation_kind = -1; static int hf_rtps_octets_to_inline_qos = -1; static int hf_rtps_filter_signature = -1; static int hf_rtps_bitmap = -1; static int hf_rtps_acknack_analysis = -1; static int hf_rtps_property_name = -1; static int hf_rtps_property_value = -1; static int hf_rtps_union = -1; static int hf_rtps_union_case = -1; static int hf_rtps_struct = -1; static int hf_rtps_member_name = -1; static int hf_rtps_sequence = -1; static int hf_rtps_array = -1; static int hf_rtps_bitfield = -1; static int hf_rtps_datatype = -1; static int hf_rtps_sequence_size = -1; static int hf_rtps_guid = -1; static int hf_rtps_heartbeat_count = -1; static int hf_rtps_encapsulation_options = -1; static int hf_rtps_serialized_key = -1; static int hf_rtps_serialized_data = -1; static int hf_rtps_type_object_type_id_disc = -1; static int hf_rtps_type_object_type_id = -1; static int hf_rtps_type_object_primitive_type_id = -1; static int hf_rtps_type_object_base_type = -1; static int hf_rtps_type_object_base_primitive_type_id = -1; static int hf_rtps_type_object_element_raw = -1; static int hf_rtps_type_object_type_property_name = -1; static int hf_rtps_type_object_flags = -1; static int hf_rtps_type_object_member_id = -1; static int hf_rtps_type_object_annotation_value_d = -1; static int hf_rtps_type_object_annotation_value_16 = -1; static int hf_rtps_type_object_union_label = -1; static int hf_rtps_type_object_bound = -1; static int hf_rtps_type_object_enum_constant_name = -1; static int hf_rtps_type_object_enum_constant_value = -1; static int hf_rtps_type_object_element_shared = -1; static int hf_rtps_type_object_name = -1; static int hf_rtps_type_object_element_module_name = -1; static int hf_rtps_uncompressed_serialized_length = -1; static int hf_rtps_compression_plugin_class_id = -1; static int hf_rtps_compressed_serialized_type_object = -1; static int hf_rtps_pl_cdr_member = -1; static int hf_rtps_pl_cdr_member_id = -1; static int hf_rtps_pl_cdr_member_length = -1; static int hf_rtps_pl_cdr_member_id_ext = -1; static int hf_rtps_pl_cdr_member_length_ext = -1; static int hf_rtps_dcps_publication_data_frame_number = -1; static int hf_rtps_udpv4_wan_locator_flags = -1; static int hf_rtps_uuid = -1; static int hf_rtps_udpv4_wan_locator_public_ip = -1; static int hf_rtps_udpv4_wan_locator_public_port = -1; static int hf_rtps_udpv4_wan_locator_local_ip = -1; static int hf_rtps_udpv4_wan_locator_local_port = -1; static int hf_rtps_udpv4_wan_binding_ping_port = -1; static int hf_rtps_udpv4_wan_binding_ping_flags = -1; static int hf_rtps_long_address = -1; static int hf_rtps_param_group_coherent_set = -1; static int hf_rtps_param_end_group_coherent_set = -1; static int hf_rtps_param_mig_end_coherent_set_sample_count = -1; static int hf_rtps_encapsulation_options_compression_plugin_class_id = -1; static int hf_rtps_padding_bytes = -1; static int hf_rtps_topic_query_selection_kind = -1; static int hf_rtps_data_session_intermediate = -1; /* Flag bits */ static int hf_rtps_flag_reserved80 = -1; static int hf_rtps_flag_reserved40 = -1; static int hf_rtps_flag_reserved20 = -1; static int hf_rtps_flag_reserved10 = -1; static int hf_rtps_flag_reserved08 = -1; static int hf_rtps_flag_reserved04 = -1; static int hf_rtps_flag_reserved02 = -1; static int hf_rtps_flag_reserved8000 = -1; static int hf_rtps_flag_reserved4000 = -1; static int hf_rtps_flag_reserved2000 = -1; static int hf_rtps_flag_reserved1000 = -1; static int hf_rtps_flag_reserved0800 = -1; static int hf_rtps_flag_reserved0400 = -1; static int hf_rtps_flag_reserved0200 = -1; static int hf_rtps_flag_reserved0100 = -1; static int hf_rtps_flag_reserved0080 = -1; static int hf_rtps_flag_reserved0040 = -1; static int hf_rtps_flag_builtin_endpoint_set_reserved = -1; static int hf_rtps_flag_unregister = -1; static int hf_rtps_flag_inline_qos_v1 = -1; static int hf_rtps_flag_hash_key = -1; static int hf_rtps_flag_alive = -1; static int hf_rtps_flag_data_present_v1 = -1; static int hf_rtps_flag_multisubmessage = -1; static int hf_rtps_flag_endianness = -1; static int hf_rtps_flag_additional_authenticated_data = -1; static int hf_rtps_flag_protected_with_psk = -1; static int hf_rtps_flag_vendor_specific_content = -1; static int hf_rtps_flag_status_info = -1; static int hf_rtps_flag_data_present_v2 = -1; static int hf_rtps_flag_inline_qos_v2 = -1; static int hf_rtps_flag_final = -1; static int hf_rtps_flag_hash_key_rti = -1; static int hf_rtps_flag_liveliness = -1; static int hf_rtps_flag_multicast = -1; static int hf_rtps_flag_data_serialized_key = -1; static int hf_rtps_flag_data_frag_serialized_key = -1; static int hf_rtps_flag_timestamp = -1; static int hf_rtps_flag_no_virtual_guids = -1; static int hf_rtps_flag_multiple_writers = -1; static int hf_rtps_flag_multiple_virtual_guids = -1; static int hf_rtps_flag_serialize_key16 = -1; static int hf_rtps_flag_invalid_sample = -1; static int hf_rtps_flag_data_present16 = -1; static int hf_rtps_flag_offsetsn_present = -1; static int hf_rtps_flag_inline_qos16_v2 = -1; static int hf_rtps_flag_timestamp_present = -1; static int hf_rtps_flag_unregistered = -1; static int hf_rtps_flag_disposed = -1; static int hf_rtps_param_status_info_flags = -1; static int hf_rtps_flag_participant_announcer = -1; static int hf_rtps_flag_participant_detector = -1; static int hf_rtps_flag_publication_announcer = -1; static int hf_rtps_flag_publication_detector = -1; static int hf_rtps_flag_subscription_announcer = -1; static int hf_rtps_flag_subscription_detector = -1; static int hf_rtps_flag_participant_proxy_announcer = -1; static int hf_rtps_flag_participant_proxy_detector = -1; static int hf_rtps_flag_participant_state_announcer = -1; static int hf_rtps_flag_participant_state_detector = -1; static int hf_rtps_flag_participant_message_datawriter = -1; static int hf_rtps_flag_participant_message_datareader = -1; static int hf_rtps_flag_secure_publication_writer = -1; static int hf_rtps_flag_secure_publication_reader = -1; static int hf_rtps_flag_secure_subscription_writer = -1; static int hf_rtps_flag_secure_subscription_reader = -1; static int hf_rtps_flag_secure_participant_message_writer = -1; static int hf_rtps_flag_secure_participant_message_reader = -1; static int hf_rtps_flag_participant_stateless_message_writer = -1; static int hf_rtps_flag_participant_stateless_message_reader = -1; static int hf_rtps_flag_secure_participant_volatile_message_writer = -1; static int hf_rtps_flag_secure_participant_volatile_message_reader = -1; static int hf_rtps_flag_participant_secure_writer = -1; static int hf_rtps_flag_participant_secure_reader = -1; static int hf_rtps_flag_typeflag_final = -1; static int hf_rtps_flag_typeflag_mutable = -1; static int hf_rtps_flag_typeflag_nested = -1; static int hf_rtps_flag_memberflag_key = -1; static int hf_rtps_flag_memberflag_optional = -1; static int hf_rtps_flag_memberflag_shareable = -1; static int hf_rtps_flag_memberflag_union_default = -1; static int hf_rtps_flag_service_request_writer = -1; static int hf_rtps_flag_service_request_reader = -1; static int hf_rtps_flag_locator_ping_writer = -1; static int hf_rtps_flag_locator_ping_reader = -1; static int hf_rtps_flag_secure_service_request_writer = -1; static int hf_rtps_flag_cloud_discovery_service_announcer = -1; static int hf_rtps_flag_participant_config_writer = -1; static int hf_rtps_flag_participant_config_reader = -1; static int hf_rtps_flag_participant_config_secure_writer = -1; static int hf_rtps_flag_participant_config_secure_reader = -1; static int hf_rtps_flag_participant_bootstrap_writer = -1; static int hf_rtps_flag_participant_bootstrap_reader = -1; static int hf_rtps_flag_monitoring_periodic_writer = -1; static int hf_rtps_flag_monitoring_periodic_reader = -1; static int hf_rtps_flag_monitoring_event_writer = -1; static int hf_rtps_flag_monitoring_event_reader = -1; static int hf_rtps_flag_monitoring_logging_writer = -1; static int hf_rtps_flag_monitoring_logging_reader = -1; static int hf_rtps_flag_secure_service_request_reader = -1; static int hf_rtps_flag_security_access_protected = -1; static int hf_rtps_flag_security_discovery_protected = -1; static int hf_rtps_flag_security_submessage_protected = -1; static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask = -1; static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit = -1; static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask = -1; static int hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm = -1; static int hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm = -1; static int hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm = -1; static int hf_rtps_param_compression_id_mask = -1; static int hf_rtps_flag_compression_id_zlib = -1; static int hf_rtps_flag_compression_id_bzip2 = -1; static int hf_rtps_flag_compression_id_lz4 = -1; static int hf_rtps_param_crypto_algorithm_requirements_trust_chain = -1; static int hf_rtps_param_crypto_algorithm_requirements_message_auth = -1; static int hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256 = -1; static int hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256 = -1; static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256 = -1; static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384 = -1; static int hf_rtps_flag_security_digital_signature_mask_custom_algorithm = -1; static int hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256 = -1; static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256 = -1; static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384 = -1; static int hf_rtps_flag_security_key_establishment_mask_custom_algorithm = -1; static int hf_rtps_flag_security_algorithm_compatibility_mode = -1; static int hf_rtps_flag_security_payload_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected = -1; static int hf_rtps_flag_endpoint_security_attribute_flag_is_valid = -1; static int hf_rtps_param_endpoint_security_attributes_mask = -1; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted = -1; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted = -1; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted = -1; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid = -1; static int hf_rtps_param_plugin_endpoint_security_attributes_mask = -1; static int hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected = -1; static int hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected = -1; static int hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected = -1; static int fh_rtps_flag_participant_security_attribute_flag_key_revisions_enabled = -1; static int hf_rtps_flag_participant_security_attribute_flag_is_valid = -1; static int hf_rtps_param_participant_security_attributes_mask = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted = -1; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid = -1; static int hf_rtps_param_plugin_participant_security_attributes_mask = -1; static int hf_rtps_sm_rti_crc_number = -1; static int hf_rtps_sm_rti_crc_result = -1; static int hf_rtps_data_tag_name = -1; static int hf_rtps_data_tag_value = -1; static int hf_rtps_flag_udpv4_wan_locator_u = -1; static int hf_rtps_flag_udpv4_wan_locator_p = -1; static int hf_rtps_flag_udpv4_wan_locator_b = -1; static int hf_rtps_flag_udpv4_wan_locator_r = -1; static int hf_rtps_flag_udpv4_wan_binding_ping_e = -1; static int hf_rtps_flag_udpv4_wan_binding_ping_l = -1; static int hf_rtps_flag_udpv4_wan_binding_ping_b = -1; static int hf_rtps_header_extension_flags = -1; static int hf_rtps_flag_header_extension_message_length = -1; static int hf_rtps_flag_header_extension_uextension = -1; static int hf_rtps_flag_header_extension_wextension = -1; static int hf_rtps_flag_header_extension_checksum1 = -1; static int hf_rtps_flag_header_extension_checksum2 = -1; static int hf_rtps_flag_header_extension_parameters = -1; static int hf_rtps_flag_header_extension_timestamp = -1; static int hf_rtps_fragments = -1; static int hf_rtps_fragment = -1; static int hf_rtps_fragment_overlap = -1; static int hf_rtps_fragment_overlap_conflict = -1; static int hf_rtps_fragment_multiple_tails = -1; static int hf_rtps_fragment_too_long_fragment = -1; static int hf_rtps_fragment_error = -1; static int hf_rtps_fragment_count = -1; static int hf_rtps_reassembled_in = -1; static int hf_rtps_reassembled_length = -1; static int hf_rtps_reassembled_data = -1; static int hf_rtps_encapsulation_extended_compression_options = -1; static int hf_rtps_message_length = -1; static int hf_rtps_header_extension_checksum_crc32c = -1; static int hf_rtps_header_extension_checksum_crc64 = -1; static int hf_rtps_header_extension_checksum_md5 = -1; static int hf_rtps_uextension = -1; static int hf_rtps_wextension = -1; static int hf_rtps_writer_group_oid = -1; static int hf_rtps_reader_group_oid = -1; static int hf_rtps_writer_session_id = -1; /* Subtree identifiers */ static gint ett_rtps_dissection_tree = -1; static gint ett_rtps = -1; static gint ett_rtps_default_mapping = -1; static gint ett_rtps_proto_version = -1; static gint ett_rtps_submessage = -1; static gint ett_rtps_parameter_sequence = -1; static gint ett_rtps_parameter = -1; static gint ett_rtps_flags = -1; static gint ett_rtps_entity = -1; static gint ett_rtps_generic_guid = -1; static gint ett_rtps_rdentity = -1; static gint ett_rtps_wrentity = -1; static gint ett_rtps_guid_prefix = -1; static gint ett_rtps_app_id = -1; static gint ett_rtps_locator_udp_v4 = -1; static gint ett_rtps_locator = -1; static gint ett_rtps_locator_list = -1; static gint ett_rtps_timestamp = -1; static gint ett_rtps_bitmap = -1; static gint ett_rtps_seq_string = -1; static gint ett_rtps_seq_ulong = -1; static gint ett_rtps_resource_limit = -1; static gint ett_rtps_durability_service = -1; static gint ett_rtps_liveliness = -1; static gint ett_rtps_manager_key = -1; static gint ett_rtps_serialized_data = -1; static gint ett_rtps_locator_filter_channel = -1; static gint ett_rtps_part_message_data = -1; static gint ett_rtps_sample_info_list = -1; static gint ett_rtps_sample_info = -1; static gint ett_rtps_sample_batch_list = -1; static gint ett_rtps_locator_filter_locator = -1; static gint ett_rtps_writer_heartbeat_virtual_list = -1; static gint ett_rtps_writer_heartbeat_virtual = -1; static gint ett_rtps_virtual_guid_heartbeat_virtual_list = -1; static gint ett_rtps_virtual_guid_heartbeat_virtual = -1; static gint ett_rtps_app_ack_virtual_writer_interval_list = -1; static gint ett_rtps_app_ack_virtual_writer_interval = -1; static gint ett_rtps_transport_info = -1; static gint ett_rtps_app_ack_virtual_writer_list = -1; static gint ett_rtps_app_ack_virtual_writer = -1; static gint ett_rtps_product_version = -1; static gint ett_rtps_property_list = -1; static gint ett_rtps_property = -1; static gint ett_rtps_topic_info = -1; static gint ett_rtps_topic_info_dw_qos = -1; static gint ett_rtps_type_object = -1; static gint ett_rtps_type_library = -1; static gint ett_rtps_type_element = -1; static gint ett_rtps_type_annotation_usage_list = -1; static gint ett_rtps_type_enum_constant = -1; static gint ett_rtps_type_bound_list = -1; static gint ett_rtps_secure_payload_tree = -1; static gint ett_rtps_secure_dataheader_tree = -1; static gint ett_rtps_pgm_data = -1; static gint ett_rtps_message_identity = -1; static gint ett_rtps_related_message_identity = -1; static gint ett_rtps_data_holder_seq = -1; static gint ett_rtps_data_holder = -1; static gint ett_rtps_data_holder_properties = -1; static gint ett_rtps_property_tree = -1; static gint ett_rtps_param_header_tree = -1; static gint ett_rtps_service_request_tree = -1; static gint ett_rtps_locator_ping_tree = -1; static gint ett_rtps_locator_reachability_tree = -1; static gint ett_rtps_custom_dissection_info = -1; static gint ett_rtps_locator_list_tree = -1; static gint ett_rtps_topic_query_tree = -1; static gint ett_rtps_topic_query_selection_tree = -1; static gint ett_rtps_topic_query_filter_params_tree = -1; static gint ett_rtps_data_member = -1; static gint ett_rtps_data_tag_seq = -1; static gint ett_rtps_data_tag_item = -1; static gint ett_rtps_fragment = -1; static gint ett_rtps_fragments = -1; static gint ett_rtps_data_representation = -1; static gint ett_rtps_decompressed_type_object = -1; static gint ett_rtps_info_remaining_items = -1; static gint ett_rtps_data_encapsulation_options = -1; static gint ett_rtps_decompressed_serialized_data = -1; static gint ett_rtps_instance_transition_data = -1; static gint ett_rtps_crypto_algorithm_requirements = -1; static expert_field ei_rtps_sm_octets_to_next_header_error = EI_INIT; static expert_field ei_rtps_checksum_check_error = EI_INIT; static expert_field ei_rtps_port_invalid = EI_INIT; static expert_field ei_rtps_ip_invalid = EI_INIT; static expert_field ei_rtps_parameter_value_invalid = EI_INIT; static expert_field ei_rtps_extra_bytes = EI_INIT; static expert_field ei_rtps_missing_bytes = EI_INIT; static expert_field ei_rtps_locator_port = EI_INIT; static expert_field ei_rtps_more_samples_available = EI_INIT; static expert_field ei_rtps_parameter_not_decoded = EI_INIT; static expert_field ei_rtps_sm_octets_to_next_header_not_zero = EI_INIT; static expert_field pid_type_csonsistency_invalid_size = EI_INIT; static expert_field ei_rtps_uncompression_error = EI_INIT; static expert_field ei_rtps_value_too_large = EI_INIT; /***************************************************************************/ /* 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_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_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_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 */ &fh_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_CHECKSUM_MAX_LEN 16 /* End of TCP get DomainId feature constants */ typedef struct _participant_info { gint domainId; } participant_info; typedef struct _datawriter_qos { guint32 reliability_kind; guint32 durability_kind; guint32 ownership_kind; } datawriter_qos; #define MAX_TOPIC_AND_TYPE_LENGTH 256 typedef struct _type_mapping { endpoint_guid guid; gchar type_name[MAX_TOPIC_AND_TYPE_LENGTH]; gchar topic_name[MAX_TOPIC_AND_TYPE_LENGTH]; gint fields_visited; datawriter_qos dw_qos; guint32 dcps_publication_frame_number; guint64 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; guint64 writer_seq_number; guint64 coherent_set_seq_number; guint64 expected_coherent_set_end_writers_seq_number; } coherent_set_entity_info; typedef struct _coherent_set_key { endpoint_guid guid; guint64 coherent_set_seq_number; } coherent_set_key; /* Holds information about the coherent set */ typedef struct _coherent_set_info { coherent_set_key *key; guint64 writer_seq_number; gboolean is_set; } coherent_set_info; /* Links a writer_seq_number with a coherent set. Useful when cohrent set ends with paramter empty packet*/ typedef struct _coherent_set_end { guint64 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 = NULL; 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 pubish 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" }; static const true_false_string tfs_little_big_endianness = { "Little-Endian", "Big-Endian" }; static guint32 check_offset_addition(guint32 offset, guint32 value, proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb) { if (offset > G_MAXUINT32 - value) { proto_tree_add_expert_format(tree, pinfo, &ei_rtps_value_too_large, tvb, 0, 0, "Offset value too large: %u", value); THROW(ReportedBoundsError); } return offset + value; } static void rtps_util_dissect_parameter_header(tvbuff_t * tvb, gint * offset, const guint encoding, guint32 * member_id, guint32 * member_length) { *member_id = tvb_get_guint16(tvb, *offset, encoding); *offset += 2; *member_length = tvb_get_guint16(tvb, *offset, encoding); *offset += 2; if ((*member_id & PID_EXTENDED) == PID_EXTENDED) { /* get extended member id and length */ *member_id = tvb_get_guint32(tvb, *offset, encoding); *offset += 4; *member_length = tvb_get_guint32(tvb, *offset, encoding); *offset += 4; } } static gint dissect_crypto_algorithm_requirements(proto_tree *tree , tvbuff_t* tvb, gint offset, gint 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 gint dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, gint offset, guint encoding, guint encoding_version, dissection_info * info, gboolean * is_end, gboolean show); static gint get_native_type_cdr_length(guint64 member_kind) { guint 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 gint get_native_type_cdr_alignment(guint64 member_kind, gint encapsulation_version) { guint 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 gint get_encapsulation_endianness(gint 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 gint get_encapsulation_version(gint 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(guint64 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 */ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, guint encoding, guint encoding_version, dissection_info * _info, guint64 type_id, gchar * name, RTICdrTypeObjectExtensibility extensibility, gint offset_zero, guint16 flags, guint32 element_member_id, gboolean show) { guint64 member_kind; dissection_info * info = NULL; guint32 member_id; guint32 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) { gint offset_before = offset; /* Parameter header is at minimun 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); switch (member_kind) { case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gint16 value = tvb_get_gint8(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gint16 value = tvb_get_gint8(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gint16 value = tvb_get_gint16(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); guint16 value = tvb_get_guint16(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gint value = tvb_get_gint32(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); guint value = tvb_get_guint32(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gint64 value = tvb_get_gint64(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); guint64 value = tvb_get_guint64(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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gfloat 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: { gint length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gdouble 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: { gint 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: { guint i; guint num_elements; proto_tree * aux_tree = NULL; gint base_offset = offset; gboolean show_current_element = TRUE; gint array_kind_length = 0; guint bound = 0; gint first_skipped_element_offset = 0; if (info != NULL) { bound = (guint)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 elese to do here. */ offset += bound * array_kind_length; break; } /* Get the maximun 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++) { gchar 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, 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: { guint i; guint num_elements; proto_tree * aux_tree = NULL; gint base_offset = offset; gboolean show_current_element = TRUE; gint length = 4; gint sequence_kind_length = 0; gint first_skipped_element_offset = 0; ALIGN_ZERO(offset, length, offset_zero); guint seq_size = tvb_get_guint32(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++) { gchar 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, 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: { gchar * string_value = NULL; gint length = 4; ALIGN_ZERO(offset, length, offset_zero); guint string_size = tvb_get_guint32(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: { guint64 base_type_id = 0; if (info != NULL) { base_type_id = info->base_type_id; } offset = dissect_user_defined(tree, tvb, 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: { guint64 key = type_id - 1; union_member_mapping * result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key)); if (result != NULL) { gint value = tvb_get_gint32(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, 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. substracting -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, 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: { guint i; proto_tree * aux_tree = NULL; guint shown_elements = 0; gboolean show_current_element = TRUE; guint num_elements = 0; gint 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) { gboolean 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, 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, offset, encoding, encoding_version, NULL, info->base_type_id, info->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show); } /* Get the maximun 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 maximun 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, 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; } } if (extensibility == EXTENSIBILITY_MUTABLE) { offset_zero += member_length; return offset_zero; } else { return offset; } } static gint dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, gint offset, guint encoding, guint encoding_version, dissection_info * info, gboolean * is_end, gboolean show) { proto_tree * member; guint32 member_id, member_length; mutable_member_mapping * mapping; gint64 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, 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, 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, guint32 writer_id, guint32 status_info) { /* Defines the extra information associated to the writer involved in * this communication * * Format: [?Ptwrpm]\(u?d?\) * * First letter table: * * writerEntityId value | Letter * ----------------------------------------------------------+-------- * ENTITYID_UNKNOWN | ? * ENTITYID_PARTICIPANT | P * ENTITYID_SEDP_BUILTIN_TOPIC_WRITER | t * ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER | w * ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER | r * ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER | p * ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER | m * ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER | s * ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER | V * ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER | M * ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER | W * ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER | R * 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 */ gchar * writerId = NULL; gchar * disposeFlag = NULL; gchar * 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* */ guint32* service_id = (guint32*)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, guint64 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, &register_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 guint16 rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL */ tvbuff_t *tvb, gint offset) { proto_item *ti; proto_tree *version_tree; guint16 version; version = tvb_get_ntohs(tvb, offset); ti = proto_tree_add_uint_format(tree, hf_rtps_protocol_version, tvb, offset, 2, version, "Protocol version: %d.%d", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1)); version_tree = proto_item_add_subtree(ti, ett_rtps_proto_version); proto_tree_add_item(version_tree, hf_rtps_protocol_version_major, tvb, offset, 1, ENC_NA); proto_tree_add_item(version_tree, hf_rtps_protocol_version_minor, tvb, offset+1, 1, ENC_NA); return version; } /* ------------------------------------------------------------------------- */ /* Interpret the next bytes as vendor ID. If proto_tree and field ID is * provided, it can also set. */ static guint16 rtps_util_add_vendor_id(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint8 major, minor; guint16 vendor_id; major = tvb_get_guint8(tvb, offset); minor = tvb_get_guint8(tvb, offset+1); vendor_id = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(tree, hf_rtps_vendor_id, tvb, offset, 2, vendor_id, "%02d.%02d (%s)", major, minor, val_to_str_const(vendor_id, vendor_vals, "Unknown")); return vendor_id; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as Locator_t * * Locator_t is a struct defined as: * struct { * long kind; // kind of locator * unsigned long port; * octet[16] address; * } Locator_t; */ static gint rtps_util_add_locator_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, const char *label) { proto_tree *ti; proto_tree *locator_tree; guint32 kind; guint32 port; const gint 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: { guint16 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_guint16(tvb, offset+16, encoding); if (ip_kind == 0xFFFF) { /* IPv4 format */ guint16 public_address_port = tvb_get_guint16(tvb, offset + 18, ENC_BIG_ENDIAN); proto_tree_add_item(locator_tree, hf_rtps_locator_public_address_port, tvb, offset+18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(tree, " (%s, %s:%d, Logical Port = %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: { guint32 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: { guint8 flags = 0; ws_in4_addr locator_ip = 0; const guint32 uuid_size = 9; const guint32 locator_port_size = 4; const guint32 locator_port_offset = offset + 4; const guint32 flags_offset = locator_port_offset + locator_port_size; const guint32 uuid_offset = flags_offset + 1; const guint32 port_offset = uuid_offset + uuid_size; const guint32 ip_offset = port_offset + 2; int hf_port = 0; int hf_ip = 0; gchar* ip_str = NULL; guint32 public_port = 0; gboolean 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_gint8(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, (guint64)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 gint rtps_util_add_seq_short(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, const guint encoding, int param_length _U_, const char *label) { guint32 num_elem; guint32 i; proto_tree *string_tree; num_elem = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Create the string node with an empty string, the replace it later */ string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem * 4, ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem); for (i = 0; i < num_elem; ++i) { proto_tree_add_item(string_tree, hf_item, tvb, offset, 2, encoding); offset += 2; } return offset; } static gint rtps_util_add_locator_ex_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, int param_length) { gint 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, gint offset, const guint8 *label, const guint encoding) { proto_tree *locator_tree; guint32 num_locators; num_locators = tvb_get_guint32(tvb, offset, encoding); locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators); offset += 4; if (num_locators > 0) { guint32 i; char temp_buff[20]; for (i = 0; i < num_locators; ++i) { 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, gint offset, const guint8 *label, const guint encoding) { proto_tree *locator_tree; guint32 num_locators; num_locators = tvb_get_guint32(tvb, offset, encoding); locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators); offset += 4; if (num_locators > 0) { guint32 i; for (i = 0; i < num_locators; ++i) { proto_tree *ti, *locator_item_tree; guint32 kind; guint32 port; gchar *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, gint offset, const guint 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, gint offset, const guint8 *label, const guint encoding) { proto_item *ti; proto_tree *locator_tree; guint32 port; locator_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_rtps_locator_udp_v4, NULL, label); rtps_util_add_ipv4_address_t(locator_tree, pinfo, tvb, offset, encoding, hf_rtps_locator_udp_v4); ti = proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_udp_v4_port, tvb, offset, 4, encoding, &port); if (port == PORT_INVALID) expert_add_info(pinfo, ti, &ei_rtps_port_invalid); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as GuidPrefix * If tree is specified, it fills up the protocol tree item: * - hf_rtps_guid_prefix * - hf_rtps_host_id * - hf_rtps_app_id * - hf_rtps_app_id_instance_id * - hf_rtps_app_id_app_kind */ static void rtps_util_add_guid_prefix_v1(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_prefix, int hf_host_id, int hf_app_id, int hf_app_id_instance_id, int hf_app_id_app_kind, const guint8 *label) { guint64 prefix; guint32 host_id, app_id, instance_id; guint8 app_kind; proto_item *ti; proto_tree *guid_tree, *appid_tree; const guint8 *safe_label = (label == NULL) ? (const guint8 *)"guidPrefix" : label; /* Read values from TVB */ prefix = tvb_get_ntoh64(tvb, offset); host_id = tvb_get_ntohl(tvb, offset); app_id = tvb_get_ntohl(tvb, offset + 4); instance_id = (app_id >> 8); app_kind = (app_id & 0xff); if (tree != NULL) { ti = proto_tree_add_uint64_format(tree, hf_prefix, tvb, offset, 8, prefix, "%s=%08x %08x { hostId=%08x, appId=%08x (%s: %06x) }", safe_label, host_id, app_id, host_id, app_id, val_to_str(app_kind, app_kind_vals, "%02x"), instance_id); guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix); /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* AppId (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id); /* InstanceId */ proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN); /* AppKind */ proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN); } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 12 bytes interpreted as GuidPrefix * If tree is specified, it fills up the protocol tree item: * - hf_rtps_guid_prefix * - hf_rtps_host_id * - hf_rtps_app_id * - hf_rtps_counter */ static void rtps_util_add_guid_prefix_v2(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_prefix, int hf_host_id, int hf_app_id, int hf_instance_id, int hf_prefix_extra) { if (tree) { proto_item *ti; proto_tree *guid_tree; /* The text node (root of the guid prefix sub-tree) */ ti = proto_tree_add_item(tree, hf_prefix, tvb, offset, 12, ENC_NA); guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix); /* Optional filter that can be guidPrefix.src or guidPrefix.dst */ if (hf_prefix_extra != 0) { ti = proto_tree_add_item(tree, hf_prefix_extra, tvb, offset, 12, ENC_NA); proto_item_set_hidden(ti); } /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* App Id */ proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); /* Counter */ proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); } } /* ------------------------------------------------------------------------- */ /* Insert the entityId from the next 4 bytes. Since there are more than * one entityId, we need to specify also the IDs of the entityId (and its * sub-components), as well as the label identifying it. * Returns true if the entityKind is one of the NDDS built-in entities. */ static gboolean rtps_util_add_entity_id(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, int hf_item_entity_key, int hf_item_entity_kind, int subtree_entity_id, const char *label, guint32 *entity_id_out) { guint32 entity_id = tvb_get_ntohl(tvb, offset); guint32 entity_key = (entity_id >> 8); guint8 entity_kind = (entity_id & 0xff); const char *str_predef = try_val_to_str(entity_id, entity_id_vals); if (entity_id_out != NULL) { *entity_id_out = entity_id; } if (tree != NULL) { proto_tree *entity_tree; proto_item *ti; if (str_predef == NULL) { /* entityId is not a predefined value, format it */ ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id, "%s: 0x%08x (%s: 0x%06x)", label, entity_id, val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"), entity_key); } else { /* entityId is a predefined value */ ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id, "%s: %s (0x%08x)", label, str_predef, entity_id); } entity_tree = proto_item_add_subtree(ti, subtree_entity_id); proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN); } /* is a built-in entity if the bit M and R (5 and 6) of the entityKind are set */ /* return ((entity_kind & 0xc0) == 0xc0); */ return ( ((entity_kind & 0xc0) == 0xc0) || entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER || entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER || entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER || entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER); } /* ------------------------------------------------------------------------- */ /* Insert the entityId from the next 4 bytes as a generic one (not connected * to any protocol field). It simply insert the content as a simple text entry * and returns in the passed buffer only the value (without the label). */ static void rtps_util_add_generic_entity_id(proto_tree *tree, tvbuff_t *tvb, gint offset, const char *label, int hf_item, int hf_item_entity_key, int hf_item_entity_kind, int subtree_entity_id) { guint32 entity_id = tvb_get_ntohl(tvb, offset); guint32 entity_key = (entity_id >> 8); guint8 entity_kind = (entity_id & 0xff); const char *str_predef = try_val_to_str(entity_id, entity_id_vals); proto_item *ti; proto_tree *entity_tree; if (str_predef == NULL) { /* entityId is not a predefined value, format it */ ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id, "%s: 0x%08x (%s: 0x%06x)", label, entity_id, val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"), entity_key); } else { /* entityId is a predefined value */ ti = proto_tree_add_uint_format_value(tree, hf_item, tvb, offset, 4, entity_id, "%s: %s (0x%08x)", label, str_predef, entity_id); } entity_tree = proto_item_add_subtree(ti, subtree_entity_id); proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN); } /* ------------------------------------------------------------------------- */ /* Interpret the next 12 octets as a generic GUID and insert it in the protocol * tree as simple text (no reference fields are set). * It is mostly used in situation where is not required to perform search for * this kind of GUID (i.e. like in some DATA parameter lists). */ static void rtps_util_add_generic_guid_v1(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_guid, int hf_host_id, int hf_app_id, int hf_app_id_instance_id, int hf_app_id_app_kind, int hf_entity, int hf_entity_key, int hf_entity_kind) { guint64 prefix; guint32 host_id, app_id, entity_id; proto_item *ti; proto_tree *guid_tree, *appid_tree, *entity_tree; /* Read typed data */ prefix = tvb_get_ntoh64(tvb, offset); host_id = tvb_get_ntohl(tvb, offset); app_id = tvb_get_ntohl(tvb, offset + 4); entity_id = tvb_get_ntohl(tvb, offset + 8); ti = proto_tree_add_uint64_format_value(tree, hf_guid, tvb, offset, 8, prefix, "%08x %08x %08x", host_id, app_id, entity_id); guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid); /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* AppId (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id); /* InstanceId */ proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN); /* AppKind */ proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN); /* Entity (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+8, 4, ENC_BIG_ENDIAN); entity_tree = proto_item_add_subtree(ti, ett_rtps_entity); proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+8, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+11, 1, ENC_BIG_ENDIAN); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next data interpreted as a String * Returns the new offset (after reading the string) */ static gint rtps_util_add_string(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, const guint encoding) { guint8 *retVal = NULL; guint32 size = tvb_get_guint32(tvb, offset, encoding); retVal = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, size, ENC_ASCII); proto_tree_add_string(tree, hf_item, tvb, offset, size+4, retVal); /* NDDS align strings at 4-bytes word. So: * string_length: 4 -> buffer_length = 4; * string_length: 5 -> buffer_length = 8; * string_length: 6 -> buffer_length = 8; * string_length: 7 -> buffer_length = 8; * string_length: 8 -> buffer_length = 8; * ... */ return offset + 4 + ((size + 3) & 0xfffffffc); } static gint rtps_util_add_data_tags(proto_tree *rtps_parameter_tree, tvbuff_t *tvb, gint offset, const guint 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; guint32 seq_sum_elements, i; seq_sum_elements = tvb_get_guint32(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) { guint32 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, gint offset, int hf_guid, int hf_host_id, int hf_app_id, int hf_instance_id, int hf_entity, int hf_entity_key, int hf_entity_kind, proto_tree *print_tree) { guint32 host_id, app_id, entity_id, instance_id; proto_item *ti; proto_tree *guid_tree, *entity_tree; /* Read typed data */ host_id = tvb_get_ntohl(tvb, offset); app_id = tvb_get_ntohl(tvb, offset + 4); instance_id = tvb_get_ntohl(tvb, offset + 8); entity_id = tvb_get_ntohl(tvb, offset + 12); ti = proto_tree_add_bytes_format_value(tree, hf_guid, tvb, offset, 16, NULL, "%08x %08x %08x %08x", host_id, app_id, instance_id, entity_id); /* If the method is called with a valid print_tree pointer, we add the info to the tree. * This improves usability a lot since the user doesn't have to click a lot to debug. */ proto_item_append_text(print_tree, "%08x %08x %08x %08x", host_id, app_id, instance_id, entity_id); guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid); /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* App Id */ proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); /* Instance Id */ proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); /* Entity (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+12, 4, ENC_BIG_ENDIAN); entity_tree = proto_item_add_subtree(ti, ett_rtps_entity); proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+12, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+15, 1, ENC_BIG_ENDIAN); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as sequence * number. */ static guint64 rtps_util_add_seq_number(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, const char *label) { guint64 hi = (guint64)tvb_get_guint32(tvb, offset, encoding); guint64 lo = (guint64)tvb_get_guint32(tvb, offset+4, encoding); guint64 all = (hi << 32) | lo; proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, 8, all, "%s: %" 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, gint offset, const guint encoding, int transport_index) { gint32 classId = tvb_get_guint32(tvb, offset, encoding); if (tree) { proto_tree *xport_info_tree; xport_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_rtps_transport_info, NULL, "transportInfo %d: %s", transport_index, val_to_str_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, gint offset, const guint encoding, int hf_time) { proto_tree_add_item(tree, hf_time, tvb, offset, 8, ENC_TIME_RTPS|encoding); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t. * Checks for special values except for TIME_INVALID, and shows the * seconds and fraction as separate fields. */ static void rtps_util_add_timestamp_sec_and_fraction(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int hf_time _U_) { gchar tempBuffer[MAX_TIMESTAMP_SIZE]; gdouble absolute; gint32 sec; guint32 frac; if (tree) { proto_tree *time_tree; sec = tvb_get_guint32(tvb, offset, encoding); frac = tvb_get_guint32(tvb, offset+4, encoding); if ((sec == 0x7fffffff) && (frac == 0xffffffff)) { (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 = (gdouble)sec + (gdouble)frac / ((gdouble)(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, gint offset, const guint encoding, int hf_item) { proto_item *ti; guint32 port; ti = proto_tree_add_item_ret_uint(tree, hf_item, tvb, offset, 4, encoding, &port); if (port == PORT_INVALID) expert_add_info(pinfo, ti, &ei_rtps_port_invalid); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as * DurabilityServiceQosPolicy */ static void rtps_util_add_durability_service_qos(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding) { proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, 28, ett_rtps_durability_service, NULL, "PID_DURABILITY_SERVICE"); rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset, encoding, hf_rtps_durability_service_cleanup_delay); proto_tree_add_item(subtree, hf_rtps_durability_service_history_kind, tvb, offset+8, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_history_depth, tvb, offset+12, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples, tvb, offset+16, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_max_instances, tvb, offset+20, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples_per_instances, tvb, offset+24, 4, encoding); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Liveliness * QoS Policy structure. */ static void rtps_util_add_liveliness_qos(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding) { proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_rtps_liveliness, NULL, "PID_LIVELINESS"); proto_tree_add_item(subtree, hf_rtps_liveliness_kind, tvb, offset, 4, encoding); rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset+4, encoding, hf_rtps_liveliness_lease_duration); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Liveliness * QoS Policy structure. */ static void rtps_util_add_product_version(proto_tree *tree, tvbuff_t *tvb, gint offset, gint vendor_id) { proto_tree *subtree; guint8 major, minor, release, revision; gint release_offset; gint revision_offset; release_offset = 2; revision_offset = 3; major = tvb_get_guint8(tvb, offset); minor = tvb_get_guint8(tvb, offset+1); release = tvb_get_guint8(tvb, offset+2); revision = tvb_get_guint8(tvb, offset+3); if (vendor_id == RTPS_VENDOR_RTI_DDS) { if (major < 5 && revision == 0) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL, "Product version: %d.%d%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 gint rtps_util_add_seq_string(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int hf_numstring, int hf_string, const char *label) { guint32 size; gint32 i, num_strings; const char *retVal; proto_tree *string_tree; gint start; proto_tree_add_item_ret_int(tree, hf_numstring, tvb, offset, 4, encoding, &num_strings); offset += 4; if (num_strings == 0) { return offset; } start = offset; /* Create the string node with a fake string, the replace it later */ string_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_seq_string, NULL, label); for (i = 0; i < num_strings; ++i) { size = tvb_get_guint32(tvb, offset, encoding); retVal = (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 gint rtps_util_add_seq_ulong(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, const guint encoding, int param_length _U_, const char *label) { guint32 num_elem; guint32 i; proto_tree *string_tree; num_elem = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Create the string node with an empty string, the replace it later */ string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem*4, ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem); for (i = 0; i < num_elem; ++i) { proto_tree_add_item(string_tree, hf_item, tvb, offset, 4, encoding); offset += 4; } return offset; } /* ------------------------------------------------------------------------- */ static const char *rtps_util_typecode_id_to_string(guint32 typecode_id) { switch(typecode_id) { case RTI_CDR_TK_ENUM: return "enum"; case RTI_CDR_TK_UNION: return "union"; case RTI_CDR_TK_STRUCT: return "struct"; case RTI_CDR_TK_LONG: return "long"; case RTI_CDR_TK_SHORT: return "short"; case RTI_CDR_TK_USHORT: return "unsigned short"; case RTI_CDR_TK_ULONG: return "unsigned long"; case RTI_CDR_TK_FLOAT: return "float"; case RTI_CDR_TK_DOUBLE: return "double"; case RTI_CDR_TK_BOOLEAN: return "boolean"; case RTI_CDR_TK_CHAR: return "char"; case RTI_CDR_TK_OCTET: return "octet"; case RTI_CDR_TK_LONGLONG: return "longlong"; case RTI_CDR_TK_ULONGLONG: return "unsigned long long"; case RTI_CDR_TK_LONGDOUBLE: return "long double"; case RTI_CDR_TK_WCHAR: return "wchar"; case RTI_CDR_TK_WSTRING: return "wstring"; case RTI_CDR_TK_STRING: return "string"; case RTI_CDR_TK_SEQUENCE: return "sequence"; case RTI_CDR_TK_ARRAY: return "array"; case RTI_CDR_TK_ALIAS: return "alias"; case RTI_CDR_TK_VALUE: return "valuetype"; case RTI_CDR_TK_NULL: default: return "<unknown type>"; } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as typecode info * Returns the number of bytes parsed */ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int indent_level, int is_pointer, guint16 bitfield, int is_key, const gint offset_begin, char *name, int seq_max_len, /* -1 = not a sequence field */ guint32 *arr_dimension, /* if !NULL: array of 10 int */ int ndds_40_hack) { const gint original_offset = offset; guint32 tk_id; guint16 tk_size; unsigned int i; char *indent_string; gint retVal; char type_name[40]; /* Structure of the typecode data: * Offset | Size | Field | Notes * ----------|-------|------------------------------|--------------------- * ? | ? | pad? | * 0 | 4 | RTI_CDR_TK_XXXXX | 4 bytes aligned * 4 | 2 | length the struct | */ /* Calc indent string */ indent_string = (char *)wmem_alloc(wmem_epan_scope(), (indent_level*2)+1); memset(indent_string, ' ', (indent_level*2)+1); indent_string[indent_level*2] = '\0'; /* Gets TK ID */ LONG_ALIGN(offset); tk_id = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Gets TK size */ tk_size = tvb_get_guint16(tvb, offset, encoding); offset += 2; retVal = tk_size + 6; /* 6 = 4 (typecode ID) + 2 (size) */ /* The first bit of typecode is set to 1, clear it */ tk_id &= 0x7fffffff; /* HACK: NDDS 4.0 and NDDS 4.1 has different typecode ID list. * The ID listed in the RTI_CDR_TK_XXXXX are the one from NDDS 4.1 * In order to correctly dissect NDDS 4.0 packets containing typecode * information, we check if the ID of the element at level zero is a * struct or union. If not, it means we are dissecting a ndds 4.0 packet * (and we can decrement the ID to match the correct values). */ if (indent_level == 0) { if (tk_id == RTI_CDR_TK_OCTET) { ndds_40_hack = 1; } } if (ndds_40_hack) { ++tk_id; } (void) g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), sizeof(type_name)); /* Structure of the typecode data: * * <type_code_header> ::= * <kind> * <type_code_length> * * <kind> ::= long (0=TK_NULL, 1=TK_SHORT...) * <type_code_length> ::= unsugned short * */ switch(tk_id) { /* Structure of the typecode data: * * <union_type_code> ::= * <type_code_header> * <name> * <default_index> * <discriminator_type_code> * <member_count> * <union_member>+ * <union_member> ::= <member_length><name><union_member_detail> * <member_length> ::= unsigned short * <name> ::= <string> * <string> ::= <length>char+<eol> * <length> ::= unsigned long * <eol> ::= (char)0 * * <union_member_detail> ::= <is_pointer> * <labels_count> * <label>+ * <type_code> * <labels_count> ::= unsigned long * <label> ::= long * */ case RTI_CDR_TK_UNION: { guint32 struct_name_len; guint8 *struct_name; const char *discriminator_name = "<unknown>"; /* for unions */ char *discriminator_enum_name = NULL; /* for unions with enum discriminator */ /*guint32 defaultIdx;*/ /* Currently is ignored */ guint32 disc_id; /* Used temporarily to populate 'discriminator_name' */ guint16 disc_size; /* Currently is ignored */ guint32 disc_offset_begin, num_members, member_name_len; guint16 member_length; guint8 *member_name = NULL; guint32 next_offset, field_offset_begin, member_label_count, discriminator_enum_name_length; gint32 member_label; guint j; /* - - - - - - - Union name - - - - - - - */ /* Pad-align */ LONG_ALIGN(offset); /* Get structure name length */ struct_name_len = tvb_get_guint32(tvb, offset, encoding); offset += 4; struct_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, struct_name_len, ENC_ASCII); offset = check_offset_addition(offset, struct_name_len, tree, NULL, tvb); /* - - - - - - - Default index - - - - - - - */ LONG_ALIGN(offset); /*defaultIdx = NEXT_guint32(tvb, offset, encoding);*/ offset += 4; /* - - - - - - - Discriminator type code - - - - - - - */ /* We don't recursively dissect everything, instead we just read the type */ disc_id = tvb_get_guint32(tvb, offset, encoding); offset += 4; disc_size = tvb_get_guint16(tvb, offset, encoding); offset += 2; disc_offset_begin = offset; disc_id &= 0x7fffffff; discriminator_name = rtps_util_typecode_id_to_string(disc_id); if (disc_id == RTI_CDR_TK_ENUM) { /* Enums has also a name that we should print */ LONG_ALIGN(offset); discriminator_enum_name_length = tvb_get_guint32(tvb, offset, encoding); discriminator_enum_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, discriminator_enum_name_length, ENC_ASCII); } offset = disc_offset_begin + disc_size; #if 0 field_offset_begin = offset; offset += rtps_util_add_typecode( tree, tvb, offset, encoding, indent_level+1, 0, 0, 0, field_offset_begin, member_name, -1, NULL, ndds_40_hack); #endif /* Add the entry of the union in the tree */ proto_tree_add_string_format(tree, hf_rtps_union, tvb, original_offset, retVal, struct_name, "%sunion %s (%s%s%s) {", indent_string, struct_name, discriminator_name, (discriminator_enum_name ? " " : ""), (discriminator_enum_name ? discriminator_enum_name : "")); if (seq_max_len != -1) { /* We're dissecting a sequence of struct, bypass the seq definition */ snprintf(type_name, 40, "%s", struct_name); break; } /* - - - - - - - Number of members - - - - - - - */ LONG_ALIGN(offset); num_members = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* - - - - - - - <union_member>+ - - - - - - - */ next_offset = offset; for (i = 0; i < num_members; ++i) { guint8 member_is_pointer; /* Safety: this theoretically should be the same already */ field_offset_begin = offset = next_offset; SHORT_ALIGN(offset); /* member's length */ member_length = tvb_get_guint16(tvb, offset, encoding); offset += 2; next_offset = offset + member_length; /* Name length */ LONG_ALIGN(offset); member_name_len = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Name */ member_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, member_name_len, ENC_ASCII); offset = check_offset_addition(offset, member_name_len, tree, NULL, tvb); /* is Pointer ? */ member_is_pointer = tvb_get_guint8(tvb, offset); offset++; /* Label count */ LONG_ALIGN(offset); member_label_count = tvb_get_guint32(tvb, offset, encoding); offset += 4; for (j = 0; j < member_label_count; ++j) { proto_item* case_item; /* Label count */ LONG_ALIGN(offset); member_label = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Add the entry of the union in the tree */ case_item = proto_tree_add_uint_format(tree, hf_rtps_union_case, tvb, field_offset_begin, 1, member_label, "%s case %d:", indent_string, member_label); proto_item_set_len(case_item, retVal); } offset += rtps_util_add_typecode(tree, tvb, offset, encoding, indent_level+2, member_is_pointer, 0, 0, field_offset_begin, member_name, -1, NULL, ndds_40_hack); } /* Finally prints the name of the struct (if provided) */ (void) g_strlcpy(type_name, "}", sizeof(type_name)); break; } /* end of case UNION */ case RTI_CDR_TK_ENUM: case RTI_CDR_TK_STRUCT: { /* Structure of the typecode data: * * <union_type_code> ::= * <type_code_header> * <name> * <default_index> * <discriminator_type_code> * <member_count> * <member>+ * * <struct_type_code> ::= * <type_code_header> * <name> * <member_count> * <member>+ * * <name> ::= <string> * <string> ::= <length>char+<eol> * <length> ::= unsigned long * <eol> ::= (char)0 * <member_count> ::= unsigned long * * STRUCT / UNION: * Foreach member { * - A2: 2: member length * - A4: 4: member name length * - n: member name * - 1: isPointer? * - A2 2: bitfield bits (-1=none) * - 1: isKey? * - A4 4: Typecode ID * - A2 2: length * } * * ENUM: * Foreach member { * - A2: 2: member length * - A4: 4: member name length * - n: member name * - A4: 4: ordinal number * * -> ----------------------------------------------------- <- * -> The alignment pad bytes belong to the FOLLOWING field <- * -> A4 = 4 bytes alignment, A2 = 2 bytes alignment <- * -> ----------------------------------------------------- <- */ gint8 *struct_name; guint32 struct_name_len, num_members; guint32 next_offset; const char *typecode_name; /* Pad-align */ LONG_ALIGN(offset); /* Get structure name length */ struct_name_len = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* struct name */ struct_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, struct_name_len, ENC_ASCII); offset = check_offset_addition(offset, struct_name_len, tree, NULL, tvb); if (tk_id == RTI_CDR_TK_ENUM) { typecode_name = "enum"; } else if (tk_id == RTI_CDR_TK_VALUE_PARAM) { /* guint16 type_modifier; */ /* guint32 baseTypeCodeKind; */ guint32 baseTypeCodeLength; /* Need to read the type modifier and the base type code */ typecode_name = "<sparse type>"; SHORT_ALIGN(offset); /* type_modifier = */ tvb_get_guint16(tvb, offset, encoding); offset += 2; LONG_ALIGN(offset); /* baseTypeCodeKind = */ tvb_get_guint32(tvb, offset, encoding); offset += 4; baseTypeCodeLength = tvb_get_guint32(tvb, offset, encoding); offset += 4; offset = check_offset_addition(offset, baseTypeCodeLength, tree, NULL, tvb); } else { typecode_name = "struct"; } if (seq_max_len != -1) { /* We're dissecting a sequence of struct, bypass the seq definition */ snprintf(type_name, 40, "%s", struct_name); break; } /* Prints it */ proto_tree_add_string_format(tree, hf_rtps_struct, tvb, original_offset, retVal, struct_name, "%s%s %s {", indent_string, typecode_name, struct_name); /* PAD align */ LONG_ALIGN(offset); /* number of members */ num_members = tvb_get_guint32(tvb, offset, encoding); offset += 4; next_offset = offset; for (i = 0; i < num_members; ++i) { guint8 *member_name; guint32 member_name_len; guint16 member_length; guint32 field_offset_begin; /* Safety: this theoretically should be the same already */ field_offset_begin = offset = next_offset; SHORT_ALIGN(offset); /* member's length */ member_length = tvb_get_guint16(tvb, offset, encoding); offset += 2; next_offset = offset + member_length; /* Name length */ LONG_ALIGN(offset); member_name_len = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Name */ member_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, member_name_len, ENC_ASCII); offset += member_name_len; if (tk_id == RTI_CDR_TK_ENUM) { /* ordinal number */ guint32 ordinal_number; LONG_ALIGN(offset); ordinal_number = tvb_get_guint32(tvb, offset, encoding); offset += 4; proto_tree_add_string_format(tree, hf_rtps_member_name, tvb, field_offset_begin, (offset-field_offset_begin), member_name, "%s %s = %d;", indent_string, member_name, ordinal_number); } else { /* Structs */ guint16 member_bitfield; guint8 member_is_pointer; guint8 member_is_key; /* is Pointer ? */ member_is_pointer = tvb_get_guint8(tvb, offset); offset++; /* Bitfield */ SHORT_ALIGN(offset); member_bitfield = tvb_get_guint16(tvb, offset, encoding); offset += 2; /* pad will be added by typecode dissector */ /* is Key ? */ member_is_key = tvb_get_guint8(tvb, offset); offset++; offset += rtps_util_add_typecode(tree, tvb, offset, encoding, indent_level+1, member_is_pointer, member_bitfield, member_is_key, field_offset_begin, member_name, -1, NULL, ndds_40_hack); } } /* Finally prints the name of the struct (if provided) */ (void) g_strlcpy(type_name, "}", sizeof(type_name)); break; } case RTI_CDR_TK_WSTRING: case RTI_CDR_TK_STRING: { /* Structure of the typecode data: * Offset | Size | Field | Notes * ----------|-------|------------------------------|--------------------- * 6 | 2 | pad | * 8 | 4 | String length | 4-bytes aligned */ guint32 string_length; LONG_ALIGN(offset); string_length = tvb_get_guint32(tvb, offset, encoding); offset += 4; snprintf(type_name, 40, "%s<%d>", (tk_id == RTI_CDR_TK_STRING) ? "string" : "wstring", string_length); break; } case RTI_CDR_TK_SEQUENCE: { /* Structure of the typecode data: * * - A4: 4: Sequence max length * - the sequence typecode */ guint32 seq_max_len2; LONG_ALIGN(offset); seq_max_len2 = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Recursive decode seq typecode */ /*offset += */rtps_util_add_typecode(tree, tvb, offset, encoding, indent_level, is_pointer, bitfield, is_key, offset_begin, name, seq_max_len2, NULL, ndds_40_hack); /* Differently from the other typecodes, the line has been already printed */ return retVal; } case RTI_CDR_TK_ARRAY: { /* Structure of the typecode data: * * - A4: 4: number of dimensions * - A4: 4: dim1 * - <A4: 4: dim2> * - ... * - the array typecode */ guint32 size[MAX_ARRAY_DIMENSION]; /* Max dimensions */ guint32 dim_max; LONG_ALIGN(offset); dim_max = tvb_get_guint32(tvb, offset, encoding); offset += 4; if (dim_max > MAX_ARRAY_DIMENSION) { /* We don't have a tree item to add expert info to... */ dim_max = MAX_ARRAY_DIMENSION; } for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) size[i] = 0; for (i = 0; i < dim_max; ++i) { size[i] = tvb_get_guint32(tvb, offset, encoding); offset += 4; } /* Recursive decode seq typecode */ /*offset += */rtps_util_add_typecode(tree, tvb, offset, encoding, indent_level, is_pointer, bitfield, is_key, offset_begin, name, -1, size, ndds_40_hack); /* Differently from the other typecodes, the line has been already printed */ return retVal; } case RTI_CDR_TK_ALIAS: { /* Structure of the typecode data: * * - A4: 4: alias name size * - A4: 4: alias name * - A4: 4: the alias typecode */ guint32 alias_name_length; guint8 *alias_name; LONG_ALIGN(offset); alias_name_length = tvb_get_guint32(tvb, offset, encoding); offset += 4; alias_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, alias_name_length, ENC_ASCII); offset = check_offset_addition(offset, alias_name_length, tree, NULL, tvb); (void) g_strlcpy(type_name, alias_name, sizeof(type_name)); break; } /* * VALUETYPES: * - A4: 4: name length * - n: name * - A2: type modifier * - A4: base type code * - A4: number of members * Foreach member: (it's just like a struct) * */ case RTI_CDR_TK_VALUE_PARAM: case RTI_CDR_TK_VALUE: { /* Not fully dissected for now */ /* Pad-align */ guint32 value_name_len; gint8 *value_name; const char *type_id_name = "valuetype"; LONG_ALIGN(offset); /* Get structure name length */ value_name_len = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* value name */ value_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_name_len, ENC_ASCII); offset = check_offset_addition(offset, value_name_len, tree, NULL, tvb); if (tk_id == RTI_CDR_TK_VALUE_PARAM) { type_id_name = "valueparam"; } snprintf(type_name, sizeof(type_name), "%s '%s'", type_id_name, value_name); break; } } /* switch(tk_id) */ /* Sequence print */ if (seq_max_len != -1) { proto_tree_add_string_format(tree, hf_rtps_sequence, tvb, offset_begin, (offset-offset_begin), type_name, "%ssequence<%s, %d> %s%s;%s", indent_string, type_name, seq_max_len, is_pointer ? "*" : "", name ? name : "", is_key ? KEY_COMMENT : ""); return retVal; } /* Array print */ if (arr_dimension != NULL) { /* Printing an array */ wmem_strbuf_t *dim_str = wmem_strbuf_create(wmem_packet_scope()); for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) { if (arr_dimension[i] != 0) { wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]); } else { break; } } proto_tree_add_string_format(tree, hf_rtps_array, tvb, offset_begin, (offset-offset_begin), type_name, "%s%s %s%s;%s", indent_string, type_name, name ? name : "", wmem_strbuf_get_str(dim_str), is_key ? KEY_COMMENT : ""); return retVal; } /* Bitfield print */ if (bitfield != 0xffff && name != NULL && is_pointer == 0) { proto_tree_add_string_format(tree, hf_rtps_bitfield, tvb, offset_begin, (offset-offset_begin), type_name, "%s%s %s:%d;%s", indent_string, type_name, name, bitfield, is_key ? KEY_COMMENT : ""); return retVal; } /* Everything else */ proto_tree_add_string_format(tree, hf_rtps_datatype, tvb, offset_begin, (offset-offset_begin), type_name, "%s%s%s%s%s;%s", indent_string, type_name, name ? " " : "", is_pointer ? "*" : "", name ? name : "", is_key ? KEY_COMMENT : ""); return retVal; } static gint rtps_util_add_type_id(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, gint zero, int hf_base, proto_item * append_info_item, guint64 * type_id) { proto_item * ti; guint16 short_number; guint64 longlong_number; int hf_type; short_number = tvb_get_guint16(tvb, offset, encoding); ti = proto_tree_add_item(tree, hf_rtps_type_object_type_id_disc, tvb, offset, 2, encoding); proto_item_set_hidden(ti); /* Here we choose the proper hf item to use */ if (hf_base != -1) { if (short_number <= 13) hf_type = hf_rtps_type_object_base_primitive_type_id; else hf_type = hf_rtps_type_object_base_type; } else { if (short_number <= 13) hf_type = hf_rtps_type_object_primitive_type_id; else hf_type = hf_rtps_type_object_type_id; } offset += 2; if (short_number <= 13) { proto_tree_add_item(tree, hf_type, tvb, offset, 2, encoding); if (append_info_item) { proto_item_append_text(append_info_item, "(%s)", val_to_str(short_number, type_object_kind, "(0x%016x)")); } offset += 2; } else { ALIGN_ZERO(offset, 8, zero); longlong_number = tvb_get_guint64(tvb, offset, encoding); proto_tree_add_item(tree, hf_type, tvb, offset, 8, encoding); if (append_info_item) { proto_item_append_text(append_info_item, "(0x%016" PRIx64 ")", longlong_number); } offset += 8; } if (short_number <= 13) { if (type_id) { *type_id = short_number; } } else { if (type_id) { *type_id = longlong_number; } } return offset; } static gint rtps_util_add_type_annotation_usage(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, gint zero) { guint32 long_number, i; guint16 short_number; offset = rtps_util_add_type_id(tree, tvb, offset, encoding, zero, -1, NULL, NULL); long_number = tvb_get_guint32(tvb, offset, encoding); offset += 4; for (i = 0; i < long_number; i++) { proto_tree_add_item(tree, hf_rtps_type_object_member_id, tvb, offset, 4, encoding); offset += 4; short_number = tvb_get_guint16(tvb, offset, encoding); proto_tree_add_item(tree, hf_rtps_type_object_annotation_value_d, tvb, offset, 2, encoding); offset += 2; /* There may be more additions in the future */ switch (short_number) { case 4: /* UINT_16 */ proto_tree_add_item(tree, hf_rtps_type_object_annotation_value_16, tvb, offset, 2, encoding); offset += 2; break; default: break; } } return offset; } static gint rtps_util_add_type_library_type(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info *info) { proto_tree * annotation_tree; guint32 member_id = 0, member_length = 0, long_number, i; gint offset_tmp; guint16 short_number; gchar * name = NULL; rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; /* dissect property */ short_number = tvb_get_guint16(tvb, offset_tmp, encoding); proto_tree_add_bitmask_value(tree, tvb, offset_tmp, hf_rtps_type_object_flags, ett_rtps_flags, TYPE_FLAG_FLAGS, short_number); if (info) { if (short_number & 0x02) info->extensibility = EXTENSIBILITY_MUTABLE; else if (short_number & 0x01) info->extensibility = EXTENSIBILITY_FINAL; else info->extensibility = EXTENSIBILITY_EXTENSIBLE; } offset_tmp += 2; if (info) offset_tmp = rtps_util_add_type_id(tree, tvb, offset_tmp, encoding, offset, -1, tree, &(info->type_id)); else offset_tmp = rtps_util_add_type_id(tree, tvb, offset_tmp, encoding, offset, -1, tree, NULL); rtps_util_add_string(tree, tvb, offset_tmp, hf_rtps_type_object_type_property_name, encoding); long_number = tvb_get_guint32(tvb, offset_tmp, encoding); name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII); if (info) (void) g_strlcpy(info->member_name, name, sizeof(info->member_name)); proto_item_append_text(tree, " %s", name); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; /* dissect annotation_seq */ long_number = tvb_get_guint32(tvb, offset_tmp, encoding); annotation_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length, ett_rtps_type_annotation_usage_list, NULL, "Annotation Usage Member List (%d elements)", long_number); offset_tmp += 4; for (i = 0; i < long_number ; i++) { offset_tmp = rtps_util_add_type_annotation_usage(annotation_tree, tvb, offset_tmp, encoding, offset); } offset = check_offset_addition(offset, member_length, tree, NULL, tvb); return offset; } static void rtps_util_add_type_element_enumeration(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info) { proto_tree * enumerated_constant; guint32 member_id = 0, member_length = 0; guint32 long_number, i; gint enum_size, offset_tmp; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); /* dissect Bound */ proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); /* dissect constant seq */ offset_tmp = offset; long_number = tvb_get_guint32(tvb, offset_tmp, encoding); offset_tmp += 4; for (i = 0; i < long_number; i++) { gchar * name = NULL; guint32 size, value; enum_size = offset_tmp; size = tvb_get_guint32(tvb, offset_tmp + 4, encoding); name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp + 8, size, ENC_ASCII); value = tvb_get_guint32(tvb, offset_tmp, encoding); enumerated_constant = proto_tree_add_subtree_format(tree, tvb, offset_tmp, 0, ett_rtps_type_enum_constant, NULL, "%s (%u)", name, value); proto_tree_add_item(enumerated_constant, hf_rtps_type_object_enum_constant_value, tvb, offset_tmp, 4, encoding); offset_tmp += 4; offset_tmp = rtps_util_add_string(enumerated_constant, tvb, offset_tmp, hf_rtps_type_object_enum_constant_name, encoding); proto_item_set_len(enumerated_constant, offset_tmp - enum_size); } info->num_elements = 0; } static void rtps_util_add_type_element_sequence(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info) { guint32 member_id = 0, member_length = 0; gint zero_alignment; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); zero_alignment = offset; rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1 , NULL, &(info->base_type_id)); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); /* dissect Bound */ proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding); if (info) info->bound = tvb_get_gint32(tvb, offset, encoding); } static void rtps_util_add_type_element_string(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info _U_) { guint32 member_id = 0, member_length = 0; gint zero_alignment; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); zero_alignment = offset; rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1, NULL, NULL); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); /* dissect Bound */ proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); } static void rtps_util_add_type_element_array(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info _U_) { proto_tree * bound_tree; guint32 member_id = 0, member_length = 0; guint32 long_number, i; gint zero_alignment, offset_tmp; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); /* Dissect Collection Type */ rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); zero_alignment = offset; rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1, NULL, &(info->base_type_id)); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); /* dissect Bound sequence */ offset_tmp = offset; long_number = tvb_get_guint32(tvb, offset_tmp, encoding); bound_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length, ett_rtps_type_bound_list, NULL, "Bounds (%d elements)", long_number); offset_tmp += 4; for (i = 0; i < long_number ; i++) { proto_tree_add_item(bound_tree, hf_rtps_type_object_bound, tvb, offset_tmp, 4, encoding); if (info) info->bound = tvb_get_gint32(tvb, offset_tmp, encoding); if (info) info->num_elements = tvb_get_gint32(tvb, offset_tmp, encoding); offset_tmp += 4; } } static void rtps_util_add_type_element_alias(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info) { guint32 member_id = 0, member_length = 0; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); /* dissect base_type */ rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); rtps_util_add_type_id(tree, tvb, offset, encoding, offset, hf_rtps_type_object_base_type, NULL, &(info->base_type_id)); } static gint rtps_util_add_type_member(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info, dissection_element * member_object) { proto_tree * member_property, *annotation_tree; guint32 member_id = 0, member_length = 0; guint32 long_number, i; guint16 short_number; guint64 member_type_id; gint offset_tmp; gchar * name = NULL; member_property = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rtps_type_element, NULL, "Member Property"); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; short_number = tvb_get_guint16(tvb, offset_tmp, encoding); proto_tree_add_bitmask_value(member_property, tvb, offset_tmp, hf_rtps_type_object_flags, ett_rtps_flags, MEMBER_FLAGS, short_number); if (member_object) member_object->flags = short_number; offset_tmp += 2; ALIGN_ZERO(offset_tmp, 4, offset); proto_tree_add_item(member_property, hf_rtps_type_object_member_id, tvb, offset_tmp, 4, encoding); member_id = tvb_get_guint32(tvb, offset_tmp, encoding); offset_tmp += 4; offset_tmp = rtps_util_add_type_id(member_property, tvb, offset_tmp, encoding, offset, -1, tree, &member_type_id); rtps_util_add_string(member_property, tvb, offset_tmp, hf_rtps_type_object_name, encoding); long_number = tvb_get_guint32(tvb, offset_tmp, encoding); name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII); proto_item_append_text(tree, " %s (ID: %d)", name, member_id); if (member_object) { member_object->member_id = member_id; (void) g_strlcpy(member_object->member_name, name, sizeof(member_object->member_name)); member_object->type_id = member_type_id; } if (info && info->extensibility == EXTENSIBILITY_MUTABLE) { mutable_member_mapping * mutable_mapping = NULL; mutable_mapping = wmem_new(wmem_file_scope(), mutable_member_mapping); (void) g_strlcpy(mutable_mapping->member_name, name, sizeof(mutable_mapping->member_name)); mutable_mapping->struct_type_id = info->type_id; mutable_mapping->member_type_id = member_type_id; mutable_mapping->member_id = member_id; mutable_mapping->key = (mutable_mapping->struct_type_id + mutable_mapping->struct_type_id * mutable_mapping->member_id); proto_item_append_text(tree, "(Inserted 0x%016" PRIx64 " from 0x%016" PRIx64 ")", mutable_mapping->key, mutable_mapping->struct_type_id); wmem_map_insert(mutable_member_mappings, &(mutable_mapping->key), (void *) mutable_mapping); } offset = check_offset_addition(offset, member_length, tree, NULL, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; long_number = tvb_get_guint32(tvb, offset_tmp, encoding); annotation_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length, ett_rtps_type_annotation_usage_list, NULL, "Annotation Usage Member List (%d elements)", long_number); offset_tmp += 4; for (i = 0; i < long_number ; i++) { offset_tmp = rtps_util_add_type_annotation_usage(annotation_tree, tvb, offset_tmp, encoding, offset); } offset = check_offset_addition(offset, member_length, tree, NULL, tvb); long_number = tvb_get_guint32(tvb, offset, encoding); if ((long_number & PID_LIST_END) == PID_LIST_END) { offset += 4; } return offset; } static gint rtps_util_add_type_union_member(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, guint64 union_type_id, gboolean is_discriminator, dissection_info * info _U_) { proto_tree * labels; gint long_number, i; gint offset_tmp; guint32 member_id = 0, member_length = 0; dissection_element object; offset = rtps_util_add_type_member(tree, tvb, offset, encoding, NULL, &object); //&(info->elements[i]) rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; long_number = tvb_get_guint32(tvb, offset_tmp, encoding); labels = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length, ett_rtps_type_enum_constant, NULL, "Labels (%u elements)", long_number); offset_tmp += 4; if ((object.flags & 8) == 8) { union_member_mapping * mapping = NULL; mapping = wmem_new(wmem_file_scope(), union_member_mapping); (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name)); mapping->member_type_id = object.type_id; mapping->discriminator = HASHMAP_DISCRIMINATOR_CONSTANT; mapping->union_type_id = union_type_id + mapping->discriminator; wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping); proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s", mapping->union_type_id, mapping->member_name); } if (is_discriminator) { union_member_mapping * mapping = NULL; mapping = wmem_new(wmem_file_scope(), union_member_mapping); (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name)); mapping->member_type_id = object.type_id; mapping->discriminator = -1; mapping->union_type_id = union_type_id + mapping->discriminator; wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping); proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s", mapping->union_type_id, mapping->member_name); } for (i = 0; i < long_number; i++) { proto_item * ti; union_member_mapping * mapping = NULL; guint32 discriminator_case; mapping = wmem_new(wmem_file_scope(), union_member_mapping); discriminator_case = tvb_get_guint32(tvb, offset_tmp, encoding); ti = proto_tree_add_item(labels, hf_rtps_type_object_union_label, tvb, offset_tmp, 4, encoding); offset_tmp += 4; (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name)); mapping->member_type_id = object.type_id; mapping->discriminator = discriminator_case; mapping->union_type_id = union_type_id + discriminator_case; wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping); proto_item_append_text(ti, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s", mapping->union_type_id, mapping->member_name); } offset = check_offset_addition(offset, member_length, tree, NULL, tvb); long_number = tvb_get_guint32(tvb, offset_tmp, encoding); if ((long_number & PID_LIST_END) == PID_LIST_END) { offset += 4; } return offset; } static void rtps_util_add_type_element_union(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info) { proto_tree * members; guint32 member_id = 0, member_length = 0; guint32 long_number, i; gint offset_tmp; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; long_number = tvb_get_guint32(tvb, offset_tmp, encoding); members = proto_tree_add_subtree(tree, tvb, offset_tmp, -1, ett_rtps_type_enum_constant, NULL, "Members"); offset_tmp += 4; for (i = 0; i < long_number; i++) { proto_tree * member = NULL; gint offset_member = offset_tmp; member = proto_tree_add_subtree(members, tvb, offset_tmp, 0, ett_rtps_type_enum_constant, NULL, "Member"); offset_tmp = rtps_util_add_type_union_member(member, tvb, offset_tmp, encoding, info->type_id, (i == 0), info); proto_item_set_len(member, offset_tmp - offset_member); } long_number = tvb_get_guint32(tvb, offset_tmp, encoding); if ((long_number & PID_LIST_END) == PID_LIST_END) { offset_tmp += 4; } proto_item_set_len(members, offset_tmp - offset); } static void rtps_util_add_type_element_struct(proto_tree *tree, tvbuff_t * tvb, gint offset, const guint encoding, dissection_info * info) { proto_tree * member; guint32 member_id = 0, member_length = 0; guint32 long_number, i; gint offset_tmp, member_size; wmem_array_t *elements = NULL; dissection_element zero_element = {0}; offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info); /* dissect base_type */ rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset = rtps_util_add_type_id(tree, tvb, offset, encoding, offset, hf_rtps_type_object_base_type, NULL, &(info->base_type_id)); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); /* dissect seq_member*/ offset_tmp = offset; long_number = tvb_get_guint32(tvb, offset_tmp, encoding); offset_tmp += 4; if (info) { elements = wmem_array_sized_new(wmem_file_scope(), sizeof(dissection_element), MIN(long_number, DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE)); } for (i = 0; i < long_number; i++) { member_size = offset_tmp; member = proto_tree_add_subtree(tree, tvb, offset_tmp, 0, ett_rtps_type_enum_constant, NULL, ""); if (info && elements) { wmem_array_append_one(elements, zero_element); offset_tmp = rtps_util_add_type_member(member, tvb, offset_tmp, encoding, info, wmem_array_index(elements, i)); } else { offset_tmp = rtps_util_add_type_member(member, tvb, offset_tmp, encoding, NULL, NULL); } proto_item_set_len(member, offset_tmp - member_size); } if (info) { info->num_elements = wmem_array_get_count(elements); info->elements = wmem_array_finalize(elements); } } static void rtps_util_add_type_library(proto_tree *tree, packet_info * pinfo, tvbuff_t * tvb, gint offset, const guint encoding, guint32 size); static void rtps_util_add_type_element_module(proto_tree *tree, packet_info * pinfo, tvbuff_t * tvb, gint offset, const guint encoding) { guint32 long_number; gchar * name = NULL; long_number = tvb_get_guint32(tvb, offset, encoding); name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, long_number, ENC_ASCII); proto_item_set_text(tree, "module %s", name); offset = rtps_util_add_string(tree, tvb, offset, hf_rtps_type_object_element_module_name, encoding); rtps_util_add_type_library(tree, pinfo, tvb, offset, encoding, -1); } static gint rtps_util_add_type_library_element(proto_tree *tree, packet_info * pinfo, tvbuff_t * tvb, gint offset, const guint encoding) { proto_tree * element_tree; guint32 long_number; guint32 member_id = 0, member_length = 0; gint initial_offset = offset; dissection_info * info; gboolean add_info = TRUE; info = wmem_new(wmem_file_scope(), dissection_info); info->elements = NULL; rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); long_number = tvb_get_guint32(tvb, offset, encoding); info->member_kind = long_number; element_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rtps_type_element, NULL, ""); offset = check_offset_addition(offset, member_length, tree, pinfo, tvb); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); proto_item_set_len(element_tree, member_length + offset - initial_offset); switch (long_number) { case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE: /*ENUMERATION */ rtps_util_add_type_element_enumeration(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE: /* ALIAS */ rtps_util_add_type_element_alias(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE: /* ARRAY */ rtps_util_add_type_element_array(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE: /* SEQUENCE */ rtps_util_add_type_element_sequence(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE: /* STRING : COLLECTION */ rtps_util_add_type_element_string(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE: rtps_util_add_type_element_union(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE: /* STRUCT */ rtps_util_add_type_element_struct(element_tree, tvb, offset, encoding, info); break; case RTI_CDR_TYPE_OBJECT_TYPE_KIND_MODULE: /* This does *not* fill in the info structure, so do *not* add it. */ add_info = FALSE; rtps_util_add_type_element_module(element_tree, pinfo, tvb, offset, encoding); break; default: /* We have *not* filled in the info structure, so do *not* add it. */ add_info = FALSE; proto_item_append_text(element_tree, "Kind: %u", long_number); proto_tree_add_item(element_tree, hf_rtps_type_object_element_raw, tvb, offset, member_length, encoding); break; } offset = check_offset_addition(offset, member_length, tree, NULL, tvb); LONG_ALIGN(offset); long_number = tvb_get_guint32(tvb, offset, encoding); if ((long_number & PID_LIST_END) != PID_LIST_END) { expert_add_info_format(pinfo, element_tree, &ei_rtps_parameter_value_invalid, "Now it should be PID_LIST_END and it is not"); \ } offset += 4; proto_item_set_len(element_tree, offset - initial_offset); if (add_info) { wmem_map_insert(dissection_infos, &(info->type_id), (void *) info); } return offset; } static void rtps_util_add_type_library(proto_tree *tree, packet_info * pinfo, tvbuff_t * tvb, gint offset, const guint encoding, guint32 size) { proto_tree * library_tree; guint32 long_number, i; long_number = tvb_get_guint32(tvb, offset, encoding); library_tree = proto_tree_add_subtree_format(tree, tvb, offset, size, ett_rtps_type_library, NULL, "Type Library (%d elements)", long_number); offset += 4; for (i = 0; i < long_number; i++) { offset = rtps_util_add_type_library_element(library_tree, pinfo, tvb, offset, encoding); } } static void rtps_util_add_typeobject(proto_tree *tree, packet_info * pinfo, tvbuff_t * tvb, gint offset, const guint encoding, guint32 size, type_mapping * type_mapping_object ) { proto_tree * typeobject_tree; gint offset_tmp = 0; guint32 member_id = 0, member_length = 0; guint32 long_number; guint64 type_id; typeobject_tree = proto_tree_add_subtree(tree, tvb, offset, size, ett_rtps_type_object, NULL, "Type Object"); /* --- This is the standard parameterized serialization --- */ /* TypeLibrary */ rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; /* Dissect the member */ rtps_util_add_type_library(typeobject_tree, pinfo, tvb, offset_tmp, encoding, member_length); offset = check_offset_addition(offset, member_length, tree, pinfo, tvb); /* End TypeLibrary */ /* _TypeId */ rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_tmp = offset; /* Dissect the member. In this case, the typeid is an union with a short * as a discriminator*/ rtps_util_add_type_id(typeobject_tree, tvb, offset_tmp, encoding, offset, -1, NULL, &type_id); if (type_mapping_object) type_mapping_object->type_id = type_id; offset = check_offset_addition(offset, member_length, tree, pinfo, tvb); /* End _TypeId */ long_number = tvb_get_guint32(tvb, offset, encoding); if ((long_number & PID_LIST_END) != PID_LIST_END) { expert_add_info_format(pinfo, typeobject_tree, &ei_rtps_parameter_value_invalid, "This should be PID_LIST_END and it is not"); \ } } #ifdef HAVE_ZLIB static void rtps_add_zlib_compressed_typeobject(proto_tree *tree, packet_info * pinfo, tvbuff_t * tvb, gint offset, const guint encoding, guint compressed_size, guint decompressed_size, type_mapping * type_mapping_object) { tvbuff_t *decompressed_data_child_tvb; tvbuff_t *compressed_type_object_subset; proto_tree *decompressed_type_object_subtree; compressed_type_object_subset = tvb_new_subset_length(tvb, offset, decompressed_size); decompressed_data_child_tvb = tvb_child_uncompress(tvb, compressed_type_object_subset, 0, compressed_size); if (decompressed_data_child_tvb) { decompressed_type_object_subtree = proto_tree_add_subtree(tree, decompressed_data_child_tvb, 0, 0, ett_rtps_decompressed_type_object, NULL, "[Uncompressed type object]"); rtps_util_add_typeobject(decompressed_type_object_subtree, pinfo, decompressed_data_child_tvb, 0, encoding, decompressed_size, type_mapping_object); } else { proto_tree_add_subtree(tree, compressed_type_object_subset, 0, 0, ett_rtps_decompressed_type_object, NULL, "[Failed to decompress type object]"); } } #else static void rtps_add_zlib_compressed_typeobject(proto_tree *tree _U_, packet_info * pinfo _U_, tvbuff_t * tvb _U_, gint offset _U_, const guint encoding _U_, guint compressed_size _U_, guint decompressed_size _U_, type_mapping * type_mapping_object _U_) { } #endif /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Sequence of * Octets. * The formatted buffer is: [ 0x01, 0x02, 0x03, 0x04, ...] * The maximum number of elements displayed is 10, after that a '...' is * inserted. */ static gint rtps_util_add_seq_octets(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, int param_length, int hf_id) { guint32 seq_length; proto_item *ti; ti = proto_tree_add_item_ret_uint(tree, hf_rtps_sequence_size, tvb, offset, 4, encoding, &seq_length); offset += 4; /* param length -1 means not specified */ if (param_length != -1 && param_length < 4 + (int)seq_length) { expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "ERROR: Parameter value too small"); return offset + seq_length; } if (seq_length) { proto_tree_add_item(tree, hf_id, tvb, offset, seq_length, ENC_NA); } return offset + seq_length; } static gint rtps_util_add_data_holder(proto_tree *tree, tvbuff_t * tvb, packet_info * pinfo, gint offset, const guint encoding, gint seq_index, gint alignment_zero) { proto_tree * data_holder_tree, * properties_tree, * property_tree; proto_item * tii, * ti, * data_holder; guint32 seq_size, i; gint offset_tmp, data_holder_begin; data_holder_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_data_holder, &data_holder, "Data Holder [%d]", seq_index); data_holder_begin = offset; offset = rtps_util_add_string(data_holder_tree, tvb, offset, hf_rtps_pgm_data_holder_class_id, encoding); LONG_ALIGN_ZERO(offset, alignment_zero); offset_tmp = offset; properties_tree = proto_tree_add_subtree_format(data_holder_tree, tvb, offset, -1, ett_rtps_data_holder_properties, &tii, "String Properties"); seq_size = tvb_get_guint32(tvb, offset, encoding); offset += 4; for(i = 0; i < seq_size; i++) { gint local_offset = offset; property_tree = proto_tree_add_subtree_format(properties_tree, tvb, offset, -1, ett_rtps_property_tree, &ti, "Property [%d]", i); offset = rtps_util_add_string(property_tree, tvb, offset, hf_rtps_property_name, encoding); offset = rtps_util_add_string(property_tree, tvb, offset, hf_rtps_property_value, encoding); proto_item_set_len(ti, offset - local_offset); } proto_item_set_len(tii, offset - offset_tmp); offset_tmp = offset; properties_tree = proto_tree_add_subtree_format(data_holder_tree, tvb, offset, -1, ett_rtps_data_holder_properties, &tii, "Binary Properties"); seq_size = tvb_get_guint32(tvb, offset, encoding); offset += 4; for(i = 0; i < seq_size; i++) { gint local_offset = offset; LONG_ALIGN(offset); property_tree = proto_tree_add_subtree_format(properties_tree, tvb, offset, -1, ett_rtps_property_tree, &ti, "Property [%d]", i); offset = rtps_util_add_string(property_tree, tvb, offset, hf_rtps_property_name, encoding); offset = rtps_util_add_seq_octets(property_tree, pinfo, tvb, offset, encoding, -1, hf_rtps_param_user_data); proto_item_set_len(ti, offset - local_offset); } proto_item_set_len(tii, offset - offset_tmp); proto_item_set_len(data_holder, offset - offset_tmp); proto_item_set_len(data_holder, offset - data_holder_begin); return offset; } static gint rtps_util_add_data_holder_seq(proto_tree *tree, tvbuff_t * tvb, packet_info * pinfo, gint offset, const guint encoding, gint alignment_zero) { proto_tree * data_holder_seq_tree; proto_item * ti; guint32 seq_length; guint32 i; data_holder_seq_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_data_holder_seq, &ti, "Data Holder Sequence"); seq_length = tvb_get_guint32(tvb, offset, encoding); offset += 4; for(i = 0; i < seq_length; i++) { offset = rtps_util_add_data_holder(data_holder_seq_tree, tvb, pinfo, offset, encoding, i, alignment_zero); } return offset; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as a Bitmap * struct { * SequenceNumber_t bitmapBase; * sequence<long, 8> bitmap; * } SequenceNumberSet; * * Returns the new offset after reading the bitmap. */ static int rtps_util_add_bitmap(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, const char *label, gboolean show_analysis) { gint32 num_bits; guint32 data; wmem_strbuf_t *temp_buff = wmem_strbuf_create(wmem_packet_scope()); wmem_strbuf_t *analysis_buff = wmem_strbuf_create(wmem_packet_scope()); gint i, j, idx; gchar *last_one; proto_item *ti = NULL, *ti_tree = NULL; proto_tree *bitmap_tree; const gint original_offset = offset; guint32 datamask; guint64 first_seq_number; gboolean first_nack = TRUE; bitmap_tree = proto_tree_add_subtree(tree, tvb, original_offset, offset-original_offset, ett_rtps_bitmap, &ti_tree, label); /* Bitmap base sequence number */ first_seq_number = rtps_util_add_seq_number(bitmap_tree, tvb, offset, encoding, "bitmapBase"); offset += 8; /* Reads the bitmap size */ proto_tree_add_item_ret_uint(bitmap_tree, hf_rtps_bitmap_num_bits, tvb, offset, 4, encoding, &num_bits); offset += 4; /* bitmap base 0 means that this is a preemptive ACKNACK */ if (first_seq_number == 0 && show_analysis) { ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0, 1, "Acknack Analysis: Preemptive ACKNACK"); proto_item_set_generated(ti); } if (first_seq_number > 0 && num_bits == 0 && show_analysis) { ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0, 2, "Acknack Analysis: Expecting sample %" PRIu64, first_seq_number); proto_item_set_generated(ti); } if (num_bits > 0 && show_analysis) { ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0, 3, "Acknack Analysis: Lost samples"); proto_item_set_generated(ti); } /* Reads the bits (and format the print buffer) */ idx = 0; for (i = 0; i < num_bits; i += 32) { data = tvb_get_guint32(tvb, offset, encoding); offset += 4; for (j = 0; j < 32; ++j) { datamask = (1U << (31-j)); wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); if ((data & datamask) == datamask) { proto_item_append_text(ti, first_nack ? " %" PRIu64 : ", %" PRIu64, first_seq_number + idx); first_nack = FALSE; } ++idx; if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) { break; } } } /* removes all the ending '0' */ last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1'); if (last_one) { wmem_strbuf_truncate(temp_buff, (gsize) (last_one - wmem_strbuf_get_str(temp_buff)) + 1); } if (wmem_strbuf_get_len(temp_buff) > 0) { proto_tree_add_bytes_format_value(bitmap_tree, hf_rtps_bitmap, tvb, original_offset + 12, offset - original_offset - 12, NULL, "%s", wmem_strbuf_get_str(temp_buff)); } proto_item_set_len(ti_tree, offset-original_offset); /* Add analysis of the information */ if (num_bits > 0 && show_analysis) { proto_item_append_text(ti, "%s in range [%" PRIu64 ",%" PRIu64 "]", wmem_strbuf_get_str(analysis_buff), first_seq_number, first_seq_number + num_bits - 1); } return offset; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as a FragmentNumberSet * typedef unsigned long FragmentNumber_t; * struct { * FragmentNumber_t bitmapBase; * sequence<FragmentNumber_t> bitmap; * } FragmentNumberSet; * * Returns the new offset after reading the bitmap. */ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, const char *label, gint section_size) { guint64 base; gint32 num_bits; guint32 data; wmem_strbuf_t *temp_buff = wmem_strbuf_create(wmem_packet_scope()); gchar *last_one; int i, j, idx; proto_item *ti; proto_tree *bitmap_tree; const gint original_offset = offset; guint32 datamask; gint expected_size; gint base_size; bitmap_tree = proto_tree_add_subtree(tree, tvb, original_offset, offset-original_offset, ett_rtps_bitmap, &ti, label); /* RTI DDS 4.2d was sending the FragmentNumber_t as a 64-bit long integer * instead of 32-bit long. * Attempt to decode this section as 32-bit, then check if the size of the * message match what is here. If not re-decode it as 64-bit. */ num_bits = tvb_get_guint32(tvb, offset+4, encoding); expected_size = ((num_bits + 31) / 32) * 4 + 8; if (expected_size == section_size) { base = (guint64)tvb_get_guint32(tvb, offset, encoding); base_size = 4; offset += 8; } else { /* Attempt to use 64-bit for base */ num_bits = tvb_get_guint32(tvb, offset+8, encoding); /* num_bits/8 must be aligned to the 4-byte word */ expected_size = (((num_bits / 8) + 3) / 4) * 4 + 12; if (expected_size == section_size) { guint64 hi = (guint64)tvb_get_guint32(tvb, offset, encoding); guint64 lo = (guint64)tvb_get_guint32(tvb, offset+4, encoding); base = (hi << 32) | lo; base_size = 8; offset += 12; } else { /* size don't match, packet error */ expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Illegal size for fragment number set"); return -1; } } /* Reads the bits (and format the print buffer) */ idx = 0; for (i = 0; i < num_bits; i += 32) { data = tvb_get_guint32(tvb, offset, encoding); offset += 4; for (j = 0; j < 32; ++j) { datamask = (1U << (31-j)); wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); ++idx; if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) { break; } } } /* removes all the ending '0' */ last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1'); if (last_one) { wmem_strbuf_truncate(temp_buff, (gsize) (last_one - wmem_strbuf_get_str(temp_buff))); } if (base_size == 8) { proto_tree_add_uint64(bitmap_tree, hf_rtps_fragment_number_base64, tvb, original_offset, 8, base); } else { proto_tree_add_item(bitmap_tree, hf_rtps_fragment_number_base, tvb, original_offset, base_size, encoding); } proto_tree_add_uint(bitmap_tree, hf_rtps_fragment_number_num_bits, tvb, original_offset + base_size, 4, num_bits); if (wmem_strbuf_get_len(temp_buff) > 0) { proto_tree_add_bytes_format_value(bitmap_tree, hf_rtps_bitmap, tvb, original_offset + base_size + 4, offset - original_offset - base_size - 4, NULL, "%s", wmem_strbuf_get_str(temp_buff)); } proto_item_set_len(ti, offset-original_offset); return offset; } static void rtps_util_insert_type_mapping_in_registry(packet_info *pinfo, type_mapping *type_mapping_object) { if (type_mapping_object) { if ((type_mapping_object->fields_visited & TOPIC_INFO_ALL_SET) == TOPIC_INFO_ALL_SET && type_mapping_object->guid.fields_present == GUID_HAS_ALL && !wmem_map_lookup(registry, &(type_mapping_object->guid))) { if (((type_mapping_object->guid.entity_id & 0x02) == 0x02) || ((type_mapping_object->guid.entity_id & 0x04) == 0x04)){ /* If it is an application defined writer matches 0x02. Matches 0x04 if it is an application defined reader */ type_mapping_object->dcps_publication_frame_number = pinfo->num; wmem_map_insert(registry, &(type_mapping_object->guid), type_mapping_object); } } } } static void rtps_util_store_type_mapping(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset, type_mapping * type_mapping_object, const gchar * value, gint topic_info_add_id) { if (enable_topic_info && type_mapping_object) { switch (topic_info_add_id) { case TOPIC_INFO_ADD_GUID: { type_mapping_object->guid.host_id = tvb_get_ntohl(tvb, offset); type_mapping_object->guid.app_id = tvb_get_ntohl(tvb, offset+4); type_mapping_object->guid.instance_id = tvb_get_ntohl(tvb, offset+8); type_mapping_object->guid.entity_id = tvb_get_ntohl(tvb, offset+12); type_mapping_object->guid.fields_present |= GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID|GUID_HAS_ENTITY_ID; type_mapping_object->fields_visited = type_mapping_object->fields_visited | TOPIC_INFO_ADD_GUID; break; } case TOPIC_INFO_ADD_TOPIC_NAME: { (void) g_strlcpy(type_mapping_object->topic_name, value, MAX_TOPIC_AND_TYPE_LENGTH); type_mapping_object->fields_visited = type_mapping_object->fields_visited | TOPIC_INFO_ADD_TOPIC_NAME; break; } case TOPIC_INFO_ADD_TYPE_NAME: { (void) g_strlcpy(type_mapping_object->type_name, value, MAX_TOPIC_AND_TYPE_LENGTH); type_mapping_object->fields_visited = type_mapping_object->fields_visited | TOPIC_INFO_ADD_TYPE_NAME; break; } default: break; } } } static guint hash_by_participant_guid(gconstpointer key) { const endpoint_guid* guid = (const endpoint_guid*)key; gint vals[] = { guid->host_id, guid->app_id, guid->instance_id }; GBytes* gbytes = g_bytes_new(vals, sizeof(vals)); return g_bytes_hash(gbytes); } static guint hash_by_guid(gconstpointer key) { const endpoint_guid * guid = (const endpoint_guid *) key; DISSECTOR_ASSERT(guid->fields_present & GUID_HAS_APP_ID); return g_int_hash(&(guid->app_id)); } static gboolean compare_by_guid(gconstpointer guid_a, gconstpointer guid_b) { return memcmp(guid_a, guid_b, sizeof(endpoint_guid)) == 0; } static gboolean compare_by_participant_guid(gconstpointer guid_a, gconstpointer guid_b) { const endpoint_guid* a = (const endpoint_guid*)guid_a; const endpoint_guid* b = (const endpoint_guid*)guid_b; return ((a->host_id == b->host_id) && (a->app_id == b->app_id) && (a->instance_id == b->instance_id)); } static guint get_domain_id_from_tcp_discovered_participants(wmem_map_t *map, endpoint_guid* key) { participant_info *p_info = (participant_info*)wmem_map_lookup(map, (void*)key); return (p_info != NULL) ? p_info->domainId: RTPS_UNKNOWN_DOMAIN_ID_VAL; } static guint coherent_set_key_hash_by_key(gconstpointer key) { return wmem_strong_hash((const guint8 *)key, sizeof(coherent_set_key)); } static gboolean compare_by_coherent_set_key(gconstpointer key_a, gconstpointer key_b) { return memcmp(key_a, key_b, sizeof(coherent_set_key)) == 0; } static type_mapping * rtps_util_get_topic_info(endpoint_guid * guid) { /* At this point, we know the boolean enable_topic_info is true */ type_mapping * result = NULL; if (guid) { guint entity_id_low = 0xFF & guid->entity_id; /* If the entity guid low is ENTITYID_NORMAL_META_GROUP_READER or ENTITYID_NORMAL_META_GROUP_WRITER then * is a builtin endpoint that uses the type InstaneStateResponseData. The type_mapping for this type is not * available through discovery. It is defined by code in * initialize_instance_state_data_response_dissection_info function. */ if (entity_id_low == ENTITYID_NORMAL_META_GROUP_READER || entity_id_low == ENTITYID_NORMAL_META_GROUP_WRITER) { result = &builtin_types_dissection_data.type_mappings.instance_state_data_response_type_mapping; } else if (guid->fields_present == GUID_HAS_ALL) result = (type_mapping *)wmem_map_lookup(registry, guid); } return result; } static void rtps_util_format_typename(gchar * type_name, gchar ** output) { gchar ** tokens; gchar * result_caps; /* The standard specifies that the max size of a type name can be 255 bytes */ tokens = wmem_strsplit(wmem_packet_scope(), type_name, "::", 255); result_caps = wmem_strjoinv(wmem_packet_scope(), "_", tokens); *output = wmem_ascii_strdown(wmem_packet_scope(), result_caps, -1); } /* Adds the topic topic information to the tree and the topic name to the info column. * Topic name will be added to the info column only if the topic information is stored * in the "registry map". * This is used when the packet doesn't contain the topic information (PID_TOPIC_INFORMATION) */ static const char* rtps_util_add_topic_info(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, gint offset, endpoint_guid * guid) { const char* topic_name = NULL; if (enable_topic_info) { proto_tree * topic_info_tree; proto_item * ti; gboolean is_builtin_type = FALSE; type_mapping * type_mapping_object = rtps_util_get_topic_info(guid); /* If it is a builtin type mapping then the information is not taken from discovery data */ is_builtin_type = (type_mapping_object == &builtin_types_dissection_data.type_mappings.instance_state_data_response_type_mapping); if (type_mapping_object != NULL) { const gchar* topic_information_text = (!is_builtin_type) ? "[Topic Information (from Discovery)]" : "[Topic Information (BuiltIn type)]"; topic_name = type_mapping_object->topic_name; if (topic_name != NULL) { submessage_col_info* current_submessage_col_info = NULL; topic_info_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rtps_topic_info, NULL, topic_information_text); ti = proto_tree_add_string(topic_info_tree, hf_rtps_param_type_name, tvb, offset, 0, type_mapping_object->type_name); proto_item_set_generated(ti); if (!is_builtin_type) { ti = proto_tree_add_string(topic_info_tree, hf_rtps_param_topic_name, tvb, offset, 0, topic_name); proto_item_set_generated(ti); ti = proto_tree_add_uint(topic_info_tree, hf_rtps_dcps_publication_data_frame_number, tvb, 0, 0, type_mapping_object->dcps_publication_frame_number); } proto_item_set_generated(ti); current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY); if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) { current_submessage_col_info->topic_name = wmem_strdup(pinfo->pool, topic_name); } } } } return topic_name; } /* Uncompress data and returns it uncompressed on a new tvb. * * @param[in] tree a chunk of data in the tvb and return a new tvb with the uncompressed data * @param[in] tvb * @param[in] offset offset at the begining of the compressed data. * @param[in] size in bytes from the initial offset to the end of the serialized data * @param[in] compressed_size size in bytes of the compressed chunk in the tvb. * @param[out] True if it tries to uncompress the data. In environment where Zlib is not available this will be false. This is used for * distinguis when the data is not decompressed because Zlib is not available (not warning) and cases where it is but fails (warning). * * @return The uncompressed data on a new TVB if everything goes fine. Otherwise NULL */ static tvbuff_t *rtps_util_get_uncompressed_tvb_zlib( tvbuff_t *tvb _U_, const gint offset _U_, const guint compressed_size _U_, gboolean *tried_to_decompress) { tvbuff_t *uncompressed_tvb = NULL; #ifdef HAVE_ZLIB /* If ZLIB is available always try to decompress. */ *tried_to_decompress = TRUE; uncompressed_tvb = tvb_new_subset_length_caplen(tvb, offset, compressed_size, -1); uncompressed_tvb = tvb_child_uncompress(uncompressed_tvb, uncompressed_tvb, 0, compressed_size); #else *tried_to_decompress = FALSE; #endif return uncompressed_tvb; } /* * 0...2...........8...............16 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | X X X X X X X X X X X | C C C P P | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * X = Unused options bits * C = Compression bits * P = Padding bits * C = 0b111 would be extended compression options which would come in as an * additional header before the payload. * C = 0b000 to indicate no compression */ /* Dissects the encapsultaion options * * @param[in] tree * @param[in] packet info. * @param[in] tvb * @param[in] offset at the begining of the encapsulation options. * @param[out] encapsulation_options_out If not null it will contain the encapsulation options * @param[out] compression_option_out If not null it will contain the compression option * @param[out] padding_bytes_out If not null it will contain the padding bytes * @param[out] extended_header_bits_out If not null it will contain the extended header bits * @return the offset after the encapsulation options * @note All output parameters are optional. */ static gint rtps_util_dissect_encapsulation_options( proto_tree *tree, tvbuff_t *tvb, gint offset, gint16 *encapsulation_options_out, guint8 *compression_options_out, guint8 *padding_bytes_out, guint8 *extended_header_bits_out) { guint8 compression_options = 0; proto_tree *compression_options_subtree = NULL; gint16 encapsulation_options = 0; guint8 padding_bytes = 0; guint8 extended_header_bits = 0; /* Encapsulation length (or option). Always big endian. */ encapsulation_options = tvb_get_gint16(tvb, offset, ENC_BIG_ENDIAN); if (encapsulation_options != 0) { compression_options_subtree = proto_tree_add_subtree_format( tree, tvb, offset, 2, ett_rtps_data_encapsulation_options, NULL, "Encapsulation options (0x%02x)", encapsulation_options); /* If compression options ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE bits are set, the header contains an extra field */ extended_header_bits = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE); GET_ENCAPSULATION_COMPRESSION_OPTIONS(encapsulation_options, compression_options); padding_bytes = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK); proto_tree_add_int( compression_options_subtree, hf_rtps_encapsulation_options_compression_plugin_class_id, tvb, offset + 1, 1, compression_options); proto_tree_add_int( compression_options_subtree, hf_rtps_padding_bytes, tvb, offset + 1, 1, padding_bytes); offset += 2; padding_bytes = encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK; } else { /* Encapsulation length (or option). Always big endian. */ proto_tree_add_item( tree, hf_rtps_param_serialize_encap_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } /* Set the optional outputs */ if (encapsulation_options_out != NULL) { *encapsulation_options_out = encapsulation_options; } if (compression_options_out != NULL) { *compression_options_out = compression_options; } if (padding_bytes_out != NULL) { *padding_bytes_out = padding_bytes; } if (extended_header_bits_out != NULL) { *extended_header_bits_out = extended_header_bits; } return offset; } static gboolean rtps_util_try_dissector(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, endpoint_guid * guid, rtps_dissector_data * data, guint encoding, guint encoding_version, gboolean try_dissection_from_type_object) { if (enable_topic_info) { type_mapping * type_mapping_object = rtps_util_get_topic_info(guid); if (type_mapping_object != NULL) { gchar * dissector_name = NULL; tvbuff_t *next_tvb; dissection_info* info = NULL; if (try_dissection_from_type_object && enable_user_data_dissection) { info = lookup_dissection_info_in_custom_and_builtin_types(type_mapping_object->type_id); if (info != NULL) { proto_item_append_text(tree, " (TypeId: 0x%016" PRIx64 ")", info->type_id); return dissect_user_defined(tree, tvb, offset, encoding, encoding_version, info, info->type_id, info->member_name, EXTENSIBILITY_INVALID, offset, 0 /* flags */, 0 /* member_id */, TRUE); } } /* This part tries to dissect the content using a dissector */ next_tvb = tvb_new_subset_remaining(tvb, offset); rtps_util_format_typename(type_mapping_object->type_name, &dissector_name); return dissector_try_string(rtps_type_name_table, dissector_name, next_tvb, pinfo, tree, data); } } /* Return false so the content is dissected by the codepath following this one */ return FALSE; } static gint rtps_util_add_rti_topic_query_service_request(proto_tree * tree, packet_info *pinfo, tvbuff_t * tvb, gint offset, guint encoding) { /* struct TopicQuerySelection { string filter_class_name; //@Optional 0 string filter_expression; // 1 sequence<string> filter_parameters; }; //@top-level false //@Extensibility MUTABLE_EXTENSIBILITY struct TopicQueryData { TopicQuerySelection topic_query_selection; SequenceNumber_t sync_sequence_number; string topic_name; GUID_t original_related_reader_guid; }; //@top-level false //@Extensibility MUTABLE_EXTENSIBILITY */ proto_tree * topic_query_tree, * topic_query_selection_tree, *topic_query_filter_params_tree; proto_item * ti; guint16 encapsulation_id, encapsulation_opt; guint32 param_id, param_length, param_length_2, num_filter_params; gint alignment_zero, tmp_offset; guint32 i; gchar* topic_name = NULL; gint topic_name_len = 0; topic_query_tree = proto_tree_add_subtree(tree, tvb, offset, 0 /* To be defined */, ett_rtps_topic_query_tree, &ti, "Topic Query Data"); /* Encapsulation Id */ encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */ proto_tree_add_uint(topic_query_tree, hf_rtps_encapsulation_id, tvb, offset, 2, encapsulation_id); offset += 2; encoding = get_encapsulation_endianness(encapsulation_id); /* Encapsulation length (or option) */ encapsulation_opt = tvb_get_ntohs(tvb, offset); /* Always big endian */ proto_tree_add_uint(topic_query_tree, hf_rtps_encapsulation_options, tvb, offset, 2, encapsulation_opt); offset += 2; alignment_zero = offset; rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length); tmp_offset = offset; { /* TopicQuerySelection */ topic_query_selection_tree = proto_tree_add_subtree(topic_query_tree, tvb, tmp_offset, 0 /* To be defined */, ett_rtps_topic_query_selection_tree, &ti, "Topic Query Selection"); SHORT_ALIGN_ZERO(tmp_offset,alignment_zero); rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, &param_id, &param_length_2); if (param_id == 0) { /* Optional string filter_class_name */ LONG_ALIGN_ZERO(tmp_offset, alignment_zero); rtps_util_add_string(topic_query_selection_tree, tvb, tmp_offset, hf_rtps_topic_query_selection_filter_class_name, encoding); } tmp_offset += param_length_2; SHORT_ALIGN_ZERO(tmp_offset,alignment_zero); rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, &param_id, &param_length_2); LONG_ALIGN_ZERO(tmp_offset, alignment_zero); tmp_offset = rtps_util_add_string(topic_query_selection_tree, tvb, tmp_offset, hf_rtps_topic_query_selection_filter_expression, encoding); SHORT_ALIGN_ZERO(tmp_offset,alignment_zero); rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, &param_id, &param_length_2); num_filter_params = tvb_get_guint32(tvb, tmp_offset, encoding); proto_tree_add_item(topic_query_selection_tree, hf_rtps_topic_query_selection_num_parameters, tvb, tmp_offset, 4, encoding); topic_query_filter_params_tree = proto_tree_add_subtree_format(topic_query_selection_tree, tvb, tmp_offset + 4, 0 /* To be defined */, ett_rtps_topic_query_filter_params_tree, &ti, "Filter Parameters (size = %u)", num_filter_params); tmp_offset += 4; for (i = 0; i < num_filter_params; ++i) { guint32 string_size; gchar * retVal; LONG_ALIGN_ZERO(tmp_offset, alignment_zero); string_size = tvb_get_guint32(tvb, tmp_offset, encoding); retVal = tvb_get_string_enc(wmem_packet_scope(), tvb, tmp_offset+4, string_size, ENC_ASCII); proto_tree_add_string_format(topic_query_filter_params_tree, hf_rtps_topic_query_selection_filter_parameter, tvb, tmp_offset, string_size+4, retVal, "%s[%d]: %s", "Filter Parameter", i, retVal); tmp_offset += (4 + string_size); } SHORT_ALIGN_ZERO(tmp_offset, alignment_zero); tmp_offset += 4; proto_tree_add_item(topic_query_selection_tree, hf_rtps_topic_query_selection_kind, tvb, tmp_offset, 4, encoding); } offset = check_offset_addition(offset, param_length, tree, NULL, tvb); SHORT_ALIGN_ZERO(offset,alignment_zero); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length); rtps_util_add_seq_number(topic_query_tree, tvb, offset, encoding, "Sync Sequence Number"); offset = check_offset_addition(offset, param_length, tree, NULL, tvb); SHORT_ALIGN_ZERO(offset,alignment_zero); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length); LONG_ALIGN_ZERO(offset, alignment_zero); topic_name_len = tvb_get_guint32(tvb, offset, encoding); topic_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, topic_name_len, ENC_ASCII); proto_tree_add_string(topic_query_tree, hf_rtps_topic_query_topic_name, tvb, offset, topic_name_len + 4, topic_name); if (topic_name != NULL) { 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); if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) { current_submessage_col_info->topic_name = wmem_strdup(pinfo->pool, topic_name); } } offset = check_offset_addition(offset, param_length, tree, NULL, tvb); SHORT_ALIGN_ZERO(offset,alignment_zero); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length); rtps_util_add_generic_guid_v2(topic_query_tree, tvb, offset, hf_rtps_topic_query_original_related_reader_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset = check_offset_addition(offset, param_length, tree, NULL, tvb); return offset; } static gint rtps_util_add_rti_locator_reachability_service_request(proto_tree * tree, packet_info *pinfo, tvbuff_t * tvb, gint offset, guint encoding) { proto_tree * locator_reachability_tree, * locator_seq_tree; proto_item * ti; guint16 encapsulation_id, encapsulation_opt; guint32 param_id, param_length, seq_length, i; locator_reachability_tree = proto_tree_add_subtree(tree, tvb, offset, 0 /* To be defined */, ett_rtps_locator_reachability_tree, &ti, "Locator Reachability Data"); /* Encapsulation Id */ encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */ proto_tree_add_uint(locator_reachability_tree, hf_rtps_encapsulation_id, tvb, offset, 2, encapsulation_id); offset += 2; encoding = get_encapsulation_endianness(encapsulation_id); /* Encapsulation length (or option) */ encapsulation_opt = tvb_get_ntohs(tvb, offset); /* Always big endian */ proto_tree_add_uint(locator_reachability_tree, hf_rtps_encapsulation_options, tvb, offset, 2, encapsulation_opt); offset += 2; rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length); seq_length = tvb_get_guint32(tvb, offset, encoding); locator_seq_tree = proto_tree_add_subtree_format(locator_reachability_tree, tvb, offset, param_length, ett_rtps_locator_list_tree, &ti, "Locator List [Size = %u]", seq_length); offset += 4; for(i = 0; i < seq_length; i++) { rtps_util_add_locator_t(locator_seq_tree, pinfo, tvb, offset, encoding, "Locator"); offset += 24; } return offset; } static gint rtps_util_add_instance_state_request_data(proto_tree* tree, tvbuff_t* tvb, gint offset, const guint encoding) { proto_tree* instance_state_request_tree = NULL; proto_item* ti = NULL; /* The sum of all fields */ const guint instance_state_request_data_len = 8 + GUID_SIZE + (4 * 3); instance_state_request_tree = proto_tree_add_subtree( tree, tvb, offset, instance_state_request_data_len, ett_rtps_instance_transition_data, &ti, "Instance State Request Data"); rtps_util_add_seq_number(instance_state_request_tree, tvb, offset, encoding, "seqNumber"); offset += 8; rtps_util_add_generic_guid_v2(instance_state_request_tree, tvb, offset, hf_rtps_pgm_dst_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset += GUID_SIZE; proto_tree_add_item(instance_state_request_tree, hf_rtps_writer_group_oid, tvb, offset, 4, encoding); offset += 4; proto_tree_add_item(instance_state_request_tree, hf_rtps_reader_group_oid, tvb, offset, 4, encoding); offset += 4; proto_tree_add_item(instance_state_request_tree, hf_rtps_writer_session_id, tvb, offset, 4, encoding); offset += 4; return offset; } static gint rtps_util_add_rti_service_request(proto_tree * tree, packet_info *pinfo, tvbuff_t * tvb, gint offset, const guint encoding, guint32 service_id) { guint32 *service_id_copy = wmem_alloc(pinfo->pool, sizeof(guint32)); *service_id_copy = service_id; /* This is used in append_status_info for adding the column info */ p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY, (gpointer)service_id_copy); switch (service_id) { case RTI_SERVICE_REQUEST_ID_TOPIC_QUERY: offset = rtps_util_add_rti_topic_query_service_request(tree, pinfo, tvb, offset + 4, encoding); break; case RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY: offset = rtps_util_add_rti_locator_reachability_service_request(tree, pinfo, tvb, offset + 4, encoding); break; case RTI_SERVICE_REQUEST_ID_UNKNOWN: { guint32 seq_length; seq_length = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_item(tree, hf_rtps_srm_request_body, tvb, offset + 4, seq_length, ENC_NA); offset = check_offset_addition(offset, seq_length, tree, NULL, tvb); offset = check_offset_addition(offset, 4, tree, NULL, tvb); break; } case RTI_SERVICE_REQUEST_ID_INSTANCE_STATE: { /* First four after the sequence size are not needed */ offset += 8; offset = rtps_util_add_instance_state_request_data(tree, tvb, offset, encoding); break; } } return offset; } /* *********************************************************************** */ /* * Parameter Sequence dissector * */ /* *********************************************************************** */ /* * It returns the new offset representing the point where the parameter * sequence terminates. * In case of protocol error, it returns 0 (cannot determine the end of * the sequence, the caller should be responsible to find the end of the * section if possible or pass the error back and abort dissecting the * current packet). * If no error occurred, the returned value is ALWAYS > than the offset passed. */ #define ENSURE_LENGTH(size) \ if (param_length < size) { \ expert_add_info_format(pinfo, param_len_item, &ei_rtps_parameter_value_invalid, "ERROR: parameter value too small (must be at least %d octets)", size); \ break; \ } static gboolean dissect_parameter_sequence_rti_dds(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb, proto_item *parameter_item, proto_item * param_len_item, gint offset, const guint encoding, int param_length, guint16 parameter, type_mapping * type_mapping_object, gboolean is_inline_qos, guint vendor_id) { switch(parameter) { case PID_DATA_TAGS: ENSURE_LENGTH(4); rtps_util_add_data_tags(rtps_parameter_tree, tvb, offset, encoding, param_length); break; case PID_SAMPLE_SIGNATURE: ENSURE_LENGTH(16); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_epoch, tvb, offset, 8, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_nonce, tvb, offset+8, 4, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_length, tvb, offset+12, 4, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_signature, tvb, offset+16, param_length-16, ENC_NA); break; case PID_ENABLE_AUTHENTICATION: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_enable_authentication, tvb, offset, 4, ENC_NA); break; case PID_BUILTIN_ENDPOINT_QOS: ENSURE_LENGTH(1); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_builtin_endpoint_qos, tvb, offset, 1, ENC_NA); break; case PID_ENDPOINT_SECURITY_INFO: { guint32 flags; ENSURE_LENGTH(8); flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_endpoint_security_attributes_mask, ett_rtps_flags, ENDPOINT_SECURITY_INFO_FLAGS, flags); flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_plugin_endpoint_security_attributes_mask, ett_rtps_flags, PLUGIN_ENDPOINT_SECURITY_INFO_FLAGS, flags); break; } case PID_PARTICIPANT_SECURITY_INFO: { guint32 flags; ENSURE_LENGTH(8); flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_participant_security_attributes_mask, ett_rtps_flags, PARTICIPANT_SECURITY_INFO_FLAGS, flags); offset += 4; flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_plugin_participant_security_attributes_mask, ett_rtps_flags, PLUGIN_PARTICIPANT_SECURITY_INFO_FLAGS, flags); break; } case PID_VENDOR_BUILTIN_ENDPOINT_SET: { guint32 flags; ENSURE_LENGTH(4); flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_vendor_builtin_endpoint_set_flags, ett_rtps_flags, VENDOR_BUILTIN_ENDPOINT_FLAGS, flags); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Unsigned long classId | * +---------------+---------------+---------------+---------------+ * | Unsigned long uncompressedSerializedLength | * +---------------+---------------+---------------+---------------+ * | byteSeq compressedSerializedTypeObject | * +---------------+---------------+---------------+---------------+ * classId: * value(0) RTI_OSAPI_COMPRESSION_CLASS_ID_NONE * value(1) RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB * value(2) RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2 * value(-1) RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO */ case PID_TYPE_OBJECT_LB: { guint compressed_size; guint decompressed_size; guint compression_plugin_class; tvbuff_t *compressed_type_object_subset; ENSURE_LENGTH(8); proto_tree_add_item(rtps_parameter_tree, hf_rtps_compression_plugin_class_id, tvb, offset, 4, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_uncompressed_serialized_length, tvb, offset + 4, 4, encoding); compression_plugin_class = tvb_get_guint32(tvb, offset, encoding); decompressed_size = tvb_get_guint32(tvb, offset + 4, encoding); /* Get the numer of bytes (elements) in the sequence */ compressed_size = tvb_get_guint32(tvb, offset + 8, encoding); switch(compression_plugin_class) { case RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB: { /* + 12 Because First 4 bytes of the sequence are the number of elements in the sequence */ proto_tree_add_item(rtps_parameter_tree, hf_rtps_compressed_serialized_type_object, tvb, offset + 12, param_length - 8, encoding); compressed_type_object_subset = tvb_new_subset_length(tvb, offset + 12, decompressed_size); rtps_add_zlib_compressed_typeobject(rtps_parameter_tree, pinfo, compressed_type_object_subset, 0, encoding, compressed_size, decompressed_size, type_mapping_object); break; } case RTI_OSAPI_COMPRESSION_CLASS_ID_NONE: { compressed_type_object_subset = tvb_new_subset_length(tvb, offset + 12, decompressed_size); rtps_util_add_typeobject(rtps_parameter_tree, pinfo, compressed_type_object_subset, 0, encoding, decompressed_size, type_mapping_object); break; } default: { /* + 12 Because First 4 bytes of the sequence are the number of elements in the sequence */ proto_tree_add_item(rtps_parameter_tree, hf_rtps_compressed_serialized_type_object, tvb, offset + 12, param_length - 8, encoding); } } break; } case PID_ENDPOINT_SECURITY_ATTRIBUTES: { guint32 flags; ENSURE_LENGTH(4); flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_endpoint_security_attributes, ett_rtps_flags, ENDPOINT_SECURITY_ATTRIBUTES, flags); break; } case PID_TOPIC_QUERY_PUBLICATION: { ENSURE_LENGTH(8); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_topic_query_publication_enable, tvb, offset, 1, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_topic_query_publication_sessions, tvb, offset+4, 4, encoding); break; } case PID_ENDPOINT_PROPERTY_CHANGE_EPOCH: { ENSURE_LENGTH(8); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_endpoint_property_change_epoch, tvb, offset, 8, encoding); break; } case PID_TOPIC_QUERY_GUID: if (is_inline_qos) { ENSURE_LENGTH(16); rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); } break; case PID_REACHABILITY_LEASE_DURATION: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_participant_lease_duration); break; case PID_RELATED_SOURCE_GUID: { ENSURE_LENGTH(16); /* PID_RELATED_SOURCE_GUID */ rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TRANSPORT_INFO_LIST | length | * +---------------+---------------+---------------+---------------+ * | unsigned long Seq.Length | * +---------------+---------------+---------------+---------------+ * | ... | * | TransportInfo 1 | * | ... | * +---------------+---------------+---------------+---------------+ * | ... | * | TransportInfo 2 | * | ... | * +---------------+---------------+---------------+---------------+ * | ... | * | TransportInfo n | * | ... | * +---------------+---------------+---------------+---------------+ * * IDL: * struct TRANSPORT_INFO { * long classid; * long messageSizeMax; * }; * * struct TRANSPORT_INFO_LIST { * Sequence<TRANSPORT_INFO> TransportInfoList; * }; * */ /* PID_RELATED_READER_GUID and PID_TRANSPORT_INFO_LIST have the same value */ case PID_TRANSPORT_INFO_LIST: { if (is_inline_qos) { ENSURE_LENGTH(16); /* PID_RELATED_READER_GUID */ rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); } else { ENSURE_LENGTH(4); { int i; guint32 temp_offset; guint32 seq_size = tvb_get_guint32(tvb, offset, encoding); if (seq_size > 0) { temp_offset = offset+4; /* move to first transportInfo */ i = 1; while(seq_size-- > 0) { rtps_util_add_transport_info(rtps_parameter_tree, tvb, temp_offset, encoding, i); temp_offset += 8; ++i; } } } } break; } /* PID_DIRECT_COMMUNICATION and PID_SOURCE_GUID have the same value */ case PID_DIRECT_COMMUNICATION: { if (is_inline_qos) { ENSURE_LENGTH(16); /* PID_SOURCE_GUID */ rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); } else { proto_tree_add_item(rtps_parameter_tree, hf_rtps_direct_communication, tvb, offset, 1, ENC_NA ); } break; } /* Product Version Version 5.3.1 and earlier * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPE_CONSISTENCY_KIND | length | * +---------------+---------------+---------------+---------------+ * | unsigned short value Kind | = = u n u s e d = = = = = = | * +---------------+---------------+---------------+---------------+ * * Product Version 5.3.3 and later * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPE_CONSISTENCY_KIND | length | * +---------------+---------------+---------------+---------------+ * | unsigned short value Kind | Boolean ISeqB | Boolean IStrB | * +---------------+---------------+---------------+---------------+ * | Boolean IMemN | Boolean PTypW | Boolean FtypV | Boolean IEnLN | * +---------------+---------------+---------------+---------------+ * ISeqB = Ignore Sequence Names * IStrB = Ignore String names * IMemN = Ignore Member Names * PTypW = Prevent Type Widening * FtypV = Force Type Validation * IEnLN = Ignore Enum Literal Names */ case PID_TYPE_CONSISTENCY: { if (param_length !=4 && param_length !=8) { expert_add_info_format(pinfo, rtps_parameter_tree, &pid_type_csonsistency_invalid_size, "PID_TYPE_CONSISTENCY invalid size. It has a size of %d bytes. Expected %d or %d bytes.", param_length, 4, 8); break; } proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_type_consistency_kind, tvb, offset, 2, encoding); /* Parameter size can be used as a discriminator between product versions. */ if (param_length == 8) { offset += 2; proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_sequence_bounds, tvb, offset, 1, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_string_bounds, tvb, offset + 1, 1, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_member_names, tvb, offset + 2, 1, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_prevent_type_widening, tvb, offset + 3, 1, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_force_type_validation, tvb, offset + 4, 1, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_enum_literal_names, tvb, offset + 5, 1, encoding); } break; } /* ================================================================== * Here are all the deprecated items. */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PRODUCT_VERSION | length | * +---------------+---------------+---------------+---------------+ * | uint8 major | uint8 minor | uint8 release |uint8 revision | * +---------------+---------------+---------------+---------------+ */ case PID_PRODUCT_VERSION: { ENSURE_LENGTH(4); rtps_util_add_product_version(rtps_parameter_tree, tvb, offset, vendor_id); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PLUGIN_PROMISCUITY_KIND | length | * +---------------+---------------+---------------+---------------+ * | short value | | * +---------------+---------------+---------------+---------------+ */ case PID_PLUGIN_PROMISCUITY_KIND: { ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_plugin_promiscuity_kind, tvb, offset, 4, encoding); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_ENTITY_VIRTUAL_GUID | length | * +---------------+---------------+---------------+---------------+ * | | * +- -+ * | octet[12] guidPrefix | * +- -+ * | | * +---------------+---------------+---------------+---------------+ * | octet[4] entityId | * +---------------+---------------+---------------+---------------+ */ case PID_ENTITY_VIRTUAL_GUID: { ENSURE_LENGTH(16); rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "virtualGUIDSuffix", NULL); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_SERVICE_KIND | length | * +---------------+---------------+---------------+---------------+ * | long value | * +---------------+---------------+---------------+---------------+ */ case PID_SERVICE_KIND: { ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_service_kind, tvb, offset, 4, encoding); break; } case PID_ROLE_NAME: { rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_role_name, encoding); break; } case PID_ACK_KIND: { ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_acknowledgment_kind, tvb, offset, 4, encoding); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PEER_HOST_EPOCH | length | * +---------------+---------------+---------------+---------------+ * | unsigned long epoch | * +---------------+---------------+---------------+---------------+ */ case PID_PEER_HOST_EPOCH: { ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_peer_host_epoch, tvb, offset, 4, encoding); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DOMAIN_ID|PID_RTI_DOMAIN_ID| length | * +---------------+---------------+---------------+---------------+ * | long domain_id | * +---------------+---------------+---------------+---------------+ */ case PID_RTI_DOMAIN_ID: case PID_DOMAIN_ID: { if (is_inline_qos) { /* PID_RELATED_ORIGINAL_WRITER_INFO */ ENSURE_LENGTH(16); rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "virtualGUIDSuffix", NULL); /* Sequence number */ rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset+16, encoding, "virtualSeqNumber"); } else { ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_domain_id, tvb, offset, 4, encoding); /* Each packet stores its participant guid in the private table. This is done in dissect_rtps */ endpoint_guid *participant_guid = (endpoint_guid*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY); if (participant_guid != NULL) { /* Since this information is fixed there is no need to update in a second pass */ if (!wmem_map_contains(discovered_participants_domain_ids, participant_guid)) { gint domainId = tvb_get_gint32(tvb, offset, encoding); participant_info *p_info = (participant_info*)wmem_new(wmem_file_scope(), participant_info); p_info->domainId = domainId; endpoint_guid *participant_guid_copy = (endpoint_guid*)wmem_memdup(wmem_file_scope(), participant_guid, sizeof(endpoint_guid)); wmem_map_insert(discovered_participants_domain_ids, (const void*)participant_guid_copy, (void*)p_info); } } } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DOMAIN_TAG | length | * +---------------+---------------+---------------+---------------+ * | long domain_tag.Length | * +---------------+---------------+---------------+---------------+ * | string domain_tag | * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_DOMAIN_TAG: { ENSURE_LENGTH(4); rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_domain_tag, encoding); break; } case PID_EXTENDED: { ENSURE_LENGTH(8); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_extended_parameter, tvb, offset, 4, encoding); offset += 4; proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_extended_pid_length, tvb, offset, 4, encoding); break; } case PID_TYPE_OBJECT: { rtps_util_add_typeobject(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length, type_mapping_object); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPECODE_RTPS2 | length | * +---------------+---------------+---------------+---------------+ * | | * + Type code description + * | | * +---------------+---------------+---------------+---------------+ */ case PID_TYPECODE: case PID_TYPECODE_RTPS2: { rtps_util_add_typecode(rtps_parameter_tree, tvb, offset, encoding, 0, /* indent level */ 0, /* isPointer */ -1, /* bitfield */ 0, /* isKey */ offset, NULL, /* name */ -1, /* not a seq field */ NULL, /* not an array */ 0); /* ndds 4.0 hack: init to false */ break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DISABLE_POSITIVE_ACKS | length | * +---------------+---------------+---------------+---------------+ * | boolean value | = = = = = = = = u n u s e d = = = = = = = = | * +---------------+---------------+---------------+---------------+ */ case PID_DISABLE_POSITIVE_ACKS: { ENSURE_LENGTH(1); proto_tree_add_item(rtps_parameter_tree, hf_rtps_disable_positive_ack, tvb, offset, 1, ENC_NA ); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_EXPECTS_VIRTUAL_HB | length | * +---------------+---------------+---------------+---------------+ * | boolean value | = = = = = = = = u n u s e d = = = = = = = = | * +---------------+---------------+---------------+---------------+ */ case PID_EXPECTS_VIRTUAL_HB: { ENSURE_LENGTH(1); proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_virtual_heartbeat, tvb, offset, 1, ENC_NA ); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_LOCATOR_FILTER_LIST | length | * +---------------+---------------+---------------+---------------+ * | unsigned long number_of_channels | * +---------------+---------------+---------------+---------------+ * | | * ~ String filter_name ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ LocatorList ~ <----------+ * | | Repeat | * +---------------+---------------+---------------+---------------+ For each| * | | Channel | * ~ String filter_expression ~ | * | | | * +---------------+---------------+---------------+---------------+ <----------+ */ case PID_LOCATOR_FILTER_LIST: { gint32 number_of_channels, ch; proto_tree *channel_tree; proto_item *ti_channel; char temp_buff[20]; gint old_offset; guint32 off = offset; ENSURE_LENGTH(4); proto_tree_add_item_ret_int(rtps_parameter_tree, hf_rtps_locator_filter_list_num_channels, tvb, off, 4, encoding, &number_of_channels ); proto_item_append_text(parameter_item, " (%d channels)", number_of_channels ); off += 4; if (number_of_channels == 0) { /* Do not dissect the rest */ break; } /* filter name */ off = rtps_util_add_string(rtps_parameter_tree, tvb, off, hf_rtps_locator_filter_list_filter_name, encoding); /* Foreach channel... */ for (ch = 0; ch < number_of_channels; ++ch) { snprintf(temp_buff, 20, "Channel[%u]", ch); old_offset = off; channel_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, off, 0, ett_rtps_locator_filter_channel, &ti_channel, "Channel[%u]", ch); off = rtps_util_add_multichannel_locator_list(channel_tree, pinfo, tvb, off, temp_buff, encoding); /* Filter expression */ off = rtps_util_add_string(rtps_parameter_tree, tvb, off, hf_rtps_locator_filter_list_filter_exp, encoding); /* Now we know the length of the channel data, set the length */ proto_item_set_len(ti_channel, (off - old_offset)); } /* End of for each channel */ break; }/* End of case PID_LOCATOR_FILTER_LIST */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_UNICAST_LOCATOR_EX | 0x8007 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ * | Locator Sequence Length | * +---------------+---------------+---------------+---------------+ * | Locator 1 | Locator 2 | * +---------------+---------------+---------------+---------------+ */ case PID_UNICAST_LOCATOR_EX: { ENSURE_LENGTH(28); rtps_util_add_locator_ex_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length); break; } case PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO: { ENSURE_LENGTH(4); proto_tree_add_bitmask( rtps_parameter_tree, tvb, offset, hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask, ett_rtps_flags, SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS, encoding); break; } case PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO: { ENSURE_LENGTH(12); proto_tree_add_bitmask( rtps_parameter_tree, tvb, offset, hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask, ett_rtps_flags, SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS, encoding); offset += 4; proto_tree_add_bitmask( rtps_parameter_tree, tvb, offset, hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask, ett_rtps_flags, SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS, encoding); offset += 4; proto_tree_add_bitmask( rtps_parameter_tree, tvb, offset, hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit, ett_rtps_flags, SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS, encoding); break; } case PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO: { ENSURE_LENGTH(8); proto_tree *sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4, ett_rtps_crypto_algorithm_requirements, NULL, "Shared Secret"); dissect_crypto_algorithm_requirements(sub_tree, tvb, offset, encoding, SECURITY_KEY_ESTABLISHMENT_MASK_FLAGS); break; } case PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO: { ENSURE_LENGTH(16); proto_tree *sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4, ett_rtps_crypto_algorithm_requirements, NULL, "Trust Chain"); offset = dissect_crypto_algorithm_requirements(sub_tree, tvb, offset, encoding, SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS); sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4, ett_rtps_crypto_algorithm_requirements, NULL, "Message Authentication"); dissect_crypto_algorithm_requirements(sub_tree, tvb, offset, encoding, SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS); break; } default: { return FALSE; } }/* End of switch for parameters for vendor RTI */ return TRUE; } static gboolean dissect_parameter_sequence_toc(proto_tree *rtps_parameter_tree, packet_info *pinfo _U_, tvbuff_t *tvb, proto_item *parameter_item _U_, proto_item *param_len_item _U_, gint offset, const guint encoding, int param_length _U_, guint16 parameter) { switch(parameter) { /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPECODE_RTPS2 | length | * +---------------+---------------+---------------+---------------+ * | | * + Type code description + * | | * +---------------+---------------+---------------+---------------+ */ case PID_TYPECODE_RTPS2: { rtps_util_add_typecode(rtps_parameter_tree, tvb, offset, encoding, 0, /* indent level */ 0, /* isPointer */ -1, /* bitfield */ 0, /* isKey */ offset, NULL, /* name */ 0, /* not a seq field */ NULL, /* not an array */ 0); /* ndds 4.0 hack: init to false */ break; } default: return FALSE; } return TRUE; } static gboolean dissect_parameter_sequence_adl(proto_tree *rtps_parameter_tree _U_, packet_info *pinfo _U_, tvbuff_t *tvb _U_, proto_item *parameter_item _U_, proto_item *param_len_item _U_, gint offset _U_, const guint encoding _U_, int param_length _U_, guint16 parameter) { switch(parameter) { case PID_ADLINK_WRITER_INFO: { break; } case PID_ADLINK_READER_DATA_LIFECYCLE: { break; } case PID_ADLINK_WRITER_DATA_LIFECYCLE: { break; } case PID_ADLINK_ENDPOINT_GUID: { break; } case PID_ADLINK_SYNCHRONOUS_ENDPOINT: { break; } case PID_ADLINK_RELAXED_QOS_MATCHING: { break; } case PID_ADLINK_PARTICIPANT_VERSION_INFO: { break; } case PID_ADLINK_NODE_NAME: { break; } case PID_ADLINK_EXEC_NAME: { break; } case PID_ADLINK_PROCESS_ID: { break; } case PID_ADLINK_SERVICE_TYPE: { break; } case PID_ADLINK_ENTITY_FACTORY: { break; } case PID_ADLINK_WATCHDOG_SCHEDULING: { break; } case PID_ADLINK_LISTENER_SCHEDULING: { break; } case PID_ADLINK_SUBSCRIPTION_KEYS: { break; } case PID_ADLINK_READER_LIFESPAN: { break; } case PID_ADLINK_SHARE: { break; } case PID_ADLINK_TYPE_DESCRIPTION: { break; } case PID_ADLINK_LAN_ID: { break; } case PID_ADLINK_ENDPOINT_GID: { break; } case PID_ADLINK_GROUP_GID: { break; } case PID_ADLINK_EOTINFO: { break; } case PID_ADLINK_PART_CERT_NAME: { break; } case PID_ADLINK_LAN_CERT_NAME: { break; } default: return FALSE; } return TRUE; } static gboolean dissect_parameter_sequence_v1(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb, proto_item *parameter_item, proto_item * param_len_item, gint offset, const guint encoding, int size, int param_length, guint16 parameter, guint16 version, type_mapping * type_mapping_object, coherent_set_entity_info *coherent_set_entity_info_object) { proto_tree *subtree; switch(parameter) { /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PARTICIPANT_LEASE_DURATION| 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ */ case PID_PARTICIPANT_LEASE_DURATION: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_participant_lease_duration); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TIME_BASED_FILTER | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ */ case PID_TIME_BASED_FILTER: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_time_based_filter_minimum_separation); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TOPIC_NAME | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String.length | * +---------------+---------------+---------------+---------------+ * | str[0] | str[1] | str[2] | str[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_TOPIC_NAME: { const gchar * retVal = NULL; guint32 str_size = tvb_get_guint32(tvb, offset, encoding); retVal = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, str_size, ENC_ASCII); rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_topic_name, encoding); /* If topic information is enabled we have to store the topic name for showing after the DATA(r|w) * in the infor column. This information is used in append_status_info function. */ if (retVal != NULL && enable_topic_info) { submessage_col_info* current_submessage_col_info = NULL; rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object, retVal, TOPIC_INFO_ADD_TOPIC_NAME); /* retVal has packet scope lifetime, enough for adding to the DATA(r|w) column information */ current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY); if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) { current_submessage_col_info->topic_name = retVal; } } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_OWNERSHIP_STRENGTH | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long strength | * +---------------+---------------+---------------+---------------+ */ case PID_OWNERSHIP_STRENGTH: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_strength, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPE_NAME | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String.length | * +---------------+---------------+---------------+---------------+ * | str[0] | str[1] | str[2] | str[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_TYPE_NAME: { const gchar * retVal = NULL; guint32 str_size = tvb_get_guint32(tvb, offset, encoding); retVal = (gchar*) tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, str_size, ENC_ASCII); rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object, retVal, TOPIC_INFO_ADD_TYPE_NAME); rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_type_name, encoding); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_XXXXXXXXXXX | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ */ case PID_METATRAFFIC_MULTICAST_PORT: case PID_METATRAFFIC_UNICAST_PORT: case PID_DEFAULT_UNICAST_PORT: ENSURE_LENGTH(4); rtps_util_add_port(rtps_parameter_tree, pinfo, tvb, offset, encoding, hf_rtps_param_port); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_EXPECTS_INLINE_QOS | 0x0004 | * +---------------+---------------+---------------+---------------+ * | boolean | N O T U S E D | * +---------------+---------------+---------------+---------------+ */ case PID_EXPECTS_INLINE_QOS: ENSURE_LENGTH(1); proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_inline_qos, tvb, offset, 1, ENC_NA ); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_XXXXXXXXXXX | length | * +---------------+---------------+---------------+---------------+ * | unsigned long ip_address | * +---------------+---------------+---------------+---------------+ */ case PID_METATRAFFIC_MULTICAST_IPADDRESS: case PID_DEFAULT_UNICAST_IPADDRESS: case PID_MULTICAST_IPADDRESS: case PID_METATRAFFIC_UNICAST_IPADDRESS: rtps_util_add_ipv4_address_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, hf_param_ip_address); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PROTOCOL_VERSION | 0x0004 | * +---------------+---------------+---------------+---------------+ * | uint8 major | uint8 minor | N O T U S E D | * +---------------+---------------+---------------+---------------+ */ case PID_PROTOCOL_VERSION: ENSURE_LENGTH(2); rtps_util_add_protocol_version(rtps_parameter_tree, tvb, offset); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_VENDOR_ID | 0x0004 | * +---------------+---------------+---------------+---------------+ * | uint8 major | uint8 minor | N O T U S E D | * +---------------+---------------+---------------+---------------+ */ case PID_VENDOR_ID: ENSURE_LENGTH(2); rtps_util_add_vendor_id(rtps_parameter_tree, tvb, offset); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_RELIABILITY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ */ case PID_RELIABILITY_OFFERED: /* Deprecated */ case PID_RELIABILITY: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_reliability_kind, tvb, offset, 4, encoding); /* Older version of the protocol (and for PID_RELIABILITY_OFFERED) * this parameter was carrying also a NtpTime called * 'maxBlockingTime'. */ if (size == 12) { rtps_util_add_timestamp(rtps_parameter_tree, tvb, offset + 4, encoding, hf_rtps_reliability_max_blocking_time); } break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_LIVELINESS | 0x000c | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ * NDDS 3.1 sends only 'kind' on the wire. * */ case PID_LIVELINESS_OFFERED: /* Deprecated */ case PID_LIVELINESS: ENSURE_LENGTH(12); rtps_util_add_liveliness_qos(rtps_parameter_tree, tvb, offset, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DURABILITY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ */ case PID_DURABILITY: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_durability, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DURABILITY_SERVICE | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ * | long history_depth | * +---------------+---------------+---------------+---------------+ * | long max_samples | * +---------------+---------------+---------------+---------------+ * | long max_instances | * +---------------+---------------+---------------+---------------+ * | long max_samples_per_instance | * +---------------+---------------+---------------+---------------+ */ case PID_DURABILITY_SERVICE: ENSURE_LENGTH(28); rtps_util_add_durability_service_qos(rtps_parameter_tree, tvb, offset, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_OWNERSHIP | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ */ case PID_OWNERSHIP_OFFERED: /* Deprecated */ case PID_OWNERSHIP: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_ownership, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PRESENTATION | 0x0008 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ * | boolean | boolean | N O T U S E D | * +---------------+---------------+---------------+---------------+ */ case PID_PRESENTATION_OFFERED: /* Deprecated */ case PID_PRESENTATION: ENSURE_LENGTH(6); proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_access_scope, tvb, offset, 4, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_coherent_access, tvb, offset+4, 1, ENC_NA ); proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_ordered_access, tvb, offset+5, 1, ENC_NA ); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DEADLINE | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ */ case PID_DEADLINE_OFFERED: /* Deprecated */ case PID_DEADLINE: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_deadline_period); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DESTINATION_ORDER | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long kind | * +---------------+---------------+---------------+---------------+ */ case PID_DESTINATION_ORDER_OFFERED: /* Deprecated */ case PID_DESTINATION_ORDER: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_destination_order, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_LATENCY_BUDGET | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ */ case PID_LATENCY_BUDGET_OFFERED: case PID_LATENCY_BUDGET: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_latency_budget_duration); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PARTITION | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ * | unsigned long string[0].size | * +---------------+---------------+---------------+---------------+ * | string[0][0] | string[0][1] | string[0][2] | string[0][3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * The value is a sequence of strings. */ case PID_PARTITION_OFFERED: /* Deprecated */ case PID_PARTITION: ENSURE_LENGTH(4); rtps_util_add_seq_string(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_param_partition_num, hf_rtps_param_partition, "name"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_LIFESPAN | 0x0008 | * +---------------+---------------+---------------+---------------+ * | long NtpTime.seconds | * +---------------+---------------+---------------+---------------+ * | unsigned long NtpTime.fraction | * +---------------+---------------+---------------+---------------+ */ case PID_LIFESPAN: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_lifespan_duration); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_USER_DATA | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ * | octet[0] | octet[1] | octet[2] | octet[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_USER_DATA: ENSURE_LENGTH(4); rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length, hf_rtps_param_user_data); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_GROUP_DATA | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ * | octet[0] | octet[1] | octet[2 ] | octet[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_GROUP_DATA: ENSURE_LENGTH(4); rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length, hf_rtps_param_group_data); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TOPIC_DATA | length | * +---------------+---------------+---------------+---------------+ * | unsigned long sequence_size | * +---------------+---------------+---------------+---------------+ * | octet[0] | octet[1] | octet[2] | octet[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_TOPIC_DATA: ENSURE_LENGTH(4); rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length, hf_rtps_param_topic_data); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_UNICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ case PID_UNICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_MULTICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ case PID_MULTICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DEFAULT_UNICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ case PID_DEFAULT_UNICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_METATRAFFIC_UNICAST_LOC...| 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ case PID_METATRAFFIC_UNICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_METATRAFFIC_MULTICAST_L...| 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ case PID_METATRAFFIC_MULTICAST_LOCATOR: ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PARTICIPANT_MANUAL_LIVE...| 0x0004 | * +---------------+---------------+---------------+---------------+ * | long livelinessEpoch | * +---------------+---------------+---------------+---------------+ */ case PID_PARTICIPANT_BUILTIN_ENDPOINTS: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_participant_builtin_endpoints, tvb, offset, 4, encoding); break; case PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_participant_manual_liveliness_count, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_HISTORY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long depth | * +---------------+---------------+---------------+---------------+ */ case PID_HISTORY: ENSURE_LENGTH(8); proto_tree_add_item(rtps_parameter_tree, hf_rtps_history_kind, tvb, offset, 4, encoding); proto_tree_add_item(rtps_parameter_tree, hf_rtps_history_depth, tvb, offset+4, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_RESOURCE_LIMIT | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long max_samples | * +---------------+---------------+---------------+---------------+ * | long max_instances | * +---------------+---------------+---------------+---------------+ * | long max_samples_per_instances | * +---------------+---------------+---------------+---------------+ */ case PID_RESOURCE_LIMIT: ENSURE_LENGTH(12); subtree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 12, ett_rtps_resource_limit, NULL, "Resource Limit"); proto_tree_add_item(subtree, hf_rtps_resource_limit_max_samples, tvb, offset, 4, encoding); proto_tree_add_item(subtree, hf_rtps_resource_limit_max_instances, tvb, offset+4, 4, encoding); proto_tree_add_item(subtree, hf_rtps_resource_limit_max_samples_per_instances, tvb, offset+8, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_CONTENT_FILTER_PROPERTY | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String1.length | * +---------------+---------------+---------------+---------------+ * | str1[0] | str1[1] | str1[2] | str1[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * | unsigned long String2.length | * +---------------+---------------+---------------+---------------+ * | str2[0] | str2[1] | str2[2] | str2[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * | unsigned long String3.length | * +---------------+---------------+---------------+---------------+ * | str3[0] | str3[1] | str3[2] | str3[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * | unsigned long String4.length | * +---------------+---------------+---------------+---------------+ * | str4[0] | str4[1] | str4[2] | str4[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * | ... | * | Filter Parameters | * | ... | * +---------------+---------------+---------------+---------------+ * * String1: ContentFilterTopicName * String2: RelatedTopicName * String3: FilterClassName * String4: FilterExpression * ExpressionParameters: sequence of Strings * * Note: those strings starts all to a word-aligned (4 bytes) offset */ case PID_CONTENT_FILTER_PROPERTY: { guint32 temp_offset = offset; ENSURE_LENGTH(20); temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset, hf_rtps_param_content_filter_topic_name, encoding); temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset, hf_rtps_param_related_topic_name, encoding); temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset, hf_rtps_param_filter_class_name, encoding); temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset, hf_rtps_param_filter_expression, encoding); /*temp_offset = */rtps_util_add_seq_string(rtps_parameter_tree, tvb, temp_offset, encoding, hf_rtps_param_expression_parameters_num, hf_rtps_param_expression_parameters, "expressionParameters"); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PROPERTY_LIST | length | * +---------------+---------------+---------------+---------------+ * | unsigned long Seq.Length | * +---------------+---------------+---------------+---------------+ * | ... | * | Property 1 | * | ... | * +---------------+---------------+---------------+---------------+ * | ... | * | Property 2 | * | ... | * +---------------+---------------+---------------+---------------+ * | ... | * | Property n | * | ... | * +---------------+---------------+---------------+---------------+ * * IDL: * struct PROPERTY { * String Name; * String Value; * }; * * struct PROPERTY_LIST { * Sequence<PROPERTY> PropertyList; * }; * */ case PID_PROPERTY_LIST: case PID_PROPERTY_LIST_OLD: ENSURE_LENGTH(4); { guint32 temp_offset, prop_size; const guint8 *propName, *propValue; proto_item *list_item, *item; proto_tree *property_list_tree, *property_tree; guint32 seq_size = tvb_get_guint32(tvb, offset, encoding); int start_offset = offset, str_length; proto_item_append_text( parameter_item, " (%d properties)", seq_size ); if (seq_size > 0) { property_list_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, -1, ett_rtps_property_list, &list_item, "Property List"); temp_offset = offset+4; while(seq_size-- > 0) { prop_size = tvb_get_guint32(tvb, temp_offset, encoding); propName = tvb_get_string_enc(wmem_packet_scope(), tvb, temp_offset+4, prop_size, ENC_ASCII); /* NDDS align strings at 4-bytes word. */ str_length = (4 + ((prop_size + 3) & 0xfffffffc)); item = proto_tree_add_string(property_list_tree, hf_rtps_property_name, tvb, temp_offset, str_length, propName); property_tree = proto_item_add_subtree(item, ett_rtps_property); temp_offset += str_length; prop_size = tvb_get_guint32(tvb, temp_offset, encoding); propValue = tvb_get_string_enc(wmem_packet_scope(), tvb, temp_offset+4, prop_size, ENC_ASCII); /* NDDS align strings at 4-bytes word. */ str_length = (4 + ((prop_size + 3) & 0xfffffffc)); proto_tree_add_string(property_tree, hf_rtps_property_value, tvb, temp_offset, str_length, propValue); temp_offset += str_length; } proto_item_set_len(list_item, temp_offset-start_offset); } } break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_FILTER_SIGNATURE | length | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * * IDL: * struct CONTENT_FILTER_SIGNATURE { * sequence<long> filterBitmap; * sequence<FILTER_SIGNATURE, 4> filterSignature; * } * * where: * struct FILTER_SIGNATURE { * long filterSignature[4]; * } */ case PID_FILTER_SIGNATURE: { guint32 temp_offset; guint32 prev_offset; guint32 fs_elem; guint32 fs[4]; ENSURE_LENGTH(8); /* Dissect filter bitmap */ temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, offset, hf_rtps_filter_bitmap, encoding, param_length, "filterBitmap"); /* Dissect sequence of FILTER_SIGNATURE */ fs_elem = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; while (fs_elem-- > 0) { prev_offset = temp_offset; /* Dissect the next FILTER_SIGNATURE object */ fs[0] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; fs[1] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; fs[2] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; fs[3] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; proto_tree_add_bytes_format_value(rtps_parameter_tree, hf_rtps_filter_signature, tvb, prev_offset, temp_offset - prev_offset, NULL, "%08x %08x %08x %08x", fs[0], fs[1], fs[2], fs[3]); } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_COHERENT_SET | length | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber seqNumber + * | | * +---------------+---------------+---------------+---------------+ */ case PID_COHERENT_SET: { guint64 coherent_seq_number; ENSURE_LENGTH(8); coherent_seq_number = rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset, encoding, "sequenceNumber"); if (coherent_set_entity_info_object && rtps_parameter_tree) { rtps_util_add_coherent_set_general_cases_case(rtps_parameter_tree, tvb, coherent_seq_number, coherent_set_entity_info_object); } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPECODE | length | * +---------------+---------------+---------------+---------------+ * | | * + Type code description + * | | * +---------------+---------------+---------------+---------------+ */ case PID_TYPECODE: rtps_util_add_typecode(rtps_parameter_tree, tvb, offset, encoding, 0, /* indent level */ 0, /* isPointer */ -1, /* bitfield */ 0, /* isKey */ offset, NULL, /* name */ -1, /* not a seq field */ NULL, /* not an array */ 0); /* ndds 4.0 hack: init to false */ break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PARTICIPANT_GUID | 0x000c | * +---------------+---------------+---------------+---------------+ * | guid[0] | guid[1] | guid[2] | guid[3] | * +---------------+---------------+---------------+---------------+ * | guid[4] | guid[5] | guid[6] | guid[7] | * +---------------+---------------+---------------+---------------+ * | guid[8] | guid[9] | guid[10] | guid[11] | * +---------------+---------------+---------------+---------------+ */ case PID_PARTICIPANT_GUID: if (version < 0x0200) { ENSURE_LENGTH(12); rtps_util_add_generic_guid_v1(rtps_parameter_tree, tvb, offset, hf_rtps_participant_guid_v1, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id_v1, hf_rtps_param_app_kind, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind); } else { ENSURE_LENGTH(16); rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); } break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_PARTICIPANT_ENTITY_ID | 0x0004 | * +---------------+---------------+---------------+---------------+ * | entity[0] | entity[1] | entity[2] | entity[3] | * +---------------+---------------+---------------+---------------+ */ case PID_PARTICIPANT_ENTITY_ID: ENSURE_LENGTH(4); rtps_util_add_generic_entity_id(rtps_parameter_tree, tvb, offset, "Participant entity ID", hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, ett_rtps_entity); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_GROUP_GUID | 0x000c | * +---------------+---------------+---------------+---------------+ * | guid[0] | guid[1] | guid[2] | guid[3] | * +---------------+---------------+---------------+---------------+ * | guid[4] | guid[5] | guid[6] | guid[7] | * +---------------+---------------+---------------+---------------+ * | guid[8] | guid[9] | guid[10] | guid[11] | * +---------------+---------------+---------------+---------------+ */ case PID_GROUP_GUID: if (version < 0x0200) { ENSURE_LENGTH(12); rtps_util_add_generic_guid_v1(rtps_parameter_tree, tvb, offset, hf_rtps_group_guid_v1, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id_v1, hf_rtps_param_app_kind, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind); } else { ENSURE_LENGTH(16); rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_group_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); } break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_GROUP_ENTITY_ID | 0x0004 | * +---------------+---------------+---------------+---------------+ * | entity[0] | entity[1] | entity[2] | entity[3] | * +---------------+---------------+---------------+---------------+ */ case PID_GROUP_ENTITY_ID: ENSURE_LENGTH(4); rtps_util_add_generic_entity_id(rtps_parameter_tree, tvb, offset, "Group entity ID", hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, ett_rtps_entity); break; /* ================================================================== * Here are all the deprecated items. */ case PID_PERSISTENCE: ENSURE_LENGTH(8); rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_persistence); break; case PID_TYPE_CHECKSUM: ENSURE_LENGTH(4); proto_tree_add_checksum(rtps_parameter_tree, tvb, offset, hf_rtps_type_checksum, -1, NULL, pinfo, 0, encoding, PROTO_CHECKSUM_NO_FLAGS); break; case PID_EXPECTS_ACK: ENSURE_LENGTH(1); proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_ack, tvb, offset, 1, ENC_NA ); break; case PID_MANAGER_KEY: { int i = 0; guint32 manager_key; subtree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, param_length, ett_rtps_manager_key, NULL, "Manager Keys"); while (param_length >= 4) { manager_key = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_uint_format(subtree, hf_rtps_manager_key, tvb, offset, 4, manager_key, "Key[%d]: 0x%X", i, manager_key); ++i; offset +=4; param_length -= 4; /* decrement count */ } break; } case PID_RECV_QUEUE_SIZE: case PID_SEND_QUEUE_SIZE: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_queue_size, tvb, offset, 4, encoding); break; case PID_VARGAPPS_SEQUENCE_NUMBER_LAST: ENSURE_LENGTH(4); rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset, encoding, "sequenceNumberLast"); break; case PID_SENTINEL: /* PID_SENTINEL should ignore any value of parameter length */ break; /* This is the default branch when we don't have enough information * on how to decode the parameter. It can be used also for known * parameters. */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | <pid_id> | 0x0000 | * +---------------+---------------+---------------+---------------+ */ case PID_TYPE2_NAME: case PID_TYPE2_CHECKSUM: case PID_RELIABILITY_ENABLED: expert_add_info(pinfo, parameter_item, &ei_rtps_parameter_not_decoded); /* Fall Through */ case PID_PAD: if (param_length > 0) { proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_data, tvb, offset, param_length, ENC_NA); } break; default: return FALSE; } return TRUE; } static gboolean dissect_parameter_sequence_v2(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb, proto_item *parameter_item _U_, proto_item *param_len_item, gint offset, const guint encoding, int param_length, guint16 parameter, guint32 *pStatusInfo, guint16 vendor_id _U_, type_mapping * type_mapping_object, coherent_set_entity_info *coherent_set_entity_info_object _U_) { proto_item *ti; switch(parameter) { /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_STATUS_INFO | 0x0004 | * +---------------+---------------+---------------+---------------+ * | long statusInfo | * +---------------+---------------+---------------+---------------+ */ case PID_STATUS_INFO: { gboolean* is_data_session_intermediate = NULL; ENSURE_LENGTH(4); /* PID_STATUS_INFO is always coded in network byte order (big endian) */ proto_tree_add_bitmask(rtps_parameter_tree, tvb, offset, hf_rtps_param_status_info_flags, ett_rtps_flags, STATUS_INFO_FLAGS, ENC_BIG_ENDIAN); if (pStatusInfo != NULL) { *pStatusInfo = tvb_get_ntohl(tvb, offset); } is_data_session_intermediate = (gboolean*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY); if (is_data_session_intermediate != NULL) { *is_data_session_intermediate = TRUE; } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DIRECTED_WRITE | 0x0010 | * +---------------+---------------+---------------+---------------+ * | | * +- -+ * | octet[12] guidPrefix | * +- -+ * | | * +---------------+---------------+---------------+---------------+ * | octet[4] entityId | * +---------------+---------------+---------------+---------------+ */ case PID_DIRECTED_WRITE: { ENSURE_LENGTH(16); rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "guidSuffix", NULL); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_KEY_HASH | xxxx | * +---------------+---------------+---------------+---------------+ * | | * +- -+ * | octet[xxxx] guid | * +- -+ * | | * +---------------+---------------+---------------+---------------+ * Differently from the other GUID, the KEY_HASH parameter may have * variable length in the future. * As consequence, no interpretation is performed here (and no check * for size). */ case PID_KEY_HASH: { guint8 guidPart; int i; ti = proto_tree_add_bytes_format(rtps_parameter_tree, hf_rtps_guid, tvb, offset, param_length, NULL, "guid: "); for (i = 0; i < param_length; ++i) { guidPart = tvb_get_guint8(tvb, offset+i); proto_item_append_text(ti, "%02x", guidPart); if (( ((i+1) % 4) == 0 ) && (i != param_length-1) ) proto_item_append_text(ti, ":"); } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TRANSPORT_PRIORITY | 0x0004 | * +---------------+---------------+---------------+---------------+ * | unsigned long value | * +---------------+---------------+---------------+---------------+ */ case PID_TRANSPORT_PRIORITY: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_transport_priority, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_CONTENT_FILTER_INFO | length | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ * * IDL: * struct CONTENT_FILTER_SIGNATURE { * sequence<long> filterBitmap; * sequence<FILTER_SIGNATURE, 4> filterSignature; * } * * where: * struct FILTER_SIGNATURE { * long filterSignature[4]; * } */ case PID_CONTENT_FILTER_INFO: { guint32 temp_offset; guint32 prev_offset; guint32 fs_elem; guint32 fs[4]; ENSURE_LENGTH(8); /* Dissect filter bitmap */ temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, offset, hf_rtps_filter_bitmap, encoding, param_length, "filterBitmap"); /* Dissect sequence of FILTER_SIGNATURE */ fs_elem = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; while (fs_elem-- > 0) { prev_offset = temp_offset; /* Dissect the next FILTER_SIGNATURE object */ fs[0] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; fs[1] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; fs[2] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; fs[3] = tvb_get_guint32(tvb, temp_offset, encoding); temp_offset += 4; proto_tree_add_bytes_format_value(rtps_parameter_tree, hf_rtps_filter_signature, tvb, prev_offset, temp_offset - prev_offset, NULL, "%08x %08x %08x %08x", fs[0], fs[1], fs[2], fs[3]); } break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_BUILTIN_ENDPOINT_SET | length | * +---------------+---------------+---------------+---------------+ * | long value | * +---------------+---------------+---------------+---------------+ */ case PID_BUILTIN_ENDPOINT_SET: { guint32 flags; ENSURE_LENGTH(4); flags = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset, hf_rtps_param_builtin_endpoint_set_flags, ett_rtps_flags, BUILTIN_ENDPOINT_FLAGS, flags); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_TYPE_MAX_SIZE_SERIALIZED | length | * +---------------+---------------+---------------+---------------+ * | long value | * +---------------+---------------+---------------+---------------+ */ case PID_TYPE_MAX_SIZE_SERIALIZED: ENSURE_LENGTH(4); proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_type_max_size_serialized, tvb, offset, 4, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_ORIGINAL_WRITER_INFO | length | * +---------------+---------------+---------------+---------------+ * | | * +- -+ * | octet[12] guidPrefix | * +- -+ * | | * +---------------+---------------+---------------+---------------+ * | octet[4] entityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ */ case PID_ORIGINAL_WRITER_INFO: ENSURE_LENGTH(16); rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "virtualGUIDSuffix", NULL); /* Sequence number */ rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset+16, encoding, "virtualSeqNumber"); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_ENTITY_NAME | length | * +---------------+---------------+---------------+---------------+ * | unsigned long String.length | * +---------------+---------------+---------------+---------------+ * | str[0] | str[1] | str[2] | str[3] | * +---------------+---------------+---------------+---------------+ * | ... | * +---------------+---------------+---------------+---------------+ */ case PID_ENTITY_NAME: rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_entity_name, encoding); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_ENDPOINT_GUID | 0x0010 | * +---------------+---------------+---------------+---------------+ * | guid[0] | guid[1] | guid[2] | guid[3] | * +---------------+---------------+---------------+---------------+ * | guid[4] | guid[5] | guid[6] | guid[7] | * +---------------+---------------+---------------+---------------+ * | guid[8] | guid[9] | guid[10] | guid[11] | * +---------------+---------------+---------------+---------------+ * | guid[12] | guid[13] | guid[14] | guid[15] | * +---------------+---------------+---------------+---------------+ */ case PID_ENDPOINT_GUID: ENSURE_LENGTH(16); rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object, NULL, TOPIC_INFO_ADD_GUID); rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset, hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); break; /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DATA_REPRESENTATION | length | * +---------------+---------------+---------------+---------------+ * | uint32 SequenceSize | * +---------------+---------------+---------------+---------------+ * | int16 DataRepresentationId[0] | int16 DataRepresentationId[1] | * +---------------+-------------------------------+---------------+ * | ... | int16 DataRepresentationId[N] | * +---------------+---------------+---------------+---------------+ * | uint32_t Compression_id (Optional) | * +---------------+---------------+---------------+---------------+ * compression_iD flags: * ZLIB: 0001b * BZIP: 0010b * LZ4: 0100b */ case PID_DATA_REPRESENTATION: { proto_tree *data_representation_seq_subtree; proto_item *item; guint value; guint item_offset; guint seq_size; guint counter = 0; guint initial_offset = offset; guint compression_id_offset = 0; seq_size = tvb_get_guint32(tvb, offset, encoding); data_representation_seq_subtree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, offset, param_length, ett_rtps_data_representation, &item, "Data Representation Sequence[%d]", seq_size); item_offset = offset + 4; for (; counter < seq_size; ++counter) { value = tvb_get_guint16(tvb, item_offset, encoding); proto_tree_add_uint_format(data_representation_seq_subtree, hf_rtps_param_data_representation, tvb, item_offset, 2, value, "[%d]: %s (0x%X)", counter, val_to_str(value, data_representation_kind_vals, "Unknown data representation value: %u"), value); item_offset += 2; } compression_id_offset = item_offset; ALIGN_ME(compression_id_offset, 4); if (compression_id_offset - initial_offset >= 4) { proto_tree_add_bitmask( rtps_parameter_tree, tvb, compression_id_offset, hf_rtps_param_compression_id_mask, ett_rtps_flags, COMPRESSION_ID_MASK_FLAGS, encoding); } break; } /* This parameter PID serializes a sequence number like the existing PID_COHERENT_SET */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_GROUP_COHERENT_SET | length | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber seqNumber + * | | * +---------------+---------------+---------------+---------------+ */ case PID_GROUP_COHERENT_SET: { guint64 hi = (guint64)tvb_get_guint32(tvb, offset, encoding); guint64 lo = (guint64)tvb_get_guint32(tvb, offset + 4, encoding); guint64 all = (hi << 32) | lo; proto_tree_add_uint64( rtps_parameter_tree, hf_rtps_param_group_coherent_set, tvb, offset, sizeof(guint64), all); break; } /* This parameter serializes a sequence number like the existing PID_COHERENT_SET * and only applies to an end coherent set sample. */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_END_GROUP_COHERENT_SET | length | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber seqNumber + * | | * +---------------+---------------+---------------+---------------+ */ case PID_END_GROUP_COHERENT_SET: { guint64 hi = (guint64)tvb_get_guint32(tvb, offset, encoding); guint64 lo = (guint64)tvb_get_guint32(tvb, offset + 4, encoding); guint64 all = (hi << 32) | lo; proto_tree_add_uint64( rtps_parameter_tree, hf_rtps_param_end_group_coherent_set, tvb, offset, sizeof(guint64), all); break; } /* This parameter serializes a SN like the existing PID_COHERENT_SET and * only applies to an end coherent set sample. * Since there are different ways to finish a coherent set it is necessary * to store information about the available coherent sets. this PID requires * set the corrresponding coherence set as "is_set". */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_END_COHERENT_SET | length | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber seqNumber + * | | * +---------------+---------------+---------------+---------------+ */ case PID_END_COHERENT_SET: { coherent_set_key coherent_set_info_key; guint64 coherent_seq_number = 0; coherent_set_entity_info *register_entry = NULL; coherent_set_info *coherent_set_info_entry; coherent_seq_number = rtps_util_add_seq_number( rtps_parameter_tree, tvb, offset, encoding, "coherenceSetSequenceNumber"); ti = proto_tree_add_uint64( rtps_parameter_tree, hf_rtps_coherent_set_end, tvb, 0, 0, coherent_seq_number); proto_item_set_generated(ti); /* Need to finish the stored coherence set */ if (coherent_set_entity_info_object != NULL) { 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_seq_number = coherent_seq_number; memset(&coherent_set_info_key, 0, sizeof(coherent_set_info_key)); coherent_set_info_key.guid = register_entry->guid; coherent_set_info_key.coherent_set_seq_number = register_entry->coherent_set_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) { /* The coherence set is completely set up */ coherent_set_info_entry->is_set = TRUE; /* Updating by last time the writer_seq_number */ coherent_set_info_entry->writer_seq_number = coherent_set_entity_info_object->writer_seq_number; } } } break; } /* This parameter serializes a long (4-byte integer) and only applies to an end coherent set sample */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | MIG..._SET_SAMPLE_COUNT | length | * +---------------+---------------+---------------+---------------+ * + sampleCount + * +---------------+---------------+---------------+---------------+ */ case MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT: { guint32 sample_count = tvb_get_guint32(tvb, offset, encoding); proto_tree_add_uint( rtps_parameter_tree, hf_rtps_param_mig_end_coherent_set_sample_count, tvb, offset, sizeof(guint32), sample_count); break; } /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PID_DEFAULT_MULTICAST_LOCATOR | 0x0018 | * +---------------+---------------+---------------+---------------+ * | long kind | * +---------------+---------------+---------------+---------------+ * | long port | * +---------------+---------------+---------------+---------------+ * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] | * +---------------+---------------+---------------+---------------+ * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] | * +---------------+---------------+---------------+---------------+ */ case PID_DEFAULT_MULTICAST_LOCATOR: { ENSURE_LENGTH(24); rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator"); break; } default: return FALSE; } /* End of switch(parameter) */ return TRUE; } #undef ENSURE_LENGTH static gint dissect_parameter_sequence(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, guint size, const char *label, guint16 version, guint32 *pStatusInfo, guint16 vendor_id, gboolean is_inline_qos, coherent_set_entity_info *coherent_set_entity_info_object) { proto_item *ti, *param_item, *param_len_item = NULL; proto_tree *rtps_parameter_sequence_tree, *rtps_parameter_tree; guint32 parameter, param_length, param_length_length = 2; gint original_offset = offset, initial_offset = offset; type_mapping * type_mapping_object = NULL; const gchar * param_name = NULL; if (!pinfo->fd->visited) { /* * At minimum, type_mapping_object->fields_visited must be * initialized to 0, because we haven't visited any fields * yet. The routines that visit fields just set individual * bits in type_mapping_object->fields_visited; they don't * initialize it. */ type_mapping_object = wmem_new(wmem_file_scope(), type_mapping); type_mapping_object->fields_visited = 0; type_mapping_object->guid.fields_present = 0; } rtps_parameter_sequence_tree = proto_tree_add_subtree_format(tree, tvb, offset, size, ett_rtps_parameter_sequence, &ti, "%s:", label); /* Loop through all the parameters defined until PID_SENTINEL is found */ for (;;) { size -= offset - original_offset; if (size < 4) { expert_add_info_format(pinfo, (param_len_item == NULL) ? ti : param_len_item, &ei_rtps_parameter_value_invalid, "ERROR: not enough bytes to read the next parameter"); return 0; } original_offset = offset; /* Reads parameter and create the sub tree. At this point we don't know * the final string that will identify the node or its length. It will * be set later... */ parameter = tvb_get_guint16(tvb, offset, encoding); param_length = tvb_get_guint16(tvb, offset+2, encoding); if ((parameter & PID_EXTENDED) == PID_EXTENDED) { offset += 4; /* get extended member id and length */ parameter = tvb_get_guint32(tvb, offset, encoding); param_length = tvb_get_guint32(tvb, offset+4, encoding); param_length_length = 4; } if (version < 0x0200) { rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1, ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_vals, "Unknown (0x%04x)")); proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id, tvb, offset, 2, parameter); } else { gboolean goto_default = TRUE; switch(vendor_id) { case RTPS_VENDOR_RTI_DDS: case RTPS_VENDOR_RTI_DDS_MICRO: { if (is_inline_qos) { param_name = try_val_to_str(parameter, parameter_id_inline_qos_rti); if (param_name != NULL) { rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1, ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_inline_qos_rti, "Unknown (0x%04x)")); proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_inline_rti, tvb, offset, param_length_length, parameter); goto_default = FALSE; } } else { param_name = try_val_to_str(parameter, parameter_id_rti_vals); if (param_name != NULL) { rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1, ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_rti_vals, "Unknown (0x%04x)")); proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_rti, tvb, offset, param_length_length, parameter); goto_default = FALSE; } } break; } case RTPS_VENDOR_TOC: { param_name = try_val_to_str(parameter, parameter_id_toc_vals); if (param_name != NULL) { rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1, ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_toc_vals, "Unknown (0x%04x)")); proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_toc, tvb, offset, param_length_length, parameter); goto_default = FALSE; } break; } case RTPS_VENDOR_ADL_DDS: { param_name = try_val_to_str(parameter, parameter_id_adl_vals); if (param_name != NULL) { rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1, ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_adl_vals, "Unknown (0x%04x)")); proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_adl, tvb, offset, param_length_length, parameter); goto_default = FALSE; } break; } } if (goto_default) { rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1, ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_v2_vals, "Unknown (0x%04x)")); proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_v2, tvb, offset, param_length_length, parameter); } } /* after param_id */ offset += param_length_length; if (parameter == PID_SENTINEL) { /* PID_SENTINEL closes the parameter list, (length is ignored) */ proto_item_set_len(param_item, 4); offset += 2; proto_item_set_len(rtps_parameter_sequence_tree, offset - initial_offset); return offset; } /* parameter length */ param_len_item = proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_length, tvb, offset, param_length_length, encoding); offset += param_length_length; /* Make sure we have enough bytes for the param value */ if ((size-4 < param_length) && (parameter != PID_SENTINEL)) { expert_add_info_format(pinfo, param_len_item, &ei_rtps_parameter_value_invalid, "Not enough bytes to read the parameter value"); return 0; } /* Sets the end of this item (now we know it!) */ proto_item_set_len(param_item, param_length+2*param_length_length); /* This way, we can include vendor specific dissections without modifying the main ones */ if (!dissect_parameter_sequence_v1(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item, offset, encoding, size, param_length, parameter, version, type_mapping_object, coherent_set_entity_info_object)) { if ((version < 0x0200) || !dissect_parameter_sequence_v2(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item, offset, encoding, param_length, parameter, pStatusInfo, vendor_id, type_mapping_object, coherent_set_entity_info_object)) { if (param_length > 0) { proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_data, tvb, offset, param_length, ENC_NA); } } } switch (vendor_id) { case RTPS_VENDOR_RTI_DDS: case RTPS_VENDOR_RTI_DDS_MICRO: { dissect_parameter_sequence_rti_dds(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item, offset, encoding, param_length, parameter, type_mapping_object, is_inline_qos, vendor_id); break; } case RTPS_VENDOR_TOC: { dissect_parameter_sequence_toc(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item, offset, encoding, param_length, parameter); break; } case RTPS_VENDOR_ADL_DDS: { dissect_parameter_sequence_adl(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item, offset, encoding, param_length, parameter); break; } default: break; } rtps_util_insert_type_mapping_in_registry(pinfo, type_mapping_object); offset += param_length; } return offset; } static gboolean rtps_is_ping(tvbuff_t *tvb, packet_info *pinfo, gint offset) { gboolean is_ping = FALSE; if (!tvb_strneql(tvb, offset, "NDDSPING", 8)) is_ping = TRUE; if (is_ping) col_set_str(pinfo->cinfo, COL_INFO, "PING"); return is_ping; } /* *********************************************************************** */ /* * A P P_ A C K_ C O N F * */ /* *********************************************************************** */ static void dissect_APP_ACK_CONF(tvbuff_t *tvb, packet_info *pinfo _U_, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, proto_item *item, endpoint_guid * guid) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | APP_ACK_CONF |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * + unsigned long virtualWriterCount + * +---------------+---------------+---------------+---------------+ * | GuidPrefix virtualWriterGuidPrefix | * +---------------+---------------+---------------+---------------+ * EntityId virtualWriterObjectId * * (after last interval) unsigned long virtualWriterEpoch * */ gint original_offset; /* Offset to the readerEntityId */ gint32 virtual_writer_count; guint32 wid; proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, APP_ACK_CONF_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); offset += 4; original_offset = offset; if (octets_to_next_header < 20) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 20); return; } /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* virtualWriterCount */ proto_tree_add_item_ret_uint(tree, hf_rtps_param_app_ack_conf_virtual_writer_count, tvb, offset, 4, encoding, &virtual_writer_count); offset += 4; { /* Deserialize Virtual Writers */ proto_tree *sil_tree_writer_list; proto_tree *sil_tree_writer; gint32 current_writer_index = 0; /** Writer list **/ sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_app_ack_virtual_writer_list, NULL, "Virtual Writer List"); current_writer_index = 0; while (current_writer_index < virtual_writer_count) { sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1, ett_rtps_app_ack_virtual_writer, NULL, "virtualWriter[%d]", current_writer_index); /* Virtual Writer Guid */ rtps_util_add_guid_prefix_v2(sil_tree_writer, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); rtps_util_add_entity_id(sil_tree_writer, tvb, offset+12, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "virtualGUIDSuffix", NULL); offset += 16; /* Counter */ proto_tree_add_item(tree, hf_rtps_param_app_ack_conf_count, tvb, offset, 4, encoding); offset += 4; current_writer_index++; } /* virtual_writer_count */ } if (offset < original_offset + octets_to_next_header) { /* In this case there must be something wrong in the bitmap: there * are some extra bytes that we don't know how to decode */ expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset); } else if (offset > original_offset + octets_to_next_header) { /* Decoding the bitmap went over the end of this submessage. * Enter an item in the protocol tree that spans over the entire * submessage. */ expert_add_info(pinfo, item, &ei_rtps_missing_bytes); } } static void dissect_parametrized_serialized_data(proto_tree *tree, tvbuff_t *tvb, gint offset_input, int size, const guint encoding) { guint32 member_id, member_length; proto_item * ti; proto_tree * data_tree, * member_tree; gint offset = offset_input; gint deserialized_size = 0; data_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_serialized_data, &ti, "serializedData"); while (deserialized_size < size) { ALIGN_ZERO(offset, 2, offset_input); member_id = tvb_get_guint16(tvb, offset, encoding); member_length = tvb_get_guint16(tvb, offset+2, encoding); if ((member_id & PID_EXTENDED) == PID_EXTENDED) { member_id = tvb_get_guint32(tvb, offset+4, encoding); member_length = tvb_get_guint32(tvb, offset+8, encoding); member_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, member_length + 12, ett_rtps_data_member, NULL, "Member (id = %u, len = %u)", member_id, member_length); proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_id_ext, tvb, offset+4, 4, encoding); proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_length_ext, tvb, offset+8, 4, encoding); offset += 12; deserialized_size += 12; } else 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 */ deserialized_size += 4; break; } else { member_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, member_length + 4, ett_rtps_data_member, NULL, "Member (id = %u, len = %u)", member_id, member_length); proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_id, tvb, offset, 2, encoding); proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_length, tvb, offset+2, 2, encoding); offset += 4; deserialized_size += 4; } proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member, tvb, offset, member_length, encoding); offset = check_offset_addition(offset, member_length, tree, NULL, tvb); deserialized_size += member_length; } proto_item_set_len(ti, deserialized_size); } /************************************************************************ */ /* Encapsulated data * */ /* ********************************************************************** */ /* * Note: the encapsulation header is ALWAYS big endian, then the encapsulation * type specified the type of endianness of the payload. * 0...2...........8...............16..............24..............32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *| representation_identifier | X X X X X X X X X X X | C C C P P | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *~ ~ * ~... Bytes of data representation using a format that ... ~ * ~... depends on the RepresentationIdentifier and options ... ~ * ~ ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * X = Unused options bits * C = Compression bits * P = Padding bits * * If compressed: * 0...2...........8...............16..............24..............32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | representation_identifier | X X X X X X X X X X X | C C C P P | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ Uncompressed Length ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ *Extended Compression Options ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ Compressed User Data ... ~ * ~ ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * C = 0b111 would be extended compression options which would come in as an * additional header before the payload. * C = 0b000 to indicate no compression * * This options field would be used for future enhancements.For example, * could be used to define a custom compressor plugin for matching purposes. */ /* Dissects the encapsultaion header and uncompress the serialized * data if is is compressed and it is compressed in using Zlib. * * @param[in] tree * @param[in] packet info. * @param[in] tvb * @param[in] offset offset at the begining of the encapsulation id. * @param[in] size in bytes from the initial offset to the end of the serialized data * @param[in] uncompress_if_compressed true for uncompressing if the data should be uncompressed. * @param[out] encapsulation_id_out If not null it will contain the encapsultaion_id * @param[out] compression_option_out If not null it will contain the compression option * @param[out] padding_bytes_out If not null it will contain the padding bytes * @param[out] extended_compression_options_out If not null it will contain the extended compression options * @param[out] extended_header_bits_out If not null it will contain the extended header bits * @param[out] is_compressed_out If not null it will indicate if the serielized data is compressed * @param[out] uncompressed_ok_out If not null it will indicate if the serizlized data has been succesfully uncompressed * @param[out] uncompressed_tvb_out If not null it will contain the uncompressed tvb pointer. If the seriaized data is not uncompressed it will return NULL. * @param[out] compressed_data_tree_out If not null it will contain the subtree of the uncompressed data. * * @return the offset after the at the beginining of the serialized data * @note All output parameters are optional. */ static gint rtps_prepare_encapsulated_data( proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, int size, gboolean uncompress_if_compressed, guint16 *encapsulation_id_out, guint8 *compression_option_out, guint8 *padding_bytes_out, guint32 *extended_compression_options_out, guint8 *extended_header_bits_out, gboolean *is_compressed_out, gboolean *uncompressed_ok_out, tvbuff_t **uncompressed_tvb_out, proto_tree **compressed_data_tree_out) { gint initial_offset = offset; gint16 encapsulation_options = 0; guint32 compressed_size = 0; guint32 uncompressed_size = 0; guint16 encapsulation_id = 0; guint8 compression_option = 0; guint8 padding_bytes = 0; guint32 extended_compression_options = 0; guint8 extended_header_bits = 0; gboolean is_compressed = 0; gboolean uncompressed_ok = 0; tvbuff_t *uncompressed_tvb = NULL; /* This logic applies to data that is not a fragment (-1) or is the first fragment */ /* Encapsulation ID */ encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */ proto_tree_add_uint(tree, hf_rtps_param_serialize_encap_kind, tvb, offset, 2, encapsulation_id); offset += 2; offset = rtps_util_dissect_encapsulation_options( tree, tvb, offset, &encapsulation_options, &compression_option, &padding_bytes, &extended_header_bits); /* If compressed on a supported format we have to uncompress it on a new tvb * and reset the offset */ is_compressed = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK) != 0; if (is_compressed) { uncompressed_size = tvb_get_gint32(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtps_uncompressed_serialized_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Get the compression extended options if required */ if (extended_header_bits == ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE) { extended_compression_options = tvb_get_gint32(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item( tree, hf_rtps_encapsulation_extended_compression_options, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } /* Get the compressed size. Padding bytes are the padding at the end of the compressed data */ compressed_size = size - (offset - initial_offset) - padding_bytes; } /* Only decompress if it is compressed with ZLIB */ if (uncompress_if_compressed && (compression_option == RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB)) { gboolean tried_to_uncompress = FALSE; proto_item *uncompressed_data_item = NULL; /* Try to uncompress the data */ uncompressed_tvb = rtps_util_get_uncompressed_tvb_zlib( tvb, offset, compressed_size, &tried_to_uncompress); /* The uncompressed data size must be the same as it is in the "Uncompressed Length" field */ uncompressed_ok = (uncompressed_tvb != NULL && (uncompressed_size == (guint32)tvb_reported_length(uncompressed_tvb))); /* If uncompression went well we have a new tvb that holds the uncompressed data */ if (tried_to_uncompress) { tvbuff_t *child_tvb = NULL; gint child_size = 0; gint child_offset = 0; /* If the tvb is not uncompressed we add use the ovb, offset and size * of the original tvb */ if (uncompressed_tvb != NULL) { child_tvb = uncompressed_tvb; child_size = -1; child_offset = 0; } else { child_tvb = tvb; child_size = compressed_size; child_offset = offset; } /* Uncompressed sample hangs from a different subtree */ *compressed_data_tree_out = proto_tree_add_subtree( tree, child_tvb, child_offset, child_size, ett_rtps_decompressed_serialized_data, &uncompressed_data_item, "[Decompressed data]"); /* If we tried to decompress we need to add hf_rtps_uncompression_ok set to true or false*/ if (!(uncompressed_ok)) { expert_add_info_format( pinfo, uncompressed_data_item, &ei_rtps_uncompression_error, "Error: unable to uncompress payload"); } } } /* Set the optional output parameters */ if (encapsulation_id_out != NULL) { *encapsulation_id_out = encapsulation_id; } if (compression_option_out != NULL) { *compression_option_out = compression_option; } if (padding_bytes_out != NULL) { *padding_bytes_out = padding_bytes; } if (extended_compression_options_out != NULL) { *extended_compression_options_out = extended_compression_options; } if (extended_header_bits_out != NULL) { *extended_header_bits_out = extended_header_bits; } if (is_compressed_out != NULL) { *is_compressed_out = is_compressed; } if (uncompressed_ok_out != NULL) { *uncompressed_ok_out = uncompressed_ok; } if (uncompressed_tvb_out != NULL) { *uncompressed_tvb_out = uncompressed_tvb; } return offset; } /* *********************************************************************** */ /* * Serialized data dissector * */ /* *********************************************************************** */ /* Note: the encapsulation header is ALWAYS big endian, then the encapsulation * type specified the type of endianness of the payload. * * Fragmentation : Options only appear on first fragment * Serieaized data might be compressed or uncompressed. Depending on that the * header contains more elements. This is indicated in the encapsulation * options where: * * X = Unused options bits * C = Compression bits * P = Padding bits * * 0...2...........8...............16..............24..............32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | representation_identifier |X X X X X X X X X X X|C C C P P| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ ~ * ~ ... Bytes of data representation using a format that ... ~ * ~ ... depends on the RepresentationIdentifier and options ... ~ * ~ ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * If compressed: * * 0...2...........8...............16..............24..............32 * + -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | representation_identifier | X X X X X X X X X X X | C C C P P | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ Uncompressed Length ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ *Extended Compression Options ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ~ Compressed User Data ... ~ * ~ ~ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * C = 0b111 would be extended compression options which would come in as an * additional header before the payload. * C = 0b000 to indicate no compression * * *This options field would be used for future enhancements.For example, * could be used to define a custom compressor plugin for matching purposes. * */ static void dissect_serialized_data(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, int size, const char *label, guint16 vendor_id, gboolean is_discovery_data, endpoint_guid * guid, gint32 frag_number /* -1 if no fragmentation */) { proto_item *ti; proto_tree *rtps_parameter_sequence_tree; guint16 encapsulation_id; gboolean try_dissection_from_type_object = FALSE; guint encapsulation_encoding = ENC_BIG_ENDIAN; rtps_dissector_data * data = wmem_new(wmem_packet_scope(), rtps_dissector_data); tvbuff_t *data_holder_tvb = tvb; tvbuff_t *compressed_tvb = NULL; proto_tree *dissected_data_holdeer_tree = NULL; gboolean is_compressed = FALSE; gboolean uncompressed_ok = FALSE; proto_tree *compressed_subtree = NULL; data->encapsulation_id = 0; data->position_in_batch = -1; /* Creates the sub-tree */ rtps_parameter_sequence_tree = proto_tree_add_subtree(tree, tvb, offset, size, ett_rtps_serialized_data, &ti, label); /* We store thisa value for using later */ dissected_data_holdeer_tree = rtps_parameter_sequence_tree; if (frag_number > 1) { /* if the data is a fragment and not the first fragment, simply dissect the content as raw bytes */ proto_tree_add_item(rtps_parameter_sequence_tree, hf_rtps_issue_data, tvb, offset, size, ENC_NA); } else { /* Dissects the encapsulation header options and uncompress the tvb if it is * compressed and can be uncompressed */ offset = rtps_prepare_encapsulated_data( rtps_parameter_sequence_tree, pinfo, tvb, offset, size, TRUE, &encapsulation_id, NULL, NULL, NULL, NULL, &is_compressed, &uncompressed_ok, &compressed_tvb, &compressed_subtree); data->encapsulation_id = encapsulation_id; if (is_compressed && uncompressed_ok) { data_holder_tvb = compressed_tvb; offset = 0; dissected_data_holdeer_tree = compressed_subtree; } /* Sets the correct values for encapsulation_encoding */ encapsulation_encoding = get_encapsulation_endianness(encapsulation_id); if (encapsulation_id == ENCAPSULATION_CDR_LE || encapsulation_id == ENCAPSULATION_CDR_BE || encapsulation_id == ENCAPSULATION_CDR2_LE || encapsulation_id == ENCAPSULATION_CDR2_BE || encapsulation_id == ENCAPSULATION_PL_CDR_LE || encapsulation_id == ENCAPSULATION_PL_CDR_BE) { try_dissection_from_type_object = TRUE; } /* In case it is compressed only try to dissect the type oject if it is correctly uncompressed */ try_dissection_from_type_object = try_dissection_from_type_object && ((is_compressed == uncompressed_ok)); /* At this point: * - uncompressed_tvb contains the uncompressed tvb or the packet tvb * - compressed_data_tree points to the tree of the uncompressed data * or the rtps_parameter_sequence_tree. * - offset points to 0 of the uncompressed tvb or the offseet of the packet * tvb if it is not decompressed. * Only try to dissect the user data if it is not compressed or it is compressed and correctly uncompressed */ if (is_compressed == uncompressed_ok) { if (rtps_util_try_dissector(dissected_data_holdeer_tree, pinfo, data_holder_tvb, offset, guid, data, encapsulation_encoding, get_encapsulation_version(encapsulation_id), try_dissection_from_type_object)) { return; } /* The payload */ size -= 4; switch (encapsulation_id) { /* CDR_LE and CDR_BE data should be dissected like this if it is a fragment or if it is not */ case ENCAPSULATION_CDR_LE: case ENCAPSULATION_CDR_BE: proto_tree_add_item(dissected_data_holdeer_tree, hf_rtps_issue_data, data_holder_tvb, offset, size, ENC_NA); break; case ENCAPSULATION_PL_CDR_LE: case ENCAPSULATION_PL_CDR_BE: if (is_discovery_data) { dissect_parameter_sequence(dissected_data_holdeer_tree, pinfo, data_holder_tvb, offset, encapsulation_encoding, size, "serializedData", 0x0200, NULL, vendor_id, FALSE, NULL); } else if (frag_number != NOT_A_FRAGMENT) { /* fragments should be dissected as raw bytes (not parametrized) */ proto_tree_add_item(dissected_data_holdeer_tree, hf_rtps_issue_data, data_holder_tvb, offset, size, ENC_NA); break; } else { /* Instead of showing a warning like before, we now dissect the data as * (id - length - value) members */ dissect_parametrized_serialized_data(dissected_data_holdeer_tree, data_holder_tvb, offset, size, encapsulation_encoding); } break; default: proto_tree_add_item(dissected_data_holdeer_tree, hf_rtps_data_serialize_data, tvb, offset, size, ENC_NA); } } } } /* *********************************************************************** */ /* * A P P_ A C K * */ /* *********************************************************************** */ static void dissect_APP_ACK(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, proto_item *item, endpoint_guid * guid) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | APP_ACK |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * + unsigned long virtualWriterCount + * +---------------+---------------+---------------+---------------+ * | GuidPrefix virtualWriterGuidPrefix | * +---------------+---------------+---------------+---------------+ * EntityId virtualWriterObjectId * unsigned short intervalCount | unsigned short bytesToNextVirtualWriter * * SequenceNumber intervalFirstSn * SequenceNumber intervalLastSn * unsigned short intervalFlags | unsigned short payloadLength * * (after last interval) unsigned long virtualWriterEpoch * */ gint original_offset; /* Offset to the readerEntityId */ gint32 virtual_writer_count; guint32 wid; /* Writer EntityID */ proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, APP_ACK_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 56) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 56); return; } offset += 4; original_offset = offset; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", &wid); offset += 4; guid->entity_id = wid; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; /* virtualWriterCount */ proto_tree_add_item_ret_int(tree, hf_rtps_param_app_ack_virtual_writer_count, tvb, offset, 4, encoding, &virtual_writer_count); offset += 4; { /* Deserialize Virtual Writers */ proto_tree *sil_tree_writer_list; gint32 current_writer_index; gint32 current_interval_count; /* guint16 interval_flags = 0; */ /* guint32 current_virtual_guid_index = 0;*/ /** Writer list **/ sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_app_ack_virtual_writer_list, NULL, "Virtual Writer List"); current_writer_index = 0; while (current_writer_index < virtual_writer_count) { proto_tree *sil_tree_writer; proto_tree *sil_tree_interval_list; gint32 interval_count; sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1, ett_rtps_app_ack_virtual_writer, NULL, "virtualWriter[%d]", current_writer_index); /* Virtual Writer Guid */ #if 0 rtps_util_add_generic_guid(sil_tree_writer, tvb, offset, "virtualGUID", buffer, MAX_GUID_SIZE); #endif offset += 16; /* Interval count */ proto_tree_add_item_ret_int(sil_tree_writer, hf_rtps_param_app_ack_interval_count, tvb, offset, 2, encoding, &interval_count); offset += 2; /* bytes to next virtual writer */ proto_tree_add_item(sil_tree_writer, hf_rtps_param_app_ack_octets_to_next_virtual_writer, tvb, offset, 2, encoding); offset += 2; /* Interval list */ sil_tree_interval_list = proto_tree_add_subtree_format(sil_tree_writer, tvb, offset, -1, ett_rtps_app_ack_virtual_writer_interval_list, NULL, "Interval List"); current_interval_count = 0; while (current_interval_count < interval_count) { proto_tree *sil_tree_interval; gint32 interval_payload_length; sil_tree_interval = proto_tree_add_subtree_format(sil_tree_interval_list, tvb, offset, -1, ett_rtps_app_ack_virtual_writer_interval, NULL, "Interval[%d]", current_interval_count); /* firstVirtualSN */ rtps_util_add_seq_number(sil_tree_interval, tvb, offset, encoding, "firstVirtualSN"); offset += 8; /* lastVirtualSN */ rtps_util_add_seq_number(sil_tree_interval, tvb, offset, encoding, "lastVirtualSN"); offset += 8; /* interval flags */ proto_tree_add_item(sil_tree_interval, hf_rtps_param_app_ack_interval_flags, tvb, offset, 2, encoding); offset += 2; /* interval payload length */ proto_tree_add_item_ret_int(sil_tree_interval, hf_rtps_param_app_ack_interval_payload_length, tvb, offset, 2, encoding, &interval_payload_length); offset += 2; if (interval_payload_length > 0) { proto_tree_add_item(sil_tree_interval, hf_rtps_serialized_data, tvb, offset, interval_payload_length, ENC_NA); offset += ((interval_payload_length + 3) & 0xfffffffc); } ++current_interval_count; } /* interval list */ /* Count */ proto_tree_add_item(tree, hf_rtps_param_app_ack_count, tvb, offset, 4, encoding); offset += 4; current_writer_index++; } /* virtual_writer_count */ } if (offset < original_offset + octets_to_next_header) { /* In this case there must be something wrong in the bitmap: there * are some extra bytes that we don't know how to decode */ expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset); } else if (offset > original_offset + octets_to_next_header) { /* Decoding the bitmap went over the end of this submessage. * Enter an item in the protocol tree that spans over the entire * submessage. */ expert_add_info(pinfo, item, &ei_rtps_missing_bytes); } } /* *********************************************************************** */ /* * P A D * */ /* *********************************************************************** */ static void dissect_PAD(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree) { /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | PAD |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ */ proto_item *item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, PAD_FLAGS, flags); item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header != 0) { expert_add_info(pinfo, item, &ei_rtps_sm_octets_to_next_header_not_zero); } } /* *********************************************************************** */ /* * D A T A * */ /* *********************************************************************** */ static void dissect_DATA_v1(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | DATA |X|X|X|U|H|A|P|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ * | ObjectId writerObjectId | * +---------------+---------------+---------------+---------------+ * | HostId hostId (iff H==1) | * +---------------+---------------+---------------+---------------+ * | AppId appId (iff H==1) | * +---------------+---------------+---------------+---------------+ * | ObjectId objectId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterSequence parameters [only if P==1] ~ * | | * +---------------+---------------+---------------+---------------+ * Note: on RTPS 1.0, flag U is not present * * RTPS 1.2: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | DATA |X|X|U|Q|H|A|D|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + KeyHashPrefix keyHashPrefix [only if H==1] + * | | * +---------------+---------------+---------------+---------------+ * | KeyHashSuffix keyHashSuffix | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [only if D==1] ~ * | | * +---------------+---------------+---------------+---------------+ * Notes: * - inlineQos is NEW * - serializedData is equivalent to the old 'parameters' */ int min_len; gboolean is_builtin_entity = FALSE; /* true=entityId.entityKind = built-in */ gint old_offset = offset; guint32 wid; /* Writer EntityID */ proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FLAGSv1, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 20; if ((flags & FLAG_DATA_H) != 0) min_len += 8; if ((flags & FLAG_DATA_Q) != 0) min_len += 4; if ((flags & FLAG_DATA_D) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* readerEntityId */ is_builtin_entity |= rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ is_builtin_entity |= rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; /* Checks for predefined declarations * * writerEntityId value | A flag | Extra * -------------------------------------------|--------|------------- * ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER | 1 | r+ * ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER | 0 | r- * ENTITYID_BUILTIN_PUBLICATIONS_WRITER | 1 | w+ * ENTITYID_BUILTIN_PUBLICATIONS_WRITER | 0 | w- * ENTITYID_BUILTIN_PARTICIPANT_WRITER | 1 | p+ * ENTITYID_BUILTIN_PARTICIPANT_WRITER | 0 | p- (*) * ENTITYID_BUILTIN_TOPIC_WRITER | 1 | t+ (*) * ENTITYID_BUILTIN_TOPIC_WRITER | 0 | t- (*) * * Note (*): Currently NDDS does not publish those values */ if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) != 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_WPLUS); } else if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) == 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_WMINUS); } else if (wid == ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER && (flags & FLAG_DATA_A) != 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_RPLUS); } else if (wid == ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER && (flags & FLAG_DATA_A) == 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_RMINUS); } else if (wid == ENTITYID_BUILTIN_PARTICIPANT_WRITER && (flags & FLAG_DATA_A) != 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_PPLUS); } else if (wid == ENTITYID_BUILTIN_PARTICIPANT_WRITER && (flags & FLAG_DATA_A) == 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_PMINUS); } else if (wid == ENTITYID_BUILTIN_TOPIC_WRITER && (flags & FLAG_DATA_A) != 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_TPLUS); } else if (wid == ENTITYID_BUILTIN_TOPIC_WRITER && (flags & FLAG_DATA_A) == 0) { col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_TMINUS); } /* If flag H is defined, read the HostId and AppId fields */ if ((flags & FLAG_DATA_H) != 0) { rtps_util_add_guid_prefix_v1(tree, tvb, offset, hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind, "keyHashPrefix"); offset += 8; } else { /* Flag H not set, use hostId, appId from the packet header */ } /* Complete the GUID by reading the Object ID */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL); offset += 4; /* Sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); offset += 8; /* InlineQos */ if ((flags & FLAG_DATA_Q) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header, "inlineQos", 0x0102, NULL, 0, is_inline_qos, NULL); } /* SerializedData */ if ((flags & FLAG_DATA_D) != 0) { if (is_builtin_entity) { dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header, "serializedData", 0x0102, NULL, 0, FALSE, NULL); } else { proto_tree_add_item(tree, hf_rtps_issue_data, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, ENC_NA); } } } static void dissect_DATA_v2(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id, endpoint_guid *guid) { /* * * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | DATA |X|X|X|I|H|D|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * + + * | KeyHashPrefix keyHashPrefix [only if H==1] | * + + * | | * +---------------+---------------+---------------+---------------+ * | KeyHashSuffix keyHashSuffix | * +---------------+---------------+---------------+---------------+ * | StatusInfo statusInfo [only if I==1] | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [only if D==1] ~ * | | * +---------------+---------------+---------------+---------------+ */ int min_len; gint old_offset = offset; guint32 wid; /* Writer EntityID */ guint32 status_info = 0xffffffff; proto_item *octet_item; gboolean from_builtin_writer; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FLAGSv2, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 20; if ((flags & FLAG_DATA_Q_v2) != 0) min_len += 4; if ((flags & FLAG_DATA_D_v2) != 0) min_len += 4; if ((flags & FLAG_DATA_H) != 0) min_len += 12; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* Sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); offset += 8; /* If flag H is defined, read the GUID Prefix */ if ((flags & FLAG_DATA_H) != 0) { rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); offset += 12; } else { /* Flag H not set, use hostId, appId from the packet header */ } /* Complete the GUID by reading the Object ID */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL); offset += 4; if ((flags & FLAG_DATA_I) != 0) { proto_tree_add_item(tree, hf_rtps_data_status_info, tvb, offset, 4, encoding); offset += 4; } /* InlineQos */ if ((flags & FLAG_DATA_Q_v2) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL); } /* SerializedData */ if ((flags & FLAG_DATA_D_v2) != 0) { from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY) || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER)) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? TRUE : FALSE; dissect_serialized_data(tree, pinfo, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, "serializedData", vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT); } generate_status_info(pinfo, wid, status_info); } static void dissect_HEADER_EXTENSION(tvbuff_t* tvb, packet_info* pinfo, gint offset, guint8 flags, const guint encoding, proto_tree* tree, int octets_to_next_header, guint16 vendor_id) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | DATA_HE |P|C|C|W|U|T|L|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | MessageLength messageLength (Only if L == 1 ) | * +---------------+---------------+---------------+---------------+ * | | * + TimeStamp rtpsSendTimestamp (Only if T == 1 ) + * | | * +---------------+---------------+---------------+---------------+ * | UExtension4 uExtension (Only if U == 1 ) | * +---------------+---------------+---------------+---------------+ * | | * + WExtension8 wExtension8 (Only if W == 1 ) + * | | * +---------------+---------------+---------------+---------------+ * | | * + Checksum messageChecksum (Only if CC != 00 ) + * | | * +---------------+---------------+---------------+---------------+ * | | * + ParameterList parameters (Only if P != 0 ) + * | | * +---------------+---------------+---------------+---------------+ * C1,C2 == 01 -> 4 bytes checksum * C1,C2 == 10 -> 8 bytes checksum * C1,C2 == 11 -> 16 bytes checksum */ #define RTPS_HE_ENDIANESS_FLAG (0x01) #define RTPS_HE_MESSAGE_LENGTH_FLAG (0x02) #define RTPS_HE_TIMESTAMP_FLAG (0x04) #define RTPS_HE_UEXTENSION_FLAG (0x08) #define RTPS_HE_WEXTENSION_FLAG (0x10) #define RTPS_HE_CHECKSUM_2_FLAG (0x20) #define RTPS_HE_CHECKSUM_1_FLAG (0x40) #define RTPS_HE_PARAMETERS_FLAG (0x80) #define RTPS_HE_CHECKSUM_CRC32 RTPS_HE_CHECKSUM_2_FLAG #define RTPS_HE_CHECKSUM_CRC64 RTPS_HE_CHECKSUM_1_FLAG #define RTPS_HE_CHECKSUM_MD5 (RTPS_HE_CHECKSUM_1_FLAG | RTPS_HE_CHECKSUM_2_FLAG) guint8 checksum_type = 0; gint initial_offset = offset; guint checksum_flags = PROTO_CHECKSUM_NO_FLAGS; gboolean is_crc_supported = true; /*Checksum can be CRC32, CRC64 and MD5 */ union _calculated_checksum { uint8_t md5[RTPS_CHECKSUM_MAX_LEN]; uint32_t crc32c; uint64_t crc64; } calculated_checksum, he_checksum; ++offset; proto_tree_add_bitmask_value( tree, tvb, offset, hf_rtps_header_extension_flags, ett_rtps_flags, HEADER_EXTENSION_MASK_FLAGS, flags); ++offset; proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset, 2, encoding); offset += 2; if ((flags & RTPS_HE_MESSAGE_LENGTH_FLAG) == RTPS_HE_MESSAGE_LENGTH_FLAG) { proto_tree_add_item(tree, hf_rtps_message_length, tvb, offset, 4, encoding); offset += 4; } if ((flags & RTPS_HE_TIMESTAMP_FLAG) == RTPS_HE_TIMESTAMP_FLAG) { rtps_util_add_timestamp(tree, tvb, offset, encoding, hf_rtps_timestamp); offset += 8; } if ((flags & RTPS_HE_UEXTENSION_FLAG) == RTPS_HE_UEXTENSION_FLAG) { proto_tree_add_item(tree, hf_rtps_uextension, tvb, offset, 4, encoding); offset += 4; } if ((flags & RTPS_HE_WEXTENSION_FLAG) == RTPS_HE_WEXTENSION_FLAG) { proto_tree_add_item(tree, hf_rtps_wextension, tvb, offset, 8, encoding); offset += 8; } checksum_type = (flags & (RTPS_HE_CHECKSUM_2_FLAG | RTPS_HE_CHECKSUM_1_FLAG)); if (checksum_type != 0) { gint checksum_len = 0; /* Adds the CRC of the RTPS message */ switch (checksum_type) { /* 32-bit checksum */ case RTPS_HE_CHECKSUM_CRC32: checksum_len = 4; break; /* 64-bit checksum */ case RTPS_HE_CHECKSUM_CRC64: checksum_len = 8; is_crc_supported = false; break; /* 128-bit checksum */ case RTPS_HE_CHECKSUM_MD5: checksum_len = 16; break; default: break; } /* If the check CRC feature is enabled */ if (enable_rtps_crc_check && is_crc_supported) { char* tvb_zero_checksum = NULL; rtps_tvb_field *rtps_root = NULL; checksum_flags = PROTO_CHECKSUM_VERIFY; rtps_root = (rtps_tvb_field*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY); if (rtps_root != NULL) { /* The checksum in the wire is the checksum of the RTPS message with the * checksum field set to 0. To calculate the checksum of the RTPS message * we need to set those bytes to 0 in a separate buffer. */ tvb_zero_checksum = wmem_alloc0_array(wmem_packet_scope(), char, rtps_root->tvb_len); tvb_memcpy( rtps_root->tvb, tvb_zero_checksum, rtps_root->tvb_offset, rtps_root->tvb_len); /* Set checksum bytes to 0 */ memset(tvb_zero_checksum + offset, 0, checksum_len); switch (checksum_type) { case RTPS_HE_CHECKSUM_CRC32: /* Checksum is always big endian */ he_checksum.crc32c = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN); calculated_checksum.crc32c = crc32c_calculate_no_swap( tvb_zero_checksum, rtps_root->tvb_len, CRC32C_PRELOAD); calculated_checksum.crc32c ^= CRC32C_PRELOAD; break; case RTPS_HE_CHECKSUM_CRC64: /* CRC64 is not supported yet */ break; case RTPS_HE_CHECKSUM_MD5: tvb_memcpy( tvb, &he_checksum.md5, offset, checksum_len); gcry_md_hash_buffer( GCRY_MD_MD5, calculated_checksum.md5, tvb_zero_checksum, rtps_root->tvb_len); break; default: break; } } } switch (checksum_type) { case RTPS_HE_CHECKSUM_CRC32: proto_tree_add_checksum( tree, tvb, offset, hf_rtps_header_extension_checksum_crc32c, -1, &ei_rtps_checksum_check_error, pinfo, calculated_checksum.crc32c, ENC_BIG_ENDIAN, checksum_flags); break; case RTPS_HE_CHECKSUM_MD5: proto_tree_add_checksum_bytes( tree, tvb, offset, hf_rtps_header_extension_checksum_md5, -1, &ei_rtps_checksum_check_error, pinfo, calculated_checksum.md5, checksum_len, checksum_flags); break; case RTPS_HE_CHECKSUM_CRC64: default: break; } offset += checksum_len; } if ((flags & RTPS_HE_PARAMETERS_FLAG) == RTPS_HE_PARAMETERS_FLAG) { guint parameter_endianess = ((flags & RTPS_HE_ENDIANESS_FLAG) == RTPS_HE_ENDIANESS_FLAG) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN; dissect_parameter_sequence(tree, pinfo, tvb, offset, parameter_endianess, octets_to_next_header - (offset - initial_offset), "Parameters", 0x0200, NULL, vendor_id, FALSE, NULL); } } static void dissect_DATA_FRAG(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id, endpoint_guid *guid) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | DATA_FRAG |X|X|X|X|X|H|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * + + * | KeyHashPrefix keyHashPrefix [only if H==1] | * + + * | | * +---------------+---------------+---------------+---------------+ * | KeyHashSuffix keyHashSuffix | * +---------------+---------------+---------------+---------------+ * | FragmentNumber fragmentStartingNum | * +---------------+---------------+---------------+---------------+ * | ushort fragmentsInSubmessage | ushort fragmentSize | * +---------------+---------------+---------------+---------------+ * | unsigned long sampleSize | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData ~ * | | * +---------------+---------------+---------------+---------------+ */ int min_len; gint old_offset = offset; guint32 frag_number = 0; proto_item *octet_item; guint32 wid; gboolean from_builtin_writer; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FRAG_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 32; if ((flags & FLAG_DATA_FRAG_Q) != 0) min_len += 4; if ((flags & FLAG_DATA_FRAG_H) != 0) min_len += 12; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* Sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); offset += 8; /* If flag H is defined, read the GUID Prefix */ if ((flags & FLAG_DATA_H) != 0) { rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); offset += 12; } else { /* Flag H not set, use hostId, appId from the packet header */ } /* Complete the GUID by reading the Object ID */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL); offset += 4; /* Fragment number */ proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_number, tvb, offset, 4, encoding, &frag_number); offset += 4; /* Fragments in submessage */ proto_tree_add_item(tree, hf_rtps_data_frag_num_fragments, tvb, offset, 2, encoding); offset += 2; /* Fragment size */ proto_tree_add_item(tree, hf_rtps_data_frag_size, tvb, offset, 2, encoding); offset += 2; /* sampleSize */ proto_tree_add_item(tree, hf_rtps_data_frag_sample_size, tvb, offset, 4, encoding); offset += 4; /* InlineQos */ if ((flags & FLAG_DATA_Q_v2) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL); } /* SerializedData */ if ((flags & FLAG_DATA_D_v2) != 0) { from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY) || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER)) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? TRUE : FALSE; dissect_serialized_data(tree, pinfo, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, "serializedData", vendor_id, from_builtin_writer, NULL, (gint32)frag_number); } } /* *********************************************************************** */ /* * N O K E Y _ D A T A * */ /* *********************************************************************** */ static void dissect_NOKEY_DATA(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 version, guint16 vendor_id) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ISSUE |X|X|X|X|X|X|P|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ * | ObjectId writerObjectId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterSequence parameters [only if P==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ UserData issueData ~ * | | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [only if D==0] ~ * | | * +---------------+---------------+---------------+---------------+ * * RTPS 2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [only if D==1] ~ * | | * +---------------+---------------+---------------+---------------+ * Notes: * - inlineQos is equivalent to the old 'parameters' * - serializedData is equivalent to the old 'issueData' */ int min_len; guint32 wid; /* Writer EntityID */ gboolean from_builtin_writer; gint old_offset = offset; proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NOKEY_DATA_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 16; if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; /* Sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); offset += 8; /* Parameters */ if ((flags & FLAG_NOKEY_DATA_Q) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header, "inlineQos", version, NULL, vendor_id, is_inline_qos, NULL); } /* Issue Data */ if ((version < 0x0200) && (flags & FLAG_NOKEY_DATA_D) == 0) { proto_tree_add_item(tree, hf_rtps_issue_data, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, ENC_NA); } if ((version >= 0x0200) && (flags & FLAG_DATA_D_v2) != 0) { from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY) || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER)) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? TRUE : FALSE; dissect_serialized_data(tree, pinfo, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, "serializedData", vendor_id, from_builtin_writer, NULL, NOT_A_FRAGMENT); } } /* *********************************************************************** */ /* * N O K E Y _ D A T A _ F R A G * */ /* *********************************************************************** */ static void dissect_NOKEY_DATA_FRAG(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |NOKEY_DATA_FRAG|X|X|X|X|X|X|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | FragmentNumber fragmentStartingNum | * +---------------+---------------+---------------+---------------+ * | ushort fragmentsInSubmessage | ushort fragmentSize | * +---------------+---------------+---------------+---------------+ * | unsigned long sampleSize | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData ~ * | | * +---------------+---------------+---------------+---------------+ */ int min_len; guint32 wid; /* Writer EntityID */ gboolean from_builtin_writer; gint old_offset = offset; guint32 frag_number = 0; proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NOKEY_DATA_FRAG_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 28; if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; /* Sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); offset += 8; /* Fragment number */ proto_tree_add_item_ret_uint(tree, hf_rtps_nokey_data_frag_number, tvb, offset, 4, encoding, &frag_number); offset += 4; /* Fragments in submessage */ proto_tree_add_item(tree, hf_rtps_nokey_data_frag_num_fragments, tvb, offset, 2, encoding); offset += 2; /* Fragment size */ proto_tree_add_item(tree, hf_rtps_nokey_data_frag_size, tvb, offset, 2, encoding); offset += 2; /* InlineQos */ if ((flags & FLAG_DATA_Q_v2) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL); } /* SerializedData */ if ((flags & FLAG_DATA_D_v2) != 0) { from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY) || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER)) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? TRUE : FALSE; dissect_serialized_data(tree, pinfo, tvb,offset, octets_to_next_header - (offset - old_offset) + 4, "serializedData", vendor_id, from_builtin_writer, NULL, (gint32)frag_number); } } static void dissect_PING(tvbuff_t* tvb, gint offset, const guint encoding, int octets_to_next_header, proto_tree* tree) { proto_tree_add_item(tree, hf_rtps_ping,tvb, offset, octets_to_next_header, encoding); } /* *********************************************************************** */ /* * A C K N A C K * */ /* *********************************************************************** */ static void dissect_ACKNACK(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, proto_item *item, endpoint_guid *guid) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ACK |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ * | ObjectId writerObjectId | * +---------------+---------------+---------------+---------------+ * | | * + Bitmap bitmap + * | | * +---------------+---------------+---------------+---------------+ * | Counter count | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ACKNACK |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumberSet readerSNState + * | | * +---------------+---------------+---------------+---------------+ * | Counter count | * +---------------+---------------+---------------+---------------+ */ gint original_offset; /* Offset to the readerEntityId */ proto_item *octet_item; guint32 wid; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, ACKNACK_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 20) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 20)"); return; } offset += 4; original_offset = offset; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* Bitmap */ offset = rtps_util_add_bitmap(tree, tvb, offset, encoding, "readerSNState", TRUE); /* RTPS 1.0 didn't have count: make sure we don't decode it wrong * in this case */ if (offset + 4 == original_offset + octets_to_next_header) { /* Count is present */ proto_tree_add_item(tree, hf_rtps_acknack_count, tvb, offset, 4, encoding); } else if (offset < original_offset + octets_to_next_header) { /* In this case there must be something wrong in the bitmap: there * are some extra bytes that we don't know how to decode */ expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset); } else if (offset > original_offset + octets_to_next_header) { /* Decoding the bitmap went over the end of this submessage. * Enter an item in the protocol tree that spans over the entire * submessage. */ expert_add_info(pinfo, item, &ei_rtps_missing_bytes); } } /* *********************************************************************** */ /* * N A C K _ F R A G * */ /* *********************************************************************** */ static void dissect_NACK_FRAG(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | NACK_FRAG |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumberSet writerSN + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ FragmentNumberSet fragmentNumberState + * | | * +---------------+---------------+---------------+---------------+ * | Counter count | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NACK_FRAG_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 24) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)"); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", NULL); offset += 4; /* Writer sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSN"); offset += 8; /* FragmentNumberSet */ offset = rtps_util_add_fragment_number_set(tree, pinfo, tvb, offset, encoding, "fragmentNumberState", octets_to_next_header - 20); if (offset == -1) { return; } /* Count */ proto_tree_add_item(tree, hf_rtps_nack_frag_count, tvb, offset, 4, encoding); } /* *********************************************************************** */ /* * H E A R T B E A T * */ /* *********************************************************************** */ static void dissect_HEARTBEAT(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 version, endpoint_guid *guid) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | HEARTBEAT |X|X|X|X|X|L|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ * | ObjectId writerObjectId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstAvailableSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber lastSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | long counter | * +---------------+---------------+---------------+---------------+ * * Notes: * - on RTPS 1.0, counter is not present * - on RTPS 1.0, L flag is not present * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | HEARTBEAT |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstAvailableSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber lastSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | Counter count | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; guint32 wid; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if ((octets_to_next_header < 24) && (version <= 0x0101)) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)"); return; } else if (octets_to_next_header < 28) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 28)"); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* First available Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstAvailableSeqNumber"); offset += 8; /* Last Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastSeqNumber"); offset += 8; /* Counter: it was not present in RTPS 1.0 */ if (version >= 0x0101) { proto_tree_add_item(tree, hf_rtps_heartbeat_count, tvb, offset, 4, encoding); } } /* *********************************************************************** */ /* * H E A R T B E A T _ B A T C H * */ /* *********************************************************************** */ static void dissect_HEARTBEAT_BATCH(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, endpoint_guid *guid) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |HEARTBEAT_BATCH|X|X|X|X|X|L|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerId | * +---------------+---------------+---------------+---------------+ * | EntityId writerId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstBatchSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber lastBatchSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber lastSN + * | | * +---------------+---------------+---------------+---------------+ * | Count count | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; guint32 wid; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_BATCH_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 36) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 36)"); return; } /* Skip decoding the entire packet if (tree == NULL) */ if (tree == NULL) { return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* First available Batch Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstBatchSN"); offset += 8; /* Last Batch Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastBatchSN"); offset += 8; /* First available Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstSeqNumber"); offset += 8; /* Last Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastSeqNumber"); offset += 8; /* Counter */ proto_tree_add_item(tree, hf_rtps_heartbeat_batch_count, tvb, offset, 4, encoding); } /* *********************************************************************** */ /* * H E A R T B E A T _ V I R T U A L * */ /* *********************************************************************** */ static void dissect_HEARTBEAT_VIRTUAL(tvbuff_t *tvb, packet_info *pinfo _U_, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id _U_, endpoint_guid *guid) { /* * VIRTUAL_HB: * * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | VIRTUAL_HB |X|X|X|X|N|W|V|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerId | * +---------------+---------------+---------------+---------------+ * | EntityId writerId | * +---------------+---------------+---------------+---------------+ * | Guid_t virtualGUID (V=0 & N=0) | * + + * | | * + + * | | * + + * | | * +---------------+---------------+---------------+---------------+ * | unsigned long numWriters (W=1) | * +---------------+---------------+---------------+---------------+ * | | * ~ WriterVirtualHBList writerVirtualHBList ~ * | | * +---------------+---------------+---------------+---------------+ * | unsigned long count | * +---------------+---------------+---------------+---------------+ * WRITER_VIRTUAL_HB: * * 0...2...........7...............15.............23...............31 * +---------------+---------------+---------------+---------------+ * | EntityId writerId (W=1) | * +---------------+---------------+---------------+---------------+ * | unsigned long numVirtualGUIDs (N=0) | * +---------------+---------------+---------------+---------------+ * | | * ~ VirtualGUIDHBList virtualGUIDHBList ~ * | | * +---------------+---------------+---------------+---------------+ * * VIRTUAL_GUID_HB: * * 0...2...........7...............15.............23...............31 * +---------------+---------------+---------------+---------------+ * | Guid_t virtualGUID (V=1) | * + + * | | * + + * | | * + + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstVirtualSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber lastVirtualSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstRTPSSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber lastRTPSSN + * | | * +---------------+---------------+---------------+---------------+ */ guint32 num_writers, num_virtual_guids, wid; gint writer_id_offset, virtual_guid_offset = 0, old_offset; proto_item *octet_item, *ti; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_VIRTUAL_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 12) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 12); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); writer_id_offset = offset; offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* virtualGUID */ if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V) && !(flags & FLAG_VIRTUAL_HEARTBEAT_N)) { /*rtps_util_add_generic_guid(tree, tvb, offset, "virtualGUID", buffer, MAX_GUID_SIZE);*/ virtual_guid_offset = offset; offset += 16; } /* num_writers */ ti = proto_tree_add_item(tree, hf_rtps_virtual_heartbeat_num_writers, tvb, offset, 4, encoding); if (flags & FLAG_VIRTUAL_HEARTBEAT_W) { num_writers = tvb_get_guint32(tvb, offset, encoding); offset += 4; } else { proto_item_set_text(ti, "numWriters: 1"); num_writers = 1; } { /* Deserialize Writers */ proto_tree *sil_tree_writer_list; guint32 current_writer_index; /** Writer list **/ sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_writer_heartbeat_virtual_list, NULL, "Writer List"); current_writer_index = 0; while (current_writer_index < num_writers) { proto_tree *sil_tree_writer; sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1, ett_rtps_writer_heartbeat_virtual, NULL, "writer[%d]", current_writer_index); if (num_writers == 1) { old_offset = offset; offset = writer_id_offset; } rtps_util_add_entity_id(sil_tree_writer, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", NULL); if (num_writers == 1) { offset = old_offset; } else { offset += 4; } if (!(flags & FLAG_VIRTUAL_HEARTBEAT_N)) { proto_tree_add_item(sil_tree_writer, hf_rtps_virtual_heartbeat_num_virtual_guids, tvb, offset, 4, encoding); num_virtual_guids = tvb_get_guint32(tvb, offset, encoding); offset += 4; } else { num_virtual_guids = 0; } /** Virtual GUID list **/ if (num_virtual_guids != 0) { proto_tree *sil_tree_virtual_guid_list; guint32 current_virtual_guid_index; sil_tree_virtual_guid_list = proto_tree_add_subtree_format(sil_tree_writer, tvb, offset, -1, ett_rtps_virtual_guid_heartbeat_virtual_list, NULL, "Virtual GUID List"); current_virtual_guid_index = 0; while (current_virtual_guid_index < num_virtual_guids) { proto_tree *sil_tree_virtual_guid; sil_tree_virtual_guid = proto_tree_add_subtree_format(sil_tree_virtual_guid_list, tvb, offset, -1, ett_rtps_virtual_guid_heartbeat_virtual, NULL, "virtualGUID[%d]", current_virtual_guid_index); if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V)) { old_offset = offset; offset = virtual_guid_offset; } /*rtps_util_add_generic_guid_v2(sil_tree_virtual_guid, tvb, offset, "virtualGUID", buffer, MAX_GUID_SIZE);*/ if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V)) { offset = old_offset; } else { offset += 16; } /* firstVirtualSN */ rtps_util_add_seq_number(sil_tree_virtual_guid, tvb, offset, encoding, "firstVirtualSN"); offset += 8; /* lastVirtualSN */ rtps_util_add_seq_number(sil_tree_virtual_guid, tvb, offset, encoding, "lastVirtualSN"); offset += 8; /* firstRTPSSN */ rtps_util_add_seq_number(sil_tree_virtual_guid, tvb, offset, encoding, "firstRTPSSN"); offset += 8; /* lastRTPSSN */ rtps_util_add_seq_number(sil_tree_virtual_guid, tvb, offset, encoding, "lastRTPSSN"); offset += 8; current_virtual_guid_index++; } } current_writer_index++; } } /* Count */ proto_tree_add_item(tree, hf_rtps_virtual_heartbeat_count, tvb, offset, 4, encoding); } /* *********************************************************************** */ /* * H E A R T B E A T _ F R A G * */ /* *********************************************************************** */ static void dissect_HEARTBEAT_FRAG(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, endpoint_guid *guid) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |HEARTBEAT_FRAG |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | FragmentNumber lastFragmentNum | * +---------------+---------------+---------------+---------------+ * | Counter count | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; guint32 wid; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_FRAG_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 24) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)"); return; } /* Skip decoding the entire packet if (tree == NULL) */ if (tree == NULL) { return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* First available Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); offset += 8; /* Fragment number */ proto_tree_add_item(tree, hf_rtps_heartbeat_frag_number, tvb, offset, 4, encoding); offset += 4; /* Counter */ proto_tree_add_item(tree, hf_rtps_heartbeat_frag_count, tvb, offset, 4, encoding); } /* *********************************************************************** */ /* * R T P S _ D A T A * */ /* * A N D * */ /* * R T P S _ D A T A _ S E S S I O N * */ /* *********************************************************************** */ static void dissect_RTPS_DATA(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id, gboolean is_session, endpoint_guid *guid) { /* * * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | RTPS_DATA |X|X|X|X|K|D|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | Flags extraFlags | octetsToInlineQos | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [only if D==1 || K==1] ~ * | | * +---------------+---------------+---------------+---------------+ * * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |RTPS_DATA_SESSI|X|X|X|X|K|D|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | Flags extraFlags | octetsToInlineQos | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSessionSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerVirtualSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [only if D==1 || K==1] ~ * | | * +---------------+---------------+---------------+---------------+ */ int min_len; gint old_offset = offset; guint32 writer_wid; /* Writer EntityID */ guint32 reader_wid = 0; guint32 status_info = 0xffffffff; gboolean from_builtin_writer; proto_item *octet_item; coherent_set_entity_info coherent_set_entity_info_object = {0}; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 20; if (is_session) { min_len += 8; gboolean* is_data_session_final = wmem_alloc(pinfo->pool, sizeof(gboolean)); *is_data_session_final = FALSE; p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY, is_data_session_final); } if ((flags & FLAG_RTPS_DATA_Q) != 0) min_len += 4; if ((flags & FLAG_RTPS_DATA_D) != 0) min_len += 4; if ((flags & FLAG_RTPS_DATA_K) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* extraFlags */ proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* octetsToInlineQos */ proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding); offset += 2; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", &reader_wid); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &writer_wid); offset += 4; guid->entity_id = writer_wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* Sequence number */ if (is_session) { rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSessionSeqNumber"); offset += 8; rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerVirtualSeqNumber"); offset += 8; } else { coherent_set_entity_info_object.writer_seq_number = rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); coherent_set_entity_info_object.guid = *guid; offset += 8; } /* InlineQos */ if ((flags & FLAG_RTPS_DATA_Q) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "inlineQos", 0x0200, &status_info, vendor_id, is_inline_qos, &coherent_set_entity_info_object); } /* SerializedData */ if (((flags & FLAG_RTPS_DATA_D) != 0) || ((flags & FLAG_RTPS_DATA_K) != 0)) { if (writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER) { /* Dissect the serialized data as ParticipantMessageData: * struct ParticipantMessageData { * KeyHashPrefix_t participantGuidPrefix; * KeyHashSuffix_t kind; * sequence<octet> data; * } */ proto_tree *rtps_pm_tree; proto_tree *guid_tree; guint32 kind; guint32 encapsulation_id, encapsulation_len; proto_item *ti; rtps_pm_tree = proto_tree_add_subtree(tree, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, ett_rtps_part_message_data, &ti, "ParticipantMessageData"); /* Encapsulation ID */ proto_tree_add_item_ret_uint(rtps_pm_tree, hf_rtps_param_serialize_encap_kind, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id); offset += 2; encoding = get_encapsulation_endianness(encapsulation_id); /* Encapsulation length (or option) */ proto_tree_add_item_ret_uint(rtps_pm_tree, hf_rtps_param_serialize_encap_len, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_len); offset += 2; guid_tree = proto_item_add_subtree(ti, ett_rtps_part_message_data); rtps_util_add_guid_prefix_v2(guid_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0); offset += 12; /* Kind */ proto_tree_add_item_ret_uint(guid_tree, hf_rtps_encapsulation_kind, tvb, offset, 4, ENC_BIG_ENDIAN, &kind); offset += 4; rtps_util_add_seq_octets(rtps_pm_tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, hf_rtps_data_serialize_data); } else if (writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER || writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER) { /* PGM stands for Participant Generic Message */ proto_tree * rtps_pgm_tree, * guid_tree, * message_identity_tree; proto_item *ti; guint32 encapsulation_id, encapsulation_opt; gint32 alignment_zero; guint64 sequence_number; ti = proto_tree_add_boolean_format(tree, hf_rtps_pgm, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, TRUE, "Participant Generic Message"); rtps_pgm_tree = proto_item_add_subtree(ti, ett_rtps_pgm_data); proto_tree_add_item_ret_uint(rtps_pgm_tree, hf_rtps_param_serialize_encap_kind, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id); encoding = get_encapsulation_endianness(encapsulation_id); offset += 2; proto_tree_add_item_ret_uint(rtps_pgm_tree, hf_rtps_param_serialize_encap_len, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt); offset += 2; alignment_zero = offset; /* Message Identity */ message_identity_tree = proto_tree_add_subtree(rtps_pgm_tree, tvb, offset, 24 , ett_rtps_message_identity, &ti, "Message Identity"); guid_tree = proto_item_add_subtree(ti, ett_rtps_message_identity); proto_item_append_text(guid_tree, " ("); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_message_identity_source_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, guid_tree); offset += 16; proto_tree_add_item(message_identity_tree, hf_rtps_sm_seq_number, tvb, offset, 8, encoding); /* This snippet shows the sequence number in the parent tree */ sequence_number = tvb_get_guint64(tvb, offset, encoding); proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")", sequence_number); offset += 8; /* Related Message Identity */ message_identity_tree = proto_tree_add_subtree(rtps_pgm_tree, tvb, offset, 24 , ett_rtps_related_message_identity, &ti, "Related Message Identity"); guid_tree = proto_item_add_subtree(ti, ett_rtps_related_message_identity); proto_item_append_text(guid_tree, " ("); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_message_identity_source_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, guid_tree); offset += 16; proto_tree_add_item(message_identity_tree, hf_rtps_sm_seq_number, tvb, offset, 8, encoding); /* This snippet shows the sequence number in the parent tree */ sequence_number = tvb_get_guint64(tvb, offset, encoding); proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")", sequence_number); offset += 8; guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_pgm_dst_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset += 16; guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_pgm_dst_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset += 16; guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_pgm_src_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset += 16; offset = rtps_util_add_string(rtps_pgm_tree, tvb, offset, hf_rtps_pgm_message_class_id, encoding); rtps_util_add_data_holder_seq(rtps_pgm_tree, tvb, pinfo, offset, encoding, alignment_zero); } else if (writer_wid == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER) { proto_tree * locator_ping_tree, *guid_tree; proto_item *ti; guint32 encapsulation_id, encapsulation_opt; locator_ping_tree = proto_tree_add_subtree(tree, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, ett_rtps_locator_ping_tree, &ti, "Locator Ping Message"); /* Encapsulation Id */ proto_tree_add_item_ret_uint(locator_ping_tree, hf_rtps_encapsulation_id, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id); offset += 2; encoding = get_encapsulation_endianness(encapsulation_id); /* Encapsulation length (or option) */ proto_tree_add_item_ret_uint(locator_ping_tree, hf_rtps_encapsulation_options, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt); offset += 2; guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_source_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset += 16; rtps_util_add_locator_t(locator_ping_tree, pinfo, tvb, offset, encoding, "Destination Locator"); } else if (writer_wid == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER) { /* struct ServiceRequest { long service_id; //@key GUID_t instance_id; //@key sequence<octet> request_body; }; //@Extensibility EXTENSIBLE_EXTENSIBILITY */ proto_tree * service_request_tree, * guid_tree; proto_item *ti; guint32 encapsulation_id, encapsulation_opt; gint32 service_id; ti = proto_tree_add_boolean_format(tree, hf_rtps_srm, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, TRUE, "Service Request Message"); service_request_tree = proto_item_add_subtree(ti, ett_rtps_service_request_tree); /* Encapsulation Id */ proto_tree_add_item_ret_uint(service_request_tree, hf_rtps_encapsulation_id, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id); offset += 2; encoding = get_encapsulation_endianness(encapsulation_id); /* Encapsulation length (or option) */ proto_tree_add_item_ret_uint(service_request_tree, hf_rtps_encapsulation_options, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt); offset += 2; proto_tree_add_item_ret_int(service_request_tree, hf_rtps_srm_service_id, tvb, offset, 4, encoding, &service_id); offset += 4; guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid); rtps_util_add_generic_guid_v2(guid_tree, tvb, offset, hf_rtps_srm_instance_id, hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_hf_entity_kind, NULL); offset += 16; rtps_util_add_rti_service_request(service_request_tree, pinfo, tvb, offset, encoding, service_id); } else { const char *label; if (((flags & FLAG_RTPS_DATA_D) != 0) || ((flags & FLAG_RTPS_DATA_K) == 0)) { label = "serializedData"; } else if (((flags & FLAG_RTPS_DATA_D) == 0) || ((flags & FLAG_RTPS_DATA_K) != 0)) { label = "serializedKey"; } else { /* D==1 && K==1 */ label = "<invalid or unknown data type>"; } from_builtin_writer = (((writer_wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY) || ((writer_wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY) || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER) || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER)) || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER) || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? TRUE : FALSE; /* At the end still dissect the rest of the bytes as raw data */ dissect_serialized_data(tree, pinfo, tvb, offset, octets_to_next_header - (offset - old_offset) + 4, label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT); } } rtps_util_detect_coherent_set_end_empty_data_case(&coherent_set_entity_info_object); generate_status_info(pinfo, writer_wid, status_info); } static void dissect_RTPS_DATA_SESSION(tvbuff_t* tvb, packet_info* pinfo, gint offset, guint8 flags, guint encoding, int octets_to_next_header, proto_tree* tree, guint16 vendor_id, endpoint_guid* guid) { gboolean is_data_session_intermediate = FALSE; proto_item* ti = NULL; p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY, &is_data_session_intermediate); dissect_RTPS_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header, tree, vendor_id, TRUE, guid); ti = proto_tree_add_boolean(tree, hf_rtps_data_session_intermediate, tvb, offset, 0, is_data_session_intermediate); proto_item_set_generated(ti); } /* *********************************************************************** */ /* * R T P S _ D A T A _ F R A G _ [SESSION] * */ /* *********************************************************************** */ static void dissect_RTPS_DATA_FRAG_kind(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id, gboolean is_session, endpoint_guid *guid) { /* * There are two kinds of DATA_FRAG, RTPS_DATA_FRAG and RTPS_DATA_FRAG_SESSION * the only difference is that RTPS_DATA_FRAG_SESSION has an extra sequence number after * writerSeqNum. * * RTPS_DATA_FRAG: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |RTPS_DATA_FRAG |X|X|X|X|X|K|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | Flags extraFlags | octetsToInlineQos | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | FragmentNumber fragmentStartingNum | * +---------------+---------------+---------------+---------------+ * | ushort fragmentsInSubmessage | ushort fragmentSize | * +---------------+---------------+---------------+---------------+ * | unsigned long sampleSize | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData ~ * | | * +---------------+---------------+---------------+---------------+ * * * RTPS_DATA_FRAG_SESSION: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |RTPS.._SESSION |X|X|X|X|X|K|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | Flags extraFlags | octetsToInlineQos | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber writerSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber virtualSeqNum + * | | * +---------------+---------------+---------------+---------------+ * | FragmentNumber fragmentStartingNum | * +---------------+---------------+---------------+---------------+ * | ushort fragmentsInSubmessage | ushort fragmentSize | * +---------------+---------------+---------------+---------------+ * | unsigned long sampleSize | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList inlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData ~ * | | * +---------------+---------------+---------------+---------------+ */ int min_len; gint old_offset = offset; guint64 sample_seq_number = 0; guint32 frag_number = 0, frag_size = 0, sample_size = 0, num_frags = 0; guint32 wid; /* Writer EntityID */ gboolean from_builtin_writer; guint32 status_info = 0xffffffff; proto_item *octet_item; coherent_set_entity_info coherent_set_entity_info_object = {0}; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_FRAG_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage * RTPS_DATA_FRAG_SESSION len = RTPS_DATA_FRAG len + 8 (extra virtualSequenceNum field). */ min_len = (is_session) ? 44 : 36; if ((flags & FLAG_RTPS_DATA_FRAG_Q) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* extraFlags */ proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* octetsToInlineQos */ proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding); offset += 2; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* Sequence number */ coherent_set_entity_info_object.writer_seq_number = rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber"); coherent_set_entity_info_object.guid = *guid; offset += 8; /* virtual Sequence Number (Only in RTPS_DATA_FRAG_SESSION)*/ if (is_session) { rtps_util_add_seq_number(tree, tvb, offset, encoding, "virtualSeqNumber"); offset += 8; } /* Fragment number */ proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_number, tvb, offset, 4, encoding, &frag_number); offset += 4; /* Fragments in submessage */ proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_num_fragments, tvb, offset, 2, encoding, &num_frags); offset += 2; /* Fragment size */ proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_size, tvb, offset, 2, encoding, &frag_size); offset += 2; /* sampleSize */ proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_sample_size, tvb, offset, 4, encoding, &sample_size); offset += 4; /* InlineQos */ if ((flags & FLAG_RTPS_DATA_FRAG_Q) != 0) { gboolean is_inline_qos = TRUE; offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "inlineQos", 0x0200, &status_info, vendor_id, is_inline_qos, &coherent_set_entity_info_object); } /* SerializedData */ { char label[20]; snprintf(label, 9, "fragment"); if ((flags & FLAG_RTPS_DATA_FRAG_K) != 0) { snprintf(label, 14, "serializedKey"); } from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY) || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER)) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER) || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? TRUE : FALSE; guint32 frag_index_in_submessage = 0, this_frag_number = 0, this_frag_size = 0, fragment_offset = 0; gboolean more_fragments = FALSE; if (enable_rtps_reassembly) { tvbuff_t* new_tvb = NULL; fragment_head *frag_msg = NULL; while(frag_index_in_submessage < num_frags) { this_frag_number = frag_number + frag_index_in_submessage; more_fragments = (this_frag_number * frag_size < sample_size); this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size)); fragment_offset = this_frag_number == 1 ? 0 : (((this_frag_number - 1) * frag_size)); pinfo->fragmented = TRUE; frag_msg = fragment_add_check(&rtps_reassembly_table, tvb, offset, pinfo, (guint32)sample_seq_number, /* ID for fragments belonging together */ (void *)guid, /* make sure only fragments from the same writer are considered for reassembly */ fragment_offset, /* fragment offset */ this_frag_size, /* fragment length */ more_fragments); /* More fragments? */ new_tvb = process_reassembled_data(tvb, offset + (frag_index_in_submessage * frag_size), pinfo, "Reassembled sample", frag_msg, &rtps_frag_items, NULL, tree); if (frag_index_in_submessage == 0) { generate_status_info(pinfo, wid, status_info); if (frag_msg) { /* Reassembled */ col_append_fstr(pinfo->cinfo, COL_INFO, " [Reassembled]"); } else { /* Not last packet of reassembled Short Message */ col_append_fstr(pinfo->cinfo, COL_INFO," [RTPS fragment]"); } } if (new_tvb) { snprintf(label, 19, "reassembled sample"); dissect_serialized_data(tree, pinfo, new_tvb, 0, sample_size, label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT); break; } else { snprintf(label, 15, "fragment [%d]", frag_index_in_submessage); dissect_serialized_data(tree, pinfo, tvb, offset + (frag_index_in_submessage * frag_size), this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number); } frag_index_in_submessage++; } } else { while (frag_index_in_submessage < num_frags) { this_frag_number = frag_number + frag_index_in_submessage; more_fragments = (this_frag_number * frag_size < sample_size); this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size)); fragment_offset = frag_index_in_submessage * frag_size; snprintf(label, 20, "fragment [%d]", frag_index_in_submessage); dissect_serialized_data(tree, pinfo, tvb, offset + fragment_offset, this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number); frag_index_in_submessage++; } generate_status_info(pinfo, wid, status_info); } } rtps_util_detect_coherent_set_end_empty_data_case(&coherent_set_entity_info_object); } /* *********************************************************************** */ /* * R T P S _ D A T A _ B A T C H * */ /* *********************************************************************** */ static void dissect_RTPS_DATA_BATCH(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id, endpoint_guid *guid) { /* * * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |RTPS_DATA_BATCH|X|X|X|X|X|X|Q|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | Flags extraFlags | octetsToInlineQos | * +---------------+---------------+---------------+---------------+ * | EntityId readerId | * +---------------+---------------+---------------+---------------+ * | EntityId writerId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber batchSN + * | | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstSampleSN + * | | * +---------------+---------------+---------------+---------------+ * | SequenceNumberOffset offsetToLastSampleSN | * +---------------+---------------+---------------+---------------+ * | unsigned long batchSampleCount | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList batchInlineQos [only if Q==1] ~ * | | * +---------------+---------------+---------------+---------------+ * | unsigned long octetsToSLEncapsulationId | * +---------------+---------------+---------------+---------------+ * | | * ~ SampleInfoList sampleInfoList ~ * | | * +---------------+---------------+---------------+---------------+ * | SampleListEncapsulationId | | * +---------------+---------------+---------------+---------------+ * | | * ~ SampleList sampleList ~ * | | * +---------------+---------------+---------------+---------------+ * * * SampleInfo: * 0...............8..............16..............24..............32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |X|X|X|X|X|X|X|X|X|X|K|I|D|O|Q|T| octetsToInlineQoS | * +---------------+---------------+---------------+---------------+ * | unsigned long serializedDataLength | * +---------------+---------------+---------------+---------------+ * | | * + Timestamp timestamp [only if T==1] + * | | * +---------------+---------------+---------------+---------------+ * | SequenceNumberOffset offsetSN [only if O==1] | * +---------------+---------------+---------------+---------------+ * | | * ~ ParameterList sampleInlineQos [only if Q==1] ~ * | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * * Sample: * 0...............8..............16..............24..............32 * +---------------+---------------+---------------+---------------+ * | | * ~ SerializedData serializedData [sampleInfo D==1 || K==1] ~ * | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ int min_len; gint old_offset = offset; guint32 wid; /* Writer EntityID */ guint32 status_info = 0xffffffff; gint32 octetsToSLEncapsulationId; gint32 sampleListOffset; guint16 encapsulation_id; gboolean try_dissection_from_type_object = FALSE; guint16 *sample_info_flags = NULL; guint32 *sample_info_length = NULL; gint32 sample_info_count = 0, sample_info_max = rtps_max_batch_samples_dissected; proto_item *octet_item; rtps_dissector_data * data = NULL; gboolean is_compressed = FALSE; gboolean uncompressed_ok = FALSE; proto_tree *compressed_subtree = NULL; tvbuff_t *data_holder_tvb = tvb; tvbuff_t *compressed_tvb = NULL; proto_tree *dissected_data_holdeer_tree = tree; data = wmem_new(wmem_packet_scope(), rtps_dissector_data); data->encapsulation_id = 0; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_BATCH_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); /* Calculates the minimum length for this submessage */ min_len = 44; if ((flags & FLAG_RTPS_DATA_BATCH_Q) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* extraFlags */ proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* octetsToInlineQos */ proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding); offset += 2; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* Batch sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "batchSeqNumber"); offset += 8; /* First stample sequence number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstSampleSeqNumber"); offset += 8; /* offsetToLastSampleSN */ proto_tree_add_item(tree, hf_rtps_data_batch_offset_to_last_sample_sn, tvb, offset, 4, encoding); offset += 4; /* batchSampleCount */ proto_tree_add_item(tree, hf_rtps_data_batch_sample_count, tvb, offset, 4, encoding); offset += 4; /* Parameter list (if Q==1) */ /* InlineQos */ if ((flags & FLAG_RTPS_DATA_BATCH_Q) != 0) { offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "batchInlineQos", 0x0200, &status_info, vendor_id, FALSE, NULL); } /* octetsToSLEncapsulationId */ proto_tree_add_item_ret_uint(tree, hf_rtps_data_batch_octets_to_sl_encap_id, tvb, offset, 4, encoding, &octetsToSLEncapsulationId); offset += 4; sampleListOffset = offset + octetsToSLEncapsulationId; /* Sample info list */ { proto_item *ti, *list_item; proto_tree *sil_tree; sample_info_count = 0; sil_tree = proto_tree_add_subtree(tree, tvb, offset, octetsToSLEncapsulationId, ett_rtps_sample_info_list, &list_item, "Sample Info List"); /* Allocate sample_info_flags and sample_info_length * to store a copy of the flags for each sample info */ if (rtps_max_batch_samples_dissected == 0) { sample_info_max = 1024; /* Max size of sampleInfo shown */ } sample_info_flags = (guint16 *)wmem_alloc(wmem_packet_scope(), sizeof(guint16) *sample_info_max); sample_info_length = (guint32 *)wmem_alloc(wmem_packet_scope(), sizeof(guint32) *sample_info_max); /* Sample Info List: start decoding the sample info list until the offset * is greater or equal than 'sampleListOffset' */ while (offset < sampleListOffset) { guint16 flags2; /*guint16 octetsToInlineQos;*/ gint min_length; proto_tree *si_tree; gint offset_begin_sampleinfo = offset; if (rtps_max_batch_samples_dissected > 0 && (guint)sample_info_count >= rtps_max_batch_samples_dissected) { expert_add_info(pinfo, list_item, &ei_rtps_more_samples_available); offset = sampleListOffset; break; } si_tree = proto_tree_add_subtree_format(sil_tree, tvb, offset, -1, ett_rtps_sample_info, &ti, "sampleInfo[%d]", sample_info_count); flags2 = tvb_get_ntohs(tvb, offset); /* Flags are always big endian */ sample_info_flags[sample_info_count] = flags2; proto_tree_add_bitmask_value(si_tree, tvb, offset, hf_rtps_sm_flags2, ett_rtps_flags, RTPS_SAMPLE_INFO_FLAGS16, flags2); offset += 2; proto_tree_add_item(si_tree, hf_rtps_data_batch_octets_to_inline_qos, tvb, offset, 2, encoding); offset += 2; min_length = 4; if ((flags2 & FLAG_SAMPLE_INFO_T) != 0) min_len += 8; if ((flags2 & FLAG_SAMPLE_INFO_Q) != 0) min_len += 4; if ((flags2 & FLAG_SAMPLE_INFO_O) != 0) min_len += 4; /* Ensure there are enough bytes to decode */ if (sampleListOffset - offset < min_length) { expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Error: not enough bytes to dissect sample info"); return; } /* Serialized data length */ proto_tree_add_item_ret_uint(si_tree, hf_rtps_data_batch_serialized_data_length, tvb, offset, 4, encoding, &sample_info_length[sample_info_count]); offset += 4; /* Timestamp [only if T==1] */ if ((flags2 & FLAG_SAMPLE_INFO_T) != 0) { rtps_util_add_timestamp(si_tree, tvb, offset, encoding, hf_rtps_data_batch_timestamp); offset += 8; } /* Offset SN [only if O==1] */ if ((flags2 & FLAG_SAMPLE_INFO_O) != 0) { proto_tree_add_item(si_tree, hf_rtps_data_batch_offset_sn, tvb, offset, 4, encoding); offset += 4; } /* Parameter list [only if Q==1] */ if ((flags2 & FLAG_SAMPLE_INFO_Q) != 0) { offset = dissect_parameter_sequence(si_tree, pinfo, tvb, offset, encoding, octets_to_next_header - (offset - old_offset) + 4, "sampleInlineQos", 0x0200, &status_info, vendor_id, FALSE, NULL); } proto_item_set_len(ti, offset - offset_begin_sampleinfo); sample_info_count++; } /* while (offset < sampleListOffset) */ } /* Dissects the encapsulated data heder and uncompress the tvb if it is compressed and it can be uncompressed */ offset = rtps_prepare_encapsulated_data( tree, pinfo, tvb, offset, tvb_reported_length(tvb) - offset, TRUE, &encapsulation_id, NULL, NULL, NULL, NULL, &is_compressed, &uncompressed_ok, &compressed_tvb, &compressed_subtree); data->encapsulation_id = encapsulation_id; if (is_compressed && uncompressed_ok) { data_holder_tvb = compressed_tvb; offset = 0; dissected_data_holdeer_tree = compressed_subtree; octets_to_next_header = tvb_reported_length(data_holder_tvb); old_offset = 0; } /* If it is compressed but not uncompressed don't try to dissect */ if (is_compressed == uncompressed_ok) { /* Now the list of serialized data: * Serialized data is allocated one after another one. * We need to use the data previously stored in the sampleInfo to detect the * kind and size. * - sample_info_flags -> Array of guint16 holding the flags for this sample info * - sample_info_length -> Array of guint32 with the size of this sample info * - sample_info_count -> size of the above arrays * This section will NEVER dissect more than 'sample_info_count'. * Note, if there are not enough bytes in the buffer, don't dissect it (this * can happen for example when a DISPOSE message is sent, there are sample * info records, but the payload size is zero for all of them) */ if ((octets_to_next_header - (offset - old_offset) > 0)) { proto_item *ti; proto_tree *sil_tree; gint count = 0; sil_tree = proto_tree_add_subtree( dissected_data_holdeer_tree, data_holder_tvb, offset, -1, ett_rtps_sample_batch_list, &ti, "Serialized Sample List"); for (count = 0; count < sample_info_count; ++count) { /* Ensure there are enough bytes in the buffer to dissect the next sample */ if (octets_to_next_header - (offset - old_offset) + 4 < (gint)sample_info_length[count]) { expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Error: not enough bytes to dissect sample"); return; } /* We have enough bytes to dissect the next sample, so we update the rtps_dissector_data * "position in the batch" value and dissect the sample */ data->position_in_batch = count; if (encapsulation_id == ENCAPSULATION_CDR_LE || encapsulation_id == ENCAPSULATION_CDR_BE || encapsulation_id == ENCAPSULATION_CDR2_LE || encapsulation_id == ENCAPSULATION_CDR2_BE || encapsulation_id == ENCAPSULATION_PL_CDR_LE || encapsulation_id == ENCAPSULATION_PL_CDR_BE) { try_dissection_from_type_object = TRUE; } if ((sample_info_flags[count] & FLAG_SAMPLE_INFO_K) != 0) { proto_tree_add_bytes_format(sil_tree, hf_rtps_serialized_key, data_holder_tvb, offset, sample_info_length[count], NULL, "serializedKey[%d]", count); } else { if (!rtps_util_try_dissector( sil_tree, pinfo, data_holder_tvb, offset, guid, data, get_encapsulation_endianness(encapsulation_id), get_encapsulation_version(encapsulation_id), try_dissection_from_type_object)) { proto_tree_add_bytes_format(sil_tree, hf_rtps_serialized_data, data_holder_tvb, offset, sample_info_length[count], NULL, "serializedData[%d]", count); } } offset += sample_info_length[count]; } } } generate_status_info(pinfo, wid, status_info); } /* *********************************************************************** */ /* * G A P * */ /* *********************************************************************** */ static void dissect_GAP(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, endpoint_guid *guid) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | GAP |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | ObjectId readerObjectId | * +---------------+---------------+---------------+---------------+ * | ObjectId writerObjectId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber firstSeqNumber + * | | * +---------------+---------------+---------------+---------------+ * | | * + Bitmap bitmap + * | | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2/2.0 * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | GAP |X|X|X|X|X|X|F|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | EntityId readerEntityId | * +---------------+---------------+---------------+---------------+ * | EntityId writerEntityId | * +---------------+---------------+---------------+---------------+ * | | * + SequenceNumber gapStart + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ SequenceNumberSet gapList ~ * | | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; guint32 wid; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, GAP_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header < 24) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)"); return; } offset += 4; /* readerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL); offset += 4; /* writerEntityId */ rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid); offset += 4; guid->entity_id = wid; guid->fields_present |= GUID_HAS_ENTITY_ID; rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid); /* First Sequence Number */ rtps_util_add_seq_number(tree, tvb, offset, encoding, "gapStart"); offset += 8; /* Bitmap */ rtps_util_add_bitmap(tree, tvb, offset, encoding, "gapList", FALSE); } /* *********************************************************************** */ /* * I N F O _ T S * */ /* *********************************************************************** */ static void dissect_INFO_TS(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_TS |X|X|X|X|X|X|I|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + NtpTime ntpTimestamp [only if I==0] + * | | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_TS |X|X|X|X|X|X|T|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + Timestamp timestamp [only if T==1] + * | | * +---------------+---------------+---------------+---------------+ */ int min_len; proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_TS_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); min_len = 0; if ((flags & FLAG_INFO_TS_T) == 0) min_len += 8; if (octets_to_next_header != min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == %u)", min_len); return; } offset += 4; if ((flags & FLAG_INFO_TS_T) == 0) { rtps_util_add_timestamp(tree, tvb, offset, encoding, hf_rtps_info_ts_timestamp); } } /* *********************************************************************** */ /* * I N F O _ S R C * */ /* *********************************************************************** */ static void dissect_INFO_SRC(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 rtps_version) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | IPAddress appIpAddress | * +---------------+---------------+---------------+---------------+ * | ProtocolVersion version | VendorId vendor | * +---------------+---------------+---------------+---------------+ * | HostId hostId | * +---------------+---------------+---------------+---------------+ * | AppId appId | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | long unused | * +---------------+---------------+---------------+---------------+ * | ProtocolVersion version | VendorId vendor | * +---------------+---------------+---------------+---------------+ * | | * + GuidPrefix guidPrefix + * | | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; guint16 version; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_SRC_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (rtps_version < 0x0200) { if (octets_to_next_header != 16) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 16)"); return; } } else { if (octets_to_next_header != 20) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 20)"); return; } } offset += 4; /* Use version field to determine what to display */ version = tvb_get_ntohs(tvb, offset+4); if (version < 0x102) { proto_tree_add_item(tree, hf_rtps_info_src_ip, tvb, offset, 4, encoding); } else { proto_tree_add_item(tree, hf_rtps_info_src_unused, tvb, offset, 4, encoding); } offset += 4; rtps_util_add_protocol_version(tree, tvb, offset); offset += 2; /* Vendor ID */ rtps_util_add_vendor_id(tree, tvb, offset); offset += 2; if (rtps_version < 0x0200) { rtps_util_add_guid_prefix_v1(tree, tvb, offset, hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind, NULL); /* Use default 'guidPrefix' */ } else { rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_guid_prefix_src, hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix); } } /* *********************************************************************** */ /* * I N F O _ R E P L Y _ I P 4 * */ /* *********************************************************************** */ static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | IPAddress unicastReplyIpAddress | * +---------------+---------------+---------------+---------------+ * | Port unicastReplyPort | * +---------------+---------------+---------------+---------------+ * | IPAddress multicastReplyIpAddress [ only if M==1 ] | * +---------------+---------------+---------------+---------------+ * | Port multicastReplyPort [ only if M==1 ] | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |INFO_REPLY_IP4 |X|X|X|X|X|X|M|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + LocatorUDPv4 unicastReplyLocator + * | | * +---------------+---------------+---------------+---------------+ * | | * + LocatorUDPv4 multicastReplyLocator [only if M==1] + * | | * +---------------+---------------+---------------+---------------+ */ int min_len; proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_REPLY_IP4_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); min_len = 8; if ((flags & FLAG_INFO_REPLY_IP4_M) != 0) min_len += 8; if (octets_to_next_header != min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == %u)", min_len); return; } offset += 4; /* unicastReplyLocator */ rtps_util_add_locator_udp_v4(tree, pinfo, tvb, offset, "unicastReplyLocator", encoding); offset += 8; /* multicastReplyLocator */ if ((flags & FLAG_INFO_REPLY_IP4_M) != 0) { rtps_util_add_locator_udp_v4(tree, pinfo, tvb, offset, "multicastReplyLocator", encoding); /*offset += 8;*/ } } /* *********************************************************************** */ /* * I N F O _ D S T * */ /* *********************************************************************** */ static void dissect_INFO_DST(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 version, endpoint_guid *dst_guid) { /* RTPS 1.0/1.1: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | HostId hostId | * +---------------+---------------+---------------+---------------+ * | AppId appId | * +---------------+---------------+---------------+---------------+ * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + GuidPrefix guidPrefix + * | | * +---------------+---------------+---------------+---------------+ */ proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_DST_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (version < 0x0200) { if (octets_to_next_header != 8) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 8)"); return; } } else { if (octets_to_next_header != 12) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 12)"); return; } } offset += 4; if (version < 0x0200) { rtps_util_add_guid_prefix_v1(tree, tvb, offset, hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind, NULL); } else { rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_guid_prefix_dst, hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix); dst_guid->host_id = tvb_get_ntohl(tvb, offset); dst_guid->app_id = tvb_get_ntohl(tvb, offset + 4); dst_guid->instance_id = tvb_get_ntohl(tvb, offset + 8); dst_guid->fields_present |= GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID; } } /* *********************************************************************** */ /* * I N F O _ R E P L Y * */ /* *********************************************************************** */ static void dissect_INFO_REPLY(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree) { /* RTPS 1.0/1.1: * INFO_REPLY is *NOT* the same thing as the old INFO_REPLY. * * RTPS 1.2/2.0: * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * ~ LocatorList unicastReplyLocatorList ~ * | | * +---------------+---------------+---------------+---------------+ * | | * ~ LocatorList multicastReplyLocatorList [only if M==1] ~ * | | * +---------------+---------------+---------------+---------------+ */ int min_len; proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_REPLY_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); min_len = 4; if ((flags & FLAG_INFO_REPLY_M) != 0) min_len += 4; if (octets_to_next_header < min_len) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len); return; } offset += 4; /* unicastReplyLocatorList */ offset = rtps_util_add_locator_list(tree, pinfo, tvb, offset, "unicastReplyLocatorList", encoding); /* multicastReplyLocatorList */ if ((flags & FLAG_INFO_REPLY_M) != 0) { /*offset = */rtps_util_add_locator_list(tree, pinfo, tvb, offset, "multicastReplyLocatorList", encoding); } } /* *********************************************************************** */ /* * RTI CRC * */ /* *********************************************************************** */ static void dissect_RTI_CRC(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, gint octets_to_next_header,proto_tree *tree) { /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | RTI_CRC |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | RTPS Message length (without the 20 bytes header) | * +---------------+---------------+---------------+---------------+ * | CRC32 | * +---------------+---------------+---------------+---------------+ Total 12 bytes */ proto_item *octet_item; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTI_CRC_FLAGS, flags); octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); if (octets_to_next_header != 8) { expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 8)"); return; } offset += 4; proto_tree_add_item(tree, hf_rtps_sm_rti_crc_number, tvb, offset, 4, encoding); offset += 4; proto_tree_add_item(tree, hf_rtps_sm_rti_crc_result, tvb, offset, 4, ENC_BIG_ENDIAN); } static void dissect_SECURE(tvbuff_t *tvb, packet_info *pinfo _U_, gint offset, guint8 flags, const guint encoding _U_, int octets_to_next_header, proto_tree *tree, guint16 vendor_id _U_) { /* *********************************************************************** */ /* * SECURE SUBMESSAGE * */ /* *********************************************************************** */ /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | SECURE SUBMSG |X|X|X|X|X|X|S|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | long transformationKind | * +---------------+---------------+---------------+---------------+ * | | * + octet transformationId[8] + * | | * +---------------+---------------+---------------+---------------+ * | | * + octet secure_data[] + * | | * +---------------+---------------+---------------+---------------+ */ proto_tree * payload_tree; guint local_encoding; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, SECURE_FLAGS, flags); local_encoding = ((flags & FLAG_E) != 0) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN; proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, local_encoding); offset += 4; payload_tree = proto_tree_add_subtree_format(tree, tvb, offset, octets_to_next_header, ett_rtps_secure_payload_tree, NULL, "Secured payload"); proto_tree_add_item(payload_tree, hf_rtps_secure_secure_data_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(payload_tree, hf_rtps_secure_secure_data, tvb, offset, octets_to_next_header-4, local_encoding); } static void dissect_SECURE_PREFIX(tvbuff_t *tvb, packet_info *pinfo _U_, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id _U_) { /* * MIG_RTPS_SECURE_RTPS_PREFIX and MIG_RTPS_SECURE_PREFIX share same serialization: * 0...2...........8...............16.............24...............32 * +---------------+---------------+---------------+---------------+ * | 0x33 / 0x31 |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + SecureDataHeader sec_data_header + * | | * +---------------+---------------+---------------+---------------+ * * where SecureDataHeader is: * * SecureDataHeader: TransformationIdentifier (kind + key) + plugin_sec_header * 0...2...........8...............16.............24...............32 * +---------------+---------------+---------------+---------------+ * | octet transformation_kind[4] | * +---------------+---------------+---------------+---------------+ * | | * + octet transformation_key_id[4] + * | | * +---------------+---------------+---------------+---------------+ * | | * ~ octet plugin_sec_header[] ~ * | | * +---------------+---------------+---------------+---------------+ */ proto_tree * sec_data_header_tree; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, SECURE_PREFIX_FLAGS, flags); proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); offset += 4; sec_data_header_tree = proto_tree_add_subtree_format(tree, tvb, offset, octets_to_next_header, ett_rtps_secure_dataheader_tree, NULL, "Secure Data Header"); /* Transformation Kind field used to be 4 bytes. Now it is splitted: * - 3 bytes: Transformation Key Revision * - 1 byte: Transformation Kind * A single byte is enough for Transformation Kind since it only has five possible values (0-4). */ proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_key_revision_id, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_kind, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_key_id, tvb, offset, 4, encoding); offset += 4; proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_plugin_sec_header, tvb, offset, octets_to_next_header-8, encoding); } static void dissect_SECURE_POSTFIX(tvbuff_t *tvb, packet_info *pinfo _U_, gint offset, guint8 flags, const guint encoding, int octets_to_next_header, proto_tree *tree, guint16 vendor_id _U_) { /* * MIG_RTPS_SECURE_RTPS_POSTFIX and MIG_RTPS_SECURE_POSTFIX share the same serialization: * 0...2...........8...............16.............24...............32 * +---------------+---------------+---------------+---------------+ * | 0x34 / 0x32 |X|X|X|X|X|X|X|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | | * + SecureDataTag sec_data_tag + * | | * +---------------+---------------+---------------+---------------+ * * where SecureDataTag is: * 0...2...........8...............16.............24...............32 * +---------------+---------------+---------------+---------------+ * | | * ~ octet plugin_sec_tag[] ~ * | | * +---------------+---------------+---------------+---------------+ */ proto_tree * sec_data_tag_tree; proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, SECURE_POSTFIX_FLAGS, flags); proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding); offset += 4; sec_data_tag_tree = proto_tree_add_subtree_format(tree, tvb, offset, octets_to_next_header, ett_rtps_secure_dataheader_tree, NULL, "Secure Data Tag"); proto_tree_add_item(sec_data_tag_tree, hf_rtps_secure_datatag_plugin_sec_tag, tvb, offset, octets_to_next_header, encoding); } /* * 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | BINDING_PING |X|X|X|X|X|B|L|E| octetsToNextHeader | * +---------------+---------------+---------------+---------------+ * | DDS_UnsignedLong rtps_port | * +---------------+---------------+---------------+---------------+ * | | * + DDS_Octet address[12][If L = 0] + * | | * + + * | | * +---------------+---------------+---------------+---------------+ * | | * + DDS_Octet address[16][If L = 1] + * | | * + + * | | * + + * | | * +---------------+---------------+---------------+---------------+ * */ static void dissect_UDP_WAN_BINDING_PING(tvbuff_t *tvb, packet_info *pinfo _U_, gint offset, guint8 flags, const guint encoding, int octets_to_next_header _U_, proto_tree *tree, guint16 vendor_id _U_) { const guint flags_offset = offset + 1; const guint next_header_offset = flags_offset + 1; const guint port_offset = next_header_offset + 2; const guint address_offset = port_offset + 4; proto_tree_add_bitmask_value(tree, tvb, flags_offset, hf_rtps_udpv4_wan_binding_ping_flags, ett_rtps_flags, UDPV4_WAN_BINDING_PING_FLAGS, flags); proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, next_header_offset, 2, encoding); proto_tree_add_item(tree, hf_rtps_udpv4_wan_binding_ping_port, tvb, port_offset, 4, encoding); /* * Address[12] [If L=0] is the only one we currently support, and it maps to: * DDS_Octet UUID[9] + 3 bytes of padding. */ if (flags & FLAG_UDPV4_WAN_BINDING_PING_FLAG_L) { proto_tree_add_item( tree, hf_rtps_long_address, tvb, address_offset, LONG_ADDRESS_SIZE, encoding); } else { proto_tree_add_item( tree, hf_rtps_uuid, tvb, address_offset, UUID_SIZE, encoding); } } static gboolean dissect_rtps_submessage_v2(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, guint8 submessageId, guint16 vendor_id, gint octets_to_next_header, proto_tree *rtps_submessage_tree, proto_item *submessage_item, endpoint_guid * guid, endpoint_guid * dst_guid) { switch (submessageId) { case SUBMESSAGE_HEADER_EXTENSION: dissect_HEADER_EXTENSION(tvb, pinfo, offset, flags, encoding, rtps_submessage_tree, octets_to_next_header, vendor_id); break; case SUBMESSAGE_DATA_FRAG: dissect_DATA_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, guid); break; case SUBMESSAGE_NOKEY_DATA_FRAG: dissect_NOKEY_DATA_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id); break; case SUBMESSAGE_NACK_FRAG: dissect_NACK_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); break; case SUBMESSAGE_ACKNACK_SESSION: case SUBMESSAGE_ACKNACK_BATCH: dissect_ACKNACK(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, dst_guid); break; case SUBMESSAGE_APP_ACK: dissect_APP_ACK(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, guid); break; case SUBMESSAGE_APP_ACK_CONF: dissect_APP_ACK_CONF(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, guid); break; case SUBMESSAGE_HEARTBEAT_SESSION: case SUBMESSAGE_HEARTBEAT_BATCH: dissect_HEARTBEAT_BATCH(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, guid); break; case SUBMESSAGE_HEARTBEAT_FRAG: dissect_HEARTBEAT_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, guid); break; case SUBMESSAGE_HEARTBEAT_VIRTUAL: dissect_HEARTBEAT_VIRTUAL(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, guid); break; case SUBMESSAGE_RTPS_DATA_SESSION: { dissect_RTPS_DATA_SESSION(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, guid); break; } case SUBMESSAGE_RTPS_DATA: dissect_RTPS_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, FALSE, guid); break; case SUBMESSAGE_RTI_DATA_FRAG_SESSION: case SUBMESSAGE_RTPS_DATA_FRAG: dissect_RTPS_DATA_FRAG_kind(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, (submessageId == SUBMESSAGE_RTI_DATA_FRAG_SESSION), guid); break; case SUBMESSAGE_RTPS_DATA_BATCH: dissect_RTPS_DATA_BATCH(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, guid); break; case SUBMESSAGE_RTI_CRC: if (vendor_id == RTPS_VENDOR_RTI_DDS) { dissect_RTI_CRC(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); } break; case SUBMESSAGE_SEC_BODY: dissect_SECURE(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id); break; case SUBMESSAGE_SEC_PREFIX: case SUBMESSAGE_SRTPS_PREFIX: dissect_SECURE_PREFIX(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id); break; case SUBMESSAGE_SEC_POSTFIX: case SUBMESSAGE_SRTPS_POSTFIX: dissect_SECURE_POSTFIX(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id); break; case SUBMESSAGE_RTI_UDP_WAN_BINDING_PING: dissect_UDP_WAN_BINDING_PING(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id); break; default: return FALSE; } return TRUE; } static gboolean dissect_rtps_submessage_v1(tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 flags, const guint encoding, guint8 submessageId, guint16 version, guint16 vendor_id, gint octets_to_next_header, proto_tree *rtps_submessage_tree, proto_item *submessage_item, endpoint_guid * guid, endpoint_guid * dst_guid) { switch (submessageId) { case SUBMESSAGE_PAD: dissect_PAD(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); break; case SUBMESSAGE_DATA: if (version < 0x0200) { dissect_DATA_v1(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); } else { dissect_DATA_v2(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id, guid); } break; case SUBMESSAGE_NOKEY_DATA: dissect_NOKEY_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, version, vendor_id); break; case SUBMESSAGE_ACKNACK: dissect_ACKNACK(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, dst_guid); break; case SUBMESSAGE_HEARTBEAT: dissect_HEARTBEAT(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, version, guid); break; case SUBMESSAGE_GAP: dissect_GAP(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, guid); break; case SUBMESSAGE_INFO_TS: dissect_INFO_TS(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); break; case SUBMESSAGE_INFO_SRC: dissect_INFO_SRC(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, version); break; case SUBMESSAGE_INFO_REPLY_IP4: dissect_INFO_REPLY_IP4(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); break; case SUBMESSAGE_INFO_DST: dissect_INFO_DST(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, version, dst_guid); break; case SUBMESSAGE_INFO_REPLY: dissect_INFO_REPLY(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree); break; default: return FALSE; } return TRUE; } /***************************************************************************/ /* The main packet dissector function */ static gboolean dissect_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { proto_item *ti; proto_tree *rtps_tree; guint8 majorRev; guint16 version, vendor_id; gboolean is_ping; endpoint_guid guid; endpoint_guid *guid_copy; guint32 magic_number; gchar domain_id_str[RTPS_UNKNOWN_DOMAIN_ID_STR_LEN] = RTPS_UNKNOWN_DOMAIN_ID_STR; gboolean is_domain_id_calculated = FALSE; const char* not_accuracy_str = ""; gint length_remaining = 0; rtps_tvb_field rtps_root; /* Check 'RTPS' signature: * A header is invalid if it has less than 16 octets */ length_remaining = tvb_reported_length_remaining(tvb, offset); if (length_remaining < 16) return FALSE; magic_number = tvb_get_ntohl(tvb, offset); if (magic_number != RTPX_MAGIC_NUMBER && magic_number != RTPS_MAGIC_NUMBER) { return FALSE; } /* Distinguish between RTPS 1.x and 2.x here */ majorRev = tvb_get_guint8(tvb,offset+4); if ((majorRev != 1) && (majorRev != 2)) return FALSE; /* No fields have been set in GUID yet. */ guid.fields_present = 0; /* Save the begining of the RTPS message */ rtps_root.tvb = tvb; rtps_root.tvb_offset = offset; rtps_root.tvb_len = tvb_reported_length_remaining(tvb, offset); p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY, (gpointer*)&rtps_root); col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPS"); col_clear(pinfo->cinfo, COL_INFO); /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_rtps, tvb, 0, -1, ENC_NA); rtps_tree = proto_item_add_subtree(ti, ett_rtps); /* magic */ proto_tree_add_item(rtps_tree, hf_rtps_magic, tvb, 0, 4, ENC_NA | ENC_ASCII); /* Protocol Version */ version = rtps_util_add_protocol_version(rtps_tree, tvb, offset+4); /* Vendor Id */ vendor_id = rtps_util_add_vendor_id(rtps_tree, tvb, offset+6); is_ping = rtps_is_ping(tvb, pinfo, offset+8); if (is_ping) { dissect_PING(tvb, offset + 8, ENC_BIG_ENDIAN, length_remaining - 8, rtps_tree); } else { if (version < 0x0200) rtps_util_add_guid_prefix_v1(rtps_tree, tvb, offset+8, hf_rtps_guid_prefix_v1, hf_rtps_host_id, hf_rtps_app_id, hf_rtps_app_id_instance_id, hf_rtps_app_id_app_kind, NULL); else rtps_util_add_guid_prefix_v2(rtps_tree, tvb, offset+8, hf_rtps_guid_prefix_src, hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix); guid.host_id = tvb_get_ntohl(tvb, offset+8); guid.app_id = tvb_get_ntohl(tvb, offset+12); guid.instance_id = tvb_get_ntohl(tvb, offset+16); guid.fields_present = GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID; /* If the packet uses TCP we need top store the participant GUID to get the domainId later * For that operation the member fields_present is not required and is not affected by * its changes. */ guid_copy = (endpoint_guid*)wmem_memdup(pinfo->pool, (const void*)&guid, sizeof(endpoint_guid)); p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY, (gpointer)guid_copy); #ifdef RTI_BUILD pinfo->guid_prefix_host = tvb_get_ntohl(tvb, offset + 8); pinfo->guid_prefix_app = tvb_get_ntohl(tvb, offset + 12); pinfo->guid_prefix_count = tvb_get_ntohl(tvb, offset + 16); pinfo->guid_rtps2 = 1; #endif } /* Extract the domain id and participant index */ { int domain_id, doffset, participant_idx = 0, nature; proto_tree *mapping_tree; /* For a complete description of these rules, see RTPS documentation RTPS 1.2 mapping: domain_id = ((pinfo->destport - PORT_BASE)/10) % 100; participant_idx = (pinfo->destport - PORT_BASE) / 1000; nature = (pinfo->destport % 10); For Unicast, the port mapping formula is: metatraffic_unicast_port = port_base + (domain_id_gain * domain_id) + (participant_id_gain * participant_id) + builtin_unicast_port_offset For Multicast, the port mapping is: metatraffic_multicast_port = port_base + (domain_id_gain * domain_id) + builtin_multicast_port_offset Where the constants are: port_base = 7400 domain_id_gain = 250 participant_id_gain = 2 builtin_multicast_port_offset = 0 builtin_unicast_port_offset = 10 user_multicast_port_offset = 1 user_unicast_port_offset = 11 To obtain the individual components from the port number, the reverse formulas are: domain_id = (port - port_base) / 250 (valid both multicast / unicast) Doffset = (port - port_Base - (domain_id * 250)); participant_idx = (Doffset - 10) / 2; */ if (version < 0x0200) { /* If using TCP domainId cannot deduced from the port. It must be taken from the participant * discovery packets or Unknown. */ domain_id = get_domain_id_from_tcp_discovered_participants(discovered_participants_domain_ids, &guid); if (pinfo->ptype != PT_TCP && domain_id == RTPS_UNKNOWN_DOMAIN_ID_VAL) { domain_id = ((pinfo->destport - PORT_BASE) / 10) % 100; is_domain_id_calculated = TRUE; } participant_idx = (pinfo->destport - PORT_BASE) / 1000; nature = (pinfo->destport % 10); } else { domain_id = get_domain_id_from_tcp_discovered_participants(discovered_participants_domain_ids, &guid); if (pinfo->ptype != PT_TCP && pinfo->destport > PORT_BASE && domain_id == RTPS_UNKNOWN_DOMAIN_ID_VAL) { domain_id = (pinfo->destport - PORT_BASE) / DOMAIN_GAIN; is_domain_id_calculated = TRUE; } doffset = (pinfo->destport - PORT_BASE - domain_id * DOMAIN_GAIN); if (doffset == 0) { nature = PORT_METATRAFFIC_MULTICAST; } else if (doffset == 1) { nature = PORT_USERTRAFFIC_MULTICAST; } else { participant_idx = (doffset - 10) / 2; if ((doffset - 10) % 2 == 0) { nature = PORT_METATRAFFIC_UNICAST; } else { nature = PORT_USERTRAFFIC_UNICAST; } } if (domain_id > 232 || domain_id < 0) { domain_id = RTPS_UNKNOWN_DOMAIN_ID_VAL; } } /* Used string for the domain participant to show Unknown if the domainId is not known when using TCP*/ if (domain_id != RTPS_UNKNOWN_DOMAIN_ID_VAL) { snprintf(domain_id_str, RTPS_UNKNOWN_DOMAIN_ID_STR_LEN, "%"PRId32, domain_id); if (is_domain_id_calculated) { not_accuracy_str = " (Based on calculated domainId. Might not be accurate)"; } } if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) || (version < 0x0200)) { mapping_tree = proto_tree_add_subtree_format(rtps_tree, tvb, 0, 0, ett_rtps_default_mapping, NULL, "Default port mapping%s: domainId=%s, " "participantIdx=%d, nature=%s", not_accuracy_str, domain_id_str, participant_idx, val_to_str(nature, nature_type_vals, "%02x")); } else { mapping_tree = proto_tree_add_subtree_format(rtps_tree, tvb, 0, 0, ett_rtps_default_mapping, NULL, "Default port mapping%s: %s, domainId=%s", not_accuracy_str, val_to_str(nature, nature_type_vals, "%02x"), domain_id_str); } ti = proto_tree_add_uint(mapping_tree, hf_rtps_domain_id, tvb, 0, 0, domain_id); proto_item_set_generated(ti); if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) || (version < 0x0200)) { ti = proto_tree_add_uint(mapping_tree, hf_rtps_participant_idx, tvb, 0, 0, participant_idx); proto_item_set_generated(ti); } ti = proto_tree_add_uint(mapping_tree, hf_rtps_nature_type, tvb, 0, 0, nature); proto_item_set_generated(ti); } /* offset behind RTPS's Header (need to be set in case tree=NULL)*/ offset += ((version < 0x0200) ? 16 : 20); dissect_rtps_submessages(tvb, offset, pinfo, rtps_tree, version, vendor_id, &guid); /* If TCP there's an extra OOB byte at the end of the message */ /* TODO: What to do with it? */ return TRUE; } /* dissect_rtps(...) */ static void append_submessage_col_info(packet_info* pinfo, submessage_col_info* current_submessage_col_info) { gboolean* is_data_session_intermediate = NULL; /* Status info clumn: (r),(p[U])...*/ if (current_submessage_col_info->status_info != NULL) { col_append_str(pinfo->cinfo, COL_INFO, current_submessage_col_info->status_info); } /* DATA_SESSION last package */ is_data_session_intermediate = (gboolean*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY); if (is_data_session_intermediate != NULL && !*is_data_session_intermediate) { current_submessage_col_info->data_session_kind = "(Last)"; col_append_str(pinfo->cinfo, COL_INFO, current_submessage_col_info->data_session_kind); } /* Topic name */ if (current_submessage_col_info->topic_name != NULL) { col_append_sep_str(pinfo->cinfo, COL_INFO, " -> ", current_submessage_col_info->topic_name); } } void dissect_rtps_submessages( tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *rtps_tree, guint16 version, guint16 vendor_id, endpoint_guid *guid) { guint8 submessageId, flags; int sub_hf; const value_string *sub_vals; proto_item *ti; proto_tree *rtps_submessage_tree; guint encoding; gint next_submsg, octets_to_next_header; endpoint_guid dst_guid; submessage_col_info current_submessage_col_info = {NULL, NULL, NULL}; /* No fields have been set in GUID yet. */ dst_guid.fields_present = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { submessageId = tvb_get_guint8(tvb, offset); if (version < 0x0200) { sub_hf = hf_rtps_sm_id; sub_vals = submessage_id_vals; } else { if ((submessageId & 0x80) && (vendor_id == RTPS_VENDOR_RTI_DDS)) { sub_hf = hf_rtps_sm_idv2; sub_vals = submessage_id_rti; } else { sub_hf = hf_rtps_sm_idv2; sub_vals = submessage_id_valsv2; } } col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(submessageId, sub_vals, "Unknown[%02x]")); /* Creates the subtree 'Submessage: XXXX' */ if (submessageId & 0x80) { if (vendor_id == RTPS_VENDOR_RTI_DDS) { ti = proto_tree_add_uint_format_value(rtps_tree, sub_hf, tvb, offset, 1, submessageId, "%s", val_to_str(submessageId, submessage_id_rti, "Vendor-specific (0x%02x)")); } else { ti = proto_tree_add_uint_format_value(rtps_tree, sub_hf, tvb, offset, 1, submessageId, "Vendor-specific (0x%02x)", submessageId); } } else { ti = proto_tree_add_uint(rtps_tree, sub_hf, tvb, offset, 1, submessageId); } rtps_submessage_tree = proto_item_add_subtree(ti, ett_rtps_submessage); /* Gets the flags */ flags = tvb_get_guint8(tvb, offset + 1); /* Gets the E (Little endian) flag */ encoding = ((flags & FLAG_E) != 0) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN; /* Octets-to-next-header */ octets_to_next_header = tvb_get_guint16(tvb, offset + 2, encoding); if ((octets_to_next_header == 0) && (version >= 0x0200) && (submessageId != SUBMESSAGE_PAD) && (submessageId != SUBMESSAGE_INFO_TS)) { octets_to_next_header = tvb_reported_length_remaining(tvb, offset + 4); } next_submsg = offset + octets_to_next_header + 4; /* Set length of this item */ proto_item_set_len(ti, octets_to_next_header + 4); /* Now decode each single submessage * The offset passed to the dissectors points to the start of the * submessage (at the ID byte). */ p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY, (gpointer*)&current_submessage_col_info); if (!dissect_rtps_submessage_v1(tvb, pinfo, offset, flags, encoding, submessageId, version, vendor_id, octets_to_next_header, rtps_submessage_tree, ti, guid, &dst_guid)) { if ((version < 0x0200) || !dissect_rtps_submessage_v2(tvb, pinfo, offset, flags, encoding, submessageId, vendor_id, octets_to_next_header, rtps_submessage_tree, ti, guid, &dst_guid)) { proto_tree_add_uint(rtps_submessage_tree, hf_rtps_sm_flags, tvb, offset + 1, 1, flags); proto_tree_add_uint(rtps_submessage_tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, octets_to_next_header); } } append_submessage_col_info(pinfo, &current_submessage_col_info); /* Reset the col info for the next submessage */ current_submessage_col_info.data_session_kind = NULL; current_submessage_col_info.status_info = NULL; current_submessage_col_info.topic_name = NULL; /* next submessage's offset */ offset = next_submsg; } } static gboolean dissect_rtps_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; return dissect_rtps(tvb, pinfo, tree, offset); } static gboolean dissect_rtps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* In RTPS over TCP the first 4 bytes are the packet length * as 32-bit unsigned int coded as BIG ENDIAN * guint32 tcp_len = tvb_get_ntohl(tvb, offset); */ gint offset = 4; return dissect_rtps(tvb, pinfo, tree, offset); } static gboolean dissect_rtps_rtitcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; return dissect_rtps(tvb, pinfo, tree, offset); } static int dissect_simple_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; if (dissect_rtps(tvb, pinfo, tree, offset) == FALSE) return 0; return tvb_captured_length(tvb); } /* * Type InstanceStateDataresponse is sent as user user data but there is no discovery data for it. * So it is necessary to add it manually so Wireshark can dissect it */ static void initialize_instance_state_data_response_dissection_info(builtin_types_dissection_data_t *_builtin_types_dissection_data) { guint32 element = 0; const guint64 InstanceStateDataResponse_type_id = 0x9d6d4c879b0e6aa9; const guint64 sequence_100_InstanceTransitionData_type_id = 0x2dac07d5577caaf6; const guint64 guid_t_type_id = 0x36d940c4ed806097; const guint64 value_type_id = 0x974064b1120169ed; const guint64 instancetransitiondata_type_id = 0xceb6f5e405f4bde7; const guint64 KeyHashValue_type_id = 0x48725f37453310ed; const guint64 SerializedKey_type_id = 0x3fd77a8ff43c7e55; const guint64 payload_type_id = 0x0d0ecc8d34a5c3ab; const guint64 ntptime_t_type_id = 0x842c59af7e962a4c; const guint64 sequencenumber_t_type_id = 0xb933efe30d85453b; /* * @appendable @nested * struct GUID_t { * octet value[16]; * }; * @appendable @nested * struct SequenceNumber_t { * long high; * unsigned long low; * }; * * @final @nested * struct NtpTime_t { * int32 sec; * uint32 frac; * }; * @final @nested * struct SerializedKey { * sequence<octet> payload; * }; * typedef octet KeyHashValue[16]; * * struct InstanceTransitionData { * @optional KeyHashValue key_hash; * @optional SerializedKey serialized_key; * NtpTime_t last_update_timestamp; * SequenceNumber_t transition_sequence_number; * }; */ /* All dissection_infos are added to the "dissction_infos" map */ /* value */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.value_dissection_info.member_name, "value", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.value_dissection_info.num_elements = VALUE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.value_dissection_info.bound = VALUE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.value_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE; _builtin_types_dissection_data->dissection_infos.value_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE; _builtin_types_dissection_data->dissection_infos.value_dissection_info.type_id = value_type_id; _builtin_types_dissection_data->dissection_infos.value_dissection_info.bound = VALUE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.value_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.value_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.value_dissection_info)); /* GUID_t */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.member_name, "GUID_t", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.num_elements = GUID_T_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE; _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.type_id = guid_t_type_id; _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS); /* octet value[16] */ _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].flags = 0; _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].member_id = 0; _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].type_id = value_type_id; g_strlcpy(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].member_name, "value", MAX_TOPIC_AND_TYPE_LENGTH); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info)); /* Payload */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.payload_dissection_info.member_name, "payload", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.payload_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE; _builtin_types_dissection_data->dissection_infos.payload_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE; _builtin_types_dissection_data->dissection_infos.payload_dissection_info.type_id = payload_type_id; _builtin_types_dissection_data->dissection_infos.payload_dissection_info.bound = -1; _builtin_types_dissection_data->dissection_infos.payload_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.payload_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.payload_dissection_info)); /* KeyHashValue */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.member_name, "KeyHashValue", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.num_elements = KEY_HAS_VALUE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.bound = KEY_HAS_VALUE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE; _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE; _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.type_id = KeyHashValue_type_id; _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.bound = KEY_HAS_VALUE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info)); /* SerializedKey */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.member_name, "SerializedKey", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.num_elements = GUID_T_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE; _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.type_id = SerializedKey_type_id; _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS); /* sequence<octet> payload */ _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].flags = 0; _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].member_id = 0; _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].type_id = payload_type_id; g_strlcpy(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].member_name, "payload", MAX_TOPIC_AND_TYPE_LENGTH); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info)); /* NtpTime_t */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.member_name, "NtpTime_t", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.num_elements = NTPTIME_T_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.type_id = ntptime_t_type_id; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, NTPTIME_T_NUM_ELEMENTS); /* int32 sec */ _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].flags = 0; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].member_id = 0; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE; g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].member_name, "sec", MAX_TOPIC_AND_TYPE_LENGTH); /* uint32 frac */ _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].flags = 0; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].member_id = 1; _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE; g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].member_name, "frac", MAX_TOPIC_AND_TYPE_LENGTH); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info)); /* SequenceNumber_t */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.member_name, "SequenceNumber_t", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.num_elements = SEQUENCE_NUMBER_T_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.type_id = sequencenumber_t_type_id; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, SEQUENCE_NUMBER_T_NUM_ELEMENTS); _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].flags = 0; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].member_id = 0; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE; g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].member_name, "high", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].flags = 0; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].member_id = 1; _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE; g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].member_name, "low", MAX_TOPIC_AND_TYPE_LENGTH); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info)); /* Instance transition Data */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.member_name, "InstanceTransitionData", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.num_elements = INSTANCE_TRANSITION_DATA_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.type_id = instancetransitiondata_type_id; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, INSTANCE_TRANSITION_DATA_NUM_ELEMENTS); wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info)); for (element = 0; element < _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.num_elements; ++element) { switch (element) { case 0: /* @optional KeyHashValue key_hash */ _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = MEMBER_OPTIONAL; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = KeyHashValue_type_id; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "key_hash", MAX_TOPIC_AND_TYPE_LENGTH); break; case 1: /* @optional SerializedKey serialized_key */ _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = MEMBER_OPTIONAL; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = SerializedKey_type_id; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "serialized_key", MAX_TOPIC_AND_TYPE_LENGTH); break; case 2: /* NtpTime_t last_update_timestamp */ _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = 0; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = ntptime_t_type_id; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "last_update_timestamp", MAX_TOPIC_AND_TYPE_LENGTH); break; case 3: /* SequenceNumber_t transition_sequence_number */ _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = 0; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element; _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = sequencenumber_t_type_id; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "transition_sequence_number", MAX_TOPIC_AND_TYPE_LENGTH); break; } } /* InstanceStateDataResponse * struct InstanceStateDataResponse { * @optional sequence<InstanceTransitionData> alive_instances; * @optional sequence<InstanceTransitionData> disposed_instances; * @optional sequence<InstanceTransitionData> unregistered_instances; * GUID_t writer_guid; * GUID_t reader_guid; * uint32 reader_group_oid; * boolean complete_snapshot; * }; */ /* This type mapping is not available in the "registry" map. It is used in the function * rtps_util_get_topic_info when the endopint GUID determines that the type is InstanceStateDataResponse */ _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.type_id = InstanceStateDataResponse_type_id; _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.guid.entity_id = ENTITYID_NORMAL_META_GROUP_READER; _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.guid.fields_present = GUID_HAS_ALL; _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.fields_visited = TOPIC_INFO_ALL_SET; g_strlcpy(_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.topic_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH); g_strlcpy(_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.type_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH); g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.member_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.num_elements = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.bound = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.base_type_id = 0; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.type_id = InstanceStateDataResponse_type_id; wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info)); /* sequence_100_InstanceTransitionData */ g_strlcpy(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.member_name, "sequence_100_InstanceTransitionData", MAX_TOPIC_AND_TYPE_LENGTH); _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.num_elements = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS; _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.bound = SEQUENCE_100_IINSTANCE_TRANSITION_DATA_BOUND; _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE; _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.base_type_id = instancetransitiondata_type_id; _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.type_id = sequence_100_InstanceTransitionData_type_id; wmem_map_insert( builtin_dissection_infos, &(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.type_id), (void*)&(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info)); /* @optional sequence<InstanceTransitionData> alive_instances */ for (element = 0; element < _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.num_elements; ++element) { switch (element) { case 0: /* @optional sequence<InstanceTransitionData> alive_instances */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "alive_instances", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; case 1: /* @optional sequence<InstanceTransitionData> disposed_instances */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "disposed_instances", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; case 2: /* @optional sequence<InstanceTransitionData> unregistered_instances */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "unregistered_instances", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; case 3: /* GUID_t writer_guid */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "writer_gid", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = guid_t_type_id; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; case 4: /* GUID_t reader_guid */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "reader_gid", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = guid_t_type_id; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; case 5: /* uint32 reader_group_oid */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "reader_group_oid", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; case 6: /* boolean complete_snapshot */ _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0; g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "complete_snapshot", MAX_MEMBER_NAME); _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE; _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element; break; } } } void proto_register_rtps(void) { static hf_register_info hf[] = { { &hf_rtps_ping, { "Ping String", "rtps.ping_str", FT_STRING, BASE_NONE, NULL, 0, "RTPS Ping String", HFILL } }, { &hf_rtps_magic, { "Magic", "rtps.magic", FT_STRING, BASE_NONE, NULL, 0, "RTPS magic", HFILL } }, /* Protocol Version (composed as major.minor) -------------------------- */ { &hf_rtps_protocol_version, { "version", "rtps.version", FT_UINT16, BASE_HEX, NULL, 0, "RTPS protocol version number", HFILL } }, { &hf_rtps_protocol_version_major, { "major", "rtps.version.major", FT_INT8, BASE_DEC, NULL, 0, "RTPS major protocol version number", HFILL } }, { &hf_rtps_protocol_version_minor, { "minor", "rtps.version.minor", FT_INT8, BASE_DEC, NULL, 0, "RTPS minor protocol version number", HFILL } }, /* Domain Participant and Participant Index ---------------------------- */ { &hf_rtps_domain_id, { "domain_id", "rtps.domain_id", FT_UINT32, BASE_DEC, NULL, 0, "Domain ID", HFILL } }, { &hf_rtps_domain_tag, { "domain_tag", "rtps.domain_tag", FT_STRINGZ, BASE_NONE, NULL, 0, "Domain Tag ID", HFILL } }, { &hf_rtps_participant_idx, { "participant_idx", "rtps.participant_idx", FT_UINT32, BASE_DEC, NULL, 0, "Participant index", HFILL } }, { &hf_rtps_nature_type, { "traffic_nature", "rtps.traffic_nature", FT_UINT32, BASE_DEC, VALS(nature_type_vals), 0, "Nature of the traffic (meta/user-traffic uni/multi-cast)", HFILL } }, /* Vendor ID ----------------------------------------------------------- */ { &hf_rtps_vendor_id, { "vendorId", "rtps.vendorId", FT_UINT16, BASE_HEX, NULL, 0, "Unique identifier of the DDS vendor that generated this packet", HFILL } }, /* Guid Prefix for the Packet ------------------------------------------ */ { &hf_rtps_guid_prefix_v1, { "guidPrefix", "rtps.guidPrefix_v1", FT_UINT64, BASE_HEX, NULL, 0, "GuidPrefix of the RTPS packet", HFILL } }, { &hf_rtps_guid_prefix, { "guidPrefix", "rtps.guidPrefix", FT_BYTES, BASE_NONE, NULL, 0, "a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)", HFILL } }, { &hf_rtps_guid_prefix_src, { "guidPrefix", "rtps.guidPrefix.src", FT_BYTES, BASE_NONE, NULL, 0, "the guidPrefix of the entity sending the sample", HFILL } }, { &hf_rtps_guid_prefix_dst, { "guidPrefix", "rtps.guidPrefix.dst", FT_BYTES, BASE_NONE, NULL, 0, "the guidPrefix of the entity receiving the sample", HFILL } }, /* Host ID ------------------------------------------------------------- */ { &hf_rtps_host_id, { /* HIDDEN */ "hostId", "rtps.hostId", FT_UINT32, BASE_HEX, NULL, 0, "Sub-component 'hostId' of the GuidPrefix of the RTPS packet", HFILL } }, /* AppID (composed as instanceId, appKind) ----------------------------- */ { &hf_rtps_app_id, { "appId", "rtps.appId", FT_UINT32, BASE_HEX, NULL, 0, "Sub-component 'appId' of the GuidPrefix of the RTPS packet", HFILL } }, { &hf_rtps_app_id_instance_id, { "appId.instanceId", "rtps.appId.instanceId", FT_UINT24, BASE_HEX, NULL, 0, "'instanceId' field of the 'AppId' structure", HFILL } }, { &hf_rtps_app_id_app_kind, { "appid.appKind", "rtps.appId.appKind", FT_UINT8, BASE_HEX, VALS(app_kind_vals), 0, "'appKind' field of the 'AppId' structure", HFILL } }, /* Submessage ID ------------------------------------------------------- */ { &hf_rtps_sm_id, { "submessageId", "rtps.sm.id", FT_UINT8, BASE_HEX, VALS(submessage_id_vals), 0, "defines the type of submessage", HFILL } }, { &hf_rtps_sm_idv2, { "submessageId", "rtps.sm.id", FT_UINT8, BASE_HEX, VALS(submessage_id_valsv2), 0, "defines the type of submessage", HFILL } }, /* Submessage flags ---------------------------------------------------- */ { &hf_rtps_sm_flags, { "Flags", "rtps.sm.flags", FT_UINT8, BASE_HEX, NULL, 0, "bitmask representing the flags associated with a submessage", HFILL } }, { &hf_rtps_sm_flags2, { "Flags", "rtps.sm.flags", FT_UINT16, BASE_HEX, NULL, 0, "bitmask representing the flags associated with a submessage", HFILL } }, /* octets to next header ---------------------------------------------- */ { &hf_rtps_sm_octets_to_next_header, { "octetsToNextHeader", "rtps.sm.octetsToNextHeader", FT_UINT16, BASE_DEC, NULL, 0, "Size of the submessage payload", HFILL } }, /* GUID as {GuidPrefix, EntityId} ------------------------------------ */ { &hf_rtps_sm_guid_prefix_v1, { "guidPrefix", "rtps.sm.guidPrefix_v1", FT_UINT64, BASE_HEX, NULL, 0, "a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)", HFILL } }, { &hf_rtps_sm_guid_prefix, { "guidPrefix", "rtps.sm.guidPrefix", FT_BYTES, BASE_NONE, NULL, 0, "a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)", HFILL } }, { &hf_rtps_sm_host_id, { "host_id", "rtps.sm.guidPrefix.hostId", FT_UINT32, BASE_HEX, NULL, 0, "The hostId component of the rtps.sm.guidPrefix", HFILL } }, { &hf_rtps_sm_app_id, { "appId", "rtps.sm.guidPrefix.appId", FT_UINT32, BASE_HEX, NULL, 0, "AppId component of the rtps.sm.guidPrefix", HFILL } }, { &hf_rtps_sm_instance_id_v1, { "instanceId", "rtps.sm.guidPrefix.appId.instanceId", FT_UINT24, BASE_HEX, NULL, 0, "instanceId component of the AppId of the rtps.sm.guidPrefix", HFILL } }, { &hf_rtps_sm_app_kind, { "appKind", "rtps.sm.guidPrefix.appId.appKind", FT_UINT8, BASE_HEX, NULL, 0, "appKind component of the AppId of the rtps.sm.guidPrefix", HFILL } }, { &hf_rtps_sm_instance_id, { "instanceId", "rtps.sm.guidPrefix.instanceId", FT_UINT32, BASE_HEX, NULL, 0, "instanceId component of the rtps.sm.guidPrefix", HFILL } }, /* Entity ID (composed as entityKey, entityKind) ----------------------- */ { &hf_rtps_sm_entity_id, { "entityId", "rtps.sm.entityId", FT_UINT32, BASE_HEX, VALS(entity_id_vals), 0, "Object entity ID as it appears in a DATA submessage (keyHashSuffix)", HFILL } }, { &hf_rtps_sm_entity_id_key, { "entityKey", "rtps.sm.entityId.entityKey", FT_UINT24, BASE_HEX, NULL, 0, "'entityKey' field of the object entity ID", HFILL } }, { &hf_rtps_sm_entity_id_kind, { "entityKind", "rtps.sm.entityId.entityKind", FT_UINT8, BASE_HEX, VALS(entity_kind_vals), 0, "'entityKind' field of the object entity ID", HFILL } }, { &hf_rtps_sm_rdentity_id, { "readerEntityId", "rtps.sm.rdEntityId", FT_UINT32, BASE_HEX, VALS(entity_id_vals), 0, "Reader entity ID as it appears in a submessage", HFILL } }, { &hf_rtps_sm_rdentity_id_key, { "readerEntityKey", "rtps.sm.rdEntityId.entityKey", FT_UINT24, BASE_HEX, NULL, 0, "'entityKey' field of the reader entity ID", HFILL } }, { &hf_rtps_sm_rdentity_id_kind, { "readerEntityKind", "rtps.sm.rdEntityId.entityKind", FT_UINT8, BASE_HEX, VALS(entity_kind_vals), 0, "'entityKind' field of the reader entity ID", HFILL } }, { &hf_rtps_sm_wrentity_id, { "writerEntityId", "rtps.sm.wrEntityId", FT_UINT32, BASE_HEX, VALS(entity_id_vals), 0, "Writer entity ID as it appears in a submessage", HFILL } }, { &hf_rtps_sm_wrentity_id_key, { "writerEntityKey", "rtps.sm.wrEntityId.entityKey", FT_UINT24, BASE_HEX, NULL, 0, "'entityKey' field of the writer entity ID", HFILL } }, { &hf_rtps_sm_wrentity_id_kind, { "writerEntityKind", "rtps.sm.wrEntityId.entityKind", FT_UINT8, BASE_HEX, VALS(entity_kind_vals), 0, "'entityKind' field of the writer entity ID", HFILL } }, /* Sequence number ----------------------------------------------------- */ { &hf_rtps_sm_seq_number, { "writerSeqNumber", "rtps.sm.seqNumber", FT_INT64, BASE_DEC, NULL, 0, "Writer sequence number", HFILL } }, { &hf_rtps_info_src_ip, { "appIpAddress", "rtps.info_src.ip", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_info_src_unused, { "Unused", "rtps.info_src.unused", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, /* Parameter Id -------------------------------------------------------- */ { &hf_rtps_parameter_id, { "parameterId", "rtps.param.id", FT_UINT16, BASE_HEX, VALS(parameter_id_vals), 0, "Parameter Id", HFILL } }, { &hf_rtps_parameter_id_v2, { "parameterId", "rtps.param.id", FT_UINT16, BASE_HEX, VALS(parameter_id_v2_vals), 0, "Parameter Id", HFILL } }, { &hf_rtps_parameter_id_inline_rti, { "Parameter Id", "rtps.param.id", FT_UINT16, BASE_HEX, VALS(parameter_id_inline_qos_rti), 0, NULL, HFILL } }, { &hf_rtps_parameter_id_toc, { "parameterId", "rtps.param.id", FT_UINT16, BASE_HEX, VALS(parameter_id_toc_vals), 0, "Parameter Id", HFILL } }, { &hf_rtps_parameter_id_rti, { "parameterId", "rtps.param.id", FT_UINT16, BASE_HEX, VALS(parameter_id_rti_vals), 0, "Parameter Id", HFILL } }, { &hf_rtps_parameter_id_adl, { "parameterId", "rtps.param.id", FT_UINT16, BASE_HEX, VALS(parameter_id_adl_vals), 0, "Parameter Id", HFILL } }, /* Parameter Length ---------------------------------------------------- */ { &hf_rtps_parameter_length, { "parameterLength", "rtps.param.length", FT_UINT16, BASE_DEC, NULL, 0, "Parameter Length", HFILL } }, /* Parameter / Topic --------------------------------------------------- */ { &hf_rtps_param_topic_name, { "topic", "rtps.param.topicName", FT_STRINGZ, BASE_NONE, NULL, 0, "String representing the value value of a PID_TOPIC parameter", HFILL } }, /* Parameter / Strength ------------------------------------------------ */ { &hf_rtps_param_strength, { "strength", "rtps.param.strength", FT_INT32, BASE_DEC, NULL, 0, "Decimal value representing the value of a PID_OWNERSHIP_STRENGTH parameter", HFILL } }, /* Parameter / Type Name ----------------------------------------------- */ { &hf_rtps_param_type_name, { "typeName", "rtps.param.typeName", FT_STRINGZ, BASE_NONE, NULL, 0, "String representing the value of a PID_TYPE_NAME parameter", HFILL } }, /* Parameter / User Data ----------------------------------------------- */ { &hf_rtps_param_user_data, { "userData", "rtps.param.userData", FT_BYTES, BASE_NONE, NULL, 0, "The user data sent in a PID_USER_DATA parameter", HFILL } }, /* Parameter / Group Data ---------------------------------------------- */ { &hf_rtps_param_group_data, { "groupData", "rtps.param.groupData", FT_BYTES, BASE_NONE, NULL, 0, "The user data sent in a PID_GROUP_DATA parameter", HFILL } }, { &hf_rtps_transportInfo_classId, { "classID", "rtps.transportInfo.classID", FT_INT32, BASE_DEC, NULL, 0, "Class ID of transport", HFILL } }, { &hf_rtps_transportInfo_messageSizeMax, { "messageSizeMax", "rtps.transportInfo.messageSizeMax", FT_INT32, BASE_DEC, NULL, 0, "Maximum message size of transport", HFILL } }, { &hf_rtps_coherent_set_start, { "Coherent set start", "rtps.coherent_set.start", FT_UINT64, BASE_DEC, NULL, 0, "Start of a coherent set", HFILL } }, { &hf_rtps_coherent_set_end, { "End of coherent set sequence", "rtps.coherent_set.end", FT_UINT64, BASE_DEC, NULL, 0, "End of a coherent set", HFILL } }, /* Parameter / Topic Data ---------------------------------------------- */ { &hf_rtps_param_topic_data, { "topicData", "rtps.param.topicData", FT_BYTES, BASE_NONE, NULL, 0, "The user data sent in a PID_TOPIC_DATA parameter", HFILL } }, /* Parameter / Content Filter Name ------------------------------------- */ { &hf_rtps_param_content_filter_topic_name, { "contentFilterTopicName", "rtps.param.contentFilterTopicName", FT_STRINGZ, BASE_NONE, NULL, 0, "Value of the content filter topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", HFILL } }, { &hf_rtps_param_related_topic_name, { "relatedTopicName", "rtps.param.relatedTopicName", FT_STRINGZ, BASE_NONE, NULL, 0, "Value of the related topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", HFILL } }, { &hf_rtps_param_filter_class_name, { "filterClassName", "rtps.param.filterClassName", FT_STRINGZ, BASE_NONE, NULL, 0, "Value of the filter class name as sent in a PID_CONTENT_FILTER_PROPERTY parameter", HFILL } }, { &hf_rtps_durability_service_cleanup_delay, { "Service Cleanup Delay", "rtps.durability.service_cleanup_delay", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_liveliness_lease_duration, { "Lease Duration", "rtps.liveliness.lease_duration", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_participant_lease_duration, { "Duration", "rtps.participant_lease_duration", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_time_based_filter_minimum_separation, { "Minimum Separation", "rtps.time_based_filter.minimum_separation", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_reliability_max_blocking_time, { "Max Blocking Time", "rtps.reliability.max_blocking_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_deadline_period, { "Period", "rtps.deadline_period", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_latency_budget_duration, { "Duration", "rtps.latency_budget.duration", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_lifespan_duration, { "Duration", "rtps.lifespan", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_persistence, { "Persistence", "rtps.persistence", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_info_ts_timestamp, { "Timestamp", "rtps.info_ts.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_timestamp, { "Timestamp", "rtps.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_locator_kind, { "Kind", "rtps.locator.kind", FT_UINT32, BASE_HEX, VALS(rtps_locator_kind_vals), 0, NULL, HFILL } }, { &hf_rtps_locator_port, { "Port", "rtps.locator.port", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, #if 0 { &hf_rtps_logical_port, { "RTPS Logical Port", "rtps.locator.port", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, #endif { &hf_rtps_locator_public_address_port, { "Public Address Port", "rtps.locator.public_address_port", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_ipv4, { "Address", "rtps.locator.ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_ipv6, { "Address", "rtps.locator.ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_participant_builtin_endpoints, { "BuiltIn Endpoint", "rtps.participant_builtin_endpoints", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_participant_manual_liveliness_count, { "Manual Liveliness Count", "rtps.participant_manual_liveliness_count", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_history_depth, { "Depth", "rtps.history_depth", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_resource_limit_max_samples, { "Max Samples", "rtps.resource_limit.max_samples", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_resource_limit_max_instances, { "Max Instances", "rtps.resource_limit.max_instances", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_resource_limit_max_samples_per_instances, { "Max Samples Per Instance", "rtps.resource_limit.max_samples_per_instance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_filter_bitmap, { "Filter Bitmap", "rtps.filter_bitmap", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_type_checksum, { "Checksum", "rtps.type_checksum", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_queue_size, { "queueSize", "rtps.queue_size", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_acknack_count, { "Count", "rtps.acknack.count", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_virtual_writer_count, { "virtualWriterCount", "rtps.app_ack.virtual_writer_count", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_count, { "count", "rtps.app_ack.count", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_conf_virtual_writer_count, { "virtualWriterCount", "rtps.app_ack_conf.virtual_writer_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_conf_count, { "count", "rtps.app_ack_conf.count", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_interval_payload_length, { "intervalPayloadLength", "rtps.app_ack.interval_payload_length", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_interval_flags, { "intervalFlags", "rtps.app_ack.interval_flags", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_interval_count, { "intervalCount", "rtps.app_ack.interval_count", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_ack_octets_to_next_virtual_writer, { "octetsToNextVirtualWriter", "rtps.app_ack.octets_to_next_virtual_writer", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_durability_service_history_kind, { "History Kind", "rtps.durability_service.history_kind", FT_UINT32, BASE_HEX, VALS(history_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_durability_service_history_depth, { "History Depth", "rtps.durability_service.history_depth", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_durability_service_max_samples, { "Max Samples", "rtps.durability_service.max_samples", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_durability_service_max_instances, { "Max Instances", "rtps.durability_service.max_instances", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_durability_service_max_samples_per_instances, { "Max Samples Per Instance", "rtps.durability_service.max_samples_per_instance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_liveliness_kind, { "Kind", "rtps.liveliness.kind", FT_UINT32, BASE_HEX, VALS(liveliness_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_manager_key, { "Key", "rtps.manager_key", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_udp_v4, { "Address", "rtps.locator_udp_v4.ip", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_udp_v4_port, { "Port", "rtps.locator_udp_v4.port", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_param_ip_address, { "Address", "rtps.param.ip_address", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_port, { "Port", "rtps.param.port", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_expects_inline_qos, { "Inline QoS", "rtps.expects_inline_qos", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_presentation_coherent_access, { "Coherent Access", "rtps.presentation.coherent_access", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_presentation_ordered_access, { "Ordered Access", "rtps.presentation.ordered_access", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_direct_communication, { "Direct Communication", "rtps.direct_communication", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_expects_ack, { "expectsAck", "rtps.expects_ack", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_expects_virtual_heartbeat, { "expectsVirtualHB", "rtps.expects_virtual_heartbeat", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_reliability_kind, { "Kind", "rtps.reliability_kind", FT_UINT32, BASE_HEX, VALS(reliability_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_durability, { "Durability", "rtps.durability", FT_UINT32, BASE_HEX, VALS(durability_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_ownership, { "Kind", "rtps.ownership", FT_UINT32, BASE_HEX, VALS(ownership_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_presentation_access_scope, { "Access Scope", "rtps.presentation.access_scope", FT_UINT32, BASE_HEX, VALS(presentation_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_destination_order, { "Kind", "rtps.destination_order", FT_UINT32, BASE_HEX, VALS(destination_order_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_history_kind, { "Kind", "rtps.history.kind", FT_UINT32, BASE_HEX, VALS(history_qos_vals), 0, NULL, HFILL } }, { &hf_rtps_data_status_info, { "statusInfo", "rtps.data.status_info", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_serialize_encap_kind, { "encapsulation kind", "rtps.param.serialize.encap_kind", FT_UINT16, BASE_HEX, VALS(encapsulation_id_vals), 0, NULL, HFILL } }, { &hf_rtps_param_serialize_encap_len, { "encapsulation options", "rtps.param.serialize.encap_len", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, /* Parameter / NtpTime ------------------------------------------------- */ { &hf_rtps_param_timestamp_sec, { "seconds", "rtps.param.ntpTime.sec", FT_INT32, BASE_DEC, NULL, 0, "The 'second' component of an RTPS time_t", HFILL } }, { &hf_rtps_param_timestamp_fraction, { "fraction", "rtps.param.ntpTime.fraction", FT_UINT32, BASE_DEC, NULL, 0, "The 'fraction' component of an RTPS time_t", HFILL } }, { &hf_rtps_param_transport_priority, { "Value", "rtps.param.transport_priority", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_type_max_size_serialized, { "Value", "rtps.param.type_max_size_serialized", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_peer_host_epoch, { "Peer Host Epoch", "rtps.param.peer_host_epoch", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_endpoint_property_change_epoch, { "Endpoint Property Change Epoch", "rtps.param.endpoint_property_change_epoch", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_entity_name, { "entityName", "rtps.param.entityName", FT_STRINGZ, BASE_NONE, NULL, 0, "String representing the name of the entity addressed by the submessage", HFILL } }, { &hf_rtps_param_role_name, { "roleName", "rtps.param.roleName", FT_STRINGZ, BASE_NONE, NULL, 0, "String representing the role name of the entity addressed by the submessage", HFILL } }, { &hf_rtps_disable_positive_ack, { "disablePositiveAcks", "rtps.disable_positive_ack", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_participant_guid_v1, { "Participant GUID", "rtps.param.participant_guid_v1", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_participant_guid, { "Participant GUID", "rtps.param.participant_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_group_guid_v1, { "Group GUID", "rtps.param.group_guid_v1", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_group_guid, { "Group GUID", "rtps.param.group_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_endpoint_guid, { "Endpoint GUID", "rtps.param.endpoint_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_host_id, { "hostId", "rtps.param.guid.hostId", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_id, { "appId", "rtps.param.guid.appId", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_instance_id_v1, { "instanceId", "rtps.param.guid.instanceId", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_instance_id, { "instanceId", "rtps.param.guid.instanceId", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_app_kind, { "instanceId", "rtps.param.guid.appKind", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_entity, { "entityId", "rtps.param.guid.entityId", FT_UINT32, BASE_HEX, VALS(entity_id_vals), 0, NULL, HFILL } }, { &hf_rtps_param_entity_key, { "entityKey", "rtps.param.guid.entityKey", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_hf_entity_kind, { "entityKind", "rtps.param.guid.entityKind", FT_UINT8, BASE_HEX, VALS(entity_kind_vals), 0, NULL, HFILL } }, { &hf_rtps_param_extended_pid_length, { "Extended Length", "rtps.param.extended_pid_length", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_extended_parameter, { "Extended Parameter", "rtps.param.extended_parameter", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_frag_number, { "fragmentStartingNum", "rtps.data_frag.number", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_frag_sample_size, { "sampleSize", "rtps.data_frag.sample_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_frag_num_fragments, { "fragmentsInSubmessage", "rtps.data_frag.num_fragments", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_frag_size, { "fragmentSize", "rtps.data_frag.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_nokey_data_frag_number, { "fragmentStartingNum", "rtps.nokey_data_frag.number", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_nokey_data_frag_num_fragments, { "fragmentsInSubmessage", "rtps.nokey_data_frag.num_fragments", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_nokey_data_frag_size, { "fragmentSize", "rtps.nokey_data_frag.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_nack_frag_count, { "Count", "rtps.nack_frag.count", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_heartbeat_frag_number, { "lastFragmentNum", "rtps.heartbeat_frag.number", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_heartbeat_frag_count, { "Count", "rtps.heartbeat_frag.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_heartbeat_batch_count, { "Count", "rtps.heartbeat_batch.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_virtual_heartbeat_count, { "Count", "rtps.virtual_heartbeat.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_virtual_heartbeat_num_virtual_guids, { "numVirtualGUIDs", "rtps.virtual_heartbeat.num_virtual_guids", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_virtual_heartbeat_num_writers, { "numWriters", "rtps.virtual_heartbeat.num_writers", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_serialize_data, { "serializedData", "rtps.data.serialize_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_parameter_data, { "parameterData", "rtps.parameter_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_batch_timestamp, { "Timestamp", "rtps.data_batch.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, "Time using the RTPS time_t standard format", HFILL } }, { &hf_rtps_data_batch_offset_to_last_sample_sn, { "offsetToLastSampleSN", "rtps.data_batch.offset_to_last_sample_sn", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_batch_sample_count, { "batchSampleCount", "rtps.data_batch.sample_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_batch_offset_sn, { "offsetSN", "rtps.data_batch.offset_sn", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_batch_octets_to_sl_encap_id, { "octetsToSLEncapsulationId", "rtps.data_batch.octets_to_sl_encap_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_batch_serialized_data_length, { "serializedDataLength", "rtps.data_batch.serialized_data_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_batch_octets_to_inline_qos, { "octetsToInlineQos", "rtps.data_batch.octets_to_inline_qos", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_fragment_number_base64, { "bitmapBase", "rtps.fragment_number.base64", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_fragment_number_base, { "bitmapBase", "rtps.fragment_number.base32", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_fragment_number_num_bits, { "numBits", "rtps.fragment_number.num_bits", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_bitmap_num_bits, { "numBits", "rtps.bitmap.num_bits", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_acknack_analysis, { "Acknack Analysis", "rtps.sm.acknack_analysis", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_partition_num, { "Number of partition names", "rtps.param.partition_num", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_expression_parameters_num, { "Number of expression params", "rtps.param.expression_parameters_num", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_partition, { "name", "rtps.param.partition", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_filter_expression, { "filterExpression", "rtps.param.filter_expression", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_expression_parameters, { "expressionParameters", "rtps.param.expression_parameters", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_filter_list_num_channels, { "numberOfChannels", "rtps.param.locator_filter_list.num_channels", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_filter_list_filter_name, { "filterName", "rtps.param.locator_filter_list.filter_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_locator_filter_list_filter_exp, { "filterExpression", "rtps.param.locator_filter_list.filter_exp", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_extra_flags, { "Extra flags", "rtps.extra_flags", FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL } }, { &hf_rtps_param_builtin_endpoint_set_flags, { "Flags", "rtps.param.builtin_endpoint_set", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the flags in PID_BUILTIN_ENDPOINT_SET", HFILL } }, { &hf_rtps_param_vendor_builtin_endpoint_set_flags, { "Flags", "rtps.param.vendor_builtin_endpoint_set", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the flags in PID_VENDOR_BUILTIN_ENDPOINT_SET", HFILL } }, { &hf_rtps_param_endpoint_security_attributes, { "Flags", "rtps.param.endpoint_security_attributes", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the flags in PID_ENDPOINT_SECURITY_ATTRIBUTES", HFILL } }, { &hf_rtps_param_plugin_promiscuity_kind, { "promiscuityKind", "rtps.param.plugin_promiscuity_kind", FT_UINT32, BASE_HEX, VALS(plugin_promiscuity_kind_vals), 0, NULL, HFILL } }, { &hf_rtps_param_service_kind, { "serviceKind", "rtps.param.service_kind", FT_UINT32, BASE_HEX, VALS(service_kind_vals), 0, NULL, HFILL } }, { &hf_rtps_param_data_representation,{ "Data Representation Kind", "rtps.param.data_representation", FT_UINT16, BASE_DEC, VALS(data_representation_kind_vals), 0, NULL, HFILL } }, { &hf_rtps_param_type_consistency_kind, { "Type Consistency Kind", "rtps.param.type_consistency_kind", FT_UINT16, BASE_HEX, VALS(type_consistency_kind_vals), 0, NULL, HFILL } }, { &hf_rtps_param_ignore_sequence_bounds, { "Ignore Sequence Bounds", "rtps.param.ignore_sequence_bounds", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_ignore_string_bounds, { "Ignore String Bounds", "rtps.param.ignore_string_bounds", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_ignore_member_names, { "Ignore Member Names", "rtps.param.ignore_member_names", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_prevent_type_widening, { "Prevent Type Widening", "rtps.param.prevent_type_widening", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_force_type_validation, { "Force Type Validation", "rtps.param.force_type_validation", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_ignore_enum_literal_names, { "Ignore Enum Literal Names", "rtps.param.ignore_enum_literal_names", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_acknowledgment_kind, { "Acknowledgment Kind", "rtps.param.acknowledgment_kind", FT_UINT32, BASE_HEX, VALS(acknowledgement_kind_vals), 0, NULL, HFILL } }, /* Finally the raw issue data ------------------------------------------ */ { &hf_rtps_issue_data, { "serializedData", "rtps.issueData", FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a ISSUE submessage", HFILL } }, { &hf_rtps_param_product_version_major, { "Major", "rtps.param.product_version.major", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_product_version_minor, { "Minor", "rtps.param.product_version.minor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_product_version_release, { "Release", "rtps.param.product_version.release", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_product_version_release_as_char, { "Release", "rtps.param.product_version.release_string", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_product_version_revision, { "Revision", "rtps.param.product_version.revision", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_encapsulation_id, { "encapsulation id", "rtps.encapsulation_id", FT_UINT16, BASE_HEX, VALS(encapsulation_id_vals), 0, NULL, HFILL } }, { &hf_rtps_encapsulation_kind, { "kind", "rtps.encapsulation_kind", FT_UINT32, BASE_HEX, VALS(participant_message_data_kind), 0, NULL, HFILL } }, { &hf_rtps_octets_to_inline_qos, { "Octets to inline QoS", "rtps.octets_to_inline_qos", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_filter_signature, { "filterSignature", "rtps.filter_signature", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_bitmap, { "bitmap", "rtps.bitmap", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_property_name, { "Property Name", "rtps.property_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_property_value, { "Value", "rtps.property_value", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_union, { "union", "rtps.union", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_union_case, { "case", "rtps.union_case", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_struct, { "struct", "rtps.struct", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_member_name, { "member_name", "rtps.member_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_sequence, { "sequence", "rtps.sequence", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_array, { "array", "rtps.array", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_bitfield, { "bitfield", "rtps.bitfield", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_datatype, { "datatype", "rtps.datatype", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_sequence_size, { "sequenceSize", "rtps.sequence_size", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_octet_octets, 0, NULL, HFILL } }, { &hf_rtps_guid, { "guid", "rtps.guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_heartbeat_count, { "count", "rtps.heartbeat_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_encapsulation_options, { "Encapsulation options", "rtps.encapsulation_options", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_serialized_key, { "serializedKey", "rtps.serialized_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_serialized_data, { "serializedData", "rtps.serialized_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_sm_rti_crc_number, { "RTPS Message Length", "rtps.sm.rti_crc.message_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_sm_rti_crc_result, { "CRC", "rtps.sm.rti_crc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_message_length, { "RTPS Message Length", "rtps.message_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, /* Flag bits */ { &hf_rtps_flag_reserved80, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL } }, { &hf_rtps_flag_reserved40, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, NULL, HFILL } }, { &hf_rtps_flag_reserved20, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20, NULL, HFILL } }, { &hf_rtps_flag_reserved10, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL } }, { &hf_rtps_flag_reserved08, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL } }, { &hf_rtps_flag_reserved04, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_reserved02, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_reserved8000, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x8000, NULL, HFILL } }, { &hf_rtps_flag_reserved4000, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x4000, NULL, HFILL } }, { &hf_rtps_flag_reserved2000, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x2000, NULL, HFILL } }, { &hf_rtps_flag_reserved1000, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x1000, NULL, HFILL } }, { &hf_rtps_flag_reserved0800, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0800, NULL, HFILL } }, { &hf_rtps_flag_reserved0400, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0400, NULL, HFILL } }, { &hf_rtps_flag_reserved0200, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0200, NULL, HFILL } }, { &hf_rtps_flag_reserved0100, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0100, NULL, HFILL } }, { &hf_rtps_flag_reserved0080, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0080, NULL, HFILL } }, { &hf_rtps_flag_reserved0040, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0040, NULL, HFILL } }, { &hf_rtps_flag_builtin_endpoint_set_reserved, { "Reserved", "rtps.flag.reserved", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x0000F000, NULL, HFILL } }, { &hf_rtps_flag_unregister, { "Unregister flag", "rtps.flag.unregister", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20, NULL, HFILL } }, { &hf_rtps_flag_inline_qos_v1, { "Inline QoS", "rtps.flag.inline_qos", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL } }, { &hf_rtps_flag_hash_key, { "Hash key flag", "rtps.flag.hash_key", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL } }, { &hf_rtps_flag_hash_key_rti, { "Hash key flag", "rtps.flag.hash_key", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_alive, { "Alive flag", "rtps.flag.alive", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_data_present_v1, { "Data present", "rtps.flag.data_present", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_multisubmessage, { "Multi-submessage", "rtps.flag.multisubmessage", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_endianness, { "Endianness", "rtps.flag.endianness", FT_BOOLEAN, 8, TFS(&tfs_little_big_endianness), 0x01, NULL, HFILL } }, { &hf_rtps_flag_additional_authenticated_data, { "Additional Authenticated Data", "rtps.flag.additional_authenticated_data", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_protected_with_psk, { "Message protected with PSK", "rtps.flag.message_protected_with_psk", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_vendor_specific_content, { "Vendor-Specific Content", "rtps.flag.vendor_specific_content", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL } }, { &hf_rtps_flag_inline_qos_v2, { "Inline QoS", "rtps.flag.inline_qos", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_data_present_v2, { "Data present", "rtps.flag.data_present", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_status_info, { "Status info flag", "rtps.flag.status_info", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL } }, { &hf_rtps_flag_final, { "Final flag", "rtps.flag.final", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_liveliness, { "Liveliness flag", "rtps.flag.liveliness", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_multicast, { "Multicast flag", "rtps.flag.multicast", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_data_serialized_key, { "Serialized Key", "rtps.flag.data.serialized_key", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL } }, { &hf_rtps_flag_data_frag_serialized_key, { "Serialized Key", "rtps.flag.data_frag.serialized_key", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_timestamp, { "Timestamp flag", "rtps.flag.timestamp", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_no_virtual_guids, { "No virtual GUIDs flag", "rtps.flag.no_virtual_guids", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL } }, { &hf_rtps_flag_multiple_writers, { "Multiple writers flag", "rtps.flag.multiple_writers", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_multiple_virtual_guids, { "Multiple virtual GUIDs flag", "rtps.flag.multiple_virtual_guids", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_serialize_key16, { "Serialized Key", "rtps.flag.serialize_key", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0020, NULL, HFILL } }, { &hf_rtps_flag_invalid_sample, { "Invalid sample", "rtps.flag.invalid_sample", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0010, NULL, HFILL } }, { &hf_rtps_flag_data_present16, { "Data present", "rtps.flag.data_present", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0008, NULL, HFILL } }, { &hf_rtps_flag_offsetsn_present, { "OffsetSN present", "rtps.flag.offsetsn_present", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL } }, { &hf_rtps_flag_inline_qos16_v2, { "Inline QoS", "rtps.flag.inline_qos", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL } }, { &hf_rtps_flag_timestamp_present, { "Timestamp present", "rtps.flag.timestamp_present", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL } }, { &hf_rtps_param_status_info_flags, { "Flags", "rtps.param.status_info", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the flags in PID_STATUS_INFO", HFILL } }, { &hf_rtps_header_extension_flags, { "Flags", "rtps.header_extension_flags", FT_UINT8, BASE_HEX, NULL, 0, "bitmask representing header extension flags", HFILL } }, { &hf_rtps_flag_header_extension_parameters, { "Header Extension Parameter List Present", "rtps.flag.header_extension.parameter_list", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_PARAMETERS_FLAG, NULL, HFILL } }, { &hf_rtps_flag_header_extension_checksum2, { "Header Extension Message Checksum 2", "rtps.flag.header_extension.message_checksum2", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_CHECKSUM_2_FLAG, NULL, HFILL } }, { &hf_rtps_flag_header_extension_checksum1, { "Header Extension Message Checksum 1", "rtps.flag.header_extension.message_checksum1", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_CHECKSUM_1_FLAG, NULL, HFILL } }, { &hf_rtps_flag_header_extension_wextension, { "Header Extension W Extension Present", "rtps.flag.header_extension.wextension", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_WEXTENSION_FLAG, NULL, HFILL } }, { &hf_rtps_flag_header_extension_uextension, { "Header Extension U Extension Present", "rtps.flag.header_extension.uextension", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_UEXTENSION_FLAG, NULL, HFILL } }, { &hf_rtps_flag_header_extension_timestamp, { "Header Extension Timestamp Present", "rtps.flag.header_extension.timestamp", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_TIMESTAMP_FLAG, NULL, HFILL } }, { &hf_rtps_flag_header_extension_message_length, { "Header Extension Message Length", "rtps.flag.header_extension.message_length", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_MESSAGE_LENGTH_FLAG, NULL, HFILL } }, { &hf_rtps_header_extension_checksum_crc32c, { "Header Extension Checksum CRC-32C", "rtps.header_extension.checksum_crc32c", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_header_extension_checksum_crc64, { "Header Extension Checksum CRC64", "rtps.header_extension.checksum_crc64", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_header_extension_checksum_md5, { "Header Extension Checksum MD5", "rtps.header_extension.checksum_md5", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_uextension, { "Header Extension uExtension", "rtps.uextension", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_wextension, { "Header Extension wExtension", "rtps.wextension", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_flag_unregistered, { "Unregistered", "rtps.flag.unregistered", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_disposed, { "Disposed", "rtps.flag.undisposed", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL } }, { &hf_rtps_flag_participant_announcer, { "Participant Announcer", "rtps.flag.participant_announcer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_flag_participant_detector, { "Participant Detector", "rtps.flag.participant_detector", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_publication_announcer, { "Publication Announcer", "rtps.flag.publication_announcer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_rtps_flag_publication_detector, { "Publication Detector", "rtps.flag.publication_detector", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_rtps_flag_subscription_announcer, { "Subscription Announcer", "rtps.flag.subscription_announcer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL } }, { &hf_rtps_flag_subscription_detector, { "Subscription Detector", "rtps.flag.subscription_detector", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL } }, { &hf_rtps_flag_participant_proxy_announcer, { "Participant Proxy Announcer", "rtps.flag.participant_proxy_announcer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL } }, { &hf_rtps_flag_participant_proxy_detector, { "Participant Proxy Detector", "rtps.flag.participant_proxy_detector", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080, NULL, HFILL } }, { &hf_rtps_flag_participant_state_announcer, { "Participant State Announcer", "rtps.flag.participant_state_announcer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100, NULL, HFILL } }, { &hf_rtps_flag_participant_state_detector, { "Participant State Detector", "rtps.flag.participant_state_detector", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200, NULL, HFILL } }, { &hf_rtps_flag_participant_message_datawriter, { "Participant Message DataWriter", "rtps.flag.participant_message_datawriter", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000400, NULL, HFILL } }, { &hf_rtps_flag_participant_message_datareader, { "Participant Message DataReader", "rtps.flag.participant_message_datareader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000800, NULL, HFILL } }, { &hf_rtps_flag_secure_publication_writer, { "Secure Publication Writer", "rtps.flag.secure_publication_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00010000, NULL, HFILL } }, { &hf_rtps_flag_secure_publication_reader, { "Secure Publication Reader", "rtps.flag.secure_publication_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00020000, NULL, HFILL } }, { &hf_rtps_flag_secure_subscription_writer, { "Secure Subscription Writer", "rtps.flag.secure_subscription_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00040000, NULL, HFILL } }, { &hf_rtps_flag_secure_subscription_reader, { "Secure Subscription Reader", "rtps.flag.secure_subscription_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00080000, NULL, HFILL } }, { &hf_rtps_flag_secure_participant_message_writer, { "Secure Participant Message Writer", "rtps.flag.secure_participant_message_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00100000, NULL, HFILL } }, { &hf_rtps_flag_secure_participant_message_reader, { "Secure Participant Message Reader", "rtps.flag.secure_participant_message_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00200000, NULL, HFILL } }, { &hf_rtps_flag_participant_stateless_message_writer, { "Participant Stateless Message Writer", "rtps.flag.participant_stateless_message_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00400000, NULL, HFILL } }, { &hf_rtps_flag_participant_stateless_message_reader, { "Participant Stateless Message Reader", "rtps.flag.participant_stateless_message_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00800000, NULL, HFILL } }, { &hf_rtps_flag_secure_participant_volatile_message_writer,{ "Secure Participant Volatile Message Writer", "rtps.flag.secure_participant_volatile_message_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x01000000, NULL, HFILL } }, { &hf_rtps_flag_secure_participant_volatile_message_reader,{ "Secure Participant Volatile Message Reader", "rtps.flag.secure_participant_volatile_message_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x02000000, NULL, HFILL } }, { &hf_rtps_flag_participant_secure_writer,{ "Participant Secure Writer", "rtps.flag.participant_secure_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000, NULL, HFILL } }, { &hf_rtps_flag_participant_secure_reader,{ "Participant Secure Reader", "rtps.flag.participant_secure_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x08000000, NULL, HFILL } }, { &hf_rtps_type_object_type_id_disc, { "TypeId (_d)", "rtps.type_object.type_id.discr", FT_INT16, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_primitive_type_id, { "Type Id", "rtps.type_object.primitive_type_id", FT_UINT16, BASE_HEX, VALS(type_object_kind), 0, NULL, HFILL } }, { &hf_rtps_type_object_base_primitive_type_id, { "Base Id", "rtps.type_object.base_primitive_type_id", FT_UINT16, BASE_HEX, VALS(type_object_kind), 0, NULL, HFILL } }, { &hf_rtps_type_object_type_id, { "Type Id", "rtps.type_object.type_id", FT_UINT64, BASE_HEX, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_base_type, { "Base Type Id", "rtps.type_object.base_type_id", FT_UINT64, BASE_HEX, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_element_raw, { "Type Element Content", "rtps.type_object.element", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_type_object_type_property_name, { "Name", "rtps.type_object.property.name", FT_STRING, BASE_NONE, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_member_id, { "Member Id", "rtps.type_object.annotation.member_id", FT_UINT32, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_name, { "Name", "rtps.type_object.member.name", FT_STRING, BASE_NONE, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_annotation_value_d, { "Annotation Member (_d)", "rtps.type_object.annotation.value_d", FT_UINT16, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_annotation_value_16, { "16 bits type", "rtps.type_object.annotation.value", FT_UINT16, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_union_label, { "Label", "rtps.type_object.union.label", FT_UINT32, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_bound, { "Bound", "rtps.type_object.bound", FT_UINT32, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_enum_constant_name, { "Enum name", "rtps.type_object.enum.name", FT_STRING, BASE_NONE, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_enum_constant_value, { "Enum value", "rtps.type_object.enum.value", FT_INT32, BASE_DEC, 0x0, 0, NULL, HFILL } }, { &hf_rtps_type_object_element_shared, { "Element shared", "rtps.type_object.shared", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_flag_typeflag_final, { "FINAL", "rtps.flag.typeflags.final", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL } }, { &hf_rtps_flag_typeflag_mutable, { "MUTABLE", "rtps.flag.typeflags.mutable", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL } }, { &hf_rtps_flag_typeflag_nested, { "NESTED", "rtps.flag.typeflags.nested", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL } }, { &hf_rtps_type_object_flags, { "Flags", "rtps.flag.typeflags", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_flag_memberflag_key, { "Key", "rtps.flag.typeflags.key", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL } }, { &hf_rtps_flag_memberflag_optional, { "Optional", "rtps.flag.typeflags.optional", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL } }, { &hf_rtps_flag_memberflag_shareable, { "Shareable", "rtps.flag.typeflags.shareable", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL } }, { &hf_rtps_flag_memberflag_union_default, { "Union default", "rtps.flag.typeflags.union_default", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0008, NULL, HFILL } }, { &hf_rtps_type_object_element_module_name, { "Module name", "rtps.type_object.module_name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_flag_service_request_writer, { "Service Request Writer", "rtps.flag.service_request_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_flag_service_request_reader, { "Service Request Reader", "rtps.flag.service_request_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_locator_ping_writer, { "Locator Ping Writer", "rtps.flag.locator_ping_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_rtps_flag_locator_ping_reader, { "Locator Ping Reader", "rtps.flag.locator_ping_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_rtps_flag_secure_service_request_writer, { "Secure Service Request Writer", "rtps.flag.secure_service_request_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL } }, { &hf_rtps_flag_secure_service_request_reader, { "Secure Service Request Reader", "rtps.flag.secure_service_request_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL } }, { &hf_rtps_flag_security_access_protected, { "Access Protected", "rtps.flag.security.access_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_flag_security_discovery_protected, { "Discovery Protected", "rtps.flag.security.discovery_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_security_submessage_protected, { "Submessage Protected", "rtps.flag.security.submessage_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_rtps_flag_security_payload_protected, { "Payload Protected", "rtps.flag.security.payload_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected,{ "Read Protected", "rtps.flag.security.info.read_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected,{ "Write Protected", "rtps.flag.security.info.write_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected,{ "Discovery Protected", "rtps.flag.security.info.discovery_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected,{ "Submessage Protected", "rtps.flag.security.info.submessage_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected,{ "Payload Protected", "rtps.flag.security.info.payload_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected,{ "Key Protected", "rtps.flag.security.info.key_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected,{ "Liveliness Protected", "rtps.flag.security.info.liveliness_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL } }, { &hf_rtps_flag_endpoint_security_attribute_flag_is_valid,{ "Mask Valid", "rtps.flag.security.info.valid", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL } }, { &hf_rtps_param_endpoint_security_attributes_mask,{ "EndpointSecurityAttributesMask", "rtps.param.endpoint_security_attributes", FT_UINT32, BASE_HEX, NULL, 0, "Bitmask representing the EndpointSecurityAttributes flags in PID_ENDPOINT_SECURITY_INFO", HFILL } }, { &hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask, { "Builtin Endpoints Required Mask", "rtps.param.participant_security_symmetric_cipher_algorithms.builtin_endpoints_used_bit", FT_UINT32, BASE_HEX, NULL, 0, "Bitmask representing the Symmetric Cipher algorithm the builtin endpoints use", HFILL } }, { &hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit, { "Key Exchange Builtin Endpoints Required Mask", "rtps.param.participant_security_symmetric_cipher_algorithms.builtin_endpoints_key_exchange_required_mask", FT_UINT32, BASE_HEX, NULL, 0, "Bitmask representing the Symmetric Cipher algorithm the key exchange builtin endpoints require", HFILL } }, { &hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask, { "Supported Mask", "rtps.param.security_symmetric_cipher_algorithms.supported_mask", FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing supported Symmetric Cipher algorithms", HFILL } }, { &hf_rtps_param_compression_id_mask, { "Compression Id Mask", "rtps.param.compression_id_mask", FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing compression id.", HFILL } }, { &hf_rtps_flag_compression_id_zlib, { "ZLIB", "rtps.flag.compression_id_zlib", FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB, NULL, HFILL } }, { &hf_rtps_flag_compression_id_bzip2, { "BZIP2", "rtps.flag.compression_id_bzip2", FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2, NULL, HFILL } }, { &hf_rtps_flag_compression_id_lz4, { "LZ4", "rtps.flag.compression_id_lz4", FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_LZ4, NULL, HFILL } }, { &hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm, { "AES128 GCM", "rtps.flag.security_symmetric_cipher_mask.aes128_gcm", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_AES128_GCM, NULL, HFILL } }, { &hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm, { "AES256 GCM", "rtps.flag.security_symmetric_cipher_mask.aes256_gcm", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_AES256_GCM, NULL, HFILL } }, { &hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm, { "Custom Algorithm", "rtps.flag.security_symmetric_cipher_mask.custom_algorithm", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_CUSTOM_ALGORITHM, NULL, HFILL } }, { &hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256, { "DHE_MODP2048256", "rtps.flag.security_key_establishment_mask.dhe_modp2048256", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_DHE_MODP2048256, NULL, HFILL } }, { &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256, { "ECDHECEUM_P256", "rtps.flag.security_key_establishment_mask.ecdheceum_p256", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P256, NULL, HFILL } }, { &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384, { "ECDHECEUM_P384", "rtps.flag.security_key_establishment_mask.ecdheceum_p384", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P384, NULL, HFILL } }, { &hf_rtps_flag_security_key_establishment_mask_custom_algorithm, { "Custom Algorithm", "rtps.flag.security_key_establishment_mask.custom_algorithm", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_CUSTOM_ALGORITHM, NULL, HFILL } }, { &hf_rtps_flag_security_algorithm_compatibility_mode, { "Compatibility Mode", "rtps.flag.security_algorithm_compatibility_mode", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_ALGORITHM_BIT_COMPATIBILITY_MODE, NULL, HFILL } }, { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted, { "Submessage Encrypted", "rtps.flag.security.info.plugin_submessage_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_param_crypto_algorithm_requirements_trust_chain, { "Supported", "rtps.param.crypto_algorithm_requirements.supported", FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing the trust chain", HFILL } }, { &hf_rtps_param_crypto_algorithm_requirements_message_auth, { "Required", "rtps.param.crypto_algorithm_requirements.required", FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing the message authentication", HFILL } }, { &hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256, { "RSASSAPSSMGF1SHA256_2048_SHA256", "rtps.flag.security_digital_signature_mask.rsassapssmgf1sha256_2048_sha256", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPSSMGF1SHA256_2048_SHA256, NULL, HFILL } }, { &hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256, { "RSASSAPKCS1V15_2048_SHA256", "rtps.flag.security_digital_signature_mask.rsassapkcs1v15_2048_sha256", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPKCS1V15_2048_SHA256, NULL, HFILL } }, { &hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256, { "ECDSA_P256_SHA256", "rtps.flag.security_digital_signature_mask.ecdsa_p256_sha256", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P256_SHA256, NULL, HFILL } }, { &hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384, { "ECDSA_P384_SHA384", "rtps.flag.security_digital_signature_mask.ecdsa_p384_sha384", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P384_SHA384, NULL, HFILL } }, { &hf_rtps_flag_security_digital_signature_mask_custom_algorithm, { "Custom Algorithm", "rtps.flag.security_digital_signature_mask.custom_algorithm", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_CUSTOM_ALGORITHM, NULL, HFILL } }, { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted,{ "Payload Encrypted", "rtps.flag.security.info.plugin_payload_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted,{ "Submessage Origin Encrypted", "rtps.flag.security.info.plugin_liveliness_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid,{ "Mask Valid", "rtps.flag.security.info.plugin_valid", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL } }, { &hf_rtps_param_plugin_endpoint_security_attributes_mask,{ "PluginEndpointSecurityAttributesMask (valid dissection if using the Specification Builtin Plugins)", "rtps.param.plugin_endpoint_security_attributes", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the PluginEndpointSecurityAttributes flags in PID_ENDPOINT_SECURITY_INFO", HFILL } }, { &hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected,{ "RTPS Protected", "rtps.flag.security.info.participant_rtps_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected,{ "Discovery Protected", "rtps.flag.security.info.participant_discovery_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected,{ "Liveliness Protected", "rtps.flag.security.info.participant_liveliness_protected", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &fh_rtps_flag_participant_security_attribute_flag_key_revisions_enabled,{ "Key Revisions Enabled", "rtps.flag.security.info.key_revisions_enabled", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_rtps_flag_participant_security_attribute_flag_is_valid,{ "Mask Valid", "rtps.flag.security.info.participant_mask_valid", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL } }, { &hf_rtps_param_participant_security_attributes_mask,{ "ParticipantSecurityAttributesMask", "rtps.param.participant_security_attributes", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the ParticipantSecurityAttributes flags in PID_PARTICIPANT_SECURITY_INFO", HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted,{ "RTPS Encrypted", "rtps.flag.security.info.plugin_participant_rtps_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted,{ "Discovery Encrypted", "rtps.flag.security.info.plugin_participant_discovery_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted,{ "Liveliness Encrypted", "rtps.flag.security.info.plugin_participant_liveliness_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted,{ "RTPS Origin Encrypted", "rtps.flag.security.info.plugin_participant_rtps_origin_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted,{ "Discovery Origin Encrypted", "rtps.flag.security.info.plugin_participant_discovery_origin_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted,{ "Liveliness Origin Encrypted", "rtps.flag.security.info.plugin_participant_liveliness_origin_encrypted", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL } }, { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid,{ "Mask Valid", "rtps.flag.security.info.plugin_participant_mask_valid", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL } }, { &hf_rtps_param_plugin_participant_security_attributes_mask,{ "PluginParticipantSecurityAttributesMask (valid dissection if using the Specification Builtin Plugins)", "rtps.param.plugin_participant_security_attributes", FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the PluginParticipantSecurityAttributes flags in PID_PARTICIPANT_SECURITY_INFO", HFILL } }, { &hf_rtps_param_enable_authentication, { "Authentication enabled", "rtps.secure.enable_authentication", FT_BOOLEAN, 32, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_param_builtin_endpoint_qos, { "Built-in Endpoint QoS", "rtps.param.builtin_endpoint_qos", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_sample_signature_epoch, { "Epoch", "rtps.sample_signature.epoch", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_sample_signature_nonce, { "Nonce", "rtps.sample_signature.nonce", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_sample_signature_length, {"Signature Length", "rtps.sample_signature.signature_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_sample_signature_signature, { "Signature", "rtps.sample_signature.signature", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_secure_dataheader_transformation_kind, { "Transformation Kind", "rtps.secure.data_header.transformation_kind", FT_INT8, BASE_DEC, VALS(secure_transformation_kind), 0, NULL, HFILL } }, { &hf_rtps_secure_dataheader_transformation_key_revision_id, { "Transformation Key Revision Id", "rtps.secure.data_header.transformation_key_revision_id", FT_INT24, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_secure_dataheader_transformation_key_id, { "Transformation Key Id", "rtps.secure.data_header.transformation_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_secure_dataheader_plugin_sec_header, { "Plugin Secure Header", "rtps.secure.data_header.plugin_sec_header", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_secure_datatag_plugin_sec_tag, { "Plugin Secure Tag", "rtps.secure.data_tag.plugin_sec_tag", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_srm_service_id, { "Service Id", "rtps.srm.service_id", FT_INT32, BASE_DEC, VALS(service_request_kind), 0, NULL, HFILL } }, { &hf_rtps_srm_request_body, { "Request Body", "rtps.srm.request_body", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_srm_instance_id, { "Instance Id", "rtps.srm.instance_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_selection_filter_class_name, { "Class Name", "rtps.srm.topic_query.class_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_selection_filter_expression, { "Filter Expression", "rtps.srm.topic_query.filter_expression", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_selection_filter_parameter, { "Filter Parameter", "rtps.srm.topic_query.filter_parameter", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_selection_num_parameters, { "Number of Filter Parameters", "rtps.srm.topic_query.num_filter_parameters", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_topic_name, { "Topic Name", "rtps.srm.topic_query.topic_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_original_related_reader_guid, { "Original Related Reader GUID", "rtps.srm.topic_query.original_related_reader_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_topic_query_selection_kind, { "Topic Query Selection Kind", "rtps.srm.topic_query.kind", FT_UINT32, BASE_DEC, VALS(topic_query_selection_kind), 0, NULL, HFILL } }, { &hf_rtps_data_session_intermediate, { "Data Session Intermediate Packet", "rtps.data_session.intermediate", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_secure_secure_data_length, { "Secure Data Length", "rtps.secure.secure_data_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_secure_secure_data, { "Secure Data", "rtps.secure.secure_data", FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a secure payload", HFILL } }, { &hf_rtps_pgm, { "Participant Generic Message", "rtps.pgm", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x0, NULL, HFILL } }, { &hf_rtps_srm, { "Service Request Message", "rtps.srm", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x0, NULL, HFILL } }, { &hf_rtps_pgm_dst_participant_guid, { "Destination Participant GUID", "rtps.pgm.dst_participant_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_source_participant_guid, { "Source Participant GUID", "rtps.pgm.source_participant_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_pgm_dst_endpoint_guid, { "Destination Endpoint GUID", "rtps.pgm.dst_endpoint_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_pgm_src_endpoint_guid, { "Source Endpoint GUID", "rtps.pgm.src_endpoint_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_message_identity_source_guid, { "Source GUID", "rtps.pgm.message_identity.source_guid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_pgm_message_class_id, { "Message class id", "rtps.pgm.data_holder.message_class_id", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_pgm_data_holder_class_id, { "Class Id", "rtps.pgm.data_holder.class_id", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, #if 0 { &hf_rtps_pgm_data_holder_stringseq_size, { "Size", "rtps.pgm.data_holder.string_seq_size", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_pgm_data_holder_stringseq_name, { "Name", "rtps.pgm.data_holder.string_seq_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_pgm_data_holder_long_long, { "Long long", "rtps.pgm.data_holder.long_long", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } }, #endif { &hf_rtps_param_topic_query_publication_enable, { "Enable", "rtps.param.topic_query_publication_enable", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0, NULL, HFILL } }, { &hf_rtps_param_topic_query_publication_sessions, { "Number of sessions", "rtps.param.topic_query_publication_sessions", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_pl_cdr_member, { "Member value", "rtps.data.value", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_pl_cdr_member_id, { "Member ID", "rtps.data.member_id", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_pl_cdr_member_length, { "Member length", "rtps.data.member_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_pl_cdr_member_id_ext, { "Member ID", "rtps.data.member_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_pl_cdr_member_length_ext, { "Member length", "rtps.data.member_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dcps_publication_data_frame_number,{ "DCPSPublicationData In", "rtps.dcps_publication_data_frame_number", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is a submessage sent by the DataWriter described in the DCPSPublicationData found in this frame", HFILL } }, { &hf_rtps_data_tag_name, { "Name", "rtps.param.data_tag.name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_data_tag_value, { "Value", "rtps.param.data_tag.value", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_fragments, { "Message fragments", "rtps.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment, { "Message fragment", "rtps.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment_overlap, { "Message fragment overlap", "rtps.fragment.overlap", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment_overlap_conflict, { "Message fragment overlapping with conflicting data", "rtps.fragment.overlap.conflicts", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment_multiple_tails, { "Message has multiple tail fragments", "rtps.fragment.multiple_tails", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment_too_long_fragment, { "Message fragment too long", "rtps.fragment.too_long_fragment", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment_error, { "Message defragmentation error", "rtps.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_fragment_count, { "Message fragment count", "rtps.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_reassembled_in, { "Reassembled in", "rtps.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_reassembled_length, { "Reassembled length", "rtps.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_rtps_reassembled_data, { "Reassembled RTPS data", "rtps.reassembled.data", FT_BYTES, BASE_NONE, NULL, 0x0, "The reassembled payload", HFILL } }, { &hf_rtps_compression_plugin_class_id, { "Compression class Id", "rtps.param.compression_class_id", FT_UINT32, BASE_DEC, VALS(class_id_enum_names), 0x0, NULL, HFILL } }, { &hf_rtps_encapsulation_options_compression_plugin_class_id, { "Compression class Id", "rtps.param.plugin.compression_class_id", FT_INT8, BASE_DEC, VALS(class_id_enum_names), 0x0, NULL, HFILL } }, { &hf_rtps_padding_bytes, { "Padding bytes", "rtps.padding_bytes", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rtps_uncompressed_serialized_length, { "Uncompressed serialized length", "rtps.param.uncompressed_serialized_length", FT_UINT32, BASE_DEC, NULL, 0x0, "The reassembled payload", HFILL } }, { &hf_rtps_encapsulation_extended_compression_options, { "Uncompressed serialized length", "rtps.extended_compression_options", FT_UINT32, BASE_DEC, NULL, 0x0, "Extended compression options", HFILL } }, { &hf_rtps_compressed_serialized_type_object, { "Compressed serialized type object", "rtps.param.compressed_serialized_typeobject", FT_BYTES, BASE_NONE, NULL, 0x0, "The reassembled payload", HFILL } }, { &hf_rtps_dissection_boolean, {"BOOLEAN", "rtps.dissection.boolean", FT_BOOLEAN, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_byte, {"BYTE", "rtps.dissection.byte", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_int16, {"INT16", "rtps.dissection.int16", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_uint16, {"UINT16", "rtps.dissection.uint16", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_int32, {"INT32", "rtps.dissection.int32", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_uint32, {"UINT32", "rtps.dissection.uint32", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_int64, {"INT64", "rtps.dissection.int64", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_uint64, {"UINT64", "rtps.dissection.uint64", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_float, {"FLOAT", "rtps.dissection.float", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_double, {"DOUBLE", "rtps.dissection.double", FT_DOUBLE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_int128, {"INT128", "rtps.dissection.int128", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_dissection_string, { "STRING", "rtps.dissection.string", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_locator_u, { "UUID Locator", "rtps.flag.udpv4_wan_locator.u", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_locator_p, { "Public Locator", "rtps.flag.udpv4_wan_locator.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_locator_b, { "Bidirectional Locator", "rtps.flag.udpv4_wan_locator.b", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_locator_r, { "Relay Locator", "rtps.flag.udpv4_wan_locator.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL } }, { &hf_rtps_udpv4_wan_locator_flags, { "Flags", "rtps.flag.udpv4_wan_locator", FT_UINT8, BASE_HEX, NULL, 0, "Bitmask representing the flags UDPv4 WAN locator", HFILL } }, { &hf_rtps_uuid,{ "UUID", "rtps.uuid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_udpv4_wan_locator_public_ip, { "Public IP", "rtps.udpv4_wan_locator.public_ip", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_udpv4_wan_locator_public_port, { "Public port", "rtps.udpv4_wan_locator.public_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_udpv4_wan_locator_local_ip,{ "Local IP", "rtps.udpv4_wan_locator.local_ip", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_udpv4_wan_locator_local_port,{ "Local port", "rtps.udpv4_wan_locator.local_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_binding_ping_e, { "Endianness", "rtps.flag.udpv4_wan_binding_ping.e", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_binding_ping_l, { "Long address", "rtps.flag.udpv4_wan_binding_ping.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_rtps_flag_udpv4_wan_binding_ping_b,{ "Bidirectional", "rtps.flag.udpv4_wan_binding_ping.b", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL } }, { &hf_rtps_udpv4_wan_binding_ping_flags, { "Flags", "rtps.flag.udpv4_wan_binding_ping", FT_UINT8, BASE_HEX, NULL, 0, "Bitmask representing the flags UDPv4 WAN binding ping", HFILL } }, { &hf_rtps_udpv4_wan_binding_ping_port, { "RTPS port", "rtps.flag.udpv4_wan_binding_rtps_port", FT_UINT32, BASE_DEC, NULL, 0, "UDPv4 WAN binding ping RTPS port", HFILL } }, { &hf_rtps_long_address, { "Long address", "rtps.long_address", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rtps_param_group_coherent_set, { "Group coherent set sequence number", "rtps.param.group_coherent_set", FT_UINT64, BASE_DEC, NULL, 0, "Decimal value representing the value of PID_GROUP_COHERENT_SET parameter", HFILL } }, { &hf_rtps_param_end_group_coherent_set, { "End group coherent set sequence number", "rtps.param.end_group_coherent_set", FT_UINT64, BASE_DEC, NULL, 0, "Decimal value representing the value of PID_END_GROUP_COHERENT_SET parameter", HFILL } }, { &hf_rtps_param_mig_end_coherent_set_sample_count, { "Ended coherent set sample count", "rtps.param.mig_end_coherent_set_sample_count", FT_UINT32, BASE_DEC, NULL, 0, "Decimal value representing the value of MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT parameter", HFILL } }, { &hf_rtps_flag_cloud_discovery_service_announcer,{ "Cloud Discovery Service Announcer", "rtps.flag.cloud_discovery_service_announcer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL } }, { &hf_rtps_writer_group_oid, { "Writer Group OID", "rtps.writer_group_oid", FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the writer group OID", HFILL } }, { &hf_rtps_reader_group_oid, { "Reader Group OID", "rtps.reader_group_oid", FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the reader group OID", HFILL } }, { &hf_rtps_writer_session_id,{ "Writer Session ID", "rtps.writer_session_id", FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the writer session ID", HFILL } }, { &hf_rtps_flag_participant_config_writer,{ "Participant Config Writer", "rtps.flag.participant_config_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_WRITER, NULL, HFILL } }, { &hf_rtps_flag_participant_config_reader,{ "Participant Config Reader", "rtps.flag.participant_config_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_READER, NULL, HFILL } }, { &hf_rtps_flag_participant_config_secure_writer,{ "Participant Config Secure Writer", "rtps.flag.participant_config_secure_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_WRITER, NULL, HFILL } }, { &hf_rtps_flag_participant_config_secure_reader,{ "Participant Config Secure Reader", "rtps.flag.participant_config_secure_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_READER, NULL, HFILL } }, { &hf_rtps_flag_participant_bootstrap_writer,{ "Participant Bootstrap Writer", "rtps.flag.participant_bootstrap_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_WRITER, NULL, HFILL } }, { &hf_rtps_flag_participant_bootstrap_reader,{ "Participant Bootstrap Reader", "rtps.flag.participant_bootstrap_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_READER, NULL, HFILL } }, { &hf_rtps_flag_monitoring_periodic_writer,{ "Monitoring Periodic Writer", "rtps.flag.monitoring_periodic_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_WRITER, NULL, HFILL } }, { &hf_rtps_flag_monitoring_periodic_reader,{ "Monitoring Periodic Reader", "rtps.flag.monitoring_periodic_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_READER, NULL, HFILL } }, { &hf_rtps_flag_monitoring_event_writer,{ "Monitoring Event Writer", "rtps.flag.monitoring_event_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_WRITER, NULL, HFILL } }, { &hf_rtps_flag_monitoring_event_reader,{ "Monitoring Event Reader", "rtps.flag.monitoring_event_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_READER, NULL, HFILL } }, { &hf_rtps_flag_monitoring_logging_writer,{ "Monitoring Logging Writer", "rtps.flag.monitoring_logging_writer", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_WRITER, NULL, HFILL } }, { &hf_rtps_flag_monitoring_logging_reader,{ "Monitoring Logging Reader", "rtps.flag.monitoring_logging_reader", FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_READER, NULL, HFILL } } }; static gint *ett[] = { &ett_rtps, &ett_rtps_default_mapping, &ett_rtps_proto_version, &ett_rtps_product_version, &ett_rtps_submessage, &ett_rtps_parameter_sequence, &ett_rtps_parameter, &ett_rtps_flags, &ett_rtps_entity, &ett_rtps_generic_guid, &ett_rtps_rdentity, &ett_rtps_wrentity, &ett_rtps_guid_prefix, &ett_rtps_app_id, &ett_rtps_locator_udp_v4, &ett_rtps_locator, &ett_rtps_locator_list, &ett_rtps_timestamp, &ett_rtps_bitmap, &ett_rtps_seq_string, &ett_rtps_seq_ulong, &ett_rtps_resource_limit, &ett_rtps_durability_service, &ett_rtps_liveliness, &ett_rtps_manager_key, &ett_rtps_serialized_data, &ett_rtps_locator_filter_channel, &ett_rtps_part_message_data, &ett_rtps_sample_info_list, &ett_rtps_sample_info, &ett_rtps_sample_batch_list, &ett_rtps_locator_filter_locator, &ett_rtps_writer_heartbeat_virtual_list, &ett_rtps_writer_heartbeat_virtual, &ett_rtps_virtual_guid_heartbeat_virtual_list, &ett_rtps_virtual_guid_heartbeat_virtual, &ett_rtps_app_ack_virtual_writer_list, &ett_rtps_app_ack_virtual_writer, &ett_rtps_app_ack_virtual_writer_interval_list, &ett_rtps_app_ack_virtual_writer_interval, &ett_rtps_transport_info, &ett_rtps_property_list, &ett_rtps_property, &ett_rtps_topic_info, &ett_rtps_topic_info_dw_qos, &ett_rtps_type_object, &ett_rtps_type_library, &ett_rtps_type_element, &ett_rtps_type_annotation_usage_list, &ett_rtps_type_enum_constant, &ett_rtps_type_bound_list, &ett_rtps_secure_payload_tree, &ett_rtps_secure_dataheader_tree, &ett_rtps_pgm_data, &ett_rtps_message_identity, &ett_rtps_related_message_identity, &ett_rtps_data_holder_seq, &ett_rtps_data_holder, &ett_rtps_data_holder_properties, &ett_rtps_property_tree, &ett_rtps_param_header_tree, &ett_rtps_custom_dissection_info, &ett_rtps_service_request_tree, &ett_rtps_locator_ping_tree, &ett_rtps_locator_reachability_tree, &ett_rtps_locator_list_tree, &ett_rtps_topic_query_tree, &ett_rtps_topic_query_selection_tree, &ett_rtps_topic_query_filter_params_tree, &ett_rtps_data_member, &ett_rtps_data_tag_seq, &ett_rtps_data_tag_item, &ett_rtps_fragment, &ett_rtps_fragments, &ett_rtps_data_representation, &ett_rtps_decompressed_type_object, &ett_rtps_dissection_tree, &ett_rtps_info_remaining_items, &ett_rtps_data_encapsulation_options, &ett_rtps_decompressed_serialized_data, &ett_rtps_instance_transition_data, &ett_rtps_crypto_algorithm_requirements }; static ei_register_info ei[] = { { &ei_rtps_sm_octets_to_next_header_error, { "rtps.sm.octetsToNextHeader.error", PI_PROTOCOL, PI_WARN, "(Error: bad length)", EXPFILL }}, { &ei_rtps_locator_port, { "rtps.locator.port.invalid", PI_PROTOCOL, PI_WARN, "Invalid Port", EXPFILL }}, { &ei_rtps_ip_invalid, { "rtps.ip_invalid", PI_PROTOCOL, PI_WARN, "IPADDRESS_INVALID_STRING", EXPFILL }}, { &ei_rtps_port_invalid, { "rtps.port_invalid", PI_PROTOCOL, PI_WARN, "PORT_INVALID_STRING", EXPFILL }}, { &ei_rtps_parameter_value_invalid, { "rtps.parameter_value_too_small", PI_PROTOCOL, PI_WARN, "ERROR: Parameter value too small", EXPFILL }}, { &ei_rtps_parameter_not_decoded, { "rtps.parameter_not_decoded", PI_PROTOCOL, PI_WARN, "[DEPRECATED] - Parameter not decoded", EXPFILL }}, { &ei_rtps_sm_octets_to_next_header_not_zero, { "rtps.sm.octetsToNextHeader.not_zero", PI_PROTOCOL, PI_WARN, "Should be ZERO", EXPFILL }}, { &ei_rtps_extra_bytes, { "rtps.extra_bytes", PI_MALFORMED, PI_ERROR, "Don't know how to decode those extra bytes: %d", EXPFILL }}, { &ei_rtps_missing_bytes, { "rtps.missing_bytes", PI_MALFORMED, PI_ERROR, "Not enough bytes to decode", EXPFILL }}, { &ei_rtps_more_samples_available, { "rtps.more_samples_available", PI_PROTOCOL, PI_NOTE, "More samples available. Configure this limit from preferences dialog", EXPFILL }}, { &pid_type_csonsistency_invalid_size, { "rtps.pid_type_consistency_invalid_size", PI_MALFORMED, PI_ERROR, "PID_TYPE_CONSISTENCY invalid size. Has a size of %d bytes. Expected %d or %d bytes.", EXPFILL }}, { &ei_rtps_uncompression_error, { "rtps.uncompression_error", PI_PROTOCOL, PI_WARN, "Unable to uncompress the compressed payload.", EXPFILL }}, { &ei_rtps_value_too_large, { "rtps.value_too_large", PI_MALFORMED, PI_ERROR, "Length value goes past the end of the packet", EXPFILL }}, { &ei_rtps_checksum_check_error, { "rtps.checksum_error", PI_CHECKSUM, PI_ERROR, "Error: Unexpected checksum", EXPFILL }}, }; module_t *rtps_module; expert_module_t *expert_rtps; proto_rtps = proto_register_protocol( "Real-Time Publish-Subscribe Wire Protocol", "RTPS", "rtps"); proto_register_field_array(proto_rtps, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtps = expert_register_protocol(proto_rtps); expert_register_field_array(expert_rtps, ei, array_length(ei)); /* Registers the control in the preference panel */ rtps_module = prefs_register_protocol(proto_rtps, NULL); prefs_register_uint_preference(rtps_module, "max_batch_samples_dissected", "Max samples dissected for DATA_BATCH", "Specifies the maximum number of samples dissected in " "a DATA_BATCH submessage. Increasing this value may affect " "performances if the trace has a lot of big batched samples.", 10, &rtps_max_batch_samples_dissected); prefs_register_bool_preference(rtps_module, "enable_max_dissection_info_elements", "Limit the number of elements dissected in structs", "Enabling this option may affect " "performance if the trace has messages with large Data Types.", &enable_max_data_type_elements); prefs_register_uint_preference(rtps_module, "max_dissection_info_elements", "Max Dissection info elements shown in structs", "Specifies the maximum number of Data Type elements dissected. " "Increasing this value may affect " "performance if the trace has messages with large Data Types.", 10, &rtps_max_data_type_elements); prefs_register_bool_preference(rtps_module, "enable_max_dissection_array_elements", "Limit the number of elements dissected in arrays or sequences", "Disabling this option may affect " "performance if the trace has messages with large arrays or sequences.", &enable_max_array_data_type_elements); prefs_register_uint_preference(rtps_module, "max_dissection_array_elements", "Max Dissection elements shown in arrays or sequences", "Specifies the maximum number of Data Type elements dissected in arrays or sequences. " "Increasing this value may affect " "performance if the trace has messages with large Data Types.", 10, &rtps_max_array_data_type_elements); prefs_register_bool_preference(rtps_module, "enable_topic_info", "Enable Topic Information", "Shows the Topic Name and Type Name of the samples. " "Note: this can considerably increase the dissection time", &enable_topic_info); prefs_register_bool_preference(rtps_module, "enable_user_data_dissection", "Enable User Data Dissection (based on Type Object)", "Dissects the user data if the Type Object is propagated in Discovery.", &enable_user_data_dissection); prefs_register_bool_preference(rtps_module, "enable_rtps_reassembly", "Enable RTPS Reassembly", "Enables the reassembly of DATA_FRAG submessages.", &enable_rtps_reassembly); prefs_register_bool_preference(rtps_module, "enable_rtps_checksum_check", "Enable RTPS Checksum check (Only CRC-32C and MD5 supported)", "Detects the RTPS packets with invalid checksums (Only CRC-32C and MD5 supported)", &enable_rtps_crc_check); rtps_type_name_table = register_dissector_table("rtps.type_name", "RTPS Type Name", proto_rtps, FT_STRING, STRING_CASE_SENSITIVE); registry = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid); dissection_infos = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal); union_member_mappings = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal); mutable_member_mappings = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal); coherent_set_tracking.entities_using_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid); coherent_set_tracking.coherent_set_registry_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), coherent_set_key_hash_by_key, compare_by_coherent_set_key); builtin_dissection_infos = wmem_map_new_autoreset(wmem_epan_scope(), wmem_epan_scope(), g_int64_hash, g_int64_equal); coherent_set_tracking.entities_using_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid); discovered_participants_domain_ids = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_participant_guid, compare_by_participant_guid); /* In order to get this dissector from other dissectors */ register_dissector("rtps", dissect_simple_rtps, proto_rtps); initialize_instance_state_data_response_dissection_info(&builtin_types_dissection_data); reassembly_table_register(&rtps_reassembly_table, &addresses_reassembly_table_functions); } void proto_reg_handoff_rtps(void) { heur_dissector_add("rtitcp", dissect_rtps_rtitcp, "RTPS over RTITCP", "rtps_rtitcp", proto_rtps, HEURISTIC_ENABLE); heur_dissector_add("udp", dissect_rtps_udp, "RTPS over UDP", "rtps_udp", proto_rtps, HEURISTIC_ENABLE); heur_dissector_add("tcp", dissect_rtps_tcp, "RTPS over TCP", "rtps_tcp", proto_rtps, HEURISTIC_ENABLE); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-rtps.h
/* packet-rtps.h * Header file for the Real-Time Publish-Subscribe (RTPS) and related (RTPS * Virtual Transport and Processed) protocols. * * (c) 2020 Copyright, Real-Time Innovations, Inc. * Real-Time Innovations, Inc. * 232 East Java Drive * Sunnyvale, CA 94089 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _TYPEDEFS_DEFINES_RTPS_H #define _TYPEDEFS_DEFINES_RTPS_H #ifdef __cplusplus extern "C" { #endif /* Vendor specific - rti */ #define NDDS_TRANSPORT_CLASSID_ANY (0) #define NDDS_TRANSPORT_CLASSID_UDPv4 (1) #define NDDS_TRANSPORT_CLASSID_UDPv6 (2) #define NDDS_TRANSPORT_CLASSID_INTRA (3) #define NDDS_TRANSPORT_CLASSID_DTLS (6) #define NDDS_TRANSPORT_CLASSID_WAN (7) #define NDDS_TRANSPORT_CLASSID_TCPV4_LAN (8) #define NDDS_TRANSPORT_CLASSID_TCPV4_WAN (9) #define NDDS_TRANSPORT_CLASSID_TLSV4_LAN (10) #define NDDS_TRANSPORT_CLASSID_TLSV4_WAN (11) #define NDDS_TRANSPORT_CLASSID_PCIE (12) #define NDDS_TRANSPORT_CLASSID_ITP (13) #define NDDS_TRANSPORT_CLASSID_SHMEM (0x01000000) #define NDDS_TRANSPORT_CLASSID_UDPv4_WAN (0x01000001) /* * Flags indicating which fields have been filled in. */ #define GUID_HAS_HOST_ID 0x00000001 #define GUID_HAS_APP_ID 0x00000002 #define GUID_HAS_INSTANCE_ID 0x00000004 #define GUID_HAS_ENTITY_ID 0x00000008 #define GUID_HAS_ALL 0x0000000F typedef struct _endpoint_guid { guint fields_present; guint32 host_id; guint32 app_id; guint32 instance_id; guint32 entity_id; } endpoint_guid; /* Process a submessage: used in packet-rtps-processed.c */ extern void dissect_rtps_submessages( tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *rtps_tree, guint16 version, guint16 vendor_id, endpoint_guid *guid); /* Information that the RTPS-VT protocol passes to RTPS-PROC */ struct rtpsvt_data { guint8 version_major; guint8 version_minor; guint8 direction; guint16 rtps_length; }; #ifdef __cplusplus } /* extern "C"*/ #endif #endif /* _TYPEDEFS_DEFINES_RTPS_H */ /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-rtse.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-rtse.c */ /* asn2wrs.py -b -L -p rtse -c ./rtse.cnf -s ./packet-rtse-template -D . -O ../.. rtse.asn */ /* packet-rtse-template.c * Routines for RTSE packet dissection * Graeme Lunt 2005 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/prefs.h> #include <epan/reassemble.h> #include <epan/asn1.h> #include <epan/expert.h> #include <wsutil/str_util.h> #include "packet-ber.h" #include "packet-pres.h" #include "packet-acse.h" #include "packet-ros.h" #include "packet-rtse.h" #define PNAME "X.228 OSI Reliable Transfer Service" #define PSNAME "RTSE" #define PFNAME "rtse" void proto_register_rtse(void); void proto_reg_handoff_rtse(void); /* Initialize the protocol and registered fields */ static int proto_rtse = -1; static gboolean open_request=FALSE; static guint32 app_proto=0; static proto_tree *top_tree=NULL; /* Preferences */ static gboolean rtse_reassemble = TRUE; static int hf_rtse_rtorq_apdu = -1; /* RTORQapdu */ static int hf_rtse_rtoac_apdu = -1; /* RTOACapdu */ static int hf_rtse_rtorj_apdu = -1; /* RTORJapdu */ static int hf_rtse_rttp_apdu = -1; /* RTTPapdu */ static int hf_rtse_rttr_apdu = -1; /* RTTRapdu */ static int hf_rtse_rtab_apdu = -1; /* RTABapdu */ static int hf_rtse_checkpointSize = -1; /* INTEGER */ static int hf_rtse_windowSize = -1; /* INTEGER */ static int hf_rtse_dialogueMode = -1; /* T_dialogueMode */ static int hf_rtse_connectionDataRQ = -1; /* ConnectionData */ static int hf_rtse_applicationProtocol = -1; /* T_applicationProtocol */ static int hf_rtse_connectionDataAC = -1; /* ConnectionData */ static int hf_rtse_refuseReason = -1; /* RefuseReason */ static int hf_rtse_userDataRJ = -1; /* T_userDataRJ */ static int hf_rtse_abortReason = -1; /* AbortReason */ static int hf_rtse_reflectedParameter = -1; /* BIT_STRING */ static int hf_rtse_userdataAB = -1; /* T_userdataAB */ static int hf_rtse_open = -1; /* T_open */ static int hf_rtse_recover = -1; /* SessionConnectionIdentifier */ static int hf_rtse_callingSSuserReference = -1; /* CallingSSuserReference */ static int hf_rtse_commonReference = -1; /* CommonReference */ static int hf_rtse_additionalReferenceInformation = -1; /* AdditionalReferenceInformation */ static int hf_rtse_t61String = -1; /* T_t61String */ static int hf_rtse_octetString = -1; /* T_octetString */ /* Initialize the subtree pointers */ static gint ett_rtse = -1; static gint ett_rtse_RTSE_apdus = -1; static gint ett_rtse_RTORQapdu = -1; static gint ett_rtse_RTOACapdu = -1; static gint ett_rtse_RTORJapdu = -1; static gint ett_rtse_RTABapdu = -1; static gint ett_rtse_ConnectionData = -1; static gint ett_rtse_SessionConnectionIdentifier = -1; static gint ett_rtse_CallingSSuserReference = -1; static expert_field ei_rtse_dissector_oid_not_implemented = EI_INIT; static expert_field ei_rtse_unknown_rtse_pdu = EI_INIT; static expert_field ei_rtse_abstract_syntax = EI_INIT; static dissector_table_t rtse_oid_dissector_table=NULL; static dissector_handle_t rtse_handle = NULL; static gint ett_rtse_unknown = -1; static reassembly_table rtse_reassembly_table; static int hf_rtse_segment_data = -1; static int hf_rtse_fragments = -1; static int hf_rtse_fragment = -1; static int hf_rtse_fragment_overlap = -1; static int hf_rtse_fragment_overlap_conflicts = -1; static int hf_rtse_fragment_multiple_tails = -1; static int hf_rtse_fragment_too_long_fragment = -1; static int hf_rtse_fragment_error = -1; static int hf_rtse_fragment_count = -1; static int hf_rtse_reassembled_in = -1; static int hf_rtse_reassembled_length = -1; static gint ett_rtse_fragment = -1; static gint ett_rtse_fragments = -1; static const fragment_items rtse_frag_items = { /* Fragment subtrees */ &ett_rtse_fragment, &ett_rtse_fragments, /* Fragment fields */ &hf_rtse_fragments, &hf_rtse_fragment, &hf_rtse_fragment_overlap, &hf_rtse_fragment_overlap_conflicts, &hf_rtse_fragment_multiple_tails, &hf_rtse_fragment_too_long_fragment, &hf_rtse_fragment_error, &hf_rtse_fragment_count, /* Reassembled in field */ &hf_rtse_reassembled_in, /* Reassembled length field */ &hf_rtse_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "RTSE fragments" }; void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto, const char *name, gboolean uses_ros) { /* XXX: Note that this fcn is called from proto_reg_handoff in *other* dissectors ... */ static dissector_handle_t ros_handle = NULL; if (ros_handle == NULL) ros_handle = find_dissector("ros"); /* register RTSE with the BER (ACSE) */ register_ber_oid_dissector_handle(oid, rtse_handle, proto, name); if (uses_ros) { /* make sure we call ROS ... */ dissector_add_string("rtse.oid", oid, ros_handle); /* and then tell ROS how to dissect the AS*/ if (dissector != NULL) register_ros_oid_dissector_handle(oid, dissector, proto, name, TRUE); } else { /* otherwise we just remember how to dissect the AS */ dissector_add_string("rtse.oid", oid, dissector); } } static int call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data) { tvbuff_t *next_tvb; int len; next_tvb = tvb_new_subset_remaining(tvb, offset); if ((len = dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)) == 0) { proto_item *item; proto_tree *next_tree; next_tree = proto_tree_add_subtree_format(tree, next_tvb, 0, -1, ett_rtse_unknown, &item, "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid); expert_add_info_format(pinfo, item, &ei_rtse_dissector_oid_not_implemented, "RTSE: Dissector for OID %s not implemented", oid); len = dissect_unknown_ber(pinfo, next_tvb, offset, next_tree); } offset += len; return offset; } static int call_rtse_external_type_callback(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { const char *oid = NULL; if (actx->external.indirect_ref_present) { oid = (const char *)find_oid_by_pres_ctx_id(actx->pinfo, actx->external.indirect_reference); if (!oid) proto_tree_add_expert_format(tree, actx->pinfo, &ei_rtse_abstract_syntax, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Unable to determine abstract syntax for indirect reference: %d.", actx->external.indirect_reference); } else if (actx->external.direct_ref_present) { oid = actx->external.direct_reference; } if (oid) offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, actx->private_data); return offset; } static int dissect_rtse_INTEGER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); return offset; } static const value_string rtse_T_dialogueMode_vals[] = { { 0, "monologue" }, { 1, "twa" }, { 0, NULL } }; static int dissect_rtse_T_dialogueMode(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); return offset; } static int dissect_rtse_T_open(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; const char *oid = NULL; switch(app_proto) { case 1: /* mts-transfer-protocol-1984 */ oid = "applicationProtocol.1"; break; case 12: /* mts-transfer-protocol */ oid = "applicationProtocol.12"; break; default: if(session && session->pres_ctx_id) oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id); break; } if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */ oid = "applicationProtocol.12"; if(oid) { offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, session); } /* else XXX: need to flag we can't find the presentation context */ return offset; } static int dissect_rtse_T_t61String(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *string = NULL; offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, actx, tree, tvb, offset, hf_index, &string); if(open_request && string) col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_get_string_enc(actx->pinfo->pool, string, 0, tvb_reported_length(string), ENC_T61)); return offset; } static int dissect_rtse_T_octetString(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *string = NULL; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &string); if(open_request && string) col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(actx->pinfo->pool, string, 0, tvb_reported_length(string))); return offset; } static const value_string rtse_CallingSSuserReference_vals[] = { { 0, "t61String" }, { 1, "octetString" }, { 0, NULL } }; static const ber_choice_t CallingSSuserReference_choice[] = { { 0, &hf_rtse_t61String , BER_CLASS_UNI, BER_UNI_TAG_TeletexString, BER_FLAGS_NOOWNTAG, dissect_rtse_T_t61String }, { 1, &hf_rtse_octetString , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_rtse_T_octetString }, { 0, NULL, 0, 0, 0, NULL } }; static int dissect_rtse_CallingSSuserReference(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_choice(actx, tree, tvb, offset, CallingSSuserReference_choice, hf_index, ett_rtse_CallingSSuserReference, NULL); return offset; } static int dissect_rtse_CommonReference(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *string = NULL; offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index, NULL, NULL); if(open_request && string) col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(actx->pinfo->pool, string, 0, tvb_reported_length(string))); return offset; } static int dissect_rtse_AdditionalReferenceInformation(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, actx, tree, tvb, offset, hf_index, NULL); return offset; } static const ber_sequence_t SessionConnectionIdentifier_sequence[] = { { &hf_rtse_callingSSuserReference, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rtse_CallingSSuserReference }, { &hf_rtse_commonReference, BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_rtse_CommonReference }, { &hf_rtse_additionalReferenceInformation, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_AdditionalReferenceInformation }, { NULL, 0, 0, 0, NULL } }; static int dissect_rtse_SessionConnectionIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { if(open_request){ col_append_str(actx->pinfo->cinfo, COL_INFO, "Recover"); } offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, SessionConnectionIdentifier_sequence, hf_index, ett_rtse_SessionConnectionIdentifier); return offset; } static const value_string rtse_ConnectionData_vals[] = { { 0, "open" }, { 1, "recover" }, { 0, NULL } }; static const ber_choice_t ConnectionData_choice[] = { { 0, &hf_rtse_open , BER_CLASS_CON, 0, 0, dissect_rtse_T_open }, { 1, &hf_rtse_recover , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_rtse_SessionConnectionIdentifier }, { 0, NULL, 0, 0, 0, NULL } }; static int dissect_rtse_ConnectionData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_choice(actx, tree, tvb, offset, ConnectionData_choice, hf_index, ett_rtse_ConnectionData, NULL); return offset; } static const value_string rtse_T_applicationProtocol_vals[] = { { 12, "mts-transfer-protocol" }, { 1, "mts-transfer-protocol-1984" }, { 0, NULL } }; static int dissect_rtse_T_applicationProtocol(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_integer(TRUE, actx, tree, tvb, offset, hf_index, &app_proto); return offset; } static const ber_sequence_t RTORQapdu_set[] = { { &hf_rtse_checkpointSize , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_INTEGER }, { &hf_rtse_windowSize , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_INTEGER }, { &hf_rtse_dialogueMode , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_T_dialogueMode }, { &hf_rtse_connectionDataRQ, BER_CLASS_CON, 3, BER_FLAGS_NOTCHKTAG, dissect_rtse_ConnectionData }, { &hf_rtse_applicationProtocol, BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_T_applicationProtocol }, { NULL, 0, 0, 0, NULL } }; int dissect_rtse_RTORQapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; if(session != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT); open_request=TRUE; offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTORQapdu_set, hf_index, ett_rtse_RTORQapdu); open_request=FALSE; return offset; } static const ber_sequence_t RTOACapdu_set[] = { { &hf_rtse_checkpointSize , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_INTEGER }, { &hf_rtse_windowSize , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_INTEGER }, { &hf_rtse_connectionDataAC, BER_CLASS_CON, 2, BER_FLAGS_NOTCHKTAG, dissect_rtse_ConnectionData }, { NULL, 0, 0, 0, NULL } }; int dissect_rtse_RTOACapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; if(session != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_RESULT); offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTOACapdu_set, hf_index, ett_rtse_RTOACapdu); return offset; } static const value_string rtse_RefuseReason_vals[] = { { 0, "rtsBusy" }, { 1, "cannotRecover" }, { 2, "validationFailure" }, { 3, "unacceptableDialogueMode" }, { 0, NULL } }; static int dissect_rtse_RefuseReason(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { int reason = -1; offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &reason); if(reason != -1) col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", val_to_str(reason, rtse_RefuseReason_vals, "reason(%d)")); return offset; } static int dissect_rtse_T_userDataRJ(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; const char *oid = NULL; switch(app_proto) { case 1: /* mts-transfer-protocol-1984 */ oid = "applicationProtocol.1"; break; case 12: /* mts-transfer-protocol */ oid = "applicationProtocol.12"; break; default: if(session && session->pres_ctx_id) oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id); break; } if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */ oid = "applicationProtocol.12"; if(oid) { if(session != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR); offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, session); } return offset; } static const ber_sequence_t RTORJapdu_set[] = { { &hf_rtse_refuseReason , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_RefuseReason }, { &hf_rtse_userDataRJ , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_rtse_T_userDataRJ }, { NULL, 0, 0, 0, NULL } }; int dissect_rtse_RTORJapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_str(actx->pinfo->cinfo, COL_INFO, "Refuse"); offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTORJapdu_set, hf_index, ett_rtse_RTORJapdu); return offset; } static int dissect_rtse_RTTPapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { int priority = -1; col_append_str(actx->pinfo->cinfo, COL_INFO, "Turn-Please"); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &priority); if(priority != -1) col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%d)", priority); return offset; } static int dissect_rtse_RTTRapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *next_tvb = NULL; struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &next_tvb); if(next_tvb) { /* XXX: we should check is this is an EXTERNAL first */ /* ROS won't do this for us */ if(session) session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); offset = dissect_ber_external_type(FALSE, tree, next_tvb, 0, actx, -1, call_rtse_external_type_callback); } return offset; } static const value_string rtse_AbortReason_vals[] = { { 0, "localSystemProblem" }, { 1, "invalidParameter" }, { 2, "unrecognizedActivity" }, { 3, "temporaryProblem" }, { 4, "protocolError" }, { 5, "permanentProblem" }, { 6, "userError" }, { 7, "transferCompleted" }, { 0, NULL } }; static int dissect_rtse_AbortReason(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { int reason = -1; offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &reason); if(reason != -1) col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", val_to_str(reason, rtse_AbortReason_vals, "reason(%d)")); return offset; } static int dissect_rtse_BIT_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset, NULL, 0, hf_index, -1, NULL); return offset; } static int dissect_rtse_T_userdataAB(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { /*XXX not implemented yet */ return offset; } static const ber_sequence_t RTABapdu_set[] = { { &hf_rtse_abortReason , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_AbortReason }, { &hf_rtse_reflectedParameter, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_rtse_BIT_STRING }, { &hf_rtse_userdataAB , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_rtse_T_userdataAB }, { NULL, 0, 0, 0, NULL } }; int dissect_rtse_RTABapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_str(actx->pinfo->cinfo, COL_INFO, "Abort"); offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTABapdu_set, hf_index, ett_rtse_RTABapdu); return offset; } static const ber_choice_t RTSE_apdus_choice[] = { { 0, &hf_rtse_rtorq_apdu , BER_CLASS_CON, 16, BER_FLAGS_IMPLTAG, dissect_rtse_RTORQapdu }, { 1, &hf_rtse_rtoac_apdu , BER_CLASS_CON, 17, BER_FLAGS_IMPLTAG, dissect_rtse_RTOACapdu }, { 2, &hf_rtse_rtorj_apdu , BER_CLASS_CON, 18, BER_FLAGS_IMPLTAG, dissect_rtse_RTORJapdu }, { 3, &hf_rtse_rttp_apdu , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_rtse_RTTPapdu }, { 4, &hf_rtse_rttr_apdu , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_rtse_RTTRapdu }, { 5, &hf_rtse_rtab_apdu , BER_CLASS_CON, 22, BER_FLAGS_IMPLTAG, dissect_rtse_RTABapdu }, { 0, NULL, 0, 0, 0, NULL } }; static int dissect_rtse_RTSE_apdus(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_choice(actx, tree, tvb, offset, RTSE_apdus_choice, hf_index, ett_rtse_RTSE_apdus, NULL); return offset; } /* * Dissect RTSE PDUs inside a PPDU. */ static int dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { int offset = 0; int old_offset; proto_item *item; proto_tree *tree; proto_tree *next_tree=NULL; tvbuff_t *next_tvb = NULL; tvbuff_t *data_tvb = NULL; fragment_head *frag_msg = NULL; guint32 fragment_length; guint32 rtse_id = 0; gboolean data_handled = FALSE; struct SESSION_DATA_STRUCTURE* session; conversation_t *conversation = NULL; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* do we have application context from the acse dissector? */ if (data == NULL) return 0; session = (struct SESSION_DATA_STRUCTURE*)data; /* save parent_tree so subdissectors can create new top nodes */ top_tree=parent_tree; asn1_ctx.private_data = session; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTSE"); col_clear(pinfo->cinfo, COL_INFO); if (rtse_reassemble && ((session->spdu_type == SES_DATA_TRANSFER) || (session->spdu_type == SES_MAJOR_SYNC_POINT))) { /* Use conversation index as fragment id */ conversation = find_conversation_pinfo(pinfo, 0); if (conversation != NULL) { rtse_id = conversation->conv_index; } session->rtse_reassemble = TRUE; } if (rtse_reassemble && session->spdu_type == SES_MAJOR_SYNC_POINT) { frag_msg = fragment_end_seq_next (&rtse_reassembly_table, pinfo, rtse_id, NULL); next_tvb = process_reassembled_data (tvb, offset, pinfo, "Reassembled RTSE", frag_msg, &rtse_frag_items, NULL, parent_tree); } item = proto_tree_add_item(parent_tree, proto_rtse, next_tvb ? next_tvb : tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_rtse); if (rtse_reassemble && session->spdu_type == SES_DATA_TRANSFER) { /* strip off the OCTET STRING encoding - including any CONSTRUCTED OCTET STRING */ dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, offset, hf_rtse_segment_data, &data_tvb); if (data_tvb) { fragment_length = tvb_captured_length_remaining (data_tvb, 0); proto_item_append_text(asn1_ctx.created_item, " (%u byte%s)", fragment_length, plurality(fragment_length, "", "s")); frag_msg = fragment_add_seq_next (&rtse_reassembly_table, data_tvb, 0, pinfo, rtse_id, NULL, fragment_length, TRUE); if (frag_msg && pinfo->num != frag_msg->reassembled_in) { /* Add a "Reassembled in" link if not reassembled in this frame */ proto_tree_add_uint (tree, *(rtse_frag_items.hf_reassembled_in), data_tvb, 0, 0, frag_msg->reassembled_in); } pinfo->fragmented = TRUE; data_handled = TRUE; } else { fragment_length = tvb_captured_length_remaining (tvb, offset); } col_append_fstr(pinfo->cinfo, COL_INFO, "[RTSE fragment, %u byte%s]", fragment_length, plurality(fragment_length, "", "s")); } else if (rtse_reassemble && session->spdu_type == SES_MAJOR_SYNC_POINT) { if (next_tvb) { /* ROS won't do this for us */ session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); /*offset=*/dissect_ber_external_type(FALSE, tree, next_tvb, 0, &asn1_ctx, -1, call_rtse_external_type_callback); top_tree = NULL; /* Return other than 0 to indicate that we handled this packet */ return 1; } else { offset = tvb_captured_length (tvb); } pinfo->fragmented = FALSE; data_handled = TRUE; } if (!data_handled) { while (tvb_reported_length_remaining(tvb, offset) > 0) { old_offset=offset; offset=dissect_rtse_RTSE_apdus(TRUE, tvb, offset, &asn1_ctx, tree, -1); if (offset == old_offset) { next_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtse_unknown, &item, "Unknown RTSE PDU"); expert_add_info (pinfo, item, &ei_rtse_unknown_rtse_pdu); dissect_unknown_ber(pinfo, tvb, offset, next_tree); break; } } } top_tree = NULL; return tvb_captured_length(tvb); } /*--- proto_register_rtse -------------------------------------------*/ void proto_register_rtse(void) { /* List of fields */ static hf_register_info hf[] = { /* Fragment entries */ { &hf_rtse_segment_data, { "RTSE segment data", "rtse.segment", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtse_fragments, { "RTSE fragments", "rtse.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtse_fragment, { "RTSE fragment", "rtse.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtse_fragment_overlap, { "RTSE fragment overlap", "rtse.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtse_fragment_overlap_conflicts, { "RTSE fragment overlapping with conflicting data", "rtse.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtse_fragment_multiple_tails, { "RTSE has multiple tail fragments", "rtse.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtse_fragment_too_long_fragment, { "RTSE fragment too long", "rtse.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_rtse_fragment_error, { "RTSE defragmentation error", "rtse.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_rtse_fragment_count, { "RTSE fragment count", "rtse.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_rtse_reassembled_in, { "Reassembled RTSE in frame", "rtse.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, "This RTSE packet is reassembled in this frame", HFILL } }, { &hf_rtse_reassembled_length, { "Reassembled RTSE length", "rtse.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, "The total length of the reassembled payload", HFILL } }, { &hf_rtse_rtorq_apdu, { "rtorq-apdu", "rtse.rtorq_apdu_element", FT_NONE, BASE_NONE, NULL, 0, "RTORQapdu", HFILL }}, { &hf_rtse_rtoac_apdu, { "rtoac-apdu", "rtse.rtoac_apdu_element", FT_NONE, BASE_NONE, NULL, 0, "RTOACapdu", HFILL }}, { &hf_rtse_rtorj_apdu, { "rtorj-apdu", "rtse.rtorj_apdu_element", FT_NONE, BASE_NONE, NULL, 0, "RTORJapdu", HFILL }}, { &hf_rtse_rttp_apdu, { "rttp-apdu", "rtse.rttp_apdu", FT_INT32, BASE_DEC, NULL, 0, "RTTPapdu", HFILL }}, { &hf_rtse_rttr_apdu, { "rttr-apdu", "rtse.rttr_apdu", FT_BYTES, BASE_NONE, NULL, 0, "RTTRapdu", HFILL }}, { &hf_rtse_rtab_apdu, { "rtab-apdu", "rtse.rtab_apdu_element", FT_NONE, BASE_NONE, NULL, 0, "RTABapdu", HFILL }}, { &hf_rtse_checkpointSize, { "checkpointSize", "rtse.checkpointSize", FT_INT32, BASE_DEC, NULL, 0, "INTEGER", HFILL }}, { &hf_rtse_windowSize, { "windowSize", "rtse.windowSize", FT_INT32, BASE_DEC, NULL, 0, "INTEGER", HFILL }}, { &hf_rtse_dialogueMode, { "dialogueMode", "rtse.dialogueMode", FT_INT32, BASE_DEC, VALS(rtse_T_dialogueMode_vals), 0, NULL, HFILL }}, { &hf_rtse_connectionDataRQ, { "connectionDataRQ", "rtse.connectionDataRQ", FT_UINT32, BASE_DEC, VALS(rtse_ConnectionData_vals), 0, "ConnectionData", HFILL }}, { &hf_rtse_applicationProtocol, { "applicationProtocol", "rtse.applicationProtocol", FT_INT32, BASE_DEC, VALS(rtse_T_applicationProtocol_vals), 0, NULL, HFILL }}, { &hf_rtse_connectionDataAC, { "connectionDataAC", "rtse.connectionDataAC", FT_UINT32, BASE_DEC, VALS(rtse_ConnectionData_vals), 0, "ConnectionData", HFILL }}, { &hf_rtse_refuseReason, { "refuseReason", "rtse.refuseReason", FT_INT32, BASE_DEC, VALS(rtse_RefuseReason_vals), 0, NULL, HFILL }}, { &hf_rtse_userDataRJ, { "userDataRJ", "rtse.userDataRJ_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtse_abortReason, { "abortReason", "rtse.abortReason", FT_INT32, BASE_DEC, VALS(rtse_AbortReason_vals), 0, NULL, HFILL }}, { &hf_rtse_reflectedParameter, { "reflectedParameter", "rtse.reflectedParameter", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING", HFILL }}, { &hf_rtse_userdataAB, { "userdataAB", "rtse.userdataAB_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtse_open, { "open", "rtse.open_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtse_recover, { "recover", "rtse.recover_element", FT_NONE, BASE_NONE, NULL, 0, "SessionConnectionIdentifier", HFILL }}, { &hf_rtse_callingSSuserReference, { "callingSSuserReference", "rtse.callingSSuserReference", FT_UINT32, BASE_DEC, VALS(rtse_CallingSSuserReference_vals), 0, NULL, HFILL }}, { &hf_rtse_commonReference, { "commonReference", "rtse.commonReference", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtse_additionalReferenceInformation, { "additionalReferenceInformation", "rtse.additionalReferenceInformation", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtse_t61String, { "t61String", "rtse.t61String", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtse_octetString, { "octetString", "rtse.octetString", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_rtse, &ett_rtse_unknown, &ett_rtse_fragment, &ett_rtse_fragments, &ett_rtse_RTSE_apdus, &ett_rtse_RTORQapdu, &ett_rtse_RTOACapdu, &ett_rtse_RTORJapdu, &ett_rtse_RTABapdu, &ett_rtse_ConnectionData, &ett_rtse_SessionConnectionIdentifier, &ett_rtse_CallingSSuserReference, }; static ei_register_info ei[] = { { &ei_rtse_dissector_oid_not_implemented, { "rtse.dissector_oid_not_implemented", PI_UNDECODED, PI_WARN, "RTSE: Dissector for OID not implemented", EXPFILL }}, { &ei_rtse_unknown_rtse_pdu, { "rtse.unknown_rtse_pdu", PI_UNDECODED, PI_WARN, "Unknown RTSE PDU", EXPFILL }}, { &ei_rtse_abstract_syntax, { "rtse.bad_abstract_syntax", PI_PROTOCOL, PI_WARN, "Unable to determine abstract syntax for indirect reference", EXPFILL }}, }; expert_module_t* expert_rtse; module_t *rtse_module; /* Register protocol */ proto_rtse = proto_register_protocol(PNAME, PSNAME, PFNAME); rtse_handle = register_dissector("rtse", dissect_rtse, proto_rtse); /* Register fields and subtrees */ proto_register_field_array(proto_rtse, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtse = expert_register_protocol(proto_rtse); expert_register_field_array(expert_rtse, ei, array_length(ei)); reassembly_table_register (&rtse_reassembly_table, &addresses_reassembly_table_functions); rtse_module = prefs_register_protocol_subtree("OSI", proto_rtse, NULL); prefs_register_bool_preference(rtse_module, "reassemble", "Reassemble segmented RTSE datagrams", "Whether segmented RTSE datagrams should be reassembled." " To use this option, you must also enable" " \"Allow subdissectors to reassemble TCP streams\"" " in the TCP protocol settings.", &rtse_reassemble); rtse_oid_dissector_table = register_dissector_table("rtse.oid", "RTSE OID Dissectors", proto_rtse, FT_STRING, STRING_CASE_SENSITIVE); } /*--- proto_reg_handoff_rtse --- */ void proto_reg_handoff_rtse(void) { } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-rtse.h
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-rtse.h */ /* asn2wrs.py -b -L -p rtse -c ./rtse.cnf -s ./packet-rtse-template -D . -O ../.. rtse.asn */ /* packet-rtse.h * Routines for RTSE packet dissection * Graeme Lunt 2005 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_RTSE_H #define PACKET_RTSE_H int dissect_rtse_RTORQapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_rtse_RTOACapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_rtse_RTORJapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_rtse_RTABapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros); #endif /* PACKET_RTSE_H */
C
wireshark/epan/dissectors/packet-rtsp.c
/* packet-rtsp.c * Routines for RTSP packet disassembly (RFC 2326) * * Jason Lango <[email protected]> * Liberally copied from packet-http.c, by Guy Harris <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * References: * RTSP is defined in RFC 2326, https://tools.ietf.org/html/rfc2326 * https://www.iana.org/assignments/rsvp-parameters */ #include "config.h" #include <stdio.h> /* for sscanf() */ #include <epan/packet.h> #include <epan/req_resp_hdrs.h> #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/expert.h> #include <epan/strutil.h> #include <epan/tap-voip.h> #include <epan/stats_tree.h> #include <epan/addr_resolv.h> #include <wsutil/str_util.h> #include <wsutil/strtoi.h> #include "packet-rdt.h" #include "packet-rtp.h" #include "packet-rtcp.h" #include "packet-e164.h" #include "packet-rtsp.h" void proto_register_rtsp(void); static int rtsp_tap = -1; static rtsp_info_value_t *rtsp_stat_info; /* http://www.iana.org/assignments/rtsp-parameters/rtsp-parameters.xml */ const value_string rtsp_status_code_vals[] = { { 100, "Continue" }, { 199, "Informational - Others" }, { 200, "OK"}, { 201, "Created"}, { 250, "Low on Storage Space"}, { 299, "Success - Others"}, { 300, "Multiple Choices"}, { 301, "Moved Permanently"}, { 302, "Moved Temporarily"}, { 303, "See Other"}, { 305, "Use Proxy"}, { 399, "Redirection - Others"}, { 400, "Bad Request"}, { 401, "Unauthorized"}, { 402, "Payment Required"}, { 403, "Forbidden"}, { 404, "Not Found"}, { 405, "Method Not Allowed"}, { 406, "Not Acceptable"}, { 407, "Proxy Authentication Required"}, { 408, "Request Timeout"}, { 410, "Gone"}, { 411, "Length Required"}, { 412, "Precondition Failed"}, { 413, "Request Entity Too Large"}, { 414, "Request-URI Too Long"}, { 415, "Unsupported Media Type"}, { 451, "Invalid Parameter"}, { 452, "Illegal Conference Identifier"}, { 453, "Not Enough Bandwidth"}, { 454, "Session Not Found"}, { 455, "Method Not Valid In This State"}, { 456, "Header Field Not Valid"}, { 457, "Invalid Range"}, { 458, "Parameter Is Read-Only"}, { 459, "Aggregate Operation Not Allowed"}, { 460, "Only Aggregate Operation Allowed"}, { 461, "Unsupported Transport"}, { 462, "Destination Unreachable"}, { 499, "Client Error - Others"}, { 500, "Internal Server Error"}, { 501, "Not Implemented"}, { 502, "Bad Gateway"}, { 503, "Service Unavailable"}, { 504, "Gateway Timeout"}, { 505, "RTSP Version not supported"}, { 551, "Option Not Support"}, { 599, "Server Error - Others"}, { 0, NULL} }; static int proto_rtsp = -1; static gint ett_rtsp = -1; static gint ett_rtspframe = -1; static gint ett_rtsp_method = -1; static int hf_rtsp_request = -1; static int hf_rtsp_response = -1; static int hf_rtsp_content_type = -1; static int hf_rtsp_content_length = -1; static int hf_rtsp_method = -1; static int hf_rtsp_url = -1; static int hf_rtsp_status = -1; static int hf_rtsp_session = -1; static int hf_rtsp_transport = -1; static int hf_rtsp_rdtfeaturelevel = -1; static int hf_rtsp_X_Vig_Msisdn = -1; static int hf_rtsp_magic = -1; static int hf_rtsp_channel = -1; static int hf_rtsp_length = -1; static int hf_rtsp_data = -1; static int voip_tap = -1; static expert_field ei_rtsp_unknown_transport_type = EI_INIT; static expert_field ei_rtsp_bad_server_port = EI_INIT; static expert_field ei_rtsp_bad_client_port = EI_INIT; static expert_field ei_rtsp_bad_interleaved_channel = EI_INIT; static expert_field ei_rtsp_content_length_invalid = EI_INIT; static expert_field ei_rtsp_rdtfeaturelevel_invalid = EI_INIT; static expert_field ei_rtsp_bad_server_ip_address = EI_INIT; static expert_field ei_rtsp_bad_client_ip_address = EI_INIT; static dissector_handle_t rtsp_handle; static dissector_handle_t rtp_handle; static dissector_handle_t rtp_rfc4571_handle; static dissector_handle_t rtcp_handle; static dissector_handle_t rdt_handle; static dissector_table_t media_type_dissector_table; static heur_dissector_list_t heur_subdissector_list; static const gchar *st_str_packets = "Total RTSP Packets"; static const gchar *st_str_requests = "RTSP Request Packets"; static const gchar *st_str_responses = "RTSP Response Packets"; static const gchar *st_str_resp_broken = "???: broken"; static const gchar *st_str_resp_100 = "1xx: Informational"; static const gchar *st_str_resp_200 = "2xx: Success"; static const gchar *st_str_resp_300 = "3xx: Redirection"; static const gchar *st_str_resp_400 = "4xx: Client Error"; static const gchar *st_str_resp_500 = "5xx: Server Error"; static const gchar *st_str_other = "Other RTSP Packets"; static int st_node_packets = -1; static int st_node_requests = -1; static int st_node_responses = -1; static int st_node_resp_broken = -1; static int st_node_resp_100 = -1; static int st_node_resp_200 = -1; static int st_node_resp_300 = -1; static int st_node_resp_400 = -1; static int st_node_resp_500 = -1; static int st_node_other = -1; static void rtsp_stats_tree_init(stats_tree* st) { st_node_packets = stats_tree_create_node(st, st_str_packets, 0, STAT_DT_INT, TRUE); st_node_requests = stats_tree_create_pivot(st, st_str_requests, st_node_packets); st_node_responses = stats_tree_create_node(st, st_str_responses, st_node_packets, STAT_DT_INT, TRUE); st_node_resp_broken = stats_tree_create_node(st, st_str_resp_broken, st_node_responses, STAT_DT_INT, TRUE); st_node_resp_100 = stats_tree_create_node(st, st_str_resp_100, st_node_responses, STAT_DT_INT, TRUE); st_node_resp_200 = stats_tree_create_node(st, st_str_resp_200, st_node_responses, STAT_DT_INT, TRUE); st_node_resp_300 = stats_tree_create_node(st, st_str_resp_300, st_node_responses, STAT_DT_INT, TRUE); st_node_resp_400 = stats_tree_create_node(st, st_str_resp_400, st_node_responses, STAT_DT_INT, TRUE); st_node_resp_500 = stats_tree_create_node(st, st_str_resp_500, st_node_responses, STAT_DT_INT, TRUE); st_node_other = stats_tree_create_node(st, st_str_other, st_node_packets, STAT_DT_INT, FALSE); } /* RTSP/Packet Counter stats packet function */ static tap_packet_status rtsp_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p, tap_flags_t flags _U_) { const rtsp_info_value_t *v = (const rtsp_info_value_t *)p; guint i = v->response_code; int resp_grp; const gchar *resp_str; static gchar str[64]; tick_stat_node(st, st_str_packets, 0, FALSE); if (i) { tick_stat_node(st, st_str_responses, st_node_packets, FALSE); if ( (i<100)||(i>=600) ) { resp_grp = st_node_resp_broken; resp_str = st_str_resp_broken; } else if (i<200) { resp_grp = st_node_resp_100; resp_str = st_str_resp_100; } else if (i<300) { resp_grp = st_node_resp_200; resp_str = st_str_resp_200; } else if (i<400) { resp_grp = st_node_resp_300; resp_str = st_str_resp_300; } else if (i<500) { resp_grp = st_node_resp_400; resp_str = st_str_resp_400; } else { resp_grp = st_node_resp_500; resp_str = st_str_resp_500; } tick_stat_node(st, resp_str, st_node_responses, FALSE); snprintf(str, sizeof(str),"%u %s",i,val_to_str(i,rtsp_status_code_vals, "Unknown (%d)")); tick_stat_node(st, str, resp_grp, FALSE); } else if (v->request_method) { stats_tree_tick_pivot(st,st_node_requests,v->request_method); } else { tick_stat_node(st, st_str_other, st_node_packets, FALSE); } return TAP_PACKET_REDRAW; } void proto_reg_handoff_rtsp(void); /* * desegmentation of RTSP headers * (when we are over TCP or another protocol providing the desegmentation API) */ static gboolean rtsp_desegment_headers = TRUE; /* * desegmentation of RTSP bodies * (when we are over TCP or another protocol providing the desegmentation API) * TODO let the user filter on content-type the bodies he wants desegmented */ static gboolean rtsp_desegment_body = TRUE; /* http://www.iana.org/assignments/port-numbers lists two rtsp ports. * In Addition RTSP uses display port over Wi-Fi Display: 7236. */ #define RTSP_TCP_PORT_RANGE "554,8554,7236" /* * Takes an array of bytes, assumed to contain a null-terminated * string, as an argument, and returns the length of the string - * i.e., the size of the array, minus 1 for the null terminator. */ #define STRLEN_CONST(str) (sizeof (str) - 1) #define RTSP_FRAMEHDR ('$') typedef struct { dissector_handle_t dissector; } rtsp_interleaved_t; #define RTSP_MAX_INTERLEAVED (256) /* * Careful about dynamically allocating memory in this structure (say * for dynamically increasing the size of the 'interleaved' array) - * the containing structure is garbage collected and contained * pointers will not be freed. */ typedef struct { rtsp_interleaved_t interleaved[RTSP_MAX_INTERLEAVED]; } rtsp_conversation_data_t; static int dissect_rtspinterleaved(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { guint length_remaining; proto_item *ti; proto_tree *rtspframe_tree = NULL; int orig_offset; guint8 rf_chan; /* interleaved channel id */ guint16 rf_len; /* packet length */ tvbuff_t *next_tvb; conversation_t *conv; rtsp_conversation_data_t *data; dissector_handle_t dissector; /* * This will throw an exception if we don't have any data left. * That's what we want. (See "tcp_dissect_pdus()", which is * similar.) */ length_remaining = tvb_ensure_captured_length_remaining(tvb, offset); /* * Can we do reassembly? */ if (rtsp_desegment_headers && pinfo->can_desegment) { /* * Yes - would an RTSP multiplexed header starting at * this offset be split across segment boundaries? */ if (length_remaining < 4) { /* * Yes. Tell the TCP dissector where the data for * this message starts in the data it handed us and * that we need "some more data." Don't tell it * exactly how many bytes we need because if/when we * ask for even more (after the header) that will * break reassembly. */ pinfo->desegment_offset = offset; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; return -1; } } /* * Get the "$", channel, and length from the header. */ orig_offset = offset; rf_chan = tvb_get_guint8(tvb, offset+1); rf_len = tvb_get_ntohs(tvb, offset+2); /* * Can we do reassembly? */ if (rtsp_desegment_body && pinfo->can_desegment) { /* * Yes - is the header + encapsulated packet split * across segment boundaries? */ if (length_remaining < 4U + rf_len) { /* * Yes. Tell the TCP dissector where the data * for this message starts in the data it handed * us, and how many more bytes we need, and return. */ pinfo->desegment_offset = offset; pinfo->desegment_len = 4U + rf_len - length_remaining; return -1; } } col_add_fstr(pinfo->cinfo, COL_INFO, "Interleaved channel 0x%02x, %u bytes", rf_chan, rf_len); ti = proto_tree_add_protocol_format(tree, proto_rtsp, tvb, offset, 4, "RTSP Interleaved Frame, Channel: 0x%02x, %u bytes", rf_chan, rf_len); rtspframe_tree = proto_item_add_subtree(ti, ett_rtspframe); proto_tree_add_item(rtspframe_tree, hf_rtsp_magic, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtspframe_tree, hf_rtsp_channel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtspframe_tree, hf_rtsp_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* * We set the actual length of the tvbuff for the interleaved * stuff to the minimum of what's left in the tvbuff and the * length in the header. * * XXX - what if there's nothing left in the tvbuff? * We'd want a BoundsError exception to be thrown, so * that a Short Frame would be reported. */ if (length_remaining > rf_len) length_remaining = rf_len; next_tvb = tvb_new_subset_length_caplen(tvb, offset, length_remaining, rf_len); conv = find_conversation_pinfo(pinfo, 0); if (conv && (data = (rtsp_conversation_data_t *)conversation_get_proto_data(conv, proto_rtsp)) && /* Add the following condition if it is not always true. rf_chan < RTSP_MAX_INTERLEAVED && */ (dissector = data->interleaved[rf_chan].dissector)) { call_dissector(dissector, next_tvb, pinfo, tree); } else { gboolean dissected = FALSE; heur_dtbl_entry_t *hdtbl_entry = NULL; dissected = dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL); if (!dissected) { proto_tree_add_item(rtspframe_tree, hf_rtsp_data, tvb, offset, rf_len, ENC_NA); } } offset += rf_len; return offset - orig_offset; } static void process_rtsp_request(tvbuff_t *tvb, int offset, const guchar *data, size_t linelen, size_t next_line_offset, proto_tree *tree); static void process_rtsp_reply(tvbuff_t *tvb, int offset, const guchar *data, size_t linelen, size_t next_line_offset, proto_tree *tree); typedef enum { RTSP_REQUEST, RTSP_REPLY, RTSP_NOT_FIRST_LINE } rtsp_type_t; static const char *rtsp_methods[] = { "DESCRIBE", "ANNOUNCE", "GET_PARAMETER", "OPTIONS", "PAUSE", "PLAY", "RECORD", "REDIRECT", "SETUP", "SET_PARAMETER", "TEARDOWN" }; #define RTSP_NMETHODS array_length(rtsp_methods) static gboolean is_rtsp_request_or_reply(const guchar *line, size_t linelen, rtsp_type_t *type) { guint ii; const guchar *token, *next_token; int tokenlen; gchar response_chars[4]; /* Is this an RTSP reply? */ if (linelen >= 5 && g_ascii_strncasecmp("RTSP/", line, 5) == 0) { /* * Yes. */ *type = RTSP_REPLY; /* The first token is the version. */ tokenlen = get_token_len(line, line+linelen, &token); if (tokenlen != 0) { /* The next token is the status code. */ tokenlen = get_token_len(token, line+linelen, &next_token); if (tokenlen >= 3) { memcpy(response_chars, token, 3); response_chars[3] = '\0'; ws_strtou32(response_chars, NULL, &rtsp_stat_info->response_code); } } return TRUE; } /* * Is this an RTSP request? * Check whether the line begins with one of the RTSP request * methods. */ for (ii = 0; ii < RTSP_NMETHODS; ii++) { size_t len = strlen(rtsp_methods[ii]); if (linelen >= len && g_ascii_strncasecmp(rtsp_methods[ii], line, len) == 0 && (len == linelen || g_ascii_isspace(line[len]))) { *type = RTSP_REQUEST; rtsp_stat_info->request_method = wmem_strndup(wmem_packet_scope(), rtsp_methods[ii], len+1); return TRUE; } } /* Wasn't a request or a response */ *type = RTSP_NOT_FIRST_LINE; return FALSE; } static const char rtsp_content_type[] = "Content-Type:"; static const char rtsp_transport[] = "Transport:"; static const char rtsp_sps_server_port[] = "server_port="; static const char rtsp_cps_server_port[] = "client_port="; static const char rtsp_sps_dest_addr[] = "dest_addr="; static const char rtsp_cps_src_addr[] = "src_addr="; static const char rtsp_rtp_udp_default[] = "rtp/avp"; static const char rtsp_rtp_udp[] = "rtp/avp/udp"; static const char rtsp_rtp_tcp[] = "rtp/avp/tcp"; static const char rtsp_rdt_feature_level[] = "RDTFeatureLevel"; static const char rtsp_real_rdt[] = "x-real-rdt/"; static const char rtsp_real_tng[] = "x-pn-tng/"; /* synonym for x-real-rdt */ static const char rtsp_inter[] = "interleaved="; static void rtsp_create_conversation(packet_info *pinfo, proto_item *ti, const guchar *line_begin, size_t line_len, gint rdt_feature_level, rtsp_type_t rtsp_type_packet) { conversation_t *conv; gchar buf[256]; gchar *tmp; gboolean rtp_udp_transport = FALSE; gboolean rtp_tcp_transport = FALSE; gboolean rdt_transport = FALSE; guint c_data_port, c_mon_port; guint s_data_port, s_mon_port; guint ipv4_1, ipv4_2, ipv4_3, ipv4_4; gboolean is_video = FALSE; /* FIX ME - need to indicate video or not */ address src_addr; address dst_addr; guint32 ip4_addr; if (rtsp_type_packet != RTSP_REPLY) { return; } src_addr=pinfo->src; dst_addr=pinfo->dst; /* Copy line into buf */ if (line_len > sizeof(buf) - 1) { /* Don't overflow the buffer. */ line_len = sizeof(buf) - 1; } memcpy(buf, line_begin, line_len); buf[line_len] = '\0'; /* Get past "Transport:" and spaces */ tmp = buf + STRLEN_CONST(rtsp_transport); while (*tmp && g_ascii_isspace(*tmp)) tmp++; /* Work out which transport type is here */ if (g_ascii_strncasecmp(tmp, rtsp_rtp_udp, strlen(rtsp_rtp_udp)) == 0) { rtp_udp_transport = TRUE; } else if (g_ascii_strncasecmp(tmp, rtsp_rtp_tcp, strlen(rtsp_rtp_tcp)) == 0) { rtp_tcp_transport = TRUE; } else if (g_ascii_strncasecmp(tmp, rtsp_rtp_udp_default, strlen(rtsp_rtp_udp_default)) == 0) { rtp_udp_transport = TRUE; } else if (g_ascii_strncasecmp(tmp, rtsp_real_rdt, strlen(rtsp_real_rdt)) == 0 || g_ascii_strncasecmp(tmp, rtsp_real_tng, strlen(rtsp_real_tng)) == 0) { rdt_transport = TRUE; } else { /* Give up on unknown transport types */ expert_add_info(pinfo, ti, &ei_rtsp_unknown_transport_type); return; } c_data_port = c_mon_port = 0; s_data_port = s_mon_port = 0; /* Look for server port */ if ((tmp = strstr(buf, rtsp_sps_server_port))) { tmp += strlen(rtsp_sps_server_port); if (sscanf(tmp, "%u-%u", &s_data_port, &s_mon_port) < 1) { expert_add_info(pinfo, ti, &ei_rtsp_bad_server_port); return; } } else if ((tmp = strstr(buf, rtsp_sps_dest_addr))) { tmp += strlen(rtsp_sps_dest_addr); if (sscanf(tmp, "\":%u\"", &s_data_port) == 1) { /* :9 mean ignore */ if (s_data_port == 9) { s_data_port = 0; } } else if (sscanf(tmp, "\"%u.%u.%u.%u:%u\"", &ipv4_1, &ipv4_2, &ipv4_3, &ipv4_4, &s_data_port) == 5) { gchar *tmp2; gchar *tmp3; /* Skip leading " */ tmp++; tmp2=strstr(tmp,":"); tmp3=g_strndup(tmp,tmp2-tmp); if (!str_to_ip(tmp3, &ip4_addr)) { g_free(tmp3); expert_add_info(pinfo, ti, &ei_rtsp_bad_server_ip_address); return; } set_address(&dst_addr, AT_IPv4, 4, &ip4_addr); g_free(tmp3); } else if (sscanf(tmp, "\"%u.%u.%u.%u\"", &ipv4_1, &ipv4_2, &ipv4_3, &ipv4_4) == 4) { gchar *tmp2; gchar *tmp3; /* Skip leading " */ tmp++; tmp2=strstr(tmp,"\""); tmp3=g_strndup(tmp,tmp2-tmp); if (!str_to_ip(tmp3, &ip4_addr)) { g_free(tmp3); expert_add_info(pinfo, ti, &ei_rtsp_bad_server_ip_address); return; } set_address(&dst_addr, AT_IPv4, 4, &ip4_addr); g_free(tmp3); } else { expert_add_info(pinfo, ti, &ei_rtsp_bad_server_port); return; } } /* Look for client port */ if ((tmp = strstr(buf, rtsp_cps_server_port))) { tmp += strlen(rtsp_cps_server_port); if (sscanf(tmp, "%u-%u", &c_data_port, &c_mon_port) < 1) { expert_add_info(pinfo, ti, &ei_rtsp_bad_client_port); return; } } else if ((tmp = strstr(buf, rtsp_cps_src_addr))) { tmp += strlen(rtsp_cps_src_addr); if (sscanf(tmp, "\"%u.%u.%u.%u:%u\"", &ipv4_1, &ipv4_2, &ipv4_3, &ipv4_4, &c_data_port) == 5) { gchar *tmp2; gchar *tmp3; /* Skip leading " */ tmp++; tmp2=strstr(tmp,":"); tmp3=g_strndup(tmp,tmp2-tmp); if (!str_to_ip(tmp3, &ip4_addr)) { g_free(tmp3); expert_add_info(pinfo, ti, &ei_rtsp_bad_client_ip_address); return; } set_address(&src_addr, AT_IPv4, 4, &ip4_addr); g_free(tmp3); } } /* Deal with RTSP TCP-interleaved conversations. */ tmp = strstr(buf, rtsp_inter); if (tmp != NULL) { rtsp_conversation_data_t *data; guint s_data_chan, s_mon_chan; int i; /* Move tmp to beyond interleaved string */ tmp += strlen(rtsp_inter); /* Look for channel number(s) */ i = sscanf(tmp, "%u-%u", &s_data_chan, &s_mon_chan); if (i < 1) { expert_add_info(pinfo, ti, &ei_rtsp_bad_interleaved_channel); return; } /* At least data channel present, look for conversation (presumably TCP) */ conv = find_or_create_conversation(pinfo); /* Look for previous data */ data = (rtsp_conversation_data_t *)conversation_get_proto_data(conv, proto_rtsp); /* Create new data if necessary */ if (!data) { data = wmem_new0(wmem_file_scope(), rtsp_conversation_data_t); conversation_add_proto_data(conv, proto_rtsp, data); } /* Now set the dissector handle of the interleaved channel according to the transport protocol used */ if (rtp_tcp_transport) { if (s_data_chan < RTSP_MAX_INTERLEAVED) { data->interleaved[s_data_chan].dissector = rtp_handle; } if (i > 1 && s_mon_chan < RTSP_MAX_INTERLEAVED) { data->interleaved[s_mon_chan].dissector = rtcp_handle; } } else if (rdt_transport) { if (s_data_chan < RTSP_MAX_INTERLEAVED) { data->interleaved[s_data_chan].dissector = rdt_handle; } } return; } /* Noninterleaved options follow */ /* * We only want to match on the destination address, not the * source address, because the server might send back a packet * from an address other than the address to which its client * sent the packet, so we construct a conversation with no * second address. */ else if (rtp_udp_transport) { /* RTP only if indicated */ if (c_data_port) { rtp_add_address(pinfo, PT_UDP, &dst_addr, c_data_port, s_data_port, "RTSP", pinfo->num, is_video, NULL); } else if (s_data_port) { rtp_add_address(pinfo, PT_UDP, &src_addr, s_data_port, 0, "RTSP", pinfo->num, is_video, NULL); } /* RTCP only if indicated */ if (c_mon_port) { rtcp_add_address(pinfo, &pinfo->dst, c_mon_port, s_mon_port, "RTSP", pinfo->num); } } else if (rtp_tcp_transport) { /* RTP only if indicated */ rtp_add_address(pinfo, PT_TCP, &src_addr, c_data_port, s_data_port, "RTSP", pinfo->num, is_video, NULL); } else if (rdt_transport) { /* Real Data Transport */ rdt_add_address(pinfo, &pinfo->dst, c_data_port, s_data_port, "RTSP", rdt_feature_level); } return; } static const char rtsp_content_length[] = "Content-Length:"; static int rtsp_get_content_length(const guchar *line_begin, size_t line_len) { char buf[256]; char *tmp; gint32 content_length; const char *p; const char *up; if (line_len > sizeof(buf) - 1) { /* * Don't overflow the buffer. */ line_len = sizeof(buf) - 1; } memcpy(buf, line_begin, line_len); buf[line_len] = '\0'; tmp = buf + STRLEN_CONST(rtsp_content_length); while (*tmp && g_ascii_isspace(*tmp)) tmp++; ws_strtoi32(tmp, &p, &content_length); up = p; if (up == tmp || (*up != '\0' && !g_ascii_isspace(*up))) return -1; /* not a valid number */ return content_length; } static const char rtsp_Session[] = "Session:"; static const char rtsp_X_Vig_Msisdn[] = "X-Vig-Msisdn"; static int dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { proto_tree *rtsp_tree = NULL; proto_tree *sub_tree = NULL; proto_item *ti_top = NULL; const guchar *line; gint next_offset; const guchar *linep, *lineend; int orig_offset; int first_linelen, linelen; int line_end_offset; int colon_offset; gboolean is_request_or_reply; gboolean body_requires_content_len; gboolean saw_req_resp_or_header; guchar c; rtsp_type_t rtsp_type_packet; rtsp_type_t rtsp_type_line; gboolean is_header; int datalen; int content_length; int reported_datalen; int value_offset; int value_len; e164_info_t e164_info; gint rdt_feature_level = 0; gchar *media_type_str_lower_case = NULL; int semi_colon_offset; int par_end_offset; gchar *frame_label = NULL; gchar *session_id = NULL; voip_packet_info_t *stat_info = NULL; rtsp_stat_info = wmem_new(wmem_packet_scope(), rtsp_info_value_t); rtsp_stat_info->framenum = pinfo->num; rtsp_stat_info->response_code = 0; rtsp_stat_info->request_method = NULL; rtsp_stat_info->request_uri = NULL; rtsp_stat_info->rtsp_host = NULL; /* * Is this a request or response? * * Note that "tvb_find_line_end()" will return a value that * is not longer than what's in the buffer, so the * "tvb_get_ptr()" call won't throw an exception. */ first_linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); /* * Is the first line a request or response? */ line = tvb_get_ptr(tvb, offset, first_linelen); is_request_or_reply = is_rtsp_request_or_reply(line, first_linelen, &rtsp_type_packet); if (is_request_or_reply) { /* * Yes, it's a request or response. * Do header desegmentation if we've been told to, * and do body desegmentation if we've been told to and * we find a Content-Length header. * * RFC 7826, Section 18.17. requires Content-Length and * assumes zero if missing. */ if (!req_resp_hdrs_do_reassembly(tvb, offset, pinfo, rtsp_desegment_headers, rtsp_desegment_body, FALSE, NULL, NULL, NULL)) { /* * More data needed for desegmentation. */ return -1; } } /* * RFC 2326 says that a content length must be specified * in requests that have a body, although section 4.4 speaks * of a server closing the connection indicating the end of * a reply body. * * To support pipelining, we check if line behind blank line * looks like RTSP header. If so, we process rest of packet with * RTSP loop. * * If no, we assume that an absent content length in a request means * that we don't have a body, and that an absent content length * in a reply means that the reply body runs to the end of * the connection. If the first line is neither, we assume * that whatever follows a blank line should be treated as a * body; there's not much else we can do, as we're jumping * into the message in the middle. * * XXX - if there was no Content-Length entity header, we should * accumulate all data until the end of the connection. * That'd require that the TCP dissector call subdissectors * for all frames with FIN, even if they contain no data, * which would require subdissectors to deal intelligently * with empty segments. */ if (rtsp_type_packet == RTSP_REQUEST) body_requires_content_len = TRUE; else body_requires_content_len = FALSE; line = tvb_get_ptr(tvb, offset, first_linelen); if (is_request_or_reply) { if ( rtsp_type_packet == RTSP_REPLY ) { frame_label = wmem_strdup_printf(wmem_packet_scope(), "Reply: %s", format_text(wmem_packet_scope(), line, first_linelen)); } else { frame_label = format_text(wmem_packet_scope(), line, first_linelen); } } col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTSP"); /* * Put the first line from the buffer into the summary * if it's an RTSP request or reply (but leave out the * line terminator). * Otherwise, just call it a continuation. * * Note that "tvb_find_line_end()" will return a value that * is not longer than what's in the buffer, so the * "tvb_get_ptr()" call won't throw an exception. */ if (is_request_or_reply) if ( rtsp_type_packet == RTSP_REPLY ) { col_set_str(pinfo->cinfo, COL_INFO, "Reply: "); col_append_str(pinfo->cinfo, COL_INFO, format_text(wmem_packet_scope(), line, first_linelen)); } else { col_add_str(pinfo->cinfo, COL_INFO, format_text(wmem_packet_scope(), line, first_linelen)); } else col_set_str(pinfo->cinfo, COL_INFO, "Continuation"); orig_offset = offset; if (tree) { ti_top = proto_tree_add_item(tree, proto_rtsp, tvb, offset, -1, ENC_NA); rtsp_tree = proto_item_add_subtree(ti_top, ett_rtsp); } /* * We haven't yet seen a Content-Length header. */ content_length = -1; /* * Process the packet data, a line at a time. */ saw_req_resp_or_header = FALSE; /* haven't seen anything yet */ while (tvb_offset_exists(tvb, offset)) { /* * We haven't yet concluded that this is a header. */ is_header = FALSE; /* * Find the end of the line. */ linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); if (linelen < 0) return -1; line_end_offset = offset + linelen; /* * colon_offset may be -1 */ colon_offset = tvb_find_guint8(tvb, offset, linelen, ':'); /* * Get a buffer that refers to the line. */ line = tvb_get_ptr(tvb, offset, linelen); lineend = line + linelen; /* * OK, does it look like an RTSP request or response? */ is_request_or_reply = is_rtsp_request_or_reply(line, linelen, &rtsp_type_line); if (is_request_or_reply) goto is_rtsp; /* * No. Does it look like a blank line (as would appear * at the end of an RTSP request)? */ if (linelen == 0) goto is_rtsp; /* Yes. */ /* * No. Does it look like a header? */ linep = line; while (linep < lineend) { c = *linep++; /* * This must be a CHAR, and must not be a CTL, to be part * of a token; that means it must be printable ASCII. * * XXX - what about leading LWS on continuation * lines of a header? */ if (!g_ascii_isprint(c)) break; switch (c) { case '(': case ')': case '<': case '>': case '@': case ',': case ';': case '\\': case '"': case '/': case '[': case ']': case '?': case '=': case '{': case '}': /* * It's a tspecial, so it's not * part of a token, so it's not * a field name for the beginning * of a header. */ goto not_rtsp; case ':': /* * This ends the token; we consider * this to be a header. */ is_header = TRUE; goto is_rtsp; case ' ': case '\t': /* * LWS (RFC-2616, 4.2); continue the previous * header. */ goto is_rtsp; } } /* * We haven't seen the colon, but everything else looks * OK for a header line. * * If we've already seen an RTSP request or response * line, or a header line, and we're at the end of * the tvbuff, we assume this is an incomplete header * line. (We quit this loop after seeing a blank line, * so if we've seen a request or response line, or a * header line, this is probably more of the request * or response we're presumably seeing. There is some * risk of false positives, but the same applies for * full request or response lines or header lines, * although that's less likely.) * * We throw an exception in that case, by checking for * the existence of the next byte after the last one * in the line. If it exists, "tvb_ensure_bytes_exist()" * throws no exception, and we fall through to the * "not RTSP" case. If it doesn't exist, * "tvb_ensure_bytes_exist()" will throw the appropriate * exception. */ if (saw_req_resp_or_header) tvb_ensure_bytes_exist(tvb, offset, linelen + 1); not_rtsp: /* * We don't consider this part of an RTSP request or * reply, so we don't display it. */ break; is_rtsp: /* * Process this line. */ if (linelen == 0) { /* * This is a blank line, which means that * whatever follows it isn't part of this * request or reply. */ proto_tree_add_format_text(rtsp_tree, tvb, offset, next_offset - offset); offset = next_offset; break; } /* * Not a blank line - either a request, a reply, or a header * line. */ saw_req_resp_or_header = TRUE; if (rtsp_tree) { switch (rtsp_type_line) { case RTSP_REQUEST: process_rtsp_request(tvb, offset, line, linelen, next_offset, rtsp_tree); break; case RTSP_REPLY: process_rtsp_reply(tvb, offset, line, linelen, next_offset, rtsp_tree); break; case RTSP_NOT_FIRST_LINE: /* Drop through, it may well be a header line */ break; } } if (is_header) { /* We know that colon_offset must be set */ /* Skip whitespace after the colon. */ value_offset = colon_offset + 1; while ((value_offset < line_end_offset) && ((c = tvb_get_guint8(tvb, value_offset)) == ' ' || c == '\t')) { value_offset++; } value_len = line_end_offset - value_offset; /* * Process some headers specially. */ #define HDR_MATCHES(header) \ ( (size_t)linelen > STRLEN_CONST(header) && \ g_ascii_strncasecmp(line, (header), STRLEN_CONST(header)) == 0) if (HDR_MATCHES(rtsp_transport)) { proto_item *ti; ti = proto_tree_add_string(rtsp_tree, hf_rtsp_transport, tvb, offset, linelen, tvb_format_text(pinfo->pool, tvb, value_offset, value_len)); /* * Based on the port numbers specified * in the Transport: header, set up * a conversation that will be dissected * with the appropriate dissector. */ rtsp_create_conversation(pinfo, ti, line, linelen, rdt_feature_level, rtsp_type_packet); } else if (HDR_MATCHES(rtsp_content_type)) { proto_tree_add_string(rtsp_tree, hf_rtsp_content_type, tvb, offset, linelen, tvb_format_text(pinfo->pool, tvb, value_offset, value_len)); offset = offset + (int)STRLEN_CONST(rtsp_content_type); /* Skip wsp */ offset = tvb_skip_wsp(tvb, offset, value_len); semi_colon_offset = tvb_find_guint8(tvb, value_offset, value_len, ';'); if ( semi_colon_offset != -1) { /* m-parameter present */ par_end_offset = tvb_skip_wsp_return(tvb, semi_colon_offset-1); value_len = par_end_offset - offset; } media_type_str_lower_case = ascii_strdown_inplace( (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_len, ENC_ASCII)); } else if (HDR_MATCHES(rtsp_content_length)) { guint32 clength; gboolean clength_valid; proto_item* pi; clength_valid = ws_strtou32(tvb_format_text(pinfo->pool, tvb, value_offset, value_len), NULL, &clength); pi = proto_tree_add_uint(rtsp_tree, hf_rtsp_content_length, tvb, offset, linelen, clength); if (!clength_valid) expert_add_info(pinfo, pi, &ei_rtsp_content_length_invalid); /* * Only the amount specified by the * Content-Length: header should be treated * as payload. */ content_length = rtsp_get_content_length(line, linelen); } else if (HDR_MATCHES(rtsp_Session)) { session_id = tvb_format_text(pinfo->pool, tvb, value_offset, value_len); /* Put the value into the protocol tree */ proto_tree_add_string(rtsp_tree, hf_rtsp_session, tvb, offset, linelen, session_id); } else if (HDR_MATCHES(rtsp_X_Vig_Msisdn)) { /* * Extract the X_Vig_Msisdn string */ if (colon_offset != -1) { proto_item *ti; /* Put the value into the protocol tree */ ti = proto_tree_add_string(rtsp_tree, hf_rtsp_X_Vig_Msisdn,tvb, offset, linelen , tvb_format_text(pinfo->pool, tvb, value_offset, value_len)); sub_tree = proto_item_add_subtree(ti, ett_rtsp_method); e164_info.e164_number_type = CALLING_PARTY_NUMBER; e164_info.nature_of_address = 0; e164_info.E164_number_str = tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset, value_len, ENC_ASCII); e164_info.E164_number_length = value_len; dissect_e164_number(tvb, sub_tree, value_offset, value_len, e164_info); } } else if (HDR_MATCHES(rtsp_rdt_feature_level)) { gboolean rdt_feature_level_valid; proto_item* pi; rdt_feature_level_valid = ws_strtou32(tvb_format_text(pinfo->pool, tvb, value_offset, value_len), NULL, &rdt_feature_level); pi = proto_tree_add_uint(rtsp_tree, hf_rtsp_rdtfeaturelevel, tvb, offset, linelen, rdt_feature_level); if (!rdt_feature_level_valid) expert_add_info(pinfo, pi, &ei_rtsp_rdtfeaturelevel_invalid); } else { /* Default case for headers. Show line as text */ proto_tree_add_format_text(rtsp_tree, tvb, offset, next_offset - offset); } } else if (rtsp_type_line == RTSP_NOT_FIRST_LINE) { /* Catch-all for all other lines... Show line as text. TODO: should these be shown as errors? */ proto_tree_add_format_text(rtsp_tree, tvb, offset, next_offset - offset); } offset = next_offset; } if (session_id) { stat_info = wmem_new0(wmem_packet_scope(), voip_packet_info_t); stat_info->protocol_name = wmem_strdup(wmem_packet_scope(), "RTSP"); stat_info->call_id = session_id; stat_info->frame_label = frame_label; stat_info->call_state = VOIP_CALL_SETUP; stat_info->call_active_state = VOIP_ACTIVE; stat_info->frame_comment = frame_label; tap_queue_packet(voip_tap, pinfo, stat_info); } /* * Have now read all of the lines of this message. * * If a content length was supplied, the amount of data to be * processed as RTSP payload is the minimum of the content * length and the amount of data remaining in the frame. * * If no content length was supplied (or if a bad content length * was supplied), the amount of data to be processed is the amount * of data remaining in the frame. */ datalen = tvb_captured_length_remaining(tvb, offset); reported_datalen = tvb_reported_length_remaining(tvb, offset); if (content_length != -1) { /* * Content length specified; display only that amount * as payload. */ if (datalen > content_length) datalen = content_length; /* * XXX - limit the reported length in the tvbuff we'll * hand to a subdissector to be no greater than the * content length. * * We really need both unreassembled and "how long it'd * be if it were reassembled" lengths for tvbuffs, so * that we throw the appropriate exceptions for * "not enough data captured" (running past the length), * "packet needed reassembly" (within the length but * running past the unreassembled length), and * "packet is malformed" (running past the reassembled * length). */ if (reported_datalen > content_length) reported_datalen = content_length; } else { /* * No content length specified; if this message doesn't * have a body if no content length is specified, process * nothing as payload. */ if (body_requires_content_len) datalen = 0; } if (datalen > 0) { /* * There's stuff left over; process it. */ tvbuff_t *new_tvb; /* * Now create a tvbuff for the Content-type stuff and * dissect it. * * The amount of data to be processed that's * available in the tvbuff is "datalen", which * is the minimum of the amount of data left in * the tvbuff and any specified content length. * * The amount of data to be processed that's in * this frame, regardless of whether it was * captured or not, is "reported_datalen", * which, if no content length was specified, * is -1, i.e. "to the end of the frame. */ new_tvb = tvb_new_subset_length_caplen(tvb, offset, datalen, reported_datalen); /* * Check if next line is RTSP message - pipelining * If yes, stop processing and start next loop * If no, process rest of packet with dissectors */ first_linelen = tvb_find_line_end(new_tvb, 0, -1, &next_offset, FALSE); line = tvb_get_ptr(new_tvb, 0, first_linelen); is_request_or_reply = is_rtsp_request_or_reply(line, first_linelen, &rtsp_type_packet); if (!is_request_or_reply){ if (media_type_str_lower_case && dissector_try_string(media_type_dissector_table, media_type_str_lower_case, new_tvb, pinfo, rtsp_tree, NULL)){ } else { /* * Fix up the top-level item so that it doesn't * include the SDP stuff. */ if (ti_top != NULL) proto_item_set_len(ti_top, offset); if (tvb_get_guint8(tvb, offset) == RTSP_FRAMEHDR) { /* * This is interleaved stuff; don't * treat it as raw data - set "datalen" * to 0, so we won't skip the offset * past it, which will cause our * caller to process that stuff itself. */ datalen = 0; } else { proto_tree_add_bytes_format(rtsp_tree, hf_rtsp_data, tvb, offset, datalen, NULL, "Data (%d bytes)", reported_datalen); } } /* * We've processed "datalen" bytes worth of data * (which may be no data at all); advance the * offset past whatever data we've processed. */ offset += datalen; } } tap_queue_packet(rtsp_tap, pinfo, rtsp_stat_info); return offset - orig_offset; } static void process_rtsp_request(tvbuff_t *tvb, int offset, const guchar *data, size_t linelen, size_t next_line_offset, proto_tree *tree) { proto_tree *sub_tree; proto_item *ti; const guchar *lineend = data + linelen; guint ii; const guchar *url; const guchar *url_start; guchar *tmp_url; /* Request Methods */ for (ii = 0; ii < RTSP_NMETHODS; ii++) { size_t len = strlen(rtsp_methods[ii]); if (linelen >= len && g_ascii_strncasecmp(rtsp_methods[ii], data, len) == 0 && (len == linelen || g_ascii_isspace(data[len]))) break; } if (ii == RTSP_NMETHODS) { /* * We got here because "is_rtsp_request_or_reply()" returned * RTSP_REQUEST, so we know one of the request methods * matched, so we "can't get here". */ DISSECTOR_ASSERT_NOT_REACHED(); } /* Add a tree for this request */ ti = proto_tree_add_string(tree, hf_rtsp_request, tvb, offset, (gint) (next_line_offset - offset), tvb_format_text(wmem_packet_scope(), tvb, offset, (gint) (next_line_offset - offset))); sub_tree = proto_item_add_subtree(ti, ett_rtsp_method); /* Add method name to tree */ proto_tree_add_string(sub_tree, hf_rtsp_method, tvb, offset, (gint) strlen(rtsp_methods[ii]), rtsp_methods[ii]); /* URL */ url = data; /* Skip method name again */ while (url < lineend && !g_ascii_isspace(*url)) url++; /* Skip spaces */ while (url < lineend && g_ascii_isspace(*url)) url++; /* URL starts here */ url_start = url; /* Scan to end of URL */ while (url < lineend && !g_ascii_isspace(*url)) url++; /* Create a URL-sized buffer and copy contents */ tmp_url = format_text(wmem_packet_scope(), url_start, url - url_start); /* Add URL to tree */ proto_tree_add_string(sub_tree, hf_rtsp_url, tvb, offset + (gint) (url_start - data), (gint) (url - url_start), tmp_url); } /* Read first line of a reply message */ static void process_rtsp_reply(tvbuff_t *tvb, int offset, const guchar *data, size_t linelen, size_t next_line_offset, proto_tree *tree) { proto_tree *sub_tree; proto_item *ti; const guchar *lineend = data + linelen; const guchar *status = data; const guchar *status_start; guint status_i; /* Add a tree for this request */ ti = proto_tree_add_string(tree, hf_rtsp_response, tvb, offset, (gint) (next_line_offset - offset), tvb_format_text(wmem_packet_scope(), tvb, offset, (gint) (next_line_offset - offset))); sub_tree = proto_item_add_subtree(ti, ett_rtsp_method); /* status code */ /* Skip protocol/version */ while (status < lineend && !g_ascii_isspace(*status)) status++; /* Skip spaces */ while (status < lineend && g_ascii_isspace(*status)) status++; /* Actual code number now */ status_start = status; status_i = 0; while (status < lineend && g_ascii_isdigit(*status)) status_i = status_i * 10 + *status++ - '0'; /* Add field to tree */ proto_tree_add_uint(sub_tree, hf_rtsp_status, tvb, offset + (gint) (status_start - data), (gint) (status - status_start), status_i); } static int dissect_rtsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; int len; while (tvb_reported_length_remaining(tvb, offset) != 0) { /* * Add separator between multiple messages in column info text */ if (offset > 0) { col_set_str(pinfo->cinfo, COL_INFO, ", "); col_set_fence(pinfo->cinfo, COL_INFO); } len = (tvb_get_guint8(tvb, offset) == RTSP_FRAMEHDR) ? dissect_rtspinterleaved(tvb, offset, pinfo, tree) : dissect_rtspmessage(tvb, offset, pinfo, tree); if (len == -1) break; offset += len; /* * OK, we've set the Protocol and Info columns for the * first RTSP message; set fence so changes are kept for * subsequent RTSP messages. */ col_set_fence(pinfo->cinfo, COL_INFO); } return tvb_captured_length(tvb); } void proto_register_rtsp(void) { static gint *ett[] = { &ett_rtspframe, &ett_rtsp, &ett_rtsp_method, }; static hf_register_info hf[] = { { &hf_rtsp_request, { "Request", "rtsp.request", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_response, { "Response", "rtsp.response", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_method, { "Method", "rtsp.method", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_content_type, { "Content-type", "rtsp.content-type", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_content_length, { "Content-length", "rtsp.content-length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtsp_url, { "URL", "rtsp.url", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_status, { "Status", "rtsp.status", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtsp_session, { "Session", "rtsp.session", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_transport, { "Transport", "rtsp.transport", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_rdtfeaturelevel, { "RDTFeatureLevel", "rtsp.rdt-feature-level", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtsp_X_Vig_Msisdn, { "X-Vig-Msisdn", "rtsp.X_Vig_Msisdn", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtsp_magic, { "Magic", "rtsp.magic", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rtsp_channel, { "Channel", "rtsp.channel", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_rtsp_length, { "Length", "rtsp.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_rtsp_data, { "Data", "rtsp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static ei_register_info ei[] = { { &ei_rtsp_unknown_transport_type, { "rtsp.unknown_transport_type", PI_UNDECODED, PI_WARN, "Unknown transport type", EXPFILL }}, { &ei_rtsp_bad_server_port, { "rtsp.bad_server_port", PI_UNDECODED, PI_WARN, "Bad server_port", EXPFILL }}, { &ei_rtsp_bad_client_port, { "rtsp.bad_client_port", PI_UNDECODED, PI_WARN, "Bad client port", EXPFILL }}, { &ei_rtsp_bad_interleaved_channel, { "rtsp.bad_interleaved_channel", PI_UNDECODED, PI_WARN, "Bad interleaved_channel", EXPFILL }}, { &ei_rtsp_content_length_invalid, { "rtsp.content-length.invalid", PI_MALFORMED, PI_ERROR, "Invalid content length", EXPFILL }}, { &ei_rtsp_rdtfeaturelevel_invalid, { "rtsp.rdt-feature-level.invalid", PI_MALFORMED, PI_ERROR, "Invalid RDTFeatureLevel", EXPFILL }}, { &ei_rtsp_bad_server_ip_address, { "rtsp.bad_client_ip_address", PI_MALFORMED, PI_ERROR, "Bad server IP address", EXPFILL }}, { &ei_rtsp_bad_client_ip_address, { "rtsp.bad_client_ip_address", PI_MALFORMED, PI_ERROR, "Bad client IP address", EXPFILL }} }; module_t *rtsp_module; expert_module_t *expert_rtsp; proto_rtsp = proto_register_protocol("Real Time Streaming Protocol", "RTSP", "rtsp"); proto_register_field_array(proto_rtsp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rtsp = expert_register_protocol(proto_rtsp); expert_register_field_array(expert_rtsp, ei, array_length(ei)); /* Make this dissector findable by name */ rtsp_handle = register_dissector("rtsp", dissect_rtsp, proto_rtsp); /* Register our configuration options, particularly our ports */ rtsp_module = prefs_register_protocol(proto_rtsp, NULL); prefs_register_obsolete_preference(rtsp_module, "tcp.alternate_port"); prefs_register_bool_preference(rtsp_module, "desegment_headers", "Reassemble RTSP headers spanning multiple TCP segments", "Whether the RTSP dissector should reassemble headers " "of a request spanning multiple TCP segments. " " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &rtsp_desegment_headers); prefs_register_bool_preference(rtsp_module, "desegment_body", "Trust the \"Content-length:\" header when desegmenting", "Whether the RTSP dissector should use the " "\"Content-length:\" value to desegment the body " "of a request spanning multiple TCP segments", &rtsp_desegment_body); /* * Heuristic dissectors SHOULD register themselves in * this table using the standard heur_dissector_add() * function. */ heur_subdissector_list = register_heur_dissector_list("rtsp", proto_rtsp); /* * Register for tapping */ rtsp_tap = register_tap("rtsp"); /* RTSP statistics tap */ } void proto_reg_handoff_rtsp(void) { rtp_handle = find_dissector_add_dependency("rtp", proto_rtsp); rtp_rfc4571_handle = find_dissector_add_dependency("rtp.rfc4571", proto_rtsp); rtcp_handle = find_dissector_add_dependency("rtcp", proto_rtsp); rdt_handle = find_dissector_add_dependency("rdt", proto_rtsp); media_type_dissector_table = find_dissector_table("media_type"); voip_tap = find_tap_id("voip"); /* Set our port number for future use */ dissector_add_uint_range_with_preference("tcp.port", RTSP_TCP_PORT_RANGE, rtsp_handle); /* XXX: Do the following only once ?? */ stats_tree_register("rtsp","rtsp","RTSP/Packet Counter", 0, rtsp_stats_tree_packet, rtsp_stats_tree_init, NULL ); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: space * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-rtsp.h
/* packet-rtsp.h * * by Stephane GORSE (Orange Labs / France Telecom) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_RTSP_H__ #define __PACKET_RTSP_H__ /* Used for RTSP statistics */ typedef struct _rtsp_info_value_t { guint32 framenum; gchar *request_method; guint response_code; gchar *rtsp_host; gchar *request_uri; } rtsp_info_value_t; WS_DLL_PUBLIC const value_string rtsp_status_code_vals[]; #endif /* __PACKET_RTSP_H__ */
C
wireshark/epan/dissectors/packet-rua.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-rua.c */ /* asn2wrs.py -L -p rua -c ./rua.cnf -s ./packet-rua-template -D . -O ../.. RUA-CommonDataTypes.asn RUA-Constants.asn RUA-Containers.asn RUA-IEs.asn RUA-PDU-Contents.asn RUA-PDU-Descriptions.asn */ /* packet-rua-template.c * Routines for UMTS Home Node B RANAP User Adaptation (RUA) packet dissection * Copyright 2010 Neil Piercy, ip.access Limited <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * Ref: 3GPP TS 25.468 version 8.1.0 Release 8 */ #include "config.h" #include <epan/packet.h> #include <epan/sctpppids.h> #include <epan/asn1.h> #include <epan/prefs.h> #include "packet-per.h" #ifdef _MSC_VER /* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */ #pragma warning(disable:4146) #endif #define PNAME "UTRAN Iuh interface RUA signalling" #define PSNAME "RUA" #define PFNAME "rua" /* Dissector to use SCTP PPID 19 or a configured SCTP port. IANA assigned port = 29169*/ #define SCTP_PORT_RUA 29169 void proto_register_rua(void); #define maxPrivateIEs 65535 #define maxProtocolExtensions 65535 #define maxProtocolIEs 65535 #define maxNrOfErrors 256 typedef enum _ProcedureCode_enum { id_Connect = 1, id_DirectTransfer = 2, id_Disconnect = 3, id_ConnectionlessTransfer = 4, id_ErrorIndication = 5, id_privateMessage = 6 } ProcedureCode_enum; typedef enum _ProtocolIE_ID_enum { id_Cause = 1, id_CriticalityDiagnostics = 2, id_Context_ID = 3, id_RANAP_Message = 4, id_IntraDomainNasNodeSelector = 5, id_Establishment_Cause = 6, id_CN_DomainIndicator = 7, id_CSGMembershipStatus = 9 } ProtocolIE_ID_enum; /* Initialize the protocol and registered fields */ static int proto_rua = -1; static int hf_rua_CN_DomainIndicator_PDU = -1; /* CN_DomainIndicator */ static int hf_rua_CSGMembershipStatus_PDU = -1; /* CSGMembershipStatus */ static int hf_rua_Establishment_Cause_PDU = -1; /* Establishment_Cause */ static int hf_rua_Context_ID_PDU = -1; /* Context_ID */ static int hf_rua_IntraDomainNasNodeSelector_PDU = -1; /* IntraDomainNasNodeSelector */ static int hf_rua_RANAP_Message_PDU = -1; /* RANAP_Message */ static int hf_rua_Cause_PDU = -1; /* Cause */ static int hf_rua_CriticalityDiagnostics_PDU = -1; /* CriticalityDiagnostics */ static int hf_rua_Connect_PDU = -1; /* Connect */ static int hf_rua_DirectTransfer_PDU = -1; /* DirectTransfer */ static int hf_rua_Disconnect_PDU = -1; /* Disconnect */ static int hf_rua_ConnectionlessTransfer_PDU = -1; /* ConnectionlessTransfer */ static int hf_rua_ErrorIndication_PDU = -1; /* ErrorIndication */ static int hf_rua_PrivateMessage_PDU = -1; /* PrivateMessage */ static int hf_rua_RUA_PDU_PDU = -1; /* RUA_PDU */ static int hf_rua_local = -1; /* INTEGER_0_65535 */ static int hf_rua_global = -1; /* OBJECT_IDENTIFIER */ static int hf_rua_ProtocolIE_Container_item = -1; /* ProtocolIE_Field */ static int hf_rua_protocol_ie_field_id = -1; /* ProtocolIE_ID */ static int hf_rua_criticality = -1; /* Criticality */ static int hf_rua_ie_field_value = -1; /* ProtocolIE_Field_value */ static int hf_rua_ProtocolExtensionContainer_item = -1; /* ProtocolExtensionField */ static int hf_rua_id = -1; /* ProtocolIE_ID */ static int hf_rua_extensionValue = -1; /* T_extensionValue */ static int hf_rua_PrivateIE_Container_item = -1; /* PrivateIE_Field */ static int hf_rua_private_ie_field_id = -1; /* PrivateIE_ID */ static int hf_rua_private_value = -1; /* PrivateIE_Field_value */ static int hf_rua_version = -1; /* T_version */ static int hf_rua_release99 = -1; /* T_release99 */ static int hf_rua_cn_Type = -1; /* T_cn_Type */ static int hf_rua_gsm_Map_IDNNS = -1; /* Gsm_map_IDNNS */ static int hf_rua_ansi_41_IDNNS = -1; /* Ansi_41_IDNNS */ static int hf_rua_later = -1; /* T_later */ static int hf_rua_futurecoding = -1; /* BIT_STRING_SIZE_15 */ static int hf_rua_routingbasis = -1; /* T_routingbasis */ static int hf_rua_localPTMSI = -1; /* T_localPTMSI */ static int hf_rua_routingparameter = -1; /* RoutingParameter */ static int hf_rua_tMSIofsamePLMN = -1; /* T_tMSIofsamePLMN */ static int hf_rua_tMSIofdifferentPLMN = -1; /* T_tMSIofdifferentPLMN */ static int hf_rua_iMSIresponsetopaging = -1; /* T_iMSIresponsetopaging */ static int hf_rua_iMSIcauseUEinitiatedEvent = -1; /* T_iMSIcauseUEinitiatedEvent */ static int hf_rua_iMEI = -1; /* T_iMEI */ static int hf_rua_spare2 = -1; /* T_spare2 */ static int hf_rua_spare1 = -1; /* T_spare1 */ static int hf_rua_dummy = -1; /* BOOLEAN */ static int hf_rua_radioNetwork = -1; /* CauseRadioNetwork */ static int hf_rua_transport = -1; /* CauseTransport */ static int hf_rua_protocol = -1; /* CauseProtocol */ static int hf_rua_misc = -1; /* CauseMisc */ static int hf_rua_procedureCode = -1; /* ProcedureCode */ static int hf_rua_triggeringMessage = -1; /* TriggeringMessage */ static int hf_rua_procedureCriticality = -1; /* Criticality */ static int hf_rua_iEsCriticalityDiagnostics = -1; /* CriticalityDiagnostics_IE_List */ static int hf_rua_iE_Extensions = -1; /* ProtocolExtensionContainer */ static int hf_rua_CriticalityDiagnostics_IE_List_item = -1; /* CriticalityDiagnostics_IE_List_item */ static int hf_rua_iECriticality = -1; /* Criticality */ static int hf_rua_iE_ID = -1; /* ProtocolIE_ID */ static int hf_rua_typeOfError = -1; /* TypeOfError */ static int hf_rua_protocolIEs = -1; /* ProtocolIE_Container */ static int hf_rua_protocolExtensions = -1; /* ProtocolExtensionContainer */ static int hf_rua_privateIEs = -1; /* PrivateIE_Container */ static int hf_rua_initiatingMessage = -1; /* InitiatingMessage */ static int hf_rua_successfulOutcome = -1; /* SuccessfulOutcome */ static int hf_rua_unsuccessfulOutcome = -1; /* UnsuccessfulOutcome */ static int hf_rua_initiatingMessagevalue = -1; /* InitiatingMessage_value */ static int hf_rua_successfulOutcome_value = -1; /* SuccessfulOutcome_value */ static int hf_rua_unsuccessfulOutcome_value = -1; /* UnsuccessfulOutcome_value */ /* Initialize the subtree pointers */ static int ett_rua = -1; /* initialise sub-dissector handles */ static dissector_handle_t ranap_handle = NULL; static gint ett_rua_PrivateIE_ID = -1; static gint ett_rua_ProtocolIE_Container = -1; static gint ett_rua_ProtocolIE_Field = -1; static gint ett_rua_ProtocolExtensionContainer = -1; static gint ett_rua_ProtocolExtensionField = -1; static gint ett_rua_PrivateIE_Container = -1; static gint ett_rua_PrivateIE_Field = -1; static gint ett_rua_IntraDomainNasNodeSelector = -1; static gint ett_rua_T_version = -1; static gint ett_rua_T_release99 = -1; static gint ett_rua_T_cn_Type = -1; static gint ett_rua_T_later = -1; static gint ett_rua_Gsm_map_IDNNS = -1; static gint ett_rua_T_routingbasis = -1; static gint ett_rua_T_localPTMSI = -1; static gint ett_rua_T_tMSIofsamePLMN = -1; static gint ett_rua_T_tMSIofdifferentPLMN = -1; static gint ett_rua_T_iMSIresponsetopaging = -1; static gint ett_rua_T_iMSIcauseUEinitiatedEvent = -1; static gint ett_rua_T_iMEI = -1; static gint ett_rua_T_spare2 = -1; static gint ett_rua_T_spare1 = -1; static gint ett_rua_Cause = -1; static gint ett_rua_CriticalityDiagnostics = -1; static gint ett_rua_CriticalityDiagnostics_IE_List = -1; static gint ett_rua_CriticalityDiagnostics_IE_List_item = -1; static gint ett_rua_Connect = -1; static gint ett_rua_DirectTransfer = -1; static gint ett_rua_Disconnect = -1; static gint ett_rua_ConnectionlessTransfer = -1; static gint ett_rua_ErrorIndication = -1; static gint ett_rua_PrivateMessage = -1; static gint ett_rua_RUA_PDU = -1; static gint ett_rua_InitiatingMessage = -1; static gint ett_rua_SuccessfulOutcome = -1; static gint ett_rua_UnsuccessfulOutcome = -1; /* Global variables */ static guint32 ProcedureCode; static guint32 ProtocolIE_ID; /* Dissector tables */ static dissector_table_t rua_ies_dissector_table; static dissector_table_t rua_extension_dissector_table; static dissector_table_t rua_proc_imsg_dissector_table; static dissector_table_t rua_proc_sout_dissector_table; static dissector_table_t rua_proc_uout_dissector_table; static dissector_handle_t rua_handle; static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); void proto_reg_handoff_rua(void); static const value_string rua_Criticality_vals[] = { { 0, "reject" }, { 1, "ignore" }, { 2, "notify" }, { 0, NULL } }; static int dissect_rua_Criticality(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static const value_string rua_ProcedureCode_vals[] = { { id_Connect, "id-Connect" }, { id_DirectTransfer, "id-DirectTransfer" }, { id_Disconnect, "id-Disconnect" }, { id_ConnectionlessTransfer, "id-ConnectionlessTransfer" }, { id_ErrorIndication, "id-ErrorIndication" }, { id_privateMessage, "id-privateMessage" }, { 0, NULL } }; static int dissect_rua_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, &ProcedureCode, FALSE); if (strcmp(val_to_str(ProcedureCode, rua_ProcedureCode_vals, "Unknown"), "Unknown") == 0) { col_set_str(actx->pinfo->cinfo, COL_INFO, "Unknown Message "); } /* Known Procedures should be included below and broken out as ELEMENTARY names to avoid confusion */ return offset; } static int dissect_rua_INTEGER_0_65535(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static int dissect_rua_OBJECT_IDENTIFIER(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_object_identifier(tvb, offset, actx, tree, hf_index, NULL); return offset; } static const value_string rua_PrivateIE_ID_vals[] = { { 0, "local" }, { 1, "global" }, { 0, NULL } }; static const per_choice_t PrivateIE_ID_choice[] = { { 0, &hf_rua_local , ASN1_NO_EXTENSIONS , dissect_rua_INTEGER_0_65535 }, { 1, &hf_rua_global , ASN1_NO_EXTENSIONS , dissect_rua_OBJECT_IDENTIFIER }, { 0, NULL, 0, NULL } }; static int dissect_rua_PrivateIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rua_PrivateIE_ID, PrivateIE_ID_choice, NULL); return offset; } static const value_string rua_ProtocolIE_ID_vals[] = { { id_Cause, "id-Cause" }, { id_CriticalityDiagnostics, "id-CriticalityDiagnostics" }, { id_Context_ID, "id-Context-ID" }, { id_RANAP_Message, "id-RANAP-Message" }, { id_IntraDomainNasNodeSelector, "id-IntraDomainNasNodeSelector" }, { id_Establishment_Cause, "id-Establishment-Cause" }, { id_CN_DomainIndicator, "id-CN-DomainIndicator" }, { id_CSGMembershipStatus, "id-CSGMembershipStatus" }, { 0, NULL } }; static int dissect_rua_ProtocolIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxProtocolIEs, &ProtocolIE_ID, FALSE); if (tree) { proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str(ProtocolIE_ID, VALS(rua_ProtocolIE_ID_vals), "unknown (%d)")); } return offset; } static const value_string rua_TriggeringMessage_vals[] = { { 0, "initiating-message" }, { 1, "successful-outcome" }, { 2, "unsuccessful-outcome" }, { 0, NULL } }; static int dissect_rua_TriggeringMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static int dissect_rua_ProtocolIE_Field_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolIEFieldValue); return offset; } static const per_sequence_t ProtocolIE_Field_sequence[] = { { &hf_rua_protocol_ie_field_id, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_ID }, { &hf_rua_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_ie_field_value , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Field_value }, { NULL, 0, 0, NULL } }; static int dissect_rua_ProtocolIE_Field(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_ProtocolIE_Field, ProtocolIE_Field_sequence); return offset; } static const per_sequence_t ProtocolIE_Container_sequence_of[1] = { { &hf_rua_ProtocolIE_Container_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Field }, }; static int dissect_rua_ProtocolIE_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_rua_ProtocolIE_Container, ProtocolIE_Container_sequence_of, 0, maxProtocolIEs, FALSE); return offset; } static int dissect_rua_T_extensionValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolExtensionFieldExtensionValue); return offset; } static const per_sequence_t ProtocolExtensionField_sequence[] = { { &hf_rua_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_ID }, { &hf_rua_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_extensionValue , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_T_extensionValue }, { NULL, 0, 0, NULL } }; static int dissect_rua_ProtocolExtensionField(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_ProtocolExtensionField, ProtocolExtensionField_sequence); return offset; } static const per_sequence_t ProtocolExtensionContainer_sequence_of[1] = { { &hf_rua_ProtocolExtensionContainer_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolExtensionField }, }; static int dissect_rua_ProtocolExtensionContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_rua_ProtocolExtensionContainer, ProtocolExtensionContainer_sequence_of, 1, maxProtocolExtensions, FALSE); return offset; } static int dissect_rua_PrivateIE_Field_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type(tvb, offset, actx, tree, hf_index, NULL); return offset; } static const per_sequence_t PrivateIE_Field_sequence[] = { { &hf_rua_private_ie_field_id, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_PrivateIE_ID }, { &hf_rua_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_private_value , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_PrivateIE_Field_value }, { NULL, 0, 0, NULL } }; static int dissect_rua_PrivateIE_Field(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_PrivateIE_Field, PrivateIE_Field_sequence); return offset; } static const per_sequence_t PrivateIE_Container_sequence_of[1] = { { &hf_rua_PrivateIE_Container_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_PrivateIE_Field }, }; static int dissect_rua_PrivateIE_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_rua_PrivateIE_Container, PrivateIE_Container_sequence_of, 1, maxPrivateIEs, FALSE); return offset; } static const value_string rua_CN_DomainIndicator_vals[] = { { 0, "cs-domain" }, { 1, "ps-domain" }, { 0, NULL } }; static int dissect_rua_CN_DomainIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const value_string rua_CSGMembershipStatus_vals[] = { { 0, "member" }, { 1, "non-member" }, { 0, NULL } }; static int dissect_rua_CSGMembershipStatus(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string rua_Establishment_Cause_vals[] = { { 0, "emergency-call" }, { 1, "normal-call" }, { 0, NULL } }; static int dissect_rua_Establishment_Cause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_rua_Context_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 24, 24, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_rua_RoutingParameter(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 10, 10, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t T_localPTMSI_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_localPTMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_localPTMSI, T_localPTMSI_sequence); return offset; } static const per_sequence_t T_tMSIofsamePLMN_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_tMSIofsamePLMN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_tMSIofsamePLMN, T_tMSIofsamePLMN_sequence); return offset; } static const per_sequence_t T_tMSIofdifferentPLMN_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_tMSIofdifferentPLMN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_tMSIofdifferentPLMN, T_tMSIofdifferentPLMN_sequence); return offset; } static const per_sequence_t T_iMSIresponsetopaging_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_iMSIresponsetopaging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_iMSIresponsetopaging, T_iMSIresponsetopaging_sequence); return offset; } static const per_sequence_t T_iMSIcauseUEinitiatedEvent_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_iMSIcauseUEinitiatedEvent(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_iMSIcauseUEinitiatedEvent, T_iMSIcauseUEinitiatedEvent_sequence); return offset; } static const per_sequence_t T_iMEI_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_iMEI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_iMEI, T_iMEI_sequence); return offset; } static const per_sequence_t T_spare2_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_spare2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_spare2, T_spare2_sequence); return offset; } static const per_sequence_t T_spare1_sequence[] = { { &hf_rua_routingparameter, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_RoutingParameter }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_spare1(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_spare1, T_spare1_sequence); return offset; } static const value_string rua_T_routingbasis_vals[] = { { 0, "localPTMSI" }, { 1, "tMSIofsamePLMN" }, { 2, "tMSIofdifferentPLMN" }, { 3, "iMSIresponsetopaging" }, { 4, "iMSIcauseUEinitiatedEvent" }, { 5, "iMEI" }, { 6, "spare2" }, { 7, "spare1" }, { 0, NULL } }; static const per_choice_t T_routingbasis_choice[] = { { 0, &hf_rua_localPTMSI , ASN1_NO_EXTENSIONS , dissect_rua_T_localPTMSI }, { 1, &hf_rua_tMSIofsamePLMN , ASN1_NO_EXTENSIONS , dissect_rua_T_tMSIofsamePLMN }, { 2, &hf_rua_tMSIofdifferentPLMN, ASN1_NO_EXTENSIONS , dissect_rua_T_tMSIofdifferentPLMN }, { 3, &hf_rua_iMSIresponsetopaging, ASN1_NO_EXTENSIONS , dissect_rua_T_iMSIresponsetopaging }, { 4, &hf_rua_iMSIcauseUEinitiatedEvent, ASN1_NO_EXTENSIONS , dissect_rua_T_iMSIcauseUEinitiatedEvent }, { 5, &hf_rua_iMEI , ASN1_NO_EXTENSIONS , dissect_rua_T_iMEI }, { 6, &hf_rua_spare2 , ASN1_NO_EXTENSIONS , dissect_rua_T_spare2 }, { 7, &hf_rua_spare1 , ASN1_NO_EXTENSIONS , dissect_rua_T_spare1 }, { 0, NULL, 0, NULL } }; static int dissect_rua_T_routingbasis(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rua_T_routingbasis, T_routingbasis_choice, NULL); return offset; } static int dissect_rua_BOOLEAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_boolean(tvb, offset, actx, tree, hf_index, NULL); return offset; } static const per_sequence_t Gsm_map_IDNNS_sequence[] = { { &hf_rua_routingbasis , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_T_routingbasis }, { &hf_rua_dummy , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_rua_Gsm_map_IDNNS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_Gsm_map_IDNNS, Gsm_map_IDNNS_sequence); return offset; } static int dissect_rua_Ansi_41_IDNNS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 14, 14, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string rua_T_cn_Type_vals[] = { { 0, "gsm-Map-IDNNS" }, { 1, "ansi-41-IDNNS" }, { 0, NULL } }; static const per_choice_t T_cn_Type_choice[] = { { 0, &hf_rua_gsm_Map_IDNNS , ASN1_NO_EXTENSIONS , dissect_rua_Gsm_map_IDNNS }, { 1, &hf_rua_ansi_41_IDNNS , ASN1_NO_EXTENSIONS , dissect_rua_Ansi_41_IDNNS }, { 0, NULL, 0, NULL } }; static int dissect_rua_T_cn_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rua_T_cn_Type, T_cn_Type_choice, NULL); return offset; } static const per_sequence_t T_release99_sequence[] = { { &hf_rua_cn_Type , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_T_cn_Type }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_release99(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_release99, T_release99_sequence); return offset; } static int dissect_rua_BIT_STRING_SIZE_15(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 15, 15, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t T_later_sequence[] = { { &hf_rua_futurecoding , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_BIT_STRING_SIZE_15 }, { NULL, 0, 0, NULL } }; static int dissect_rua_T_later(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_T_later, T_later_sequence); return offset; } static const value_string rua_T_version_vals[] = { { 0, "release99" }, { 1, "later" }, { 0, NULL } }; static const per_choice_t T_version_choice[] = { { 0, &hf_rua_release99 , ASN1_NO_EXTENSIONS , dissect_rua_T_release99 }, { 1, &hf_rua_later , ASN1_NO_EXTENSIONS , dissect_rua_T_later }, { 0, NULL, 0, NULL } }; static int dissect_rua_T_version(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rua_T_version, T_version_choice, NULL); return offset; } static const per_sequence_t IntraDomainNasNodeSelector_sequence[] = { { &hf_rua_version , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_T_version }, { NULL, 0, 0, NULL } }; static int dissect_rua_IntraDomainNasNodeSelector(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_IntraDomainNasNodeSelector, IntraDomainNasNodeSelector_sequence); return offset; } static int dissect_rua_RANAP_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *ranap_message_tvb=NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &ranap_message_tvb); if ((tvb_reported_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */ col_set_str(actx->pinfo->cinfo, COL_INFO, "(RUA) "); /* Set info to (RUA) to make room for RANAP */ col_set_fence(actx->pinfo->cinfo, COL_INFO); call_dissector(ranap_handle,ranap_message_tvb,actx->pinfo, proto_tree_get_root(tree)); } return offset; } static const value_string rua_CauseRadioNetwork_vals[] = { { 0, "normal" }, { 1, "connect-failed" }, { 2, "network-release" }, { 3, "unspecified" }, { 0, NULL } }; static int dissect_rua_CauseRadioNetwork(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const value_string rua_CauseTransport_vals[] = { { 0, "transport-resource-unavailable" }, { 1, "unspecified" }, { 0, NULL } }; static int dissect_rua_CauseTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string rua_CauseProtocol_vals[] = { { 0, "transfer-syntax-error" }, { 1, "abstract-syntax-error-reject" }, { 2, "abstract-syntax-error-ignore-and-notify" }, { 3, "message-not-compatible-with-receiver-state" }, { 4, "semantic-error" }, { 5, "unspecified" }, { 6, "abstract-syntax-error-falsely-constructed-message" }, { 0, NULL } }; static int dissect_rua_CauseProtocol(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 7, NULL, TRUE, 0, NULL); return offset; } static const value_string rua_CauseMisc_vals[] = { { 0, "processing-overload" }, { 1, "hardware-failure" }, { 2, "o-and-m-intervention" }, { 3, "unspecified" }, { 0, NULL } }; static int dissect_rua_CauseMisc(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const value_string rua_Cause_vals[] = { { 0, "radioNetwork" }, { 1, "transport" }, { 2, "protocol" }, { 3, "misc" }, { 0, NULL } }; static const per_choice_t Cause_choice[] = { { 0, &hf_rua_radioNetwork , ASN1_EXTENSION_ROOT , dissect_rua_CauseRadioNetwork }, { 1, &hf_rua_transport , ASN1_EXTENSION_ROOT , dissect_rua_CauseTransport }, { 2, &hf_rua_protocol , ASN1_EXTENSION_ROOT , dissect_rua_CauseProtocol }, { 3, &hf_rua_misc , ASN1_EXTENSION_ROOT , dissect_rua_CauseMisc }, { 0, NULL, 0, NULL } }; static int dissect_rua_Cause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rua_Cause, Cause_choice, NULL); return offset; } static const value_string rua_TypeOfError_vals[] = { { 0, "not-understood" }, { 1, "missing" }, { 0, NULL } }; static int dissect_rua_TypeOfError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_item_sequence[] = { { &hf_rua_iECriticality , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_iE_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_ID }, { &hf_rua_typeOfError , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_TypeOfError }, { &hf_rua_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_CriticalityDiagnostics_IE_List_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_CriticalityDiagnostics_IE_List_item, CriticalityDiagnostics_IE_List_item_sequence); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_sequence_of[1] = { { &hf_rua_CriticalityDiagnostics_IE_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_CriticalityDiagnostics_IE_List_item }, }; static int dissect_rua_CriticalityDiagnostics_IE_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_rua_CriticalityDiagnostics_IE_List, CriticalityDiagnostics_IE_List_sequence_of, 1, maxNrOfErrors, FALSE); return offset; } static const per_sequence_t CriticalityDiagnostics_sequence[] = { { &hf_rua_procedureCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProcedureCode }, { &hf_rua_triggeringMessage, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_TriggeringMessage }, { &hf_rua_procedureCriticality, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_Criticality }, { &hf_rua_iEsCriticalityDiagnostics, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_CriticalityDiagnostics_IE_List }, { &hf_rua_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_CriticalityDiagnostics(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_CriticalityDiagnostics, CriticalityDiagnostics_sequence); return offset; } static const per_sequence_t Connect_sequence[] = { { &hf_rua_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Container }, { &hf_rua_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_Connect(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_set_str(actx->pinfo->cinfo, COL_INFO, "CONNECT "); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_Connect, Connect_sequence); return offset; } static const per_sequence_t DirectTransfer_sequence[] = { { &hf_rua_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Container }, { &hf_rua_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_DirectTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_set_str(actx->pinfo->cinfo, COL_INFO, "DIRECT_TRANSFER "); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_DirectTransfer, DirectTransfer_sequence); return offset; } static const per_sequence_t Disconnect_sequence[] = { { &hf_rua_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Container }, { &hf_rua_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_Disconnect(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_set_str(actx->pinfo->cinfo, COL_INFO, "DISCONNECT "); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_Disconnect, Disconnect_sequence); return offset; } static const per_sequence_t ConnectionlessTransfer_sequence[] = { { &hf_rua_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Container }, { &hf_rua_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_ConnectionlessTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_set_str(actx->pinfo->cinfo, COL_INFO, "CONNECTIONLESS_TRANSFER "); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_ConnectionlessTransfer, ConnectionlessTransfer_sequence); return offset; } static const per_sequence_t ErrorIndication_sequence[] = { { &hf_rua_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_ProtocolIE_Container }, { &hf_rua_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_rua_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_rua_ErrorIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_set_str(actx->pinfo->cinfo, COL_INFO, "ERROR_INDICATION "); col_set_fence(actx->pinfo->cinfo, COL_INFO); /* Protect info from CriticalityDiagnostics decodes */ offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_ErrorIndication, ErrorIndication_sequence); return offset; } static const per_sequence_t PrivateMessage_sequence[] = { { &hf_rua_privateIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_rua_PrivateIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_rua_PrivateMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_set_str(actx->pinfo->cinfo, COL_INFO, "PRIVATE_MESSAGE "); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_PrivateMessage, PrivateMessage_sequence); return offset; } static int dissect_rua_InitiatingMessage_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_InitiatingMessageValue); return offset; } static const per_sequence_t InitiatingMessage_sequence[] = { { &hf_rua_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProcedureCode }, { &hf_rua_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_initiatingMessagevalue, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_InitiatingMessage_value }, { NULL, 0, 0, NULL } }; static int dissect_rua_InitiatingMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_InitiatingMessage, InitiatingMessage_sequence); return offset; } static int dissect_rua_SuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_SuccessfulOutcomeValue); return offset; } static const per_sequence_t SuccessfulOutcome_sequence[] = { { &hf_rua_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProcedureCode }, { &hf_rua_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_successfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_SuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_rua_SuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_SuccessfulOutcome, SuccessfulOutcome_sequence); return offset; } static int dissect_rua_UnsuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_UnsuccessfulOutcomeValue); return offset; } static const per_sequence_t UnsuccessfulOutcome_sequence[] = { { &hf_rua_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_ProcedureCode }, { &hf_rua_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_Criticality }, { &hf_rua_unsuccessfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rua_UnsuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_rua_UnsuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rua_UnsuccessfulOutcome, UnsuccessfulOutcome_sequence); return offset; } static const value_string rua_RUA_PDU_vals[] = { { 0, "initiatingMessage" }, { 1, "successfulOutcome" }, { 2, "unsuccessfulOutcome" }, { 0, NULL } }; static const per_choice_t RUA_PDU_choice[] = { { 0, &hf_rua_initiatingMessage, ASN1_EXTENSION_ROOT , dissect_rua_InitiatingMessage }, { 1, &hf_rua_successfulOutcome, ASN1_EXTENSION_ROOT , dissect_rua_SuccessfulOutcome }, { 2, &hf_rua_unsuccessfulOutcome, ASN1_EXTENSION_ROOT , dissect_rua_UnsuccessfulOutcome }, { 0, NULL, 0, NULL } }; static int dissect_rua_RUA_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rua_RUA_PDU, RUA_PDU_choice, NULL); return offset; } /*--- PDUs ---*/ static int dissect_CN_DomainIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_CN_DomainIndicator(tvb, offset, &asn1_ctx, tree, hf_rua_CN_DomainIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CSGMembershipStatus_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_CSGMembershipStatus(tvb, offset, &asn1_ctx, tree, hf_rua_CSGMembershipStatus_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Establishment_Cause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_Establishment_Cause(tvb, offset, &asn1_ctx, tree, hf_rua_Establishment_Cause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Context_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_Context_ID(tvb, offset, &asn1_ctx, tree, hf_rua_Context_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_IntraDomainNasNodeSelector_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_IntraDomainNasNodeSelector(tvb, offset, &asn1_ctx, tree, hf_rua_IntraDomainNasNodeSelector_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RANAP_Message_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_RANAP_Message(tvb, offset, &asn1_ctx, tree, hf_rua_RANAP_Message_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_Cause(tvb, offset, &asn1_ctx, tree, hf_rua_Cause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CriticalityDiagnostics_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_CriticalityDiagnostics(tvb, offset, &asn1_ctx, tree, hf_rua_CriticalityDiagnostics_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Connect_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_Connect(tvb, offset, &asn1_ctx, tree, hf_rua_Connect_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DirectTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_DirectTransfer(tvb, offset, &asn1_ctx, tree, hf_rua_DirectTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Disconnect_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_Disconnect(tvb, offset, &asn1_ctx, tree, hf_rua_Disconnect_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ConnectionlessTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_ConnectionlessTransfer(tvb, offset, &asn1_ctx, tree, hf_rua_ConnectionlessTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ErrorIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_ErrorIndication(tvb, offset, &asn1_ctx, tree, hf_rua_ErrorIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PrivateMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_PrivateMessage(tvb, offset, &asn1_ctx, tree, hf_rua_PrivateMessage_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RUA_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_rua_RUA_PDU(tvb, offset, &asn1_ctx, tree, hf_rua_RUA_PDU_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint_new(rua_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0; } static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint_new(rua_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0; } static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint_new(rua_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint_new(rua_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint_new(rua_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0; } static int dissect_rua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *rua_item = NULL; proto_tree *rua_tree = NULL; /* make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RUA"); /* create the rua protocol tree */ rua_item = proto_tree_add_item(tree, proto_rua, tvb, 0, -1, ENC_NA); rua_tree = proto_item_add_subtree(rua_item, ett_rua); return dissect_RUA_PDU_PDU(tvb, pinfo, rua_tree, data); } /*--- proto_register_rua -------------------------------------------*/ void proto_register_rua(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_rua_CN_DomainIndicator_PDU, { "CN-DomainIndicator", "rua.CN_DomainIndicator", FT_UINT32, BASE_DEC, VALS(rua_CN_DomainIndicator_vals), 0, NULL, HFILL }}, { &hf_rua_CSGMembershipStatus_PDU, { "CSGMembershipStatus", "rua.CSGMembershipStatus", FT_UINT32, BASE_DEC, VALS(rua_CSGMembershipStatus_vals), 0, NULL, HFILL }}, { &hf_rua_Establishment_Cause_PDU, { "Establishment-Cause", "rua.Establishment_Cause", FT_UINT32, BASE_DEC, VALS(rua_Establishment_Cause_vals), 0, NULL, HFILL }}, { &hf_rua_Context_ID_PDU, { "Context-ID", "rua.Context_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_IntraDomainNasNodeSelector_PDU, { "IntraDomainNasNodeSelector", "rua.IntraDomainNasNodeSelector_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_RANAP_Message_PDU, { "RANAP-Message", "rua.RANAP_Message", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_Cause_PDU, { "Cause", "rua.Cause", FT_UINT32, BASE_DEC, VALS(rua_Cause_vals), 0, NULL, HFILL }}, { &hf_rua_CriticalityDiagnostics_PDU, { "CriticalityDiagnostics", "rua.CriticalityDiagnostics_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_Connect_PDU, { "Connect", "rua.Connect_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_DirectTransfer_PDU, { "DirectTransfer", "rua.DirectTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_Disconnect_PDU, { "Disconnect", "rua.Disconnect_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_ConnectionlessTransfer_PDU, { "ConnectionlessTransfer", "rua.ConnectionlessTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_ErrorIndication_PDU, { "ErrorIndication", "rua.ErrorIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_PrivateMessage_PDU, { "PrivateMessage", "rua.PrivateMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_RUA_PDU_PDU, { "RUA-PDU", "rua.RUA_PDU", FT_UINT32, BASE_DEC, VALS(rua_RUA_PDU_vals), 0, NULL, HFILL }}, { &hf_rua_local, { "local", "rua.local", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_rua_global, { "global", "rua.global", FT_OID, BASE_NONE, NULL, 0, "OBJECT_IDENTIFIER", HFILL }}, { &hf_rua_ProtocolIE_Container_item, { "ProtocolIE-Field", "rua.ProtocolIE_Field_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_protocol_ie_field_id, { "id", "rua.id", FT_UINT32, BASE_DEC, VALS(rua_ProtocolIE_ID_vals), 0, "ProtocolIE_ID", HFILL }}, { &hf_rua_criticality, { "criticality", "rua.criticality", FT_UINT32, BASE_DEC, VALS(rua_Criticality_vals), 0, NULL, HFILL }}, { &hf_rua_ie_field_value, { "value", "rua.value_element", FT_NONE, BASE_NONE, NULL, 0, "ProtocolIE_Field_value", HFILL }}, { &hf_rua_ProtocolExtensionContainer_item, { "ProtocolExtensionField", "rua.ProtocolExtensionField_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_id, { "id", "rua.id", FT_UINT32, BASE_DEC, VALS(rua_ProtocolIE_ID_vals), 0, "ProtocolIE_ID", HFILL }}, { &hf_rua_extensionValue, { "extensionValue", "rua.extensionValue_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_PrivateIE_Container_item, { "PrivateIE-Field", "rua.PrivateIE_Field_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_private_ie_field_id, { "id", "rua.id", FT_UINT32, BASE_DEC, VALS(rua_PrivateIE_ID_vals), 0, "PrivateIE_ID", HFILL }}, { &hf_rua_private_value, { "value", "rua.value_element", FT_NONE, BASE_NONE, NULL, 0, "PrivateIE_Field_value", HFILL }}, { &hf_rua_version, { "version", "rua.version", FT_UINT32, BASE_DEC, VALS(rua_T_version_vals), 0, NULL, HFILL }}, { &hf_rua_release99, { "release99", "rua.release99_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_cn_Type, { "cn-Type", "rua.cn_Type", FT_UINT32, BASE_DEC, VALS(rua_T_cn_Type_vals), 0, NULL, HFILL }}, { &hf_rua_gsm_Map_IDNNS, { "gsm-Map-IDNNS", "rua.gsm_Map_IDNNS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_ansi_41_IDNNS, { "ansi-41-IDNNS", "rua.ansi_41_IDNNS", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_later, { "later", "rua.later_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_futurecoding, { "futurecoding", "rua.futurecoding", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_15", HFILL }}, { &hf_rua_routingbasis, { "routingbasis", "rua.routingbasis", FT_UINT32, BASE_DEC, VALS(rua_T_routingbasis_vals), 0, NULL, HFILL }}, { &hf_rua_localPTMSI, { "localPTMSI", "rua.localPTMSI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_routingparameter, { "routingparameter", "rua.routingparameter", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_tMSIofsamePLMN, { "tMSIofsamePLMN", "rua.tMSIofsamePLMN_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_tMSIofdifferentPLMN, { "tMSIofdifferentPLMN", "rua.tMSIofdifferentPLMN_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_iMSIresponsetopaging, { "iMSIresponsetopaging", "rua.iMSIresponsetopaging_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_iMSIcauseUEinitiatedEvent, { "iMSIcauseUEinitiatedEvent", "rua.iMSIcauseUEinitiatedEvent_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_iMEI, { "iMEI", "rua.iMEI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_spare2, { "spare2", "rua.spare2_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_spare1, { "spare1", "rua.spare1_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_dummy, { "dummy", "rua.dummy", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_rua_radioNetwork, { "radioNetwork", "rua.radioNetwork", FT_UINT32, BASE_DEC, VALS(rua_CauseRadioNetwork_vals), 0, "CauseRadioNetwork", HFILL }}, { &hf_rua_transport, { "transport", "rua.transport", FT_UINT32, BASE_DEC, VALS(rua_CauseTransport_vals), 0, "CauseTransport", HFILL }}, { &hf_rua_protocol, { "protocol", "rua.protocol", FT_UINT32, BASE_DEC, VALS(rua_CauseProtocol_vals), 0, "CauseProtocol", HFILL }}, { &hf_rua_misc, { "misc", "rua.misc", FT_UINT32, BASE_DEC, VALS(rua_CauseMisc_vals), 0, "CauseMisc", HFILL }}, { &hf_rua_procedureCode, { "procedureCode", "rua.procedureCode", FT_UINT32, BASE_DEC, VALS(rua_ProcedureCode_vals), 0, NULL, HFILL }}, { &hf_rua_triggeringMessage, { "triggeringMessage", "rua.triggeringMessage", FT_UINT32, BASE_DEC, VALS(rua_TriggeringMessage_vals), 0, NULL, HFILL }}, { &hf_rua_procedureCriticality, { "procedureCriticality", "rua.procedureCriticality", FT_UINT32, BASE_DEC, VALS(rua_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_rua_iEsCriticalityDiagnostics, { "iEsCriticalityDiagnostics", "rua.iEsCriticalityDiagnostics", FT_UINT32, BASE_DEC, NULL, 0, "CriticalityDiagnostics_IE_List", HFILL }}, { &hf_rua_iE_Extensions, { "iE-Extensions", "rua.iE_Extensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_rua_CriticalityDiagnostics_IE_List_item, { "CriticalityDiagnostics-IE-List item", "rua.CriticalityDiagnostics_IE_List_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_iECriticality, { "iECriticality", "rua.iECriticality", FT_UINT32, BASE_DEC, VALS(rua_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_rua_iE_ID, { "iE-ID", "rua.iE_ID", FT_UINT32, BASE_DEC, VALS(rua_ProtocolIE_ID_vals), 0, "ProtocolIE_ID", HFILL }}, { &hf_rua_typeOfError, { "typeOfError", "rua.typeOfError", FT_UINT32, BASE_DEC, VALS(rua_TypeOfError_vals), 0, NULL, HFILL }}, { &hf_rua_protocolIEs, { "protocolIEs", "rua.protocolIEs", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolIE_Container", HFILL }}, { &hf_rua_protocolExtensions, { "protocolExtensions", "rua.protocolExtensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_rua_privateIEs, { "privateIEs", "rua.privateIEs", FT_UINT32, BASE_DEC, NULL, 0, "PrivateIE_Container", HFILL }}, { &hf_rua_initiatingMessage, { "initiatingMessage", "rua.initiatingMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_successfulOutcome, { "successfulOutcome", "rua.successfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_unsuccessfulOutcome, { "unsuccessfulOutcome", "rua.unsuccessfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rua_initiatingMessagevalue, { "value", "rua.value_element", FT_NONE, BASE_NONE, NULL, 0, "InitiatingMessage_value", HFILL }}, { &hf_rua_successfulOutcome_value, { "value", "rua.value_element", FT_NONE, BASE_NONE, NULL, 0, "SuccessfulOutcome_value", HFILL }}, { &hf_rua_unsuccessfulOutcome_value, { "value", "rua.value_element", FT_NONE, BASE_NONE, NULL, 0, "UnsuccessfulOutcome_value", HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_rua, &ett_rua_PrivateIE_ID, &ett_rua_ProtocolIE_Container, &ett_rua_ProtocolIE_Field, &ett_rua_ProtocolExtensionContainer, &ett_rua_ProtocolExtensionField, &ett_rua_PrivateIE_Container, &ett_rua_PrivateIE_Field, &ett_rua_IntraDomainNasNodeSelector, &ett_rua_T_version, &ett_rua_T_release99, &ett_rua_T_cn_Type, &ett_rua_T_later, &ett_rua_Gsm_map_IDNNS, &ett_rua_T_routingbasis, &ett_rua_T_localPTMSI, &ett_rua_T_tMSIofsamePLMN, &ett_rua_T_tMSIofdifferentPLMN, &ett_rua_T_iMSIresponsetopaging, &ett_rua_T_iMSIcauseUEinitiatedEvent, &ett_rua_T_iMEI, &ett_rua_T_spare2, &ett_rua_T_spare1, &ett_rua_Cause, &ett_rua_CriticalityDiagnostics, &ett_rua_CriticalityDiagnostics_IE_List, &ett_rua_CriticalityDiagnostics_IE_List_item, &ett_rua_Connect, &ett_rua_DirectTransfer, &ett_rua_Disconnect, &ett_rua_ConnectionlessTransfer, &ett_rua_ErrorIndication, &ett_rua_PrivateMessage, &ett_rua_RUA_PDU, &ett_rua_InitiatingMessage, &ett_rua_SuccessfulOutcome, &ett_rua_UnsuccessfulOutcome, }; /* Register protocol */ proto_rua = proto_register_protocol(PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array(proto_rua, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register dissector */ rua_handle = register_dissector("rua", dissect_rua, proto_rua); /* Register dissector tables */ rua_ies_dissector_table = register_dissector_table("rua.ies", "RUA-PROTOCOL-IES", proto_rua, FT_UINT32, BASE_DEC); rua_extension_dissector_table = register_dissector_table("rua.extension", "RUA-PROTOCOL-EXTENSION", proto_rua, FT_UINT32, BASE_DEC); rua_proc_imsg_dissector_table = register_dissector_table("rua.proc.imsg", "RUA-ELEMENTARY-PROCEDURE InitiatingMessage", proto_rua, FT_UINT32, BASE_DEC); rua_proc_sout_dissector_table = register_dissector_table("rua.proc.sout", "RUA-ELEMENTARY-PROCEDURE SuccessfulOutcome", proto_rua, FT_UINT32, BASE_DEC); rua_proc_uout_dissector_table = register_dissector_table("rua.proc.uout", "RUA-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_rua, FT_UINT32, BASE_DEC); /* rua_module = prefs_register_protocol(proto_rua, NULL); */ } /*--- proto_reg_handoff_rua ---------------------------------------*/ void proto_reg_handoff_rua(void) { ranap_handle = find_dissector_add_dependency("ranap", proto_rua); dissector_add_uint("sctp.ppi", RUA_PAYLOAD_PROTOCOL_ID, rua_handle); dissector_add_uint_with_preference("sctp.port", SCTP_PORT_RUA, rua_handle); dissector_add_uint("rua.ies", id_Cause, create_dissector_handle(dissect_Cause_PDU, proto_rua)); dissector_add_uint("rua.ies", id_CriticalityDiagnostics, create_dissector_handle(dissect_CriticalityDiagnostics_PDU, proto_rua)); dissector_add_uint("rua.ies", id_Context_ID, create_dissector_handle(dissect_Context_ID_PDU, proto_rua)); dissector_add_uint("rua.ies", id_RANAP_Message, create_dissector_handle(dissect_RANAP_Message_PDU, proto_rua)); dissector_add_uint("rua.ies", id_IntraDomainNasNodeSelector, create_dissector_handle(dissect_IntraDomainNasNodeSelector_PDU, proto_rua)); dissector_add_uint("rua.ies", id_Establishment_Cause, create_dissector_handle(dissect_Establishment_Cause_PDU, proto_rua)); dissector_add_uint("rua.ies", id_CN_DomainIndicator, create_dissector_handle(dissect_CN_DomainIndicator_PDU, proto_rua)); dissector_add_uint("rua.extension", id_CSGMembershipStatus, create_dissector_handle(dissect_CSGMembershipStatus_PDU, proto_rua)); dissector_add_uint("rua.proc.imsg", id_Connect, create_dissector_handle(dissect_Connect_PDU, proto_rua)); dissector_add_uint("rua.proc.imsg", id_DirectTransfer, create_dissector_handle(dissect_DirectTransfer_PDU, proto_rua)); dissector_add_uint("rua.proc.imsg", id_Disconnect, create_dissector_handle(dissect_Disconnect_PDU, proto_rua)); dissector_add_uint("rua.proc.imsg", id_ConnectionlessTransfer, create_dissector_handle(dissect_ConnectionlessTransfer_PDU, proto_rua)); dissector_add_uint("rua.proc.imsg", id_ErrorIndication, create_dissector_handle(dissect_ErrorIndication_PDU, proto_rua)); dissector_add_uint("rua.proc.imsg", id_privateMessage, create_dissector_handle(dissect_PrivateMessage_PDU, proto_rua)); }
C
wireshark/epan/dissectors/packet-rudp.c
/* packet-rudp.c * Routines for Reliable UDP Protocol. * Copyright 2004, Duncan Sargeant <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * Copied from packet-data.c, README.developer, and various other files. * * SPDX-License-Identifier: GPL-2.0-or-later * Reliable UDP is a lightweight protocol for providing TCP-like flow * control over UDP. Cisco published an PFC a long time ago, and * their actual implementation is slightly different, having no * checksum field. * * I've cheated here - RUDP could be used for anything, but I've only * seen it used to switched telephony calls, so we just call the Cisco SM * dissector from here. * * Here are some links: * * http://www.watersprings.org/pub/id/draft-ietf-sigtran-reliable-udp-00.txt * http://www.javvin.com/protocolRUDP.html * http://www.cisco.com/univercd/cc/td/doc/product/access/sc/rel7/omts/omts_apb.htm#30052 */ #include "config.h" #include <epan/packet.h> void proto_register_rudp(void); void proto_reg_handoff_rudp(void); static int proto_rudp = -1; static int hf_rudp_flags = -1; static int hf_rudp_flags_syn = -1; static int hf_rudp_flags_ack = -1; static int hf_rudp_flags_eak = -1; static int hf_rudp_flags_rst = -1; static int hf_rudp_flags_nul = -1; static int hf_rudp_flags_chk = -1; static int hf_rudp_flags_tcs = -1; static int hf_rudp_flags_0 = -1; static int hf_rudp_hlen = -1; static int hf_rudp_seq = -1; static int hf_rudp_ack = -1; static int hf_rudp_cksum = -1; static gint ett_rudp = -1; static gint ett_rudp_flags = -1; static dissector_handle_t sm_handle = NULL; static int dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree, void* data _U_) { tvbuff_t * next_tvb; proto_tree *rudp_tree; proto_item *ti; guint8 hlen; static int * const flags[] = { &hf_rudp_flags_syn, &hf_rudp_flags_ack, &hf_rudp_flags_eak, &hf_rudp_flags_rst, &hf_rudp_flags_nul, &hf_rudp_flags_chk, &hf_rudp_flags_tcs, &hf_rudp_flags_0, NULL }; hlen = tvb_get_guint8(tvb, 1); col_set_str(pinfo->cinfo, COL_PROTOCOL, "RUDP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_rudp, tvb, 0, hlen, ENC_NA); rudp_tree = proto_item_add_subtree(ti, ett_rudp); proto_tree_add_bitmask(rudp_tree, tvb, 0, hf_rudp_flags, ett_rudp_flags, flags, ENC_BIG_ENDIAN); proto_tree_add_item(rudp_tree, hf_rudp_hlen, tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rudp_tree, hf_rudp_seq, tvb, 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rudp_tree, hf_rudp_ack, tvb, 3, 1, ENC_BIG_ENDIAN); /* If the header is more than 4 bytes the next 2 bytes are the checksum */ if (hlen > 4) { proto_tree_add_checksum(rudp_tree, tvb, 4, hf_rudp_cksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); } /* If we have even more bytes their meaning is unknown - we have seen this * in live captures */ if (hlen > 6) { next_tvb = tvb_new_subset_length(tvb, 6, hlen-6); call_data_dissector(next_tvb, pinfo, rudp_tree); } next_tvb = tvb_new_subset_remaining(tvb, hlen); if (tvb_captured_length(next_tvb) && sm_handle) call_dissector(sm_handle, next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_rudp(void) { static hf_register_info hf[] = { { &hf_rudp_flags, { "RUDP Header flags", "rudp.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rudp_flags_syn, { "Syn", "rudp.flags.syn", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_rudp_flags_ack, { "Ack", "rudp.flags.ack", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_rudp_flags_eak, { "Eak", "rudp.flags.eak", FT_BOOLEAN, 8, NULL, 0x20, "Extended Ack", HFILL } }, { &hf_rudp_flags_rst, { "RST", "rudp.flags.rst", FT_BOOLEAN, 8, NULL, 0x10, "Reset flag", HFILL } }, { &hf_rudp_flags_nul, { "NULL", "rudp.flags.nul", FT_BOOLEAN, 8, NULL, 0x08, "Null flag", HFILL } }, { &hf_rudp_flags_chk, { "CHK", "rudp.flags.chk", FT_BOOLEAN, 8, NULL, 0x04, "Checksum is on header or body", HFILL } }, { &hf_rudp_flags_tcs, { "TCS", "rudp.flags.tcs", FT_BOOLEAN, 8, NULL, 0x02, "Transfer Connection System", HFILL } }, { &hf_rudp_flags_0, { "0", "rudp.flags.0", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_rudp_hlen, { "Header Length", "rudp.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_rudp_seq, { "Seq", "rudp.seq", FT_UINT8, BASE_DEC, NULL, 0x0, "Sequence Number", HFILL } }, { &hf_rudp_ack, { "Ack", "rudp.ack", FT_UINT8, BASE_DEC, NULL, 0x0, "Acknowledgement Number", HFILL } }, { &hf_rudp_cksum, { "Checksum", "rudp.cksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_rudp, &ett_rudp_flags, }; proto_rudp = proto_register_protocol ("Reliable UDP", "RUDP", "rudp"); proto_register_field_array(proto_rudp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_rudp(void) { dissector_handle_t rudp_handle; /* Disable rudp by default. The previously hardcoded value of * 7000 (used by Cisco) collides with afs and as the draft states: * "RUDP doesn't place any restrictions on which UDP port numbers are used. * Valid port numbers are ports not defined in RFC 1700." */ /* FIXME: The proper solution would be to convert this dissector into * heuristic dissector, but it isn't complete anyway. */ rudp_handle = create_dissector_handle(dissect_rudp, proto_rudp); dissector_add_for_decode_as_with_preference("udp.port", rudp_handle); sm_handle = find_dissector_add_dependency("sm", proto_rudp); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-rwall.c
/* packet-rwall.c * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include "packet-rpc.h" void proto_register_rwall(void); void proto_reg_handoff_rwall(void); /* there is no procedure 1 */ #define RWALL_WALL 2 #define RWALL_PROGRAM 100008 static const value_string rwall1_proc_vals[] = { { RWALL_WALL, "RWALL" }, { 0, NULL } }; static int proto_rwall = -1; static int hf_rwall_message = -1; static int hf_rwall_procedure_v1 = -1; static gint ett_rwall = -1; static int dissect_rwall_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { return dissect_rpc_string(tvb, tree, hf_rwall_message, 0, NULL); } static const vsff rwall1_proc[] = { { RWALL_WALL, "RWALL", dissect_rwall_call, dissect_rpc_void }, { 0, NULL, NULL, NULL } }; static const rpc_prog_vers_info rwall_vers_info[] = { { 1, rwall1_proc, &hf_rwall_procedure_v1 }, }; void proto_register_rwall(void) { static hf_register_info hf[] = { { &hf_rwall_procedure_v1, { "V1 Procedure", "rwall.procedure_v1", FT_UINT32, BASE_DEC, VALS(rwall1_proc_vals), 0, NULL, HFILL } }, { &hf_rwall_message, { "Message", "rwall.message", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, }; static gint *ett[] = { &ett_rwall, }; proto_rwall = proto_register_protocol("Remote Wall protocol", "RWALL", "rwall"); proto_register_field_array(proto_rwall, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_rwall(void) { /* Register the protocol as RPC */ rpc_init_prog(proto_rwall, RWALL_PROGRAM, ett_rwall, G_N_ELEMENTS(rwall_vers_info), rwall_vers_info); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-rx.c
/* packet-rx.c * Routines for RX packet dissection * Copyright 1999, Nathan Neulinger <[email protected]> * Based on routines from tcpdump patches by * Ken Hornstein <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * Copied from packet-tftp.c * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include "packet-rx.h" #include <epan/addr_resolv.h> /* * See * * http://web.mit.edu/kolya/afs/rx/rx-spec * * XXX - is the "Epoch" really a UN*X time? The high-order bit, according * to that spec, is a flag bit. */ void proto_register_rx(void); void proto_reg_handoff_rx(void); #define UDP_PORT_RX_RANGE "7000-7009,7021" static const value_string rx_types[] = { { RX_PACKET_TYPE_DATA, "data" }, { RX_PACKET_TYPE_ACK, "ack" }, { RX_PACKET_TYPE_BUSY, "busy" }, { RX_PACKET_TYPE_ABORT, "abort" }, { RX_PACKET_TYPE_ACKALL, "ackall" }, { RX_PACKET_TYPE_CHALLENGE, "challenge" }, { RX_PACKET_TYPE_RESPONSE, "response" }, { RX_PACKET_TYPE_DEBUG, "debug" }, { RX_PACKET_TYPE_PARAMS, "params" }, { RX_PACKET_TYPE_VERSION, "version" }, { 0, NULL }, }; static const value_string rx_reason[] = { { RX_ACK_REQUESTED, "Ack Requested" }, { RX_ACK_DUPLICATE, "Duplicate Packet" }, { RX_ACK_OUT_OF_SEQUENCE, "Out Of Sequence" }, { RX_ACK_EXEEDS_WINDOW, "Exceeds Window" }, { RX_ACK_NOSPACE, "No Space" }, { RX_ACK_PING, "Ping" }, { RX_ACK_PING_RESPONSE, "Ping Response" }, { RX_ACK_DELAY, "Delay" }, { RX_ACK_IDLE, "Idle" }, { 0, NULL } }; static const value_string rx_ack_type[] = { { RX_ACK_TYPE_NACK, "NACK" }, { RX_ACK_TYPE_ACK, "ACK" }, { 0, NULL } }; static int proto_rx = -1; static int hf_rx_epoch = -1; static int hf_rx_cid = -1; static int hf_rx_seq = -1; static int hf_rx_serial = -1; static int hf_rx_callnumber = -1; static int hf_rx_type = -1; static int hf_rx_flags = -1; static int hf_rx_flags_clientinit = -1; static int hf_rx_flags_request_ack = -1; static int hf_rx_flags_last_packet = -1; static int hf_rx_flags_more_packets = -1; static int hf_rx_flags_free_packet = -1; static int hf_rx_userstatus = -1; static int hf_rx_securityindex = -1; static int hf_rx_spare = -1; static int hf_rx_serviceid = -1; static int hf_rx_bufferspace = -1; static int hf_rx_maxskew = -1; static int hf_rx_first_packet = -1; static int hf_rx_prev_packet = -1; static int hf_rx_reason = -1; static int hf_rx_numacks = -1; static int hf_rx_ack_type = -1; static int hf_rx_ack = -1; static int hf_rx_challenge = -1; static int hf_rx_version = -1; static int hf_rx_nonce = -1; static int hf_rx_inc_nonce = -1; static int hf_rx_min_level = -1; static int hf_rx_level = -1; static int hf_rx_response = -1; static int hf_rx_encrypted = -1; static int hf_rx_kvno = -1; static int hf_rx_ticket_len = -1; static int hf_rx_ticket = -1; static int hf_rx_ifmtu = -1; static int hf_rx_maxmtu = -1; static int hf_rx_rwind = -1; static int hf_rx_maxpackets = -1; static int hf_rx_abort = -1; static int hf_rx_abortcode = -1; static gint ett_rx = -1; static gint ett_rx_flags = -1; static gint ett_rx_ack = -1; static gint ett_rx_challenge = -1; static gint ett_rx_response = -1; static gint ett_rx_encrypted = -1; static gint ett_rx_abort = -1; static dissector_handle_t afs_handle; static int dissect_rx_response_encrypted(tvbuff_t *tvb, proto_tree *parent_tree, int offset) { proto_tree *tree; proto_item *item; int old_offset=offset; int i; guint32 callnumber; item = proto_tree_add_item(parent_tree, hf_rx_encrypted, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_rx_encrypted); /* epoch : 4 bytes */ proto_tree_add_item(tree, hf_rx_epoch, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); offset += 4; /* cid : 4 bytes */ proto_tree_add_item(tree, hf_rx_cid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*FIXME don't know how to handle this checksum, skipping it */ offset += 4; /* sequrityindex : 1 byte */ proto_tree_add_item(tree, hf_rx_securityindex, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 4; for (i=0; i<RX_MAXCALLS; i++) { /* callnumber : 4 bytes */ callnumber = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_callnumber, tvb, offset, 4, callnumber); offset += 4; } /* inc nonce : 4 bytes */ proto_tree_add_item(tree, hf_rx_inc_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* level : 4 bytes */ proto_tree_add_item(tree, hf_rx_level, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_item_set_len(item, offset-old_offset); return offset; } static int dissect_rx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint32 seq, guint32 callnumber) { proto_tree *tree; proto_item *item; guint32 version, tl; int old_offset=offset; col_add_fstr(pinfo->cinfo, COL_INFO, "RESPONSE " "Seq: %lu " "Call: %lu " "Source Port: %s " "Destination Port: %s ", (unsigned long)seq, (unsigned long)callnumber, udp_port_to_display(pinfo->pool, pinfo->srcport), udp_port_to_display(pinfo->pool, pinfo->destport) ); item = proto_tree_add_item(parent_tree, hf_rx_response, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_rx_response); version = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_version, tvb, offset, 4, version); offset += 4; if (version==2) { /* skip unused */ offset += 4; /* encrypted : struct */ offset = dissect_rx_response_encrypted(tvb, tree, offset); /* kvno */ proto_tree_add_item(tree, hf_rx_kvno, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* ticket_len */ tl = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_ticket_len, tvb, offset, 4, tl); offset += 4; proto_tree_add_item(tree, hf_rx_ticket, tvb, offset, tl, ENC_NA); offset += tl; } proto_item_set_len(item, offset-old_offset); return offset; } static int dissect_rx_abort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint32 seq, guint32 callnumber) { proto_tree *tree; proto_item *item; int old_offset=offset; col_add_fstr(pinfo->cinfo, COL_INFO, "ABORT " "Seq: %lu " "Call: %lu " "Source Port: %s " "Destination Port: %s ", (unsigned long)seq, (unsigned long)callnumber, udp_port_to_display(pinfo->pool, pinfo->srcport), udp_port_to_display(pinfo->pool, pinfo->destport) ); item = proto_tree_add_item(parent_tree, hf_rx_abort, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_rx_abort); /* abort code */ proto_tree_add_item(tree, hf_rx_abortcode, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_item_set_len(item, offset-old_offset); return offset; } static int dissect_rx_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint32 seq, guint32 callnumber) { proto_tree *tree; proto_item *item; guint32 version; int old_offset=offset; col_add_fstr(pinfo->cinfo, COL_INFO, "CHALLENGE " "Seq: %lu " "Call: %lu " "Source Port: %s " "Destination Port: %s ", (unsigned long)seq, (unsigned long)callnumber, udp_port_to_display(pinfo->pool, pinfo->srcport), udp_port_to_display(pinfo->pool, pinfo->destport) ); item = proto_tree_add_item(parent_tree, hf_rx_challenge, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_rx_challenge); version = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_version, tvb, offset, 4, version); offset += 4; if (version==2) { proto_tree_add_item(tree, hf_rx_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_rx_min_level, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } proto_item_set_len(item, offset-old_offset); return offset; } static int dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint32 seq, guint32 callnumber) { proto_tree *tree; proto_item *item; guint8 num, reason; int old_offset = offset; item = proto_tree_add_item(parent_tree, hf_rx_ack, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_rx_ack); /* bufferspace: 2 bytes*/ proto_tree_add_item(tree, hf_rx_bufferspace, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* maxskew: 2 bytes*/ proto_tree_add_item(tree, hf_rx_maxskew, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* first packet: 4 bytes*/ proto_tree_add_item(tree, hf_rx_first_packet, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* prev packet: 4 bytes*/ proto_tree_add_item(tree, hf_rx_prev_packet, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* serial : 4 bytes */ proto_tree_add_item(tree, hf_rx_serial, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* reason : 1 byte */ reason = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_rx_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* nACKs */ num = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_rx_numacks, tvb, offset, 1, num); offset += 1; while(num--){ proto_tree_add_item(tree, hf_rx_ack_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } /* Some implementations add some extra fields. * As far as I can see, these first add 3 padding bytes and then * up to 4 32-bit values. (0,3,4 have been witnessed) * * RX as a protocol seems to be completely undefined and seems to lack * any sort of documentation other than "read the source of any of the * (compatible?) implementations. The OpenAFS source indicates that * 3 bytes of padding are written after the acks. */ if (tvb_reported_length_remaining(tvb, offset)>3) { offset += 3; /* guess. some implementations add 3 bytes */ if (tvb_reported_length_remaining(tvb, offset) >= 4){ proto_tree_add_item(tree, hf_rx_maxmtu, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if (tvb_reported_length_remaining(tvb, offset) >= 4){ proto_tree_add_item(tree, hf_rx_ifmtu, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if (tvb_reported_length_remaining(tvb, offset) >= 4){ proto_tree_add_item(tree, hf_rx_rwind, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if (tvb_reported_length_remaining(tvb, offset) >= 4){ proto_tree_add_item(tree, hf_rx_maxpackets, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } col_add_fstr(pinfo->cinfo, COL_INFO, "ACK %s " "Seq: %lu " "Call: %lu " "Source Port: %s " "Destination Port: %s ", val_to_str(reason, rx_reason, "%d"), (unsigned long)seq, (unsigned long)callnumber, udp_port_to_display(pinfo->pool, pinfo->srcport), udp_port_to_display(pinfo->pool, pinfo->destport) ); proto_item_set_len(item, offset-old_offset); return offset; } static int dissect_rx_flags(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *parent_tree, int offset) { static int * const flags[] = { &hf_rx_flags_free_packet, &hf_rx_flags_more_packets, &hf_rx_flags_last_packet, &hf_rx_flags_request_ack, &hf_rx_flags_clientinit, NULL }; rxinfo->flags = tvb_get_guint8(tvb, offset); proto_tree_add_bitmask(parent_tree, tvb, offset, hf_rx_flags, ett_rx_flags, flags, ENC_NA); offset += 1; return offset; } static int dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { proto_tree *tree; proto_item *item; const char *version_type; int offset = 0; struct rxinfo rxinfo; guint8 type; nstime_t ts; guint32 seq, callnumber; guint16 serviceid; /* Ensure we have enough data */ if (tvb_captured_length(tvb) < 28) return 0; /* Make sure it's a known type */ type = tvb_get_guint8(tvb, 20); if (!try_val_to_str(type, rx_types)) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RX"); col_clear(pinfo->cinfo, COL_INFO); item = proto_tree_add_protocol_format(parent_tree, proto_rx, tvb, offset, 28, "RX Protocol"); tree = proto_item_add_subtree(item, ett_rx); /* epoch : 4 bytes */ rxinfo.epoch = tvb_get_ntohl(tvb, offset); ts.secs = rxinfo.epoch; ts.nsecs = 0; proto_tree_add_time(tree, hf_rx_epoch, tvb, offset, 4, &ts); offset += 4; /* cid : 4 bytes */ rxinfo.cid = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_rx_cid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* callnumber : 4 bytes */ callnumber = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_callnumber, tvb, offset, 4, callnumber); offset += 4; rxinfo.callnumber = callnumber; /* seq : 4 bytes */ seq = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_seq, tvb, offset, 4, seq); offset += 4; rxinfo.seq = seq; /* serial : 4 bytes */ proto_tree_add_item(tree, hf_rx_serial, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* type : 1 byte */ type = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_rx_type, tvb, offset, 1, type); offset += 1; rxinfo.type = type; /* flags : 1 byte */ offset = dissect_rx_flags(tvb, &rxinfo, tree, offset); /* userstatus : 1 byte */ proto_tree_add_item(tree, hf_rx_userstatus, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* sequrityindex : 1 byte */ proto_tree_add_item(tree, hf_rx_securityindex, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* * How clever: even though the AFS header files indicate that the * serviceId is first, it's really encoded _after_ the spare field. * I wasted a day figuring that out! */ /* spare */ proto_tree_add_item(tree, hf_rx_spare, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* service id : 2 bytes */ serviceid = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_rx_serviceid, tvb, offset, 2, serviceid); offset += 2; rxinfo.serviceid = serviceid; switch (type) { case RX_PACKET_TYPE_ACK: /*dissect_rx_acks(tvb, pinfo, parent_tree, offset, can't create it in a parallel tree, then ett search won't work */ dissect_rx_acks(tvb, pinfo, tree, offset, seq, callnumber); break; case RX_PACKET_TYPE_ACKALL: /* does not contain any payload */ col_add_fstr(pinfo->cinfo, COL_INFO, "ACKALL " "Seq: %lu " "Call: %lu " "Source Port: %s " "Destination Port: %s ", (unsigned long)seq, (unsigned long)callnumber, udp_port_to_display(pinfo->pool, pinfo->srcport), udp_port_to_display(pinfo->pool, pinfo->destport) ); break; case RX_PACKET_TYPE_VERSION: /* does not contain any payload */ if (rxinfo.cid == 0) version_type = "NAT ping"; else version_type = "request"; col_add_fstr(pinfo->cinfo, COL_INFO, "VERSION %s " "Seq: %lu " "Call: %lu " "Source Port: %s " "Destination Port: %s ", version_type, (unsigned long)seq, (unsigned long)callnumber, udp_port_to_display(pinfo->pool, pinfo->srcport), udp_port_to_display(pinfo->pool, pinfo->destport) ); break; case RX_PACKET_TYPE_CHALLENGE: dissect_rx_challenge(tvb, pinfo, tree, offset, seq, callnumber); break; case RX_PACKET_TYPE_RESPONSE: dissect_rx_response(tvb, pinfo, tree, offset, seq, callnumber); break; case RX_PACKET_TYPE_DATA: { tvbuff_t *next_tvb; next_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector_with_data(afs_handle, next_tvb, pinfo, parent_tree, &rxinfo); }; break; case RX_PACKET_TYPE_ABORT: dissect_rx_abort(tvb, pinfo, tree, offset, seq, callnumber); break; } return(tvb_captured_length(tvb)); } void proto_register_rx(void) { static hf_register_info hf[] = { { &hf_rx_epoch, { "Epoch", "rx.epoch", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }}, { &hf_rx_cid, { "CID", "rx.cid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_callnumber, { "Call Number", "rx.callnumber", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_seq, { "Sequence Number", "rx.seq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_serial, { "Serial", "rx.serial", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_type, { "Type", "rx.type", FT_UINT8, BASE_DEC, VALS(rx_types), 0, NULL, HFILL }}, { &hf_rx_flags, { "Flags", "rx.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_rx_flags_clientinit, { "Client Initiated", "rx.flags.client_init", FT_BOOLEAN, 8, NULL, RX_CLIENT_INITIATED, NULL, HFILL }}, { &hf_rx_flags_request_ack, { "Request Ack", "rx.flags.request_ack", FT_BOOLEAN, 8, NULL, RX_REQUEST_ACK, NULL, HFILL }}, { &hf_rx_flags_last_packet, { "Last Packet", "rx.flags.last_packet", FT_BOOLEAN, 8, NULL, RX_LAST_PACKET, NULL, HFILL }}, { &hf_rx_flags_more_packets, { "More Packets", "rx.flags.more_packets", FT_BOOLEAN, 8, NULL, RX_MORE_PACKETS, NULL, HFILL }}, { &hf_rx_flags_free_packet, { "Free Packet", "rx.flags.free_packet", FT_BOOLEAN, 8, NULL, RX_FREE_PACKET, NULL, HFILL }}, /* XXX - what about RX_SLOW_START_OR_JUMBO? */ { &hf_rx_userstatus, { "User Status", "rx.userstatus", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_securityindex, { "Security Index", "rx.securityindex", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_spare, { "Spare/Checksum", "rx.spare", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_serviceid, { "Service ID", "rx.serviceid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_bufferspace, { "Bufferspace", "rx.bufferspace", FT_UINT16, BASE_DEC, NULL, 0, "Number Of Packets Available", HFILL }}, { &hf_rx_maxskew, { "Max Skew", "rx.maxskew", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_first_packet, { "First Packet", "rx.first", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_prev_packet, { "Prev Packet", "rx.prev", FT_UINT32, BASE_DEC, NULL, 0, "Previous Packet", HFILL }}, { &hf_rx_reason, { "Reason", "rx.reason", FT_UINT8, BASE_DEC, VALS(rx_reason), 0, "Reason For This ACK", HFILL }}, { &hf_rx_numacks, { "Num ACKs", "rx.num_acks", FT_UINT8, BASE_DEC, NULL, 0, "Number Of ACKs", HFILL }}, { &hf_rx_ack_type, { "ACK Type", "rx.ack_type", FT_UINT8, BASE_DEC, VALS(rx_ack_type), 0, "Type Of ACKs", HFILL }}, { &hf_rx_ack, { "ACK Packet", "rx.ack", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rx_challenge, { "CHALLENGE Packet", "rx.challenge", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rx_version, { "Version", "rx.version", FT_UINT32, BASE_DEC, NULL, 0, "Version Of Challenge/Response", HFILL }}, { &hf_rx_nonce, { "Nonce", "rx.nonce", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_rx_inc_nonce, { "Inc Nonce", "rx.inc_nonce", FT_UINT32, BASE_HEX, NULL, 0, "Incremented Nonce", HFILL }}, { &hf_rx_min_level, { "Min Level", "rx.min_level", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_level, { "Level", "rx.level", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_response, { "RESPONSE Packet", "rx.response", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rx_abort, { "ABORT Packet", "rx.abort", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rx_encrypted, { "Encrypted", "rx.encrypted", FT_NONE, BASE_NONE, NULL, 0, "Encrypted part of response packet", HFILL }}, { &hf_rx_kvno, { "kvno", "rx.kvno", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_ticket_len, { "Ticket len", "rx.ticket_len", FT_UINT32, BASE_DEC, NULL, 0, "Ticket Length", HFILL }}, { &hf_rx_ticket, { "ticket", "rx.ticket", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rx_ifmtu, { "Interface MTU", "rx.if_mtu", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_maxmtu, { "Max MTU", "rx.max_mtu", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_rwind, { "rwind", "rx.rwind", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_maxpackets, { "Max Packets", "rx.max_packets", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rx_abortcode, { "Abort Code", "rx.abort_code", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }}, }; static gint *ett[] = { &ett_rx, &ett_rx_flags, &ett_rx_ack, &ett_rx_challenge, &ett_rx_response, &ett_rx_encrypted, &ett_rx_abort }; proto_rx = proto_register_protocol("RX Protocol", "RX", "rx"); proto_register_field_array(proto_rx, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_rx(void) { dissector_handle_t rx_handle; /* * Get handle for the AFS dissector. */ afs_handle = find_dissector_add_dependency("afs", proto_rx); rx_handle = create_dissector_handle(dissect_rx, proto_rx); dissector_add_uint_range_with_preference("udp.port", UDP_PORT_RX_RANGE, rx_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=yes: */
C/C++
wireshark/epan/dissectors/packet-rx.h
/* packet-rx.h * Definitions for packet disassembly structures and routines * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_RX_H #define PACKET_RX_H /* * Private data passed from the RX dissector to the AFS dissector. */ struct rxinfo { guint8 type; guint8 flags; guint16 serviceid; guint32 epoch; guint32 cid; guint32 callnumber; guint32 seq; }; /* * RX protocol definitions. */ /* * Packet types. */ #define RX_PACKET_TYPE_DATA 1 #define RX_PACKET_TYPE_ACK 2 #define RX_PACKET_TYPE_BUSY 3 #define RX_PACKET_TYPE_ABORT 4 #define RX_PACKET_TYPE_ACKALL 5 #define RX_PACKET_TYPE_CHALLENGE 6 #define RX_PACKET_TYPE_RESPONSE 7 #define RX_PACKET_TYPE_DEBUG 8 #define RX_PACKET_TYPE_PARAMS 9 #define RX_PACKET_TYPE_VERSION 13 /* * Flag bits in the RX header. */ #define RX_CLIENT_INITIATED 1 #define RX_REQUEST_ACK 2 #define RX_LAST_PACKET 4 #define RX_MORE_PACKETS 8 #define RX_FREE_PACKET 16 #define RX_SLOW_START_OR_JUMBO 32 #define RX_ACK_TYPE_NACK 0 #define RX_ACK_TYPE_ACK 1 /* ACK reasons */ #define RX_ACK_REQUESTED 1 #define RX_ACK_DUPLICATE 2 #define RX_ACK_OUT_OF_SEQUENCE 3 #define RX_ACK_EXEEDS_WINDOW 4 #define RX_ACK_NOSPACE 5 #define RX_ACK_PING 6 #define RX_ACK_PING_RESPONSE 7 #define RX_ACK_DELAY 8 #define RX_ACK_IDLE 9 #define RX_MAXCALLS 4 #endif
C
wireshark/epan/dissectors/packet-s101.c
/* packet-S101.c * Routines for S101 dissection * Copyright 2018, Gilles Dufour <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This Dissector will dissect S101 frames used by Lawo Ember Plus protocol. * https://github.com/Lawo/ember-plus/ */ #include <config.h> #include <epan/packet.h> /* Should be first Wireshark include (other than config.h) */ #include <epan/prefs.h> #include <epan/reassemble.h> #include <wsutil/crc16.h> #include <epan/expert.h> #define S101_HEADER_DATA_LENGTH 9 #define S101_BOF 0xFE #define S101_EOF 0xFF #define S101_CE 0xFD #define S101_XOR 0x20 #define S101_INV 0xF8 #define S101_SLOT 0x00 #define S101_MSG_EMBER 0x0E #define S101_CMD_EMBER 0x00 #define S101_CMD_KEEPALIVE_REQ 0x01 #define S101_CMD_KEEPALIVE_RESP 0x02 #define S101_VERSION 0x01 #define FLAG_SINGLE_PACKET 0xC0 #define FLAG_FIRST_MULTI_PACKET 0x80 #define FLAG_LAST_MULTI_PACKET 0x40 #define FLAG_EMPTY_PACKET 0x20 #define FLAG_MULTI_PACKET 0x00 #define S101_DTD_GLOW 0x01 #define S101_DTD_VERSION_MAJOR 0x02 #define S101_DTD_VERSION_MINOR 0x1F #define S101_VALID_CRC 0xF0B8 #define APP_BYTES_LEN 2 static int hf_S101_frame_format = -1; static int hf_S101_length_size = -1; static int hf_S101_message_length = -1; static int hf_S101_slot = -1; static int hf_S101_message_type = -1; static int hf_S101_cmd_type = -1; static int hf_S101_version = -1; static int hf_S101_flags = -1; static int hf_S101_dtd_type = -1; static int hf_S101_app_bytes_len = -1; static int hf_S101_dtd_minor_ver = -1; static int hf_S101_dtd_major_ver = -1; static int hf_S101_crc = -1; static int hf_S101_crc_status = -1; static int hf_S101_eof = -1; static int hf_S101_error = -1; static dissector_handle_t glow_handle = NULL; static reassembly_table s101_data_reassembly_table; typedef struct _s101_fragment_t { guint32 id; int offset; } s101_fragment_t; /* Prototypes */ /* (Required to prevent [-Wmissing-prototypes] warnings */ void proto_reg_handoff_S101(void); void proto_register_S101(void); static tvbuff_t *decode_s101_escaped_buffer(tvbuff_t *tvb, packet_info *pinfo, int *offset, guint16 *crc); static guint32 get_fragment_pdu_id(packet_info *pinfo); static s101_fragment_t* new_fragment_info(packet_info *pinfo); static void display_expert_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int len); /* Initialize the protocol and registered fields */ static int proto_S101 = -1; /* Real port preferences should generally default to 0 unless there is an * IANA-registered (or equivalent) port for your protocol. */ #define S101_TCP_PORT 9000 /* Not IANA-registered */ /* Initialize the subtree pointers */ static gint ett_S101 = -1; static gint ett_decoding_error = -1; #define S101_MIN_LENGTH 5 static int hf_msg_fragments = -1; static int hf_msg_fragment = -1; static int hf_msg_fragment_overlap = -1; static int hf_msg_fragment_overlap_conflicts = -1; static int hf_msg_fragment_multiple_tails = -1; static int hf_msg_fragment_too_long_fragment = -1; static int hf_msg_fragment_error = -1; static int hf_msg_fragment_count = -1; static int hf_msg_reassembled_in = -1; static int hf_msg_reassembled_length = -1; static int hf_msg_reassembled_data = -1; static expert_field ei_s101_failed_reassembly = EI_INIT; static gint ett_msg_fragment = -1; static gint ett_msg_fragments = -1; static const fragment_items msg_frag_items = { /* Fragment subtrees */ &ett_msg_fragment, &ett_msg_fragments, /* Fragment fields */ &hf_msg_fragments, &hf_msg_fragment, &hf_msg_fragment_overlap, &hf_msg_fragment_overlap_conflicts, &hf_msg_fragment_multiple_tails, &hf_msg_fragment_too_long_fragment, &hf_msg_fragment_error, &hf_msg_fragment_count, /* Reassembled in field */ &hf_msg_reassembled_in, /* Reassembled length field */ &hf_msg_reassembled_length, &hf_msg_reassembled_data, /* Tag */ "Message fragments" }; /* Create a unique id to link fragments together. This is a 4 bytes value: | SRCPORT (16) | SRC_ADDRESS (16) | SRC_ADDRESS is last 2 bytes of the src address. */ static guint32 get_fragment_pdu_id(packet_info *pinfo) { guint32 id = pinfo->srcport << 16; const guint8 *data = (const guint8*)pinfo->src.data; if (pinfo->src.len >= 2) { id = id + (((guint32)data[pinfo->src.len - 2]) << 8) + (guint32)data[pinfo->src.len - 1]; } return id; } static wmem_map_t* s101_fragment_info_hash = NULL; static s101_fragment_t* new_fragment_info(packet_info *pinfo) { s101_fragment_t* fi = wmem_new(wmem_file_scope(), s101_fragment_t); if (NULL == fi) { return fi; } fi->id = pinfo->num; fi->offset = 0; return fi; } /* Get 1 byte If byte escaped, get the unescaped value */ static guint8 get_byte(tvbuff_t *tvb, int *offset, guint16 *crc) { guint8 b = tvb_get_guint8(tvb, *offset); *crc = crc16_ccitt_seed(&b, 1, *crc) ^ 0xFFFF; *offset = *offset + 1; if (b == S101_CE) { b = tvb_get_guint8(tvb, *offset); *crc = crc16_ccitt_seed(&b, 1, *crc) ^ 0xFFFF; *offset = *offset + 1; return (b ^ S101_XOR); } else { return b; } } static const value_string frame_format_vs[] = { { S101_BOF , "Escaped Frame" }, { S101_INV , "UnEscaped Frame"}, { 0, NULL} }; static const value_string message_type_vs[] = { { S101_MSG_EMBER , "Ember" }, { 0, NULL} }; static const value_string command_type_vs[] = { { S101_CMD_EMBER , "Ember Command" }, { S101_CMD_KEEPALIVE_REQ , "Keepalive Request" }, { S101_CMD_KEEPALIVE_RESP , "Keepalive Response" }, { 0, NULL} }; static const value_string flags_vs[] = { { FLAG_SINGLE_PACKET , "Single Packet" }, { FLAG_EMPTY_PACKET , "Empty Packet" }, { FLAG_MULTI_PACKET , "Multi Packet" }, { FLAG_LAST_MULTI_PACKET , "Last Packet" }, { FLAG_FIRST_MULTI_PACKET , "First Packet" }, { 0, NULL} }; static const value_string dtd_type_vs[] = { { S101_DTD_GLOW , "DTD Glow" }, { 0, NULL} }; static void display_expert_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int len) { proto_item* pi; proto_tree *error_tree; error_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_decoding_error, &pi, "S101 Error"); pi = proto_tree_add_string_format_value( error_tree, hf_S101_error, tvb, offset, len, "s101_error", "reassembly error"); expert_add_info(pinfo, pi, &ei_s101_failed_reassembly); } /* Check s101 packet header format. If not valid, return 0. If valid, extract all header parameters and return 1. If variant1, set msgLength to zero. We will have to search the end of frame. If variant2, the msgLength contains the msgLength in bytes 0-6 and byte 7 is the number of bytes. */ static int find_s101_packet_header(tvbuff_t *tvb, int* offset, guint8 *start, guint8 *slot, guint8 *message, guint8 *version, guint8 *dtd, guint8 *command, guint8 *flags, guint8* app_bytes, guint64 *msgLength, guint16 *crc) { guint8 app_bytes_len = 0; int i; *start = tvb_get_guint8(tvb, *offset); // no CRC and no escaping on first bytes. *offset = *offset + 1; if (*start == S101_INV) { // Variant 2 of header - unescaped data //Read the frame length app_bytes_len = tvb_get_guint8(tvb, *offset) & 0x7; *offset = *offset + 1; if (app_bytes_len > 1) { *msgLength = tvb_get_bits64 (tvb, *offset, app_bytes_len * 8, ENC_BIG_ENDIAN); *msgLength = *msgLength + (((guint64)app_bytes_len) << 56); *offset = app_bytes_len; } } else if (*start != S101_BOF) { // IF NOT Begining of Frame - variant 1 - escaped data return 0; } else { *msgLength = 0; } *slot = get_byte(tvb, offset, crc); *message = get_byte(tvb, offset, crc); *command = get_byte(tvb, offset, crc); *version = get_byte(tvb, offset, crc); if (*command == S101_CMD_EMBER) { *flags = get_byte(tvb, offset, crc); *dtd = get_byte(tvb, offset, crc); app_bytes_len = get_byte(tvb, offset, crc); } if ((S101_SLOT != *slot) || (S101_MSG_EMBER != *message) || (*command > S101_CMD_KEEPALIVE_RESP) || (S101_VERSION != *version ) || ((*command == S101_CMD_EMBER) && ((*flags & 0xF) || (S101_DTD_GLOW != *dtd) || (APP_BYTES_LEN != app_bytes_len)))) { return 0; } if (*command == S101_CMD_EMBER) { for(i = 0; i < APP_BYTES_LEN; i++) { app_bytes[i] = get_byte(tvb, offset, crc); } } return 1; } static tvbuff_t * decode_s101_escaped_buffer(tvbuff_t *tvb, packet_info *pinfo, int *offset, guint16 *crc) { tvbuff_t *next_tvb; int len; int i; guchar *decoded_buffer; guint8 b; len = tvb_captured_length(tvb); if (len <= 0) { return tvb; } decoded_buffer = (guchar*)wmem_alloc(pinfo->pool, len); if (decoded_buffer == NULL) { return tvb; } for(i = 0; *offset < len; ) { b = tvb_get_guint8(tvb, *offset); *offset = *offset + 1; if (b == S101_CE) { // Escaped Byte b = tvb_get_guint8(tvb, *offset); *offset = *offset + 1; b = (b ^ S101_XOR); decoded_buffer[i++] = b; } else { decoded_buffer[i] = b; if (b == S101_EOF) { // End of Frame // let's remove the CRC and the EOF if (i > 2) { i -= 2; } break; } i++; } *crc = crc16_ccitt_seed(&b, 1, *crc) ^ 0xFFFF; } next_tvb = tvb_new_child_real_data(tvb, decoded_buffer, i, i); add_new_data_source(pinfo, next_tvb, "Decoded Data"); return next_tvb; } /* Code to actually dissect the packets */ static int dissect_S101(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *S101_tree; tvbuff_t *tvb_payload; /* Other misc. local variables. */ int offset = 0; int parsedLen = 0; int len = 0; int current_offset; int datalen = 0; guint16 crc_data; guint64 msgLength = 0; guint16 crc; guint8 start, slot, message, version, dtd, command, flags = 0xFF, app_bytes[APP_BYTES_LEN]; /* Check that the packet is long enough for it to belong to us. */ len = tvb_reported_length(tvb); if (len < S101_MIN_LENGTH) return 0; current_offset = 0; do { offset = current_offset; crc = 0xFFFF; if (0 == find_s101_packet_header(tvb, &offset, &start, &slot, &message, &version, &dtd, &command, &flags, &app_bytes[0], &msgLength, &crc)) { break; } if (0 == current_offset) { /* Set the Protocol column to the constant string of S101 */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "S101"); } /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_S101, tvb, current_offset, -1, ENC_NA); S101_tree = proto_item_add_subtree(ti, ett_S101); proto_tree_add_item(S101_tree, hf_S101_frame_format, tvb, current_offset++, 1, ENC_BIG_ENDIAN); if (msgLength != 0) { // Variant 2, the header contains a frame length int lengthSize = (int)(msgLength >> 56) & 0xF; proto_tree_add_item(S101_tree, hf_S101_length_size, tvb, current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_message_length, tvb, current_offset,lengthSize, ENC_NA); current_offset += lengthSize; } proto_tree_add_item(S101_tree, hf_S101_slot, tvb, current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_message_type, tvb, current_offset++,1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_cmd_type, tvb,current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_version, tvb, current_offset++, 1, ENC_BIG_ENDIAN); if (command == S101_CMD_EMBER) { proto_tree_add_item(S101_tree, hf_S101_flags, tvb, current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_dtd_type, tvb, current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_app_bytes_len, tvb, current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_dtd_minor_ver, tvb, current_offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(S101_tree, hf_S101_dtd_major_ver, tvb, current_offset++, 1, ENC_BIG_ENDIAN); } if (msgLength == 0) { //Variant 1 - data is encoded with escaped bytes. tvb_payload = decode_s101_escaped_buffer(tvb, pinfo, &current_offset, &crc); datalen = tvb_captured_length(tvb_payload); crc_data = tvb_get_ntohs(tvb, current_offset - 3); proto_tree_add_checksum(S101_tree, tvb, current_offset - 3, hf_S101_crc, hf_S101_crc_status, NULL, pinfo, crc == S101_VALID_CRC ? crc_data : crc ^ crc_data, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); proto_tree_add_item(S101_tree, hf_S101_eof, tvb, current_offset - 1, 1, ENC_BIG_ENDIAN); } else { //variant 2. Packet size is provided and no encoding datalen = (int)(msgLength & 0x0FFFFFFF) - S101_HEADER_DATA_LENGTH; tvb_payload = tvb_new_subset_length(tvb, current_offset, datalen); current_offset += datalen; } proto_item_set_len(ti, current_offset - offset); if (command == S101_CMD_EMBER) { if (flags != FLAG_SINGLE_PACKET) { fragment_head *frag_msg = NULL; guint32 id = get_fragment_pdu_id(pinfo); s101_fragment_t* fi = (s101_fragment_t*)wmem_map_lookup(s101_fragment_info_hash, &id); pinfo->fragmented = TRUE; if (flags == FLAG_FIRST_MULTI_PACKET) { if (NULL == fi) { fi = new_fragment_info(pinfo); wmem_map_insert(s101_fragment_info_hash, &id, fi); } else { fi->id = pinfo->num; } fragment_add(&s101_data_reassembly_table, tvb_payload, 0, pinfo, fi->id, NULL, 0, datalen, TRUE); fi->offset = datalen; } else if (flags == FLAG_LAST_MULTI_PACKET) { if (NULL != fi) { // last fragment frag_msg = fragment_add(&s101_data_reassembly_table, tvb_payload, 0, pinfo, fi->id, NULL, fi->offset, datalen, FALSE); tvb_payload = process_reassembled_data(tvb, offset, pinfo, "Reassembled Message", frag_msg, &msg_frag_items, NULL, S101_tree); } if (frag_msg) { /* Reassembled */ col_append_str(pinfo->cinfo, COL_INFO, " (Message Reassembled)"); } else { display_expert_info(S101_tree, tvb, pinfo, offset, current_offset - offset); } } else if (NULL == fi) { display_expert_info(S101_tree, tvb, pinfo, offset, current_offset - offset); } else if (flags == FLAG_MULTI_PACKET) { fragment_add(&s101_data_reassembly_table, tvb_payload, 0, pinfo, fi->id, NULL, fi->offset, datalen, TRUE); fi->offset += datalen; col_append_fstr(pinfo->cinfo, COL_INFO, " (Message fragment)"); } } // Call ASN1 Glow dissector - see epan/dissectors/asn1/glow/ if packet is complete. if ((flags == FLAG_LAST_MULTI_PACKET) && (tvb_payload == NULL)) { proto_item* pi; proto_tree_add_subtree(S101_tree, tvb, offset, current_offset - offset, ett_decoding_error, &pi, "S101 Error"); expert_add_info(pinfo, pi, &ei_s101_failed_reassembly); } else if ((glow_handle != NULL) && ((flags == FLAG_LAST_MULTI_PACKET) || (flags == FLAG_SINGLE_PACKET))) { parsedLen = call_dissector_only(glow_handle, tvb_payload, pinfo, S101_tree, data); if (parsedLen <= 0) { break; } } } }while(current_offset < len); return current_offset; } /* Register the protocol with Wireshark. * * This format is required because a script is used to build the C function that * calls all the protocol registration. */ void proto_register_S101(void) { expert_module_t* expert_s101; /* Setup list of header fields See Section 1.5 of README.dissector for * details. */ static hf_register_info hf[] = { { &hf_S101_frame_format, { "Frame Format", "s101.format", FT_UINT8, BASE_HEX, VALS(frame_format_vs), 0x0, NULL, HFILL }}, { &hf_S101_length_size, { "Bytes for Length", "s101.lensize", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_S101_message_length, { "Message Length", "s101.msglen", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_S101_slot, { "Slot", "s101.slot", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_S101_message_type, { "Message Type", "s101.msgtype", FT_UINT8, BASE_HEX, VALS(message_type_vs), 0x0, NULL, HFILL }}, { &hf_S101_cmd_type, { "Command Type", "s101.cmdtype", FT_UINT8, BASE_HEX, VALS(command_type_vs), 0x0, NULL, HFILL }}, { &hf_S101_version, { "Version", "s101.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_S101_flags, { "Flags", "s101.flags", FT_UINT8, BASE_HEX, VALS(flags_vs), 0x0, NULL, HFILL }}, { &hf_S101_dtd_type, { "DTD Type", "s101.dtdtype", FT_UINT8, BASE_DEC, VALS(dtd_type_vs), 0x0, NULL, HFILL }}, { &hf_S101_app_bytes_len, { "App Bytes Length", "s101.applen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_S101_dtd_minor_ver, { "App Minor Version", "s101.appminver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_S101_dtd_major_ver, { "App Major Version", "s101.appmajver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_S101_crc, { "CRC", "s101.crc", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_S101_crc_status, { "Checksum Status", "s101.crc.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL }}, { &hf_S101_eof, { "End of Frane", "s101.eof", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_S101_error, { "S101 Error", "s101.error", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, // fragments info {&hf_msg_fragments, { "Message fragments", "s101.msg.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment, { "Message fragment", "s101.msg.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment_overlap, { "Message fragment overlap", "s101.msg.fragment.overlap", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment_overlap_conflicts, { "Message fragment overlapping with conflicting data", "s101.msg.fragment.overlap.conflicts", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment_multiple_tails, { "Message has multiple tail fragments", "s101.msg.fragment.multiple_tails", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment_too_long_fragment, { "Message fragment too long", "s101.msg.fragment.too_long_fragment", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment_error, { "Message defragmentation error", "s101.msg.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, {&hf_msg_fragment_count, { "Message fragment count", "s101.msg.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, {&hf_msg_reassembled_in, { "Reassembled in", "s101.msg.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, {&hf_msg_reassembled_length, { "Reassembled length", "s101.msg.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, {&hf_msg_reassembled_data, { "Reassembled Data", "s101.msg.reassembled.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_S101, &ett_msg_fragment, &ett_msg_fragments, &ett_decoding_error }; static ei_register_info ei[] = { { &ei_s101_failed_reassembly, { "s101.reassembly_error", PI_MALFORMED, PI_WARN, "Reassembly Error", EXPFILL }}, }; /* Register the protocol name and description */ proto_S101 = proto_register_protocol("S101", "S101", "s101"); /* Required function calls to register the header fields and subtrees */ proto_register_field_array(proto_S101, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); reassembly_table_register(&s101_data_reassembly_table, &addresses_ports_reassembly_table_functions); s101_fragment_info_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal); /* S101_module = prefs_register_protocol(proto_S101, NULL); */ expert_s101 = expert_register_protocol(proto_S101); expert_register_field_array(expert_s101, ei, array_length(ei)); } void proto_reg_handoff_S101(void) { static dissector_handle_t S101_handle; S101_handle = create_dissector_handle(dissect_S101, proto_S101); glow_handle = find_dissector_add_dependency("glow", proto_S101); dissector_add_uint_with_preference("tcp.port", S101_TCP_PORT, S101_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-s1ap.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-s1ap.c */ /* asn2wrs.py -L -p s1ap -c ./s1ap.cnf -s ./packet-s1ap-template -D . -O ../.. S1AP-CommonDataTypes.asn S1AP-Constants.asn S1AP-Containers.asn S1AP-IEs.asn S1AP-PDU-Contents.asn S1AP-PDU-Descriptions.asn S1AP-SonTransfer-IEs.asn */ /* packet-s1ap.c * Routines for E-UTRAN S1 Application Protocol (S1AP) packet dissection * Copyright 2007-2016, Anders Broman <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * Based on the RANAP dissector * * References: 3GPP TS 36.413 V17.5.0 (2023-06) */ #include "config.h" #include <epan/packet.h> #include <epan/strutil.h> #include <epan/asn1.h> #include <epan/prefs.h> #include <epan/sctpppids.h> #include <epan/expert.h> #include <epan/conversation.h> #include <epan/proto_data.h> #include <epan/exceptions.h> #include <epan/show_exception.h> #include "packet-ber.h" #include "packet-per.h" #include "packet-e212.h" #include "packet-sccp.h" #include "packet-lte-rrc.h" #include "packet-ranap.h" #include "packet-bssgp.h" #include "packet-s1ap.h" #include "packet-a21.h" #include "packet-gsm_map.h" #include "packet-cell_broadcast.h" #include "packet-gsm_a_common.h" #include "packet-ntp.h" #include "packet-ngap.h" #define PNAME "S1 Application Protocol" #define PSNAME "S1AP" #define PFNAME "s1ap" /* Dissector will use SCTP PPID 18 or SCTP port. IANA assigned port = 36412 */ #define SCTP_PORT_S1AP 36412 void proto_register_s1ap(void); void proto_reg_handoff_s1ap(void); static dissector_handle_t gcsna_handle; static dissector_handle_t nas_eps_handle; static dissector_handle_t lppa_handle; static dissector_handle_t bssgp_handle; static dissector_handle_t lte_rrc_ue_radio_access_cap_info_handle; static dissector_handle_t lte_rrc_ue_radio_access_cap_info_nb_handle; static dissector_handle_t nr_rrc_ue_radio_access_cap_info_handle; static dissector_handle_t lte_rrc_ue_radio_paging_info_handle; static dissector_handle_t lte_rrc_ue_radio_paging_info_nb_handle; static dissector_handle_t nr_rrc_ue_radio_paging_info_handle; #define maxPrivateIEs 65535 #define maxProtocolExtensions 65535 #define maxProtocolIEs 65535 #define maxnoofCSGs 256 #define maxnoofE_RABs 256 #define maxnoofTAIs 256 #define maxnoofTACs 256 #define maxnoofErrors 256 #define maxnoofBPLMNs 6 #define maxnoofPLMNsPerMME 32 #define maxnoofEPLMNs 15 #define maxnoofEPLMNsPlusOne 16 #define maxnoofForbLACs 4096 #define maxnoofForbTACs 4096 #define maxnoofIndividualS1ConnectionsToReset 256 #define maxnoofCellsinUEHistoryInfo 16 #define maxnoofCellsineNB 256 #define maxnoofTAIforWarning 65535 #define maxnoofCellID 65535 #define maxnoofDCNs 32 #define maxnoofEmergencyAreaID 65535 #define maxnoofCellinTAI 65535 #define maxnoofCellinEAI 65535 #define maxnoofeNBX2TLAs 2 #define maxnoofeNBX2ExtTLAs 16 #define maxnoofeNBX2GTPTLAs 16 #define maxnoofRATs 8 #define maxnoofGroupIDs 65535 #define maxnoofMMECs 256 #define maxnoofCellIDforMDT 32 #define maxnoofTAforMDT 8 #define maxnoofMDTPLMNs 16 #define maxnoofCellsforRestart 256 #define maxnoofRestartTAIs 2048 #define maxnoofRestartEmergencyAreaIDs 256 #define maxEARFCN 262143 #define maxnoofMBSFNAreaMDT 8 #define maxnoofRecommendedCells 16 #define maxnoofRecommendedENBs 16 #define maxnooftimeperiods 2 #define maxnoofCellIDforQMC 32 #define maxnoofTAforQMC 8 #define maxnoofPLMNforQMC 16 #define maxnoofBluetoothName 4 #define maxnoofWLANName 4 #define maxnoofConnectedengNBs 256 #define maxnoofPC5QoSFlows 2048 #define maxnooffrequencies 64 #define maxNARFCN 3279165 #define maxRS_IndexCellQual 16 #define maxnoofPSCellsPerPrimaryCellinUEHistoryInfo 8 #define maxnoofTACsInNTN 12 #define maxnoofSensorName 3 #define maxnoofIRATReportingCells 128 #define maxnoofcandidateCells 16 #define maxnoofCellineNB 256 typedef enum _ProcedureCode_enum { id_HandoverPreparation = 0, id_HandoverResourceAllocation = 1, id_HandoverNotification = 2, id_PathSwitchRequest = 3, id_HandoverCancel = 4, id_E_RABSetup = 5, id_E_RABModify = 6, id_E_RABRelease = 7, id_E_RABReleaseIndication = 8, id_InitialContextSetup = 9, id_Paging = 10, id_downlinkNASTransport = 11, id_initialUEMessage = 12, id_uplinkNASTransport = 13, id_Reset = 14, id_ErrorIndication = 15, id_NASNonDeliveryIndication = 16, id_S1Setup = 17, id_UEContextReleaseRequest = 18, id_DownlinkS1cdma2000tunnelling = 19, id_UplinkS1cdma2000tunnelling = 20, id_UEContextModification = 21, id_UECapabilityInfoIndication = 22, id_UEContextRelease = 23, id_eNBStatusTransfer = 24, id_MMEStatusTransfer = 25, id_DeactivateTrace = 26, id_TraceStart = 27, id_TraceFailureIndication = 28, id_ENBConfigurationUpdate = 29, id_MMEConfigurationUpdate = 30, id_LocationReportingControl = 31, id_LocationReportingFailureIndication = 32, id_LocationReport = 33, id_OverloadStart = 34, id_OverloadStop = 35, id_WriteReplaceWarning = 36, id_eNBDirectInformationTransfer = 37, id_MMEDirectInformationTransfer = 38, id_PrivateMessage = 39, id_eNBConfigurationTransfer = 40, id_MMEConfigurationTransfer = 41, id_CellTrafficTrace = 42, id_Kill = 43, id_downlinkUEAssociatedLPPaTransport = 44, id_uplinkUEAssociatedLPPaTransport = 45, id_downlinkNonUEAssociatedLPPaTransport = 46, id_uplinkNonUEAssociatedLPPaTransport = 47, id_UERadioCapabilityMatch = 48, id_PWSRestartIndication = 49, id_E_RABModificationIndication = 50, id_PWSFailureIndication = 51, id_RerouteNASRequest = 52, id_UEContextModificationIndication = 53, id_ConnectionEstablishmentIndication = 54, id_UEContextSuspend = 55, id_UEContextResume = 56, id_NASDeliveryIndication = 57, id_RetrieveUEInformation = 58, id_UEInformationTransfer = 59, id_eNBCPRelocationIndication = 60, id_MMECPRelocationIndication = 61, id_SecondaryRATDataUsageReport = 62, id_UERadioCapabilityIDMapping = 63, id_HandoverSuccess = 64, id_eNBEarlyStatusTransfer = 65, id_MMEEarlyStatusTransfer = 66 } ProcedureCode_enum; typedef enum _ProtocolIE_ID_enum { id_MME_UE_S1AP_ID = 0, id_HandoverType = 1, id_Cause = 2, id_SourceID = 3, id_TargetID = 4, id_Unknown_5 = 5, id_Unknown_6 = 6, id_Unknown_7 = 7, id_eNB_UE_S1AP_ID = 8, id_Unknown_9 = 9, id_Unknown_10 = 10, id_Unknown_11 = 11, id_E_RABSubjecttoDataForwardingList = 12, id_E_RABtoReleaseListHOCmd = 13, id_E_RABDataForwardingItem = 14, id_E_RABReleaseItemBearerRelComp = 15, id_E_RABToBeSetupListBearerSUReq = 16, id_E_RABToBeSetupItemBearerSUReq = 17, id_E_RABAdmittedList = 18, id_E_RABFailedToSetupListHOReqAck = 19, id_E_RABAdmittedItem = 20, id_E_RABFailedtoSetupItemHOReqAck = 21, id_E_RABToBeSwitchedDLList = 22, id_E_RABToBeSwitchedDLItem = 23, id_E_RABToBeSetupListCtxtSUReq = 24, id_TraceActivation = 25, id_NAS_PDU = 26, id_E_RABToBeSetupItemHOReq = 27, id_E_RABSetupListBearerSURes = 28, id_E_RABFailedToSetupListBearerSURes = 29, id_E_RABToBeModifiedListBearerModReq = 30, id_E_RABModifyListBearerModRes = 31, id_E_RABFailedToModifyList = 32, id_E_RABToBeReleasedList = 33, id_E_RABFailedToReleaseList = 34, id_E_RABItem = 35, id_E_RABToBeModifiedItemBearerModReq = 36, id_E_RABModifyItemBearerModRes = 37, id_E_RABReleaseItem = 38, id_E_RABSetupItemBearerSURes = 39, id_SecurityContext = 40, id_HandoverRestrictionList = 41, id_Unknown_42 = 42, id_UEPagingID = 43, id_pagingDRX = 44, id_Unknown_45 = 45, id_TAIList = 46, id_TAIItem = 47, id_E_RABFailedToSetupListCtxtSURes = 48, id_E_RABReleaseItemHOCmd = 49, id_E_RABSetupItemCtxtSURes = 50, id_E_RABSetupListCtxtSURes = 51, id_E_RABToBeSetupItemCtxtSUReq = 52, id_E_RABToBeSetupListHOReq = 53, id_Unknown_54 = 54, id_GERANtoLTEHOInformationRes = 55, id_Unknown_56 = 56, id_UTRANtoLTEHOInformationRes = 57, id_CriticalityDiagnostics = 58, id_Global_ENB_ID = 59, id_eNBname = 60, id_MMEname = 61, id_Unknown_62 = 62, id_ServedPLMNs = 63, id_SupportedTAs = 64, id_TimeToWait = 65, id_uEaggregateMaximumBitrate = 66, id_TAI = 67, id_Unknown_68 = 68, id_E_RABReleaseListBearerRelComp = 69, id_cdma2000PDU = 70, id_cdma2000RATType = 71, id_cdma2000SectorID = 72, id_SecurityKey = 73, id_UERadioCapability = 74, id_GUMMEI_ID = 75, id_Unknown_76 = 76, id_Unknown_77 = 77, id_E_RABInformationListItem = 78, id_Direct_Forwarding_Path_Availability = 79, id_UEIdentityIndexValue = 80, id_Unknown_81 = 81, id_Unknown_82 = 82, id_cdma2000HOStatus = 83, id_cdma2000HORequiredIndication = 84, id_Unknown_85 = 85, id_E_UTRAN_Trace_ID = 86, id_RelativeMMECapacity = 87, id_SourceMME_UE_S1AP_ID = 88, id_Bearers_SubjectToStatusTransfer_Item = 89, id_eNB_StatusTransfer_TransparentContainer = 90, id_UE_associatedLogicalS1_ConnectionItem = 91, id_ResetType = 92, id_UE_associatedLogicalS1_ConnectionListResAck = 93, id_E_RABToBeSwitchedULItem = 94, id_E_RABToBeSwitchedULList = 95, id_S_TMSI = 96, id_cdma2000OneXRAND = 97, id_RequestType = 98, id_UE_S1AP_IDs = 99, id_EUTRAN_CGI = 100, id_OverloadResponse = 101, id_cdma2000OneXSRVCCInfo = 102, id_E_RABFailedToBeReleasedList = 103, id_Source_ToTarget_TransparentContainer = 104, id_ServedGUMMEIs = 105, id_SubscriberProfileIDforRFP = 106, id_UESecurityCapabilities = 107, id_CSFallbackIndicator = 108, id_CNDomain = 109, id_E_RABReleasedList = 110, id_MessageIdentifier = 111, id_SerialNumber = 112, id_WarningAreaList = 113, id_RepetitionPeriod = 114, id_NumberofBroadcastRequest = 115, id_WarningType = 116, id_WarningSecurityInfo = 117, id_DataCodingScheme = 118, id_WarningMessageContents = 119, id_BroadcastCompletedAreaList = 120, id_Inter_SystemInformationTransferTypeEDT = 121, id_Inter_SystemInformationTransferTypeMDT = 122, id_Target_ToSource_TransparentContainer = 123, id_SRVCCOperationPossible = 124, id_SRVCCHOIndication = 125, id_NAS_DownlinkCount = 126, id_CSG_Id = 127, id_CSG_IdList = 128, id_SONConfigurationTransferECT = 129, id_SONConfigurationTransferMCT = 130, id_TraceCollectionEntityIPAddress = 131, id_MSClassmark2 = 132, id_MSClassmark3 = 133, id_RRC_Establishment_Cause = 134, id_NASSecurityParametersfromE_UTRAN = 135, id_NASSecurityParameterstoE_UTRAN = 136, id_DefaultPagingDRX = 137, id_Source_ToTarget_TransparentContainer_Secondary = 138, id_Target_ToSource_TransparentContainer_Secondary = 139, id_EUTRANRoundTripDelayEstimationInfo = 140, id_BroadcastCancelledAreaList = 141, id_ConcurrentWarningMessageIndicator = 142, id_Data_Forwarding_Not_Possible = 143, id_ExtendedRepetitionPeriod = 144, id_CellAccessMode = 145, id_CSGMembershipStatus = 146, id_LPPa_PDU = 147, id_Routing_ID = 148, id_Time_Synchronisation_Info = 149, id_PS_ServiceNotAvailable = 150, id_PagingPriority = 151, id_x2TNLConfigurationInfo = 152, id_eNBX2ExtendedTransportLayerAddresses = 153, id_GUMMEIList = 154, id_GW_TransportLayerAddress = 155, id_Correlation_ID = 156, id_SourceMME_GUMMEI = 157, id_MME_UE_S1AP_ID_2 = 158, id_RegisteredLAI = 159, id_RelayNode_Indicator = 160, id_TrafficLoadReductionIndication = 161, id_MDTConfiguration = 162, id_MMERelaySupportIndicator = 163, id_GWContextReleaseIndication = 164, id_ManagementBasedMDTAllowed = 165, id_PrivacyIndicator = 166, id_Time_UE_StayedInCell_EnhancedGranularity = 167, id_HO_Cause = 168, id_VoiceSupportMatchIndicator = 169, id_GUMMEIType = 170, id_M3Configuration = 171, id_M4Configuration = 172, id_M5Configuration = 173, id_MDT_Location_Info = 174, id_MobilityInformation = 175, id_Tunnel_Information_for_BBF = 176, id_ManagementBasedMDTPLMNList = 177, id_SignallingBasedMDTPLMNList = 178, id_ULCOUNTValueExtended = 179, id_DLCOUNTValueExtended = 180, id_ReceiveStatusOfULPDCPSDUsExtended = 181, id_ECGIListForRestart = 182, id_SIPTO_Correlation_ID = 183, id_SIPTO_L_GW_TransportLayerAddress = 184, id_TransportInformation = 185, id_LHN_ID = 186, id_AdditionalCSFallbackIndicator = 187, id_TAIListForRestart = 188, id_UserLocationInformation = 189, id_EmergencyAreaIDListForRestart = 190, id_KillAllWarningMessages = 191, id_Masked_IMEISV = 192, id_eNBIndirectX2TransportLayerAddresses = 193, id_uE_HistoryInformationFromTheUE = 194, id_ProSeAuthorized = 195, id_ExpectedUEBehaviour = 196, id_LoggedMBSFNMDT = 197, id_UERadioCapabilityForPaging = 198, id_E_RABToBeModifiedListBearerModInd = 199, id_E_RABToBeModifiedItemBearerModInd = 200, id_E_RABNotToBeModifiedListBearerModInd = 201, id_E_RABNotToBeModifiedItemBearerModInd = 202, id_E_RABModifyListBearerModConf = 203, id_E_RABModifyItemBearerModConf = 204, id_E_RABFailedToModifyListBearerModConf = 205, id_SON_Information_Report = 206, id_Muting_Availability_Indication = 207, id_Muting_Pattern_Information = 208, id_Synchronisation_Information = 209, id_E_RABToBeReleasedListBearerModConf = 210, id_AssistanceDataForPaging = 211, id_CellIdentifierAndCELevelForCECapableUEs = 212, id_InformationOnRecommendedCellsAndENBsForPaging = 213, id_RecommendedCellItem = 214, id_RecommendedENBItem = 215, id_ProSeUEtoNetworkRelaying = 216, id_ULCOUNTValuePDCP_SNlength18 = 217, id_DLCOUNTValuePDCP_SNlength18 = 218, id_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18 = 219, id_M6Configuration = 220, id_M7Configuration = 221, id_PWSfailedECGIList = 222, id_MME_Group_ID = 223, id_Additional_GUTI = 224, id_S1_Message = 225, id_CSGMembershipInfo = 226, id_Paging_eDRXInformation = 227, id_UE_RetentionInformation = 228, id_Unknown_229 = 229, id_UE_Usage_Type = 230, id_extended_UEIdentityIndexValue = 231, id_RAT_Type = 232, id_BearerType = 233, id_NB_IoT_DefaultPagingDRX = 234, id_E_RABFailedToResumeListResumeReq = 235, id_E_RABFailedToResumeItemResumeReq = 236, id_E_RABFailedToResumeListResumeRes = 237, id_E_RABFailedToResumeItemResumeRes = 238, id_NB_IoT_Paging_eDRXInformation = 239, id_V2XServicesAuthorized = 240, id_UEUserPlaneCIoTSupportIndicator = 241, id_CE_mode_B_SupportIndicator = 242, id_SRVCCOperationNotPossible = 243, id_NB_IoT_UEIdentityIndexValue = 244, id_RRC_Resume_Cause = 245, id_DCN_ID = 246, id_ServedDCNs = 247, id_UESidelinkAggregateMaximumBitrate = 248, id_DLNASPDUDeliveryAckRequest = 249, id_Coverage_Level = 250, id_EnhancedCoverageRestricted = 251, id_UE_Level_QoS_Parameters = 252, id_DL_CP_SecurityInformation = 253, id_UL_CP_SecurityInformation = 254, id_extended_e_RAB_MaximumBitrateDL = 255, id_extended_e_RAB_MaximumBitrateUL = 256, id_extended_e_RAB_GuaranteedBitrateDL = 257, id_extended_e_RAB_GuaranteedBitrateUL = 258, id_extended_uEaggregateMaximumBitRateDL = 259, id_extended_uEaggregateMaximumBitRateUL = 260, id_NRrestrictioninEPSasSecondaryRAT = 261, id_UEAppLayerMeasConfig = 262, id_UE_Application_Layer_Measurement_Capability = 263, id_SecondaryRATDataUsageReportList = 264, id_SecondaryRATDataUsageReportItem = 265, id_HandoverFlag = 266, id_E_RABUsageReportItem = 267, id_SecondaryRATDataUsageRequest = 268, id_NRUESecurityCapabilities = 269, id_UnlicensedSpectrumRestriction = 270, id_CE_ModeBRestricted = 271, id_LTE_M_Indication = 272, id_DownlinkPacketLossRate = 273, id_UplinkPacketLossRate = 274, id_UECapabilityInfoRequest = 275, id_serviceType = 276, id_AerialUEsubscriptionInformation = 277, id_Subscription_Based_UE_DifferentiationInfo = 278, id_Unknown_279 = 279, id_EndIndication = 280, id_EDT_Session = 281, id_CNTypeRestrictions = 282, id_PendingDataIndication = 283, id_BluetoothMeasurementConfiguration = 284, id_WLANMeasurementConfiguration = 285, id_WarningAreaCoordinates = 286, id_NRrestrictionin5GS = 287, id_PSCellInformation = 288, id_Unknown_289 = 289, id_LastNG_RANPLMNIdentity = 290, id_ConnectedengNBList = 291, id_ConnectedengNBToAddList = 292, id_ConnectedengNBToRemoveList = 293, id_EN_DCSONConfigurationTransfer_ECT = 294, id_EN_DCSONConfigurationTransfer_MCT = 295, id_IMSvoiceEPSfallbackfrom5G = 296, id_TimeSinceSecondaryNodeRelease = 297, id_RequestTypeAdditionalInfo = 298, id_AdditionalRRMPriorityIndex = 299, id_ContextatSource = 300, id_IAB_Authorized = 301, id_IAB_Node_Indication = 302, id_IAB_Supported = 303, id_DataSize = 304, id_Ethernet_Type = 305, id_NRV2XServicesAuthorized = 306, id_NRUESidelinkAggregateMaximumBitrate = 307, id_PC5QoSParameters = 308, id_IntersystemSONConfigurationTransferMCT = 309, id_IntersystemSONConfigurationTransferECT = 310, id_IntersystemMeasurementConfiguration = 311, id_SourceNodeID = 312, id_NB_IoT_RLF_Report_Container = 313, id_UERadioCapabilityID = 314, id_UERadioCapability_NR_Format = 315, id_MDTConfigurationNR = 316, id_DAPSRequestInfo = 317, id_DAPSResponseInfoList = 318, id_DAPSResponseInfoItem = 319, id_NotifySourceeNB = 320, id_eNB_EarlyStatusTransfer_TransparentContainer = 321, id_Bearers_SubjectToEarlyStatusTransfer_Item = 322, id_WUS_Assistance_Information = 323, id_NB_IoT_PagingDRX = 324, id_TraceCollectionEntityURI = 325, id_EmergencyIndicator = 326, id_UERadioCapabilityForPaging_NR_Format = 327, id_SourceTransportLayerAddress = 328, id_lastVisitedPSCellList = 329, id_RACSIndication = 330, id_PagingCause = 331, id_SecurityIndication = 332, id_SecurityResult = 333, id_E_RABSecurityResultItem = 334, id_E_RABSecurityResultList = 335, id_RAT_Restrictions = 336, id_UEContextReferenceatSourceeNB = 337, id_Unknown_338 = 338, id_LTE_NTN_TAI_Information = 339, id_SourceNodeTransportLayerAddress = 340, id_E_RABToBeUpdatedList = 341, id_E_RABToBeUpdatedItem = 342, id_SourceSNID = 343, id_LoggedMDTTrigger = 344, id_SensorMeasurementConfiguration = 345 } ProtocolIE_ID_enum; typedef enum _HandoverType_enum { intralte = 0, ltetoutran = 1, ltetogeran = 2, utrantolte = 3, gerantolte = 4, eps_to_5gs = 5, fivegs_to_eps = 6 } HandoverType_enum; typedef enum _RAT_Type_enum { nbiot = 0, nbiot_leo = 1, nbiot_meo = 2, nbiot_geo = 3, nbiot_othersat = 4, eutran_leo = 5, eutran_meo = 6, eutran_geo = 7, eutran_othersat = 8 } RAT_Type_enum; typedef enum _SRVCCHOIndication_enum { pSandCS = 0, cSonly = 1 } SRVCCHOIndication_enum; /* Initialize the protocol and registered fields */ static int proto_s1ap = -1; static int hf_s1ap_transportLayerAddressIPv4 = -1; static int hf_s1ap_transportLayerAddressIPv6 = -1; static int hf_s1ap_E_UTRAN_Trace_ID_TraceID = -1; static int hf_s1ap_E_UTRAN_Trace_ID_TraceRecordingSessionReference = -1; static int hf_s1ap_interfacesToTrace_S1_MME = -1; static int hf_s1ap_interfacesToTrace_X2 = -1; static int hf_s1ap_interfacesToTrace_Uu = -1; static int hf_s1ap_interfacesToTrace_F1_C = -1; static int hf_s1ap_interfacesToTrace_E1 = -1; static int hf_s1ap_interfacesToTrace_Reserved = -1; static int hf_s1ap_encryptionAlgorithms_EEA1 = -1; static int hf_s1ap_encryptionAlgorithms_EEA2 = -1; static int hf_s1ap_encryptionAlgorithms_EEA3 = -1; static int hf_s1ap_encryptionAlgorithms_Reserved = -1; static int hf_s1ap_integrityProtectionAlgorithms_EIA1 = -1; static int hf_s1ap_integrityProtectionAlgorithms_EIA2 = -1; static int hf_s1ap_integrityProtectionAlgorithms_EIA3 = -1; static int hf_s1ap_integrityProtectionAlgorithms_Reserved = -1; static int hf_s1ap_SerialNumber_gs = -1; static int hf_s1ap_SerialNumber_msg_code = -1; static int hf_s1ap_SerialNumber_upd_nb = -1; static int hf_s1ap_WarningType_value = -1; static int hf_s1ap_WarningType_emergency_user_alert = -1; static int hf_s1ap_WarningType_popup = -1; static int hf_s1ap_WarningMessageContents_nb_pages = -1; static int hf_s1ap_WarningMessageContents_decoded_page = -1; static int hf_s1ap_measurementsToActivate_M1 = -1; static int hf_s1ap_measurementsToActivate_M2 = -1; static int hf_s1ap_measurementsToActivate_M3 = -1; static int hf_s1ap_measurementsToActivate_M4 = -1; static int hf_s1ap_measurementsToActivate_M5 = -1; static int hf_s1ap_measurementsToActivate_LoggingM1FromEventTriggered = -1; static int hf_s1ap_measurementsToActivate_M6 = -1; static int hf_s1ap_measurementsToActivate_M7 = -1; static int hf_s1ap_MDT_Location_Info_GNSS = -1; static int hf_s1ap_MDT_Location_Info_E_CID = -1; static int hf_s1ap_MDT_Location_Info_Reserved = -1; static int hf_s1ap_NRencryptionAlgorithms_NEA1 = -1; static int hf_s1ap_NRencryptionAlgorithms_NEA2 = -1; static int hf_s1ap_NRencryptionAlgorithms_NEA3 = -1; static int hf_s1ap_NRencryptionAlgorithms_Reserved = -1; static int hf_s1ap_NRintegrityProtectionAlgorithms_NIA1 = -1; static int hf_s1ap_NRintegrityProtectionAlgorithms_NIA2 = -1; static int hf_s1ap_NRintegrityProtectionAlgorithms_NIA3 = -1; static int hf_s1ap_NRintegrityProtectionAlgorithms_Reserved = -1; static int hf_s1ap_UE_Application_Layer_Measurement_Capability_QoE_Measurement_for_streaming_service = -1; static int hf_s1ap_UE_Application_Layer_Measurement_Capability_QoE_Measurement_for_MTSI_service = -1; static int hf_s1ap_UE_Application_Layer_Measurement_Capability_Reserved = -1; static int hf_s1ap_rAT_RestrictionInformation_LEO = -1; static int hf_s1ap_rAT_RestrictionInformation_MEO = -1; static int hf_s1ap_rAT_RestrictionInformation_GEO = -1; static int hf_s1ap_rAT_RestrictionInformation_OTHERSAT = -1; static int hf_s1ap_rAT_RestrictionInformation_Reserved = -1; static int hf_s1ap_Additional_GUTI_PDU = -1; /* Additional_GUTI */ static int hf_s1ap_AdditionalRRMPriorityIndex_PDU = -1; /* AdditionalRRMPriorityIndex */ static int hf_s1ap_AerialUEsubscriptionInformation_PDU = -1; /* AerialUEsubscriptionInformation */ static int hf_s1ap_AssistanceDataForPaging_PDU = -1; /* AssistanceDataForPaging */ static int hf_s1ap_Bearers_SubjectToStatusTransfer_Item_PDU = -1; /* Bearers_SubjectToStatusTransfer_Item */ static int hf_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item_PDU = -1; /* Bearers_SubjectToEarlyStatusTransfer_Item */ static int hf_s1ap_BearerType_PDU = -1; /* BearerType */ static int hf_s1ap_BluetoothMeasurementConfiguration_PDU = -1; /* BluetoothMeasurementConfiguration */ static int hf_s1ap_BroadcastCancelledAreaList_PDU = -1; /* BroadcastCancelledAreaList */ static int hf_s1ap_BroadcastCompletedAreaList_PDU = -1; /* BroadcastCompletedAreaList */ static int hf_s1ap_Cause_PDU = -1; /* Cause */ static int hf_s1ap_CellAccessMode_PDU = -1; /* CellAccessMode */ static int hf_s1ap_CellIdentifierAndCELevelForCECapableUEs_PDU = -1; /* CellIdentifierAndCELevelForCECapableUEs */ static int hf_s1ap_CE_mode_B_SupportIndicator_PDU = -1; /* CE_mode_B_SupportIndicator */ static int hf_s1ap_Cdma2000PDU_PDU = -1; /* Cdma2000PDU */ static int hf_s1ap_Cdma2000RATType_PDU = -1; /* Cdma2000RATType */ static int hf_s1ap_Cdma2000SectorID_PDU = -1; /* Cdma2000SectorID */ static int hf_s1ap_Cdma2000HOStatus_PDU = -1; /* Cdma2000HOStatus */ static int hf_s1ap_Cdma2000HORequiredIndication_PDU = -1; /* Cdma2000HORequiredIndication */ static int hf_s1ap_Cdma2000OneXSRVCCInfo_PDU = -1; /* Cdma2000OneXSRVCCInfo */ static int hf_s1ap_Cdma2000OneXRAND_PDU = -1; /* Cdma2000OneXRAND */ static int hf_s1ap_CNDomain_PDU = -1; /* CNDomain */ static int hf_s1ap_CNTypeRestrictions_PDU = -1; /* CNTypeRestrictions */ static int hf_s1ap_ConcurrentWarningMessageIndicator_PDU = -1; /* ConcurrentWarningMessageIndicator */ static int hf_s1ap_ConnectedengNBList_PDU = -1; /* ConnectedengNBList */ static int hf_s1ap_ContextatSource_PDU = -1; /* ContextatSource */ static int hf_s1ap_Correlation_ID_PDU = -1; /* Correlation_ID */ static int hf_s1ap_CSFallbackIndicator_PDU = -1; /* CSFallbackIndicator */ static int hf_s1ap_AdditionalCSFallbackIndicator_PDU = -1; /* AdditionalCSFallbackIndicator */ static int hf_s1ap_CSG_Id_PDU = -1; /* CSG_Id */ static int hf_s1ap_CSG_IdList_PDU = -1; /* CSG_IdList */ static int hf_s1ap_CSGMembershipStatus_PDU = -1; /* CSGMembershipStatus */ static int hf_s1ap_COUNTValueExtended_PDU = -1; /* COUNTValueExtended */ static int hf_s1ap_COUNTvaluePDCP_SNlength18_PDU = -1; /* COUNTvaluePDCP_SNlength18 */ static int hf_s1ap_Coverage_Level_PDU = -1; /* Coverage_Level */ static int hf_s1ap_CriticalityDiagnostics_PDU = -1; /* CriticalityDiagnostics */ static int hf_s1ap_DAPSRequestInfo_PDU = -1; /* DAPSRequestInfo */ static int hf_s1ap_DAPSResponseInfoList_PDU = -1; /* DAPSResponseInfoList */ static int hf_s1ap_DAPSResponseInfoItem_PDU = -1; /* DAPSResponseInfoItem */ static int hf_s1ap_DataCodingScheme_PDU = -1; /* DataCodingScheme */ static int hf_s1ap_DataSize_PDU = -1; /* DataSize */ static int hf_s1ap_DCN_ID_PDU = -1; /* DCN_ID */ static int hf_s1ap_ServedDCNs_PDU = -1; /* ServedDCNs */ static int hf_s1ap_DL_CP_SecurityInformation_PDU = -1; /* DL_CP_SecurityInformation */ static int hf_s1ap_Direct_Forwarding_Path_Availability_PDU = -1; /* Direct_Forwarding_Path_Availability */ static int hf_s1ap_Data_Forwarding_Not_Possible_PDU = -1; /* Data_Forwarding_Not_Possible */ static int hf_s1ap_DLNASPDUDeliveryAckRequest_PDU = -1; /* DLNASPDUDeliveryAckRequest */ static int hf_s1ap_PWSfailedECGIList_PDU = -1; /* PWSfailedECGIList */ static int hf_s1ap_EDT_Session_PDU = -1; /* EDT_Session */ static int hf_s1ap_EmergencyAreaIDListForRestart_PDU = -1; /* EmergencyAreaIDListForRestart */ static int hf_s1ap_EmergencyIndicator_PDU = -1; /* EmergencyIndicator */ static int hf_s1ap_ENB_EarlyStatusTransfer_TransparentContainer_PDU = -1; /* ENB_EarlyStatusTransfer_TransparentContainer */ static int hf_s1ap_s1ap_Global_ENB_ID_PDU = -1; /* Global_ENB_ID */ static int hf_s1ap_GUMMEIList_PDU = -1; /* GUMMEIList */ static int hf_s1ap_s1ap_ENB_StatusTransfer_TransparentContainer_PDU = -1; /* ENB_StatusTransfer_TransparentContainer */ static int hf_s1ap_ENB_UE_S1AP_ID_PDU = -1; /* ENB_UE_S1AP_ID */ static int hf_s1ap_ENBname_PDU = -1; /* ENBname */ static int hf_s1ap_s1ap_EN_DCSONConfigurationTransfer_PDU = -1; /* EN_DCSONConfigurationTransfer */ static int hf_s1ap_EndIndication_PDU = -1; /* EndIndication */ static int hf_s1ap_EnhancedCoverageRestricted_PDU = -1; /* EnhancedCoverageRestricted */ static int hf_s1ap_CE_ModeBRestricted_PDU = -1; /* CE_ModeBRestricted */ static int hf_s1ap_E_RABInformationListItem_PDU = -1; /* E_RABInformationListItem */ static int hf_s1ap_E_RABList_PDU = -1; /* E_RABList */ static int hf_s1ap_E_RABItem_PDU = -1; /* E_RABItem */ static int hf_s1ap_E_RABLevelQoSParameters_PDU = -1; /* E_RABLevelQoSParameters */ static int hf_s1ap_E_RABSecurityResultList_PDU = -1; /* E_RABSecurityResultList */ static int hf_s1ap_E_RABSecurityResultItem_PDU = -1; /* E_RABSecurityResultItem */ static int hf_s1ap_E_RABUsageReportItem_PDU = -1; /* E_RABUsageReportItem */ static int hf_s1ap_Ethernet_Type_PDU = -1; /* Ethernet_Type */ static int hf_s1ap_s1ap_EUTRAN_CGI_PDU = -1; /* EUTRAN_CGI */ static int hf_s1ap_EUTRANRoundTripDelayEstimationInfo_PDU = -1; /* EUTRANRoundTripDelayEstimationInfo */ static int hf_s1ap_ExpectedUEBehaviour_PDU = -1; /* ExpectedUEBehaviour */ static int hf_s1ap_ExtendedBitRate_PDU = -1; /* ExtendedBitRate */ static int hf_s1ap_ExtendedRepetitionPeriod_PDU = -1; /* ExtendedRepetitionPeriod */ static int hf_s1ap_Extended_UEIdentityIndexValue_PDU = -1; /* Extended_UEIdentityIndexValue */ static int hf_s1ap_GUMMEI_PDU = -1; /* GUMMEI */ static int hf_s1ap_GUMMEIType_PDU = -1; /* GUMMEIType */ static int hf_s1ap_GWContextReleaseIndication_PDU = -1; /* GWContextReleaseIndication */ static int hf_s1ap_HandoverFlag_PDU = -1; /* HandoverFlag */ static int hf_s1ap_s1ap_HandoverRestrictionList_PDU = -1; /* HandoverRestrictionList */ static int hf_s1ap_HandoverType_PDU = -1; /* HandoverType */ static int hf_s1ap_Masked_IMEISV_PDU = -1; /* Masked_IMEISV */ static int hf_s1ap_InformationOnRecommendedCellsAndENBsForPaging_PDU = -1; /* InformationOnRecommendedCellsAndENBsForPaging */ static int hf_s1ap_IntersystemMeasurementConfiguration_PDU = -1; /* IntersystemMeasurementConfiguration */ static int hf_s1ap_s1ap_IntersystemSONConfigurationTransfer_PDU = -1; /* IntersystemSONConfigurationTransfer */ static int hf_s1ap_IMSvoiceEPSfallbackfrom5G_PDU = -1; /* IMSvoiceEPSfallbackfrom5G */ static int hf_s1ap_IAB_Authorized_PDU = -1; /* IAB_Authorized */ static int hf_s1ap_IAB_Node_Indication_PDU = -1; /* IAB_Node_Indication */ static int hf_s1ap_IAB_Supported_PDU = -1; /* IAB_Supported */ static int hf_s1ap_KillAllWarningMessages_PDU = -1; /* KillAllWarningMessages */ static int hf_s1ap_LAI_PDU = -1; /* LAI */ static int hf_s1ap_s1ap_LastVisitedEUTRANCellInformation_PDU = -1; /* LastVisitedEUTRANCellInformation */ static int hf_s1ap_LastVisitedPSCellList_PDU = -1; /* LastVisitedPSCellList */ static int hf_s1ap_s1ap_LastVisitedGERANCellInformation_PDU = -1; /* LastVisitedGERANCellInformation */ static int hf_s1ap_LPPa_PDU_PDU = -1; /* LPPa_PDU */ static int hf_s1ap_LHN_ID_PDU = -1; /* LHN_ID */ static int hf_s1ap_LoggedMBSFNMDT_PDU = -1; /* LoggedMBSFNMDT */ static int hf_s1ap_LoggedMDTTrigger_PDU = -1; /* LoggedMDTTrigger */ static int hf_s1ap_LTE_M_Indication_PDU = -1; /* LTE_M_Indication */ static int hf_s1ap_LTE_NTN_TAI_Information_PDU = -1; /* LTE_NTN_TAI_Information */ static int hf_s1ap_M3Configuration_PDU = -1; /* M3Configuration */ static int hf_s1ap_M4Configuration_PDU = -1; /* M4Configuration */ static int hf_s1ap_M5Configuration_PDU = -1; /* M5Configuration */ static int hf_s1ap_M6Configuration_PDU = -1; /* M6Configuration */ static int hf_s1ap_M7Configuration_PDU = -1; /* M7Configuration */ static int hf_s1ap_MDT_Location_Info_PDU = -1; /* MDT_Location_Info */ static int hf_s1ap_MDT_Configuration_PDU = -1; /* MDT_Configuration */ static int hf_s1ap_ManagementBasedMDTAllowed_PDU = -1; /* ManagementBasedMDTAllowed */ static int hf_s1ap_MDTPLMNList_PDU = -1; /* MDTPLMNList */ static int hf_s1ap_PrivacyIndicator_PDU = -1; /* PrivacyIndicator */ static int hf_s1ap_s1ap_MDTMode_PDU = -1; /* MDTMode */ static int hf_s1ap_MessageIdentifier_PDU = -1; /* MessageIdentifier */ static int hf_s1ap_MobilityInformation_PDU = -1; /* MobilityInformation */ static int hf_s1ap_MMEname_PDU = -1; /* MMEname */ static int hf_s1ap_MMERelaySupportIndicator_PDU = -1; /* MMERelaySupportIndicator */ static int hf_s1ap_MME_Group_ID_PDU = -1; /* MME_Group_ID */ static int hf_s1ap_MME_UE_S1AP_ID_PDU = -1; /* MME_UE_S1AP_ID */ static int hf_s1ap_MSClassmark2_PDU = -1; /* MSClassmark2 */ static int hf_s1ap_MSClassmark3_PDU = -1; /* MSClassmark3 */ static int hf_s1ap_MutingAvailabilityIndication_PDU = -1; /* MutingAvailabilityIndication */ static int hf_s1ap_MutingPatternInformation_PDU = -1; /* MutingPatternInformation */ static int hf_s1ap_MDT_ConfigurationNR_PDU = -1; /* MDT_ConfigurationNR */ static int hf_s1ap_NAS_PDU_PDU = -1; /* NAS_PDU */ static int hf_s1ap_NASSecurityParametersfromE_UTRAN_PDU = -1; /* NASSecurityParametersfromE_UTRAN */ static int hf_s1ap_NASSecurityParameterstoE_UTRAN_PDU = -1; /* NASSecurityParameterstoE_UTRAN */ static int hf_s1ap_NB_IoT_DefaultPagingDRX_PDU = -1; /* NB_IoT_DefaultPagingDRX */ static int hf_s1ap_NB_IoT_PagingDRX_PDU = -1; /* NB_IoT_PagingDRX */ static int hf_s1ap_NB_IoT_Paging_eDRXInformation_PDU = -1; /* NB_IoT_Paging_eDRXInformation */ static int hf_s1ap_NB_IoT_RLF_Report_Container_PDU = -1; /* NB_IoT_RLF_Report_Container */ static int hf_s1ap_NB_IoT_UEIdentityIndexValue_PDU = -1; /* NB_IoT_UEIdentityIndexValue */ static int hf_s1ap_NotifySourceeNB_PDU = -1; /* NotifySourceeNB */ static int hf_s1ap_NRrestrictioninEPSasSecondaryRAT_PDU = -1; /* NRrestrictioninEPSasSecondaryRAT */ static int hf_s1ap_NRrestrictionin5GS_PDU = -1; /* NRrestrictionin5GS */ static int hf_s1ap_NRUESecurityCapabilities_PDU = -1; /* NRUESecurityCapabilities */ static int hf_s1ap_NumberofBroadcastRequest_PDU = -1; /* NumberofBroadcastRequest */ static int hf_s1ap_NRV2XServicesAuthorized_PDU = -1; /* NRV2XServicesAuthorized */ static int hf_s1ap_NRUESidelinkAggregateMaximumBitrate_PDU = -1; /* NRUESidelinkAggregateMaximumBitrate */ static int hf_s1ap_OverloadResponse_PDU = -1; /* OverloadResponse */ static int hf_s1ap_Packet_LossRate_PDU = -1; /* Packet_LossRate */ static int hf_s1ap_Paging_eDRXInformation_PDU = -1; /* Paging_eDRXInformation */ static int hf_s1ap_PagingDRX_PDU = -1; /* PagingDRX */ static int hf_s1ap_PagingPriority_PDU = -1; /* PagingPriority */ static int hf_s1ap_PagingCause_PDU = -1; /* PagingCause */ static int hf_s1ap_PC5QoSParameters_PDU = -1; /* PC5QoSParameters */ static int hf_s1ap_PendingDataIndication_PDU = -1; /* PendingDataIndication */ static int hf_s1ap_PLMNidentity_PDU = -1; /* PLMNidentity */ static int hf_s1ap_ProSeAuthorized_PDU = -1; /* ProSeAuthorized */ static int hf_s1ap_ProSeUEtoNetworkRelaying_PDU = -1; /* ProSeUEtoNetworkRelaying */ static int hf_s1ap_PS_ServiceNotAvailable_PDU = -1; /* PS_ServiceNotAvailable */ static int hf_s1ap_s1ap_PSCellInformation_PDU = -1; /* PSCellInformation */ static int hf_s1ap_RACSIndication_PDU = -1; /* RACSIndication */ static int hf_s1ap_ReceiveStatusOfULPDCPSDUsExtended_PDU = -1; /* ReceiveStatusOfULPDCPSDUsExtended */ static int hf_s1ap_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18_PDU = -1; /* ReceiveStatusOfULPDCPSDUsPDCP_SNlength18 */ static int hf_s1ap_RecommendedCellItem_PDU = -1; /* RecommendedCellItem */ static int hf_s1ap_RecommendedENBItem_PDU = -1; /* RecommendedENBItem */ static int hf_s1ap_RelativeMMECapacity_PDU = -1; /* RelativeMMECapacity */ static int hf_s1ap_RelayNode_Indicator_PDU = -1; /* RelayNode_Indicator */ static int hf_s1ap_RAT_Restrictions_PDU = -1; /* RAT_Restrictions */ static int hf_s1ap_RAT_Type_PDU = -1; /* RAT_Type */ static int hf_s1ap_RequestType_PDU = -1; /* RequestType */ static int hf_s1ap_RequestTypeAdditionalInfo_PDU = -1; /* RequestTypeAdditionalInfo */ static int hf_s1ap_RepetitionPeriod_PDU = -1; /* RepetitionPeriod */ static int hf_s1ap_RRC_Establishment_Cause_PDU = -1; /* RRC_Establishment_Cause */ static int hf_s1ap_ECGIListForRestart_PDU = -1; /* ECGIListForRestart */ static int hf_s1ap_Routing_ID_PDU = -1; /* Routing_ID */ static int hf_s1ap_SecurityKey_PDU = -1; /* SecurityKey */ static int hf_s1ap_SecurityContext_PDU = -1; /* SecurityContext */ static int hf_s1ap_SecondaryRATDataUsageRequest_PDU = -1; /* SecondaryRATDataUsageRequest */ static int hf_s1ap_SecondaryRATDataUsageReportList_PDU = -1; /* SecondaryRATDataUsageReportList */ static int hf_s1ap_SecondaryRATDataUsageReportItem_PDU = -1; /* SecondaryRATDataUsageReportItem */ static int hf_s1ap_SecurityIndication_PDU = -1; /* SecurityIndication */ static int hf_s1ap_SensorMeasurementConfiguration_PDU = -1; /* SensorMeasurementConfiguration */ static int hf_s1ap_SerialNumber_PDU = -1; /* SerialNumber */ static int hf_s1ap_ServiceType_PDU = -1; /* ServiceType */ static int hf_s1ap_SONInformationReport_PDU = -1; /* SONInformationReport */ static int hf_s1ap_s1ap_SONConfigurationTransfer_PDU = -1; /* SONConfigurationTransfer */ static int hf_s1ap_SynchronisationInformation_PDU = -1; /* SynchronisationInformation */ static int hf_s1ap_Source_ToTarget_TransparentContainer_PDU = -1; /* Source_ToTarget_TransparentContainer */ static int hf_s1ap_SRVCCOperationNotPossible_PDU = -1; /* SRVCCOperationNotPossible */ static int hf_s1ap_SRVCCOperationPossible_PDU = -1; /* SRVCCOperationPossible */ static int hf_s1ap_SRVCCHOIndication_PDU = -1; /* SRVCCHOIndication */ static int hf_s1ap_SourceNodeID_PDU = -1; /* SourceNodeID */ static int hf_s1ap_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU = -1; /* SourceeNB_ToTargeteNB_TransparentContainer */ static int hf_s1ap_ServedGUMMEIs_PDU = -1; /* ServedGUMMEIs */ static int hf_s1ap_ServedPLMNs_PDU = -1; /* ServedPLMNs */ static int hf_s1ap_SubscriberProfileIDforRFP_PDU = -1; /* SubscriberProfileIDforRFP */ static int hf_s1ap_Subscription_Based_UE_DifferentiationInfo_PDU = -1; /* Subscription_Based_UE_DifferentiationInfo */ static int hf_s1ap_SupportedTAs_PDU = -1; /* SupportedTAs */ static int hf_s1ap_TimeSynchronisationInfo_PDU = -1; /* TimeSynchronisationInfo */ static int hf_s1ap_S_TMSI_PDU = -1; /* S_TMSI */ static int hf_s1ap_TAI_PDU = -1; /* TAI */ static int hf_s1ap_TargetID_PDU = -1; /* TargetID */ static int hf_s1ap_Global_RAN_NODE_ID_PDU = -1; /* Global_RAN_NODE_ID */ static int hf_s1ap_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU = -1; /* TargeteNB_ToSourceeNB_TransparentContainer */ static int hf_s1ap_Target_ToSource_TransparentContainer_PDU = -1; /* Target_ToSource_TransparentContainer */ static int hf_s1ap_TimeToWait_PDU = -1; /* TimeToWait */ static int hf_s1ap_Time_UE_StayedInCell_EnhancedGranularity_PDU = -1; /* Time_UE_StayedInCell_EnhancedGranularity */ static int hf_s1ap_TimeSinceSecondaryNodeRelease_PDU = -1; /* TimeSinceSecondaryNodeRelease */ static int hf_s1ap_TransportInformation_PDU = -1; /* TransportInformation */ static int hf_s1ap_TransportLayerAddress_PDU = -1; /* TransportLayerAddress */ static int hf_s1ap_TraceActivation_PDU = -1; /* TraceActivation */ static int hf_s1ap_E_UTRAN_Trace_ID_PDU = -1; /* E_UTRAN_Trace_ID */ static int hf_s1ap_TrafficLoadReductionIndication_PDU = -1; /* TrafficLoadReductionIndication */ static int hf_s1ap_TunnelInformation_PDU = -1; /* TunnelInformation */ static int hf_s1ap_TAIListForRestart_PDU = -1; /* TAIListForRestart */ static int hf_s1ap_UEAggregateMaximumBitrate_PDU = -1; /* UEAggregateMaximumBitrate */ static int hf_s1ap_UEAppLayerMeasConfig_PDU = -1; /* UEAppLayerMeasConfig */ static int hf_s1ap_UECapabilityInfoRequest_PDU = -1; /* UECapabilityInfoRequest */ static int hf_s1ap_UE_RetentionInformation_PDU = -1; /* UE_RetentionInformation */ static int hf_s1ap_UE_S1AP_IDs_PDU = -1; /* UE_S1AP_IDs */ static int hf_s1ap_UE_associatedLogicalS1_ConnectionItem_PDU = -1; /* UE_associatedLogicalS1_ConnectionItem */ static int hf_s1ap_UEIdentityIndexValue_PDU = -1; /* UEIdentityIndexValue */ static int hf_s1ap_s1ap_UE_HistoryInformation_PDU = -1; /* UE_HistoryInformation */ static int hf_s1ap_UE_HistoryInformationFromTheUE_PDU = -1; /* UE_HistoryInformationFromTheUE */ static int hf_s1ap_UEPagingID_PDU = -1; /* UEPagingID */ static int hf_s1ap_UERadioCapability_PDU = -1; /* UERadioCapability */ static int hf_s1ap_UERadioCapabilityForPaging_PDU = -1; /* UERadioCapabilityForPaging */ static int hf_s1ap_UERadioCapabilityID_PDU = -1; /* UERadioCapabilityID */ static int hf_s1ap_UESecurityCapabilities_PDU = -1; /* UESecurityCapabilities */ static int hf_s1ap_UESidelinkAggregateMaximumBitrate_PDU = -1; /* UESidelinkAggregateMaximumBitrate */ static int hf_s1ap_UE_Usage_Type_PDU = -1; /* UE_Usage_Type */ static int hf_s1ap_UL_CP_SecurityInformation_PDU = -1; /* UL_CP_SecurityInformation */ static int hf_s1ap_UnlicensedSpectrumRestriction_PDU = -1; /* UnlicensedSpectrumRestriction */ static int hf_s1ap_URI_Address_PDU = -1; /* URI_Address */ static int hf_s1ap_UserLocationInformation_PDU = -1; /* UserLocationInformation */ static int hf_s1ap_UEUserPlaneCIoTSupportIndicator_PDU = -1; /* UEUserPlaneCIoTSupportIndicator */ static int hf_s1ap_UE_Application_Layer_Measurement_Capability_PDU = -1; /* UE_Application_Layer_Measurement_Capability */ static int hf_s1ap_VoiceSupportMatchIndicator_PDU = -1; /* VoiceSupportMatchIndicator */ static int hf_s1ap_V2XServicesAuthorized_PDU = -1; /* V2XServicesAuthorized */ static int hf_s1ap_WarningAreaCoordinates_PDU = -1; /* WarningAreaCoordinates */ static int hf_s1ap_WarningAreaList_PDU = -1; /* WarningAreaList */ static int hf_s1ap_WarningType_PDU = -1; /* WarningType */ static int hf_s1ap_WarningSecurityInfo_PDU = -1; /* WarningSecurityInfo */ static int hf_s1ap_WarningMessageContents_PDU = -1; /* WarningMessageContents */ static int hf_s1ap_WLANMeasurementConfiguration_PDU = -1; /* WLANMeasurementConfiguration */ static int hf_s1ap_WUS_Assistance_Information_PDU = -1; /* WUS_Assistance_Information */ static int hf_s1ap_X2TNLConfigurationInfo_PDU = -1; /* X2TNLConfigurationInfo */ static int hf_s1ap_ENBX2ExtTLAs_PDU = -1; /* ENBX2ExtTLAs */ static int hf_s1ap_ENBIndirectX2TransportLayerAddresses_PDU = -1; /* ENBIndirectX2TransportLayerAddresses */ static int hf_s1ap_HandoverRequired_PDU = -1; /* HandoverRequired */ static int hf_s1ap_HandoverCommand_PDU = -1; /* HandoverCommand */ static int hf_s1ap_E_RABSubjecttoDataForwardingList_PDU = -1; /* E_RABSubjecttoDataForwardingList */ static int hf_s1ap_E_RABDataForwardingItem_PDU = -1; /* E_RABDataForwardingItem */ static int hf_s1ap_HandoverPreparationFailure_PDU = -1; /* HandoverPreparationFailure */ static int hf_s1ap_HandoverRequest_PDU = -1; /* HandoverRequest */ static int hf_s1ap_E_RABToBeSetupListHOReq_PDU = -1; /* E_RABToBeSetupListHOReq */ static int hf_s1ap_E_RABToBeSetupItemHOReq_PDU = -1; /* E_RABToBeSetupItemHOReq */ static int hf_s1ap_HandoverRequestAcknowledge_PDU = -1; /* HandoverRequestAcknowledge */ static int hf_s1ap_E_RABAdmittedList_PDU = -1; /* E_RABAdmittedList */ static int hf_s1ap_E_RABAdmittedItem_PDU = -1; /* E_RABAdmittedItem */ static int hf_s1ap_E_RABFailedtoSetupListHOReqAck_PDU = -1; /* E_RABFailedtoSetupListHOReqAck */ static int hf_s1ap_E_RABFailedToSetupItemHOReqAck_PDU = -1; /* E_RABFailedToSetupItemHOReqAck */ static int hf_s1ap_HandoverFailure_PDU = -1; /* HandoverFailure */ static int hf_s1ap_HandoverNotify_PDU = -1; /* HandoverNotify */ static int hf_s1ap_PathSwitchRequest_PDU = -1; /* PathSwitchRequest */ static int hf_s1ap_E_RABToBeSwitchedDLList_PDU = -1; /* E_RABToBeSwitchedDLList */ static int hf_s1ap_E_RABToBeSwitchedDLItem_PDU = -1; /* E_RABToBeSwitchedDLItem */ static int hf_s1ap_PathSwitchRequestAcknowledge_PDU = -1; /* PathSwitchRequestAcknowledge */ static int hf_s1ap_E_RABToBeSwitchedULList_PDU = -1; /* E_RABToBeSwitchedULList */ static int hf_s1ap_E_RABToBeSwitchedULItem_PDU = -1; /* E_RABToBeSwitchedULItem */ static int hf_s1ap_E_RABToBeUpdatedList_PDU = -1; /* E_RABToBeUpdatedList */ static int hf_s1ap_E_RABToBeUpdatedItem_PDU = -1; /* E_RABToBeUpdatedItem */ static int hf_s1ap_PathSwitchRequestFailure_PDU = -1; /* PathSwitchRequestFailure */ static int hf_s1ap_HandoverCancel_PDU = -1; /* HandoverCancel */ static int hf_s1ap_HandoverCancelAcknowledge_PDU = -1; /* HandoverCancelAcknowledge */ static int hf_s1ap_HandoverSuccess_PDU = -1; /* HandoverSuccess */ static int hf_s1ap_ENBEarlyStatusTransfer_PDU = -1; /* ENBEarlyStatusTransfer */ static int hf_s1ap_MMEEarlyStatusTransfer_PDU = -1; /* MMEEarlyStatusTransfer */ static int hf_s1ap_E_RABSetupRequest_PDU = -1; /* E_RABSetupRequest */ static int hf_s1ap_E_RABToBeSetupListBearerSUReq_PDU = -1; /* E_RABToBeSetupListBearerSUReq */ static int hf_s1ap_E_RABToBeSetupItemBearerSUReq_PDU = -1; /* E_RABToBeSetupItemBearerSUReq */ static int hf_s1ap_E_RABSetupResponse_PDU = -1; /* E_RABSetupResponse */ static int hf_s1ap_E_RABSetupListBearerSURes_PDU = -1; /* E_RABSetupListBearerSURes */ static int hf_s1ap_E_RABSetupItemBearerSURes_PDU = -1; /* E_RABSetupItemBearerSURes */ static int hf_s1ap_E_RABModifyRequest_PDU = -1; /* E_RABModifyRequest */ static int hf_s1ap_E_RABToBeModifiedListBearerModReq_PDU = -1; /* E_RABToBeModifiedListBearerModReq */ static int hf_s1ap_E_RABToBeModifiedItemBearerModReq_PDU = -1; /* E_RABToBeModifiedItemBearerModReq */ static int hf_s1ap_E_RABModifyResponse_PDU = -1; /* E_RABModifyResponse */ static int hf_s1ap_E_RABModifyListBearerModRes_PDU = -1; /* E_RABModifyListBearerModRes */ static int hf_s1ap_E_RABModifyItemBearerModRes_PDU = -1; /* E_RABModifyItemBearerModRes */ static int hf_s1ap_E_RABReleaseCommand_PDU = -1; /* E_RABReleaseCommand */ static int hf_s1ap_E_RABReleaseResponse_PDU = -1; /* E_RABReleaseResponse */ static int hf_s1ap_E_RABReleaseListBearerRelComp_PDU = -1; /* E_RABReleaseListBearerRelComp */ static int hf_s1ap_E_RABReleaseItemBearerRelComp_PDU = -1; /* E_RABReleaseItemBearerRelComp */ static int hf_s1ap_E_RABReleaseIndication_PDU = -1; /* E_RABReleaseIndication */ static int hf_s1ap_InitialContextSetupRequest_PDU = -1; /* InitialContextSetupRequest */ static int hf_s1ap_E_RABToBeSetupListCtxtSUReq_PDU = -1; /* E_RABToBeSetupListCtxtSUReq */ static int hf_s1ap_E_RABToBeSetupItemCtxtSUReq_PDU = -1; /* E_RABToBeSetupItemCtxtSUReq */ static int hf_s1ap_InitialContextSetupResponse_PDU = -1; /* InitialContextSetupResponse */ static int hf_s1ap_E_RABSetupListCtxtSURes_PDU = -1; /* E_RABSetupListCtxtSURes */ static int hf_s1ap_E_RABSetupItemCtxtSURes_PDU = -1; /* E_RABSetupItemCtxtSURes */ static int hf_s1ap_InitialContextSetupFailure_PDU = -1; /* InitialContextSetupFailure */ static int hf_s1ap_Paging_PDU = -1; /* Paging */ static int hf_s1ap_TAIList_PDU = -1; /* TAIList */ static int hf_s1ap_TAIItem_PDU = -1; /* TAIItem */ static int hf_s1ap_UEContextReleaseRequest_PDU = -1; /* UEContextReleaseRequest */ static int hf_s1ap_UEContextReleaseCommand_PDU = -1; /* UEContextReleaseCommand */ static int hf_s1ap_UEContextReleaseComplete_PDU = -1; /* UEContextReleaseComplete */ static int hf_s1ap_UEContextModificationRequest_PDU = -1; /* UEContextModificationRequest */ static int hf_s1ap_UEContextModificationResponse_PDU = -1; /* UEContextModificationResponse */ static int hf_s1ap_UEContextModificationFailure_PDU = -1; /* UEContextModificationFailure */ static int hf_s1ap_UERadioCapabilityMatchRequest_PDU = -1; /* UERadioCapabilityMatchRequest */ static int hf_s1ap_UERadioCapabilityMatchResponse_PDU = -1; /* UERadioCapabilityMatchResponse */ static int hf_s1ap_DownlinkNASTransport_PDU = -1; /* DownlinkNASTransport */ static int hf_s1ap_InitialUEMessage_PDU = -1; /* InitialUEMessage */ static int hf_s1ap_UplinkNASTransport_PDU = -1; /* UplinkNASTransport */ static int hf_s1ap_NASNonDeliveryIndication_PDU = -1; /* NASNonDeliveryIndication */ static int hf_s1ap_RerouteNASRequest_PDU = -1; /* RerouteNASRequest */ static int hf_s1ap_S1_Message_PDU = -1; /* S1_Message */ static int hf_s1ap_NASDeliveryIndication_PDU = -1; /* NASDeliveryIndication */ static int hf_s1ap_Reset_PDU = -1; /* Reset */ static int hf_s1ap_ResetType_PDU = -1; /* ResetType */ static int hf_s1ap_ResetAcknowledge_PDU = -1; /* ResetAcknowledge */ static int hf_s1ap_UE_associatedLogicalS1_ConnectionListResAck_PDU = -1; /* UE_associatedLogicalS1_ConnectionListResAck */ static int hf_s1ap_ErrorIndication_PDU = -1; /* ErrorIndication */ static int hf_s1ap_S1SetupRequest_PDU = -1; /* S1SetupRequest */ static int hf_s1ap_S1SetupResponse_PDU = -1; /* S1SetupResponse */ static int hf_s1ap_S1SetupFailure_PDU = -1; /* S1SetupFailure */ static int hf_s1ap_ENBConfigurationUpdate_PDU = -1; /* ENBConfigurationUpdate */ static int hf_s1ap_ENBConfigurationUpdateAcknowledge_PDU = -1; /* ENBConfigurationUpdateAcknowledge */ static int hf_s1ap_ENBConfigurationUpdateFailure_PDU = -1; /* ENBConfigurationUpdateFailure */ static int hf_s1ap_MMEConfigurationUpdate_PDU = -1; /* MMEConfigurationUpdate */ static int hf_s1ap_MMEConfigurationUpdateAcknowledge_PDU = -1; /* MMEConfigurationUpdateAcknowledge */ static int hf_s1ap_MMEConfigurationUpdateFailure_PDU = -1; /* MMEConfigurationUpdateFailure */ static int hf_s1ap_DownlinkS1cdma2000tunnelling_PDU = -1; /* DownlinkS1cdma2000tunnelling */ static int hf_s1ap_UplinkS1cdma2000tunnelling_PDU = -1; /* UplinkS1cdma2000tunnelling */ static int hf_s1ap_UECapabilityInfoIndication_PDU = -1; /* UECapabilityInfoIndication */ static int hf_s1ap_ENBStatusTransfer_PDU = -1; /* ENBStatusTransfer */ static int hf_s1ap_MMEStatusTransfer_PDU = -1; /* MMEStatusTransfer */ static int hf_s1ap_TraceStart_PDU = -1; /* TraceStart */ static int hf_s1ap_TraceFailureIndication_PDU = -1; /* TraceFailureIndication */ static int hf_s1ap_DeactivateTrace_PDU = -1; /* DeactivateTrace */ static int hf_s1ap_CellTrafficTrace_PDU = -1; /* CellTrafficTrace */ static int hf_s1ap_LocationReportingControl_PDU = -1; /* LocationReportingControl */ static int hf_s1ap_LocationReportingFailureIndication_PDU = -1; /* LocationReportingFailureIndication */ static int hf_s1ap_LocationReport_PDU = -1; /* LocationReport */ static int hf_s1ap_OverloadStart_PDU = -1; /* OverloadStart */ static int hf_s1ap_OverloadStop_PDU = -1; /* OverloadStop */ static int hf_s1ap_WriteReplaceWarningRequest_PDU = -1; /* WriteReplaceWarningRequest */ static int hf_s1ap_WriteReplaceWarningResponse_PDU = -1; /* WriteReplaceWarningResponse */ static int hf_s1ap_ENBDirectInformationTransfer_PDU = -1; /* ENBDirectInformationTransfer */ static int hf_s1ap_Inter_SystemInformationTransferType_PDU = -1; /* Inter_SystemInformationTransferType */ static int hf_s1ap_MMEDirectInformationTransfer_PDU = -1; /* MMEDirectInformationTransfer */ static int hf_s1ap_ENBConfigurationTransfer_PDU = -1; /* ENBConfigurationTransfer */ static int hf_s1ap_MMEConfigurationTransfer_PDU = -1; /* MMEConfigurationTransfer */ static int hf_s1ap_PrivateMessage_PDU = -1; /* PrivateMessage */ static int hf_s1ap_KillRequest_PDU = -1; /* KillRequest */ static int hf_s1ap_KillResponse_PDU = -1; /* KillResponse */ static int hf_s1ap_PWSRestartIndication_PDU = -1; /* PWSRestartIndication */ static int hf_s1ap_PWSFailureIndication_PDU = -1; /* PWSFailureIndication */ static int hf_s1ap_DownlinkUEAssociatedLPPaTransport_PDU = -1; /* DownlinkUEAssociatedLPPaTransport */ static int hf_s1ap_UplinkUEAssociatedLPPaTransport_PDU = -1; /* UplinkUEAssociatedLPPaTransport */ static int hf_s1ap_DownlinkNonUEAssociatedLPPaTransport_PDU = -1; /* DownlinkNonUEAssociatedLPPaTransport */ static int hf_s1ap_UplinkNonUEAssociatedLPPaTransport_PDU = -1; /* UplinkNonUEAssociatedLPPaTransport */ static int hf_s1ap_E_RABModificationIndication_PDU = -1; /* E_RABModificationIndication */ static int hf_s1ap_E_RABToBeModifiedListBearerModInd_PDU = -1; /* E_RABToBeModifiedListBearerModInd */ static int hf_s1ap_E_RABToBeModifiedItemBearerModInd_PDU = -1; /* E_RABToBeModifiedItemBearerModInd */ static int hf_s1ap_E_RABNotToBeModifiedListBearerModInd_PDU = -1; /* E_RABNotToBeModifiedListBearerModInd */ static int hf_s1ap_E_RABNotToBeModifiedItemBearerModInd_PDU = -1; /* E_RABNotToBeModifiedItemBearerModInd */ static int hf_s1ap_CSGMembershipInfo_PDU = -1; /* CSGMembershipInfo */ static int hf_s1ap_E_RABModificationConfirm_PDU = -1; /* E_RABModificationConfirm */ static int hf_s1ap_E_RABModifyListBearerModConf_PDU = -1; /* E_RABModifyListBearerModConf */ static int hf_s1ap_E_RABModifyItemBearerModConf_PDU = -1; /* E_RABModifyItemBearerModConf */ static int hf_s1ap_UEContextModificationIndication_PDU = -1; /* UEContextModificationIndication */ static int hf_s1ap_UEContextModificationConfirm_PDU = -1; /* UEContextModificationConfirm */ static int hf_s1ap_UEContextSuspendRequest_PDU = -1; /* UEContextSuspendRequest */ static int hf_s1ap_UEContextSuspendResponse_PDU = -1; /* UEContextSuspendResponse */ static int hf_s1ap_UEContextResumeRequest_PDU = -1; /* UEContextResumeRequest */ static int hf_s1ap_E_RABFailedToResumeListResumeReq_PDU = -1; /* E_RABFailedToResumeListResumeReq */ static int hf_s1ap_E_RABFailedToResumeItemResumeReq_PDU = -1; /* E_RABFailedToResumeItemResumeReq */ static int hf_s1ap_UEContextResumeResponse_PDU = -1; /* UEContextResumeResponse */ static int hf_s1ap_E_RABFailedToResumeListResumeRes_PDU = -1; /* E_RABFailedToResumeListResumeRes */ static int hf_s1ap_E_RABFailedToResumeItemResumeRes_PDU = -1; /* E_RABFailedToResumeItemResumeRes */ static int hf_s1ap_UEContextResumeFailure_PDU = -1; /* UEContextResumeFailure */ static int hf_s1ap_ConnectionEstablishmentIndication_PDU = -1; /* ConnectionEstablishmentIndication */ static int hf_s1ap_RetrieveUEInformation_PDU = -1; /* RetrieveUEInformation */ static int hf_s1ap_UEInformationTransfer_PDU = -1; /* UEInformationTransfer */ static int hf_s1ap_ENBCPRelocationIndication_PDU = -1; /* ENBCPRelocationIndication */ static int hf_s1ap_MMECPRelocationIndication_PDU = -1; /* MMECPRelocationIndication */ static int hf_s1ap_SecondaryRATDataUsageReport_PDU = -1; /* SecondaryRATDataUsageReport */ static int hf_s1ap_UERadioCapabilityIDMappingRequest_PDU = -1; /* UERadioCapabilityIDMappingRequest */ static int hf_s1ap_UERadioCapabilityIDMappingResponse_PDU = -1; /* UERadioCapabilityIDMappingResponse */ static int hf_s1ap_S1AP_PDU_PDU = -1; /* S1AP_PDU */ static int hf_s1ap_s1ap_SONtransferApplicationIdentity_PDU = -1; /* SONtransferApplicationIdentity */ static int hf_s1ap_s1ap_SONtransferRequestContainer_PDU = -1; /* SONtransferRequestContainer */ static int hf_s1ap_s1ap_SONtransferResponseContainer_PDU = -1; /* SONtransferResponseContainer */ static int hf_s1ap_s1ap_SONtransferCause_PDU = -1; /* SONtransferCause */ static int hf_s1ap_local = -1; /* INTEGER_0_65535 */ static int hf_s1ap_global = -1; /* T_global */ static int hf_s1ap_ProtocolIE_Container_item = -1; /* ProtocolIE_Field */ static int hf_s1ap_id = -1; /* ProtocolIE_ID */ static int hf_s1ap_criticality = -1; /* Criticality */ static int hf_s1ap_ie_field_value = -1; /* T_ie_field_value */ static int hf_s1ap_ProtocolIE_ContainerList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_ProtocolExtensionContainer_item = -1; /* ProtocolExtensionField */ static int hf_s1ap_ext_id = -1; /* ProtocolExtensionID */ static int hf_s1ap_extensionValue = -1; /* T_extensionValue */ static int hf_s1ap_PrivateIE_Container_item = -1; /* PrivateIE_Field */ static int hf_s1ap_private_id = -1; /* PrivateIE_ID */ static int hf_s1ap_value = -1; /* T_value */ static int hf_s1ap_gUMMEI = -1; /* GUMMEI */ static int hf_s1ap_m_TMSI = -1; /* M_TMSI */ static int hf_s1ap_iE_Extensions = -1; /* ProtocolExtensionContainer */ static int hf_s1ap_cellBased = -1; /* CellBasedMDT */ static int hf_s1ap_tABased = -1; /* TABasedMDT */ static int hf_s1ap_pLMNWide = -1; /* NULL */ static int hf_s1ap_tAIBased = -1; /* TAIBasedMDT */ static int hf_s1ap_cellBased_01 = -1; /* CellBasedQMC */ static int hf_s1ap_tABased_01 = -1; /* TABasedQMC */ static int hf_s1ap_tAIBased_01 = -1; /* TAIBasedQMC */ static int hf_s1ap_pLMNAreaBased = -1; /* PLMNAreaBasedQMC */ static int hf_s1ap_priorityLevel = -1; /* PriorityLevel */ static int hf_s1ap_pre_emptionCapability = -1; /* Pre_emptionCapability */ static int hf_s1ap_pre_emptionVulnerability = -1; /* Pre_emptionVulnerability */ static int hf_s1ap_cellIdentifierAndCELevelForCECapableUEs = -1; /* CellIdentifierAndCELevelForCECapableUEs */ static int hf_s1ap_assistanceDataForRecommendedCells = -1; /* AssistanceDataForRecommendedCells */ static int hf_s1ap_assistanceDataForCECapableUEs = -1; /* AssistanceDataForCECapableUEs */ static int hf_s1ap_pagingAttemptInformation = -1; /* PagingAttemptInformation */ static int hf_s1ap_recommendedCellsForPaging = -1; /* RecommendedCellsForPaging */ static int hf_s1ap_Bearers_SubjectToStatusTransferList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_e_RAB_ID = -1; /* E_RAB_ID */ static int hf_s1ap_uL_COUNTvalue = -1; /* COUNTvalue */ static int hf_s1ap_dL_COUNTvalue = -1; /* COUNTvalue */ static int hf_s1ap_receiveStatusofULPDCPSDUs = -1; /* ReceiveStatusofULPDCPSDUs */ static int hf_s1ap_Bearers_SubjectToEarlyStatusTransferList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_dLCOUNT_PDCP_SNlength = -1; /* DLCOUNT_PDCP_SNlength */ static int hf_s1ap_bluetoothMeasConfig = -1; /* BluetoothMeasConfig */ static int hf_s1ap_bluetoothMeasConfigNameList = -1; /* BluetoothMeasConfigNameList */ static int hf_s1ap_bt_rssi = -1; /* T_bt_rssi */ static int hf_s1ap_BluetoothMeasConfigNameList_item = -1; /* BluetoothName */ static int hf_s1ap_BPLMNs_item = -1; /* PLMNidentity */ static int hf_s1ap_cellID_Cancelled = -1; /* CellID_Cancelled */ static int hf_s1ap_tAI_Cancelled = -1; /* TAI_Cancelled */ static int hf_s1ap_emergencyAreaID_Cancelled = -1; /* EmergencyAreaID_Cancelled */ static int hf_s1ap_cellID_Broadcast = -1; /* CellID_Broadcast */ static int hf_s1ap_tAI_Broadcast = -1; /* TAI_Broadcast */ static int hf_s1ap_emergencyAreaID_Broadcast = -1; /* EmergencyAreaID_Broadcast */ static int hf_s1ap_CancelledCellinEAI_item = -1; /* CancelledCellinEAI_Item */ static int hf_s1ap_eCGI = -1; /* EUTRAN_CGI */ static int hf_s1ap_numberOfBroadcasts = -1; /* NumberOfBroadcasts */ static int hf_s1ap_CancelledCellinTAI_item = -1; /* CancelledCellinTAI_Item */ static int hf_s1ap_radioNetwork = -1; /* CauseRadioNetwork */ static int hf_s1ap_transport = -1; /* CauseTransport */ static int hf_s1ap_nas = -1; /* CauseNas */ static int hf_s1ap_protocol = -1; /* CauseProtocol */ static int hf_s1ap_misc = -1; /* CauseMisc */ static int hf_s1ap_global_Cell_ID = -1; /* EUTRAN_CGI */ static int hf_s1ap_cELevel = -1; /* CELevel */ static int hf_s1ap_CellID_Broadcast_item = -1; /* CellID_Broadcast_Item */ static int hf_s1ap_CellID_Cancelled_item = -1; /* CellID_Cancelled_Item */ static int hf_s1ap_cellIdListforMDT = -1; /* CellIdListforMDT */ static int hf_s1ap_CellIdListforMDT_item = -1; /* EUTRAN_CGI */ static int hf_s1ap_cellIdListforQMC = -1; /* CellIdListforQMC */ static int hf_s1ap_CellIdListforQMC_item = -1; /* EUTRAN_CGI */ static int hf_s1ap_cdma2000OneXMEID = -1; /* Cdma2000OneXMEID */ static int hf_s1ap_cdma2000OneXMSI = -1; /* Cdma2000OneXMSI */ static int hf_s1ap_cdma2000OneXPilot = -1; /* Cdma2000OneXPilot */ static int hf_s1ap_cell_Size = -1; /* Cell_Size */ static int hf_s1ap_pLMNidentity = -1; /* PLMNidentity */ static int hf_s1ap_lAC = -1; /* LAC */ static int hf_s1ap_cI = -1; /* CI */ static int hf_s1ap_rAC = -1; /* RAC */ static int hf_s1ap_CNTypeRestrictions_item = -1; /* CNTypeRestrictions_Item */ static int hf_s1ap_pLMN_Identity = -1; /* PLMNidentity */ static int hf_s1ap_cNType = -1; /* CNType */ static int hf_s1ap_ConnectedengNBList_item = -1; /* ConnectedengNBItem */ static int hf_s1ap_en_gNB_ID = -1; /* En_gNB_ID */ static int hf_s1ap_supportedTAs = -1; /* SupportedTAs */ static int hf_s1ap_sourceNG_RAN_node_ID = -1; /* Global_RAN_NODE_ID */ static int hf_s1ap_rAN_UE_NGAP_ID = -1; /* RAN_UE_NGAP_ID */ static int hf_s1ap_CSG_IdList_item = -1; /* CSG_IdList_Item */ static int hf_s1ap_cSG_Id = -1; /* CSG_Id */ static int hf_s1ap_pDCP_SN = -1; /* PDCP_SN */ static int hf_s1ap_hFN = -1; /* HFN */ static int hf_s1ap_pDCP_SNExtended = -1; /* PDCP_SNExtended */ static int hf_s1ap_hFNModified = -1; /* HFNModified */ static int hf_s1ap_pDCP_SNlength18 = -1; /* PDCP_SNlength18 */ static int hf_s1ap_hFNforPDCP_SNlength18 = -1; /* HFNforPDCP_SNlength18 */ static int hf_s1ap_procedureCode = -1; /* ProcedureCode */ static int hf_s1ap_triggeringMessage = -1; /* TriggeringMessage */ static int hf_s1ap_procedureCriticality = -1; /* Criticality */ static int hf_s1ap_iEsCriticalityDiagnostics = -1; /* CriticalityDiagnostics_IE_List */ static int hf_s1ap_CriticalityDiagnostics_IE_List_item = -1; /* CriticalityDiagnostics_IE_Item */ static int hf_s1ap_iECriticality = -1; /* Criticality */ static int hf_s1ap_iE_ID = -1; /* ProtocolIE_ID */ static int hf_s1ap_typeOfError = -1; /* TypeOfError */ static int hf_s1ap_dAPSIndicator = -1; /* T_dAPSIndicator */ static int hf_s1ap_DAPSResponseInfoList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_dAPSResponseInfo = -1; /* DAPSResponseInfo */ static int hf_s1ap_dapsresponseindicator = -1; /* T_dapsresponseindicator */ static int hf_s1ap_ServedDCNs_item = -1; /* ServedDCNsItem */ static int hf_s1ap_dCN_ID = -1; /* DCN_ID */ static int hf_s1ap_relativeDCNCapacity = -1; /* RelativeMMECapacity */ static int hf_s1ap_dl_NAS_MAC = -1; /* DL_NAS_MAC */ static int hf_s1ap_dLCOUNTValuePDCP_SNlength12 = -1; /* COUNTvalue */ static int hf_s1ap_dLCOUNTValuePDCP_SNlength15 = -1; /* COUNTValueExtended */ static int hf_s1ap_dLCOUNTValuePDCP_SNlength18 = -1; /* COUNTvaluePDCP_SNlength18 */ static int hf_s1ap_ECGIList_item = -1; /* EUTRAN_CGI */ static int hf_s1ap_PWSfailedECGIList_item = -1; /* EUTRAN_CGI */ static int hf_s1ap_EmergencyAreaIDList_item = -1; /* EmergencyAreaID */ static int hf_s1ap_EmergencyAreaID_Broadcast_item = -1; /* EmergencyAreaID_Broadcast_Item */ static int hf_s1ap_emergencyAreaID = -1; /* EmergencyAreaID */ static int hf_s1ap_completedCellinEAI = -1; /* CompletedCellinEAI */ static int hf_s1ap_EmergencyAreaID_Cancelled_item = -1; /* EmergencyAreaID_Cancelled_Item */ static int hf_s1ap_cancelledCellinEAI = -1; /* CancelledCellinEAI */ static int hf_s1ap_CompletedCellinEAI_item = -1; /* CompletedCellinEAI_Item */ static int hf_s1ap_ECGI_List_item = -1; /* EUTRAN_CGI */ static int hf_s1ap_EmergencyAreaIDListForRestart_item = -1; /* EmergencyAreaID */ static int hf_s1ap_bearers_SubjectToEarlyStatusTransferList = -1; /* Bearers_SubjectToEarlyStatusTransferList */ static int hf_s1ap_macroENB_ID = -1; /* BIT_STRING_SIZE_20 */ static int hf_s1ap_homeENB_ID = -1; /* BIT_STRING_SIZE_28 */ static int hf_s1ap_short_macroENB_ID = -1; /* BIT_STRING_SIZE_18 */ static int hf_s1ap_long_macroENB_ID = -1; /* BIT_STRING_SIZE_21 */ static int hf_s1ap_lAI = -1; /* LAI */ static int hf_s1ap_eNB_ID = -1; /* ENB_ID */ static int hf_s1ap_GUMMEIList_item = -1; /* GUMMEI */ static int hf_s1ap_bearers_SubjectToStatusTransferList = -1; /* Bearers_SubjectToStatusTransferList */ static int hf_s1ap_ENBX2TLAs_item = -1; /* TransportLayerAddress */ static int hf_s1ap_transfertype = -1; /* EN_DCSONTransferType */ static int hf_s1ap_sONInformation = -1; /* SONInformation */ static int hf_s1ap_x2TNLConfigInfo = -1; /* X2TNLConfigurationInfo */ static int hf_s1ap_request = -1; /* EN_DCTransferTypeRequest */ static int hf_s1ap_reply = -1; /* EN_DCTransferTypeReply */ static int hf_s1ap_sourceeNB = -1; /* EN_DCSONeNBIdentification */ static int hf_s1ap_targetengNB = -1; /* EN_DCSONengNBIdentification */ static int hf_s1ap_targeteNB = -1; /* EN_DCSONeNBIdentification */ static int hf_s1ap_associatedTAI = -1; /* TAI */ static int hf_s1ap_broadcast5GSTAI = -1; /* FiveGSTAI */ static int hf_s1ap_sourceengNB = -1; /* EN_DCSONengNBIdentification */ static int hf_s1ap_globaleNBID = -1; /* Global_ENB_ID */ static int hf_s1ap_selectedTAI = -1; /* TAI */ static int hf_s1ap_globalengNBID = -1; /* Global_en_gNB_ID */ static int hf_s1ap_EPLMNs_item = -1; /* PLMNidentity */ static int hf_s1ap_E_RABInformationList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_dL_Forwarding = -1; /* DL_Forwarding */ static int hf_s1ap_E_RABList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_cause = -1; /* Cause */ static int hf_s1ap_qCI = -1; /* QCI */ static int hf_s1ap_allocationRetentionPriority = -1; /* AllocationAndRetentionPriority */ static int hf_s1ap_gbrQosInformation = -1; /* GBR_QosInformation */ static int hf_s1ap_E_RABSecurityResultList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_securityResult = -1; /* SecurityResult */ static int hf_s1ap_E_RABUsageReportList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_startTimestamp = -1; /* T_startTimestamp */ static int hf_s1ap_endTimestamp = -1; /* T_endTimestamp */ static int hf_s1ap_usageCountUL = -1; /* INTEGER_0_18446744073709551615 */ static int hf_s1ap_usageCountDL = -1; /* INTEGER_0_18446744073709551615 */ static int hf_s1ap_cell_ID = -1; /* CellIdentity */ static int hf_s1ap_l1Threshold = -1; /* MeasurementThresholdL1LoggedMDT */ static int hf_s1ap_hysteresis = -1; /* Hysteresis */ static int hf_s1ap_timeToTrigger = -1; /* TimeToTrigger */ static int hf_s1ap_outOfCoverage = -1; /* T_outOfCoverage */ static int hf_s1ap_eventL1LoggedMDTConfig = -1; /* EventL1LoggedMDTConfig */ static int hf_s1ap_choice_Extensions = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_expectedActivity = -1; /* ExpectedUEActivityBehaviour */ static int hf_s1ap_expectedHOInterval = -1; /* ExpectedHOInterval */ static int hf_s1ap_expectedActivityPeriod = -1; /* ExpectedActivityPeriod */ static int hf_s1ap_expectedIdlePeriod = -1; /* ExpectedIdlePeriod */ static int hf_s1ap_sourceofUEActivityBehaviourInformation = -1; /* SourceOfUEActivityBehaviourInformation */ static int hf_s1ap_fiveGSTAC = -1; /* FiveGSTAC */ static int hf_s1ap_ForbiddenTAs_item = -1; /* ForbiddenTAs_Item */ static int hf_s1ap_forbiddenTACs = -1; /* ForbiddenTACs */ static int hf_s1ap_ForbiddenTACs_item = -1; /* TAC */ static int hf_s1ap_ForbiddenLAs_item = -1; /* ForbiddenLAs_Item */ static int hf_s1ap_forbiddenLACs = -1; /* ForbiddenLACs */ static int hf_s1ap_ForbiddenLACs_item = -1; /* LAC */ static int hf_s1ap_e_RAB_MaximumBitrateDL = -1; /* BitRate */ static int hf_s1ap_e_RAB_MaximumBitrateUL = -1; /* BitRate */ static int hf_s1ap_e_RAB_GuaranteedBitrateDL = -1; /* BitRate */ static int hf_s1ap_e_RAB_GuaranteedBitrateUL = -1; /* BitRate */ static int hf_s1ap_mME_Group_ID = -1; /* MME_Group_ID */ static int hf_s1ap_mME_Code = -1; /* MME_Code */ static int hf_s1ap_servingPLMN = -1; /* PLMNidentity */ static int hf_s1ap_equivalentPLMNs = -1; /* EPLMNs */ static int hf_s1ap_forbiddenTAs = -1; /* ForbiddenTAs */ static int hf_s1ap_forbiddenLAs = -1; /* ForbiddenLAs */ static int hf_s1ap_forbiddenInterRATs = -1; /* ForbiddenInterRATs */ static int hf_s1ap_measurementsToActivate = -1; /* MeasurementsToActivate */ static int hf_s1ap_m1reportingTrigger = -1; /* M1ReportingTrigger */ static int hf_s1ap_m1thresholdeventA2 = -1; /* M1ThresholdEventA2 */ static int hf_s1ap_m1periodicReporting = -1; /* M1PeriodicReporting */ static int hf_s1ap_recommendENBsForPaging = -1; /* RecommendedENBsForPaging */ static int hf_s1ap_rSRP = -1; /* INTEGER_0_127 */ static int hf_s1ap_rSRQ = -1; /* INTEGER_0_127 */ static int hf_s1ap_sINR = -1; /* INTEGER_0_127 */ static int hf_s1ap_interSystemMeasurementParameters = -1; /* InterSystemMeasurementParameters */ static int hf_s1ap_measurementDuration = -1; /* INTEGER_1_100 */ static int hf_s1ap_interSystemMeasurementList = -1; /* InterSystemMeasurementList */ static int hf_s1ap_InterSystemMeasurementList_item = -1; /* InterSystemMeasurementItem */ static int hf_s1ap_freqBandIndicatorNR = -1; /* INTEGER_1_1024 */ static int hf_s1ap_sSBfrequencies = -1; /* INTEGER_0_maxNARFCN */ static int hf_s1ap_subcarrierSpacingSSB = -1; /* T_subcarrierSpacingSSB */ static int hf_s1ap_maxRSIndexCellQual = -1; /* INTEGER_1_maxRS_IndexCellQual */ static int hf_s1ap_sMTC = -1; /* T_sMTC */ static int hf_s1ap_threshRS_Index_r15 = -1; /* T_threshRS_Index_r15 */ static int hf_s1ap_sSBToMeasure = -1; /* T_sSBToMeasure */ static int hf_s1ap_sSRSSIMeasurement = -1; /* T_sSRSSIMeasurement */ static int hf_s1ap_quantityConfigNR_R15 = -1; /* T_quantityConfigNR_R15 */ static int hf_s1ap_excludedCellsToAddModList = -1; /* T_excludedCellsToAddModList */ static int hf_s1ap_e_UTRAN_Cell = -1; /* LastVisitedEUTRANCellInformation */ static int hf_s1ap_uTRAN_Cell = -1; /* LastVisitedUTRANCellInformation */ static int hf_s1ap_gERAN_Cell = -1; /* LastVisitedGERANCellInformation */ static int hf_s1ap_nG_RAN_Cell = -1; /* LastVisitedNGRANCellInformation */ static int hf_s1ap_cellType = -1; /* CellType */ static int hf_s1ap_time_UE_StayedInCell = -1; /* Time_UE_StayedInCell */ static int hf_s1ap_LastVisitedPSCellList_item = -1; /* LastVisitedPSCellInformation */ static int hf_s1ap_pSCellID = -1; /* PSCellInformation */ static int hf_s1ap_timeStay = -1; /* INTEGER_0_40950 */ static int hf_s1ap_undefined = -1; /* NULL */ static int hf_s1ap_pattern_period = -1; /* T_pattern_period */ static int hf_s1ap_pattern_offset = -1; /* INTEGER_0_10239_ */ static int hf_s1ap_loggingInterval = -1; /* LoggingInterval */ static int hf_s1ap_loggingDuration = -1; /* LoggingDuration */ static int hf_s1ap_mBSFN_ResultToLog = -1; /* MBSFN_ResultToLog */ static int hf_s1ap_periodical = -1; /* NULL */ static int hf_s1ap_eventTrigger = -1; /* EventTrigger */ static int hf_s1ap_tACList_In_LTE_NTN = -1; /* TACList_In_LTE_NTN */ static int hf_s1ap_uE_Location_Derived_TAC = -1; /* TAC */ static int hf_s1ap_m3period = -1; /* M3period */ static int hf_s1ap_m4period = -1; /* M4period */ static int hf_s1ap_m4_links_to_log = -1; /* Links_to_log */ static int hf_s1ap_m5period = -1; /* M5period */ static int hf_s1ap_m5_links_to_log = -1; /* Links_to_log */ static int hf_s1ap_m6report_Interval = -1; /* M6report_Interval */ static int hf_s1ap_m6delay_threshold = -1; /* M6delay_threshold */ static int hf_s1ap_m6_links_to_log = -1; /* Links_to_log */ static int hf_s1ap_m7period = -1; /* M7period */ static int hf_s1ap_m7_links_to_log = -1; /* Links_to_log */ static int hf_s1ap_mdt_Activation = -1; /* MDT_Activation */ static int hf_s1ap_areaScopeOfMDT = -1; /* AreaScopeOfMDT */ static int hf_s1ap_mDTMode = -1; /* MDTMode */ static int hf_s1ap_MBSFN_ResultToLog_item = -1; /* MBSFN_ResultToLogInfo */ static int hf_s1ap_mBSFN_AreaId = -1; /* INTEGER_0_255 */ static int hf_s1ap_carrierFreq = -1; /* EARFCN */ static int hf_s1ap_MDTPLMNList_item = -1; /* PLMNidentity */ static int hf_s1ap_immediateMDT = -1; /* ImmediateMDT */ static int hf_s1ap_loggedMDT = -1; /* LoggedMDT */ static int hf_s1ap_mDTMode_Extension = -1; /* MDTMode_Extension */ static int hf_s1ap_threshold_RSRP = -1; /* Threshold_RSRP */ static int hf_s1ap_threshold_RSRQ = -1; /* Threshold_RSRQ */ static int hf_s1ap_global_ENB_ID = -1; /* Global_ENB_ID */ static int hf_s1ap_tAI = -1; /* TAI */ static int hf_s1ap_muting_pattern_period = -1; /* T_muting_pattern_period */ static int hf_s1ap_muting_pattern_offset = -1; /* INTEGER_0_10239_ */ static int hf_s1ap_nB_IoT_paging_eDRX_Cycle = -1; /* NB_IoT_Paging_eDRX_Cycle */ static int hf_s1ap_nB_IoT_pagingTimeWindow = -1; /* NB_IoT_PagingTimeWindow */ static int hf_s1ap_pLMNIdentity = -1; /* PLMNidentity */ static int hf_s1ap_nRCellIdentity = -1; /* NRCellIdentity */ static int hf_s1ap_nRencryptionAlgorithms = -1; /* NRencryptionAlgorithms */ static int hf_s1ap_nRintegrityProtectionAlgorithms = -1; /* NRintegrityProtectionAlgorithms */ static int hf_s1ap_vehicleUE = -1; /* VehicleUE */ static int hf_s1ap_pedestrianUE = -1; /* PedestrianUE */ static int hf_s1ap_uEaggregateMaximumBitRate = -1; /* BitRate */ static int hf_s1ap_overloadAction = -1; /* OverloadAction */ static int hf_s1ap_pagingAttemptCount = -1; /* PagingAttemptCount */ static int hf_s1ap_intendedNumberOfPagingAttempts = -1; /* IntendedNumberOfPagingAttempts */ static int hf_s1ap_nextPagingAreaScope = -1; /* NextPagingAreaScope */ static int hf_s1ap_paging_eDRX_Cycle = -1; /* Paging_eDRX_Cycle */ static int hf_s1ap_pagingTimeWindow = -1; /* PagingTimeWindow */ static int hf_s1ap_pc5QoSFlowList = -1; /* PC5QoSFlowList */ static int hf_s1ap_pc5LinkAggregatedBitRates = -1; /* BitRate */ static int hf_s1ap_PC5QoSFlowList_item = -1; /* PC5QoSFlowItem */ static int hf_s1ap_pQI = -1; /* FiveQI */ static int hf_s1ap_pc5FlowBitRates = -1; /* PC5FlowBitRates */ static int hf_s1ap_range = -1; /* Range */ static int hf_s1ap_guaranteedFlowBitRate = -1; /* BitRate */ static int hf_s1ap_maximumFlowBitRate = -1; /* BitRate */ static int hf_s1ap_reportInterval = -1; /* ReportIntervalMDT */ static int hf_s1ap_reportAmount = -1; /* ReportAmountMDT */ static int hf_s1ap_plmnListforQMC = -1; /* PLMNListforQMC */ static int hf_s1ap_PLMNListforQMC_item = -1; /* PLMNidentity */ static int hf_s1ap_proSeDirectDiscovery = -1; /* ProSeDirectDiscovery */ static int hf_s1ap_proSeDirectCommunication = -1; /* ProSeDirectCommunication */ static int hf_s1ap_nCGI = -1; /* NR_CGI */ static int hf_s1ap_recommendedCellList = -1; /* RecommendedCellList */ static int hf_s1ap_RecommendedCellList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_eUTRAN_CGI = -1; /* EUTRAN_CGI */ static int hf_s1ap_timeStayedInCell = -1; /* INTEGER_0_4095 */ static int hf_s1ap_recommendedENBList = -1; /* RecommendedENBList */ static int hf_s1ap_RecommendedENBList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_mMEPagingTarget = -1; /* MMEPagingTarget */ static int hf_s1ap_RAT_Restrictions_item = -1; /* RAT_RestrictionsItem */ static int hf_s1ap_rAT_RestrictionInformation = -1; /* T_rAT_RestrictionInformation */ static int hf_s1ap_eventType = -1; /* EventType */ static int hf_s1ap_reportArea = -1; /* ReportArea */ static int hf_s1ap_rIMInformation = -1; /* RIMInformation */ static int hf_s1ap_rIMRoutingAddress = -1; /* RIMRoutingAddress */ static int hf_s1ap_gERAN_Cell_ID = -1; /* GERAN_Cell_ID */ static int hf_s1ap_targetRNC_ID = -1; /* TargetRNC_ID */ static int hf_s1ap_eHRPD_Sector_ID = -1; /* OCTET_STRING_SIZE_16 */ static int hf_s1ap_uE_RLF_Report_Container = -1; /* UE_RLF_Report_Container */ static int hf_s1ap_uE_RLF_Report_Container_for_extended_bands = -1; /* UE_RLF_Report_Container_for_extended_bands */ static int hf_s1ap_ECGIListForRestart_item = -1; /* EUTRAN_CGI */ static int hf_s1ap_nextHopChainingCount = -1; /* INTEGER_0_7 */ static int hf_s1ap_nextHopParameter = -1; /* SecurityKey */ static int hf_s1ap_SecondaryRATDataUsageReportList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_secondaryRATType = -1; /* SecondaryRATType */ static int hf_s1ap_e_RABUsageReportList = -1; /* E_RABUsageReportList */ static int hf_s1ap_integrityProtectionIndication = -1; /* IntegrityProtectionIndication */ static int hf_s1ap_integrityProtectionResult = -1; /* IntegrityProtectionResult */ static int hf_s1ap_sensorNameConfig = -1; /* SensorNameConfig */ static int hf_s1ap_SensorMeasConfigNameList_item = -1; /* SensorMeasConfigNameItem */ static int hf_s1ap_sensorMeasConfig = -1; /* SensorMeasConfig */ static int hf_s1ap_sensorMeasConfigNameList = -1; /* SensorMeasConfigNameList */ static int hf_s1ap_uncompensatedBarometricConfig = -1; /* T_uncompensatedBarometricConfig */ static int hf_s1ap_sONInformationRequest = -1; /* SONInformationRequest */ static int hf_s1ap_sONInformationReply = -1; /* SONInformationReply */ static int hf_s1ap_sONInformation_Extension = -1; /* SONInformation_Extension */ static int hf_s1ap_x2TNLConfigurationInfo = -1; /* X2TNLConfigurationInfo */ static int hf_s1ap_rLFReportInformation = -1; /* RLFReportInformation */ static int hf_s1ap_targeteNB_ID = -1; /* TargeteNB_ID */ static int hf_s1ap_sourceeNB_ID = -1; /* SourceeNB_ID */ static int hf_s1ap_sourceStratumLevel = -1; /* StratumLevel */ static int hf_s1ap_listeningSubframePattern = -1; /* ListeningSubframePattern */ static int hf_s1ap_aggressoreCGI_List = -1; /* ECGI_List */ static int hf_s1ap_selected_TAI = -1; /* TAI */ static int hf_s1ap_sourceNgRanNode_ID = -1; /* SourceNgRanNode_ID */ static int hf_s1ap_sourceNodeID_Extension = -1; /* SourceNodeID_Extension */ static int hf_s1ap_rRC_Container = -1; /* RRC_Container */ static int hf_s1ap_e_RABInformationList = -1; /* E_RABInformationList */ static int hf_s1ap_targetCell_ID = -1; /* EUTRAN_CGI */ static int hf_s1ap_subscriberProfileIDforRFP = -1; /* SubscriberProfileIDforRFP */ static int hf_s1ap_uE_HistoryInformation = -1; /* UE_HistoryInformation */ static int hf_s1ap_global_RAN_NODE_ID = -1; /* Global_RAN_NODE_ID */ static int hf_s1ap_selected_TAI_01 = -1; /* FiveGSTAI */ static int hf_s1ap_ServedGUMMEIs_item = -1; /* ServedGUMMEIsItem */ static int hf_s1ap_servedPLMNs = -1; /* ServedPLMNs */ static int hf_s1ap_servedGroupIDs = -1; /* ServedGroupIDs */ static int hf_s1ap_servedMMECs = -1; /* ServedMMECs */ static int hf_s1ap_ServedGroupIDs_item = -1; /* MME_Group_ID */ static int hf_s1ap_ServedMMECs_item = -1; /* MME_Code */ static int hf_s1ap_ServedPLMNs_item = -1; /* PLMNidentity */ static int hf_s1ap_periodicCommunicationIndicator = -1; /* T_periodicCommunicationIndicator */ static int hf_s1ap_periodicTime = -1; /* INTEGER_1_3600_ */ static int hf_s1ap_scheduledCommunicationTime = -1; /* ScheduledCommunicationTime */ static int hf_s1ap_stationaryIndication = -1; /* T_stationaryIndication */ static int hf_s1ap_trafficProfile = -1; /* T_trafficProfile */ static int hf_s1ap_batteryIndication = -1; /* T_batteryIndication */ static int hf_s1ap_dayofWeek = -1; /* BIT_STRING_SIZE_7 */ static int hf_s1ap_timeofDayStart = -1; /* INTEGER_0_86399_ */ static int hf_s1ap_timeofDayEnd = -1; /* INTEGER_0_86399_ */ static int hf_s1ap_SupportedTAs_item = -1; /* SupportedTAs_Item */ static int hf_s1ap_tAC = -1; /* TAC */ static int hf_s1ap_broadcastPLMNs = -1; /* BPLMNs */ static int hf_s1ap_stratumLevel = -1; /* StratumLevel */ static int hf_s1ap_synchronisationStatus = -1; /* SynchronisationStatus */ static int hf_s1ap_mMEC = -1; /* MME_Code */ static int hf_s1ap_TACList_In_LTE_NTN_item = -1; /* TAC */ static int hf_s1ap_tAIListforMDT = -1; /* TAIListforMDT */ static int hf_s1ap_TAIListforMDT_item = -1; /* TAI */ static int hf_s1ap_TAIListforWarning_item = -1; /* TAI */ static int hf_s1ap_TAI_Broadcast_item = -1; /* TAI_Broadcast_Item */ static int hf_s1ap_completedCellinTAI = -1; /* CompletedCellinTAI */ static int hf_s1ap_TAI_Cancelled_item = -1; /* TAI_Cancelled_Item */ static int hf_s1ap_cancelledCellinTAI = -1; /* CancelledCellinTAI */ static int hf_s1ap_tAListforMDT = -1; /* TAListforMDT */ static int hf_s1ap_TAListforMDT_item = -1; /* TAC */ static int hf_s1ap_tAListforQMC = -1; /* TAListforQMC */ static int hf_s1ap_TAListforQMC_item = -1; /* TAC */ static int hf_s1ap_tAIListforQMC = -1; /* TAIListforQMC */ static int hf_s1ap_TAIListforQMC_item = -1; /* TAI */ static int hf_s1ap_CompletedCellinTAI_item = -1; /* CompletedCellinTAI_Item */ static int hf_s1ap_cGI = -1; /* CGI */ static int hf_s1ap_targetgNgRanNode_ID = -1; /* TargetNgRanNode_ID */ static int hf_s1ap_rNC_ID = -1; /* RNC_ID */ static int hf_s1ap_extendedRNC_ID = -1; /* ExtendedRNC_ID */ static int hf_s1ap_gNB = -1; /* GNB */ static int hf_s1ap_ng_eNB = -1; /* NG_eNB */ static int hf_s1ap_global_gNB_ID = -1; /* Global_GNB_ID */ static int hf_s1ap_gNB_ID = -1; /* GNB_Identity */ static int hf_s1ap_gNB_ID_01 = -1; /* GNB_ID */ static int hf_s1ap_global_ng_eNB_ID = -1; /* Global_ENB_ID */ static int hf_s1ap_measurementThreshold = -1; /* MeasurementThresholdA2 */ static int hf_s1ap_transportLayerAddress = -1; /* TransportLayerAddress */ static int hf_s1ap_uL_GTP_TEID = -1; /* GTP_TEID */ static int hf_s1ap_e_UTRAN_Trace_ID = -1; /* E_UTRAN_Trace_ID */ static int hf_s1ap_interfacesToTrace = -1; /* InterfacesToTrace */ static int hf_s1ap_traceDepth = -1; /* TraceDepth */ static int hf_s1ap_traceCollectionEntityIPAddress = -1; /* TransportLayerAddress */ static int hf_s1ap_uDP_Port_Number = -1; /* Port_Number */ static int hf_s1ap_TAIListForRestart_item = -1; /* TAI */ static int hf_s1ap_uEaggregateMaximumBitRateDL = -1; /* BitRate */ static int hf_s1ap_uEaggregateMaximumBitRateUL = -1; /* BitRate */ static int hf_s1ap_containerForAppLayerMeasConfig = -1; /* OCTET_STRING_SIZE_1_1000 */ static int hf_s1ap_areaScopeOfQMC = -1; /* AreaScopeOfQMC */ static int hf_s1ap_uE_S1AP_ID_pair = -1; /* UE_S1AP_ID_pair */ static int hf_s1ap_mME_UE_S1AP_ID = -1; /* MME_UE_S1AP_ID */ static int hf_s1ap_eNB_UE_S1AP_ID = -1; /* ENB_UE_S1AP_ID */ static int hf_s1ap_UE_HistoryInformation_item = -1; /* LastVisitedCell_Item */ static int hf_s1ap_s_TMSI = -1; /* S_TMSI */ static int hf_s1ap_iMSI = -1; /* IMSI */ static int hf_s1ap_encryptionAlgorithms = -1; /* EncryptionAlgorithms */ static int hf_s1ap_integrityProtectionAlgorithms = -1; /* IntegrityProtectionAlgorithms */ static int hf_s1ap_uESidelinkAggregateMaximumBitRate = -1; /* BitRate */ static int hf_s1ap_ul_NAS_MAC = -1; /* UL_NAS_MAC */ static int hf_s1ap_ul_NAS_Count = -1; /* UL_NAS_Count */ static int hf_s1ap_eutran_cgi = -1; /* EUTRAN_CGI */ static int hf_s1ap_tai = -1; /* TAI */ static int hf_s1ap_cellIDList = -1; /* ECGIList */ static int hf_s1ap_trackingAreaListforWarning = -1; /* TAIListforWarning */ static int hf_s1ap_emergencyAreaIDList = -1; /* EmergencyAreaIDList */ static int hf_s1ap_wlanMeasConfig = -1; /* WLANMeasConfig */ static int hf_s1ap_wlanMeasConfigNameList = -1; /* WLANMeasConfigNameList */ static int hf_s1ap_wlan_rssi = -1; /* T_wlan_rssi */ static int hf_s1ap_wlan_rtt = -1; /* T_wlan_rtt */ static int hf_s1ap_WLANMeasConfigNameList_item = -1; /* WLANName */ static int hf_s1ap_pagingProbabilityInformation = -1; /* PagingProbabilityInformation */ static int hf_s1ap_eNBX2TransportLayerAddresses = -1; /* ENBX2TLAs */ static int hf_s1ap_ENBX2ExtTLAs_item = -1; /* ENBX2ExtTLA */ static int hf_s1ap_iPsecTLA = -1; /* TransportLayerAddress */ static int hf_s1ap_gTPTLAa = -1; /* ENBX2GTPTLAs */ static int hf_s1ap_ENBX2GTPTLAs_item = -1; /* TransportLayerAddress */ static int hf_s1ap_ENBIndirectX2TransportLayerAddresses_item = -1; /* TransportLayerAddress */ static int hf_s1ap_protocolIEs = -1; /* ProtocolIE_Container */ static int hf_s1ap_dL_transportLayerAddress = -1; /* TransportLayerAddress */ static int hf_s1ap_dL_gTP_TEID = -1; /* GTP_TEID */ static int hf_s1ap_uL_TransportLayerAddress = -1; /* TransportLayerAddress */ static int hf_s1ap_gTP_TEID = -1; /* GTP_TEID */ static int hf_s1ap_e_RABlevelQosParameters = -1; /* E_RABLevelQoSParameters */ static int hf_s1ap_securityIndication = -1; /* SecurityIndication */ static int hf_s1ap_E_RABToBeSetupListBearerSUReq_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_e_RABlevelQoSParameters = -1; /* E_RABLevelQoSParameters */ static int hf_s1ap_nAS_PDU = -1; /* NAS_PDU */ static int hf_s1ap_E_RABSetupListBearerSURes_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_E_RABToBeModifiedListBearerModReq_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_e_RABLevelQoSParameters = -1; /* E_RABLevelQoSParameters */ static int hf_s1ap_E_RABModifyListBearerModRes_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_E_RABReleaseListBearerRelComp_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_E_RABToBeSetupListCtxtSUReq_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_E_RABSetupListCtxtSURes_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_TAIList_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_s1_Interface = -1; /* ResetAll */ static int hf_s1ap_partOfS1_Interface = -1; /* UE_associatedLogicalS1_ConnectionListRes */ static int hf_s1ap_UE_associatedLogicalS1_ConnectionListRes_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_UE_associatedLogicalS1_ConnectionListResAck_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_rIMTransfer = -1; /* RIMTransfer */ static int hf_s1ap_privateIEs = -1; /* PrivateIE_Container */ static int hf_s1ap_dL_GTP_TEID = -1; /* GTP_TEID */ static int hf_s1ap_cSGMembershipStatus = -1; /* CSGMembershipStatus */ static int hf_s1ap_cellAccessMode = -1; /* CellAccessMode */ static int hf_s1ap_E_RABModifyListBearerModConf_item = -1; /* ProtocolIE_SingleContainer */ static int hf_s1ap_initiatingMessage = -1; /* InitiatingMessage */ static int hf_s1ap_successfulOutcome = -1; /* SuccessfulOutcome */ static int hf_s1ap_unsuccessfulOutcome = -1; /* UnsuccessfulOutcome */ static int hf_s1ap_initiatingMessagevalue = -1; /* InitiatingMessage_value */ static int hf_s1ap_successfulOutcome_value = -1; /* SuccessfulOutcome_value */ static int hf_s1ap_unsuccessfulOutcome_value = -1; /* UnsuccessfulOutcome_value */ static int hf_s1ap_cellLoadReporting = -1; /* NULL */ static int hf_s1ap_multiCellLoadReporting = -1; /* MultiCellLoadReportingRequest */ static int hf_s1ap_eventTriggeredCellLoadReporting = -1; /* EventTriggeredCellLoadReportingRequest */ static int hf_s1ap_hOReporting = -1; /* HOReport */ static int hf_s1ap_eutranCellActivation = -1; /* CellActivationRequest */ static int hf_s1ap_energySavingsIndication = -1; /* CellStateIndication */ static int hf_s1ap_failureEventReporting = -1; /* FailureEventReport */ static int hf_s1ap_cellLoadReporting_01 = -1; /* CellLoadReportingResponse */ static int hf_s1ap_multiCellLoadReporting_01 = -1; /* MultiCellLoadReportingResponse */ static int hf_s1ap_eventTriggeredCellLoadReporting_01 = -1; /* EventTriggeredCellLoadReportingResponse */ static int hf_s1ap_hOReporting_01 = -1; /* NULL */ static int hf_s1ap_eutranCellActivation_01 = -1; /* CellActivationResponse */ static int hf_s1ap_energySavingsIndication_01 = -1; /* NULL */ static int hf_s1ap_failureEventReporting_01 = -1; /* NULL */ static int hf_s1ap_cellLoadReporting_02 = -1; /* CellLoadReportingCause */ static int hf_s1ap_multiCellLoadReporting_02 = -1; /* CellLoadReportingCause */ static int hf_s1ap_eventTriggeredCellLoadReporting_02 = -1; /* CellLoadReportingCause */ static int hf_s1ap_hOReporting_02 = -1; /* HOReportingCause */ static int hf_s1ap_eutranCellActivation_02 = -1; /* CellActivationCause */ static int hf_s1ap_energySavingsIndication_02 = -1; /* CellStateIndicationCause */ static int hf_s1ap_failureEventReporting_02 = -1; /* FailureEventReportingCause */ static int hf_s1ap_eUTRAN = -1; /* EUTRANcellLoadReportingResponse */ static int hf_s1ap_uTRAN = -1; /* OCTET_STRING */ static int hf_s1ap_gERAN = -1; /* OCTET_STRING */ static int hf_s1ap_eHRPD = -1; /* EHRPDSectorLoadReportingResponse */ static int hf_s1ap_compositeAvailableCapacityGroup = -1; /* CompositeAvailableCapacityGroup */ static int hf_s1ap_cell_ID_01 = -1; /* OCTET_STRING */ static int hf_s1ap_eUTRANcellLoadReportingResponse = -1; /* EUTRANcellLoadReportingResponse */ static int hf_s1ap_eUTRAN_01 = -1; /* OCTET_STRING */ static int hf_s1ap_eHRPD_01 = -1; /* EHRPD_Sector_ID */ static int hf_s1ap_RequestedCellList_item = -1; /* IRAT_Cell_ID */ static int hf_s1ap_requestedCellList = -1; /* RequestedCellList */ static int hf_s1ap_cell_ID_02 = -1; /* IRAT_Cell_ID */ static int hf_s1ap_ReportingCellList_item = -1; /* ReportingCellList_Item */ static int hf_s1ap_MultiCellLoadReportingResponse_item = -1; /* MultiCellLoadReportingResponse_Item */ static int hf_s1ap_eUTRANResponse = -1; /* EUTRANResponse */ static int hf_s1ap_uTRANResponse = -1; /* OCTET_STRING */ static int hf_s1ap_gERANResponse = -1; /* OCTET_STRING */ static int hf_s1ap_eHRPD_02 = -1; /* EHRPDMultiSectorLoadReportingResponseItem */ static int hf_s1ap_numberOfMeasurementReportingLevels = -1; /* NumberOfMeasurementReportingLevels */ static int hf_s1ap_cellLoadReportingResponse = -1; /* CellLoadReportingResponse */ static int hf_s1ap_overloadFlag = -1; /* OverloadFlag */ static int hf_s1ap_hoType = -1; /* HoType */ static int hf_s1ap_hoReportType = -1; /* HoReportType */ static int hf_s1ap_hosourceID = -1; /* IRAT_Cell_ID */ static int hf_s1ap_hoTargetID = -1; /* IRAT_Cell_ID */ static int hf_s1ap_candidateCellList = -1; /* CandidateCellList */ static int hf_s1ap_candidatePCIList = -1; /* CandidatePCIList */ static int hf_s1ap_CandidateCellList_item = -1; /* IRAT_Cell_ID */ static int hf_s1ap_CandidatePCIList_item = -1; /* CandidatePCI */ static int hf_s1ap_pCI = -1; /* INTEGER_0_503 */ static int hf_s1ap_eARFCN = -1; /* OCTET_STRING */ static int hf_s1ap_cellsToActivateList = -1; /* CellsToActivateList */ static int hf_s1ap_minimumActivationTime = -1; /* INTEGER_1_60 */ static int hf_s1ap_CellsToActivateList_item = -1; /* CellsToActivateList_Item */ static int hf_s1ap_activatedCellsList = -1; /* ActivatedCellsList */ static int hf_s1ap_ActivatedCellsList_item = -1; /* ActivatedCellsList_Item */ static int hf_s1ap_notificationCellList = -1; /* NotificationCellList */ static int hf_s1ap_NotificationCellList_item = -1; /* NotificationCellList_Item */ static int hf_s1ap_notifyFlag = -1; /* NotifyFlag */ static int hf_s1ap_tooEarlyInterRATHOReportFromEUTRAN = -1; /* TooEarlyInterRATHOReportReportFromEUTRAN */ static int hf_s1ap_uERLFReportContainer = -1; /* T_uERLFReportContainer */ static int hf_s1ap_mobilityInformation = -1; /* MobilityInformation */ static int hf_s1ap_dL_EHRPD_CompositeAvailableCapacity = -1; /* EHRPDCompositeAvailableCapacity */ static int hf_s1ap_uL_EHRPD_CompositeAvailableCapacity = -1; /* EHRPDCompositeAvailableCapacity */ static int hf_s1ap_eHRPDSectorCapacityClassValue = -1; /* EHRPDSectorCapacityClassValue */ static int hf_s1ap_eHRPDCapacityValue = -1; /* EHRPDCapacityValue */ static int hf_s1ap_eHRPD_Sector_ID_01 = -1; /* EHRPD_Sector_ID */ static int hf_s1ap_eHRPDSectorLoadReportingResponse = -1; /* EHRPDSectorLoadReportingResponse */ /* Initialize the subtree pointers */ static int ett_s1ap = -1; static int ett_s1ap_TransportLayerAddress = -1; static int ett_s1ap_ToTargetTransparentContainer = -1; static int ett_s1ap_ToSourceTransparentContainer = -1; static int ett_s1ap_RRCContainer = -1; static int ett_s1ap_UERadioCapability = -1; static int ett_s1ap_RIMInformation = -1; static int ett_s1ap_Cdma2000PDU = -1; static int ett_s1ap_Cdma2000SectorID = -1; static int ett_s1ap_UERadioPagingInformation = -1; static int ett_s1ap_UE_HistoryInformationFromTheUE = -1; static int ett_s1ap_CELevel = -1; static int ett_s1ap_UE_RLF_Report_Container = -1; static int ett_s1ap_UE_RLF_Report_Container_for_extended_bands = -1; static int ett_s1ap_S1_Message = -1; static int ett_s1ap_E_UTRAN_Trace_ID = -1; static int ett_s1ap_InterfacesToTrace = -1; static int ett_s1ap_EncryptionAlgorithms = -1; static int ett_s1ap_IntegrityProtectionAlgorithms = -1; static int ett_s1ap_LastVisitedNGRANCellInformation = -1; static int ett_s1ap_LastVisitedUTRANCellInformation = -1; static int ett_s1ap_SerialNumber = -1; static int ett_s1ap_WarningType = -1; static int ett_s1ap_DataCodingScheme = -1; static int ett_s1ap_WarningMessageContents = -1; static int ett_s1ap_MSClassmark = -1; static int ett_s1ap_MeasurementsToActivate = -1; static int ett_s1ap_MDT_Location_Info = -1; static int ett_s1ap_IMSI = -1; static int ett_s1ap_NASSecurityParameters = -1; static int ett_s1ap_NRencryptionAlgorithms = -1; static int ett_s1ap_NRintegrityProtectionAlgorithms = -1; static int ett_s1ap_UE_Application_Layer_Measurement_Capability = -1; static int ett_s1ap_sMTC = -1; static int ett_s1ap_threshRS_Index_r15 = -1; static int ett_s1ap_sSBToMeasure = -1; static int ett_s1ap_sSRSSIMeasurement = -1; static int ett_s1ap_quantityConfigNR_R15 = -1; static int ett_s1ap_excludedCellsToAddModList = -1; static int ett_s1ap_NB_IoT_RLF_Report_Container = -1; static int ett_s1ap_MDT_ConfigurationNR = -1; static int ett_s1ap_IntersystemSONConfigurationTransfer = -1; static int ett_s1ap_rAT_RestrictionInformation = -1; static gint ett_s1ap_PrivateIE_ID = -1; static gint ett_s1ap_ProtocolIE_Container = -1; static gint ett_s1ap_ProtocolIE_Field = -1; static gint ett_s1ap_ProtocolIE_ContainerList = -1; static gint ett_s1ap_ProtocolExtensionContainer = -1; static gint ett_s1ap_ProtocolExtensionField = -1; static gint ett_s1ap_PrivateIE_Container = -1; static gint ett_s1ap_PrivateIE_Field = -1; static gint ett_s1ap_Additional_GUTI = -1; static gint ett_s1ap_AreaScopeOfMDT = -1; static gint ett_s1ap_AreaScopeOfQMC = -1; static gint ett_s1ap_AllocationAndRetentionPriority = -1; static gint ett_s1ap_AssistanceDataForCECapableUEs = -1; static gint ett_s1ap_AssistanceDataForPaging = -1; static gint ett_s1ap_AssistanceDataForRecommendedCells = -1; static gint ett_s1ap_Bearers_SubjectToStatusTransferList = -1; static gint ett_s1ap_Bearers_SubjectToStatusTransfer_Item = -1; static gint ett_s1ap_Bearers_SubjectToEarlyStatusTransferList = -1; static gint ett_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item = -1; static gint ett_s1ap_BluetoothMeasurementConfiguration = -1; static gint ett_s1ap_BluetoothMeasConfigNameList = -1; static gint ett_s1ap_BPLMNs = -1; static gint ett_s1ap_BroadcastCancelledAreaList = -1; static gint ett_s1ap_BroadcastCompletedAreaList = -1; static gint ett_s1ap_CancelledCellinEAI = -1; static gint ett_s1ap_CancelledCellinEAI_Item = -1; static gint ett_s1ap_CancelledCellinTAI = -1; static gint ett_s1ap_CancelledCellinTAI_Item = -1; static gint ett_s1ap_Cause = -1; static gint ett_s1ap_CellIdentifierAndCELevelForCECapableUEs = -1; static gint ett_s1ap_CellID_Broadcast = -1; static gint ett_s1ap_CellID_Broadcast_Item = -1; static gint ett_s1ap_CellID_Cancelled = -1; static gint ett_s1ap_CellID_Cancelled_Item = -1; static gint ett_s1ap_CellBasedMDT = -1; static gint ett_s1ap_CellIdListforMDT = -1; static gint ett_s1ap_CellBasedQMC = -1; static gint ett_s1ap_CellIdListforQMC = -1; static gint ett_s1ap_Cdma2000OneXSRVCCInfo = -1; static gint ett_s1ap_CellType = -1; static gint ett_s1ap_CGI = -1; static gint ett_s1ap_CNTypeRestrictions = -1; static gint ett_s1ap_CNTypeRestrictions_Item = -1; static gint ett_s1ap_ConnectedengNBList = -1; static gint ett_s1ap_ConnectedengNBItem = -1; static gint ett_s1ap_ContextatSource = -1; static gint ett_s1ap_CSG_IdList = -1; static gint ett_s1ap_CSG_IdList_Item = -1; static gint ett_s1ap_COUNTvalue = -1; static gint ett_s1ap_COUNTValueExtended = -1; static gint ett_s1ap_COUNTvaluePDCP_SNlength18 = -1; static gint ett_s1ap_CriticalityDiagnostics = -1; static gint ett_s1ap_CriticalityDiagnostics_IE_List = -1; static gint ett_s1ap_CriticalityDiagnostics_IE_Item = -1; static gint ett_s1ap_DAPSRequestInfo = -1; static gint ett_s1ap_DAPSResponseInfoList = -1; static gint ett_s1ap_DAPSResponseInfoItem = -1; static gint ett_s1ap_DAPSResponseInfo = -1; static gint ett_s1ap_ServedDCNs = -1; static gint ett_s1ap_ServedDCNsItem = -1; static gint ett_s1ap_DL_CP_SecurityInformation = -1; static gint ett_s1ap_DLCOUNT_PDCP_SNlength = -1; static gint ett_s1ap_ECGIList = -1; static gint ett_s1ap_PWSfailedECGIList = -1; static gint ett_s1ap_EmergencyAreaIDList = -1; static gint ett_s1ap_EmergencyAreaID_Broadcast = -1; static gint ett_s1ap_EmergencyAreaID_Broadcast_Item = -1; static gint ett_s1ap_EmergencyAreaID_Cancelled = -1; static gint ett_s1ap_EmergencyAreaID_Cancelled_Item = -1; static gint ett_s1ap_CompletedCellinEAI = -1; static gint ett_s1ap_CompletedCellinEAI_Item = -1; static gint ett_s1ap_ECGI_List = -1; static gint ett_s1ap_EmergencyAreaIDListForRestart = -1; static gint ett_s1ap_ENB_EarlyStatusTransfer_TransparentContainer = -1; static gint ett_s1ap_ENB_ID = -1; static gint ett_s1ap_GERAN_Cell_ID = -1; static gint ett_s1ap_Global_ENB_ID = -1; static gint ett_s1ap_Global_en_gNB_ID = -1; static gint ett_s1ap_GUMMEIList = -1; static gint ett_s1ap_ENB_StatusTransfer_TransparentContainer = -1; static gint ett_s1ap_ENBX2TLAs = -1; static gint ett_s1ap_EN_DCSONConfigurationTransfer = -1; static gint ett_s1ap_EN_DCSONTransferType = -1; static gint ett_s1ap_EN_DCTransferTypeRequest = -1; static gint ett_s1ap_EN_DCTransferTypeReply = -1; static gint ett_s1ap_EN_DCSONeNBIdentification = -1; static gint ett_s1ap_EN_DCSONengNBIdentification = -1; static gint ett_s1ap_EPLMNs = -1; static gint ett_s1ap_E_RABInformationList = -1; static gint ett_s1ap_E_RABInformationListItem = -1; static gint ett_s1ap_E_RABList = -1; static gint ett_s1ap_E_RABItem = -1; static gint ett_s1ap_E_RABLevelQoSParameters = -1; static gint ett_s1ap_E_RABSecurityResultList = -1; static gint ett_s1ap_E_RABSecurityResultItem = -1; static gint ett_s1ap_E_RABUsageReportList = -1; static gint ett_s1ap_E_RABUsageReportItem = -1; static gint ett_s1ap_EUTRAN_CGI = -1; static gint ett_s1ap_EventL1LoggedMDTConfig = -1; static gint ett_s1ap_EventTrigger = -1; static gint ett_s1ap_ExpectedUEBehaviour = -1; static gint ett_s1ap_ExpectedUEActivityBehaviour = -1; static gint ett_s1ap_FiveGSTAI = -1; static gint ett_s1ap_ForbiddenTAs = -1; static gint ett_s1ap_ForbiddenTAs_Item = -1; static gint ett_s1ap_ForbiddenTACs = -1; static gint ett_s1ap_ForbiddenLAs = -1; static gint ett_s1ap_ForbiddenLAs_Item = -1; static gint ett_s1ap_ForbiddenLACs = -1; static gint ett_s1ap_GBR_QosInformation = -1; static gint ett_s1ap_GUMMEI = -1; static gint ett_s1ap_HandoverRestrictionList = -1; static gint ett_s1ap_ImmediateMDT = -1; static gint ett_s1ap_InformationOnRecommendedCellsAndENBsForPaging = -1; static gint ett_s1ap_IntersystemMeasurementConfiguration = -1; static gint ett_s1ap_InterSystemMeasurementParameters = -1; static gint ett_s1ap_InterSystemMeasurementList = -1; static gint ett_s1ap_InterSystemMeasurementItem = -1; static gint ett_s1ap_LAI = -1; static gint ett_s1ap_LastVisitedCell_Item = -1; static gint ett_s1ap_LastVisitedEUTRANCellInformation = -1; static gint ett_s1ap_LastVisitedPSCellList = -1; static gint ett_s1ap_LastVisitedPSCellInformation = -1; static gint ett_s1ap_LastVisitedGERANCellInformation = -1; static gint ett_s1ap_ListeningSubframePattern = -1; static gint ett_s1ap_LoggedMDT = -1; static gint ett_s1ap_LoggedMBSFNMDT = -1; static gint ett_s1ap_LoggedMDTTrigger = -1; static gint ett_s1ap_LTE_NTN_TAI_Information = -1; static gint ett_s1ap_M3Configuration = -1; static gint ett_s1ap_M4Configuration = -1; static gint ett_s1ap_M5Configuration = -1; static gint ett_s1ap_M6Configuration = -1; static gint ett_s1ap_M7Configuration = -1; static gint ett_s1ap_MDT_Configuration = -1; static gint ett_s1ap_MBSFN_ResultToLog = -1; static gint ett_s1ap_MBSFN_ResultToLogInfo = -1; static gint ett_s1ap_MDTPLMNList = -1; static gint ett_s1ap_MDTMode = -1; static gint ett_s1ap_MeasurementThresholdA2 = -1; static gint ett_s1ap_MeasurementThresholdL1LoggedMDT = -1; static gint ett_s1ap_MMEPagingTarget = -1; static gint ett_s1ap_MutingPatternInformation = -1; static gint ett_s1ap_NB_IoT_Paging_eDRXInformation = -1; static gint ett_s1ap_NR_CGI = -1; static gint ett_s1ap_NRUESecurityCapabilities = -1; static gint ett_s1ap_NRV2XServicesAuthorized = -1; static gint ett_s1ap_NRUESidelinkAggregateMaximumBitrate = -1; static gint ett_s1ap_OverloadResponse = -1; static gint ett_s1ap_PagingAttemptInformation = -1; static gint ett_s1ap_Paging_eDRXInformation = -1; static gint ett_s1ap_PC5QoSParameters = -1; static gint ett_s1ap_PC5QoSFlowList = -1; static gint ett_s1ap_PC5QoSFlowItem = -1; static gint ett_s1ap_PC5FlowBitRates = -1; static gint ett_s1ap_M1PeriodicReporting = -1; static gint ett_s1ap_PLMNAreaBasedQMC = -1; static gint ett_s1ap_PLMNListforQMC = -1; static gint ett_s1ap_ProSeAuthorized = -1; static gint ett_s1ap_PSCellInformation = -1; static gint ett_s1ap_RecommendedCellsForPaging = -1; static gint ett_s1ap_RecommendedCellList = -1; static gint ett_s1ap_RecommendedCellItem = -1; static gint ett_s1ap_RecommendedENBsForPaging = -1; static gint ett_s1ap_RecommendedENBList = -1; static gint ett_s1ap_RecommendedENBItem = -1; static gint ett_s1ap_RAT_Restrictions = -1; static gint ett_s1ap_RAT_RestrictionsItem = -1; static gint ett_s1ap_RequestType = -1; static gint ett_s1ap_RIMTransfer = -1; static gint ett_s1ap_RIMRoutingAddress = -1; static gint ett_s1ap_RLFReportInformation = -1; static gint ett_s1ap_ECGIListForRestart = -1; static gint ett_s1ap_SecurityContext = -1; static gint ett_s1ap_SecondaryRATDataUsageReportList = -1; static gint ett_s1ap_SecondaryRATDataUsageReportItem = -1; static gint ett_s1ap_SecurityIndication = -1; static gint ett_s1ap_SecurityResult = -1; static gint ett_s1ap_SensorMeasConfigNameItem = -1; static gint ett_s1ap_SensorMeasConfigNameList = -1; static gint ett_s1ap_SensorMeasurementConfiguration = -1; static gint ett_s1ap_SensorNameConfig = -1; static gint ett_s1ap_SONInformation = -1; static gint ett_s1ap_SONInformationReply = -1; static gint ett_s1ap_SONInformationReport = -1; static gint ett_s1ap_SONConfigurationTransfer = -1; static gint ett_s1ap_SynchronisationInformation = -1; static gint ett_s1ap_SourceeNB_ID = -1; static gint ett_s1ap_SourceNodeID = -1; static gint ett_s1ap_SourceeNB_ToTargeteNB_TransparentContainer = -1; static gint ett_s1ap_SourceNgRanNode_ID = -1; static gint ett_s1ap_ServedGUMMEIs = -1; static gint ett_s1ap_ServedGUMMEIsItem = -1; static gint ett_s1ap_ServedGroupIDs = -1; static gint ett_s1ap_ServedMMECs = -1; static gint ett_s1ap_ServedPLMNs = -1; static gint ett_s1ap_Subscription_Based_UE_DifferentiationInfo = -1; static gint ett_s1ap_ScheduledCommunicationTime = -1; static gint ett_s1ap_SupportedTAs = -1; static gint ett_s1ap_SupportedTAs_Item = -1; static gint ett_s1ap_TimeSynchronisationInfo = -1; static gint ett_s1ap_S_TMSI = -1; static gint ett_s1ap_TACList_In_LTE_NTN = -1; static gint ett_s1ap_TAIBasedMDT = -1; static gint ett_s1ap_TAIListforMDT = -1; static gint ett_s1ap_TAIListforWarning = -1; static gint ett_s1ap_TAI = -1; static gint ett_s1ap_TAI_Broadcast = -1; static gint ett_s1ap_TAI_Broadcast_Item = -1; static gint ett_s1ap_TAI_Cancelled = -1; static gint ett_s1ap_TAI_Cancelled_Item = -1; static gint ett_s1ap_TABasedMDT = -1; static gint ett_s1ap_TAListforMDT = -1; static gint ett_s1ap_TABasedQMC = -1; static gint ett_s1ap_TAListforQMC = -1; static gint ett_s1ap_TAIBasedQMC = -1; static gint ett_s1ap_TAIListforQMC = -1; static gint ett_s1ap_CompletedCellinTAI = -1; static gint ett_s1ap_CompletedCellinTAI_Item = -1; static gint ett_s1ap_TargetID = -1; static gint ett_s1ap_TargeteNB_ID = -1; static gint ett_s1ap_TargetRNC_ID = -1; static gint ett_s1ap_TargetNgRanNode_ID = -1; static gint ett_s1ap_Global_RAN_NODE_ID = -1; static gint ett_s1ap_GNB = -1; static gint ett_s1ap_Global_GNB_ID = -1; static gint ett_s1ap_GNB_Identity = -1; static gint ett_s1ap_NG_eNB = -1; static gint ett_s1ap_TargeteNB_ToSourceeNB_TransparentContainer = -1; static gint ett_s1ap_M1ThresholdEventA2 = -1; static gint ett_s1ap_TransportInformation = -1; static gint ett_s1ap_TraceActivation = -1; static gint ett_s1ap_TunnelInformation = -1; static gint ett_s1ap_TAIListForRestart = -1; static gint ett_s1ap_UEAggregateMaximumBitrate = -1; static gint ett_s1ap_UEAppLayerMeasConfig = -1; static gint ett_s1ap_UE_S1AP_IDs = -1; static gint ett_s1ap_UE_S1AP_ID_pair = -1; static gint ett_s1ap_UE_associatedLogicalS1_ConnectionItem = -1; static gint ett_s1ap_UE_HistoryInformation = -1; static gint ett_s1ap_UEPagingID = -1; static gint ett_s1ap_UESecurityCapabilities = -1; static gint ett_s1ap_UESidelinkAggregateMaximumBitrate = -1; static gint ett_s1ap_UL_CP_SecurityInformation = -1; static gint ett_s1ap_UserLocationInformation = -1; static gint ett_s1ap_V2XServicesAuthorized = -1; static gint ett_s1ap_WarningAreaList = -1; static gint ett_s1ap_WLANMeasurementConfiguration = -1; static gint ett_s1ap_WLANMeasConfigNameList = -1; static gint ett_s1ap_WUS_Assistance_Information = -1; static gint ett_s1ap_X2TNLConfigurationInfo = -1; static gint ett_s1ap_ENBX2ExtTLAs = -1; static gint ett_s1ap_ENBX2ExtTLA = -1; static gint ett_s1ap_ENBX2GTPTLAs = -1; static gint ett_s1ap_ENBIndirectX2TransportLayerAddresses = -1; static gint ett_s1ap_HandoverRequired = -1; static gint ett_s1ap_HandoverCommand = -1; static gint ett_s1ap_E_RABDataForwardingItem = -1; static gint ett_s1ap_HandoverPreparationFailure = -1; static gint ett_s1ap_HandoverRequest = -1; static gint ett_s1ap_E_RABToBeSetupItemHOReq = -1; static gint ett_s1ap_HandoverRequestAcknowledge = -1; static gint ett_s1ap_E_RABAdmittedItem = -1; static gint ett_s1ap_E_RABFailedToSetupItemHOReqAck = -1; static gint ett_s1ap_HandoverFailure = -1; static gint ett_s1ap_HandoverNotify = -1; static gint ett_s1ap_PathSwitchRequest = -1; static gint ett_s1ap_E_RABToBeSwitchedDLItem = -1; static gint ett_s1ap_PathSwitchRequestAcknowledge = -1; static gint ett_s1ap_E_RABToBeSwitchedULItem = -1; static gint ett_s1ap_E_RABToBeUpdatedItem = -1; static gint ett_s1ap_PathSwitchRequestFailure = -1; static gint ett_s1ap_HandoverCancel = -1; static gint ett_s1ap_HandoverCancelAcknowledge = -1; static gint ett_s1ap_HandoverSuccess = -1; static gint ett_s1ap_ENBEarlyStatusTransfer = -1; static gint ett_s1ap_MMEEarlyStatusTransfer = -1; static gint ett_s1ap_E_RABSetupRequest = -1; static gint ett_s1ap_E_RABToBeSetupListBearerSUReq = -1; static gint ett_s1ap_E_RABToBeSetupItemBearerSUReq = -1; static gint ett_s1ap_E_RABSetupResponse = -1; static gint ett_s1ap_E_RABSetupListBearerSURes = -1; static gint ett_s1ap_E_RABSetupItemBearerSURes = -1; static gint ett_s1ap_E_RABModifyRequest = -1; static gint ett_s1ap_E_RABToBeModifiedListBearerModReq = -1; static gint ett_s1ap_E_RABToBeModifiedItemBearerModReq = -1; static gint ett_s1ap_E_RABModifyResponse = -1; static gint ett_s1ap_E_RABModifyListBearerModRes = -1; static gint ett_s1ap_E_RABModifyItemBearerModRes = -1; static gint ett_s1ap_E_RABReleaseCommand = -1; static gint ett_s1ap_E_RABReleaseResponse = -1; static gint ett_s1ap_E_RABReleaseListBearerRelComp = -1; static gint ett_s1ap_E_RABReleaseItemBearerRelComp = -1; static gint ett_s1ap_E_RABReleaseIndication = -1; static gint ett_s1ap_InitialContextSetupRequest = -1; static gint ett_s1ap_E_RABToBeSetupListCtxtSUReq = -1; static gint ett_s1ap_E_RABToBeSetupItemCtxtSUReq = -1; static gint ett_s1ap_InitialContextSetupResponse = -1; static gint ett_s1ap_E_RABSetupListCtxtSURes = -1; static gint ett_s1ap_E_RABSetupItemCtxtSURes = -1; static gint ett_s1ap_InitialContextSetupFailure = -1; static gint ett_s1ap_Paging = -1; static gint ett_s1ap_TAIList = -1; static gint ett_s1ap_TAIItem = -1; static gint ett_s1ap_UEContextReleaseRequest = -1; static gint ett_s1ap_UEContextReleaseCommand = -1; static gint ett_s1ap_UEContextReleaseComplete = -1; static gint ett_s1ap_UEContextModificationRequest = -1; static gint ett_s1ap_UEContextModificationResponse = -1; static gint ett_s1ap_UEContextModificationFailure = -1; static gint ett_s1ap_UERadioCapabilityMatchRequest = -1; static gint ett_s1ap_UERadioCapabilityMatchResponse = -1; static gint ett_s1ap_DownlinkNASTransport = -1; static gint ett_s1ap_InitialUEMessage = -1; static gint ett_s1ap_UplinkNASTransport = -1; static gint ett_s1ap_NASNonDeliveryIndication = -1; static gint ett_s1ap_RerouteNASRequest = -1; static gint ett_s1ap_NASDeliveryIndication = -1; static gint ett_s1ap_Reset = -1; static gint ett_s1ap_ResetType = -1; static gint ett_s1ap_UE_associatedLogicalS1_ConnectionListRes = -1; static gint ett_s1ap_ResetAcknowledge = -1; static gint ett_s1ap_UE_associatedLogicalS1_ConnectionListResAck = -1; static gint ett_s1ap_ErrorIndication = -1; static gint ett_s1ap_S1SetupRequest = -1; static gint ett_s1ap_S1SetupResponse = -1; static gint ett_s1ap_S1SetupFailure = -1; static gint ett_s1ap_ENBConfigurationUpdate = -1; static gint ett_s1ap_ENBConfigurationUpdateAcknowledge = -1; static gint ett_s1ap_ENBConfigurationUpdateFailure = -1; static gint ett_s1ap_MMEConfigurationUpdate = -1; static gint ett_s1ap_MMEConfigurationUpdateAcknowledge = -1; static gint ett_s1ap_MMEConfigurationUpdateFailure = -1; static gint ett_s1ap_DownlinkS1cdma2000tunnelling = -1; static gint ett_s1ap_UplinkS1cdma2000tunnelling = -1; static gint ett_s1ap_UECapabilityInfoIndication = -1; static gint ett_s1ap_ENBStatusTransfer = -1; static gint ett_s1ap_MMEStatusTransfer = -1; static gint ett_s1ap_TraceStart = -1; static gint ett_s1ap_TraceFailureIndication = -1; static gint ett_s1ap_DeactivateTrace = -1; static gint ett_s1ap_CellTrafficTrace = -1; static gint ett_s1ap_LocationReportingControl = -1; static gint ett_s1ap_LocationReportingFailureIndication = -1; static gint ett_s1ap_LocationReport = -1; static gint ett_s1ap_OverloadStart = -1; static gint ett_s1ap_OverloadStop = -1; static gint ett_s1ap_WriteReplaceWarningRequest = -1; static gint ett_s1ap_WriteReplaceWarningResponse = -1; static gint ett_s1ap_ENBDirectInformationTransfer = -1; static gint ett_s1ap_Inter_SystemInformationTransferType = -1; static gint ett_s1ap_MMEDirectInformationTransfer = -1; static gint ett_s1ap_ENBConfigurationTransfer = -1; static gint ett_s1ap_MMEConfigurationTransfer = -1; static gint ett_s1ap_PrivateMessage = -1; static gint ett_s1ap_KillRequest = -1; static gint ett_s1ap_KillResponse = -1; static gint ett_s1ap_PWSRestartIndication = -1; static gint ett_s1ap_PWSFailureIndication = -1; static gint ett_s1ap_DownlinkUEAssociatedLPPaTransport = -1; static gint ett_s1ap_UplinkUEAssociatedLPPaTransport = -1; static gint ett_s1ap_DownlinkNonUEAssociatedLPPaTransport = -1; static gint ett_s1ap_UplinkNonUEAssociatedLPPaTransport = -1; static gint ett_s1ap_E_RABModificationIndication = -1; static gint ett_s1ap_E_RABToBeModifiedItemBearerModInd = -1; static gint ett_s1ap_E_RABNotToBeModifiedItemBearerModInd = -1; static gint ett_s1ap_CSGMembershipInfo = -1; static gint ett_s1ap_E_RABModificationConfirm = -1; static gint ett_s1ap_E_RABModifyListBearerModConf = -1; static gint ett_s1ap_E_RABModifyItemBearerModConf = -1; static gint ett_s1ap_UEContextModificationIndication = -1; static gint ett_s1ap_UEContextModificationConfirm = -1; static gint ett_s1ap_UEContextSuspendRequest = -1; static gint ett_s1ap_UEContextSuspendResponse = -1; static gint ett_s1ap_UEContextResumeRequest = -1; static gint ett_s1ap_E_RABFailedToResumeItemResumeReq = -1; static gint ett_s1ap_UEContextResumeResponse = -1; static gint ett_s1ap_E_RABFailedToResumeItemResumeRes = -1; static gint ett_s1ap_UEContextResumeFailure = -1; static gint ett_s1ap_ConnectionEstablishmentIndication = -1; static gint ett_s1ap_RetrieveUEInformation = -1; static gint ett_s1ap_UEInformationTransfer = -1; static gint ett_s1ap_ENBCPRelocationIndication = -1; static gint ett_s1ap_MMECPRelocationIndication = -1; static gint ett_s1ap_SecondaryRATDataUsageReport = -1; static gint ett_s1ap_UERadioCapabilityIDMappingRequest = -1; static gint ett_s1ap_UERadioCapabilityIDMappingResponse = -1; static gint ett_s1ap_S1AP_PDU = -1; static gint ett_s1ap_InitiatingMessage = -1; static gint ett_s1ap_SuccessfulOutcome = -1; static gint ett_s1ap_UnsuccessfulOutcome = -1; static gint ett_s1ap_SONtransferRequestContainer = -1; static gint ett_s1ap_SONtransferResponseContainer = -1; static gint ett_s1ap_SONtransferCause = -1; static gint ett_s1ap_CellLoadReportingResponse = -1; static gint ett_s1ap_EUTRANcellLoadReportingResponse = -1; static gint ett_s1ap_EUTRANResponse = -1; static gint ett_s1ap_IRAT_Cell_ID = -1; static gint ett_s1ap_RequestedCellList = -1; static gint ett_s1ap_MultiCellLoadReportingRequest = -1; static gint ett_s1ap_ReportingCellList_Item = -1; static gint ett_s1ap_ReportingCellList = -1; static gint ett_s1ap_MultiCellLoadReportingResponse = -1; static gint ett_s1ap_MultiCellLoadReportingResponse_Item = -1; static gint ett_s1ap_EventTriggeredCellLoadReportingRequest = -1; static gint ett_s1ap_EventTriggeredCellLoadReportingResponse = -1; static gint ett_s1ap_HOReport = -1; static gint ett_s1ap_CandidateCellList = -1; static gint ett_s1ap_CandidatePCIList = -1; static gint ett_s1ap_CandidatePCI = -1; static gint ett_s1ap_CellActivationRequest = -1; static gint ett_s1ap_CellsToActivateList = -1; static gint ett_s1ap_CellsToActivateList_Item = -1; static gint ett_s1ap_CellActivationResponse = -1; static gint ett_s1ap_ActivatedCellsList = -1; static gint ett_s1ap_ActivatedCellsList_Item = -1; static gint ett_s1ap_CellStateIndication = -1; static gint ett_s1ap_NotificationCellList = -1; static gint ett_s1ap_NotificationCellList_Item = -1; static gint ett_s1ap_FailureEventReport = -1; static gint ett_s1ap_TooEarlyInterRATHOReportReportFromEUTRAN = -1; static gint ett_s1ap_EHRPDSectorLoadReportingResponse = -1; static gint ett_s1ap_EHRPDCompositeAvailableCapacity = -1; static gint ett_s1ap_EHRPDMultiSectorLoadReportingResponseItem = -1; static expert_field ei_s1ap_number_pages_le15 = EI_INIT; enum{ INITIATING_MESSAGE, SUCCESSFUL_OUTCOME, UNSUCCESSFUL_OUTCOME }; struct s1ap_conv_info { wmem_map_t *nbiot_ta; wmem_tree_t *nbiot_enb_ue_s1ap_id; }; struct s1ap_supported_ta { guint16 tac; wmem_array_t *plmn; }; struct s1ap_tai { guint32 plmn; guint16 tac; }; struct s1ap_private_data { struct s1ap_conv_info *s1ap_conv; guint32 procedure_code; guint32 protocol_ie_id; guint32 protocol_extension_id; guint32 handover_type_value; guint32 message_type; guint8 data_coding_scheme; struct s1ap_supported_ta *supported_ta; const char *obj_id; struct s1ap_tai *tai; guint16 enb_ue_s1ap_id; gboolean srvcc_ho_cs_only; guint8 transparent_container_type; e212_number_type_t number_type; }; enum { S1AP_LTE_CONTAINER_AUTOMATIC, S1AP_LTE_CONTAINER_LEGACY, S1AP_LTE_CONTAINER_NBIOT }; static const enum_val_t s1ap_lte_container_vals[] = { {"automatic", "Automatic", S1AP_LTE_CONTAINER_AUTOMATIC}, {"legacy", "Legacy LTE", S1AP_LTE_CONTAINER_LEGACY}, {"nb-iot","NB-IoT", S1AP_LTE_CONTAINER_NBIOT}, {NULL, NULL, -1} }; enum { SOURCE_TO_TARGET_TRANSPARENT_CONTAINER = 1, TARGET_TO_SOURCE_TRANSPARENT_CONTAINER }; /* Global variables */ static gboolean g_s1ap_dissect_container = TRUE; static gint g_s1ap_dissect_lte_container_as = S1AP_LTE_CONTAINER_AUTOMATIC; static dissector_handle_t s1ap_handle; /* Dissector tables */ static dissector_table_t s1ap_ies_dissector_table; static dissector_table_t s1ap_ies_p1_dissector_table; static dissector_table_t s1ap_ies_p2_dissector_table; static dissector_table_t s1ap_extension_dissector_table; static dissector_table_t s1ap_proc_imsg_dissector_table; static dissector_table_t s1ap_proc_sout_dissector_table; static dissector_table_t s1ap_proc_uout_dissector_table; static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); /* Currently not used static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); */ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_InitialUEMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data); #if 0 static int dissect_SourceRNC_ToTargetRNC_TransparentContainer_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_TargetRNC_ToSourceRNC_TransparentContainer_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_SourceBSS_ToTargetBSS_TransparentContainer_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_TargetBSS_ToSourceBSS_TransparentContainer_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); #endif static void s1ap_Threshold_RSRP_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm (%u)", (gint32)v-140, v); } static void s1ap_Threshold_RSRQ_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%u)", ((float)v/2)-20, v); } static void s1ap_Hysteresis_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%u)", (float)v/2, v); } static const true_false_string s1ap_tfs_interfacesToTrace = { "Should be traced", "Should not be traced" }; static void s1ap_Time_UE_StayedInCell_EnhancedGranularity_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1fs", ((float)v)/10); } const value_string s1ap_serialNumber_gs_vals[] = { { 0, "Display mode immediate, cell wide"}, { 1, "Display mode normal, PLMN wide"}, { 2, "Display mode normal, tracking area wide"}, { 3, "Display mode normal, cell wide"}, { 0, NULL}, }; const value_string s1ap_warningType_vals[] = { { 0, "Earthquake"}, { 1, "Tsunami"}, { 2, "Earthquake and Tsunami"}, { 3, "Test"}, { 4, "Other"}, { 0, NULL}, }; void dissect_s1ap_warningMessageContents(tvbuff_t *warning_msg_tvb, proto_tree *tree, packet_info *pinfo, guint8 dcs, int hf_nb_pages, int hf_decoded_page) { guint32 offset; guint8 nb_of_pages, length, *str; proto_item *ti; tvbuff_t *cb_data_page_tvb, *cb_data_tvb; int i; nb_of_pages = tvb_get_guint8(warning_msg_tvb, 0); ti = proto_tree_add_uint(tree, hf_nb_pages, warning_msg_tvb, 0, 1, nb_of_pages); if (nb_of_pages > 15) { expert_add_info_format(pinfo, ti, &ei_s1ap_number_pages_le15, "Number of pages should be <=15 (found %u)", nb_of_pages); nb_of_pages = 15; } for (i = 0, offset = 1; i < nb_of_pages; i++) { length = tvb_get_guint8(warning_msg_tvb, offset+82); cb_data_page_tvb = tvb_new_subset_length(warning_msg_tvb, offset, length); cb_data_tvb = dissect_cbs_data(dcs, cb_data_page_tvb, tree, pinfo, 0); if (cb_data_tvb) { str = tvb_get_string_enc(pinfo->pool, cb_data_tvb, 0, tvb_reported_length(cb_data_tvb), ENC_UTF_8|ENC_NA); proto_tree_add_string_format(tree, hf_decoded_page, warning_msg_tvb, offset, 83, str, "Decoded Page %u: %s", i+1, str); } offset += 83; } } static void s1ap_EUTRANRoundTripDelayEstimationInfo_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%uTs (%u)", 16*v, v); } static const true_false_string s1ap_tfs_activate_do_not_activate = { "Activate", "Do not activate" }; static void s1ap_Packet_LossRate_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1f %% (%u)", (float)v/10, v); } static void s1ap_threshold_nr_rsrp_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm (%u)", (gint32)v-156, v); } static void s1ap_threshold_nr_rsrq_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%u)", ((float)v/2)-43, v); } static void s1ap_threshold_nr_sinr_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%u)", ((float)v/2)-23, v); } static struct s1ap_private_data* s1ap_get_private_data(packet_info *pinfo) { struct s1ap_private_data *s1ap_data = (struct s1ap_private_data*)p_get_proto_data(pinfo->pool, pinfo, proto_s1ap, 0); if (!s1ap_data) { s1ap_data = wmem_new0(pinfo->pool, struct s1ap_private_data); p_add_proto_data(pinfo->pool, pinfo, proto_s1ap, 0, s1ap_data); } return s1ap_data; } static gboolean s1ap_is_nbiot_ue(packet_info *pinfo) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); if (s1ap_data->s1ap_conv) { wmem_tree_key_t tree_key[3]; guint32 *id; guint32 enb_ue_s1ap_id = s1ap_data->enb_ue_s1ap_id; tree_key[0].length = 1; tree_key[0].key = &enb_ue_s1ap_id; tree_key[1].length = 1; tree_key[1].key = &pinfo->num; tree_key[2].length = 0; tree_key[2].key = NULL; id = (guint32*)wmem_tree_lookup32_array_le(s1ap_data->s1ap_conv->nbiot_enb_ue_s1ap_id, tree_key); if (id && (*id == enb_ue_s1ap_id)) { return TRUE; } } return FALSE; } static const value_string s1ap_Criticality_vals[] = { { 0, "reject" }, { 1, "ignore" }, { 2, "notify" }, { 0, NULL } }; static int dissect_s1ap_Criticality(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static int dissect_s1ap_INTEGER_0_65535(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static int dissect_s1ap_T_global(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_object_identifier_str(tvb, offset, actx, tree, hf_index, &s1ap_data->obj_id); return offset; } static const value_string s1ap_PrivateIE_ID_vals[] = { { 0, "local" }, { 1, "global" }, { 0, NULL } }; static const per_choice_t PrivateIE_ID_choice[] = { { 0, &hf_s1ap_local , ASN1_NO_EXTENSIONS , dissect_s1ap_INTEGER_0_65535 }, { 1, &hf_s1ap_global , ASN1_NO_EXTENSIONS , dissect_s1ap_T_global }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_PrivateIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->obj_id = NULL; offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_PrivateIE_ID, PrivateIE_ID_choice, NULL); return offset; } static const value_string s1ap_ProcedureCode_vals[] = { { id_HandoverPreparation, "id-HandoverPreparation" }, { id_HandoverResourceAllocation, "id-HandoverResourceAllocation" }, { id_HandoverNotification, "id-HandoverNotification" }, { id_PathSwitchRequest, "id-PathSwitchRequest" }, { id_HandoverCancel, "id-HandoverCancel" }, { id_E_RABSetup, "id-E-RABSetup" }, { id_E_RABModify, "id-E-RABModify" }, { id_E_RABRelease, "id-E-RABRelease" }, { id_E_RABReleaseIndication, "id-E-RABReleaseIndication" }, { id_InitialContextSetup, "id-InitialContextSetup" }, { id_Paging, "id-Paging" }, { id_downlinkNASTransport, "id-downlinkNASTransport" }, { id_initialUEMessage, "id-initialUEMessage" }, { id_uplinkNASTransport, "id-uplinkNASTransport" }, { id_Reset, "id-Reset" }, { id_ErrorIndication, "id-ErrorIndication" }, { id_NASNonDeliveryIndication, "id-NASNonDeliveryIndication" }, { id_S1Setup, "id-S1Setup" }, { id_UEContextReleaseRequest, "id-UEContextReleaseRequest" }, { id_DownlinkS1cdma2000tunnelling, "id-DownlinkS1cdma2000tunnelling" }, { id_UplinkS1cdma2000tunnelling, "id-UplinkS1cdma2000tunnelling" }, { id_UEContextModification, "id-UEContextModification" }, { id_UECapabilityInfoIndication, "id-UECapabilityInfoIndication" }, { id_UEContextRelease, "id-UEContextRelease" }, { id_eNBStatusTransfer, "id-eNBStatusTransfer" }, { id_MMEStatusTransfer, "id-MMEStatusTransfer" }, { id_DeactivateTrace, "id-DeactivateTrace" }, { id_TraceStart, "id-TraceStart" }, { id_TraceFailureIndication, "id-TraceFailureIndication" }, { id_ENBConfigurationUpdate, "id-ENBConfigurationUpdate" }, { id_MMEConfigurationUpdate, "id-MMEConfigurationUpdate" }, { id_LocationReportingControl, "id-LocationReportingControl" }, { id_LocationReportingFailureIndication, "id-LocationReportingFailureIndication" }, { id_LocationReport, "id-LocationReport" }, { id_OverloadStart, "id-OverloadStart" }, { id_OverloadStop, "id-OverloadStop" }, { id_WriteReplaceWarning, "id-WriteReplaceWarning" }, { id_eNBDirectInformationTransfer, "id-eNBDirectInformationTransfer" }, { id_MMEDirectInformationTransfer, "id-MMEDirectInformationTransfer" }, { id_PrivateMessage, "id-PrivateMessage" }, { id_eNBConfigurationTransfer, "id-eNBConfigurationTransfer" }, { id_MMEConfigurationTransfer, "id-MMEConfigurationTransfer" }, { id_CellTrafficTrace, "id-CellTrafficTrace" }, { id_Kill, "id-Kill" }, { id_downlinkUEAssociatedLPPaTransport, "id-downlinkUEAssociatedLPPaTransport" }, { id_uplinkUEAssociatedLPPaTransport, "id-uplinkUEAssociatedLPPaTransport" }, { id_downlinkNonUEAssociatedLPPaTransport, "id-downlinkNonUEAssociatedLPPaTransport" }, { id_uplinkNonUEAssociatedLPPaTransport, "id-uplinkNonUEAssociatedLPPaTransport" }, { id_UERadioCapabilityMatch, "id-UERadioCapabilityMatch" }, { id_PWSRestartIndication, "id-PWSRestartIndication" }, { id_E_RABModificationIndication, "id-E-RABModificationIndication" }, { id_PWSFailureIndication, "id-PWSFailureIndication" }, { id_RerouteNASRequest, "id-RerouteNASRequest" }, { id_UEContextModificationIndication, "id-UEContextModificationIndication" }, { id_ConnectionEstablishmentIndication, "id-ConnectionEstablishmentIndication" }, { id_UEContextSuspend, "id-UEContextSuspend" }, { id_UEContextResume, "id-UEContextResume" }, { id_NASDeliveryIndication, "id-NASDeliveryIndication" }, { id_RetrieveUEInformation, "id-RetrieveUEInformation" }, { id_UEInformationTransfer, "id-UEInformationTransfer" }, { id_eNBCPRelocationIndication, "id-eNBCPRelocationIndication" }, { id_MMECPRelocationIndication, "id-MMECPRelocationIndication" }, { id_SecondaryRATDataUsageReport, "id-SecondaryRATDataUsageReport" }, { id_UERadioCapabilityIDMapping, "id-UERadioCapabilityIDMapping" }, { id_HandoverSuccess, "id-HandoverSuccess" }, { id_eNBEarlyStatusTransfer, "id-eNBEarlyStatusTransfer" }, { id_MMEEarlyStatusTransfer, "id-MMEEarlyStatusTransfer" }, { 0, NULL } }; static value_string_ext s1ap_ProcedureCode_vals_ext = VALUE_STRING_EXT_INIT(s1ap_ProcedureCode_vals); static int dissect_s1ap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, &s1ap_data->procedure_code, FALSE); return offset; } static int dissect_s1ap_ProtocolExtensionID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &s1ap_data->protocol_extension_id, FALSE); return offset; } static const value_string s1ap_ProtocolIE_ID_vals[] = { { id_MME_UE_S1AP_ID, "id-MME-UE-S1AP-ID" }, { id_HandoverType, "id-HandoverType" }, { id_Cause, "id-Cause" }, { id_SourceID, "id-SourceID" }, { id_TargetID, "id-TargetID" }, { id_Unknown_5, "id-Unknown-5" }, { id_Unknown_6, "id-Unknown-6" }, { id_Unknown_7, "id-Unknown-7" }, { id_eNB_UE_S1AP_ID, "id-eNB-UE-S1AP-ID" }, { id_Unknown_9, "id-Unknown-9" }, { id_Unknown_10, "id-Unknown-10" }, { id_Unknown_11, "id-Unknown-11" }, { id_E_RABSubjecttoDataForwardingList, "id-E-RABSubjecttoDataForwardingList" }, { id_E_RABtoReleaseListHOCmd, "id-E-RABtoReleaseListHOCmd" }, { id_E_RABDataForwardingItem, "id-E-RABDataForwardingItem" }, { id_E_RABReleaseItemBearerRelComp, "id-E-RABReleaseItemBearerRelComp" }, { id_E_RABToBeSetupListBearerSUReq, "id-E-RABToBeSetupListBearerSUReq" }, { id_E_RABToBeSetupItemBearerSUReq, "id-E-RABToBeSetupItemBearerSUReq" }, { id_E_RABAdmittedList, "id-E-RABAdmittedList" }, { id_E_RABFailedToSetupListHOReqAck, "id-E-RABFailedToSetupListHOReqAck" }, { id_E_RABAdmittedItem, "id-E-RABAdmittedItem" }, { id_E_RABFailedtoSetupItemHOReqAck, "id-E-RABFailedtoSetupItemHOReqAck" }, { id_E_RABToBeSwitchedDLList, "id-E-RABToBeSwitchedDLList" }, { id_E_RABToBeSwitchedDLItem, "id-E-RABToBeSwitchedDLItem" }, { id_E_RABToBeSetupListCtxtSUReq, "id-E-RABToBeSetupListCtxtSUReq" }, { id_TraceActivation, "id-TraceActivation" }, { id_NAS_PDU, "id-NAS-PDU" }, { id_E_RABToBeSetupItemHOReq, "id-E-RABToBeSetupItemHOReq" }, { id_E_RABSetupListBearerSURes, "id-E-RABSetupListBearerSURes" }, { id_E_RABFailedToSetupListBearerSURes, "id-E-RABFailedToSetupListBearerSURes" }, { id_E_RABToBeModifiedListBearerModReq, "id-E-RABToBeModifiedListBearerModReq" }, { id_E_RABModifyListBearerModRes, "id-E-RABModifyListBearerModRes" }, { id_E_RABFailedToModifyList, "id-E-RABFailedToModifyList" }, { id_E_RABToBeReleasedList, "id-E-RABToBeReleasedList" }, { id_E_RABFailedToReleaseList, "id-E-RABFailedToReleaseList" }, { id_E_RABItem, "id-E-RABItem" }, { id_E_RABToBeModifiedItemBearerModReq, "id-E-RABToBeModifiedItemBearerModReq" }, { id_E_RABModifyItemBearerModRes, "id-E-RABModifyItemBearerModRes" }, { id_E_RABReleaseItem, "id-E-RABReleaseItem" }, { id_E_RABSetupItemBearerSURes, "id-E-RABSetupItemBearerSURes" }, { id_SecurityContext, "id-SecurityContext" }, { id_HandoverRestrictionList, "id-HandoverRestrictionList" }, { id_Unknown_42, "id-Unknown-42" }, { id_UEPagingID, "id-UEPagingID" }, { id_pagingDRX, "id-pagingDRX" }, { id_Unknown_45, "id-Unknown-45" }, { id_TAIList, "id-TAIList" }, { id_TAIItem, "id-TAIItem" }, { id_E_RABFailedToSetupListCtxtSURes, "id-E-RABFailedToSetupListCtxtSURes" }, { id_E_RABReleaseItemHOCmd, "id-E-RABReleaseItemHOCmd" }, { id_E_RABSetupItemCtxtSURes, "id-E-RABSetupItemCtxtSURes" }, { id_E_RABSetupListCtxtSURes, "id-E-RABSetupListCtxtSURes" }, { id_E_RABToBeSetupItemCtxtSUReq, "id-E-RABToBeSetupItemCtxtSUReq" }, { id_E_RABToBeSetupListHOReq, "id-E-RABToBeSetupListHOReq" }, { id_Unknown_54, "id-Unknown-54" }, { id_GERANtoLTEHOInformationRes, "id-GERANtoLTEHOInformationRes" }, { id_Unknown_56, "id-Unknown-56" }, { id_UTRANtoLTEHOInformationRes, "id-UTRANtoLTEHOInformationRes" }, { id_CriticalityDiagnostics, "id-CriticalityDiagnostics" }, { id_Global_ENB_ID, "id-Global-ENB-ID" }, { id_eNBname, "id-eNBname" }, { id_MMEname, "id-MMEname" }, { id_Unknown_62, "id-Unknown-62" }, { id_ServedPLMNs, "id-ServedPLMNs" }, { id_SupportedTAs, "id-SupportedTAs" }, { id_TimeToWait, "id-TimeToWait" }, { id_uEaggregateMaximumBitrate, "id-uEaggregateMaximumBitrate" }, { id_TAI, "id-TAI" }, { id_Unknown_68, "id-Unknown-68" }, { id_E_RABReleaseListBearerRelComp, "id-E-RABReleaseListBearerRelComp" }, { id_cdma2000PDU, "id-cdma2000PDU" }, { id_cdma2000RATType, "id-cdma2000RATType" }, { id_cdma2000SectorID, "id-cdma2000SectorID" }, { id_SecurityKey, "id-SecurityKey" }, { id_UERadioCapability, "id-UERadioCapability" }, { id_GUMMEI_ID, "id-GUMMEI-ID" }, { id_Unknown_76, "id-Unknown-76" }, { id_Unknown_77, "id-Unknown-77" }, { id_E_RABInformationListItem, "id-E-RABInformationListItem" }, { id_Direct_Forwarding_Path_Availability, "id-Direct-Forwarding-Path-Availability" }, { id_UEIdentityIndexValue, "id-UEIdentityIndexValue" }, { id_Unknown_81, "id-Unknown-81" }, { id_Unknown_82, "id-Unknown-82" }, { id_cdma2000HOStatus, "id-cdma2000HOStatus" }, { id_cdma2000HORequiredIndication, "id-cdma2000HORequiredIndication" }, { id_Unknown_85, "id-Unknown-85" }, { id_E_UTRAN_Trace_ID, "id-E-UTRAN-Trace-ID" }, { id_RelativeMMECapacity, "id-RelativeMMECapacity" }, { id_SourceMME_UE_S1AP_ID, "id-SourceMME-UE-S1AP-ID" }, { id_Bearers_SubjectToStatusTransfer_Item, "id-Bearers-SubjectToStatusTransfer-Item" }, { id_eNB_StatusTransfer_TransparentContainer, "id-eNB-StatusTransfer-TransparentContainer" }, { id_UE_associatedLogicalS1_ConnectionItem, "id-UE-associatedLogicalS1-ConnectionItem" }, { id_ResetType, "id-ResetType" }, { id_UE_associatedLogicalS1_ConnectionListResAck, "id-UE-associatedLogicalS1-ConnectionListResAck" }, { id_E_RABToBeSwitchedULItem, "id-E-RABToBeSwitchedULItem" }, { id_E_RABToBeSwitchedULList, "id-E-RABToBeSwitchedULList" }, { id_S_TMSI, "id-S-TMSI" }, { id_cdma2000OneXRAND, "id-cdma2000OneXRAND" }, { id_RequestType, "id-RequestType" }, { id_UE_S1AP_IDs, "id-UE-S1AP-IDs" }, { id_EUTRAN_CGI, "id-EUTRAN-CGI" }, { id_OverloadResponse, "id-OverloadResponse" }, { id_cdma2000OneXSRVCCInfo, "id-cdma2000OneXSRVCCInfo" }, { id_E_RABFailedToBeReleasedList, "id-E-RABFailedToBeReleasedList" }, { id_Source_ToTarget_TransparentContainer, "id-Source-ToTarget-TransparentContainer" }, { id_ServedGUMMEIs, "id-ServedGUMMEIs" }, { id_SubscriberProfileIDforRFP, "id-SubscriberProfileIDforRFP" }, { id_UESecurityCapabilities, "id-UESecurityCapabilities" }, { id_CSFallbackIndicator, "id-CSFallbackIndicator" }, { id_CNDomain, "id-CNDomain" }, { id_E_RABReleasedList, "id-E-RABReleasedList" }, { id_MessageIdentifier, "id-MessageIdentifier" }, { id_SerialNumber, "id-SerialNumber" }, { id_WarningAreaList, "id-WarningAreaList" }, { id_RepetitionPeriod, "id-RepetitionPeriod" }, { id_NumberofBroadcastRequest, "id-NumberofBroadcastRequest" }, { id_WarningType, "id-WarningType" }, { id_WarningSecurityInfo, "id-WarningSecurityInfo" }, { id_DataCodingScheme, "id-DataCodingScheme" }, { id_WarningMessageContents, "id-WarningMessageContents" }, { id_BroadcastCompletedAreaList, "id-BroadcastCompletedAreaList" }, { id_Inter_SystemInformationTransferTypeEDT, "id-Inter-SystemInformationTransferTypeEDT" }, { id_Inter_SystemInformationTransferTypeMDT, "id-Inter-SystemInformationTransferTypeMDT" }, { id_Target_ToSource_TransparentContainer, "id-Target-ToSource-TransparentContainer" }, { id_SRVCCOperationPossible, "id-SRVCCOperationPossible" }, { id_SRVCCHOIndication, "id-SRVCCHOIndication" }, { id_NAS_DownlinkCount, "id-NAS-DownlinkCount" }, { id_CSG_Id, "id-CSG-Id" }, { id_CSG_IdList, "id-CSG-IdList" }, { id_SONConfigurationTransferECT, "id-SONConfigurationTransferECT" }, { id_SONConfigurationTransferMCT, "id-SONConfigurationTransferMCT" }, { id_TraceCollectionEntityIPAddress, "id-TraceCollectionEntityIPAddress" }, { id_MSClassmark2, "id-MSClassmark2" }, { id_MSClassmark3, "id-MSClassmark3" }, { id_RRC_Establishment_Cause, "id-RRC-Establishment-Cause" }, { id_NASSecurityParametersfromE_UTRAN, "id-NASSecurityParametersfromE-UTRAN" }, { id_NASSecurityParameterstoE_UTRAN, "id-NASSecurityParameterstoE-UTRAN" }, { id_DefaultPagingDRX, "id-DefaultPagingDRX" }, { id_Source_ToTarget_TransparentContainer_Secondary, "id-Source-ToTarget-TransparentContainer-Secondary" }, { id_Target_ToSource_TransparentContainer_Secondary, "id-Target-ToSource-TransparentContainer-Secondary" }, { id_EUTRANRoundTripDelayEstimationInfo, "id-EUTRANRoundTripDelayEstimationInfo" }, { id_BroadcastCancelledAreaList, "id-BroadcastCancelledAreaList" }, { id_ConcurrentWarningMessageIndicator, "id-ConcurrentWarningMessageIndicator" }, { id_Data_Forwarding_Not_Possible, "id-Data-Forwarding-Not-Possible" }, { id_ExtendedRepetitionPeriod, "id-ExtendedRepetitionPeriod" }, { id_CellAccessMode, "id-CellAccessMode" }, { id_CSGMembershipStatus, "id-CSGMembershipStatus" }, { id_LPPa_PDU, "id-LPPa-PDU" }, { id_Routing_ID, "id-Routing-ID" }, { id_Time_Synchronisation_Info, "id-Time-Synchronisation-Info" }, { id_PS_ServiceNotAvailable, "id-PS-ServiceNotAvailable" }, { id_PagingPriority, "id-PagingPriority" }, { id_x2TNLConfigurationInfo, "id-x2TNLConfigurationInfo" }, { id_eNBX2ExtendedTransportLayerAddresses, "id-eNBX2ExtendedTransportLayerAddresses" }, { id_GUMMEIList, "id-GUMMEIList" }, { id_GW_TransportLayerAddress, "id-GW-TransportLayerAddress" }, { id_Correlation_ID, "id-Correlation-ID" }, { id_SourceMME_GUMMEI, "id-SourceMME-GUMMEI" }, { id_MME_UE_S1AP_ID_2, "id-MME-UE-S1AP-ID-2" }, { id_RegisteredLAI, "id-RegisteredLAI" }, { id_RelayNode_Indicator, "id-RelayNode-Indicator" }, { id_TrafficLoadReductionIndication, "id-TrafficLoadReductionIndication" }, { id_MDTConfiguration, "id-MDTConfiguration" }, { id_MMERelaySupportIndicator, "id-MMERelaySupportIndicator" }, { id_GWContextReleaseIndication, "id-GWContextReleaseIndication" }, { id_ManagementBasedMDTAllowed, "id-ManagementBasedMDTAllowed" }, { id_PrivacyIndicator, "id-PrivacyIndicator" }, { id_Time_UE_StayedInCell_EnhancedGranularity, "id-Time-UE-StayedInCell-EnhancedGranularity" }, { id_HO_Cause, "id-HO-Cause" }, { id_VoiceSupportMatchIndicator, "id-VoiceSupportMatchIndicator" }, { id_GUMMEIType, "id-GUMMEIType" }, { id_M3Configuration, "id-M3Configuration" }, { id_M4Configuration, "id-M4Configuration" }, { id_M5Configuration, "id-M5Configuration" }, { id_MDT_Location_Info, "id-MDT-Location-Info" }, { id_MobilityInformation, "id-MobilityInformation" }, { id_Tunnel_Information_for_BBF, "id-Tunnel-Information-for-BBF" }, { id_ManagementBasedMDTPLMNList, "id-ManagementBasedMDTPLMNList" }, { id_SignallingBasedMDTPLMNList, "id-SignallingBasedMDTPLMNList" }, { id_ULCOUNTValueExtended, "id-ULCOUNTValueExtended" }, { id_DLCOUNTValueExtended, "id-DLCOUNTValueExtended" }, { id_ReceiveStatusOfULPDCPSDUsExtended, "id-ReceiveStatusOfULPDCPSDUsExtended" }, { id_ECGIListForRestart, "id-ECGIListForRestart" }, { id_SIPTO_Correlation_ID, "id-SIPTO-Correlation-ID" }, { id_SIPTO_L_GW_TransportLayerAddress, "id-SIPTO-L-GW-TransportLayerAddress" }, { id_TransportInformation, "id-TransportInformation" }, { id_LHN_ID, "id-LHN-ID" }, { id_AdditionalCSFallbackIndicator, "id-AdditionalCSFallbackIndicator" }, { id_TAIListForRestart, "id-TAIListForRestart" }, { id_UserLocationInformation, "id-UserLocationInformation" }, { id_EmergencyAreaIDListForRestart, "id-EmergencyAreaIDListForRestart" }, { id_KillAllWarningMessages, "id-KillAllWarningMessages" }, { id_Masked_IMEISV, "id-Masked-IMEISV" }, { id_eNBIndirectX2TransportLayerAddresses, "id-eNBIndirectX2TransportLayerAddresses" }, { id_uE_HistoryInformationFromTheUE, "id-uE-HistoryInformationFromTheUE" }, { id_ProSeAuthorized, "id-ProSeAuthorized" }, { id_ExpectedUEBehaviour, "id-ExpectedUEBehaviour" }, { id_LoggedMBSFNMDT, "id-LoggedMBSFNMDT" }, { id_UERadioCapabilityForPaging, "id-UERadioCapabilityForPaging" }, { id_E_RABToBeModifiedListBearerModInd, "id-E-RABToBeModifiedListBearerModInd" }, { id_E_RABToBeModifiedItemBearerModInd, "id-E-RABToBeModifiedItemBearerModInd" }, { id_E_RABNotToBeModifiedListBearerModInd, "id-E-RABNotToBeModifiedListBearerModInd" }, { id_E_RABNotToBeModifiedItemBearerModInd, "id-E-RABNotToBeModifiedItemBearerModInd" }, { id_E_RABModifyListBearerModConf, "id-E-RABModifyListBearerModConf" }, { id_E_RABModifyItemBearerModConf, "id-E-RABModifyItemBearerModConf" }, { id_E_RABFailedToModifyListBearerModConf, "id-E-RABFailedToModifyListBearerModConf" }, { id_SON_Information_Report, "id-SON-Information-Report" }, { id_Muting_Availability_Indication, "id-Muting-Availability-Indication" }, { id_Muting_Pattern_Information, "id-Muting-Pattern-Information" }, { id_Synchronisation_Information, "id-Synchronisation-Information" }, { id_E_RABToBeReleasedListBearerModConf, "id-E-RABToBeReleasedListBearerModConf" }, { id_AssistanceDataForPaging, "id-AssistanceDataForPaging" }, { id_CellIdentifierAndCELevelForCECapableUEs, "id-CellIdentifierAndCELevelForCECapableUEs" }, { id_InformationOnRecommendedCellsAndENBsForPaging, "id-InformationOnRecommendedCellsAndENBsForPaging" }, { id_RecommendedCellItem, "id-RecommendedCellItem" }, { id_RecommendedENBItem, "id-RecommendedENBItem" }, { id_ProSeUEtoNetworkRelaying, "id-ProSeUEtoNetworkRelaying" }, { id_ULCOUNTValuePDCP_SNlength18, "id-ULCOUNTValuePDCP-SNlength18" }, { id_DLCOUNTValuePDCP_SNlength18, "id-DLCOUNTValuePDCP-SNlength18" }, { id_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18, "id-ReceiveStatusOfULPDCPSDUsPDCP-SNlength18" }, { id_M6Configuration, "id-M6Configuration" }, { id_M7Configuration, "id-M7Configuration" }, { id_PWSfailedECGIList, "id-PWSfailedECGIList" }, { id_MME_Group_ID, "id-MME-Group-ID" }, { id_Additional_GUTI, "id-Additional-GUTI" }, { id_S1_Message, "id-S1-Message" }, { id_CSGMembershipInfo, "id-CSGMembershipInfo" }, { id_Paging_eDRXInformation, "id-Paging-eDRXInformation" }, { id_UE_RetentionInformation, "id-UE-RetentionInformation" }, { id_Unknown_229, "id-Unknown-229" }, { id_UE_Usage_Type, "id-UE-Usage-Type" }, { id_extended_UEIdentityIndexValue, "id-extended-UEIdentityIndexValue" }, { id_RAT_Type, "id-RAT-Type" }, { id_BearerType, "id-BearerType" }, { id_NB_IoT_DefaultPagingDRX, "id-NB-IoT-DefaultPagingDRX" }, { id_E_RABFailedToResumeListResumeReq, "id-E-RABFailedToResumeListResumeReq" }, { id_E_RABFailedToResumeItemResumeReq, "id-E-RABFailedToResumeItemResumeReq" }, { id_E_RABFailedToResumeListResumeRes, "id-E-RABFailedToResumeListResumeRes" }, { id_E_RABFailedToResumeItemResumeRes, "id-E-RABFailedToResumeItemResumeRes" }, { id_NB_IoT_Paging_eDRXInformation, "id-NB-IoT-Paging-eDRXInformation" }, { id_V2XServicesAuthorized, "id-V2XServicesAuthorized" }, { id_UEUserPlaneCIoTSupportIndicator, "id-UEUserPlaneCIoTSupportIndicator" }, { id_CE_mode_B_SupportIndicator, "id-CE-mode-B-SupportIndicator" }, { id_SRVCCOperationNotPossible, "id-SRVCCOperationNotPossible" }, { id_NB_IoT_UEIdentityIndexValue, "id-NB-IoT-UEIdentityIndexValue" }, { id_RRC_Resume_Cause, "id-RRC-Resume-Cause" }, { id_DCN_ID, "id-DCN-ID" }, { id_ServedDCNs, "id-ServedDCNs" }, { id_UESidelinkAggregateMaximumBitrate, "id-UESidelinkAggregateMaximumBitrate" }, { id_DLNASPDUDeliveryAckRequest, "id-DLNASPDUDeliveryAckRequest" }, { id_Coverage_Level, "id-Coverage-Level" }, { id_EnhancedCoverageRestricted, "id-EnhancedCoverageRestricted" }, { id_UE_Level_QoS_Parameters, "id-UE-Level-QoS-Parameters" }, { id_DL_CP_SecurityInformation, "id-DL-CP-SecurityInformation" }, { id_UL_CP_SecurityInformation, "id-UL-CP-SecurityInformation" }, { id_extended_e_RAB_MaximumBitrateDL, "id-extended-e-RAB-MaximumBitrateDL" }, { id_extended_e_RAB_MaximumBitrateUL, "id-extended-e-RAB-MaximumBitrateUL" }, { id_extended_e_RAB_GuaranteedBitrateDL, "id-extended-e-RAB-GuaranteedBitrateDL" }, { id_extended_e_RAB_GuaranteedBitrateUL, "id-extended-e-RAB-GuaranteedBitrateUL" }, { id_extended_uEaggregateMaximumBitRateDL, "id-extended-uEaggregateMaximumBitRateDL" }, { id_extended_uEaggregateMaximumBitRateUL, "id-extended-uEaggregateMaximumBitRateUL" }, { id_NRrestrictioninEPSasSecondaryRAT, "id-NRrestrictioninEPSasSecondaryRAT" }, { id_UEAppLayerMeasConfig, "id-UEAppLayerMeasConfig" }, { id_UE_Application_Layer_Measurement_Capability, "id-UE-Application-Layer-Measurement-Capability" }, { id_SecondaryRATDataUsageReportList, "id-SecondaryRATDataUsageReportList" }, { id_SecondaryRATDataUsageReportItem, "id-SecondaryRATDataUsageReportItem" }, { id_HandoverFlag, "id-HandoverFlag" }, { id_E_RABUsageReportItem, "id-E-RABUsageReportItem" }, { id_SecondaryRATDataUsageRequest, "id-SecondaryRATDataUsageRequest" }, { id_NRUESecurityCapabilities, "id-NRUESecurityCapabilities" }, { id_UnlicensedSpectrumRestriction, "id-UnlicensedSpectrumRestriction" }, { id_CE_ModeBRestricted, "id-CE-ModeBRestricted" }, { id_LTE_M_Indication, "id-LTE-M-Indication" }, { id_DownlinkPacketLossRate, "id-DownlinkPacketLossRate" }, { id_UplinkPacketLossRate, "id-UplinkPacketLossRate" }, { id_UECapabilityInfoRequest, "id-UECapabilityInfoRequest" }, { id_serviceType, "id-serviceType" }, { id_AerialUEsubscriptionInformation, "id-AerialUEsubscriptionInformation" }, { id_Subscription_Based_UE_DifferentiationInfo, "id-Subscription-Based-UE-DifferentiationInfo" }, { id_Unknown_279, "id-Unknown-279" }, { id_EndIndication, "id-EndIndication" }, { id_EDT_Session, "id-EDT-Session" }, { id_CNTypeRestrictions, "id-CNTypeRestrictions" }, { id_PendingDataIndication, "id-PendingDataIndication" }, { id_BluetoothMeasurementConfiguration, "id-BluetoothMeasurementConfiguration" }, { id_WLANMeasurementConfiguration, "id-WLANMeasurementConfiguration" }, { id_WarningAreaCoordinates, "id-WarningAreaCoordinates" }, { id_NRrestrictionin5GS, "id-NRrestrictionin5GS" }, { id_PSCellInformation, "id-PSCellInformation" }, { id_Unknown_289, "id-Unknown-289" }, { id_LastNG_RANPLMNIdentity, "id-LastNG-RANPLMNIdentity" }, { id_ConnectedengNBList, "id-ConnectedengNBList" }, { id_ConnectedengNBToAddList, "id-ConnectedengNBToAddList" }, { id_ConnectedengNBToRemoveList, "id-ConnectedengNBToRemoveList" }, { id_EN_DCSONConfigurationTransfer_ECT, "id-EN-DCSONConfigurationTransfer-ECT" }, { id_EN_DCSONConfigurationTransfer_MCT, "id-EN-DCSONConfigurationTransfer-MCT" }, { id_IMSvoiceEPSfallbackfrom5G, "id-IMSvoiceEPSfallbackfrom5G" }, { id_TimeSinceSecondaryNodeRelease, "id-TimeSinceSecondaryNodeRelease" }, { id_RequestTypeAdditionalInfo, "id-RequestTypeAdditionalInfo" }, { id_AdditionalRRMPriorityIndex, "id-AdditionalRRMPriorityIndex" }, { id_ContextatSource, "id-ContextatSource" }, { id_IAB_Authorized, "id-IAB-Authorized" }, { id_IAB_Node_Indication, "id-IAB-Node-Indication" }, { id_IAB_Supported, "id-IAB-Supported" }, { id_DataSize, "id-DataSize" }, { id_Ethernet_Type, "id-Ethernet-Type" }, { id_NRV2XServicesAuthorized, "id-NRV2XServicesAuthorized" }, { id_NRUESidelinkAggregateMaximumBitrate, "id-NRUESidelinkAggregateMaximumBitrate" }, { id_PC5QoSParameters, "id-PC5QoSParameters" }, { id_IntersystemSONConfigurationTransferMCT, "id-IntersystemSONConfigurationTransferMCT" }, { id_IntersystemSONConfigurationTransferECT, "id-IntersystemSONConfigurationTransferECT" }, { id_IntersystemMeasurementConfiguration, "id-IntersystemMeasurementConfiguration" }, { id_SourceNodeID, "id-SourceNodeID" }, { id_NB_IoT_RLF_Report_Container, "id-NB-IoT-RLF-Report-Container" }, { id_UERadioCapabilityID, "id-UERadioCapabilityID" }, { id_UERadioCapability_NR_Format, "id-UERadioCapability-NR-Format" }, { id_MDTConfigurationNR, "id-MDTConfigurationNR" }, { id_DAPSRequestInfo, "id-DAPSRequestInfo" }, { id_DAPSResponseInfoList, "id-DAPSResponseInfoList" }, { id_DAPSResponseInfoItem, "id-DAPSResponseInfoItem" }, { id_NotifySourceeNB, "id-NotifySourceeNB" }, { id_eNB_EarlyStatusTransfer_TransparentContainer, "id-eNB-EarlyStatusTransfer-TransparentContainer" }, { id_Bearers_SubjectToEarlyStatusTransfer_Item, "id-Bearers-SubjectToEarlyStatusTransfer-Item" }, { id_WUS_Assistance_Information, "id-WUS-Assistance-Information" }, { id_NB_IoT_PagingDRX, "id-NB-IoT-PagingDRX" }, { id_TraceCollectionEntityURI, "id-TraceCollectionEntityURI" }, { id_EmergencyIndicator, "id-EmergencyIndicator" }, { id_UERadioCapabilityForPaging_NR_Format, "id-UERadioCapabilityForPaging-NR-Format" }, { id_SourceTransportLayerAddress, "id-SourceTransportLayerAddress" }, { id_lastVisitedPSCellList, "id-lastVisitedPSCellList" }, { id_RACSIndication, "id-RACSIndication" }, { id_PagingCause, "id-PagingCause" }, { id_SecurityIndication, "id-SecurityIndication" }, { id_SecurityResult, "id-SecurityResult" }, { id_E_RABSecurityResultItem, "id-E-RABSecurityResultItem" }, { id_E_RABSecurityResultList, "id-E-RABSecurityResultList" }, { id_RAT_Restrictions, "id-RAT-Restrictions" }, { id_UEContextReferenceatSourceeNB, "id-UEContextReferenceatSourceeNB" }, { id_Unknown_338, "id-Unknown-338" }, { id_LTE_NTN_TAI_Information, "id-LTE-NTN-TAI-Information" }, { id_SourceNodeTransportLayerAddress, "id-SourceNodeTransportLayerAddress" }, { id_E_RABToBeUpdatedList, "id-E-RABToBeUpdatedList" }, { id_E_RABToBeUpdatedItem, "id-E-RABToBeUpdatedItem" }, { id_SourceSNID, "id-SourceSNID" }, { id_LoggedMDTTrigger, "id-LoggedMDTTrigger" }, { id_SensorMeasurementConfiguration, "id-SensorMeasurementConfiguration" }, { 0, NULL } }; static value_string_ext s1ap_ProtocolIE_ID_vals_ext = VALUE_STRING_EXT_INIT(s1ap_ProtocolIE_ID_vals); static int dissect_s1ap_ProtocolIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &s1ap_data->protocol_ie_id, FALSE); if (tree) { proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str_ext(s1ap_data->protocol_ie_id, &s1ap_ProtocolIE_ID_vals_ext, "unknown (%d)")); } return offset; } static const value_string s1ap_TriggeringMessage_vals[] = { { 0, "initiating-message" }, { 1, "successful-outcome" }, { 2, "unsuccessfull-outcome" }, { 0, NULL } }; static int dissect_s1ap_TriggeringMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static int dissect_s1ap_T_ie_field_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolIEFieldValue); return offset; } static const per_sequence_t ProtocolIE_Field_sequence[] = { { &hf_s1ap_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_ID }, { &hf_s1ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_ie_field_value , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_T_ie_field_value }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ProtocolIE_Field(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ProtocolIE_Field, ProtocolIE_Field_sequence); return offset; } static const per_sequence_t ProtocolIE_Container_sequence_of[1] = { { &hf_s1ap_ProtocolIE_Container_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Field }, }; static int dissect_s1ap_ProtocolIE_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ProtocolIE_Container, ProtocolIE_Container_sequence_of, 0, maxProtocolIEs, FALSE); return offset; } static int dissect_s1ap_ProtocolIE_SingleContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_ProtocolIE_Field(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t ProtocolIE_ContainerList_sequence_of[1] = { { &hf_s1ap_ProtocolIE_ContainerList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_ProtocolIE_ContainerList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { static const asn1_par_def_t ProtocolIE_ContainerList_pars[] = { { "lowerBound", ASN1_PAR_INTEGER }, { "upperBound", ASN1_PAR_INTEGER }, { NULL, (asn1_par_type)0 } }; asn1_stack_frame_check(actx, "ProtocolIE-ContainerList", ProtocolIE_ContainerList_pars); offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ProtocolIE_ContainerList, ProtocolIE_ContainerList_sequence_of, asn1_param_get_integer(actx,"lowerBound"), asn1_param_get_integer(actx,"upperBound"), FALSE); return offset; } static int dissect_s1ap_T_extensionValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolExtensionFieldExtensionValue); return offset; } static const per_sequence_t ProtocolExtensionField_sequence[] = { { &hf_s1ap_ext_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolExtensionID }, { &hf_s1ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_extensionValue , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_T_extensionValue }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ProtocolExtensionField(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ProtocolExtensionField, ProtocolExtensionField_sequence); return offset; } static const per_sequence_t ProtocolExtensionContainer_sequence_of[1] = { { &hf_s1ap_ProtocolExtensionContainer_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolExtensionField }, }; static int dissect_s1ap_ProtocolExtensionContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ProtocolExtensionContainer, ProtocolExtensionContainer_sequence_of, 1, maxProtocolExtensions, FALSE); return offset; } static int dissect_s1ap_T_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); if (s1ap_data->obj_id) { offset = call_per_oid_callback(s1ap_data->obj_id, tvb, actx->pinfo, tree, offset, actx, hf_index); } else { offset = dissect_per_open_type(tvb, offset, actx, tree, hf_index, NULL); } return offset; } static const per_sequence_t PrivateIE_Field_sequence[] = { { &hf_s1ap_private_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PrivateIE_ID }, { &hf_s1ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_value , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_T_value }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PrivateIE_Field(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PrivateIE_Field, PrivateIE_Field_sequence); return offset; } static const per_sequence_t PrivateIE_Container_sequence_of[1] = { { &hf_s1ap_PrivateIE_Container_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PrivateIE_Field }, }; static int dissect_s1ap_PrivateIE_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_PrivateIE_Container, PrivateIE_Container_sequence_of, 1, maxPrivateIEs, FALSE); return offset; } static int dissect_s1ap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); e212_number_type_t number_type = s1ap_data->number_type; s1ap_data->number_type = E212_NONE; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, &parameter_tvb); if(tvb_reported_length(tvb)==0) return offset; if (!parameter_tvb) return offset; dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, number_type, FALSE); if (s1ap_data->supported_ta) { guint32 plmn = tvb_get_ntoh24(parameter_tvb, 0); wmem_array_append_one(s1ap_data->supported_ta->plmn, plmn); } else if (s1ap_data->tai) { s1ap_data->tai->plmn = tvb_get_ntoh24(parameter_tvb, 0); } return offset; } static int dissect_s1ap_MME_Group_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_MME_Code(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, 1, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t GUMMEI_sequence[] = { { &hf_s1ap_pLMN_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_mME_Group_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MME_Group_ID }, { &hf_s1ap_mME_Code , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MME_Code }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_GUMMEI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_GUMMEI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_GUMMEI, GUMMEI_sequence); return offset; } static int dissect_s1ap_M_TMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; proto_item *ti; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 4, 4, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 4, ENC_BIG_ENDIAN); ti = proto_tree_add_item(tree, hf_3gpp_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN); proto_item_set_hidden(ti); } return offset; } static const per_sequence_t Additional_GUTI_sequence[] = { { &hf_s1ap_gUMMEI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GUMMEI }, { &hf_s1ap_m_TMSI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M_TMSI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Additional_GUTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Additional_GUTI, Additional_GUTI_sequence); return offset; } static int dissect_s1ap_AdditionalRRMPriorityIndex(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 32, 32, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string s1ap_AerialUEsubscriptionInformation_vals[] = { { 0, "allowed" }, { 1, "not-allowed" }, { 0, NULL } }; static int dissect_s1ap_AerialUEsubscriptionInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_CellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *cell_id_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 28, 28, FALSE, NULL, 0, &cell_id_tvb, NULL); if (cell_id_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, cell_id_tvb, 0, 4, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t EUTRAN_CGI_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_cell_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellIdentity }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EUTRAN_CGI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_ECGI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EUTRAN_CGI, EUTRAN_CGI_sequence); return offset; } static const per_sequence_t CellIdListforMDT_sequence_of[1] = { { &hf_s1ap_CellIdListforMDT_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, }; static int dissect_s1ap_CellIdListforMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CellIdListforMDT, CellIdListforMDT_sequence_of, 1, maxnoofCellIDforMDT, FALSE); return offset; } static const per_sequence_t CellBasedMDT_sequence[] = { { &hf_s1ap_cellIdListforMDT, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellIdListforMDT }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellBasedMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellBasedMDT, CellBasedMDT_sequence); return offset; } static int dissect_s1ap_TAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); if (s1ap_data->supported_ta) { s1ap_data->supported_ta->tac = tvb_get_ntohs(parameter_tvb, 0); } else if (s1ap_data->tai) { s1ap_data->tai->tac = tvb_get_ntohs(parameter_tvb, 0); } } return offset; } static const per_sequence_t TAListforMDT_sequence_of[1] = { { &hf_s1ap_TAListforMDT_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAC }, }; static int dissect_s1ap_TAListforMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAListforMDT, TAListforMDT_sequence_of, 1, maxnoofTAforMDT, FALSE); return offset; } static const per_sequence_t TABasedMDT_sequence[] = { { &hf_s1ap_tAListforMDT , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAListforMDT }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TABasedMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TABasedMDT, TABasedMDT_sequence); return offset; } static int dissect_s1ap_NULL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_null(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t TAI_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_tAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_TAI; s1ap_data->tai = wmem_new0(actx->pinfo->pool, struct s1ap_tai); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TAI, TAI_sequence); if (!PINFO_FD_VISITED(actx->pinfo) && s1ap_data->s1ap_conv && (s1ap_data->message_type == INITIATING_MESSAGE) && (s1ap_data->procedure_code == id_initialUEMessage)) { guint64 key = (s1ap_data->tai->plmn << 16) | s1ap_data->tai->tac; if (wmem_map_lookup(s1ap_data->s1ap_conv->nbiot_ta, &key)) { wmem_tree_key_t tree_key[3]; guint32 *id = wmem_new(wmem_file_scope(), guint32); *id = s1ap_data->enb_ue_s1ap_id; tree_key[0].length = 1; tree_key[0].key = id; tree_key[1].length = 1; tree_key[1].key = &actx->pinfo->num; tree_key[2].length = 0; tree_key[2].key = NULL; wmem_tree_insert32_array(s1ap_data->s1ap_conv->nbiot_enb_ue_s1ap_id, tree_key, id); } } return offset; } static const per_sequence_t TAIListforMDT_sequence_of[1] = { { &hf_s1ap_TAIListforMDT_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, }; static int dissect_s1ap_TAIListforMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIListforMDT, TAIListforMDT_sequence_of, 1, maxnoofTAforMDT, FALSE); return offset; } static const per_sequence_t TAIBasedMDT_sequence[] = { { &hf_s1ap_tAIListforMDT , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAIListforMDT }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TAIBasedMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIBasedMDT, TAIBasedMDT_sequence); return offset; } static const value_string s1ap_AreaScopeOfMDT_vals[] = { { 0, "cellBased" }, { 1, "tABased" }, { 2, "pLMNWide" }, { 3, "tAIBased" }, { 0, NULL } }; static const per_choice_t AreaScopeOfMDT_choice[] = { { 0, &hf_s1ap_cellBased , ASN1_EXTENSION_ROOT , dissect_s1ap_CellBasedMDT }, { 1, &hf_s1ap_tABased , ASN1_EXTENSION_ROOT , dissect_s1ap_TABasedMDT }, { 2, &hf_s1ap_pLMNWide , ASN1_EXTENSION_ROOT , dissect_s1ap_NULL }, { 3, &hf_s1ap_tAIBased , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_TAIBasedMDT }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_AreaScopeOfMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_AreaScopeOfMDT, AreaScopeOfMDT_choice, NULL); return offset; } static const per_sequence_t CellIdListforQMC_sequence_of[1] = { { &hf_s1ap_CellIdListforQMC_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, }; static int dissect_s1ap_CellIdListforQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CellIdListforQMC, CellIdListforQMC_sequence_of, 1, maxnoofCellIDforQMC, FALSE); return offset; } static const per_sequence_t CellBasedQMC_sequence[] = { { &hf_s1ap_cellIdListforQMC, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellIdListforQMC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellBasedQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellBasedQMC, CellBasedQMC_sequence); return offset; } static const per_sequence_t TAListforQMC_sequence_of[1] = { { &hf_s1ap_TAListforQMC_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAC }, }; static int dissect_s1ap_TAListforQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAListforQMC, TAListforQMC_sequence_of, 1, maxnoofTAforQMC, FALSE); return offset; } static const per_sequence_t TABasedQMC_sequence[] = { { &hf_s1ap_tAListforQMC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAListforQMC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TABasedQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TABasedQMC, TABasedQMC_sequence); return offset; } static const per_sequence_t TAIListforQMC_sequence_of[1] = { { &hf_s1ap_TAIListforQMC_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, }; static int dissect_s1ap_TAIListforQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIListforQMC, TAIListforQMC_sequence_of, 1, maxnoofTAforQMC, FALSE); return offset; } static const per_sequence_t TAIBasedQMC_sequence[] = { { &hf_s1ap_tAIListforQMC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAIListforQMC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TAIBasedQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIBasedQMC, TAIBasedQMC_sequence); return offset; } static const per_sequence_t PLMNListforQMC_sequence_of[1] = { { &hf_s1ap_PLMNListforQMC_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, }; static int dissect_s1ap_PLMNListforQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_PLMNListforQMC, PLMNListforQMC_sequence_of, 1, maxnoofPLMNforQMC, FALSE); return offset; } static const per_sequence_t PLMNAreaBasedQMC_sequence[] = { { &hf_s1ap_plmnListforQMC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNListforQMC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PLMNAreaBasedQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PLMNAreaBasedQMC, PLMNAreaBasedQMC_sequence); return offset; } static const value_string s1ap_AreaScopeOfQMC_vals[] = { { 0, "cellBased" }, { 1, "tABased" }, { 2, "tAIBased" }, { 3, "pLMNAreaBased" }, { 0, NULL } }; static const per_choice_t AreaScopeOfQMC_choice[] = { { 0, &hf_s1ap_cellBased_01 , ASN1_EXTENSION_ROOT , dissect_s1ap_CellBasedQMC }, { 1, &hf_s1ap_tABased_01 , ASN1_EXTENSION_ROOT , dissect_s1ap_TABasedQMC }, { 2, &hf_s1ap_tAIBased_01 , ASN1_EXTENSION_ROOT , dissect_s1ap_TAIBasedQMC }, { 3, &hf_s1ap_pLMNAreaBased , ASN1_EXTENSION_ROOT , dissect_s1ap_PLMNAreaBasedQMC }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_AreaScopeOfQMC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_AreaScopeOfQMC, AreaScopeOfQMC_choice, NULL); return offset; } static const value_string s1ap_PriorityLevel_vals[] = { { 0, "spare" }, { 1, "highest" }, { 14, "lowest" }, { 15, "no-priority" }, { 0, NULL } }; static int dissect_s1ap_PriorityLevel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 15U, NULL, FALSE); return offset; } static const value_string s1ap_Pre_emptionCapability_vals[] = { { 0, "shall-not-trigger-pre-emption" }, { 1, "may-trigger-pre-emption" }, { 0, NULL } }; static int dissect_s1ap_Pre_emptionCapability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const value_string s1ap_Pre_emptionVulnerability_vals[] = { { 0, "not-pre-emptable" }, { 1, "pre-emptable" }, { 0, NULL } }; static int dissect_s1ap_Pre_emptionVulnerability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t AllocationAndRetentionPriority_sequence[] = { { &hf_s1ap_priorityLevel , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PriorityLevel }, { &hf_s1ap_pre_emptionCapability, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Pre_emptionCapability }, { &hf_s1ap_pre_emptionVulnerability, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Pre_emptionVulnerability }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_AllocationAndRetentionPriority(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_AllocationAndRetentionPriority, AllocationAndRetentionPriority_sequence); return offset; } static int dissect_s1ap_CELevel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_CELevel); volatile int saved_offset = offset; if ((s1ap_is_nbiot_ue(actx->pinfo) && (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_AUTOMATIC)) || (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_NBIOT)) { TRY { dissect_lte_rrc_UEPagingCoverageInformation_NB_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } else { TRY { dissect_lte_rrc_UEPagingCoverageInformation_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } offset = saved_offset; } return offset; } static const per_sequence_t CellIdentifierAndCELevelForCECapableUEs_sequence[] = { { &hf_s1ap_global_Cell_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_cELevel , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CELevel }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellIdentifierAndCELevelForCECapableUEs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellIdentifierAndCELevelForCECapableUEs, CellIdentifierAndCELevelForCECapableUEs_sequence); return offset; } static const per_sequence_t AssistanceDataForCECapableUEs_sequence[] = { { &hf_s1ap_cellIdentifierAndCELevelForCECapableUEs, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellIdentifierAndCELevelForCECapableUEs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_AssistanceDataForCECapableUEs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_AssistanceDataForCECapableUEs, AssistanceDataForCECapableUEs_sequence); return offset; } static const per_sequence_t RecommendedCellList_sequence_of[1] = { { &hf_s1ap_RecommendedCellList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_RecommendedCellList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_RecommendedCellList, RecommendedCellList_sequence_of, 1, maxnoofRecommendedCells, FALSE); return offset; } static const per_sequence_t RecommendedCellsForPaging_sequence[] = { { &hf_s1ap_recommendedCellList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RecommendedCellList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RecommendedCellsForPaging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RecommendedCellsForPaging, RecommendedCellsForPaging_sequence); return offset; } static const per_sequence_t AssistanceDataForRecommendedCells_sequence[] = { { &hf_s1ap_recommendedCellsForPaging, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RecommendedCellsForPaging }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_AssistanceDataForRecommendedCells(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_AssistanceDataForRecommendedCells, AssistanceDataForRecommendedCells_sequence); return offset; } static int dissect_s1ap_PagingAttemptCount(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 16U, NULL, TRUE); return offset; } static int dissect_s1ap_IntendedNumberOfPagingAttempts(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 16U, NULL, TRUE); return offset; } static const value_string s1ap_NextPagingAreaScope_vals[] = { { 0, "same" }, { 1, "changed" }, { 0, NULL } }; static int dissect_s1ap_NextPagingAreaScope(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t PagingAttemptInformation_sequence[] = { { &hf_s1ap_pagingAttemptCount, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PagingAttemptCount }, { &hf_s1ap_intendedNumberOfPagingAttempts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_IntendedNumberOfPagingAttempts }, { &hf_s1ap_nextPagingAreaScope, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_NextPagingAreaScope }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PagingAttemptInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PagingAttemptInformation, PagingAttemptInformation_sequence); return offset; } static const per_sequence_t AssistanceDataForPaging_sequence[] = { { &hf_s1ap_assistanceDataForRecommendedCells, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_AssistanceDataForRecommendedCells }, { &hf_s1ap_assistanceDataForCECapableUEs, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_AssistanceDataForCECapableUEs }, { &hf_s1ap_pagingAttemptInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PagingAttemptInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_AssistanceDataForPaging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_AssistanceDataForPaging, AssistanceDataForPaging_sequence); return offset; } static const per_sequence_t Bearers_SubjectToStatusTransferList_sequence_of[1] = { { &hf_s1ap_Bearers_SubjectToStatusTransferList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_Bearers_SubjectToStatusTransferList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_Bearers_SubjectToStatusTransferList, Bearers_SubjectToStatusTransferList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static int dissect_s1ap_E_RAB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 15U, NULL, TRUE); return offset; } static int dissect_s1ap_PDCP_SN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); return offset; } static int dissect_s1ap_HFN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 1048575U, NULL, FALSE); return offset; } static const per_sequence_t COUNTvalue_sequence[] = { { &hf_s1ap_pDCP_SN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PDCP_SN }, { &hf_s1ap_hFN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_HFN }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_COUNTvalue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_COUNTvalue, COUNTvalue_sequence); return offset; } static int dissect_s1ap_ReceiveStatusofULPDCPSDUs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 4096, 4096, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t Bearers_SubjectToStatusTransfer_Item_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_uL_COUNTvalue , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_COUNTvalue }, { &hf_s1ap_dL_COUNTvalue , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_COUNTvalue }, { &hf_s1ap_receiveStatusofULPDCPSDUs, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ReceiveStatusofULPDCPSDUs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Bearers_SubjectToStatusTransfer_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Bearers_SubjectToStatusTransfer_Item, Bearers_SubjectToStatusTransfer_Item_sequence); return offset; } static const per_sequence_t Bearers_SubjectToEarlyStatusTransferList_sequence_of[1] = { { &hf_s1ap_Bearers_SubjectToEarlyStatusTransferList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_Bearers_SubjectToEarlyStatusTransferList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_Bearers_SubjectToEarlyStatusTransferList, Bearers_SubjectToEarlyStatusTransferList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static int dissect_s1ap_PDCP_SNExtended(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 32767U, NULL, FALSE); return offset; } static int dissect_s1ap_HFNModified(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 131071U, NULL, FALSE); return offset; } static const per_sequence_t COUNTValueExtended_sequence[] = { { &hf_s1ap_pDCP_SNExtended, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PDCP_SNExtended }, { &hf_s1ap_hFNModified , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_HFNModified }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_COUNTValueExtended(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_COUNTValueExtended, COUNTValueExtended_sequence); return offset; } static int dissect_s1ap_PDCP_SNlength18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 262143U, NULL, FALSE); return offset; } static int dissect_s1ap_HFNforPDCP_SNlength18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 16383U, NULL, FALSE); return offset; } static const per_sequence_t COUNTvaluePDCP_SNlength18_sequence[] = { { &hf_s1ap_pDCP_SNlength18, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PDCP_SNlength18 }, { &hf_s1ap_hFNforPDCP_SNlength18, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_HFNforPDCP_SNlength18 }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_COUNTvaluePDCP_SNlength18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_COUNTvaluePDCP_SNlength18, COUNTvaluePDCP_SNlength18_sequence); return offset; } static const value_string s1ap_DLCOUNT_PDCP_SNlength_vals[] = { { 0, "dLCOUNTValuePDCP-SNlength12" }, { 1, "dLCOUNTValuePDCP-SNlength15" }, { 2, "dLCOUNTValuePDCP-SNlength18" }, { 0, NULL } }; static const per_choice_t DLCOUNT_PDCP_SNlength_choice[] = { { 0, &hf_s1ap_dLCOUNTValuePDCP_SNlength12, ASN1_EXTENSION_ROOT , dissect_s1ap_COUNTvalue }, { 1, &hf_s1ap_dLCOUNTValuePDCP_SNlength15, ASN1_EXTENSION_ROOT , dissect_s1ap_COUNTValueExtended }, { 2, &hf_s1ap_dLCOUNTValuePDCP_SNlength18, ASN1_EXTENSION_ROOT , dissect_s1ap_COUNTvaluePDCP_SNlength18 }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_DLCOUNT_PDCP_SNlength(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_DLCOUNT_PDCP_SNlength, DLCOUNT_PDCP_SNlength_choice, NULL); return offset; } static const per_sequence_t Bearers_SubjectToEarlyStatusTransfer_Item_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_dLCOUNT_PDCP_SNlength, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_DLCOUNT_PDCP_SNlength }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item, Bearers_SubjectToEarlyStatusTransfer_Item_sequence); return offset; } static const value_string s1ap_BearerType_vals[] = { { 0, "non-IP" }, { 0, NULL } }; static int dissect_s1ap_BearerType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_BitRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index, 0U, G_GUINT64_CONSTANT(10000000000), NULL, FALSE); return offset; } static const value_string s1ap_BluetoothMeasConfig_vals[] = { { 0, "setup" }, { 0, NULL } }; static int dissect_s1ap_BluetoothMeasConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_BluetoothName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, 248, FALSE, &parameter_tvb); actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, -1, ENC_UTF_8|ENC_NA); return offset; } static const per_sequence_t BluetoothMeasConfigNameList_sequence_of[1] = { { &hf_s1ap_BluetoothMeasConfigNameList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_BluetoothName }, }; static int dissect_s1ap_BluetoothMeasConfigNameList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_BluetoothMeasConfigNameList, BluetoothMeasConfigNameList_sequence_of, 1, maxnoofBluetoothName, FALSE); return offset; } static const value_string s1ap_T_bt_rssi_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_T_bt_rssi(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t BluetoothMeasurementConfiguration_sequence[] = { { &hf_s1ap_bluetoothMeasConfig, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BluetoothMeasConfig }, { &hf_s1ap_bluetoothMeasConfigNameList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_BluetoothMeasConfigNameList }, { &hf_s1ap_bt_rssi , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_bt_rssi }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_BluetoothMeasurementConfiguration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_BluetoothMeasurementConfiguration, BluetoothMeasurementConfiguration_sequence); return offset; } static const per_sequence_t BPLMNs_sequence_of[1] = { { &hf_s1ap_BPLMNs_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, }; static int dissect_s1ap_BPLMNs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_BPLMNs, BPLMNs_sequence_of, 1, maxnoofBPLMNs, FALSE); return offset; } static int dissect_s1ap_NumberOfBroadcasts(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static const per_sequence_t CellID_Cancelled_Item_sequence[] = { { &hf_s1ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NumberOfBroadcasts }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellID_Cancelled_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellID_Cancelled_Item, CellID_Cancelled_Item_sequence); return offset; } static const per_sequence_t CellID_Cancelled_sequence_of[1] = { { &hf_s1ap_CellID_Cancelled_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CellID_Cancelled_Item }, }; static int dissect_s1ap_CellID_Cancelled(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CellID_Cancelled, CellID_Cancelled_sequence_of, 1, maxnoofCellID, FALSE); return offset; } static const per_sequence_t CancelledCellinTAI_Item_sequence[] = { { &hf_s1ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NumberOfBroadcasts }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CancelledCellinTAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CancelledCellinTAI_Item, CancelledCellinTAI_Item_sequence); return offset; } static const per_sequence_t CancelledCellinTAI_sequence_of[1] = { { &hf_s1ap_CancelledCellinTAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CancelledCellinTAI_Item }, }; static int dissect_s1ap_CancelledCellinTAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CancelledCellinTAI, CancelledCellinTAI_sequence_of, 1, maxnoofCellinTAI, FALSE); return offset; } static const per_sequence_t TAI_Cancelled_Item_sequence[] = { { &hf_s1ap_tAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_cancelledCellinTAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CancelledCellinTAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TAI_Cancelled_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TAI_Cancelled_Item, TAI_Cancelled_Item_sequence); return offset; } static const per_sequence_t TAI_Cancelled_sequence_of[1] = { { &hf_s1ap_TAI_Cancelled_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI_Cancelled_Item }, }; static int dissect_s1ap_TAI_Cancelled(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAI_Cancelled, TAI_Cancelled_sequence_of, 1, maxnoofTAIforWarning, FALSE); return offset; } static int dissect_s1ap_EmergencyAreaID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, NULL); return offset; } static const per_sequence_t CancelledCellinEAI_Item_sequence[] = { { &hf_s1ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NumberOfBroadcasts }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CancelledCellinEAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CancelledCellinEAI_Item, CancelledCellinEAI_Item_sequence); return offset; } static const per_sequence_t CancelledCellinEAI_sequence_of[1] = { { &hf_s1ap_CancelledCellinEAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CancelledCellinEAI_Item }, }; static int dissect_s1ap_CancelledCellinEAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CancelledCellinEAI, CancelledCellinEAI_sequence_of, 1, maxnoofCellinEAI, FALSE); return offset; } static const per_sequence_t EmergencyAreaID_Cancelled_Item_sequence[] = { { &hf_s1ap_emergencyAreaID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EmergencyAreaID }, { &hf_s1ap_cancelledCellinEAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CancelledCellinEAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EmergencyAreaID_Cancelled_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EmergencyAreaID_Cancelled_Item, EmergencyAreaID_Cancelled_Item_sequence); return offset; } static const per_sequence_t EmergencyAreaID_Cancelled_sequence_of[1] = { { &hf_s1ap_EmergencyAreaID_Cancelled_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EmergencyAreaID_Cancelled_Item }, }; static int dissect_s1ap_EmergencyAreaID_Cancelled(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_EmergencyAreaID_Cancelled, EmergencyAreaID_Cancelled_sequence_of, 1, maxnoofEmergencyAreaID, FALSE); return offset; } static const value_string s1ap_BroadcastCancelledAreaList_vals[] = { { 0, "cellID-Cancelled" }, { 1, "tAI-Cancelled" }, { 2, "emergencyAreaID-Cancelled" }, { 0, NULL } }; static const per_choice_t BroadcastCancelledAreaList_choice[] = { { 0, &hf_s1ap_cellID_Cancelled, ASN1_EXTENSION_ROOT , dissect_s1ap_CellID_Cancelled }, { 1, &hf_s1ap_tAI_Cancelled , ASN1_EXTENSION_ROOT , dissect_s1ap_TAI_Cancelled }, { 2, &hf_s1ap_emergencyAreaID_Cancelled, ASN1_EXTENSION_ROOT , dissect_s1ap_EmergencyAreaID_Cancelled }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_BroadcastCancelledAreaList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_BroadcastCancelledAreaList, BroadcastCancelledAreaList_choice, NULL); return offset; } static const per_sequence_t CellID_Broadcast_Item_sequence[] = { { &hf_s1ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellID_Broadcast_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellID_Broadcast_Item, CellID_Broadcast_Item_sequence); return offset; } static const per_sequence_t CellID_Broadcast_sequence_of[1] = { { &hf_s1ap_CellID_Broadcast_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CellID_Broadcast_Item }, }; static int dissect_s1ap_CellID_Broadcast(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CellID_Broadcast, CellID_Broadcast_sequence_of, 1, maxnoofCellID, FALSE); return offset; } static const per_sequence_t CompletedCellinTAI_Item_sequence[] = { { &hf_s1ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CompletedCellinTAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CompletedCellinTAI_Item, CompletedCellinTAI_Item_sequence); return offset; } static const per_sequence_t CompletedCellinTAI_sequence_of[1] = { { &hf_s1ap_CompletedCellinTAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CompletedCellinTAI_Item }, }; static int dissect_s1ap_CompletedCellinTAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CompletedCellinTAI, CompletedCellinTAI_sequence_of, 1, maxnoofCellinTAI, FALSE); return offset; } static const per_sequence_t TAI_Broadcast_Item_sequence[] = { { &hf_s1ap_tAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_completedCellinTAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CompletedCellinTAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TAI_Broadcast_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TAI_Broadcast_Item, TAI_Broadcast_Item_sequence); return offset; } static const per_sequence_t TAI_Broadcast_sequence_of[1] = { { &hf_s1ap_TAI_Broadcast_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI_Broadcast_Item }, }; static int dissect_s1ap_TAI_Broadcast(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAI_Broadcast, TAI_Broadcast_sequence_of, 1, maxnoofTAIforWarning, FALSE); return offset; } static const per_sequence_t CompletedCellinEAI_Item_sequence[] = { { &hf_s1ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CompletedCellinEAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CompletedCellinEAI_Item, CompletedCellinEAI_Item_sequence); return offset; } static const per_sequence_t CompletedCellinEAI_sequence_of[1] = { { &hf_s1ap_CompletedCellinEAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CompletedCellinEAI_Item }, }; static int dissect_s1ap_CompletedCellinEAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CompletedCellinEAI, CompletedCellinEAI_sequence_of, 1, maxnoofCellinEAI, FALSE); return offset; } static const per_sequence_t EmergencyAreaID_Broadcast_Item_sequence[] = { { &hf_s1ap_emergencyAreaID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EmergencyAreaID }, { &hf_s1ap_completedCellinEAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CompletedCellinEAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EmergencyAreaID_Broadcast_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EmergencyAreaID_Broadcast_Item, EmergencyAreaID_Broadcast_Item_sequence); return offset; } static const per_sequence_t EmergencyAreaID_Broadcast_sequence_of[1] = { { &hf_s1ap_EmergencyAreaID_Broadcast_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EmergencyAreaID_Broadcast_Item }, }; static int dissect_s1ap_EmergencyAreaID_Broadcast(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_EmergencyAreaID_Broadcast, EmergencyAreaID_Broadcast_sequence_of, 1, maxnoofEmergencyAreaID, FALSE); return offset; } static const value_string s1ap_BroadcastCompletedAreaList_vals[] = { { 0, "cellID-Broadcast" }, { 1, "tAI-Broadcast" }, { 2, "emergencyAreaID-Broadcast" }, { 0, NULL } }; static const per_choice_t BroadcastCompletedAreaList_choice[] = { { 0, &hf_s1ap_cellID_Broadcast, ASN1_EXTENSION_ROOT , dissect_s1ap_CellID_Broadcast }, { 1, &hf_s1ap_tAI_Broadcast , ASN1_EXTENSION_ROOT , dissect_s1ap_TAI_Broadcast }, { 2, &hf_s1ap_emergencyAreaID_Broadcast, ASN1_EXTENSION_ROOT , dissect_s1ap_EmergencyAreaID_Broadcast }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_BroadcastCompletedAreaList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_BroadcastCompletedAreaList, BroadcastCompletedAreaList_choice, NULL); return offset; } const value_string s1ap_CauseRadioNetwork_vals[] = { { 0, "unspecified" }, { 1, "tx2relocoverall-expiry" }, { 2, "successful-handover" }, { 3, "release-due-to-eutran-generated-reason" }, { 4, "handover-cancelled" }, { 5, "partial-handover" }, { 6, "ho-failure-in-target-EPC-eNB-or-target-system" }, { 7, "ho-target-not-allowed" }, { 8, "tS1relocoverall-expiry" }, { 9, "tS1relocprep-expiry" }, { 10, "cell-not-available" }, { 11, "unknown-targetID" }, { 12, "no-radio-resources-available-in-target-cell" }, { 13, "unknown-mme-ue-s1ap-id" }, { 14, "unknown-enb-ue-s1ap-id" }, { 15, "unknown-pair-ue-s1ap-id" }, { 16, "handover-desirable-for-radio-reason" }, { 17, "time-critical-handover" }, { 18, "resource-optimisation-handover" }, { 19, "reduce-load-in-serving-cell" }, { 20, "user-inactivity" }, { 21, "radio-connection-with-ue-lost" }, { 22, "load-balancing-tau-required" }, { 23, "cs-fallback-triggered" }, { 24, "ue-not-available-for-ps-service" }, { 25, "radio-resources-not-available" }, { 26, "failure-in-radio-interface-procedure" }, { 27, "invalid-qos-combination" }, { 28, "interrat-redirection" }, { 29, "interaction-with-other-procedure" }, { 30, "unknown-E-RAB-ID" }, { 31, "multiple-E-RAB-ID-instances" }, { 32, "encryption-and-or-integrity-protection-algorithms-not-supported" }, { 33, "s1-intra-system-handover-triggered" }, { 34, "s1-inter-system-handover-triggered" }, { 35, "x2-handover-triggered" }, { 36, "redirection-towards-1xRTT" }, { 37, "not-supported-QCI-value" }, { 38, "invalid-CSG-Id" }, { 39, "release-due-to-pre-emption" }, { 40, "n26-interface-not-available" }, { 41, "insufficient-ue-capabilities" }, { 42, "maximum-bearer-pre-emption-rate-exceeded" }, { 43, "up-integrity-protection-not-possible" }, { 0, NULL } }; static value_string_ext s1ap_CauseRadioNetwork_vals_ext = VALUE_STRING_EXT_INIT(s1ap_CauseRadioNetwork_vals); static int dissect_s1ap_CauseRadioNetwork(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 value; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 36, &value, TRUE, 8, NULL); col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [RadioNetwork-cause=%s]", val_to_str_const(value, s1ap_CauseRadioNetwork_vals, "Unknown")); return offset; } const value_string s1ap_CauseTransport_vals[] = { { 0, "transport-resource-unavailable" }, { 1, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_CauseTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 value; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, &value, TRUE, 0, NULL); col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [Transport-cause=%s]", val_to_str_const(value, s1ap_CauseTransport_vals, "Unknown")); return offset; } const value_string s1ap_CauseNas_vals[] = { { 0, "normal-release" }, { 1, "authentication-failure" }, { 2, "detach" }, { 3, "unspecified" }, { 4, "csg-subscription-expiry" }, { 5, "uE-not-in-PLMN-serving-area" }, { 0, NULL } }; static int dissect_s1ap_CauseNas(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 value; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, &value, TRUE, 2, NULL); col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [NAS-cause=%s]", val_to_str_const(value, s1ap_CauseNas_vals, "Unknown")); return offset; } const value_string s1ap_CauseProtocol_vals[] = { { 0, "transfer-syntax-error" }, { 1, "abstract-syntax-error-reject" }, { 2, "abstract-syntax-error-ignore-and-notify" }, { 3, "message-not-compatible-with-receiver-state" }, { 4, "semantic-error" }, { 5, "abstract-syntax-error-falsely-constructed-message" }, { 6, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_CauseProtocol(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 value; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 7, &value, TRUE, 0, NULL); col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [Protocol-cause=%s]", val_to_str_const(value, s1ap_CauseProtocol_vals, "Unknown")); return offset; } const value_string s1ap_CauseMisc_vals[] = { { 0, "control-processing-overload" }, { 1, "not-enough-user-plane-processing-resources" }, { 2, "hardware-failure" }, { 3, "om-intervention" }, { 4, "unspecified" }, { 5, "unknown-PLMN" }, { 0, NULL } }; static int dissect_s1ap_CauseMisc(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 value; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 6, &value, TRUE, 0, NULL); col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [Misc-cause=%s]", val_to_str_const(value, s1ap_CauseMisc_vals, "Unknown")); return offset; } const value_string s1ap_Cause_vals[] = { { 0, "radioNetwork" }, { 1, "transport" }, { 2, "nas" }, { 3, "protocol" }, { 4, "misc" }, { 0, NULL } }; static const per_choice_t Cause_choice[] = { { 0, &hf_s1ap_radioNetwork , ASN1_EXTENSION_ROOT , dissect_s1ap_CauseRadioNetwork }, { 1, &hf_s1ap_transport , ASN1_EXTENSION_ROOT , dissect_s1ap_CauseTransport }, { 2, &hf_s1ap_nas , ASN1_EXTENSION_ROOT , dissect_s1ap_CauseNas }, { 3, &hf_s1ap_protocol , ASN1_EXTENSION_ROOT , dissect_s1ap_CauseProtocol }, { 4, &hf_s1ap_misc , ASN1_EXTENSION_ROOT , dissect_s1ap_CauseMisc }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_Cause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_Cause, Cause_choice, NULL); return offset; } static const value_string s1ap_CellAccessMode_vals[] = { { 0, "hybrid" }, { 0, NULL } }; static int dissect_s1ap_CellAccessMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_CE_mode_B_SupportIndicator_vals[] = { { 0, "supported" }, { 0, NULL } }; static int dissect_s1ap_CE_mode_B_SupportIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_Cdma2000PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (gcsna_handle) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_Cdma2000PDU); call_dissector(gcsna_handle, parameter_tvb, actx->pinfo, subtree); } return offset; } static const value_string s1ap_Cdma2000RATType_vals[] = { { 0, "hRPD" }, { 1, "onexRTT" }, { 0, NULL } }; static int dissect_s1ap_Cdma2000RATType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_Cdma2000SectorID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { /* 9.2.1.25 * This IE is set to CDMA2000 Reference Cell ID * corresponding to the HRPD/1xRTT sector under * the HRPD AN/1xBS to which the eNB has initiated the UE * to handover to. The CDMA2000 Reference Cell * ID is statically configured in the eNB. */ tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_Cdma2000SectorID); dissect_a21_ie_common(parameter_tvb, actx->pinfo, NULL/* Top tree not needed */, subtree, 0, 0 /* message_type not needed */); return offset; } static const value_string s1ap_Cdma2000HOStatus_vals[] = { { 0, "hOSuccess" }, { 1, "hOFailure" }, { 0, NULL } }; static int dissect_s1ap_Cdma2000HOStatus(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_Cdma2000HORequiredIndication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_Cdma2000HORequiredIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_Cdma2000OneXMEID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static int dissect_s1ap_Cdma2000OneXMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static int dissect_s1ap_Cdma2000OneXPilot(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static const per_sequence_t Cdma2000OneXSRVCCInfo_sequence[] = { { &hf_s1ap_cdma2000OneXMEID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cdma2000OneXMEID }, { &hf_s1ap_cdma2000OneXMSI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cdma2000OneXMSI }, { &hf_s1ap_cdma2000OneXPilot, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cdma2000OneXPilot }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Cdma2000OneXSRVCCInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Cdma2000OneXSRVCCInfo, Cdma2000OneXSRVCCInfo_sequence); return offset; } static int dissect_s1ap_Cdma2000OneXRAND(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static const value_string s1ap_Cell_Size_vals[] = { { 0, "verysmall" }, { 1, "small" }, { 2, "medium" }, { 3, "large" }, { 0, NULL } }; static int dissect_s1ap_Cell_Size(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t CellType_sequence[] = { { &hf_s1ap_cell_Size , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cell_Size }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellType, CellType_sequence); return offset; } static int dissect_s1ap_LAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_CI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 2, 2, FALSE, NULL); return offset; } static int dissect_s1ap_RAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, 1, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t CGI_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_lAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LAC }, { &hf_s1ap_cI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CI }, { &hf_s1ap_rAC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_RAC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CGI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_CGI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CGI, CGI_sequence); return offset; } static const value_string s1ap_CNDomain_vals[] = { { 0, "ps" }, { 1, "cs" }, { 0, NULL } }; static int dissect_s1ap_CNDomain(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const value_string s1ap_CNType_vals[] = { { 0, "fiveGCForbidden" }, { 1, "epc-Forbiddden" }, { 0, NULL } }; static int dissect_s1ap_CNType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 1, NULL); return offset; } static const per_sequence_t CNTypeRestrictions_Item_sequence[] = { { &hf_s1ap_pLMN_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_cNType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CNType }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CNTypeRestrictions_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CNTypeRestrictions_Item, CNTypeRestrictions_Item_sequence); return offset; } static const per_sequence_t CNTypeRestrictions_sequence_of[1] = { { &hf_s1ap_CNTypeRestrictions_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CNTypeRestrictions_Item }, }; static int dissect_s1ap_CNTypeRestrictions(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CNTypeRestrictions, CNTypeRestrictions_sequence_of, 1, maxnoofEPLMNsPlusOne, FALSE); return offset; } static const value_string s1ap_ConcurrentWarningMessageIndicator_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_ConcurrentWarningMessageIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static int dissect_s1ap_En_gNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 22, 32, TRUE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t SupportedTAs_Item_sequence[] = { { &hf_s1ap_tAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAC }, { &hf_s1ap_broadcastPLMNs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BPLMNs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SupportedTAs_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); if (!PINFO_FD_VISITED(actx->pinfo) && (s1ap_data->message_type == INITIATING_MESSAGE) && ((s1ap_data->procedure_code == id_S1Setup) || (s1ap_data->procedure_code == id_ENBConfigurationUpdate))) { s1ap_data->supported_ta = wmem_new0(actx->pinfo->pool, struct s1ap_supported_ta); s1ap_data->supported_ta->plmn = wmem_array_new(actx->pinfo->pool, sizeof(guint32)); } offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SupportedTAs_Item, SupportedTAs_Item_sequence); s1ap_data->supported_ta = NULL; return offset; } static const per_sequence_t SupportedTAs_sequence_of[1] = { { &hf_s1ap_SupportedTAs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_SupportedTAs_Item }, }; static int dissect_s1ap_SupportedTAs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_SupportedTAs, SupportedTAs_sequence_of, 1, maxnoofTACs, FALSE); return offset; } static const per_sequence_t ConnectedengNBItem_sequence[] = { { &hf_s1ap_en_gNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_En_gNB_ID }, { &hf_s1ap_supportedTAs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SupportedTAs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ConnectedengNBItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ConnectedengNBItem, ConnectedengNBItem_sequence); return offset; } static const per_sequence_t ConnectedengNBList_sequence_of[1] = { { &hf_s1ap_ConnectedengNBList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ConnectedengNBItem }, }; static int dissect_s1ap_ConnectedengNBList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ConnectedengNBList, ConnectedengNBList_sequence_of, 1, maxnoofConnectedengNBs, FALSE); return offset; } static int dissect_s1ap_GNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 22, 32, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string s1ap_GNB_Identity_vals[] = { { 0, "gNB-ID" }, { 0, NULL } }; static const per_choice_t GNB_Identity_choice[] = { { 0, &hf_s1ap_gNB_ID_01 , ASN1_EXTENSION_ROOT , dissect_s1ap_GNB_ID }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_GNB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_GNB_Identity, GNB_Identity_choice, NULL); return offset; } static const per_sequence_t Global_GNB_ID_sequence[] = { { &hf_s1ap_pLMN_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_gNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GNB_Identity }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Global_GNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Global_GNB_ID, Global_GNB_ID_sequence); return offset; } static const per_sequence_t GNB_sequence[] = { { &hf_s1ap_global_gNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_GNB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_GNB(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_GNB, GNB_sequence); return offset; } static int dissect_s1ap_BIT_STRING_SIZE_20(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 20, 20, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_BIT_STRING_SIZE_28(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 28, 28, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_BIT_STRING_SIZE_18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 18, 18, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_BIT_STRING_SIZE_21(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 21, 21, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string s1ap_ENB_ID_vals[] = { { 0, "macroENB-ID" }, { 1, "homeENB-ID" }, { 2, "short-macroENB-ID" }, { 3, "long-macroENB-ID" }, { 0, NULL } }; static const per_choice_t ENB_ID_choice[] = { { 0, &hf_s1ap_macroENB_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_BIT_STRING_SIZE_20 }, { 1, &hf_s1ap_homeENB_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_BIT_STRING_SIZE_28 }, { 2, &hf_s1ap_short_macroENB_ID, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_BIT_STRING_SIZE_18 }, { 3, &hf_s1ap_long_macroENB_ID, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_BIT_STRING_SIZE_21 }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_ENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_ENB_ID, ENB_ID_choice, NULL); return offset; } static const per_sequence_t Global_ENB_ID_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_eNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ENB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; int dissect_s1ap_Global_ENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Global_ENB_ID, Global_ENB_ID_sequence); return offset; } static const per_sequence_t NG_eNB_sequence[] = { { &hf_s1ap_global_ng_eNB_ID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_ENB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NG_eNB(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NG_eNB, NG_eNB_sequence); return offset; } static const value_string s1ap_Global_RAN_NODE_ID_vals[] = { { 0, "gNB" }, { 1, "ng-eNB" }, { 0, NULL } }; static const per_choice_t Global_RAN_NODE_ID_choice[] = { { 0, &hf_s1ap_gNB , ASN1_EXTENSION_ROOT , dissect_s1ap_GNB }, { 1, &hf_s1ap_ng_eNB , ASN1_EXTENSION_ROOT , dissect_s1ap_NG_eNB }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_Global_RAN_NODE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_Global_RAN_NODE_ID, Global_RAN_NODE_ID_choice, NULL); return offset; } static int dissect_s1ap_RAN_UE_NGAP_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4294967295U, NULL, FALSE); return offset; } static const per_sequence_t ContextatSource_sequence[] = { { &hf_s1ap_sourceNG_RAN_node_ID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_RAN_NODE_ID }, { &hf_s1ap_rAN_UE_NGAP_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RAN_UE_NGAP_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ContextatSource(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ContextatSource, ContextatSource_sequence); return offset; } static int dissect_s1ap_Correlation_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 4, 4, FALSE, NULL); return offset; } static const value_string s1ap_CSFallbackIndicator_vals[] = { { 0, "cs-fallback-required" }, { 1, "cs-fallback-high-priority" }, { 0, NULL } }; static int dissect_s1ap_CSFallbackIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 1, NULL); return offset; } static const value_string s1ap_AdditionalCSFallbackIndicator_vals[] = { { 0, "no-restriction" }, { 1, "restriction" }, { 0, NULL } }; static int dissect_s1ap_AdditionalCSFallbackIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_CSG_Id(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 27, 27, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t CSG_IdList_Item_sequence[] = { { &hf_s1ap_cSG_Id , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CSG_Id }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CSG_IdList_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CSG_IdList_Item, CSG_IdList_Item_sequence); return offset; } static const per_sequence_t CSG_IdList_sequence_of[1] = { { &hf_s1ap_CSG_IdList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CSG_IdList_Item }, }; static int dissect_s1ap_CSG_IdList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CSG_IdList, CSG_IdList_sequence_of, 1, maxnoofCSGs, FALSE); return offset; } static const value_string s1ap_CSGMembershipStatus_vals[] = { { 0, "member" }, { 1, "not-member" }, { 0, NULL } }; static int dissect_s1ap_CSGMembershipStatus(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const value_string s1ap_Coverage_Level_vals[] = { { 0, "extendedcoverage" }, { 0, NULL } }; static int dissect_s1ap_Coverage_Level(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_TypeOfError_vals[] = { { 0, "not-understood" }, { 1, "missing" }, { 0, NULL } }; static int dissect_s1ap_TypeOfError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_Item_sequence[] = { { &hf_s1ap_iECriticality , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_iE_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_ID }, { &hf_s1ap_typeOfError , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TypeOfError }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CriticalityDiagnostics_IE_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CriticalityDiagnostics_IE_Item, CriticalityDiagnostics_IE_Item_sequence); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_sequence_of[1] = { { &hf_s1ap_CriticalityDiagnostics_IE_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CriticalityDiagnostics_IE_Item }, }; static int dissect_s1ap_CriticalityDiagnostics_IE_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CriticalityDiagnostics_IE_List, CriticalityDiagnostics_IE_List_sequence_of, 1, maxnoofErrors, FALSE); return offset; } static const per_sequence_t CriticalityDiagnostics_sequence[] = { { &hf_s1ap_procedureCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProcedureCode }, { &hf_s1ap_triggeringMessage, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TriggeringMessage }, { &hf_s1ap_procedureCriticality, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_Criticality }, { &hf_s1ap_iEsCriticalityDiagnostics, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_CriticalityDiagnostics_IE_List }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CriticalityDiagnostics(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CriticalityDiagnostics, CriticalityDiagnostics_sequence); return offset; } static const value_string s1ap_T_dAPSIndicator_vals[] = { { 0, "dAPS-HO-required" }, { 0, NULL } }; static int dissect_s1ap_T_dAPSIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t DAPSRequestInfo_sequence[] = { { &hf_s1ap_dAPSIndicator , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_dAPSIndicator }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DAPSRequestInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DAPSRequestInfo, DAPSRequestInfo_sequence); return offset; } static const per_sequence_t DAPSResponseInfoList_sequence_of[1] = { { &hf_s1ap_DAPSResponseInfoList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_DAPSResponseInfoList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_DAPSResponseInfoList, DAPSResponseInfoList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const value_string s1ap_T_dapsresponseindicator_vals[] = { { 0, "dAPS-HO-accepted" }, { 1, "dAPS-HO-not-accepted" }, { 0, NULL } }; static int dissect_s1ap_T_dapsresponseindicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t DAPSResponseInfo_sequence[] = { { &hf_s1ap_dapsresponseindicator, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_dapsresponseindicator }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DAPSResponseInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DAPSResponseInfo, DAPSResponseInfo_sequence); return offset; } static const per_sequence_t DAPSResponseInfoItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_dAPSResponseInfo, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_DAPSResponseInfo }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DAPSResponseInfoItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DAPSResponseInfoItem, DAPSResponseInfoItem_sequence); return offset; } static int dissect_s1ap_DataCodingScheme(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_DataCodingScheme); s1ap_data->data_coding_scheme = dissect_cbs_data_coding_scheme(parameter_tvb, actx->pinfo, subtree, 0); } return offset; } static int dissect_s1ap_DataSize(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 4095U, NULL, TRUE); return offset; } static int dissect_s1ap_DCN_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static int dissect_s1ap_RelativeMMECapacity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static const per_sequence_t ServedDCNsItem_sequence[] = { { &hf_s1ap_dCN_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_DCN_ID }, { &hf_s1ap_relativeDCNCapacity, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RelativeMMECapacity }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ServedDCNsItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedDCNsItem, ServedDCNsItem_sequence); return offset; } static const per_sequence_t ServedDCNs_sequence_of[1] = { { &hf_s1ap_ServedDCNs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ServedDCNsItem }, }; static int dissect_s1ap_ServedDCNs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedDCNs, ServedDCNs_sequence_of, 0, maxnoofDCNs, FALSE); return offset; } static int dissect_s1ap_DL_NAS_MAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t DL_CP_SecurityInformation_sequence[] = { { &hf_s1ap_dl_NAS_MAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_DL_NAS_MAC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DL_CP_SecurityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DL_CP_SecurityInformation, DL_CP_SecurityInformation_sequence); return offset; } static const value_string s1ap_DL_Forwarding_vals[] = { { 0, "dL-Forwarding-proposed" }, { 0, NULL } }; static int dissect_s1ap_DL_Forwarding(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_Direct_Forwarding_Path_Availability_vals[] = { { 0, "directPathAvailable" }, { 0, NULL } }; static int dissect_s1ap_Direct_Forwarding_Path_Availability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_Data_Forwarding_Not_Possible_vals[] = { { 0, "data-Forwarding-not-Possible" }, { 0, NULL } }; static int dissect_s1ap_Data_Forwarding_Not_Possible(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_DLNASPDUDeliveryAckRequest_vals[] = { { 0, "requested" }, { 0, NULL } }; static int dissect_s1ap_DLNASPDUDeliveryAckRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_EARFCN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxEARFCN, NULL, TRUE); return offset; } static const per_sequence_t ECGIList_sequence_of[1] = { { &hf_s1ap_ECGIList_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, }; static int dissect_s1ap_ECGIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ECGIList, ECGIList_sequence_of, 1, maxnoofCellID, FALSE); return offset; } static const per_sequence_t PWSfailedECGIList_sequence_of[1] = { { &hf_s1ap_PWSfailedECGIList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, }; static int dissect_s1ap_PWSfailedECGIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_PWSfailedECGIList, PWSfailedECGIList_sequence_of, 1, maxnoofCellsineNB, FALSE); return offset; } static const value_string s1ap_EDT_Session_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_EDT_Session(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t EmergencyAreaIDList_sequence_of[1] = { { &hf_s1ap_EmergencyAreaIDList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EmergencyAreaID }, }; static int dissect_s1ap_EmergencyAreaIDList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_EmergencyAreaIDList, EmergencyAreaIDList_sequence_of, 1, maxnoofEmergencyAreaID, FALSE); return offset; } static const per_sequence_t ECGI_List_sequence_of[1] = { { &hf_s1ap_ECGI_List_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, }; static int dissect_s1ap_ECGI_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ECGI_List, ECGI_List_sequence_of, 1, maxnoofCellsineNB, FALSE); return offset; } static const per_sequence_t EmergencyAreaIDListForRestart_sequence_of[1] = { { &hf_s1ap_EmergencyAreaIDListForRestart_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EmergencyAreaID }, }; static int dissect_s1ap_EmergencyAreaIDListForRestart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_EmergencyAreaIDListForRestart, EmergencyAreaIDListForRestart_sequence_of, 1, maxnoofRestartEmergencyAreaIDs, FALSE); return offset; } static const value_string s1ap_EmergencyIndicator_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_EmergencyIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t ENB_EarlyStatusTransfer_TransparentContainer_sequence[] = { { &hf_s1ap_bearers_SubjectToEarlyStatusTransferList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Bearers_SubjectToEarlyStatusTransferList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENB_EarlyStatusTransfer_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENB_EarlyStatusTransfer_TransparentContainer, ENB_EarlyStatusTransfer_TransparentContainer_sequence); return offset; } static const per_sequence_t LAI_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_lAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LAC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_LAI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LAI, LAI_sequence); return offset; } static const per_sequence_t GERAN_Cell_ID_sequence[] = { { &hf_s1ap_lAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LAI }, { &hf_s1ap_rAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RAC }, { &hf_s1ap_cI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_GERAN_Cell_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_GERAN_Cell_ID, GERAN_Cell_ID_sequence); return offset; } static const per_sequence_t Global_en_gNB_ID_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_en_gNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_En_gNB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Global_en_gNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Global_en_gNB_ID, Global_en_gNB_ID_sequence); return offset; } static const per_sequence_t GUMMEIList_sequence_of[1] = { { &hf_s1ap_GUMMEIList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_GUMMEI }, }; static int dissect_s1ap_GUMMEIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_GUMMEIList, GUMMEIList_sequence_of, 1, maxnoofMMECs, FALSE); return offset; } static const per_sequence_t ENB_StatusTransfer_TransparentContainer_sequence[] = { { &hf_s1ap_bearers_SubjectToStatusTransferList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Bearers_SubjectToStatusTransferList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENB_StatusTransfer_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENB_StatusTransfer_TransparentContainer, ENB_StatusTransfer_TransparentContainer_sequence); return offset; } static int dissect_s1ap_ENB_UE_S1AP_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 enb_ue_s1ap_id; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 16777215U, &enb_ue_s1ap_id, FALSE); if (hf_index == hf_s1ap_eNB_UE_S1AP_ID) { proto_item *item; item = proto_tree_add_uint(tree, hf_s1ap_ENB_UE_S1AP_ID_PDU, tvb, offset, 0 , enb_ue_s1ap_id ); proto_item_set_hidden(item); } s1ap_data->enb_ue_s1ap_id = (guint16)enb_ue_s1ap_id; return offset; } static int dissect_s1ap_ENBname(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; int length; gboolean is_ascii; offset = dissect_per_PrintableString(tvb, offset, actx, tree, hf_index, 1, 150, TRUE, &parameter_tvb); if (!parameter_tvb) return offset; length = tvb_reported_length(parameter_tvb); is_ascii = tvb_ascii_isprint(parameter_tvb, 0, length); if (is_ascii) proto_item_append_text(actx->created_item," (%s)",tvb_format_text(actx->pinfo->pool, parameter_tvb, 0, length)); return offset; } static int dissect_s1ap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; proto_tree *subtree; gint tvb_len; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 1, 160, TRUE, NULL, 0, &parameter_tvb, NULL); if (!parameter_tvb) return offset; /* Get the length */ tvb_len = tvb_reported_length(parameter_tvb); subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_TransportLayerAddress); if (tvb_len==4) { /* IPv4 */ proto_tree_add_item(subtree, hf_s1ap_transportLayerAddressIPv4, parameter_tvb, 0, 4, ENC_BIG_ENDIAN); } else if (tvb_len==16) { /* IPv6 */ proto_tree_add_item(subtree, hf_s1ap_transportLayerAddressIPv6, parameter_tvb, 0, 16, ENC_NA); } else if (tvb_len==20) { /* IPv4 */ proto_tree_add_item(subtree, hf_s1ap_transportLayerAddressIPv4, parameter_tvb, 0, 4, ENC_BIG_ENDIAN); /* IPv6 */ proto_tree_add_item(subtree, hf_s1ap_transportLayerAddressIPv6, parameter_tvb, 4, 16, ENC_NA); } return offset; } static const per_sequence_t ENBX2TLAs_sequence_of[1] = { { &hf_s1ap_ENBX2TLAs_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, }; static int dissect_s1ap_ENBX2TLAs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBX2TLAs, ENBX2TLAs_sequence_of, 1, maxnoofeNBX2TLAs, FALSE); return offset; } static int dissect_s1ap_EncryptionAlgorithms(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, TRUE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_encryptionAlgorithms_EEA1, &hf_s1ap_encryptionAlgorithms_EEA2, &hf_s1ap_encryptionAlgorithms_EEA3, &hf_s1ap_encryptionAlgorithms_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_EncryptionAlgorithms); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 2, fields, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t EN_DCSONeNBIdentification_sequence[] = { { &hf_s1ap_globaleNBID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_ENB_ID }, { &hf_s1ap_selectedTAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EN_DCSONeNBIdentification(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EN_DCSONeNBIdentification, EN_DCSONeNBIdentification_sequence); return offset; } static const per_sequence_t EN_DCSONengNBIdentification_sequence[] = { { &hf_s1ap_globalengNBID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_en_gNB_ID }, { &hf_s1ap_selectedTAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EN_DCSONengNBIdentification(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EN_DCSONengNBIdentification, EN_DCSONengNBIdentification_sequence); return offset; } static int dissect_s1ap_FiveGSTAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 3, 3, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 3, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t FiveGSTAI_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_fiveGSTAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_FiveGSTAC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_FiveGSTAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_5GSTAI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_FiveGSTAI, FiveGSTAI_sequence); return offset; } static const per_sequence_t EN_DCTransferTypeRequest_sequence[] = { { &hf_s1ap_sourceeNB , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EN_DCSONeNBIdentification }, { &hf_s1ap_targetengNB , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EN_DCSONengNBIdentification }, { &hf_s1ap_targeteNB , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_EN_DCSONeNBIdentification }, { &hf_s1ap_associatedTAI , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TAI }, { &hf_s1ap_broadcast5GSTAI, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_FiveGSTAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EN_DCTransferTypeRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EN_DCTransferTypeRequest, EN_DCTransferTypeRequest_sequence); return offset; } static const per_sequence_t EN_DCTransferTypeReply_sequence[] = { { &hf_s1ap_sourceengNB , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EN_DCSONengNBIdentification }, { &hf_s1ap_targeteNB , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EN_DCSONeNBIdentification }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EN_DCTransferTypeReply(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EN_DCTransferTypeReply, EN_DCTransferTypeReply_sequence); return offset; } static const value_string s1ap_EN_DCSONTransferType_vals[] = { { 0, "request" }, { 1, "reply" }, { 0, NULL } }; static const per_choice_t EN_DCSONTransferType_choice[] = { { 0, &hf_s1ap_request , ASN1_EXTENSION_ROOT , dissect_s1ap_EN_DCTransferTypeRequest }, { 1, &hf_s1ap_reply , ASN1_EXTENSION_ROOT , dissect_s1ap_EN_DCTransferTypeReply }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_EN_DCSONTransferType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_EN_DCSONTransferType, EN_DCSONTransferType_choice, NULL); return offset; } static const value_string s1ap_SONInformationRequest_vals[] = { { 0, "x2TNL-Configuration-Info" }, { 1, "time-Synchronisation-Info" }, { 2, "activate-Muting" }, { 3, "deactivate-Muting" }, { 0, NULL } }; static int dissect_s1ap_SONInformationRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 3, NULL); return offset; } static const per_sequence_t X2TNLConfigurationInfo_sequence[] = { { &hf_s1ap_eNBX2TransportLayerAddresses, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ENBX2TLAs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_X2TNLConfigurationInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_X2TNLConfigurationInfo, X2TNLConfigurationInfo_sequence); return offset; } static const per_sequence_t SONInformationReply_sequence[] = { { &hf_s1ap_x2TNLConfigurationInfo, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_X2TNLConfigurationInfo }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SONInformationReply(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SONInformationReply, SONInformationReply_sequence); return offset; } static int dissect_s1ap_SONInformation_Extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_ProtocolIE_SingleContainer(tvb, offset, actx, tree, hf_index); return offset; } static const value_string s1ap_SONInformation_vals[] = { { 0, "sONInformationRequest" }, { 1, "sONInformationReply" }, { 2, "sONInformation-Extension" }, { 0, NULL } }; static const per_choice_t SONInformation_choice[] = { { 0, &hf_s1ap_sONInformationRequest, ASN1_EXTENSION_ROOT , dissect_s1ap_SONInformationRequest }, { 1, &hf_s1ap_sONInformationReply, ASN1_EXTENSION_ROOT , dissect_s1ap_SONInformationReply }, { 2, &hf_s1ap_sONInformation_Extension, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_SONInformation_Extension }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_SONInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SONInformation, SONInformation_choice, NULL); return offset; } static const per_sequence_t EN_DCSONConfigurationTransfer_sequence[] = { { &hf_s1ap_transfertype , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EN_DCSONTransferType }, { &hf_s1ap_sONInformation , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SONInformation }, { &hf_s1ap_x2TNLConfigInfo, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_X2TNLConfigurationInfo }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EN_DCSONConfigurationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EN_DCSONConfigurationTransfer, EN_DCSONConfigurationTransfer_sequence); return offset; } static const value_string s1ap_EndIndication_vals[] = { { 0, "no-further-data" }, { 1, "further-data-exists" }, { 0, NULL } }; static int dissect_s1ap_EndIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_EnhancedCoverageRestricted_vals[] = { { 0, "restricted" }, { 0, NULL } }; static int dissect_s1ap_EnhancedCoverageRestricted(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_CE_ModeBRestricted_vals[] = { { 0, "restricted" }, { 1, "not-restricted" }, { 0, NULL } }; static int dissect_s1ap_CE_ModeBRestricted(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t EPLMNs_sequence_of[1] = { { &hf_s1ap_EPLMNs_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, }; static int dissect_s1ap_EPLMNs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_EPLMNs, EPLMNs_sequence_of, 1, maxnoofEPLMNs, FALSE); return offset; } static const value_string s1ap_EventType_vals[] = { { 0, "direct" }, { 1, "change-of-serve-cell" }, { 2, "stop-change-of-serve-cell" }, { 0, NULL } }; static int dissect_s1ap_EventType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t E_RABInformationList_sequence_of[1] = { { &hf_s1ap_E_RABInformationList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABInformationList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABInformationList, E_RABInformationList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABInformationListItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_dL_Forwarding , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_DL_Forwarding }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABInformationListItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABInformationListItem, E_RABInformationListItem_sequence); return offset; } static const per_sequence_t E_RABList_sequence_of[1] = { { &hf_s1ap_E_RABList_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABList, E_RABList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_cause , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cause }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABItem, E_RABItem_sequence); return offset; } static int dissect_s1ap_QCI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static const per_sequence_t GBR_QosInformation_sequence[] = { { &hf_s1ap_e_RAB_MaximumBitrateDL, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_e_RAB_MaximumBitrateUL, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_e_RAB_GuaranteedBitrateDL, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_e_RAB_GuaranteedBitrateUL, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_GBR_QosInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_GBR_QosInformation, GBR_QosInformation_sequence); return offset; } static const per_sequence_t E_RABLevelQoSParameters_sequence[] = { { &hf_s1ap_qCI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_QCI }, { &hf_s1ap_allocationRetentionPriority, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_AllocationAndRetentionPriority }, { &hf_s1ap_gbrQosInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_GBR_QosInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABLevelQoSParameters(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABLevelQoSParameters, E_RABLevelQoSParameters_sequence); return offset; } static const per_sequence_t E_RABSecurityResultList_sequence_of[1] = { { &hf_s1ap_E_RABSecurityResultList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABSecurityResultList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSecurityResultList, E_RABSecurityResultList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const value_string s1ap_IntegrityProtectionResult_vals[] = { { 0, "performed" }, { 1, "not-performed" }, { 0, NULL } }; static int dissect_s1ap_IntegrityProtectionResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t SecurityResult_sequence[] = { { &hf_s1ap_integrityProtectionResult, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_IntegrityProtectionResult }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SecurityResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SecurityResult, SecurityResult_sequence); return offset; } static const per_sequence_t E_RABSecurityResultItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_securityResult , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SecurityResult }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABSecurityResultItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSecurityResultItem, E_RABSecurityResultItem_sequence); return offset; } static const per_sequence_t E_RABUsageReportList_sequence_of[1] = { { &hf_s1ap_E_RABUsageReportList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABUsageReportList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABUsageReportList, E_RABUsageReportList_sequence_of, 1, maxnooftimeperiods, FALSE); return offset; } static int dissect_s1ap_T_startTimestamp(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *timestamp_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 4, 4, FALSE, &timestamp_tvb); if (timestamp_tvb) { proto_item_append_text(actx->created_item, " (%s)", tvb_ntp_fmt_ts_sec(timestamp_tvb, 0)); } return offset; } static int dissect_s1ap_T_endTimestamp(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *timestamp_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 4, 4, FALSE, &timestamp_tvb); if (timestamp_tvb) { proto_item_append_text(actx->created_item, " (%s)", tvb_ntp_fmt_ts_sec(timestamp_tvb, 0)); } return offset; } static int dissect_s1ap_INTEGER_0_18446744073709551615(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index, 0U, G_GUINT64_CONSTANT(18446744073709551615), NULL, FALSE); return offset; } static const per_sequence_t E_RABUsageReportItem_sequence[] = { { &hf_s1ap_startTimestamp , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_startTimestamp }, { &hf_s1ap_endTimestamp , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_endTimestamp }, { &hf_s1ap_usageCountUL , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_18446744073709551615 }, { &hf_s1ap_usageCountDL , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_18446744073709551615 }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABUsageReportItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABUsageReportItem, E_RABUsageReportItem_sequence); return offset; } static const value_string s1ap_Ethernet_Type_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_Ethernet_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_EUTRANRoundTripDelayEstimationInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 2047U, NULL, FALSE); return offset; } static int dissect_s1ap_Threshold_RSRP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 97U, NULL, FALSE); return offset; } static int dissect_s1ap_Threshold_RSRQ(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 34U, NULL, FALSE); return offset; } static const value_string s1ap_MeasurementThresholdL1LoggedMDT_vals[] = { { 0, "threshold-RSRP" }, { 1, "threshold-RSRQ" }, { 2, "choice-Extensions" }, { 0, NULL } }; static const per_choice_t MeasurementThresholdL1LoggedMDT_choice[] = { { 0, &hf_s1ap_threshold_RSRP , ASN1_NO_EXTENSIONS , dissect_s1ap_Threshold_RSRP }, { 1, &hf_s1ap_threshold_RSRQ , ASN1_NO_EXTENSIONS , dissect_s1ap_Threshold_RSRQ }, { 2, &hf_s1ap_choice_Extensions, ASN1_NO_EXTENSIONS , dissect_s1ap_ProtocolIE_SingleContainer }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_MeasurementThresholdL1LoggedMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_MeasurementThresholdL1LoggedMDT, MeasurementThresholdL1LoggedMDT_choice, NULL); return offset; } static int dissect_s1ap_Hysteresis(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 30U, NULL, FALSE); return offset; } static const value_string s1ap_TimeToTrigger_vals[] = { { 0, "ms0" }, { 1, "ms40" }, { 2, "ms64" }, { 3, "ms80" }, { 4, "ms100" }, { 5, "ms128" }, { 6, "ms160" }, { 7, "ms256" }, { 8, "ms320" }, { 9, "ms480" }, { 10, "ms512" }, { 11, "ms640" }, { 12, "ms1024" }, { 13, "ms1280" }, { 14, "ms2560" }, { 15, "ms5120" }, { 0, NULL } }; static int dissect_s1ap_TimeToTrigger(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 16, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t EventL1LoggedMDTConfig_sequence[] = { { &hf_s1ap_l1Threshold , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MeasurementThresholdL1LoggedMDT }, { &hf_s1ap_hysteresis , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Hysteresis }, { &hf_s1ap_timeToTrigger , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TimeToTrigger }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EventL1LoggedMDTConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EventL1LoggedMDTConfig, EventL1LoggedMDTConfig_sequence); return offset; } static const value_string s1ap_T_outOfCoverage_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_T_outOfCoverage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_EventTrigger_vals[] = { { 0, "outOfCoverage" }, { 1, "eventL1LoggedMDTConfig" }, { 2, "choice-Extensions" }, { 0, NULL } }; static const per_choice_t EventTrigger_choice[] = { { 0, &hf_s1ap_outOfCoverage , ASN1_NO_EXTENSIONS , dissect_s1ap_T_outOfCoverage }, { 1, &hf_s1ap_eventL1LoggedMDTConfig, ASN1_NO_EXTENSIONS , dissect_s1ap_EventL1LoggedMDTConfig }, { 2, &hf_s1ap_choice_Extensions, ASN1_NO_EXTENSIONS , dissect_s1ap_ProtocolIE_SingleContainer }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_EventTrigger(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_EventTrigger, EventTrigger_choice, NULL); return offset; } static int dissect_s1ap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 181U, NULL, TRUE); return offset; } static int dissect_s1ap_ExpectedIdlePeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 181U, NULL, TRUE); return offset; } static const value_string s1ap_SourceOfUEActivityBehaviourInformation_vals[] = { { 0, "subscription-information" }, { 1, "statistics" }, { 0, NULL } }; static int dissect_s1ap_SourceOfUEActivityBehaviourInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t ExpectedUEActivityBehaviour_sequence[] = { { &hf_s1ap_expectedActivityPeriod, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ExpectedActivityPeriod }, { &hf_s1ap_expectedIdlePeriod, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ExpectedIdlePeriod }, { &hf_s1ap_sourceofUEActivityBehaviourInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_SourceOfUEActivityBehaviourInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ExpectedUEActivityBehaviour(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ExpectedUEActivityBehaviour, ExpectedUEActivityBehaviour_sequence); return offset; } static const value_string s1ap_ExpectedHOInterval_vals[] = { { 0, "sec15" }, { 1, "sec30" }, { 2, "sec60" }, { 3, "sec90" }, { 4, "sec120" }, { 5, "sec180" }, { 6, "long-time" }, { 0, NULL } }; static int dissect_s1ap_ExpectedHOInterval(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 7, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t ExpectedUEBehaviour_sequence[] = { { &hf_s1ap_expectedActivity, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ExpectedUEActivityBehaviour }, { &hf_s1ap_expectedHOInterval, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ExpectedHOInterval }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ExpectedUEBehaviour(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ExpectedUEBehaviour, ExpectedUEBehaviour_sequence); return offset; } static int dissect_s1ap_ExtendedBitRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index, 10000000001U, G_GUINT64_CONSTANT(4000000000000), NULL, TRUE); return offset; } static int dissect_s1ap_ExtendedRNC_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 4096U, 65535U, NULL, FALSE); return offset; } static int dissect_s1ap_ExtendedRepetitionPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 4096U, 131071U, NULL, FALSE); return offset; } static int dissect_s1ap_Extended_UEIdentityIndexValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 14, 14, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_FiveQI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, TRUE); return offset; } static const value_string s1ap_ForbiddenInterRATs_vals[] = { { 0, "all" }, { 1, "geran" }, { 2, "utran" }, { 3, "cdma2000" }, { 4, "geranandutran" }, { 5, "cdma2000andutran" }, { 0, NULL } }; static int dissect_s1ap_ForbiddenInterRATs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 2, NULL); return offset; } static const per_sequence_t ForbiddenTACs_sequence_of[1] = { { &hf_s1ap_ForbiddenTACs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAC }, }; static int dissect_s1ap_ForbiddenTACs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ForbiddenTACs, ForbiddenTACs_sequence_of, 1, maxnoofForbTACs, FALSE); return offset; } static const per_sequence_t ForbiddenTAs_Item_sequence[] = { { &hf_s1ap_pLMN_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_forbiddenTACs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ForbiddenTACs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ForbiddenTAs_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ForbiddenTAs_Item, ForbiddenTAs_Item_sequence); return offset; } static const per_sequence_t ForbiddenTAs_sequence_of[1] = { { &hf_s1ap_ForbiddenTAs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ForbiddenTAs_Item }, }; static int dissect_s1ap_ForbiddenTAs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ForbiddenTAs, ForbiddenTAs_sequence_of, 1, maxnoofEPLMNsPlusOne, FALSE); return offset; } static const per_sequence_t ForbiddenLACs_sequence_of[1] = { { &hf_s1ap_ForbiddenLACs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_LAC }, }; static int dissect_s1ap_ForbiddenLACs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ForbiddenLACs, ForbiddenLACs_sequence_of, 1, maxnoofForbLACs, FALSE); return offset; } static const per_sequence_t ForbiddenLAs_Item_sequence[] = { { &hf_s1ap_pLMN_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_forbiddenLACs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ForbiddenLACs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ForbiddenLAs_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ForbiddenLAs_Item, ForbiddenLAs_Item_sequence); return offset; } static const per_sequence_t ForbiddenLAs_sequence_of[1] = { { &hf_s1ap_ForbiddenLAs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ForbiddenLAs_Item }, }; static int dissect_s1ap_ForbiddenLAs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ForbiddenLAs, ForbiddenLAs_sequence_of, 1, maxnoofEPLMNsPlusOne, FALSE); return offset; } static int dissect_s1ap_GTP_TEID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 4, 4, FALSE, NULL); return offset; } static const value_string s1ap_GUMMEIType_vals[] = { { 0, "native" }, { 1, "mapped" }, { 2, "mappedFrom5G" }, { 0, NULL } }; static int dissect_s1ap_GUMMEIType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 1, NULL); return offset; } static const value_string s1ap_GWContextReleaseIndication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_GWContextReleaseIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_HandoverFlag_vals[] = { { 0, "handoverPreparation" }, { 0, NULL } }; static int dissect_s1ap_HandoverFlag(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t HandoverRestrictionList_sequence[] = { { &hf_s1ap_servingPLMN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_equivalentPLMNs, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_EPLMNs }, { &hf_s1ap_forbiddenTAs , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ForbiddenTAs }, { &hf_s1ap_forbiddenLAs , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ForbiddenLAs }, { &hf_s1ap_forbiddenInterRATs, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ForbiddenInterRATs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverRestrictionList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverRestrictionList, HandoverRestrictionList_sequence); return offset; } static const value_string s1ap_HandoverType_vals[] = { { intralte, "intralte" }, { ltetoutran, "ltetoutran" }, { ltetogeran, "ltetogeran" }, { utrantolte, "utrantolte" }, { gerantolte, "gerantolte" }, { eps_to_5gs, "eps-to-5gs" }, { fivegs_to_eps, "fivegs-to-eps" }, { 0, NULL } }; static int dissect_s1ap_HandoverType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, &s1ap_data->handover_type_value, TRUE, 2, NULL); return offset; } static int dissect_s1ap_Masked_IMEISV(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 64, 64, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_MeasurementsToActivate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_measurementsToActivate_M1, &hf_s1ap_measurementsToActivate_M2, &hf_s1ap_measurementsToActivate_M3, &hf_s1ap_measurementsToActivate_M4, &hf_s1ap_measurementsToActivate_M5, &hf_s1ap_measurementsToActivate_LoggingM1FromEventTriggered, &hf_s1ap_measurementsToActivate_M6, &hf_s1ap_measurementsToActivate_M7, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_MeasurementsToActivate); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 1, fields, ENC_BIG_ENDIAN); } return offset; } static const value_string s1ap_M1ReportingTrigger_vals[] = { { 0, "periodic" }, { 1, "a2eventtriggered" }, { 2, "a2eventtriggered-periodic" }, { 0, NULL } }; static int dissect_s1ap_M1ReportingTrigger(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 1, NULL); return offset; } static const value_string s1ap_MeasurementThresholdA2_vals[] = { { 0, "threshold-RSRP" }, { 1, "threshold-RSRQ" }, { 0, NULL } }; static const per_choice_t MeasurementThresholdA2_choice[] = { { 0, &hf_s1ap_threshold_RSRP , ASN1_EXTENSION_ROOT , dissect_s1ap_Threshold_RSRP }, { 1, &hf_s1ap_threshold_RSRQ , ASN1_EXTENSION_ROOT , dissect_s1ap_Threshold_RSRQ }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_MeasurementThresholdA2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_MeasurementThresholdA2, MeasurementThresholdA2_choice, NULL); return offset; } static const per_sequence_t M1ThresholdEventA2_sequence[] = { { &hf_s1ap_measurementThreshold, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MeasurementThresholdA2 }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M1ThresholdEventA2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M1ThresholdEventA2, M1ThresholdEventA2_sequence); return offset; } static const value_string s1ap_ReportIntervalMDT_vals[] = { { 0, "ms120" }, { 1, "ms240" }, { 2, "ms480" }, { 3, "ms640" }, { 4, "ms1024" }, { 5, "ms2048" }, { 6, "ms5120" }, { 7, "ms10240" }, { 8, "min1" }, { 9, "min6" }, { 10, "min12" }, { 11, "min30" }, { 12, "min60" }, { 0, NULL } }; static int dissect_s1ap_ReportIntervalMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 13, NULL, FALSE, 0, NULL); return offset; } static const value_string s1ap_ReportAmountMDT_vals[] = { { 0, "r1" }, { 1, "r2" }, { 2, "r4" }, { 3, "r8" }, { 4, "r16" }, { 5, "r32" }, { 6, "r64" }, { 7, "rinfinity" }, { 0, NULL } }; static int dissect_s1ap_ReportAmountMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 8, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t M1PeriodicReporting_sequence[] = { { &hf_s1ap_reportInterval , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ReportIntervalMDT }, { &hf_s1ap_reportAmount , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ReportAmountMDT }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M1PeriodicReporting(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M1PeriodicReporting, M1PeriodicReporting_sequence); return offset; } static const per_sequence_t ImmediateMDT_sequence[] = { { &hf_s1ap_measurementsToActivate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MeasurementsToActivate }, { &hf_s1ap_m1reportingTrigger, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M1ReportingTrigger }, { &hf_s1ap_m1thresholdeventA2, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_M1ThresholdEventA2 }, { &hf_s1ap_m1periodicReporting, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_M1PeriodicReporting }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ImmediateMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ImmediateMDT, ImmediateMDT_sequence); return offset; } static int dissect_s1ap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 8, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_IMSI); dissect_e212_imsi(parameter_tvb, actx->pinfo, subtree, 0, tvb_reported_length(parameter_tvb), FALSE); } return offset; } static const per_sequence_t RecommendedENBList_sequence_of[1] = { { &hf_s1ap_RecommendedENBList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_RecommendedENBList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_RecommendedENBList, RecommendedENBList_sequence_of, 1, maxnoofRecommendedENBs, FALSE); return offset; } static const per_sequence_t RecommendedENBsForPaging_sequence[] = { { &hf_s1ap_recommendedENBList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RecommendedENBList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RecommendedENBsForPaging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RecommendedENBsForPaging, RecommendedENBsForPaging_sequence); return offset; } static const per_sequence_t InformationOnRecommendedCellsAndENBsForPaging_sequence[] = { { &hf_s1ap_recommendedCellsForPaging, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RecommendedCellsForPaging }, { &hf_s1ap_recommendENBsForPaging, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RecommendedENBsForPaging }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InformationOnRecommendedCellsAndENBsForPaging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InformationOnRecommendedCellsAndENBsForPaging, InformationOnRecommendedCellsAndENBsForPaging_sequence); return offset; } static int dissect_s1ap_IntegrityProtectionAlgorithms(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, TRUE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_integrityProtectionAlgorithms_EIA1, &hf_s1ap_integrityProtectionAlgorithms_EIA2, &hf_s1ap_integrityProtectionAlgorithms_EIA3, &hf_s1ap_integrityProtectionAlgorithms_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_IntegrityProtectionAlgorithms); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 2, fields, ENC_BIG_ENDIAN); } return offset; } static const value_string s1ap_IntegrityProtectionIndication_vals[] = { { 0, "required" }, { 1, "preferred" }, { 2, "not-needed" }, { 0, NULL } }; static int dissect_s1ap_IntegrityProtectionIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_InterfacesToTrace(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_interfacesToTrace_S1_MME, &hf_s1ap_interfacesToTrace_X2, &hf_s1ap_interfacesToTrace_Uu, &hf_s1ap_interfacesToTrace_F1_C, &hf_s1ap_interfacesToTrace_E1, &hf_s1ap_interfacesToTrace_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_InterfacesToTrace); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 1, fields, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_INTEGER_0_127(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static int dissect_s1ap_INTEGER_1_100(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 100U, NULL, FALSE); return offset; } static int dissect_s1ap_INTEGER_1_1024(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 1024U, NULL, FALSE); return offset; } static int dissect_s1ap_INTEGER_0_maxNARFCN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxNARFCN, NULL, FALSE); return offset; } static const value_string s1ap_T_subcarrierSpacingSSB_vals[] = { { 0, "kHz15" }, { 1, "kHz30" }, { 2, "kHz60" }, { 3, "kHz120" }, { 4, "kHz240" }, { 5, "kHz480" }, { 6, "kHz960" }, { 0, NULL } }; static int dissect_s1ap_T_subcarrierSpacingSSB(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 2, NULL); return offset; } static int dissect_s1ap_INTEGER_1_maxRS_IndexCellQual(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, maxRS_IndexCellQual, NULL, FALSE); return offset; } static int dissect_s1ap_T_sMTC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *ssb_mtc_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &ssb_mtc_tvb); if (ssb_mtc_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_sMTC); dissect_lte_rrc_MTC_SSB_NR_r15_PDU(ssb_mtc_tvb, actx->pinfo, subtree, NULL); } return offset; } static int dissect_s1ap_T_threshRS_Index_r15(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *threshold_list_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &threshold_list_tvb); if (threshold_list_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_threshRS_Index_r15); dissect_lte_rrc_ThresholdListNR_r15_PDU(threshold_list_tvb, actx->pinfo, subtree, NULL); } return offset; } static int dissect_s1ap_T_sSBToMeasure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *ssb_to_meas_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &ssb_to_meas_tvb); if (ssb_to_meas_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_sSBToMeasure); dissect_lte_rrc_SSB_ToMeasure_r15_PDU(ssb_to_meas_tvb, actx->pinfo, subtree, NULL); } return offset; } static int dissect_s1ap_T_sSRSSIMeasurement(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *ss_rssi_meas_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &ss_rssi_meas_tvb); if (ss_rssi_meas_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_sSRSSIMeasurement); dissect_lte_rrc_SS_RSSI_Measurement_r15_PDU(ss_rssi_meas_tvb, actx->pinfo, subtree, NULL); } return offset; } static int dissect_s1ap_T_quantityConfigNR_R15(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *quantity_config_nr_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &quantity_config_nr_tvb); if (quantity_config_nr_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_quantityConfigNR_R15); dissect_lte_rrc_QuantityConfigNR_r15_PDU(quantity_config_nr_tvb, actx->pinfo, subtree, NULL); } return offset; } static int dissect_s1ap_T_excludedCellsToAddModList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *excluded_cells_list_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &excluded_cells_list_tvb); if (excluded_cells_list_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_excludedCellsToAddModList); dissect_lte_rrc_CellsToAddModListNR_r15_PDU(excluded_cells_list_tvb, actx->pinfo, subtree, NULL); } return offset; } static const per_sequence_t InterSystemMeasurementItem_sequence[] = { { &hf_s1ap_freqBandIndicatorNR, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_1_1024 }, { &hf_s1ap_sSBfrequencies , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_maxNARFCN }, { &hf_s1ap_subcarrierSpacingSSB, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_T_subcarrierSpacingSSB }, { &hf_s1ap_maxRSIndexCellQual, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_INTEGER_1_maxRS_IndexCellQual }, { &hf_s1ap_sMTC , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_T_sMTC }, { &hf_s1ap_threshRS_Index_r15, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_T_threshRS_Index_r15 }, { &hf_s1ap_sSBToMeasure , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_T_sSBToMeasure }, { &hf_s1ap_sSRSSIMeasurement, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_T_sSRSSIMeasurement }, { &hf_s1ap_quantityConfigNR_R15, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_T_quantityConfigNR_R15 }, { &hf_s1ap_excludedCellsToAddModList, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_T_excludedCellsToAddModList }, { &hf_s1ap_iE_Extensions , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InterSystemMeasurementItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InterSystemMeasurementItem, InterSystemMeasurementItem_sequence); return offset; } static const per_sequence_t InterSystemMeasurementList_sequence_of[1] = { { &hf_s1ap_InterSystemMeasurementList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_InterSystemMeasurementItem }, }; static int dissect_s1ap_InterSystemMeasurementList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_InterSystemMeasurementList, InterSystemMeasurementList_sequence_of, 1, maxnooffrequencies, FALSE); return offset; } static const per_sequence_t InterSystemMeasurementParameters_sequence[] = { { &hf_s1ap_measurementDuration, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_1_100 }, { &hf_s1ap_interSystemMeasurementList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_InterSystemMeasurementList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InterSystemMeasurementParameters(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InterSystemMeasurementParameters, InterSystemMeasurementParameters_sequence); return offset; } static const per_sequence_t IntersystemMeasurementConfiguration_sequence[] = { { &hf_s1ap_rSRP , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_127 }, { &hf_s1ap_rSRQ , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_127 }, { &hf_s1ap_sINR , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_127 }, { &hf_s1ap_interSystemMeasurementParameters, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_InterSystemMeasurementParameters }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_IntersystemMeasurementConfiguration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_IntersystemMeasurementConfiguration, IntersystemMeasurementConfiguration_sequence); return offset; } static int dissect_s1ap_IntersystemSONConfigurationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (parameter_tvb) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_IntersystemSONConfigurationTransfer); dissect_ngap_SONConfigurationTransfer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } return offset; } static const value_string s1ap_IMSvoiceEPSfallbackfrom5G_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_IMSvoiceEPSfallbackfrom5G(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_IAB_Authorized_vals[] = { { 0, "authorized" }, { 1, "not-authorized" }, { 0, NULL } }; static int dissect_s1ap_IAB_Authorized(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_IAB_Node_Indication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_IAB_Node_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_IAB_Supported_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_IAB_Supported(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_KillAllWarningMessages_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_KillAllWarningMessages(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static int dissect_s1ap_Time_UE_StayedInCell(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); return offset; } static const per_sequence_t LastVisitedEUTRANCellInformation_sequence[] = { { &hf_s1ap_global_Cell_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_cellType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellType }, { &hf_s1ap_time_UE_StayedInCell, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Time_UE_StayedInCell }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LastVisitedEUTRANCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LastVisitedEUTRANCellInformation, LastVisitedEUTRANCellInformation_sequence); return offset; } static int dissect_s1ap_LastVisitedUTRANCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_LastVisitedUTRANCellInformation); volatile int saved_offset = offset; TRY { dissect_ranap_LastVisitedUTRANCell_Item_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = saved_offset; } return offset; } static const value_string s1ap_LastVisitedGERANCellInformation_vals[] = { { 0, "undefined" }, { 0, NULL } }; static const per_choice_t LastVisitedGERANCellInformation_choice[] = { { 0, &hf_s1ap_undefined , ASN1_EXTENSION_ROOT , dissect_s1ap_NULL }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_LastVisitedGERANCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_LastVisitedGERANCellInformation, LastVisitedGERANCellInformation_choice, NULL); return offset; } static int dissect_s1ap_LastVisitedNGRANCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_LastVisitedNGRANCellInformation); volatile int saved_offset = offset; TRY { dissect_ngap_LastVisitedNGRANCellInformation_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = saved_offset; } return offset; } static const value_string s1ap_LastVisitedCell_Item_vals[] = { { 0, "e-UTRAN-Cell" }, { 1, "uTRAN-Cell" }, { 2, "gERAN-Cell" }, { 3, "nG-RAN-Cell" }, { 0, NULL } }; static const per_choice_t LastVisitedCell_Item_choice[] = { { 0, &hf_s1ap_e_UTRAN_Cell , ASN1_EXTENSION_ROOT , dissect_s1ap_LastVisitedEUTRANCellInformation }, { 1, &hf_s1ap_uTRAN_Cell , ASN1_EXTENSION_ROOT , dissect_s1ap_LastVisitedUTRANCellInformation }, { 2, &hf_s1ap_gERAN_Cell , ASN1_EXTENSION_ROOT , dissect_s1ap_LastVisitedGERANCellInformation }, { 3, &hf_s1ap_nG_RAN_Cell , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_LastVisitedNGRANCellInformation }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_LastVisitedCell_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_LastVisitedCell_Item, LastVisitedCell_Item_choice, NULL); return offset; } static int dissect_s1ap_NRCellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 36, 36, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t NR_CGI_sequence[] = { { &hf_s1ap_pLMNIdentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_nRCellIdentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NRCellIdentity }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NR_CGI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->number_type = E212_NRCGI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NR_CGI, NR_CGI_sequence); return offset; } static const per_sequence_t PSCellInformation_sequence[] = { { &hf_s1ap_nCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NR_CGI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PSCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PSCellInformation, PSCellInformation_sequence); return offset; } static int dissect_s1ap_INTEGER_0_40950(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 40950U, NULL, FALSE); return offset; } static const per_sequence_t LastVisitedPSCellInformation_sequence[] = { { &hf_s1ap_pSCellID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PSCellInformation }, { &hf_s1ap_timeStay , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_40950 }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LastVisitedPSCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LastVisitedPSCellInformation, LastVisitedPSCellInformation_sequence); return offset; } static const per_sequence_t LastVisitedPSCellList_sequence_of[1] = { { &hf_s1ap_LastVisitedPSCellList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_LastVisitedPSCellInformation }, }; static int dissect_s1ap_LastVisitedPSCellList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_LastVisitedPSCellList, LastVisitedPSCellList_sequence_of, 1, maxnoofPSCellsPerPrimaryCellinUEHistoryInfo, FALSE); return offset; } static int dissect_s1ap_LPPa_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if ((tvb_reported_length(parameter_tvb)>0)&&(lppa_handle)) call_dissector(lppa_handle, parameter_tvb, actx->pinfo, tree); return offset; } static int dissect_s1ap_LHN_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 32, 256, FALSE, &parameter_tvb); actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, -1, ENC_UTF_8|ENC_NA); return offset; } static const value_string s1ap_Links_to_log_vals[] = { { 0, "uplink" }, { 1, "downlink" }, { 2, "both-uplink-and-downlink" }, { 0, NULL } }; static int dissect_s1ap_Links_to_log(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_T_pattern_period_vals[] = { { 0, "ms1280" }, { 1, "ms2560" }, { 2, "ms5120" }, { 3, "ms10240" }, { 0, NULL } }; static int dissect_s1ap_T_pattern_period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_INTEGER_0_10239_(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 10239U, NULL, TRUE); return offset; } static const per_sequence_t ListeningSubframePattern_sequence[] = { { &hf_s1ap_pattern_period , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_pattern_period }, { &hf_s1ap_pattern_offset , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_10239_ }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ListeningSubframePattern(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ListeningSubframePattern, ListeningSubframePattern_sequence); return offset; } static const value_string s1ap_LoggingInterval_vals[] = { { 0, "ms1280" }, { 1, "ms2560" }, { 2, "ms5120" }, { 3, "ms10240" }, { 4, "ms20480" }, { 5, "ms30720" }, { 6, "ms40960" }, { 7, "ms61440" }, { 0, NULL } }; static int dissect_s1ap_LoggingInterval(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 8, NULL, FALSE, 0, NULL); return offset; } static const value_string s1ap_LoggingDuration_vals[] = { { 0, "m10" }, { 1, "m20" }, { 2, "m40" }, { 3, "m60" }, { 4, "m90" }, { 5, "m120" }, { 0, NULL } }; static int dissect_s1ap_LoggingDuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 6, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t LoggedMDT_sequence[] = { { &hf_s1ap_loggingInterval, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LoggingInterval }, { &hf_s1ap_loggingDuration, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LoggingDuration }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LoggedMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LoggedMDT, LoggedMDT_sequence); return offset; } static int dissect_s1ap_INTEGER_0_255(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static const per_sequence_t MBSFN_ResultToLogInfo_sequence[] = { { &hf_s1ap_mBSFN_AreaId , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_255 }, { &hf_s1ap_carrierFreq , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EARFCN }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MBSFN_ResultToLogInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MBSFN_ResultToLogInfo, MBSFN_ResultToLogInfo_sequence); return offset; } static const per_sequence_t MBSFN_ResultToLog_sequence_of[1] = { { &hf_s1ap_MBSFN_ResultToLog_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_MBSFN_ResultToLogInfo }, }; static int dissect_s1ap_MBSFN_ResultToLog(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_MBSFN_ResultToLog, MBSFN_ResultToLog_sequence_of, 1, maxnoofMBSFNAreaMDT, FALSE); return offset; } static const per_sequence_t LoggedMBSFNMDT_sequence[] = { { &hf_s1ap_loggingInterval, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LoggingInterval }, { &hf_s1ap_loggingDuration, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LoggingDuration }, { &hf_s1ap_mBSFN_ResultToLog, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_MBSFN_ResultToLog }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LoggedMBSFNMDT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LoggedMBSFNMDT, LoggedMBSFNMDT_sequence); return offset; } static const value_string s1ap_LoggedMDTTrigger_vals[] = { { 0, "periodical" }, { 1, "eventTrigger" }, { 0, NULL } }; static const per_choice_t LoggedMDTTrigger_choice[] = { { 0, &hf_s1ap_periodical , ASN1_EXTENSION_ROOT , dissect_s1ap_NULL }, { 1, &hf_s1ap_eventTrigger , ASN1_EXTENSION_ROOT , dissect_s1ap_EventTrigger }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_LoggedMDTTrigger(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_LoggedMDTTrigger, LoggedMDTTrigger_choice, NULL); return offset; } static const value_string s1ap_LTE_M_Indication_vals[] = { { 0, "lte-m" }, { 0, NULL } }; static int dissect_s1ap_LTE_M_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t TACList_In_LTE_NTN_sequence_of[1] = { { &hf_s1ap_TACList_In_LTE_NTN_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAC }, }; static int dissect_s1ap_TACList_In_LTE_NTN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TACList_In_LTE_NTN, TACList_In_LTE_NTN_sequence_of, 1, maxnoofTACsInNTN, FALSE); return offset; } static const per_sequence_t LTE_NTN_TAI_Information_sequence[] = { { &hf_s1ap_servingPLMN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_tACList_In_LTE_NTN, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TACList_In_LTE_NTN }, { &hf_s1ap_uE_Location_Derived_TAC, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TAC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LTE_NTN_TAI_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LTE_NTN_TAI_Information, LTE_NTN_TAI_Information_sequence); return offset; } static const value_string s1ap_M3period_vals[] = { { 0, "ms100" }, { 1, "ms1000" }, { 2, "ms10000" }, { 3, "ms1024" }, { 4, "ms1280" }, { 5, "ms2048" }, { 6, "ms2560" }, { 7, "ms5120" }, { 8, "ms10240" }, { 9, "min1" }, { 0, NULL } }; static int dissect_s1ap_M3period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 7, NULL); return offset; } static const per_sequence_t M3Configuration_sequence[] = { { &hf_s1ap_m3period , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M3period }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M3Configuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M3Configuration, M3Configuration_sequence); return offset; } static const value_string s1ap_M4period_vals[] = { { 0, "ms1024" }, { 1, "ms2048" }, { 2, "ms5120" }, { 3, "ms10240" }, { 4, "min1" }, { 0, NULL } }; static int dissect_s1ap_M4period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t M4Configuration_sequence[] = { { &hf_s1ap_m4period , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M4period }, { &hf_s1ap_m4_links_to_log, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Links_to_log }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M4Configuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M4Configuration, M4Configuration_sequence); return offset; } static const value_string s1ap_M5period_vals[] = { { 0, "ms1024" }, { 1, "ms2048" }, { 2, "ms5120" }, { 3, "ms10240" }, { 4, "min1" }, { 0, NULL } }; static int dissect_s1ap_M5period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t M5Configuration_sequence[] = { { &hf_s1ap_m5period , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M5period }, { &hf_s1ap_m5_links_to_log, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Links_to_log }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M5Configuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M5Configuration, M5Configuration_sequence); return offset; } static const value_string s1ap_M6report_Interval_vals[] = { { 0, "ms1024" }, { 1, "ms2048" }, { 2, "ms5120" }, { 3, "ms10240" }, { 0, NULL } }; static int dissect_s1ap_M6report_Interval(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_M6delay_threshold_vals[] = { { 0, "ms30" }, { 1, "ms40" }, { 2, "ms50" }, { 3, "ms60" }, { 4, "ms70" }, { 5, "ms80" }, { 6, "ms90" }, { 7, "ms100" }, { 8, "ms150" }, { 9, "ms300" }, { 10, "ms500" }, { 11, "ms750" }, { 0, NULL } }; static int dissect_s1ap_M6delay_threshold(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 12, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t M6Configuration_sequence[] = { { &hf_s1ap_m6report_Interval, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M6report_Interval }, { &hf_s1ap_m6delay_threshold, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_M6delay_threshold }, { &hf_s1ap_m6_links_to_log, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Links_to_log }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M6Configuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M6Configuration, M6Configuration_sequence); return offset; } static int dissect_s1ap_M7period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 60U, NULL, TRUE); return offset; } static const per_sequence_t M7Configuration_sequence[] = { { &hf_s1ap_m7period , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M7period }, { &hf_s1ap_m7_links_to_log, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Links_to_log }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_M7Configuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_M7Configuration, M7Configuration_sequence); return offset; } static const value_string s1ap_MDT_Activation_vals[] = { { 0, "immediate-MDT-only" }, { 1, "immediate-MDT-and-Trace" }, { 2, "logged-MDT-only" }, { 3, "logged-MBSFN-MDT" }, { 0, NULL } }; static int dissect_s1ap_MDT_Activation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 1, NULL); return offset; } static int dissect_s1ap_MDT_Location_Info(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_MDT_Location_Info_GNSS, &hf_s1ap_MDT_Location_Info_E_CID, &hf_s1ap_MDT_Location_Info_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_MDT_Location_Info); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 1, fields, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_MDTMode_Extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_ProtocolIE_SingleContainer(tvb, offset, actx, tree, hf_index); return offset; } static const value_string s1ap_MDTMode_vals[] = { { 0, "immediateMDT" }, { 1, "loggedMDT" }, { 2, "mDTMode-Extension" }, { 0, NULL } }; static const per_choice_t MDTMode_choice[] = { { 0, &hf_s1ap_immediateMDT , ASN1_EXTENSION_ROOT , dissect_s1ap_ImmediateMDT }, { 1, &hf_s1ap_loggedMDT , ASN1_EXTENSION_ROOT , dissect_s1ap_LoggedMDT }, { 2, &hf_s1ap_mDTMode_Extension, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_MDTMode_Extension }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_MDTMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_MDTMode, MDTMode_choice, NULL); return offset; } static const per_sequence_t MDT_Configuration_sequence[] = { { &hf_s1ap_mdt_Activation , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MDT_Activation }, { &hf_s1ap_areaScopeOfMDT , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_AreaScopeOfMDT }, { &hf_s1ap_mDTMode , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MDTMode }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MDT_Configuration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MDT_Configuration, MDT_Configuration_sequence); return offset; } static const value_string s1ap_ManagementBasedMDTAllowed_vals[] = { { 0, "allowed" }, { 0, NULL } }; static int dissect_s1ap_ManagementBasedMDTAllowed(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t MDTPLMNList_sequence_of[1] = { { &hf_s1ap_MDTPLMNList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, }; static int dissect_s1ap_MDTPLMNList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_MDTPLMNList, MDTPLMNList_sequence_of, 1, maxnoofMDTPLMNs, FALSE); return offset; } static const value_string s1ap_PrivacyIndicator_vals[] = { { 0, "immediate-MDT" }, { 1, "logged-MDT" }, { 0, NULL } }; static int dissect_s1ap_PrivacyIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_MessageIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 16, 16, FALSE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_MobilityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 32, 32, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_MMEname(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; int length; gboolean is_ascii; offset = dissect_per_PrintableString(tvb, offset, actx, tree, hf_index, 1, 150, TRUE, &parameter_tvb); if (!parameter_tvb) return offset; length = tvb_reported_length(parameter_tvb); is_ascii = tvb_ascii_isprint(parameter_tvb, 0, length); if (is_ascii) proto_item_append_text(actx->created_item," (%s)",tvb_format_text(actx->pinfo->pool, parameter_tvb, 0, length)); return offset; } static const value_string s1ap_MMEPagingTarget_vals[] = { { 0, "global-ENB-ID" }, { 1, "tAI" }, { 0, NULL } }; static const per_choice_t MMEPagingTarget_choice[] = { { 0, &hf_s1ap_global_ENB_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_Global_ENB_ID }, { 1, &hf_s1ap_tAI , ASN1_EXTENSION_ROOT , dissect_s1ap_TAI }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_MMEPagingTarget(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEPagingTarget, MMEPagingTarget_choice, NULL); return offset; } static const value_string s1ap_MMERelaySupportIndicator_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_MMERelaySupportIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_MME_UE_S1AP_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 mme_ue_s1ap_id; offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4294967295U, &mme_ue_s1ap_id, FALSE); if (hf_index == hf_s1ap_mME_UE_S1AP_ID) { proto_item *item; item = proto_tree_add_uint(tree, hf_s1ap_MME_UE_S1AP_ID_PDU, tvb, offset, 0 , mme_ue_s1ap_id ); proto_item_set_hidden(item); } return offset; } static int dissect_s1ap_MSClassmark2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_MSClassmark); de_ms_cm_2(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0); } return offset; } static int dissect_s1ap_MSClassmark3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_MSClassmark); de_ms_cm_3(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0); } return offset; } static const value_string s1ap_MutingAvailabilityIndication_vals[] = { { 0, "available" }, { 1, "unavailable" }, { 0, NULL } }; static int dissect_s1ap_MutingAvailabilityIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_T_muting_pattern_period_vals[] = { { 0, "ms0" }, { 1, "ms1280" }, { 2, "ms2560" }, { 3, "ms5120" }, { 4, "ms10240" }, { 0, NULL } }; static int dissect_s1ap_T_muting_pattern_period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t MutingPatternInformation_sequence[] = { { &hf_s1ap_muting_pattern_period, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_muting_pattern_period }, { &hf_s1ap_muting_pattern_offset, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_10239_ }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MutingPatternInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MutingPatternInformation, MutingPatternInformation_sequence); return offset; } static int dissect_s1ap_MDT_ConfigurationNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (parameter_tvb) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_MDT_ConfigurationNR); dissect_ngap_MDT_Configuration_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } return offset; } static int dissect_s1ap_NAS_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if ((tvb_reported_length(parameter_tvb)>0)&&(nas_eps_handle)) call_dissector(nas_eps_handle,parameter_tvb,actx->pinfo, tree); return offset; } static int dissect_s1ap_NASSecurityParametersfromE_UTRAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_NASSecurityParameters); de_emm_sec_par_from_eutra(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0); } return offset; } static int dissect_s1ap_NASSecurityParameterstoE_UTRAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_NASSecurityParameters); de_emm_sec_par_to_eutra(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0); } return offset; } static const value_string s1ap_NB_IoT_DefaultPagingDRX_vals[] = { { 0, "v128" }, { 1, "v256" }, { 2, "v512" }, { 3, "v1024" }, { 0, NULL } }; static int dissect_s1ap_NB_IoT_DefaultPagingDRX(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_NB_IoT_PagingDRX_vals[] = { { 0, "v32" }, { 1, "v64" }, { 2, "v128" }, { 3, "v256" }, { 4, "v512" }, { 5, "v1024" }, { 0, NULL } }; static int dissect_s1ap_NB_IoT_PagingDRX(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 6, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_NB_IoT_Paging_eDRX_Cycle_vals[] = { { 0, "hf2" }, { 1, "hf4" }, { 2, "hf6" }, { 3, "hf8" }, { 4, "hf10" }, { 5, "hf12" }, { 6, "hf14" }, { 7, "hf16" }, { 8, "hf32" }, { 9, "hf64" }, { 10, "hf128" }, { 11, "hf256" }, { 12, "hf512" }, { 13, "hf1024" }, { 0, NULL } }; static int dissect_s1ap_NB_IoT_Paging_eDRX_Cycle(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 14, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_NB_IoT_PagingTimeWindow_vals[] = { { 0, "s1" }, { 1, "s2" }, { 2, "s3" }, { 3, "s4" }, { 4, "s5" }, { 5, "s6" }, { 6, "s7" }, { 7, "s8" }, { 8, "s9" }, { 9, "s10" }, { 10, "s11" }, { 11, "s12" }, { 12, "s13" }, { 13, "s14" }, { 14, "s15" }, { 15, "s16" }, { 0, NULL } }; static int dissect_s1ap_NB_IoT_PagingTimeWindow(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 16, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t NB_IoT_Paging_eDRXInformation_sequence[] = { { &hf_s1ap_nB_IoT_paging_eDRX_Cycle, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NB_IoT_Paging_eDRX_Cycle }, { &hf_s1ap_nB_IoT_pagingTimeWindow, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_NB_IoT_PagingTimeWindow }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NB_IoT_Paging_eDRXInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NB_IoT_Paging_eDRXInformation, NB_IoT_Paging_eDRXInformation_sequence); return offset; } static int dissect_s1ap_NB_IoT_RLF_Report_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_NB_IoT_RLF_Report_Container); volatile int saved_offset = offset; TRY { dissect_lte_rrc_RLF_Report_NB_r16_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = saved_offset; } return offset; } static int dissect_s1ap_NB_IoT_UEIdentityIndexValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 12, 12, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string s1ap_NotifySourceeNB_vals[] = { { 0, "notifySource" }, { 0, NULL } }; static int dissect_s1ap_NotifySourceeNB(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_NRencryptionAlgorithms(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, TRUE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { static int * const fields[] = { &hf_s1ap_NRencryptionAlgorithms_NEA1, &hf_s1ap_NRencryptionAlgorithms_NEA2, &hf_s1ap_NRencryptionAlgorithms_NEA3, &hf_s1ap_NRencryptionAlgorithms_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_NRencryptionAlgorithms); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 2, fields, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_NRintegrityProtectionAlgorithms(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, TRUE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { static int * const fields[] = { &hf_s1ap_NRintegrityProtectionAlgorithms_NIA1, &hf_s1ap_NRintegrityProtectionAlgorithms_NIA2, &hf_s1ap_NRintegrityProtectionAlgorithms_NIA3, &hf_s1ap_NRintegrityProtectionAlgorithms_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_NRintegrityProtectionAlgorithms); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 2, fields, ENC_BIG_ENDIAN); } return offset; } static const value_string s1ap_NRrestrictioninEPSasSecondaryRAT_vals[] = { { 0, "nRrestrictedinEPSasSecondaryRAT" }, { 0, NULL } }; static int dissect_s1ap_NRrestrictioninEPSasSecondaryRAT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_NRrestrictionin5GS_vals[] = { { 0, "nRrestrictedin5GS" }, { 0, NULL } }; static int dissect_s1ap_NRrestrictionin5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t NRUESecurityCapabilities_sequence[] = { { &hf_s1ap_nRencryptionAlgorithms, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NRencryptionAlgorithms }, { &hf_s1ap_nRintegrityProtectionAlgorithms, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NRintegrityProtectionAlgorithms }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NRUESecurityCapabilities(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NRUESecurityCapabilities, NRUESecurityCapabilities_sequence); return offset; } static int dissect_s1ap_NumberofBroadcastRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static const value_string s1ap_VehicleUE_vals[] = { { 0, "authorized" }, { 1, "not-authorized" }, { 0, NULL } }; static int dissect_s1ap_VehicleUE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_PedestrianUE_vals[] = { { 0, "authorized" }, { 1, "not-authorized" }, { 0, NULL } }; static int dissect_s1ap_PedestrianUE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t NRV2XServicesAuthorized_sequence[] = { { &hf_s1ap_vehicleUE , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_VehicleUE }, { &hf_s1ap_pedestrianUE , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PedestrianUE }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NRV2XServicesAuthorized(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NRV2XServicesAuthorized, NRV2XServicesAuthorized_sequence); return offset; } static const per_sequence_t NRUESidelinkAggregateMaximumBitrate_sequence[] = { { &hf_s1ap_uEaggregateMaximumBitRate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NRUESidelinkAggregateMaximumBitrate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NRUESidelinkAggregateMaximumBitrate, NRUESidelinkAggregateMaximumBitrate_sequence); return offset; } static const value_string s1ap_OverloadAction_vals[] = { { 0, "reject-non-emergency-mo-dt" }, { 1, "reject-rrc-cr-signalling" }, { 2, "permit-emergency-sessions-and-mobile-terminated-services-only" }, { 3, "permit-high-priority-sessions-and-mobile-terminated-services-only" }, { 4, "reject-delay-tolerant-access" }, { 5, "permit-high-priority-sessions-and-exception-reporting-and-mobile-terminated-services-only" }, { 6, "not-accept-mo-data-or-delay-tolerant-access-from-CP-CIoT" }, { 0, NULL } }; static int dissect_s1ap_OverloadAction(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 4, NULL); return offset; } static const value_string s1ap_OverloadResponse_vals[] = { { 0, "overloadAction" }, { 0, NULL } }; static const per_choice_t OverloadResponse_choice[] = { { 0, &hf_s1ap_overloadAction , ASN1_EXTENSION_ROOT , dissect_s1ap_OverloadAction }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_OverloadResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_OverloadResponse, OverloadResponse_choice, NULL); return offset; } static int dissect_s1ap_Packet_LossRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 1000U, NULL, FALSE); return offset; } static const value_string s1ap_Paging_eDRX_Cycle_vals[] = { { 0, "hfhalf" }, { 1, "hf1" }, { 2, "hf2" }, { 3, "hf4" }, { 4, "hf6" }, { 5, "hf8" }, { 6, "hf10" }, { 7, "hf12" }, { 8, "hf14" }, { 9, "hf16" }, { 10, "hf32" }, { 11, "hf64" }, { 12, "hf128" }, { 13, "hf256" }, { 0, NULL } }; static int dissect_s1ap_Paging_eDRX_Cycle(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 14, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_PagingTimeWindow_vals[] = { { 0, "s1" }, { 1, "s2" }, { 2, "s3" }, { 3, "s4" }, { 4, "s5" }, { 5, "s6" }, { 6, "s7" }, { 7, "s8" }, { 8, "s9" }, { 9, "s10" }, { 10, "s11" }, { 11, "s12" }, { 12, "s13" }, { 13, "s14" }, { 14, "s15" }, { 15, "s16" }, { 0, NULL } }; static int dissect_s1ap_PagingTimeWindow(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 16, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t Paging_eDRXInformation_sequence[] = { { &hf_s1ap_paging_eDRX_Cycle, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Paging_eDRX_Cycle }, { &hf_s1ap_pagingTimeWindow, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PagingTimeWindow }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Paging_eDRXInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Paging_eDRXInformation, Paging_eDRXInformation_sequence); return offset; } static const value_string s1ap_PagingDRX_vals[] = { { 0, "v32" }, { 1, "v64" }, { 2, "v128" }, { 3, "v256" }, { 0, NULL } }; static int dissect_s1ap_PagingDRX(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_PagingPriority_vals[] = { { 0, "priolevel1" }, { 1, "priolevel2" }, { 2, "priolevel3" }, { 3, "priolevel4" }, { 4, "priolevel5" }, { 5, "priolevel6" }, { 6, "priolevel7" }, { 7, "priolevel8" }, { 0, NULL } }; static int dissect_s1ap_PagingPriority(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 8, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_PagingProbabilityInformation_vals[] = { { 0, "p00" }, { 1, "p05" }, { 2, "p10" }, { 3, "p15" }, { 4, "p20" }, { 5, "p25" }, { 6, "p30" }, { 7, "p35" }, { 8, "p40" }, { 9, "p45" }, { 10, "p50" }, { 11, "p55" }, { 12, "p60" }, { 13, "p65" }, { 14, "p70" }, { 15, "p75" }, { 16, "p80" }, { 17, "p85" }, { 18, "p90" }, { 19, "p95" }, { 20, "p100" }, { 0, NULL } }; static int dissect_s1ap_PagingProbabilityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 21, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_PagingCause_vals[] = { { 0, "voice" }, { 0, NULL } }; static int dissect_s1ap_PagingCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t PC5FlowBitRates_sequence[] = { { &hf_s1ap_guaranteedFlowBitRate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_maximumFlowBitRate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PC5FlowBitRates(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PC5FlowBitRates, PC5FlowBitRates_sequence); return offset; } static const value_string s1ap_Range_vals[] = { { 0, "m50" }, { 1, "m80" }, { 2, "m180" }, { 3, "m200" }, { 4, "m350" }, { 5, "m400" }, { 6, "m500" }, { 7, "m700" }, { 8, "m1000" }, { 0, NULL } }; static int dissect_s1ap_Range(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 9, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t PC5QoSFlowItem_sequence[] = { { &hf_s1ap_pQI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_FiveQI }, { &hf_s1ap_pc5FlowBitRates, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PC5FlowBitRates }, { &hf_s1ap_range , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_Range }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PC5QoSFlowItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PC5QoSFlowItem, PC5QoSFlowItem_sequence); return offset; } static const per_sequence_t PC5QoSFlowList_sequence_of[1] = { { &hf_s1ap_PC5QoSFlowList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PC5QoSFlowItem }, }; static int dissect_s1ap_PC5QoSFlowList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_PC5QoSFlowList, PC5QoSFlowList_sequence_of, 1, maxnoofPC5QoSFlows, FALSE); return offset; } static const per_sequence_t PC5QoSParameters_sequence[] = { { &hf_s1ap_pc5QoSFlowList , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PC5QoSFlowList }, { &hf_s1ap_pc5LinkAggregatedBitRates, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_BitRate }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PC5QoSParameters(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PC5QoSParameters, PC5QoSParameters_sequence); return offset; } static const value_string s1ap_PendingDataIndication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_PendingDataIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_Port_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static const value_string s1ap_ProSeDirectDiscovery_vals[] = { { 0, "authorized" }, { 1, "not-authorized" }, { 0, NULL } }; static int dissect_s1ap_ProSeDirectDiscovery(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_ProSeDirectCommunication_vals[] = { { 0, "authorized" }, { 1, "not-authorized" }, { 0, NULL } }; static int dissect_s1ap_ProSeDirectCommunication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t ProSeAuthorized_sequence[] = { { &hf_s1ap_proSeDirectDiscovery, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProSeDirectDiscovery }, { &hf_s1ap_proSeDirectCommunication, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProSeDirectCommunication }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ProSeAuthorized(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ProSeAuthorized, ProSeAuthorized_sequence); return offset; } static const value_string s1ap_ProSeUEtoNetworkRelaying_vals[] = { { 0, "authorized" }, { 1, "not-authorized" }, { 0, NULL } }; static int dissect_s1ap_ProSeUEtoNetworkRelaying(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_PS_ServiceNotAvailable_vals[] = { { 0, "ps-service-not-available" }, { 0, NULL } }; static int dissect_s1ap_PS_ServiceNotAvailable(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_RACSIndication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_RACSIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_ReceiveStatusOfULPDCPSDUsExtended(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 1, 16384, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 1, 131072, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_INTEGER_0_4095(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); return offset; } static const per_sequence_t RecommendedCellItem_sequence[] = { { &hf_s1ap_eUTRAN_CGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_timeStayedInCell, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_4095 }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RecommendedCellItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RecommendedCellItem, RecommendedCellItem_sequence); return offset; } static const per_sequence_t RecommendedENBItem_sequence[] = { { &hf_s1ap_mMEPagingTarget, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MMEPagingTarget }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RecommendedENBItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RecommendedENBItem, RecommendedENBItem_sequence); return offset; } static const value_string s1ap_RelayNode_Indicator_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_RelayNode_Indicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_T_rAT_RestrictionInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, TRUE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_rAT_RestrictionInformation_LEO, &hf_s1ap_rAT_RestrictionInformation_MEO, &hf_s1ap_rAT_RestrictionInformation_GEO, &hf_s1ap_rAT_RestrictionInformation_OTHERSAT, &hf_s1ap_rAT_RestrictionInformation_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_rAT_RestrictionInformation); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 1, fields, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t RAT_RestrictionsItem_sequence[] = { { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, { &hf_s1ap_rAT_RestrictionInformation, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_rAT_RestrictionInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RAT_RestrictionsItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RAT_RestrictionsItem, RAT_RestrictionsItem_sequence); return offset; } static const per_sequence_t RAT_Restrictions_sequence_of[1] = { { &hf_s1ap_RAT_Restrictions_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_RAT_RestrictionsItem }, }; static int dissect_s1ap_RAT_Restrictions(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_RAT_Restrictions, RAT_Restrictions_sequence_of, 1, maxnoofEPLMNsPlusOne, FALSE); return offset; } static const value_string s1ap_RAT_Type_vals[] = { { nbiot, "nbiot" }, { nbiot_leo, "nbiot-leo" }, { nbiot_meo, "nbiot-meo" }, { nbiot_geo, "nbiot-geo" }, { nbiot_othersat, "nbiot-othersat" }, { eutran_leo, "eutran-leo" }, { eutran_meo, "eutran-meo" }, { eutran_geo, "eutran-geo" }, { eutran_othersat, "eutran-othersat" }, { 0, NULL } }; static int dissect_s1ap_RAT_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 rat_type = 0xffffffff; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, &rat_type, TRUE, 8, NULL); if (s1ap_data->s1ap_conv && s1ap_data->supported_ta && rat_type <= nbiot_othersat) { guint64 *key; guint i; for (i = 0; i < wmem_array_get_count(s1ap_data->supported_ta->plmn); i++) { key = wmem_new(wmem_file_scope(), guint64); *key = ((*(guint32*)wmem_array_index(s1ap_data->supported_ta->plmn, i)) << 16) | s1ap_data->supported_ta->tac; wmem_map_insert(s1ap_data->s1ap_conv->nbiot_ta, key, GUINT_TO_POINTER(1)); } } return offset; } static const value_string s1ap_ReportArea_vals[] = { { 0, "ecgi" }, { 0, NULL } }; static int dissect_s1ap_ReportArea(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t RequestType_sequence[] = { { &hf_s1ap_eventType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EventType }, { &hf_s1ap_reportArea , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ReportArea }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RequestType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RequestType, RequestType_sequence); return offset; } static const value_string s1ap_RequestTypeAdditionalInfo_vals[] = { { 0, "includePSCell" }, { 0, NULL } }; static int dissect_s1ap_RequestTypeAdditionalInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_RIMInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_RIMInformation); if ((tvb_reported_length(parameter_tvb)>0)&&(bssgp_handle)){ col_set_fence(actx->pinfo->cinfo, COL_INFO); call_dissector(bssgp_handle,parameter_tvb,actx->pinfo, subtree); } return offset; } static int dissect_s1ap_RNC_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); return offset; } static const per_sequence_t TargetRNC_ID_sequence[] = { { &hf_s1ap_lAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_LAI }, { &hf_s1ap_rAC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_RAC }, { &hf_s1ap_rNC_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RNC_ID }, { &hf_s1ap_extendedRNC_ID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ExtendedRNC_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TargetRNC_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TargetRNC_ID, TargetRNC_ID_sequence); return offset; } static int dissect_s1ap_OCTET_STRING_SIZE_16(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL); return offset; } static const value_string s1ap_RIMRoutingAddress_vals[] = { { 0, "gERAN-Cell-ID" }, { 1, "targetRNC-ID" }, { 2, "eHRPD-Sector-ID" }, { 0, NULL } }; static const per_choice_t RIMRoutingAddress_choice[] = { { 0, &hf_s1ap_gERAN_Cell_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_GERAN_Cell_ID }, { 1, &hf_s1ap_targetRNC_ID , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_TargetRNC_ID }, { 2, &hf_s1ap_eHRPD_Sector_ID, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_OCTET_STRING_SIZE_16 }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_RIMRoutingAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_RIMRoutingAddress, RIMRoutingAddress_choice, NULL); return offset; } static const per_sequence_t RIMTransfer_sequence[] = { { &hf_s1ap_rIMInformation , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RIMInformation }, { &hf_s1ap_rIMRoutingAddress, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_RIMRoutingAddress }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RIMTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RIMTransfer, RIMTransfer_sequence); return offset; } static int dissect_s1ap_RepetitionPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); return offset; } static int dissect_s1ap_UE_RLF_Report_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UE_RLF_Report_Container); volatile int saved_offset = offset; TRY { dissect_lte_rrc_RLF_Report_r9_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = saved_offset; } return offset; } static int dissect_s1ap_UE_RLF_Report_Container_for_extended_bands(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UE_RLF_Report_Container_for_extended_bands); volatile int saved_offset = offset; TRY { dissect_lte_rrc_RLF_Report_v9e0_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = saved_offset; } return offset; } static const per_sequence_t RLFReportInformation_sequence[] = { { &hf_s1ap_uE_RLF_Report_Container, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_UE_RLF_Report_Container }, { &hf_s1ap_uE_RLF_Report_Container_for_extended_bands, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_UE_RLF_Report_Container_for_extended_bands }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RLFReportInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RLFReportInformation, RLFReportInformation_sequence); return offset; } static int dissect_s1ap_RRC_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_RRCContainer); volatile int saved_offset = offset; switch(s1ap_data->transparent_container_type){ case SOURCE_TO_TARGET_TRANSPARENT_CONTAINER: /* 9.2.1.7 Source eNB to Target eNB Transparent Container */ if ((s1ap_is_nbiot_ue(actx->pinfo) && (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_AUTOMATIC)) || (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_NBIOT)) { TRY { dissect_lte_rrc_HandoverPreparationInformation_NB_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } else { TRY { dissect_lte_rrc_HandoverPreparationInformation_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } break; case TARGET_TO_SOURCE_TRANSPARENT_CONTAINER: /* 9.2.1.8 Target eNB to Source eNB Transparent Container */ TRY { dissect_lte_rrc_HandoverCommand_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; break; default: break; } offset = saved_offset; } return offset; } static const value_string s1ap_RRC_Establishment_Cause_vals[] = { { 0, "emergency" }, { 1, "highPriorityAccess" }, { 2, "mt-Access" }, { 3, "mo-Signalling" }, { 4, "mo-Data" }, { 5, "delay-TolerantAccess" }, { 6, "mo-VoiceCall" }, { 7, "mo-ExceptionData" }, { 0, NULL } }; static int dissect_s1ap_RRC_Establishment_Cause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 3, NULL); return offset; } static const per_sequence_t ECGIListForRestart_sequence_of[1] = { { &hf_s1ap_ECGIListForRestart_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, }; static int dissect_s1ap_ECGIListForRestart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ECGIListForRestart, ECGIListForRestart_sequence_of, 1, maxnoofCellsforRestart, FALSE); return offset; } static int dissect_s1ap_Routing_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static int dissect_s1ap_SecurityKey(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 256, 256, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_INTEGER_0_7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 7U, NULL, FALSE); return offset; } static const per_sequence_t SecurityContext_sequence[] = { { &hf_s1ap_nextHopChainingCount, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_7 }, { &hf_s1ap_nextHopParameter, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SecurityKey }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SecurityContext(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SecurityContext, SecurityContext_sequence); return offset; } static const value_string s1ap_SecondaryRATType_vals[] = { { 0, "nR" }, { 1, "unlicensed" }, { 0, NULL } }; static int dissect_s1ap_SecondaryRATType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 1, NULL); return offset; } static const value_string s1ap_SecondaryRATDataUsageRequest_vals[] = { { 0, "requested" }, { 0, NULL } }; static int dissect_s1ap_SecondaryRATDataUsageRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t SecondaryRATDataUsageReportList_sequence_of[1] = { { &hf_s1ap_SecondaryRATDataUsageReportList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_SecondaryRATDataUsageReportList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_SecondaryRATDataUsageReportList, SecondaryRATDataUsageReportList_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t SecondaryRATDataUsageReportItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_secondaryRATType, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SecondaryRATType }, { &hf_s1ap_e_RABUsageReportList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RABUsageReportList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SecondaryRATDataUsageReportItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SecondaryRATDataUsageReportItem, SecondaryRATDataUsageReportItem_sequence); return offset; } static const per_sequence_t SecurityIndication_sequence[] = { { &hf_s1ap_integrityProtectionIndication, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_IntegrityProtectionIndication }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SecurityIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SecurityIndication, SecurityIndication_sequence); return offset; } static const value_string s1ap_SensorMeasConfig_vals[] = { { 0, "setup" }, { 0, NULL } }; static int dissect_s1ap_SensorMeasConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_T_uncompensatedBarometricConfig_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_T_uncompensatedBarometricConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_SensorNameConfig_vals[] = { { 0, "uncompensatedBarometricConfig" }, { 1, "choice-Extensions" }, { 0, NULL } }; static const per_choice_t SensorNameConfig_choice[] = { { 0, &hf_s1ap_uncompensatedBarometricConfig, ASN1_NO_EXTENSIONS , dissect_s1ap_T_uncompensatedBarometricConfig }, { 1, &hf_s1ap_choice_Extensions, ASN1_NO_EXTENSIONS , dissect_s1ap_ProtocolIE_SingleContainer }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_SensorNameConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SensorNameConfig, SensorNameConfig_choice, NULL); return offset; } static const per_sequence_t SensorMeasConfigNameItem_sequence[] = { { &hf_s1ap_sensorNameConfig, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SensorNameConfig }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SensorMeasConfigNameItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SensorMeasConfigNameItem, SensorMeasConfigNameItem_sequence); return offset; } static const per_sequence_t SensorMeasConfigNameList_sequence_of[1] = { { &hf_s1ap_SensorMeasConfigNameList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_SensorMeasConfigNameItem }, }; static int dissect_s1ap_SensorMeasConfigNameList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_SensorMeasConfigNameList, SensorMeasConfigNameList_sequence_of, 1, maxnoofSensorName, FALSE); return offset; } static const per_sequence_t SensorMeasurementConfiguration_sequence[] = { { &hf_s1ap_sensorMeasConfig, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SensorMeasConfig }, { &hf_s1ap_sensorMeasConfigNameList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_SensorMeasConfigNameList }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SensorMeasurementConfiguration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SensorMeasurementConfiguration, SensorMeasurementConfiguration_sequence); return offset; } static int dissect_s1ap_SerialNumber(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_SerialNumber); proto_tree_add_item(subtree, hf_s1ap_SerialNumber_gs, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_s1ap_SerialNumber_msg_code, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_s1ap_SerialNumber_upd_nb, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static const value_string s1ap_ServiceType_vals[] = { { 0, "qMC-for-streaming-service" }, { 1, "qMC-for-MTSI-service" }, { 0, NULL } }; static int dissect_s1ap_ServiceType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_SONInformationReport_vals[] = { { 0, "rLFReportInformation" }, { 0, NULL } }; static const per_choice_t SONInformationReport_choice[] = { { 0, &hf_s1ap_rLFReportInformation, ASN1_EXTENSION_ROOT , dissect_s1ap_RLFReportInformation }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_SONInformationReport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SONInformationReport, SONInformationReport_choice, NULL); return offset; } static const per_sequence_t TargeteNB_ID_sequence[] = { { &hf_s1ap_global_ENB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_ENB_ID }, { &hf_s1ap_selected_TAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TargeteNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TargeteNB_ID, TargeteNB_ID_sequence); return offset; } static const per_sequence_t SourceeNB_ID_sequence[] = { { &hf_s1ap_global_ENB_ID , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_ENB_ID }, { &hf_s1ap_selected_TAI , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_iE_Extensions , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SourceeNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SourceeNB_ID, SourceeNB_ID_sequence); return offset; } static const per_sequence_t SONConfigurationTransfer_sequence[] = { { &hf_s1ap_targeteNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TargeteNB_ID }, { &hf_s1ap_sourceeNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SourceeNB_ID }, { &hf_s1ap_sONInformation , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SONInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SONConfigurationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SONConfigurationTransfer, SONConfigurationTransfer_sequence); return offset; } static int dissect_s1ap_StratumLevel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 3U, NULL, TRUE); return offset; } static const per_sequence_t SynchronisationInformation_sequence[] = { { &hf_s1ap_sourceStratumLevel, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_StratumLevel }, { &hf_s1ap_listeningSubframePattern, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ListeningSubframePattern }, { &hf_s1ap_aggressoreCGI_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ECGI_List }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SynchronisationInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SynchronisationInformation, SynchronisationInformation_sequence); return offset; } static int dissect_s1ap_Source_ToTarget_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if ((g_s1ap_dissect_container)&&(parameter_tvb) && (tvb_reported_length(parameter_tvb) > 0)) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); /* Don't want elements inside container to write to info column */ col_set_writable(actx->pinfo->cinfo, COL_INFO, FALSE); subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_ToTargetTransparentContainer); switch(s1ap_data->handover_type_value){ /* HandoverType ::= ENUMERATED { intralte, ltetoutran, ltetogeran, utrantolte, gerantolte, ... eps_to_5gs, fivegs_to_eps } */ case intralte: /* intralte Intra E-UTRAN handover Source eNB to Target eNB Transparent Container 36.413 */ case utrantolte: /* utrantolte */ case gerantolte: /* gerantolte */ case fivegs_to_eps: /* fivegs_to_eps */ dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); break; case ltetoutran: /* ltetoutran Source RNC to Target RNC Transparent Container 25.413 */ dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); break; case ltetogeran: /* ltetogeran Source BSS to Target BSS Transparent Container 48.018 or Old BSS to New BSS information elements Transparent Container 48.008 */ if (s1ap_data->srvcc_ho_cs_only) bssmap_old_bss_to_new_bss_info(parameter_tvb, subtree, actx->pinfo); else de_bssgp_source_BSS_to_target_BSS_transp_cont(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0); break; case eps_to_5gs: /* eps_to_5gs */ dissect_ngap_SourceNGRANNode_ToTargetNGRANNode_TransparentContainer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); break; default: break; } /* Enable writing of the column again */ col_set_writable(actx->pinfo->cinfo, COL_INFO, TRUE); } return offset; } static const value_string s1ap_SRVCCOperationNotPossible_vals[] = { { 0, "notPossible" }, { 0, NULL } }; static int dissect_s1ap_SRVCCOperationNotPossible(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_SRVCCOperationPossible_vals[] = { { 0, "possible" }, { 0, NULL } }; static int dissect_s1ap_SRVCCOperationPossible(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_SRVCCHOIndication_vals[] = { { pSandCS, "pSandCS" }, { cSonly, "cSonly" }, { 0, NULL } }; static int dissect_s1ap_SRVCCHOIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 srvcc_ho_ind; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, &srvcc_ho_ind, TRUE, 0, NULL); if (srvcc_ho_ind == cSonly) s1ap_data->srvcc_ho_cs_only = TRUE; return offset; } static const per_sequence_t SourceNgRanNode_ID_sequence[] = { { &hf_s1ap_global_RAN_NODE_ID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_RAN_NODE_ID }, { &hf_s1ap_selected_TAI_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_FiveGSTAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SourceNgRanNode_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SourceNgRanNode_ID, SourceNgRanNode_ID_sequence); return offset; } static int dissect_s1ap_SourceNodeID_Extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_ProtocolIE_SingleContainer(tvb, offset, actx, tree, hf_index); return offset; } static const value_string s1ap_SourceNodeID_vals[] = { { 0, "sourceNgRanNode-ID" }, { 1, "sourceNodeID-Extension" }, { 0, NULL } }; static const per_choice_t SourceNodeID_choice[] = { { 0, &hf_s1ap_sourceNgRanNode_ID, ASN1_NO_EXTENSIONS , dissect_s1ap_SourceNgRanNode_ID }, { 1, &hf_s1ap_sourceNodeID_Extension, ASN1_NO_EXTENSIONS , dissect_s1ap_SourceNodeID_Extension }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_SourceNodeID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SourceNodeID, SourceNodeID_choice, NULL); return offset; } static int dissect_s1ap_SubscriberProfileIDforRFP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 256U, NULL, FALSE); return offset; } static const per_sequence_t UE_HistoryInformation_sequence_of[1] = { { &hf_s1ap_UE_HistoryInformation_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_LastVisitedCell_Item }, }; static int dissect_s1ap_UE_HistoryInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_UE_HistoryInformation, UE_HistoryInformation_sequence_of, 1, maxnoofCellsinUEHistoryInfo, FALSE); return offset; } static const per_sequence_t SourceeNB_ToTargeteNB_TransparentContainer_sequence[] = { { &hf_s1ap_rRC_Container , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RRC_Container }, { &hf_s1ap_e_RABInformationList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_E_RABInformationList }, { &hf_s1ap_targetCell_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_subscriberProfileIDforRFP, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_SubscriberProfileIDforRFP }, { &hf_s1ap_uE_HistoryInformation, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_UE_HistoryInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); volatile guint32 _offset; s1ap_data->transparent_container_type = SOURCE_TO_TARGET_TRANSPARENT_CONTAINER; _offset = offset; TRY { offset = dissect_per_sequence(tvb, _offset, actx, tree, hf_index, ett_s1ap_SourceeNB_ToTargeteNB_TransparentContainer, SourceeNB_ToTargeteNB_TransparentContainer_sequence); } CATCH_ALL { show_exception(tvb, actx->pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = _offset; return offset; } static const per_sequence_t ServedPLMNs_sequence_of[1] = { { &hf_s1ap_ServedPLMNs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_PLMNidentity }, }; static int dissect_s1ap_ServedPLMNs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedPLMNs, ServedPLMNs_sequence_of, 1, maxnoofPLMNsPerMME, FALSE); return offset; } static const per_sequence_t ServedGroupIDs_sequence_of[1] = { { &hf_s1ap_ServedGroupIDs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_MME_Group_ID }, }; static int dissect_s1ap_ServedGroupIDs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedGroupIDs, ServedGroupIDs_sequence_of, 1, maxnoofGroupIDs, FALSE); return offset; } static const per_sequence_t ServedMMECs_sequence_of[1] = { { &hf_s1ap_ServedMMECs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_MME_Code }, }; static int dissect_s1ap_ServedMMECs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedMMECs, ServedMMECs_sequence_of, 1, maxnoofMMECs, FALSE); return offset; } static const per_sequence_t ServedGUMMEIsItem_sequence[] = { { &hf_s1ap_servedPLMNs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ServedPLMNs }, { &hf_s1ap_servedGroupIDs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ServedGroupIDs }, { &hf_s1ap_servedMMECs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ServedMMECs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ServedGUMMEIsItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedGUMMEIsItem, ServedGUMMEIsItem_sequence); return offset; } static const per_sequence_t ServedGUMMEIs_sequence_of[1] = { { &hf_s1ap_ServedGUMMEIs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ServedGUMMEIsItem }, }; static int dissect_s1ap_ServedGUMMEIs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ServedGUMMEIs, ServedGUMMEIs_sequence_of, 1, maxnoofRATs, FALSE); return offset; } static const value_string s1ap_T_periodicCommunicationIndicator_vals[] = { { 0, "periodically" }, { 1, "ondemand" }, { 0, NULL } }; static int dissect_s1ap_T_periodicCommunicationIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_INTEGER_1_3600_(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 3600U, NULL, TRUE); return offset; } static int dissect_s1ap_BIT_STRING_SIZE_7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 7, 7, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_INTEGER_0_86399_(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 86399U, NULL, TRUE); return offset; } static const per_sequence_t ScheduledCommunicationTime_sequence[] = { { &hf_s1ap_dayofWeek , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_BIT_STRING_SIZE_7 }, { &hf_s1ap_timeofDayStart , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_86399_ }, { &hf_s1ap_timeofDayEnd , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_0_86399_ }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ScheduledCommunicationTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ScheduledCommunicationTime, ScheduledCommunicationTime_sequence); return offset; } static const value_string s1ap_T_stationaryIndication_vals[] = { { 0, "stationary" }, { 1, "mobile" }, { 0, NULL } }; static int dissect_s1ap_T_stationaryIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_T_trafficProfile_vals[] = { { 0, "single-packet" }, { 1, "dual-packets" }, { 2, "multiple-packets" }, { 0, NULL } }; static int dissect_s1ap_T_trafficProfile(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_T_batteryIndication_vals[] = { { 0, "battery-powered" }, { 1, "battery-powered-not-rechargeable-or-replaceable" }, { 2, "not-battery-powered" }, { 0, NULL } }; static int dissect_s1ap_T_batteryIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t Subscription_Based_UE_DifferentiationInfo_sequence[] = { { &hf_s1ap_periodicCommunicationIndicator, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_periodicCommunicationIndicator }, { &hf_s1ap_periodicTime , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_1_3600_ }, { &hf_s1ap_scheduledCommunicationTime, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ScheduledCommunicationTime }, { &hf_s1ap_stationaryIndication, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_stationaryIndication }, { &hf_s1ap_trafficProfile , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_trafficProfile }, { &hf_s1ap_batteryIndication, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_batteryIndication }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Subscription_Based_UE_DifferentiationInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Subscription_Based_UE_DifferentiationInfo, Subscription_Based_UE_DifferentiationInfo_sequence); return offset; } static const value_string s1ap_SynchronisationStatus_vals[] = { { 0, "synchronous" }, { 1, "asynchronous" }, { 0, NULL } }; static int dissect_s1ap_SynchronisationStatus(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t TimeSynchronisationInfo_sequence[] = { { &hf_s1ap_stratumLevel , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_StratumLevel }, { &hf_s1ap_synchronisationStatus, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_SynchronisationStatus }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TimeSynchronisationInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TimeSynchronisationInfo, TimeSynchronisationInfo_sequence); return offset; } static const per_sequence_t S_TMSI_sequence[] = { { &hf_s1ap_mMEC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MME_Code }, { &hf_s1ap_m_TMSI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_M_TMSI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_S_TMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_S_TMSI, S_TMSI_sequence); return offset; } static const per_sequence_t TAIListforWarning_sequence_of[1] = { { &hf_s1ap_TAIListforWarning_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, }; static int dissect_s1ap_TAIListforWarning(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIListforWarning, TAIListforWarning_sequence_of, 1, maxnoofTAIforWarning, FALSE); return offset; } static const per_sequence_t TargetNgRanNode_ID_sequence[] = { { &hf_s1ap_global_RAN_NODE_ID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Global_RAN_NODE_ID }, { &hf_s1ap_selected_TAI_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_FiveGSTAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TargetNgRanNode_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TargetNgRanNode_ID, TargetNgRanNode_ID_sequence); return offset; } static const value_string s1ap_TargetID_vals[] = { { 0, "targeteNB-ID" }, { 1, "targetRNC-ID" }, { 2, "cGI" }, { 3, "targetgNgRanNode-ID" }, { 0, NULL } }; static const per_choice_t TargetID_choice[] = { { 0, &hf_s1ap_targeteNB_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_TargeteNB_ID }, { 1, &hf_s1ap_targetRNC_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_TargetRNC_ID }, { 2, &hf_s1ap_cGI , ASN1_EXTENSION_ROOT , dissect_s1ap_CGI }, { 3, &hf_s1ap_targetgNgRanNode_ID, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_TargetNgRanNode_ID }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_TargetID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_TargetID, TargetID_choice, NULL); return offset; } static const per_sequence_t TargeteNB_ToSourceeNB_TransparentContainer_sequence[] = { { &hf_s1ap_rRC_Container , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RRC_Container }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); volatile guint32 _offset; s1ap_data->transparent_container_type = TARGET_TO_SOURCE_TRANSPARENT_CONTAINER; _offset = offset; TRY { _offset = dissect_per_sequence(tvb, _offset, actx, tree, hf_index, ett_s1ap_TargeteNB_ToSourceeNB_TransparentContainer, TargeteNB_ToSourceeNB_TransparentContainer_sequence); } CATCH_ALL { show_exception(tvb, actx->pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = _offset; return offset; } static int dissect_s1ap_Target_ToSource_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if ((g_s1ap_dissect_container)&&(parameter_tvb) && (tvb_reported_length(parameter_tvb) > 0)) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_ToSourceTransparentContainer); switch(s1ap_data->handover_type_value){ /* HandoverType ::= ENUMERATED { intralte, ltetoutran, ltetogeran, utrantolte, gerantolte, ... eps_to_5gs, fivegs_to_eps } */ case intralte: /* intralte Intra E-UTRAN handover Target eNB to Source eNB Transparent Container 36.413 */ case utrantolte: /* utrantolte */ case gerantolte: /* gerantolte */ case fivegs_to_eps: /* fivegs_to_eps */ dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); break; case ltetoutran: /* ltetoutran Target RNC to Source RNC Transparent Container 25.413 */ dissect_ranap_TargetRNC_ToSourceRNC_TransparentContainer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); break; case ltetogeran: /* ltetogeran Target BSS to Source BSS Transparent Container 48.018 */ de_bssgp_target_BSS_to_source_BSS_transp_cont(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0); break; case eps_to_5gs: /* eps_to_5gs */ dissect_ngap_TargetNGRANNode_ToSourceNGRANNode_TransparentContainer_PDU(parameter_tvb, actx->pinfo, subtree, NULL); break; default: break; } } return offset; } static const value_string s1ap_TimeToWait_vals[] = { { 0, "v1s" }, { 1, "v2s" }, { 2, "v5s" }, { 3, "v10s" }, { 4, "v20s" }, { 5, "v60s" }, { 0, NULL } }; static int dissect_s1ap_TimeToWait(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 6, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_Time_UE_StayedInCell_EnhancedGranularity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 40950U, NULL, FALSE); return offset; } static int dissect_s1ap_TimeSinceSecondaryNodeRelease(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 4, 4, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 4, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t TransportInformation_sequence[] = { { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_uL_GTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TransportInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TransportInformation, TransportInformation_sequence); return offset; } static int dissect_s1ap_E_UTRAN_Trace_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_E_UTRAN_Trace_ID); dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_NONE, FALSE); proto_tree_add_item(subtree, hf_s1ap_E_UTRAN_Trace_ID_TraceID, parameter_tvb, 3, 3, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_s1ap_E_UTRAN_Trace_ID_TraceRecordingSessionReference, parameter_tvb, 6, 2, ENC_BIG_ENDIAN); return offset; } static const value_string s1ap_TraceDepth_vals[] = { { 0, "minimum" }, { 1, "medium" }, { 2, "maximum" }, { 3, "minimumWithoutVendorSpecificExtension" }, { 4, "mediumWithoutVendorSpecificExtension" }, { 5, "maximumWithoutVendorSpecificExtension" }, { 0, NULL } }; static int dissect_s1ap_TraceDepth(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 6, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t TraceActivation_sequence[] = { { &hf_s1ap_e_UTRAN_Trace_ID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_UTRAN_Trace_ID }, { &hf_s1ap_interfacesToTrace, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_InterfacesToTrace }, { &hf_s1ap_traceDepth , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TraceDepth }, { &hf_s1ap_traceCollectionEntityIPAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TraceActivation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TraceActivation, TraceActivation_sequence); return offset; } static int dissect_s1ap_TrafficLoadReductionIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 99U, NULL, FALSE); return offset; } static const per_sequence_t TunnelInformation_sequence[] = { { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_uDP_Port_Number, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_Port_Number }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TunnelInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TunnelInformation, TunnelInformation_sequence); return offset; } static const per_sequence_t TAIListForRestart_sequence_of[1] = { { &hf_s1ap_TAIListForRestart_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, }; static int dissect_s1ap_TAIListForRestart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIListForRestart, TAIListForRestart_sequence_of, 1, maxnoofRestartTAIs, FALSE); return offset; } static const per_sequence_t UEAggregateMaximumBitrate_sequence[] = { { &hf_s1ap_uEaggregateMaximumBitRateDL, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_uEaggregateMaximumBitRateUL, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEAggregateMaximumBitrate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEAggregateMaximumBitrate, UEAggregateMaximumBitrate_sequence); return offset; } static int dissect_s1ap_OCTET_STRING_SIZE_1_1000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 1000, FALSE, NULL); return offset; } static const per_sequence_t UEAppLayerMeasConfig_sequence[] = { { &hf_s1ap_containerForAppLayerMeasConfig, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_OCTET_STRING_SIZE_1_1000 }, { &hf_s1ap_areaScopeOfQMC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_AreaScopeOfQMC }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEAppLayerMeasConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEAppLayerMeasConfig, UEAppLayerMeasConfig_sequence); return offset; } static const value_string s1ap_UECapabilityInfoRequest_vals[] = { { 0, "requested" }, { 0, NULL } }; static int dissect_s1ap_UECapabilityInfoRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_UE_RetentionInformation_vals[] = { { 0, "ues-retained" }, { 0, NULL } }; static int dissect_s1ap_UE_RetentionInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t UE_S1AP_ID_pair_sequence[] = { { &hf_s1ap_mME_UE_S1AP_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_MME_UE_S1AP_ID }, { &hf_s1ap_eNB_UE_S1AP_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ENB_UE_S1AP_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UE_S1AP_ID_pair(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UE_S1AP_ID_pair, UE_S1AP_ID_pair_sequence); return offset; } static const value_string s1ap_UE_S1AP_IDs_vals[] = { { 0, "uE-S1AP-ID-pair" }, { 1, "mME-UE-S1AP-ID" }, { 0, NULL } }; static const per_choice_t UE_S1AP_IDs_choice[] = { { 0, &hf_s1ap_uE_S1AP_ID_pair, ASN1_EXTENSION_ROOT , dissect_s1ap_UE_S1AP_ID_pair }, { 1, &hf_s1ap_mME_UE_S1AP_ID , ASN1_EXTENSION_ROOT , dissect_s1ap_MME_UE_S1AP_ID }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_UE_S1AP_IDs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_UE_S1AP_IDs, UE_S1AP_IDs_choice, NULL); return offset; } static const per_sequence_t UE_associatedLogicalS1_ConnectionItem_sequence[] = { { &hf_s1ap_mME_UE_S1AP_ID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_MME_UE_S1AP_ID }, { &hf_s1ap_eNB_UE_S1AP_ID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ENB_UE_S1AP_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UE_associatedLogicalS1_ConnectionItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UE_associatedLogicalS1_ConnectionItem, UE_associatedLogicalS1_ConnectionItem_sequence); return offset; } static int dissect_s1ap_UEIdentityIndexValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 10, 10, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_UE_HistoryInformationFromTheUE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UE_HistoryInformationFromTheUE); TRY { dissect_lte_rrc_VisitedCellInfoList_r12_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } return offset; } static const value_string s1ap_UEPagingID_vals[] = { { 0, "s-TMSI" }, { 1, "iMSI" }, { 0, NULL } }; static const per_choice_t UEPagingID_choice[] = { { 0, &hf_s1ap_s_TMSI , ASN1_EXTENSION_ROOT , dissect_s1ap_S_TMSI }, { 1, &hf_s1ap_iMSI , ASN1_EXTENSION_ROOT , dissect_s1ap_IMSI }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_UEPagingID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_UEPagingID, UEPagingID_choice, NULL); return offset; } static int dissect_s1ap_UERadioCapability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); volatile dissector_handle_t handle; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UERadioCapability); if (s1ap_data->protocol_ie_id == id_UERadioCapability_NR_Format) { handle = nr_rrc_ue_radio_access_cap_info_handle; } else if ((s1ap_is_nbiot_ue(actx->pinfo) && (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_AUTOMATIC)) || (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_NBIOT)) { handle = lte_rrc_ue_radio_access_cap_info_nb_handle; } else { handle = lte_rrc_ue_radio_access_cap_info_handle; } if (handle) { TRY { call_dissector(handle, parameter_tvb, actx->pinfo, subtree); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } } return offset; } static int dissect_s1ap_UERadioCapabilityForPaging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); volatile dissector_handle_t handle; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UERadioPagingInformation); if (s1ap_data->protocol_ie_id == id_UERadioCapabilityForPaging_NR_Format) { handle = nr_rrc_ue_radio_paging_info_handle; } else if ((s1ap_is_nbiot_ue(actx->pinfo) && (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_AUTOMATIC)) || (g_s1ap_dissect_lte_container_as == S1AP_LTE_CONTAINER_NBIOT)) { handle = lte_rrc_ue_radio_paging_info_nb_handle; } else { handle = lte_rrc_ue_radio_paging_info_handle; } if (handle) { TRY { call_dissector(handle, parameter_tvb, actx->pinfo, subtree); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; } } return offset; } static int dissect_s1ap_UERadioCapabilityID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static const per_sequence_t UESecurityCapabilities_sequence[] = { { &hf_s1ap_encryptionAlgorithms, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EncryptionAlgorithms }, { &hf_s1ap_integrityProtectionAlgorithms, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_IntegrityProtectionAlgorithms }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UESecurityCapabilities(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UESecurityCapabilities, UESecurityCapabilities_sequence); return offset; } static const per_sequence_t UESidelinkAggregateMaximumBitrate_sequence[] = { { &hf_s1ap_uESidelinkAggregateMaximumBitRate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_BitRate }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UESidelinkAggregateMaximumBitrate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UESidelinkAggregateMaximumBitrate, UESidelinkAggregateMaximumBitrate_sequence); return offset; } static int dissect_s1ap_UE_Usage_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static int dissect_s1ap_UL_NAS_MAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_s1ap_UL_NAS_Count(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 5, 5, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t UL_CP_SecurityInformation_sequence[] = { { &hf_s1ap_ul_NAS_MAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_UL_NAS_MAC }, { &hf_s1ap_ul_NAS_Count , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_UL_NAS_Count }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UL_CP_SecurityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UL_CP_SecurityInformation, UL_CP_SecurityInformation_sequence); return offset; } static const value_string s1ap_UnlicensedSpectrumRestriction_vals[] = { { 0, "unlicensed-restricted" }, { 0, NULL } }; static int dissect_s1ap_UnlicensedSpectrumRestriction(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_URI_Address(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_VisibleString(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static const per_sequence_t UserLocationInformation_sequence[] = { { &hf_s1ap_eutran_cgi , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRAN_CGI }, { &hf_s1ap_tai , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UserLocationInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UserLocationInformation, UserLocationInformation_sequence); return offset; } static const value_string s1ap_UEUserPlaneCIoTSupportIndicator_vals[] = { { 0, "supported" }, { 0, NULL } }; static int dissect_s1ap_UEUserPlaneCIoTSupportIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_UE_Application_Layer_Measurement_Capability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if(parameter_tvb){ static int * const fields[] = { &hf_s1ap_UE_Application_Layer_Measurement_Capability_QoE_Measurement_for_streaming_service, &hf_s1ap_UE_Application_Layer_Measurement_Capability_QoE_Measurement_for_MTSI_service, &hf_s1ap_UE_Application_Layer_Measurement_Capability_Reserved, NULL }; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UE_Application_Layer_Measurement_Capability); proto_tree_add_bitmask_list(subtree, parameter_tvb, 0, 1, fields, ENC_BIG_ENDIAN); } return offset; } static const value_string s1ap_VoiceSupportMatchIndicator_vals[] = { { 0, "supported" }, { 1, "not-supported" }, { 0, NULL } }; static int dissect_s1ap_VoiceSupportMatchIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t V2XServicesAuthorized_sequence[] = { { &hf_s1ap_vehicleUE , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_VehicleUE }, { &hf_s1ap_pedestrianUE , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PedestrianUE }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_V2XServicesAuthorized(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_V2XServicesAuthorized, V2XServicesAuthorized_sequence); return offset; } static int dissect_s1ap_WarningAreaCoordinates(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 1024, FALSE, NULL); return offset; } static const value_string s1ap_WarningAreaList_vals[] = { { 0, "cellIDList" }, { 1, "trackingAreaListforWarning" }, { 2, "emergencyAreaIDList" }, { 0, NULL } }; static const per_choice_t WarningAreaList_choice[] = { { 0, &hf_s1ap_cellIDList , ASN1_EXTENSION_ROOT , dissect_s1ap_ECGIList }, { 1, &hf_s1ap_trackingAreaListforWarning, ASN1_EXTENSION_ROOT , dissect_s1ap_TAIListforWarning }, { 2, &hf_s1ap_emergencyAreaIDList, ASN1_EXTENSION_ROOT , dissect_s1ap_EmergencyAreaIDList }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_WarningAreaList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_WarningAreaList, WarningAreaList_choice, NULL); return offset; } static int dissect_s1ap_WarningType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_WarningType); proto_tree_add_item(subtree, hf_s1ap_WarningType_value, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_s1ap_WarningType_emergency_user_alert, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_s1ap_WarningType_popup, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_s1ap_WarningSecurityInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 50, 50, FALSE, NULL); return offset; } static int dissect_s1ap_WarningMessageContents(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 9600, FALSE, &parameter_tvb); if (parameter_tvb) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_WarningMessageContents); dissect_s1ap_warningMessageContents(parameter_tvb, subtree, actx->pinfo, s1ap_data->data_coding_scheme, hf_s1ap_WarningMessageContents_nb_pages, hf_s1ap_WarningMessageContents_decoded_page); } return offset; } static const value_string s1ap_WLANMeasConfig_vals[] = { { 0, "setup" }, { 0, NULL } }; static int dissect_s1ap_WLANMeasConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int dissect_s1ap_WLANName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, 32, FALSE, &parameter_tvb); actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, -1, ENC_UTF_8|ENC_NA); return offset; } static const per_sequence_t WLANMeasConfigNameList_sequence_of[1] = { { &hf_s1ap_WLANMeasConfigNameList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_WLANName }, }; static int dissect_s1ap_WLANMeasConfigNameList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_WLANMeasConfigNameList, WLANMeasConfigNameList_sequence_of, 1, maxnoofWLANName, FALSE); return offset; } static const value_string s1ap_T_wlan_rssi_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_T_wlan_rssi(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_T_wlan_rtt_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_s1ap_T_wlan_rtt(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t WLANMeasurementConfiguration_sequence[] = { { &hf_s1ap_wlanMeasConfig , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_WLANMeasConfig }, { &hf_s1ap_wlanMeasConfigNameList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_WLANMeasConfigNameList }, { &hf_s1ap_wlan_rssi , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_wlan_rssi }, { &hf_s1ap_wlan_rtt , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_T_wlan_rtt }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_WLANMeasurementConfiguration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_WLANMeasurementConfiguration, WLANMeasurementConfiguration_sequence); return offset; } static const per_sequence_t WUS_Assistance_Information_sequence[] = { { &hf_s1ap_pagingProbabilityInformation, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PagingProbabilityInformation }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_WUS_Assistance_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_WUS_Assistance_Information, WUS_Assistance_Information_sequence); return offset; } static const per_sequence_t ENBX2GTPTLAs_sequence_of[1] = { { &hf_s1ap_ENBX2GTPTLAs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, }; static int dissect_s1ap_ENBX2GTPTLAs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBX2GTPTLAs, ENBX2GTPTLAs_sequence_of, 1, maxnoofeNBX2GTPTLAs, FALSE); return offset; } static const per_sequence_t ENBX2ExtTLA_sequence[] = { { &hf_s1ap_iPsecTLA , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTPTLAa , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ENBX2GTPTLAs }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBX2ExtTLA(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBX2ExtTLA, ENBX2ExtTLA_sequence); return offset; } static const per_sequence_t ENBX2ExtTLAs_sequence_of[1] = { { &hf_s1ap_ENBX2ExtTLAs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ENBX2ExtTLA }, }; static int dissect_s1ap_ENBX2ExtTLAs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBX2ExtTLAs, ENBX2ExtTLAs_sequence_of, 1, maxnoofeNBX2ExtTLAs, FALSE); return offset; } static const per_sequence_t ENBIndirectX2TransportLayerAddresses_sequence_of[1] = { { &hf_s1ap_ENBIndirectX2TransportLayerAddresses_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, }; static int dissect_s1ap_ENBIndirectX2TransportLayerAddresses(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBIndirectX2TransportLayerAddresses, ENBIndirectX2TransportLayerAddresses_sequence_of, 1, maxnoofeNBX2TLAs, FALSE); return offset; } static int dissect_s1ap_E_RAB_IE_ContainerList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { asn1_stack_frame_push(actx, "ProtocolIE-ContainerList"); asn1_param_push_integer(actx, 1); asn1_param_push_integer(actx, maxnoofE_RABs); offset = dissect_s1ap_ProtocolIE_ContainerList(tvb, offset, actx, tree, hf_index); asn1_stack_frame_pop(actx, "ProtocolIE-ContainerList"); return offset; } static const per_sequence_t HandoverRequired_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverRequired(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->handover_type_value = 0xff; s1ap_data->srvcc_ho_cs_only = FALSE; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverRequired"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverRequired, HandoverRequired_sequence); return offset; } static const per_sequence_t HandoverCommand_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->handover_type_value = 0xff; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverCommand"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverCommand, HandoverCommand_sequence); return offset; } static int dissect_s1ap_E_RABSubjecttoDataForwardingList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABDataForwardingItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_dL_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_dL_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_GTP_TEID }, { &hf_s1ap_uL_TransportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_uL_GTP_TEID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABDataForwardingItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABDataForwardingItem, E_RABDataForwardingItem_sequence); return offset; } static const per_sequence_t HandoverPreparationFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverPreparationFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverPreparationFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverPreparationFailure, HandoverPreparationFailure_sequence); return offset; } static const per_sequence_t HandoverRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->handover_type_value = 0xff; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverRequest, HandoverRequest_sequence); return offset; } static int dissect_s1ap_E_RABToBeSetupListHOReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABToBeSetupItemHOReq_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_e_RABlevelQosParameters, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RABLevelQoSParameters }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeSetupItemHOReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSetupItemHOReq, E_RABToBeSetupItemHOReq_sequence); return offset; } static const per_sequence_t HandoverRequestAcknowledge_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverRequestAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->handover_type_value = 0xff; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverRequestAcknowledge"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverRequestAcknowledge, HandoverRequestAcknowledge_sequence); return offset; } static int dissect_s1ap_E_RABAdmittedList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABAdmittedItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_dL_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_dL_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_GTP_TEID }, { &hf_s1ap_uL_TransportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_uL_GTP_TEID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABAdmittedItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABAdmittedItem, E_RABAdmittedItem_sequence); return offset; } static int dissect_s1ap_E_RABFailedtoSetupListHOReqAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABFailedToSetupItemHOReqAck_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_cause , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cause }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABFailedToSetupItemHOReqAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABFailedToSetupItemHOReqAck, E_RABFailedToSetupItemHOReqAck_sequence); return offset; } static const per_sequence_t HandoverFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverFailure, HandoverFailure_sequence); return offset; } static const per_sequence_t HandoverNotify_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverNotify(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverNotify"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverNotify, HandoverNotify_sequence); return offset; } static const per_sequence_t PathSwitchRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PathSwitchRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PathSwitchRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PathSwitchRequest, PathSwitchRequest_sequence); return offset; } static int dissect_s1ap_E_RABToBeSwitchedDLList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABToBeSwitchedDLItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeSwitchedDLItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSwitchedDLItem, E_RABToBeSwitchedDLItem_sequence); return offset; } static const per_sequence_t PathSwitchRequestAcknowledge_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PathSwitchRequestAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PathSwitchRequestAcknowledge"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PathSwitchRequestAcknowledge, PathSwitchRequestAcknowledge_sequence); return offset; } static int dissect_s1ap_E_RABToBeSwitchedULList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABToBeSwitchedULItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeSwitchedULItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSwitchedULItem, E_RABToBeSwitchedULItem_sequence); return offset; } static int dissect_s1ap_E_RABToBeUpdatedList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABToBeUpdatedItem_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_securityIndication, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_SecurityIndication }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeUpdatedItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeUpdatedItem, E_RABToBeUpdatedItem_sequence); return offset; } static const per_sequence_t PathSwitchRequestFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PathSwitchRequestFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PathSwitchRequestFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PathSwitchRequestFailure, PathSwitchRequestFailure_sequence); return offset; } static const per_sequence_t HandoverCancel_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverCancel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverCancel"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverCancel, HandoverCancel_sequence); return offset; } static const per_sequence_t HandoverCancelAcknowledge_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverCancelAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverCancelAcknowledge"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverCancelAcknowledge, HandoverCancelAcknowledge_sequence); return offset; } static const per_sequence_t HandoverSuccess_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HandoverSuccess(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "HandoverSuccess"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HandoverSuccess, HandoverSuccess_sequence); return offset; } static const per_sequence_t ENBEarlyStatusTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBEarlyStatusTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBEarlyStatusTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBEarlyStatusTransfer, ENBEarlyStatusTransfer_sequence); return offset; } static const per_sequence_t MMEEarlyStatusTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEEarlyStatusTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEEarlyStatusTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEEarlyStatusTransfer, MMEEarlyStatusTransfer_sequence); return offset; } static const per_sequence_t E_RABSetupRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABSetupRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABSetupRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSetupRequest, E_RABSetupRequest_sequence); return offset; } static const per_sequence_t E_RABToBeSetupListBearerSUReq_sequence_of[1] = { { &hf_s1ap_E_RABToBeSetupListBearerSUReq_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABToBeSetupListBearerSUReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSetupListBearerSUReq, E_RABToBeSetupListBearerSUReq_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABToBeSetupItemBearerSUReq_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_e_RABlevelQoSParameters, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RABLevelQoSParameters }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_nAS_PDU , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NAS_PDU }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeSetupItemBearerSUReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSetupItemBearerSUReq, E_RABToBeSetupItemBearerSUReq_sequence); return offset; } static const per_sequence_t E_RABSetupResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABSetupResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABSetupResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSetupResponse, E_RABSetupResponse_sequence); return offset; } static const per_sequence_t E_RABSetupListBearerSURes_sequence_of[1] = { { &hf_s1ap_E_RABSetupListBearerSURes_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABSetupListBearerSURes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSetupListBearerSURes, E_RABSetupListBearerSURes_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABSetupItemBearerSURes_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABSetupItemBearerSURes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSetupItemBearerSURes, E_RABSetupItemBearerSURes_sequence); return offset; } static const per_sequence_t E_RABModifyRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABModifyRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABModifyRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModifyRequest, E_RABModifyRequest_sequence); return offset; } static const per_sequence_t E_RABToBeModifiedListBearerModReq_sequence_of[1] = { { &hf_s1ap_E_RABToBeModifiedListBearerModReq_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABToBeModifiedListBearerModReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeModifiedListBearerModReq, E_RABToBeModifiedListBearerModReq_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABToBeModifiedItemBearerModReq_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_e_RABLevelQoSParameters, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RABLevelQoSParameters }, { &hf_s1ap_nAS_PDU , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NAS_PDU }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeModifiedItemBearerModReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeModifiedItemBearerModReq, E_RABToBeModifiedItemBearerModReq_sequence); return offset; } static const per_sequence_t E_RABModifyResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABModifyResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABModifyResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModifyResponse, E_RABModifyResponse_sequence); return offset; } static const per_sequence_t E_RABModifyListBearerModRes_sequence_of[1] = { { &hf_s1ap_E_RABModifyListBearerModRes_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABModifyListBearerModRes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModifyListBearerModRes, E_RABModifyListBearerModRes_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABModifyItemBearerModRes_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABModifyItemBearerModRes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModifyItemBearerModRes, E_RABModifyItemBearerModRes_sequence); return offset; } static const per_sequence_t E_RABReleaseCommand_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABReleaseCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABReleaseCommand"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABReleaseCommand, E_RABReleaseCommand_sequence); return offset; } static const per_sequence_t E_RABReleaseResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABReleaseResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABReleaseResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABReleaseResponse, E_RABReleaseResponse_sequence); return offset; } static const per_sequence_t E_RABReleaseListBearerRelComp_sequence_of[1] = { { &hf_s1ap_E_RABReleaseListBearerRelComp_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABReleaseListBearerRelComp(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABReleaseListBearerRelComp, E_RABReleaseListBearerRelComp_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABReleaseItemBearerRelComp_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABReleaseItemBearerRelComp(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABReleaseItemBearerRelComp, E_RABReleaseItemBearerRelComp_sequence); return offset; } static const per_sequence_t E_RABReleaseIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABReleaseIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABReleaseIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABReleaseIndication, E_RABReleaseIndication_sequence); return offset; } static const per_sequence_t InitialContextSetupRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InitialContextSetupRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "InitialContextSetupRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InitialContextSetupRequest, InitialContextSetupRequest_sequence); return offset; } static const per_sequence_t E_RABToBeSetupListCtxtSUReq_sequence_of[1] = { { &hf_s1ap_E_RABToBeSetupListCtxtSUReq_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABToBeSetupListCtxtSUReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSetupListCtxtSUReq, E_RABToBeSetupListCtxtSUReq_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABToBeSetupItemCtxtSUReq_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_e_RABlevelQoSParameters, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RABLevelQoSParameters }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_nAS_PDU , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_NAS_PDU }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeSetupItemCtxtSUReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeSetupItemCtxtSUReq, E_RABToBeSetupItemCtxtSUReq_sequence); return offset; } static const per_sequence_t InitialContextSetupResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InitialContextSetupResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "InitialContextSetupResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InitialContextSetupResponse, InitialContextSetupResponse_sequence); return offset; } static const per_sequence_t E_RABSetupListCtxtSURes_sequence_of[1] = { { &hf_s1ap_E_RABSetupListCtxtSURes_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABSetupListCtxtSURes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSetupListCtxtSURes, E_RABSetupListCtxtSURes_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABSetupItemCtxtSURes_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_gTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABSetupItemCtxtSURes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABSetupItemCtxtSURes, E_RABSetupItemCtxtSURes_sequence); return offset; } static const per_sequence_t InitialContextSetupFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InitialContextSetupFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "InitialContextSetupFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InitialContextSetupFailure, InitialContextSetupFailure_sequence); return offset; } static const per_sequence_t Paging_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Paging(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Paging"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Paging, Paging_sequence); return offset; } static const per_sequence_t TAIList_sequence_of[1] = { { &hf_s1ap_TAIList_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_TAIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIList, TAIList_sequence_of, 1, maxnoofTAIs, FALSE); return offset; } static const per_sequence_t TAIItem_sequence[] = { { &hf_s1ap_tAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TAI }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TAIItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TAIItem, TAIItem_sequence); return offset; } static const per_sequence_t UEContextReleaseRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextReleaseRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextReleaseRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextReleaseRequest, UEContextReleaseRequest_sequence); return offset; } static const per_sequence_t UEContextReleaseCommand_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextReleaseCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextReleaseCommand"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextReleaseCommand, UEContextReleaseCommand_sequence); return offset; } static const per_sequence_t UEContextReleaseComplete_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextReleaseComplete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextReleaseComplete"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextReleaseComplete, UEContextReleaseComplete_sequence); return offset; } static const per_sequence_t UEContextModificationRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextModificationRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextModificationRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextModificationRequest, UEContextModificationRequest_sequence); return offset; } static const per_sequence_t UEContextModificationResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextModificationResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextModificationResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextModificationResponse, UEContextModificationResponse_sequence); return offset; } static const per_sequence_t UEContextModificationFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextModificationFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextModificationFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextModificationFailure, UEContextModificationFailure_sequence); return offset; } static const per_sequence_t UERadioCapabilityMatchRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UERadioCapabilityMatchRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UERadioCapabilityMatchRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UERadioCapabilityMatchRequest, UERadioCapabilityMatchRequest_sequence); return offset; } static const per_sequence_t UERadioCapabilityMatchResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UERadioCapabilityMatchResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UERadioCapabilityMatchResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UERadioCapabilityMatchResponse, UERadioCapabilityMatchResponse_sequence); return offset; } static const per_sequence_t DownlinkNASTransport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DownlinkNASTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { /* Set the direction of the message */ actx->pinfo->link_dir=P2P_DIR_DL; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "DownlinkNASTransport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DownlinkNASTransport, DownlinkNASTransport_sequence); return offset; } static const per_sequence_t InitialUEMessage_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InitialUEMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { /* Set the direction of the message */ actx->pinfo->link_dir=P2P_DIR_UL; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "InitialUEMessage"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InitialUEMessage, InitialUEMessage_sequence); return offset; } static const per_sequence_t UplinkNASTransport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UplinkNASTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { /* Set the direction of the message */ actx->pinfo->link_dir=P2P_DIR_UL; col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UplinkNASTransport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UplinkNASTransport, UplinkNASTransport_sequence); return offset; } static const per_sequence_t NASNonDeliveryIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NASNonDeliveryIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "NASNonDeliveryIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NASNonDeliveryIndication, NASNonDeliveryIndication_sequence); return offset; } static const per_sequence_t RerouteNASRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RerouteNASRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "RerouteNASRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RerouteNASRequest, RerouteNASRequest_sequence); return offset; } static int dissect_s1ap_S1_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_S1_Message); col_set_fence(actx->pinfo->cinfo, COL_INFO); call_dissector(s1ap_handle, parameter_tvb, actx->pinfo, subtree); return offset; } static const per_sequence_t NASDeliveryIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NASDeliveryIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "NASDeliveryIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NASDeliveryIndication, NASDeliveryIndication_sequence); return offset; } static const per_sequence_t Reset_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_Reset(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Reset"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_Reset, Reset_sequence); return offset; } static const value_string s1ap_ResetAll_vals[] = { { 0, "reset-all" }, { 0, NULL } }; static int dissect_s1ap_ResetAll(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t UE_associatedLogicalS1_ConnectionListRes_sequence_of[1] = { { &hf_s1ap_UE_associatedLogicalS1_ConnectionListRes_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_UE_associatedLogicalS1_ConnectionListRes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_UE_associatedLogicalS1_ConnectionListRes, UE_associatedLogicalS1_ConnectionListRes_sequence_of, 1, maxnoofIndividualS1ConnectionsToReset, FALSE); return offset; } static const value_string s1ap_ResetType_vals[] = { { 0, "s1-Interface" }, { 1, "partOfS1-Interface" }, { 0, NULL } }; static const per_choice_t ResetType_choice[] = { { 0, &hf_s1ap_s1_Interface , ASN1_EXTENSION_ROOT , dissect_s1ap_ResetAll }, { 1, &hf_s1ap_partOfS1_Interface, ASN1_EXTENSION_ROOT , dissect_s1ap_UE_associatedLogicalS1_ConnectionListRes }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_ResetType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_ResetType, ResetType_choice, NULL); return offset; } static const per_sequence_t ResetAcknowledge_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ResetAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ResetAcknowledge"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ResetAcknowledge, ResetAcknowledge_sequence); return offset; } static const per_sequence_t UE_associatedLogicalS1_ConnectionListResAck_sequence_of[1] = { { &hf_s1ap_UE_associatedLogicalS1_ConnectionListResAck_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_UE_associatedLogicalS1_ConnectionListResAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_UE_associatedLogicalS1_ConnectionListResAck, UE_associatedLogicalS1_ConnectionListResAck_sequence_of, 1, maxnoofIndividualS1ConnectionsToReset, FALSE); return offset; } static const per_sequence_t ErrorIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ErrorIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ErrorIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ErrorIndication, ErrorIndication_sequence); return offset; } static const per_sequence_t S1SetupRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_S1SetupRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "S1SetupRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_S1SetupRequest, S1SetupRequest_sequence); return offset; } static const per_sequence_t S1SetupResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_S1SetupResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "S1SetupResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_S1SetupResponse, S1SetupResponse_sequence); return offset; } static const per_sequence_t S1SetupFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_S1SetupFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "S1SetupFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_S1SetupFailure, S1SetupFailure_sequence); return offset; } static const per_sequence_t ENBConfigurationUpdate_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBConfigurationUpdate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBConfigurationUpdate"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBConfigurationUpdate, ENBConfigurationUpdate_sequence); return offset; } static const per_sequence_t ENBConfigurationUpdateAcknowledge_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBConfigurationUpdateAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBConfigurationUpdateAcknowledge"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBConfigurationUpdateAcknowledge, ENBConfigurationUpdateAcknowledge_sequence); return offset; } static const per_sequence_t ENBConfigurationUpdateFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBConfigurationUpdateFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBConfigurationUpdateFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBConfigurationUpdateFailure, ENBConfigurationUpdateFailure_sequence); return offset; } static const per_sequence_t MMEConfigurationUpdate_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEConfigurationUpdate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEConfigurationUpdate"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEConfigurationUpdate, MMEConfigurationUpdate_sequence); return offset; } static const per_sequence_t MMEConfigurationUpdateAcknowledge_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEConfigurationUpdateAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEConfigurationUpdateAcknowledge"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEConfigurationUpdateAcknowledge, MMEConfigurationUpdateAcknowledge_sequence); return offset; } static const per_sequence_t MMEConfigurationUpdateFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEConfigurationUpdateFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEConfigurationUpdateFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEConfigurationUpdateFailure, MMEConfigurationUpdateFailure_sequence); return offset; } static const per_sequence_t DownlinkS1cdma2000tunnelling_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DownlinkS1cdma2000tunnelling(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "DownlinkS1cdma2000tunnelling"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DownlinkS1cdma2000tunnelling, DownlinkS1cdma2000tunnelling_sequence); return offset; } static const per_sequence_t UplinkS1cdma2000tunnelling_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UplinkS1cdma2000tunnelling(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UplinkS1cdma2000tunnelling"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UplinkS1cdma2000tunnelling, UplinkS1cdma2000tunnelling_sequence); return offset; } static const per_sequence_t UECapabilityInfoIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UECapabilityInfoIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UECapabilityInfoIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UECapabilityInfoIndication, UECapabilityInfoIndication_sequence); return offset; } static const per_sequence_t ENBStatusTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBStatusTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBStatusTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBStatusTransfer, ENBStatusTransfer_sequence); return offset; } static const per_sequence_t MMEStatusTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEStatusTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEStatusTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEStatusTransfer, MMEStatusTransfer_sequence); return offset; } static const per_sequence_t TraceStart_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TraceStart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "TraceStart"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TraceStart, TraceStart_sequence); return offset; } static const per_sequence_t TraceFailureIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TraceFailureIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "TraceFailureIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TraceFailureIndication, TraceFailureIndication_sequence); return offset; } static const per_sequence_t DeactivateTrace_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DeactivateTrace(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "DeactivateTrace"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DeactivateTrace, DeactivateTrace_sequence); return offset; } static const per_sequence_t CellTrafficTrace_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellTrafficTrace(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "CellTrafficTrace"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellTrafficTrace, CellTrafficTrace_sequence); return offset; } static const per_sequence_t LocationReportingControl_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LocationReportingControl(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "LocationReportingControl"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LocationReportingControl, LocationReportingControl_sequence); return offset; } static const per_sequence_t LocationReportingFailureIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LocationReportingFailureIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "LocationReportingFailureIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LocationReportingFailureIndication, LocationReportingFailureIndication_sequence); return offset; } static const per_sequence_t LocationReport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_LocationReport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "LocationReport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_LocationReport, LocationReport_sequence); return offset; } static const per_sequence_t OverloadStart_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_OverloadStart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "OverloadStart"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_OverloadStart, OverloadStart_sequence); return offset; } static const per_sequence_t OverloadStop_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_OverloadStop(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "OverloadStop"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_OverloadStop, OverloadStop_sequence); return offset; } static const per_sequence_t WriteReplaceWarningRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_WriteReplaceWarningRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "WriteReplaceWarningRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_WriteReplaceWarningRequest, WriteReplaceWarningRequest_sequence); return offset; } static const per_sequence_t WriteReplaceWarningResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_WriteReplaceWarningResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "WriteReplaceWarningResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_WriteReplaceWarningResponse, WriteReplaceWarningResponse_sequence); return offset; } static const per_sequence_t ENBDirectInformationTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBDirectInformationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBDirectInformationTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBDirectInformationTransfer, ENBDirectInformationTransfer_sequence); return offset; } static const value_string s1ap_Inter_SystemInformationTransferType_vals[] = { { 0, "rIMTransfer" }, { 0, NULL } }; static const per_choice_t Inter_SystemInformationTransferType_choice[] = { { 0, &hf_s1ap_rIMTransfer , ASN1_EXTENSION_ROOT , dissect_s1ap_RIMTransfer }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_Inter_SystemInformationTransferType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_Inter_SystemInformationTransferType, Inter_SystemInformationTransferType_choice, NULL); return offset; } static const per_sequence_t MMEDirectInformationTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEDirectInformationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEDirectInformationTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEDirectInformationTransfer, MMEDirectInformationTransfer_sequence); return offset; } static const per_sequence_t ENBConfigurationTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBConfigurationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBConfigurationTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBConfigurationTransfer, ENBConfigurationTransfer_sequence); return offset; } static const per_sequence_t MMEConfigurationTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMEConfigurationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMEConfigurationTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMEConfigurationTransfer, MMEConfigurationTransfer_sequence); return offset; } static const per_sequence_t PrivateMessage_sequence[] = { { &hf_s1ap_privateIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_PrivateIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PrivateMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PrivateMessage"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PrivateMessage, PrivateMessage_sequence); return offset; } static const per_sequence_t KillRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_KillRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "KillRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_KillRequest, KillRequest_sequence); return offset; } static const per_sequence_t KillResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_KillResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "KillResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_KillResponse, KillResponse_sequence); return offset; } static const per_sequence_t PWSRestartIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PWSRestartIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PWSRestartIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PWSRestartIndication, PWSRestartIndication_sequence); return offset; } static const per_sequence_t PWSFailureIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_PWSFailureIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PWSFailureIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_PWSFailureIndication, PWSFailureIndication_sequence); return offset; } static const per_sequence_t DownlinkUEAssociatedLPPaTransport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DownlinkUEAssociatedLPPaTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "DownlinkUEAssociatedLPPaTransport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DownlinkUEAssociatedLPPaTransport, DownlinkUEAssociatedLPPaTransport_sequence); return offset; } static const per_sequence_t UplinkUEAssociatedLPPaTransport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UplinkUEAssociatedLPPaTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UplinkUEAssociatedLPPaTransport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UplinkUEAssociatedLPPaTransport, UplinkUEAssociatedLPPaTransport_sequence); return offset; } static const per_sequence_t DownlinkNonUEAssociatedLPPaTransport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_DownlinkNonUEAssociatedLPPaTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "DownlinkNonUEAssociatedLPPaTransport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_DownlinkNonUEAssociatedLPPaTransport, DownlinkNonUEAssociatedLPPaTransport_sequence); return offset; } static const per_sequence_t UplinkNonUEAssociatedLPPaTransport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UplinkNonUEAssociatedLPPaTransport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UplinkNonUEAssociatedLPPaTransport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UplinkNonUEAssociatedLPPaTransport, UplinkNonUEAssociatedLPPaTransport_sequence); return offset; } static const per_sequence_t E_RABModificationIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABModificationIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABModificationIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModificationIndication, E_RABModificationIndication_sequence); return offset; } static int dissect_s1ap_E_RABToBeModifiedListBearerModInd(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABToBeModifiedItemBearerModInd_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_dL_GTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABToBeModifiedItemBearerModInd(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABToBeModifiedItemBearerModInd, E_RABToBeModifiedItemBearerModInd_sequence); return offset; } static int dissect_s1ap_E_RABNotToBeModifiedListBearerModInd(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABNotToBeModifiedItemBearerModInd_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_transportLayerAddress, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_TransportLayerAddress }, { &hf_s1ap_dL_GTP_TEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_GTP_TEID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABNotToBeModifiedItemBearerModInd(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABNotToBeModifiedItemBearerModInd, E_RABNotToBeModifiedItemBearerModInd_sequence); return offset; } static const per_sequence_t CSGMembershipInfo_sequence[] = { { &hf_s1ap_cSGMembershipStatus, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CSGMembershipStatus }, { &hf_s1ap_cSG_Id , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CSG_Id }, { &hf_s1ap_cellAccessMode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_CellAccessMode }, { &hf_s1ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_PLMNidentity }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CSGMembershipInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CSGMembershipInfo, CSGMembershipInfo_sequence); return offset; } static const per_sequence_t E_RABModificationConfirm_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABModificationConfirm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "E-RABModificationConfirm"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModificationConfirm, E_RABModificationConfirm_sequence); return offset; } static const per_sequence_t E_RABModifyListBearerModConf_sequence_of[1] = { { &hf_s1ap_E_RABModifyListBearerModConf_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_SingleContainer }, }; static int dissect_s1ap_E_RABModifyListBearerModConf(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModifyListBearerModConf, E_RABModifyListBearerModConf_sequence_of, 1, maxnoofE_RABs, FALSE); return offset; } static const per_sequence_t E_RABModifyItemBearerModConf_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABModifyItemBearerModConf(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABModifyItemBearerModConf, E_RABModifyItemBearerModConf_sequence); return offset; } static const per_sequence_t UEContextModificationIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextModificationIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextModificationIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextModificationIndication, UEContextModificationIndication_sequence); return offset; } static const per_sequence_t UEContextModificationConfirm_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextModificationConfirm(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextModificationConfirm"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextModificationConfirm, UEContextModificationConfirm_sequence); return offset; } static const per_sequence_t UEContextSuspendRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextSuspendRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextSuspendRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextSuspendRequest, UEContextSuspendRequest_sequence); return offset; } static const per_sequence_t UEContextSuspendResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextSuspendResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextSuspendResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextSuspendResponse, UEContextSuspendResponse_sequence); return offset; } static const per_sequence_t UEContextResumeRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextResumeRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextResumeRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextResumeRequest, UEContextResumeRequest_sequence); return offset; } static int dissect_s1ap_E_RABFailedToResumeListResumeReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABFailedToResumeItemResumeReq_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_cause , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cause }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABFailedToResumeItemResumeReq(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABFailedToResumeItemResumeReq, E_RABFailedToResumeItemResumeReq_sequence); return offset; } static const per_sequence_t UEContextResumeResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextResumeResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextResumeResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextResumeResponse, UEContextResumeResponse_sequence); return offset; } static int dissect_s1ap_E_RABFailedToResumeListResumeRes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_s1ap_E_RAB_IE_ContainerList(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t E_RABFailedToResumeItemResumeRes_sequence[] = { { &hf_s1ap_e_RAB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_E_RAB_ID }, { &hf_s1ap_cause , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_Cause }, { &hf_s1ap_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_E_RABFailedToResumeItemResumeRes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_E_RABFailedToResumeItemResumeRes, E_RABFailedToResumeItemResumeRes_sequence); return offset; } static const per_sequence_t UEContextResumeFailure_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEContextResumeFailure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEContextResumeFailure"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEContextResumeFailure, UEContextResumeFailure_sequence); return offset; } static const per_sequence_t ConnectionEstablishmentIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ConnectionEstablishmentIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ConnectionEstablishmentIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ConnectionEstablishmentIndication, ConnectionEstablishmentIndication_sequence); return offset; } static const per_sequence_t RetrieveUEInformation_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_RetrieveUEInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "RetrieveUEInformation"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_RetrieveUEInformation, RetrieveUEInformation_sequence); return offset; } static const per_sequence_t UEInformationTransfer_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UEInformationTransfer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UEInformationTransfer"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UEInformationTransfer, UEInformationTransfer_sequence); return offset; } static const per_sequence_t ENBCPRelocationIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ENBCPRelocationIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "ENBCPRelocationIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ENBCPRelocationIndication, ENBCPRelocationIndication_sequence); return offset; } static const per_sequence_t MMECPRelocationIndication_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MMECPRelocationIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "MMECPRelocationIndication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MMECPRelocationIndication, MMECPRelocationIndication_sequence); return offset; } static const per_sequence_t SecondaryRATDataUsageReport_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SecondaryRATDataUsageReport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "SecondaryRATDataUsageReport"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SecondaryRATDataUsageReport, SecondaryRATDataUsageReport_sequence); return offset; } static const per_sequence_t UERadioCapabilityIDMappingRequest_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UERadioCapabilityIDMappingRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UERadioCapabilityIDMappingRequest"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UERadioCapabilityIDMappingRequest, UERadioCapabilityIDMappingRequest_sequence); return offset; } static const per_sequence_t UERadioCapabilityIDMappingResponse_sequence[] = { { &hf_s1ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UERadioCapabilityIDMappingResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "UERadioCapabilityIDMappingResponse"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UERadioCapabilityIDMappingResponse, UERadioCapabilityIDMappingResponse_sequence); return offset; } static int dissect_s1ap_InitiatingMessage_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->message_type = INITIATING_MESSAGE; offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_InitiatingMessageValue); return offset; } static const per_sequence_t InitiatingMessage_sequence[] = { { &hf_s1ap_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProcedureCode }, { &hf_s1ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_initiatingMessagevalue, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_InitiatingMessage_value }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_InitiatingMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_InitiatingMessage, InitiatingMessage_sequence); return offset; } static int dissect_s1ap_SuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->message_type = SUCCESSFUL_OUTCOME; offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_SuccessfulOutcomeValue); return offset; } static const per_sequence_t SuccessfulOutcome_sequence[] = { { &hf_s1ap_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProcedureCode }, { &hf_s1ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_successfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_SuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_SuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_SuccessfulOutcome, SuccessfulOutcome_sequence); return offset; } static int dissect_s1ap_UnsuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo); s1ap_data->message_type = UNSUCCESSFUL_OUTCOME; offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_UnsuccessfulOutcomeValue); return offset; } static const per_sequence_t UnsuccessfulOutcome_sequence[] = { { &hf_s1ap_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ProcedureCode }, { &hf_s1ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_Criticality }, { &hf_s1ap_unsuccessfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_UnsuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_UnsuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_UnsuccessfulOutcome, UnsuccessfulOutcome_sequence); return offset; } static const value_string s1ap_S1AP_PDU_vals[] = { { 0, "initiatingMessage" }, { 1, "successfulOutcome" }, { 2, "unsuccessfulOutcome" }, { 0, NULL } }; static const per_choice_t S1AP_PDU_choice[] = { { 0, &hf_s1ap_initiatingMessage, ASN1_EXTENSION_ROOT , dissect_s1ap_InitiatingMessage }, { 1, &hf_s1ap_successfulOutcome, ASN1_EXTENSION_ROOT , dissect_s1ap_SuccessfulOutcome }, { 2, &hf_s1ap_unsuccessfulOutcome, ASN1_EXTENSION_ROOT , dissect_s1ap_UnsuccessfulOutcome }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_S1AP_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_S1AP_PDU, S1AP_PDU_choice, NULL); return offset; } static const value_string s1ap_SONtransferApplicationIdentity_vals[] = { { 0, "cell-load-reporting" }, { 1, "multi-cell-load-reporting" }, { 2, "event-triggered-cell-load-reporting" }, { 3, "ho-reporting" }, { 4, "eutran-cell-activation" }, { 5, "energy-savings-indication" }, { 6, "failure-event-reporting" }, { 0, NULL } }; static int dissect_s1ap_SONtransferApplicationIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 6, NULL); return offset; } static int dissect_s1ap_OCTET_STRING(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static int dissect_s1ap_EHRPD_Sector_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL); return offset; } static const value_string s1ap_IRAT_Cell_ID_vals[] = { { 0, "eUTRAN" }, { 1, "uTRAN" }, { 2, "gERAN" }, { 3, "eHRPD" }, { 0, NULL } }; static const per_choice_t IRAT_Cell_ID_choice[] = { { 0, &hf_s1ap_eUTRAN_01 , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 1, &hf_s1ap_uTRAN , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 2, &hf_s1ap_gERAN , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 3, &hf_s1ap_eHRPD_01 , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_EHRPD_Sector_ID }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_IRAT_Cell_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_IRAT_Cell_ID, IRAT_Cell_ID_choice, NULL); return offset; } static const per_sequence_t RequestedCellList_sequence_of[1] = { { &hf_s1ap_RequestedCellList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_IRAT_Cell_ID }, }; static int dissect_s1ap_RequestedCellList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_RequestedCellList, RequestedCellList_sequence_of, 1, maxnoofIRATReportingCells, FALSE); return offset; } static const per_sequence_t MultiCellLoadReportingRequest_sequence[] = { { &hf_s1ap_requestedCellList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_RequestedCellList }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_MultiCellLoadReportingRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_MultiCellLoadReportingRequest, MultiCellLoadReportingRequest_sequence); return offset; } static const value_string s1ap_NumberOfMeasurementReportingLevels_vals[] = { { 0, "rl2" }, { 1, "rl3" }, { 2, "rl4" }, { 3, "rl5" }, { 4, "rl10" }, { 0, NULL } }; static int dissect_s1ap_NumberOfMeasurementReportingLevels(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t EventTriggeredCellLoadReportingRequest_sequence[] = { { &hf_s1ap_numberOfMeasurementReportingLevels, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NumberOfMeasurementReportingLevels }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EventTriggeredCellLoadReportingRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EventTriggeredCellLoadReportingRequest, EventTriggeredCellLoadReportingRequest_sequence); return offset; } static const value_string s1ap_HoType_vals[] = { { 0, "ltetoutran" }, { 1, "ltetogeran" }, { 0, NULL } }; static int dissect_s1ap_HoType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_HoReportType_vals[] = { { 0, "unnecessaryhotoanotherrat" }, { 1, "earlyirathandover" }, { 0, NULL } }; static int dissect_s1ap_HoReportType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 1, NULL); return offset; } static const per_sequence_t CandidateCellList_sequence_of[1] = { { &hf_s1ap_CandidateCellList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_IRAT_Cell_ID }, }; static int dissect_s1ap_CandidateCellList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CandidateCellList, CandidateCellList_sequence_of, 1, maxnoofcandidateCells, FALSE); return offset; } static int dissect_s1ap_INTEGER_0_503(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 503U, NULL, FALSE); return offset; } static const per_sequence_t CandidatePCI_sequence[] = { { &hf_s1ap_pCI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_INTEGER_0_503 }, { &hf_s1ap_eARFCN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_OCTET_STRING }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CandidatePCI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CandidatePCI, CandidatePCI_sequence); return offset; } static const per_sequence_t CandidatePCIList_sequence_of[1] = { { &hf_s1ap_CandidatePCIList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CandidatePCI }, }; static int dissect_s1ap_CandidatePCIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CandidatePCIList, CandidatePCIList_sequence_of, 1, maxnoofcandidateCells, FALSE); return offset; } static const per_sequence_t HOReport_sequence[] = { { &hf_s1ap_hoType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_HoType }, { &hf_s1ap_hoReportType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_HoReportType }, { &hf_s1ap_hosourceID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_IRAT_Cell_ID }, { &hf_s1ap_hoTargetID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_IRAT_Cell_ID }, { &hf_s1ap_candidateCellList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CandidateCellList }, { &hf_s1ap_candidatePCIList, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_s1ap_CandidatePCIList }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_HOReport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_HOReport, HOReport_sequence); return offset; } static const per_sequence_t CellsToActivateList_Item_sequence[] = { { &hf_s1ap_cell_ID_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_OCTET_STRING }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellsToActivateList_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellsToActivateList_Item, CellsToActivateList_Item_sequence); return offset; } static const per_sequence_t CellsToActivateList_sequence_of[1] = { { &hf_s1ap_CellsToActivateList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_CellsToActivateList_Item }, }; static int dissect_s1ap_CellsToActivateList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_CellsToActivateList, CellsToActivateList_sequence_of, 1, maxnoofCellineNB, FALSE); return offset; } static int dissect_s1ap_INTEGER_1_60(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 60U, NULL, FALSE); return offset; } static const per_sequence_t CellActivationRequest_sequence[] = { { &hf_s1ap_cellsToActivateList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellsToActivateList }, { &hf_s1ap_minimumActivationTime, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_INTEGER_1_60 }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellActivationRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellActivationRequest, CellActivationRequest_sequence); return offset; } static const value_string s1ap_NotifyFlag_vals[] = { { 0, "activated" }, { 1, "deactivated" }, { 0, NULL } }; static int dissect_s1ap_NotifyFlag(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t NotificationCellList_Item_sequence[] = { { &hf_s1ap_cell_ID_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_OCTET_STRING }, { &hf_s1ap_notifyFlag , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NotifyFlag }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_NotificationCellList_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_NotificationCellList_Item, NotificationCellList_Item_sequence); return offset; } static const per_sequence_t NotificationCellList_sequence_of[1] = { { &hf_s1ap_NotificationCellList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_NotificationCellList_Item }, }; static int dissect_s1ap_NotificationCellList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_NotificationCellList, NotificationCellList_sequence_of, 1, maxnoofCellineNB, FALSE); return offset; } static const per_sequence_t CellStateIndication_sequence[] = { { &hf_s1ap_notificationCellList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_NotificationCellList }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellStateIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellStateIndication, CellStateIndication_sequence); return offset; } static int dissect_s1ap_T_uERLFReportContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; if (g_s1ap_dissect_container) { subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_UE_RLF_Report_Container); volatile int saved_offset = offset; TRY { dissect_lte_rrc_RLF_Report_r9_PDU(parameter_tvb, actx->pinfo, subtree, NULL); } CATCH_BOUNDS_ERRORS { show_exception(parameter_tvb, actx->pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; offset = saved_offset; } return offset; } static const per_sequence_t TooEarlyInterRATHOReportReportFromEUTRAN_sequence[] = { { &hf_s1ap_uERLFReportContainer, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_T_uERLFReportContainer }, { &hf_s1ap_mobilityInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_MobilityInformation }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_TooEarlyInterRATHOReportReportFromEUTRAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_TooEarlyInterRATHOReportReportFromEUTRAN, TooEarlyInterRATHOReportReportFromEUTRAN_sequence); return offset; } static const value_string s1ap_FailureEventReport_vals[] = { { 0, "tooEarlyInterRATHOReportFromEUTRAN" }, { 0, NULL } }; static const per_choice_t FailureEventReport_choice[] = { { 0, &hf_s1ap_tooEarlyInterRATHOReportFromEUTRAN, ASN1_EXTENSION_ROOT , dissect_s1ap_TooEarlyInterRATHOReportReportFromEUTRAN }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_FailureEventReport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_FailureEventReport, FailureEventReport_choice, NULL); return offset; } const value_string s1ap_SONtransferRequestContainer_vals[] = { { 0, "cellLoadReporting" }, { 1, "multiCellLoadReporting" }, { 2, "eventTriggeredCellLoadReporting" }, { 3, "hOReporting" }, { 4, "eutranCellActivation" }, { 5, "energySavingsIndication" }, { 6, "failureEventReporting" }, { 0, NULL } }; static const per_choice_t SONtransferRequestContainer_choice[] = { { 0, &hf_s1ap_cellLoadReporting, ASN1_EXTENSION_ROOT , dissect_s1ap_NULL }, { 1, &hf_s1ap_multiCellLoadReporting, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_MultiCellLoadReportingRequest }, { 2, &hf_s1ap_eventTriggeredCellLoadReporting, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_EventTriggeredCellLoadReportingRequest }, { 3, &hf_s1ap_hOReporting , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_HOReport }, { 4, &hf_s1ap_eutranCellActivation, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellActivationRequest }, { 5, &hf_s1ap_energySavingsIndication, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellStateIndication }, { 6, &hf_s1ap_failureEventReporting, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_FailureEventReport }, { 0, NULL, 0, NULL } }; int dissect_s1ap_SONtransferRequestContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SONtransferRequestContainer, SONtransferRequestContainer_choice, NULL); return offset; } static int dissect_s1ap_CompositeAvailableCapacityGroup(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static const per_sequence_t EUTRANcellLoadReportingResponse_sequence[] = { { &hf_s1ap_compositeAvailableCapacityGroup, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CompositeAvailableCapacityGroup }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EUTRANcellLoadReportingResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EUTRANcellLoadReportingResponse, EUTRANcellLoadReportingResponse_sequence); return offset; } static int dissect_s1ap_EHRPDSectorCapacityClassValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 100U, NULL, TRUE); return offset; } static int dissect_s1ap_EHRPDCapacityValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 100U, NULL, FALSE); return offset; } static const per_sequence_t EHRPDCompositeAvailableCapacity_sequence[] = { { &hf_s1ap_eHRPDSectorCapacityClassValue, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EHRPDSectorCapacityClassValue }, { &hf_s1ap_eHRPDCapacityValue, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EHRPDCapacityValue }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EHRPDCompositeAvailableCapacity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EHRPDCompositeAvailableCapacity, EHRPDCompositeAvailableCapacity_sequence); return offset; } static const per_sequence_t EHRPDSectorLoadReportingResponse_sequence[] = { { &hf_s1ap_dL_EHRPD_CompositeAvailableCapacity, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EHRPDCompositeAvailableCapacity }, { &hf_s1ap_uL_EHRPD_CompositeAvailableCapacity, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EHRPDCompositeAvailableCapacity }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EHRPDSectorLoadReportingResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EHRPDSectorLoadReportingResponse, EHRPDSectorLoadReportingResponse_sequence); return offset; } static const value_string s1ap_CellLoadReportingResponse_vals[] = { { 0, "eUTRAN" }, { 1, "uTRAN" }, { 2, "gERAN" }, { 3, "eHRPD" }, { 0, NULL } }; static const per_choice_t CellLoadReportingResponse_choice[] = { { 0, &hf_s1ap_eUTRAN , ASN1_EXTENSION_ROOT , dissect_s1ap_EUTRANcellLoadReportingResponse }, { 1, &hf_s1ap_uTRAN , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 2, &hf_s1ap_gERAN , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 3, &hf_s1ap_eHRPD , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_EHRPDSectorLoadReportingResponse }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_CellLoadReportingResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_CellLoadReportingResponse, CellLoadReportingResponse_choice, NULL); return offset; } static const per_sequence_t EUTRANResponse_sequence[] = { { &hf_s1ap_cell_ID_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_OCTET_STRING }, { &hf_s1ap_eUTRANcellLoadReportingResponse, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EUTRANcellLoadReportingResponse }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EUTRANResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EUTRANResponse, EUTRANResponse_sequence); return offset; } static const per_sequence_t EHRPDMultiSectorLoadReportingResponseItem_sequence[] = { { &hf_s1ap_eHRPD_Sector_ID_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EHRPD_Sector_ID }, { &hf_s1ap_eHRPDSectorLoadReportingResponse, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_EHRPDSectorLoadReportingResponse }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EHRPDMultiSectorLoadReportingResponseItem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EHRPDMultiSectorLoadReportingResponseItem, EHRPDMultiSectorLoadReportingResponseItem_sequence); return offset; } static const value_string s1ap_MultiCellLoadReportingResponse_Item_vals[] = { { 0, "eUTRANResponse" }, { 1, "uTRANResponse" }, { 2, "gERANResponse" }, { 3, "eHRPD" }, { 0, NULL } }; static const per_choice_t MultiCellLoadReportingResponse_Item_choice[] = { { 0, &hf_s1ap_eUTRANResponse , ASN1_EXTENSION_ROOT , dissect_s1ap_EUTRANResponse }, { 1, &hf_s1ap_uTRANResponse , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 2, &hf_s1ap_gERANResponse , ASN1_EXTENSION_ROOT , dissect_s1ap_OCTET_STRING }, { 3, &hf_s1ap_eHRPD_02 , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_EHRPDMultiSectorLoadReportingResponseItem }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_MultiCellLoadReportingResponse_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_MultiCellLoadReportingResponse_Item, MultiCellLoadReportingResponse_Item_choice, NULL); return offset; } static const per_sequence_t MultiCellLoadReportingResponse_sequence_of[1] = { { &hf_s1ap_MultiCellLoadReportingResponse_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_MultiCellLoadReportingResponse_Item }, }; static int dissect_s1ap_MultiCellLoadReportingResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_MultiCellLoadReportingResponse, MultiCellLoadReportingResponse_sequence_of, 1, maxnoofIRATReportingCells, FALSE); return offset; } static const value_string s1ap_OverloadFlag_vals[] = { { 0, "overload" }, { 0, NULL } }; static int dissect_s1ap_OverloadFlag(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t EventTriggeredCellLoadReportingResponse_sequence[] = { { &hf_s1ap_cellLoadReportingResponse, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_CellLoadReportingResponse }, { &hf_s1ap_overloadFlag , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_s1ap_OverloadFlag }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_EventTriggeredCellLoadReportingResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_EventTriggeredCellLoadReportingResponse, EventTriggeredCellLoadReportingResponse_sequence); return offset; } static const per_sequence_t ActivatedCellsList_Item_sequence[] = { { &hf_s1ap_cell_ID_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_OCTET_STRING }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_ActivatedCellsList_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_ActivatedCellsList_Item, ActivatedCellsList_Item_sequence); return offset; } static const per_sequence_t ActivatedCellsList_sequence_of[1] = { { &hf_s1ap_ActivatedCellsList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_s1ap_ActivatedCellsList_Item }, }; static int dissect_s1ap_ActivatedCellsList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_s1ap_ActivatedCellsList, ActivatedCellsList_sequence_of, 0, maxnoofCellineNB, FALSE); return offset; } static const per_sequence_t CellActivationResponse_sequence[] = { { &hf_s1ap_activatedCellsList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_s1ap_ActivatedCellsList }, { NULL, 0, 0, NULL } }; static int dissect_s1ap_CellActivationResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_s1ap_CellActivationResponse, CellActivationResponse_sequence); return offset; } const value_string s1ap_SONtransferResponseContainer_vals[] = { { 0, "cellLoadReporting" }, { 1, "multiCellLoadReporting" }, { 2, "eventTriggeredCellLoadReporting" }, { 3, "hOReporting" }, { 4, "eutranCellActivation" }, { 5, "energySavingsIndication" }, { 6, "failureEventReporting" }, { 0, NULL } }; static const per_choice_t SONtransferResponseContainer_choice[] = { { 0, &hf_s1ap_cellLoadReporting_01, ASN1_EXTENSION_ROOT , dissect_s1ap_CellLoadReportingResponse }, { 1, &hf_s1ap_multiCellLoadReporting_01, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_MultiCellLoadReportingResponse }, { 2, &hf_s1ap_eventTriggeredCellLoadReporting_01, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_EventTriggeredCellLoadReportingResponse }, { 3, &hf_s1ap_hOReporting_01 , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_NULL }, { 4, &hf_s1ap_eutranCellActivation_01, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellActivationResponse }, { 5, &hf_s1ap_energySavingsIndication_01, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_NULL }, { 6, &hf_s1ap_failureEventReporting_01, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_NULL }, { 0, NULL, 0, NULL } }; int dissect_s1ap_SONtransferResponseContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SONtransferResponseContainer, SONtransferResponseContainer_choice, NULL); return offset; } static const value_string s1ap_CellLoadReportingCause_vals[] = { { 0, "application-container-syntax-error" }, { 1, "inconsistent-reporting-cell-identifier" }, { 2, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_CellLoadReportingCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_HOReportingCause_vals[] = { { 0, "application-container-syntax-error" }, { 1, "inconsistent-reporting-cell-identifier" }, { 2, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_HOReportingCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_CellActivationCause_vals[] = { { 0, "application-container-syntax-error" }, { 1, "inconsistent-reporting-cell-identifier" }, { 2, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_CellActivationCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_CellStateIndicationCause_vals[] = { { 0, "application-container-syntax-error" }, { 1, "inconsistent-reporting-cell-identifier" }, { 2, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_CellStateIndicationCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_FailureEventReportingCause_vals[] = { { 0, "application-container-syntax-error" }, { 1, "inconsistent-reporting-cell-identifier" }, { 2, "unspecified" }, { 0, NULL } }; static int dissect_s1ap_FailureEventReportingCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string s1ap_SONtransferCause_vals[] = { { 0, "cellLoadReporting" }, { 1, "multiCellLoadReporting" }, { 2, "eventTriggeredCellLoadReporting" }, { 3, "hOReporting" }, { 4, "eutranCellActivation" }, { 5, "energySavingsIndication" }, { 6, "failureEventReporting" }, { 0, NULL } }; static const per_choice_t SONtransferCause_choice[] = { { 0, &hf_s1ap_cellLoadReporting_02, ASN1_EXTENSION_ROOT , dissect_s1ap_CellLoadReportingCause }, { 1, &hf_s1ap_multiCellLoadReporting_02, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellLoadReportingCause }, { 2, &hf_s1ap_eventTriggeredCellLoadReporting_02, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellLoadReportingCause }, { 3, &hf_s1ap_hOReporting_02 , ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_HOReportingCause }, { 4, &hf_s1ap_eutranCellActivation_02, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellActivationCause }, { 5, &hf_s1ap_energySavingsIndication_02, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_CellStateIndicationCause }, { 6, &hf_s1ap_failureEventReporting_02, ASN1_NOT_EXTENSION_ROOT, dissect_s1ap_FailureEventReportingCause }, { 0, NULL, 0, NULL } }; static int dissect_s1ap_SONtransferCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_s1ap_SONtransferCause, SONtransferCause_choice, NULL); return offset; } /*--- PDUs ---*/ static int dissect_Additional_GUTI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Additional_GUTI(tvb, offset, &asn1_ctx, tree, hf_s1ap_Additional_GUTI_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_AdditionalRRMPriorityIndex_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_AdditionalRRMPriorityIndex(tvb, offset, &asn1_ctx, tree, hf_s1ap_AdditionalRRMPriorityIndex_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_AerialUEsubscriptionInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_AerialUEsubscriptionInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_AerialUEsubscriptionInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_AssistanceDataForPaging_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_AssistanceDataForPaging(tvb, offset, &asn1_ctx, tree, hf_s1ap_AssistanceDataForPaging_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Bearers_SubjectToStatusTransfer_Item_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Bearers_SubjectToStatusTransfer_Item(tvb, offset, &asn1_ctx, tree, hf_s1ap_Bearers_SubjectToStatusTransfer_Item_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Bearers_SubjectToEarlyStatusTransfer_Item_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item(tvb, offset, &asn1_ctx, tree, hf_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_BearerType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_BearerType(tvb, offset, &asn1_ctx, tree, hf_s1ap_BearerType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_BluetoothMeasurementConfiguration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_BluetoothMeasurementConfiguration(tvb, offset, &asn1_ctx, tree, hf_s1ap_BluetoothMeasurementConfiguration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_BroadcastCancelledAreaList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_BroadcastCancelledAreaList(tvb, offset, &asn1_ctx, tree, hf_s1ap_BroadcastCancelledAreaList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_BroadcastCompletedAreaList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_BroadcastCompletedAreaList(tvb, offset, &asn1_ctx, tree, hf_s1ap_BroadcastCompletedAreaList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cause(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CellAccessMode_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CellAccessMode(tvb, offset, &asn1_ctx, tree, hf_s1ap_CellAccessMode_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CellIdentifierAndCELevelForCECapableUEs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CellIdentifierAndCELevelForCECapableUEs(tvb, offset, &asn1_ctx, tree, hf_s1ap_CellIdentifierAndCELevelForCECapableUEs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CE_mode_B_SupportIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CE_mode_B_SupportIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_CE_mode_B_SupportIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000PDU(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000PDU_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000RATType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000RATType(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000RATType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000SectorID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000SectorID(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000SectorID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000HOStatus_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000HOStatus(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000HOStatus_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000HORequiredIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000HORequiredIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000HORequiredIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000OneXSRVCCInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000OneXSRVCCInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000OneXSRVCCInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cdma2000OneXRAND_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Cdma2000OneXRAND(tvb, offset, &asn1_ctx, tree, hf_s1ap_Cdma2000OneXRAND_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CNDomain_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CNDomain(tvb, offset, &asn1_ctx, tree, hf_s1ap_CNDomain_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CNTypeRestrictions_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CNTypeRestrictions(tvb, offset, &asn1_ctx, tree, hf_s1ap_CNTypeRestrictions_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ConcurrentWarningMessageIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ConcurrentWarningMessageIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_ConcurrentWarningMessageIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ConnectedengNBList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ConnectedengNBList(tvb, offset, &asn1_ctx, tree, hf_s1ap_ConnectedengNBList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ContextatSource_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ContextatSource(tvb, offset, &asn1_ctx, tree, hf_s1ap_ContextatSource_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Correlation_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Correlation_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_Correlation_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CSFallbackIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CSFallbackIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_CSFallbackIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_AdditionalCSFallbackIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_AdditionalCSFallbackIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_AdditionalCSFallbackIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CSG_Id_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CSG_Id(tvb, offset, &asn1_ctx, tree, hf_s1ap_CSG_Id_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CSG_IdList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CSG_IdList(tvb, offset, &asn1_ctx, tree, hf_s1ap_CSG_IdList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CSGMembershipStatus_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CSGMembershipStatus(tvb, offset, &asn1_ctx, tree, hf_s1ap_CSGMembershipStatus_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_COUNTValueExtended_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_COUNTValueExtended(tvb, offset, &asn1_ctx, tree, hf_s1ap_COUNTValueExtended_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_COUNTvaluePDCP_SNlength18_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_COUNTvaluePDCP_SNlength18(tvb, offset, &asn1_ctx, tree, hf_s1ap_COUNTvaluePDCP_SNlength18_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Coverage_Level_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Coverage_Level(tvb, offset, &asn1_ctx, tree, hf_s1ap_Coverage_Level_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CriticalityDiagnostics_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CriticalityDiagnostics(tvb, offset, &asn1_ctx, tree, hf_s1ap_CriticalityDiagnostics_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DAPSRequestInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DAPSRequestInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_DAPSRequestInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DAPSResponseInfoList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DAPSResponseInfoList(tvb, offset, &asn1_ctx, tree, hf_s1ap_DAPSResponseInfoList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DAPSResponseInfoItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DAPSResponseInfoItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_DAPSResponseInfoItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DataCodingScheme_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DataCodingScheme(tvb, offset, &asn1_ctx, tree, hf_s1ap_DataCodingScheme_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DataSize_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DataSize(tvb, offset, &asn1_ctx, tree, hf_s1ap_DataSize_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DCN_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DCN_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_DCN_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ServedDCNs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ServedDCNs(tvb, offset, &asn1_ctx, tree, hf_s1ap_ServedDCNs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DL_CP_SecurityInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DL_CP_SecurityInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_DL_CP_SecurityInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Direct_Forwarding_Path_Availability_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Direct_Forwarding_Path_Availability(tvb, offset, &asn1_ctx, tree, hf_s1ap_Direct_Forwarding_Path_Availability_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Data_Forwarding_Not_Possible_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Data_Forwarding_Not_Possible(tvb, offset, &asn1_ctx, tree, hf_s1ap_Data_Forwarding_Not_Possible_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DLNASPDUDeliveryAckRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DLNASPDUDeliveryAckRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_DLNASPDUDeliveryAckRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PWSfailedECGIList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PWSfailedECGIList(tvb, offset, &asn1_ctx, tree, hf_s1ap_PWSfailedECGIList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_EDT_Session_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EDT_Session(tvb, offset, &asn1_ctx, tree, hf_s1ap_EDT_Session_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_EmergencyAreaIDListForRestart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EmergencyAreaIDListForRestart(tvb, offset, &asn1_ctx, tree, hf_s1ap_EmergencyAreaIDListForRestart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_EmergencyIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EmergencyIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_EmergencyIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENB_EarlyStatusTransfer_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENB_EarlyStatusTransfer_TransparentContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENB_EarlyStatusTransfer_TransparentContainer_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_Global_ENB_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Global_ENB_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_Global_ENB_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_GUMMEIList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_GUMMEIList(tvb, offset, &asn1_ctx, tree, hf_s1ap_GUMMEIList_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENB_StatusTransfer_TransparentContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_ENB_StatusTransfer_TransparentContainer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENB_UE_S1AP_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENB_UE_S1AP_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENB_UE_S1AP_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBname_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBname(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBname_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_EN_DCSONConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EN_DCSONConfigurationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_EN_DCSONConfigurationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_EndIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EndIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_EndIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_EnhancedCoverageRestricted_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EnhancedCoverageRestricted(tvb, offset, &asn1_ctx, tree, hf_s1ap_EnhancedCoverageRestricted_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CE_ModeBRestricted_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CE_ModeBRestricted(tvb, offset, &asn1_ctx, tree, hf_s1ap_CE_ModeBRestricted_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABInformationListItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABInformationListItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABInformationListItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABLevelQoSParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABLevelQoSParameters(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABLevelQoSParameters_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSecurityResultList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSecurityResultList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSecurityResultList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSecurityResultItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSecurityResultItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSecurityResultItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABUsageReportItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABUsageReportItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABUsageReportItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Ethernet_Type_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Ethernet_Type(tvb, offset, &asn1_ctx, tree, hf_s1ap_Ethernet_Type_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_EUTRAN_CGI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EUTRAN_CGI(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_EUTRAN_CGI_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_EUTRANRoundTripDelayEstimationInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_EUTRANRoundTripDelayEstimationInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_EUTRANRoundTripDelayEstimationInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ExpectedUEBehaviour_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ExpectedUEBehaviour(tvb, offset, &asn1_ctx, tree, hf_s1ap_ExpectedUEBehaviour_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ExtendedBitRate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ExtendedBitRate(tvb, offset, &asn1_ctx, tree, hf_s1ap_ExtendedBitRate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ExtendedRepetitionPeriod_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ExtendedRepetitionPeriod(tvb, offset, &asn1_ctx, tree, hf_s1ap_ExtendedRepetitionPeriod_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Extended_UEIdentityIndexValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Extended_UEIdentityIndexValue(tvb, offset, &asn1_ctx, tree, hf_s1ap_Extended_UEIdentityIndexValue_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_GUMMEI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_GUMMEI(tvb, offset, &asn1_ctx, tree, hf_s1ap_GUMMEI_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_GUMMEIType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_GUMMEIType(tvb, offset, &asn1_ctx, tree, hf_s1ap_GUMMEIType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_GWContextReleaseIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_GWContextReleaseIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_GWContextReleaseIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverFlag_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverFlag(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverFlag_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_HandoverRestrictionList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverRestrictionList(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_HandoverRestrictionList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverType(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Masked_IMEISV_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Masked_IMEISV(tvb, offset, &asn1_ctx, tree, hf_s1ap_Masked_IMEISV_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_InformationOnRecommendedCellsAndENBsForPaging_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_InformationOnRecommendedCellsAndENBsForPaging(tvb, offset, &asn1_ctx, tree, hf_s1ap_InformationOnRecommendedCellsAndENBsForPaging_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_IntersystemMeasurementConfiguration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_IntersystemMeasurementConfiguration(tvb, offset, &asn1_ctx, tree, hf_s1ap_IntersystemMeasurementConfiguration_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_IntersystemSONConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_IntersystemSONConfigurationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_IntersystemSONConfigurationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_IMSvoiceEPSfallbackfrom5G_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_IMSvoiceEPSfallbackfrom5G(tvb, offset, &asn1_ctx, tree, hf_s1ap_IMSvoiceEPSfallbackfrom5G_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_IAB_Authorized_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_IAB_Authorized(tvb, offset, &asn1_ctx, tree, hf_s1ap_IAB_Authorized_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_IAB_Node_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_IAB_Node_Indication(tvb, offset, &asn1_ctx, tree, hf_s1ap_IAB_Node_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_IAB_Supported_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_IAB_Supported(tvb, offset, &asn1_ctx, tree, hf_s1ap_IAB_Supported_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_KillAllWarningMessages_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_KillAllWarningMessages(tvb, offset, &asn1_ctx, tree, hf_s1ap_KillAllWarningMessages_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LAI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LAI(tvb, offset, &asn1_ctx, tree, hf_s1ap_LAI_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_LastVisitedEUTRANCellInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LastVisitedEUTRANCellInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_LastVisitedEUTRANCellInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LastVisitedPSCellList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LastVisitedPSCellList(tvb, offset, &asn1_ctx, tree, hf_s1ap_LastVisitedPSCellList_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_LastVisitedGERANCellInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LastVisitedGERANCellInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_LastVisitedGERANCellInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LPPa_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LPPa_PDU(tvb, offset, &asn1_ctx, tree, hf_s1ap_LPPa_PDU_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LHN_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LHN_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_LHN_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LoggedMBSFNMDT_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LoggedMBSFNMDT(tvb, offset, &asn1_ctx, tree, hf_s1ap_LoggedMBSFNMDT_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LoggedMDTTrigger_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LoggedMDTTrigger(tvb, offset, &asn1_ctx, tree, hf_s1ap_LoggedMDTTrigger_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LTE_M_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LTE_M_Indication(tvb, offset, &asn1_ctx, tree, hf_s1ap_LTE_M_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LTE_NTN_TAI_Information_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LTE_NTN_TAI_Information(tvb, offset, &asn1_ctx, tree, hf_s1ap_LTE_NTN_TAI_Information_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_M3Configuration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_M3Configuration(tvb, offset, &asn1_ctx, tree, hf_s1ap_M3Configuration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_M4Configuration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_M4Configuration(tvb, offset, &asn1_ctx, tree, hf_s1ap_M4Configuration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_M5Configuration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_M5Configuration(tvb, offset, &asn1_ctx, tree, hf_s1ap_M5Configuration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_M6Configuration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_M6Configuration(tvb, offset, &asn1_ctx, tree, hf_s1ap_M6Configuration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_M7Configuration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_M7Configuration(tvb, offset, &asn1_ctx, tree, hf_s1ap_M7Configuration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MDT_Location_Info_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MDT_Location_Info(tvb, offset, &asn1_ctx, tree, hf_s1ap_MDT_Location_Info_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MDT_Configuration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MDT_Configuration(tvb, offset, &asn1_ctx, tree, hf_s1ap_MDT_Configuration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ManagementBasedMDTAllowed_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ManagementBasedMDTAllowed(tvb, offset, &asn1_ctx, tree, hf_s1ap_ManagementBasedMDTAllowed_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MDTPLMNList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MDTPLMNList(tvb, offset, &asn1_ctx, tree, hf_s1ap_MDTPLMNList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PrivacyIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PrivacyIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_PrivacyIndicator_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_MDTMode_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MDTMode(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_MDTMode_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MessageIdentifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MessageIdentifier(tvb, offset, &asn1_ctx, tree, hf_s1ap_MessageIdentifier_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MobilityInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MobilityInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_MobilityInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEname_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEname(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEname_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMERelaySupportIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMERelaySupportIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMERelaySupportIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MME_Group_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MME_Group_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_MME_Group_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MME_UE_S1AP_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MME_UE_S1AP_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_MME_UE_S1AP_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MSClassmark2_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MSClassmark2(tvb, offset, &asn1_ctx, tree, hf_s1ap_MSClassmark2_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MSClassmark3_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MSClassmark3(tvb, offset, &asn1_ctx, tree, hf_s1ap_MSClassmark3_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MutingAvailabilityIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MutingAvailabilityIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_MutingAvailabilityIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MutingPatternInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MutingPatternInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_MutingPatternInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MDT_ConfigurationNR_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MDT_ConfigurationNR(tvb, offset, &asn1_ctx, tree, hf_s1ap_MDT_ConfigurationNR_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NAS_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NAS_PDU(tvb, offset, &asn1_ctx, tree, hf_s1ap_NAS_PDU_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NASSecurityParametersfromE_UTRAN_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NASSecurityParametersfromE_UTRAN(tvb, offset, &asn1_ctx, tree, hf_s1ap_NASSecurityParametersfromE_UTRAN_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NASSecurityParameterstoE_UTRAN_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NASSecurityParameterstoE_UTRAN(tvb, offset, &asn1_ctx, tree, hf_s1ap_NASSecurityParameterstoE_UTRAN_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NB_IoT_DefaultPagingDRX_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NB_IoT_DefaultPagingDRX(tvb, offset, &asn1_ctx, tree, hf_s1ap_NB_IoT_DefaultPagingDRX_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NB_IoT_PagingDRX_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NB_IoT_PagingDRX(tvb, offset, &asn1_ctx, tree, hf_s1ap_NB_IoT_PagingDRX_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NB_IoT_Paging_eDRXInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NB_IoT_Paging_eDRXInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_NB_IoT_Paging_eDRXInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NB_IoT_RLF_Report_Container_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NB_IoT_RLF_Report_Container(tvb, offset, &asn1_ctx, tree, hf_s1ap_NB_IoT_RLF_Report_Container_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NB_IoT_UEIdentityIndexValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NB_IoT_UEIdentityIndexValue(tvb, offset, &asn1_ctx, tree, hf_s1ap_NB_IoT_UEIdentityIndexValue_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NotifySourceeNB_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NotifySourceeNB(tvb, offset, &asn1_ctx, tree, hf_s1ap_NotifySourceeNB_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NRrestrictioninEPSasSecondaryRAT_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NRrestrictioninEPSasSecondaryRAT(tvb, offset, &asn1_ctx, tree, hf_s1ap_NRrestrictioninEPSasSecondaryRAT_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NRrestrictionin5GS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NRrestrictionin5GS(tvb, offset, &asn1_ctx, tree, hf_s1ap_NRrestrictionin5GS_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NRUESecurityCapabilities_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NRUESecurityCapabilities(tvb, offset, &asn1_ctx, tree, hf_s1ap_NRUESecurityCapabilities_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NumberofBroadcastRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NumberofBroadcastRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_NumberofBroadcastRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NRV2XServicesAuthorized_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NRV2XServicesAuthorized(tvb, offset, &asn1_ctx, tree, hf_s1ap_NRV2XServicesAuthorized_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NRUESidelinkAggregateMaximumBitrate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NRUESidelinkAggregateMaximumBitrate(tvb, offset, &asn1_ctx, tree, hf_s1ap_NRUESidelinkAggregateMaximumBitrate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_OverloadResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_OverloadResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_OverloadResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Packet_LossRate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Packet_LossRate(tvb, offset, &asn1_ctx, tree, hf_s1ap_Packet_LossRate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Paging_eDRXInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Paging_eDRXInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_Paging_eDRXInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PagingDRX_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PagingDRX(tvb, offset, &asn1_ctx, tree, hf_s1ap_PagingDRX_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PagingPriority_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PagingPriority(tvb, offset, &asn1_ctx, tree, hf_s1ap_PagingPriority_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PagingCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PagingCause(tvb, offset, &asn1_ctx, tree, hf_s1ap_PagingCause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PC5QoSParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PC5QoSParameters(tvb, offset, &asn1_ctx, tree, hf_s1ap_PC5QoSParameters_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PendingDataIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PendingDataIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_PendingDataIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PLMNidentity_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PLMNidentity(tvb, offset, &asn1_ctx, tree, hf_s1ap_PLMNidentity_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ProSeAuthorized_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ProSeAuthorized(tvb, offset, &asn1_ctx, tree, hf_s1ap_ProSeAuthorized_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ProSeUEtoNetworkRelaying_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ProSeUEtoNetworkRelaying(tvb, offset, &asn1_ctx, tree, hf_s1ap_ProSeUEtoNetworkRelaying_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PS_ServiceNotAvailable_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PS_ServiceNotAvailable(tvb, offset, &asn1_ctx, tree, hf_s1ap_PS_ServiceNotAvailable_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_PSCellInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PSCellInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_PSCellInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RACSIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RACSIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_RACSIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ReceiveStatusOfULPDCPSDUsExtended_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ReceiveStatusOfULPDCPSDUsExtended(tvb, offset, &asn1_ctx, tree, hf_s1ap_ReceiveStatusOfULPDCPSDUsExtended_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18(tvb, offset, &asn1_ctx, tree, hf_s1ap_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RecommendedCellItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RecommendedCellItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_RecommendedCellItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RecommendedENBItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RecommendedENBItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_RecommendedENBItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RelativeMMECapacity_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RelativeMMECapacity(tvb, offset, &asn1_ctx, tree, hf_s1ap_RelativeMMECapacity_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RelayNode_Indicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RelayNode_Indicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_RelayNode_Indicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RAT_Restrictions_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RAT_Restrictions(tvb, offset, &asn1_ctx, tree, hf_s1ap_RAT_Restrictions_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RAT_Type_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RAT_Type(tvb, offset, &asn1_ctx, tree, hf_s1ap_RAT_Type_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RequestType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RequestType(tvb, offset, &asn1_ctx, tree, hf_s1ap_RequestType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RequestTypeAdditionalInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RequestTypeAdditionalInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_RequestTypeAdditionalInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RepetitionPeriod_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RepetitionPeriod(tvb, offset, &asn1_ctx, tree, hf_s1ap_RepetitionPeriod_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RRC_Establishment_Cause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RRC_Establishment_Cause(tvb, offset, &asn1_ctx, tree, hf_s1ap_RRC_Establishment_Cause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ECGIListForRestart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ECGIListForRestart(tvb, offset, &asn1_ctx, tree, hf_s1ap_ECGIListForRestart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Routing_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Routing_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_Routing_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecurityKey_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecurityKey(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecurityKey_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecurityContext_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecurityContext(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecurityContext_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecondaryRATDataUsageRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecondaryRATDataUsageRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecondaryRATDataUsageRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecondaryRATDataUsageReportList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecondaryRATDataUsageReportList(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecondaryRATDataUsageReportList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecondaryRATDataUsageReportItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecondaryRATDataUsageReportItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecondaryRATDataUsageReportItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecurityIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecurityIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecurityIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SensorMeasurementConfiguration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SensorMeasurementConfiguration(tvb, offset, &asn1_ctx, tree, hf_s1ap_SensorMeasurementConfiguration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SerialNumber_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SerialNumber(tvb, offset, &asn1_ctx, tree, hf_s1ap_SerialNumber_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ServiceType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ServiceType(tvb, offset, &asn1_ctx, tree, hf_s1ap_ServiceType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SONInformationReport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SONInformationReport(tvb, offset, &asn1_ctx, tree, hf_s1ap_SONInformationReport_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_SONConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SONConfigurationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_SONConfigurationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SynchronisationInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SynchronisationInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_SynchronisationInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Source_ToTarget_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Source_ToTarget_TransparentContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_Source_ToTarget_TransparentContainer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SRVCCOperationNotPossible_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SRVCCOperationNotPossible(tvb, offset, &asn1_ctx, tree, hf_s1ap_SRVCCOperationNotPossible_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SRVCCOperationPossible_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SRVCCOperationPossible(tvb, offset, &asn1_ctx, tree, hf_s1ap_SRVCCOperationPossible_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SRVCCHOIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SRVCCHOIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_SRVCCHOIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SourceNodeID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SourceNodeID(tvb, offset, &asn1_ctx, tree, hf_s1ap_SourceNodeID_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ServedGUMMEIs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ServedGUMMEIs(tvb, offset, &asn1_ctx, tree, hf_s1ap_ServedGUMMEIs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ServedPLMNs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ServedPLMNs(tvb, offset, &asn1_ctx, tree, hf_s1ap_ServedPLMNs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SubscriberProfileIDforRFP_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SubscriberProfileIDforRFP(tvb, offset, &asn1_ctx, tree, hf_s1ap_SubscriberProfileIDforRFP_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Subscription_Based_UE_DifferentiationInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Subscription_Based_UE_DifferentiationInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_Subscription_Based_UE_DifferentiationInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SupportedTAs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SupportedTAs(tvb, offset, &asn1_ctx, tree, hf_s1ap_SupportedTAs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TimeSynchronisationInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TimeSynchronisationInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_TimeSynchronisationInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_S_TMSI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_S_TMSI(tvb, offset, &asn1_ctx, tree, hf_s1ap_S_TMSI_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TAI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TAI(tvb, offset, &asn1_ctx, tree, hf_s1ap_TAI_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TargetID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TargetID(tvb, offset, &asn1_ctx, tree, hf_s1ap_TargetID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Global_RAN_NODE_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Global_RAN_NODE_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_Global_RAN_NODE_ID_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Target_ToSource_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Target_ToSource_TransparentContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_Target_ToSource_TransparentContainer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TimeToWait_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TimeToWait(tvb, offset, &asn1_ctx, tree, hf_s1ap_TimeToWait_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Time_UE_StayedInCell_EnhancedGranularity_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Time_UE_StayedInCell_EnhancedGranularity(tvb, offset, &asn1_ctx, tree, hf_s1ap_Time_UE_StayedInCell_EnhancedGranularity_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TimeSinceSecondaryNodeRelease_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TimeSinceSecondaryNodeRelease(tvb, offset, &asn1_ctx, tree, hf_s1ap_TimeSinceSecondaryNodeRelease_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TransportInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TransportInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_TransportInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TransportLayerAddress_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TransportLayerAddress(tvb, offset, &asn1_ctx, tree, hf_s1ap_TransportLayerAddress_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TraceActivation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TraceActivation(tvb, offset, &asn1_ctx, tree, hf_s1ap_TraceActivation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_UTRAN_Trace_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_UTRAN_Trace_ID(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_UTRAN_Trace_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TrafficLoadReductionIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TrafficLoadReductionIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_TrafficLoadReductionIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TunnelInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TunnelInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_TunnelInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TAIListForRestart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TAIListForRestart(tvb, offset, &asn1_ctx, tree, hf_s1ap_TAIListForRestart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEAggregateMaximumBitrate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEAggregateMaximumBitrate(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEAggregateMaximumBitrate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEAppLayerMeasConfig_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEAppLayerMeasConfig(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEAppLayerMeasConfig_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UECapabilityInfoRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UECapabilityInfoRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UECapabilityInfoRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_RetentionInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_RetentionInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_RetentionInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_S1AP_IDs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_S1AP_IDs(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_S1AP_IDs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_associatedLogicalS1_ConnectionItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_associatedLogicalS1_ConnectionItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_associatedLogicalS1_ConnectionItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEIdentityIndexValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEIdentityIndexValue(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEIdentityIndexValue_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_UE_HistoryInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_HistoryInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_UE_HistoryInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_HistoryInformationFromTheUE_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_HistoryInformationFromTheUE(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_HistoryInformationFromTheUE_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEPagingID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEPagingID(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEPagingID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapability_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapability(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapability_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapabilityForPaging_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapabilityForPaging(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapabilityForPaging_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapabilityID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapabilityID(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapabilityID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UESecurityCapabilities_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UESecurityCapabilities(tvb, offset, &asn1_ctx, tree, hf_s1ap_UESecurityCapabilities_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UESidelinkAggregateMaximumBitrate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UESidelinkAggregateMaximumBitrate(tvb, offset, &asn1_ctx, tree, hf_s1ap_UESidelinkAggregateMaximumBitrate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_Usage_Type_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_Usage_Type(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_Usage_Type_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UL_CP_SecurityInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UL_CP_SecurityInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_UL_CP_SecurityInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UnlicensedSpectrumRestriction_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UnlicensedSpectrumRestriction(tvb, offset, &asn1_ctx, tree, hf_s1ap_UnlicensedSpectrumRestriction_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_URI_Address_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_URI_Address(tvb, offset, &asn1_ctx, tree, hf_s1ap_URI_Address_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UserLocationInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UserLocationInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_UserLocationInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEUserPlaneCIoTSupportIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEUserPlaneCIoTSupportIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEUserPlaneCIoTSupportIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_Application_Layer_Measurement_Capability_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_Application_Layer_Measurement_Capability(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_Application_Layer_Measurement_Capability_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_VoiceSupportMatchIndicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_VoiceSupportMatchIndicator(tvb, offset, &asn1_ctx, tree, hf_s1ap_VoiceSupportMatchIndicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_V2XServicesAuthorized_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_V2XServicesAuthorized(tvb, offset, &asn1_ctx, tree, hf_s1ap_V2XServicesAuthorized_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WarningAreaCoordinates_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WarningAreaCoordinates(tvb, offset, &asn1_ctx, tree, hf_s1ap_WarningAreaCoordinates_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WarningAreaList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WarningAreaList(tvb, offset, &asn1_ctx, tree, hf_s1ap_WarningAreaList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WarningType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WarningType(tvb, offset, &asn1_ctx, tree, hf_s1ap_WarningType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WarningSecurityInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WarningSecurityInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_WarningSecurityInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WarningMessageContents_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WarningMessageContents(tvb, offset, &asn1_ctx, tree, hf_s1ap_WarningMessageContents_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WLANMeasurementConfiguration_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WLANMeasurementConfiguration(tvb, offset, &asn1_ctx, tree, hf_s1ap_WLANMeasurementConfiguration_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WUS_Assistance_Information_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WUS_Assistance_Information(tvb, offset, &asn1_ctx, tree, hf_s1ap_WUS_Assistance_Information_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_X2TNLConfigurationInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_X2TNLConfigurationInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_X2TNLConfigurationInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBX2ExtTLAs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBX2ExtTLAs(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBX2ExtTLAs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBIndirectX2TransportLayerAddresses_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBIndirectX2TransportLayerAddresses(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBIndirectX2TransportLayerAddresses_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverRequired_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverRequired(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverRequired_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverCommand_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverCommand(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverCommand_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSubjecttoDataForwardingList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSubjecttoDataForwardingList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSubjecttoDataForwardingList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABDataForwardingItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABDataForwardingItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABDataForwardingItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverPreparationFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverPreparationFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverPreparationFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSetupListHOReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSetupListHOReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSetupListHOReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSetupItemHOReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSetupItemHOReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSetupItemHOReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverRequestAcknowledge_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverRequestAcknowledge(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverRequestAcknowledge_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABAdmittedList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABAdmittedList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABAdmittedList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABAdmittedItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABAdmittedItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABAdmittedItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABFailedtoSetupListHOReqAck_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABFailedtoSetupListHOReqAck(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABFailedtoSetupListHOReqAck_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABFailedToSetupItemHOReqAck_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABFailedToSetupItemHOReqAck(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABFailedToSetupItemHOReqAck_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverNotify_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverNotify(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverNotify_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PathSwitchRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PathSwitchRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_PathSwitchRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSwitchedDLList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSwitchedDLList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSwitchedDLList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSwitchedDLItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSwitchedDLItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSwitchedDLItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PathSwitchRequestAcknowledge_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PathSwitchRequestAcknowledge(tvb, offset, &asn1_ctx, tree, hf_s1ap_PathSwitchRequestAcknowledge_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSwitchedULList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSwitchedULList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSwitchedULList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSwitchedULItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSwitchedULItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSwitchedULItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeUpdatedList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeUpdatedList(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeUpdatedList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeUpdatedItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeUpdatedItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeUpdatedItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PathSwitchRequestFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PathSwitchRequestFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_PathSwitchRequestFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverCancel_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverCancel(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverCancel_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverCancelAcknowledge_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverCancelAcknowledge(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverCancelAcknowledge_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_HandoverSuccess_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_HandoverSuccess(tvb, offset, &asn1_ctx, tree, hf_s1ap_HandoverSuccess_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBEarlyStatusTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBEarlyStatusTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBEarlyStatusTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEEarlyStatusTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEEarlyStatusTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEEarlyStatusTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSetupRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSetupRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSetupRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSetupListBearerSUReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSetupListBearerSUReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSetupListBearerSUReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSetupItemBearerSUReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSetupItemBearerSUReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSetupItemBearerSUReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSetupResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSetupResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSetupResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSetupListBearerSURes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSetupListBearerSURes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSetupListBearerSURes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSetupItemBearerSURes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSetupItemBearerSURes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSetupItemBearerSURes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModifyRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModifyRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModifyRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeModifiedListBearerModReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeModifiedListBearerModReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeModifiedListBearerModReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeModifiedItemBearerModReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeModifiedItemBearerModReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeModifiedItemBearerModReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModifyResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModifyResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModifyResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModifyListBearerModRes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModifyListBearerModRes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModifyListBearerModRes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModifyItemBearerModRes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModifyItemBearerModRes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModifyItemBearerModRes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABReleaseCommand_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABReleaseCommand(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABReleaseCommand_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABReleaseResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABReleaseResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABReleaseResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABReleaseListBearerRelComp_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABReleaseListBearerRelComp(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABReleaseListBearerRelComp_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABReleaseItemBearerRelComp_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABReleaseItemBearerRelComp(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABReleaseItemBearerRelComp_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABReleaseIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABReleaseIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABReleaseIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_InitialContextSetupRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_InitialContextSetupRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_InitialContextSetupRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSetupListCtxtSUReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSetupListCtxtSUReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSetupListCtxtSUReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeSetupItemCtxtSUReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeSetupItemCtxtSUReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeSetupItemCtxtSUReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_InitialContextSetupResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_InitialContextSetupResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_InitialContextSetupResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSetupListCtxtSURes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSetupListCtxtSURes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSetupListCtxtSURes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABSetupItemCtxtSURes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABSetupItemCtxtSURes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABSetupItemCtxtSURes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_InitialContextSetupFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_InitialContextSetupFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_InitialContextSetupFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Paging_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Paging(tvb, offset, &asn1_ctx, tree, hf_s1ap_Paging_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TAIList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TAIList(tvb, offset, &asn1_ctx, tree, hf_s1ap_TAIList_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TAIItem_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TAIItem(tvb, offset, &asn1_ctx, tree, hf_s1ap_TAIItem_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextReleaseRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextReleaseRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextReleaseRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextReleaseCommand_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextReleaseCommand(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextReleaseCommand_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextReleaseComplete_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextReleaseComplete(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextReleaseComplete_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextModificationRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextModificationRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextModificationRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextModificationResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextModificationResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextModificationResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextModificationFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextModificationFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextModificationFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapabilityMatchRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapabilityMatchRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapabilityMatchRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapabilityMatchResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapabilityMatchResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapabilityMatchResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DownlinkNASTransport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DownlinkNASTransport(tvb, offset, &asn1_ctx, tree, hf_s1ap_DownlinkNASTransport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_InitialUEMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_InitialUEMessage(tvb, offset, &asn1_ctx, tree, hf_s1ap_InitialUEMessage_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UplinkNASTransport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UplinkNASTransport(tvb, offset, &asn1_ctx, tree, hf_s1ap_UplinkNASTransport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NASNonDeliveryIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NASNonDeliveryIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_NASNonDeliveryIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RerouteNASRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RerouteNASRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_RerouteNASRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_S1_Message_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_S1_Message(tvb, offset, &asn1_ctx, tree, hf_s1ap_S1_Message_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_NASDeliveryIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_NASDeliveryIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_NASDeliveryIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Reset_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Reset(tvb, offset, &asn1_ctx, tree, hf_s1ap_Reset_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ResetType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ResetType(tvb, offset, &asn1_ctx, tree, hf_s1ap_ResetType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ResetAcknowledge_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ResetAcknowledge(tvb, offset, &asn1_ctx, tree, hf_s1ap_ResetAcknowledge_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UE_associatedLogicalS1_ConnectionListResAck_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UE_associatedLogicalS1_ConnectionListResAck(tvb, offset, &asn1_ctx, tree, hf_s1ap_UE_associatedLogicalS1_ConnectionListResAck_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ErrorIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ErrorIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_ErrorIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_S1SetupRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_S1SetupRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_S1SetupRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_S1SetupResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_S1SetupResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_S1SetupResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_S1SetupFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_S1SetupFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_S1SetupFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBConfigurationUpdate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBConfigurationUpdate(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBConfigurationUpdate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBConfigurationUpdateAcknowledge_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBConfigurationUpdateAcknowledge(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBConfigurationUpdateAcknowledge_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBConfigurationUpdateFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBConfigurationUpdateFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBConfigurationUpdateFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEConfigurationUpdate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEConfigurationUpdate(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEConfigurationUpdate_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEConfigurationUpdateAcknowledge_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEConfigurationUpdateAcknowledge(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEConfigurationUpdateAcknowledge_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEConfigurationUpdateFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEConfigurationUpdateFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEConfigurationUpdateFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DownlinkS1cdma2000tunnelling_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DownlinkS1cdma2000tunnelling(tvb, offset, &asn1_ctx, tree, hf_s1ap_DownlinkS1cdma2000tunnelling_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UplinkS1cdma2000tunnelling_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UplinkS1cdma2000tunnelling(tvb, offset, &asn1_ctx, tree, hf_s1ap_UplinkS1cdma2000tunnelling_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UECapabilityInfoIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UECapabilityInfoIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_UECapabilityInfoIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBStatusTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBStatusTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBStatusTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEStatusTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEStatusTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEStatusTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TraceStart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TraceStart(tvb, offset, &asn1_ctx, tree, hf_s1ap_TraceStart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TraceFailureIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_TraceFailureIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_TraceFailureIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DeactivateTrace_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DeactivateTrace(tvb, offset, &asn1_ctx, tree, hf_s1ap_DeactivateTrace_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CellTrafficTrace_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CellTrafficTrace(tvb, offset, &asn1_ctx, tree, hf_s1ap_CellTrafficTrace_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LocationReportingControl_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LocationReportingControl(tvb, offset, &asn1_ctx, tree, hf_s1ap_LocationReportingControl_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LocationReportingFailureIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LocationReportingFailureIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_LocationReportingFailureIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_LocationReport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_LocationReport(tvb, offset, &asn1_ctx, tree, hf_s1ap_LocationReport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_OverloadStart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_OverloadStart(tvb, offset, &asn1_ctx, tree, hf_s1ap_OverloadStart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_OverloadStop_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_OverloadStop(tvb, offset, &asn1_ctx, tree, hf_s1ap_OverloadStop_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WriteReplaceWarningRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WriteReplaceWarningRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_WriteReplaceWarningRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WriteReplaceWarningResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_WriteReplaceWarningResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_WriteReplaceWarningResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBDirectInformationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBDirectInformationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBDirectInformationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Inter_SystemInformationTransferType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_Inter_SystemInformationTransferType(tvb, offset, &asn1_ctx, tree, hf_s1ap_Inter_SystemInformationTransferType_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEDirectInformationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEDirectInformationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEDirectInformationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBConfigurationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBConfigurationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMEConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMEConfigurationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMEConfigurationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PrivateMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PrivateMessage(tvb, offset, &asn1_ctx, tree, hf_s1ap_PrivateMessage_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_KillRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_KillRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_KillRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_KillResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_KillResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_KillResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PWSRestartIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PWSRestartIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_PWSRestartIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PWSFailureIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_PWSFailureIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_PWSFailureIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DownlinkUEAssociatedLPPaTransport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DownlinkUEAssociatedLPPaTransport(tvb, offset, &asn1_ctx, tree, hf_s1ap_DownlinkUEAssociatedLPPaTransport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UplinkUEAssociatedLPPaTransport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UplinkUEAssociatedLPPaTransport(tvb, offset, &asn1_ctx, tree, hf_s1ap_UplinkUEAssociatedLPPaTransport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_DownlinkNonUEAssociatedLPPaTransport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_DownlinkNonUEAssociatedLPPaTransport(tvb, offset, &asn1_ctx, tree, hf_s1ap_DownlinkNonUEAssociatedLPPaTransport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UplinkNonUEAssociatedLPPaTransport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UplinkNonUEAssociatedLPPaTransport(tvb, offset, &asn1_ctx, tree, hf_s1ap_UplinkNonUEAssociatedLPPaTransport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModificationIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModificationIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModificationIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeModifiedListBearerModInd_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeModifiedListBearerModInd(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeModifiedListBearerModInd_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABToBeModifiedItemBearerModInd_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABToBeModifiedItemBearerModInd(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABToBeModifiedItemBearerModInd_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABNotToBeModifiedListBearerModInd_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABNotToBeModifiedListBearerModInd(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABNotToBeModifiedListBearerModInd_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABNotToBeModifiedItemBearerModInd_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABNotToBeModifiedItemBearerModInd(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABNotToBeModifiedItemBearerModInd_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_CSGMembershipInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_CSGMembershipInfo(tvb, offset, &asn1_ctx, tree, hf_s1ap_CSGMembershipInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModificationConfirm_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModificationConfirm(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModificationConfirm_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModifyListBearerModConf_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModifyListBearerModConf(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModifyListBearerModConf_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABModifyItemBearerModConf_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABModifyItemBearerModConf(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABModifyItemBearerModConf_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextModificationIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextModificationIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextModificationIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextModificationConfirm_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextModificationConfirm(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextModificationConfirm_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextSuspendRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextSuspendRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextSuspendRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextSuspendResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextSuspendResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextSuspendResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextResumeRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextResumeRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextResumeRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABFailedToResumeListResumeReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABFailedToResumeListResumeReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABFailedToResumeListResumeReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABFailedToResumeItemResumeReq_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABFailedToResumeItemResumeReq(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABFailedToResumeItemResumeReq_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextResumeResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextResumeResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextResumeResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABFailedToResumeListResumeRes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABFailedToResumeListResumeRes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABFailedToResumeListResumeRes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_E_RABFailedToResumeItemResumeRes_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_E_RABFailedToResumeItemResumeRes(tvb, offset, &asn1_ctx, tree, hf_s1ap_E_RABFailedToResumeItemResumeRes_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEContextResumeFailure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEContextResumeFailure(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEContextResumeFailure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ConnectionEstablishmentIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ConnectionEstablishmentIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_ConnectionEstablishmentIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RetrieveUEInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_RetrieveUEInformation(tvb, offset, &asn1_ctx, tree, hf_s1ap_RetrieveUEInformation_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UEInformationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UEInformationTransfer(tvb, offset, &asn1_ctx, tree, hf_s1ap_UEInformationTransfer_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ENBCPRelocationIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_ENBCPRelocationIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_ENBCPRelocationIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MMECPRelocationIndication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_MMECPRelocationIndication(tvb, offset, &asn1_ctx, tree, hf_s1ap_MMECPRelocationIndication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SecondaryRATDataUsageReport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SecondaryRATDataUsageReport(tvb, offset, &asn1_ctx, tree, hf_s1ap_SecondaryRATDataUsageReport_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapabilityIDMappingRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapabilityIDMappingRequest(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapabilityIDMappingRequest_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_UERadioCapabilityIDMappingResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_UERadioCapabilityIDMappingResponse(tvb, offset, &asn1_ctx, tree, hf_s1ap_UERadioCapabilityIDMappingResponse_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_S1AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_S1AP_PDU(tvb, offset, &asn1_ctx, tree, hf_s1ap_S1AP_PDU_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_SONtransferApplicationIdentity_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SONtransferApplicationIdentity(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_SONtransferApplicationIdentity_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_SONtransferRequestContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SONtransferRequestContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_SONtransferRequestContainer_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_SONtransferResponseContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SONtransferResponseContainer(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_SONtransferResponseContainer_PDU); offset += 7; offset >>= 3; return offset; } int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_s1ap_SONtransferCause(tvb, offset, &asn1_ctx, tree, hf_s1ap_s1ap_SONtransferCause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { s1ap_ctx_t s1ap_ctx; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); s1ap_ctx.message_type = s1ap_data->message_type; s1ap_ctx.ProcedureCode = s1ap_data->procedure_code; s1ap_ctx.ProtocolIE_ID = s1ap_data->protocol_ie_id; s1ap_ctx.ProtocolExtensionID = s1ap_data->protocol_extension_id; return (dissector_try_uint_new(s1ap_ies_dissector_table, s1ap_data->protocol_ie_id, tvb, pinfo, tree, FALSE, &s1ap_ctx)) ? tvb_captured_length(tvb) : 0; } /* Currently not used static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); return (dissector_try_uint(s1ap_ies_p1_dissector_table, s1ap_data->protocol_ie_id, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); return (dissector_try_uint(s1ap_ies_p2_dissector_table, s1ap_data->protocol_ie_id, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } */ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { s1ap_ctx_t s1ap_ctx; struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); s1ap_ctx.message_type = s1ap_data->message_type; s1ap_ctx.ProcedureCode = s1ap_data->procedure_code; s1ap_ctx.ProtocolIE_ID = s1ap_data->protocol_ie_id; s1ap_ctx.ProtocolExtensionID = s1ap_data->protocol_extension_id; return (dissector_try_uint_new(s1ap_extension_dissector_table, s1ap_data->protocol_extension_id, tvb, pinfo, tree, FALSE, &s1ap_ctx)) ? tvb_captured_length(tvb) : 0; } static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); return (dissector_try_uint_new(s1ap_proc_imsg_dissector_table, s1ap_data->procedure_code, tvb, pinfo, tree, FALSE, data)) ? tvb_captured_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); return (dissector_try_uint_new(s1ap_proc_sout_dissector_table, s1ap_data->procedure_code, tvb, pinfo, tree, FALSE, data)) ? tvb_captured_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { struct s1ap_private_data *s1ap_data = s1ap_get_private_data(pinfo); return (dissector_try_uint_new(s1ap_proc_uout_dissector_table, s1ap_data->procedure_code, tvb, pinfo, tree, FALSE, data)) ? tvb_captured_length(tvb) : 0; } static int dissect_s1ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *s1ap_item = NULL; proto_tree *s1ap_tree = NULL; conversation_t *conversation; struct s1ap_private_data* s1ap_data; /* make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "S1AP"); col_clear(pinfo->cinfo, COL_INFO); /* create the s1ap protocol tree */ s1ap_item = proto_tree_add_item(tree, proto_s1ap, tvb, 0, -1, ENC_NA); s1ap_tree = proto_item_add_subtree(s1ap_item, ett_s1ap); s1ap_data = s1ap_get_private_data(pinfo); conversation = find_or_create_conversation(pinfo); s1ap_data->s1ap_conv = (struct s1ap_conv_info *)conversation_get_proto_data(conversation, proto_s1ap); if (!s1ap_data->s1ap_conv) { s1ap_data->s1ap_conv = wmem_new(wmem_file_scope(), struct s1ap_conv_info); s1ap_data->s1ap_conv->nbiot_ta = wmem_map_new(wmem_file_scope(), wmem_int64_hash, g_int64_equal); s1ap_data->s1ap_conv->nbiot_enb_ue_s1ap_id = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(conversation, proto_s1ap, s1ap_data->s1ap_conv); } dissect_S1AP_PDU_PDU(tvb, pinfo, s1ap_tree, NULL); return tvb_captured_length(tvb); } /*--- proto_reg_handoff_s1ap ---------------------------------------*/ void proto_reg_handoff_s1ap(void) { gcsna_handle = find_dissector_add_dependency("gcsna", proto_s1ap); nas_eps_handle = find_dissector_add_dependency("nas-eps", proto_s1ap); lppa_handle = find_dissector_add_dependency("lppa", proto_s1ap); bssgp_handle = find_dissector_add_dependency("bssgp", proto_s1ap); lte_rrc_ue_radio_access_cap_info_handle = find_dissector_add_dependency("lte-rrc.ue_radio_access_cap_info", proto_s1ap); lte_rrc_ue_radio_access_cap_info_nb_handle = find_dissector_add_dependency("lte-rrc.ue_radio_access_cap_info.nb", proto_s1ap); nr_rrc_ue_radio_access_cap_info_handle = find_dissector_add_dependency("nr-rrc.ue_radio_access_cap_info", proto_s1ap); lte_rrc_ue_radio_paging_info_handle = find_dissector_add_dependency("lte-rrc.ue_radio_paging_info", proto_s1ap); lte_rrc_ue_radio_paging_info_nb_handle = find_dissector_add_dependency("lte-rrc.ue_radio_paging_info.nb", proto_s1ap); nr_rrc_ue_radio_paging_info_handle = find_dissector_add_dependency("nr-rrc.ue_radio_paging_info", proto_s1ap); dissector_add_uint("sctp.ppi", S1AP_PAYLOAD_PROTOCOL_ID, s1ap_handle); dissector_add_uint_with_preference("sctp.port", SCTP_PORT_S1AP, s1ap_handle); dissector_add_uint("s1ap.ies", id_MME_UE_S1AP_ID, create_dissector_handle(dissect_MME_UE_S1AP_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_HandoverType, create_dissector_handle(dissect_HandoverType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Cause, create_dissector_handle(dissect_Cause_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TargetID, create_dissector_handle(dissect_TargetID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_eNB_UE_S1AP_ID, create_dissector_handle(dissect_ENB_UE_S1AP_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABSubjecttoDataForwardingList, create_dissector_handle(dissect_E_RABSubjecttoDataForwardingList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABtoReleaseListHOCmd, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABDataForwardingItem, create_dissector_handle(dissect_E_RABDataForwardingItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABReleaseItemBearerRelComp, create_dissector_handle(dissect_E_RABReleaseItemBearerRelComp_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSetupListBearerSUReq, create_dissector_handle(dissect_E_RABToBeSetupListBearerSUReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSetupItemBearerSUReq, create_dissector_handle(dissect_E_RABToBeSetupItemBearerSUReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABAdmittedList, create_dissector_handle(dissect_E_RABAdmittedList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToSetupListHOReqAck, create_dissector_handle(dissect_E_RABFailedtoSetupListHOReqAck_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABAdmittedItem, create_dissector_handle(dissect_E_RABAdmittedItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedtoSetupItemHOReqAck, create_dissector_handle(dissect_E_RABFailedToSetupItemHOReqAck_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSwitchedDLList, create_dissector_handle(dissect_E_RABToBeSwitchedDLList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSwitchedDLItem, create_dissector_handle(dissect_E_RABToBeSwitchedDLItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSetupListCtxtSUReq, create_dissector_handle(dissect_E_RABToBeSetupListCtxtSUReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TraceActivation, create_dissector_handle(dissect_TraceActivation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_UTRAN_Trace_ID, create_dissector_handle(dissect_E_UTRAN_Trace_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NAS_PDU, create_dissector_handle(dissect_NAS_PDU_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSetupItemHOReq, create_dissector_handle(dissect_E_RABToBeSetupItemHOReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABSetupListBearerSURes, create_dissector_handle(dissect_E_RABSetupListBearerSURes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToSetupListBearerSURes, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeModifiedListBearerModReq, create_dissector_handle(dissect_E_RABToBeModifiedListBearerModReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABModifyListBearerModRes, create_dissector_handle(dissect_E_RABModifyListBearerModRes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToModifyList, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeReleasedList, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToReleaseList, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABItem, create_dissector_handle(dissect_E_RABItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeModifiedItemBearerModReq, create_dissector_handle(dissect_E_RABToBeModifiedItemBearerModReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABModifyItemBearerModRes, create_dissector_handle(dissect_E_RABModifyItemBearerModRes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABSetupItemBearerSURes, create_dissector_handle(dissect_E_RABSetupItemBearerSURes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SecurityContext, create_dissector_handle(dissect_SecurityContext_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_HandoverRestrictionList, create_dissector_handle(dissect_s1ap_HandoverRestrictionList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UEPagingID, create_dissector_handle(dissect_UEPagingID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_pagingDRX, create_dissector_handle(dissect_PagingDRX_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TAIList, create_dissector_handle(dissect_TAIList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TAIItem, create_dissector_handle(dissect_TAIItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToSetupListCtxtSURes, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABSetupItemCtxtSURes, create_dissector_handle(dissect_E_RABSetupItemCtxtSURes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABSetupListCtxtSURes, create_dissector_handle(dissect_E_RABSetupListCtxtSURes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSetupItemCtxtSUReq, create_dissector_handle(dissect_E_RABToBeSetupItemCtxtSUReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSetupListHOReq, create_dissector_handle(dissect_E_RABToBeSetupListHOReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CriticalityDiagnostics, create_dissector_handle(dissect_CriticalityDiagnostics_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Global_ENB_ID, create_dissector_handle(dissect_s1ap_Global_ENB_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_eNBname, create_dissector_handle(dissect_ENBname_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MMEname, create_dissector_handle(dissect_MMEname_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ServedPLMNs, create_dissector_handle(dissect_ServedPLMNs_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SupportedTAs, create_dissector_handle(dissect_SupportedTAs_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TimeToWait, create_dissector_handle(dissect_TimeToWait_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_uEaggregateMaximumBitrate, create_dissector_handle(dissect_UEAggregateMaximumBitrate_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TAI, create_dissector_handle(dissect_TAI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABReleaseListBearerRelComp, create_dissector_handle(dissect_E_RABReleaseListBearerRelComp_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000PDU, create_dissector_handle(dissect_Cdma2000PDU_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000RATType, create_dissector_handle(dissect_Cdma2000RATType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000SectorID, create_dissector_handle(dissect_Cdma2000SectorID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SecurityKey, create_dissector_handle(dissect_SecurityKey_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UERadioCapability, create_dissector_handle(dissect_UERadioCapability_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_GUMMEI_ID, create_dissector_handle(dissect_GUMMEI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABInformationListItem, create_dissector_handle(dissect_E_RABInformationListItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Direct_Forwarding_Path_Availability, create_dissector_handle(dissect_Direct_Forwarding_Path_Availability_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UEIdentityIndexValue, create_dissector_handle(dissect_UEIdentityIndexValue_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000HOStatus, create_dissector_handle(dissect_Cdma2000HOStatus_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000HORequiredIndication, create_dissector_handle(dissect_Cdma2000HORequiredIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RelativeMMECapacity, create_dissector_handle(dissect_RelativeMMECapacity_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SourceMME_UE_S1AP_ID, create_dissector_handle(dissect_MME_UE_S1AP_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Bearers_SubjectToStatusTransfer_Item, create_dissector_handle(dissect_Bearers_SubjectToStatusTransfer_Item_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_eNB_StatusTransfer_TransparentContainer, create_dissector_handle(dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_associatedLogicalS1_ConnectionItem, create_dissector_handle(dissect_UE_associatedLogicalS1_ConnectionItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ResetType, create_dissector_handle(dissect_ResetType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_associatedLogicalS1_ConnectionListResAck, create_dissector_handle(dissect_UE_associatedLogicalS1_ConnectionListResAck_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSwitchedULItem, create_dissector_handle(dissect_E_RABToBeSwitchedULItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeSwitchedULList, create_dissector_handle(dissect_E_RABToBeSwitchedULList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_S_TMSI, create_dissector_handle(dissect_S_TMSI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000OneXRAND, create_dissector_handle(dissect_Cdma2000OneXRAND_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RequestType, create_dissector_handle(dissect_RequestType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_S1AP_IDs, create_dissector_handle(dissect_UE_S1AP_IDs_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EUTRAN_CGI, create_dissector_handle(dissect_s1ap_EUTRAN_CGI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_OverloadResponse, create_dissector_handle(dissect_OverloadResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_cdma2000OneXSRVCCInfo, create_dissector_handle(dissect_Cdma2000OneXSRVCCInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Source_ToTarget_TransparentContainer, create_dissector_handle(dissect_Source_ToTarget_TransparentContainer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ServedGUMMEIs, create_dissector_handle(dissect_ServedGUMMEIs_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SubscriberProfileIDforRFP, create_dissector_handle(dissect_SubscriberProfileIDforRFP_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UESecurityCapabilities, create_dissector_handle(dissect_UESecurityCapabilities_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CSFallbackIndicator, create_dissector_handle(dissect_CSFallbackIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CNDomain, create_dissector_handle(dissect_CNDomain_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABReleasedList, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MessageIdentifier, create_dissector_handle(dissect_MessageIdentifier_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SerialNumber, create_dissector_handle(dissect_SerialNumber_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_WarningAreaList, create_dissector_handle(dissect_WarningAreaList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RepetitionPeriod, create_dissector_handle(dissect_RepetitionPeriod_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NumberofBroadcastRequest, create_dissector_handle(dissect_NumberofBroadcastRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_WarningType, create_dissector_handle(dissect_WarningType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_WarningSecurityInfo, create_dissector_handle(dissect_WarningSecurityInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DataCodingScheme, create_dissector_handle(dissect_DataCodingScheme_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_WarningMessageContents, create_dissector_handle(dissect_WarningMessageContents_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_BroadcastCompletedAreaList, create_dissector_handle(dissect_BroadcastCompletedAreaList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Inter_SystemInformationTransferTypeEDT, create_dissector_handle(dissect_Inter_SystemInformationTransferType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Inter_SystemInformationTransferTypeMDT, create_dissector_handle(dissect_Inter_SystemInformationTransferType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Target_ToSource_TransparentContainer, create_dissector_handle(dissect_Target_ToSource_TransparentContainer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SRVCCOperationPossible, create_dissector_handle(dissect_SRVCCOperationPossible_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SRVCCHOIndication, create_dissector_handle(dissect_SRVCCHOIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CSG_Id, create_dissector_handle(dissect_CSG_Id_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CSG_IdList, create_dissector_handle(dissect_CSG_IdList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SONConfigurationTransferECT, create_dissector_handle(dissect_s1ap_SONConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SONConfigurationTransferMCT, create_dissector_handle(dissect_s1ap_SONConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TraceCollectionEntityIPAddress, create_dissector_handle(dissect_TransportLayerAddress_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MSClassmark2, create_dissector_handle(dissect_MSClassmark2_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MSClassmark3, create_dissector_handle(dissect_MSClassmark3_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RRC_Establishment_Cause, create_dissector_handle(dissect_RRC_Establishment_Cause_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NASSecurityParametersfromE_UTRAN, create_dissector_handle(dissect_NASSecurityParametersfromE_UTRAN_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NASSecurityParameterstoE_UTRAN, create_dissector_handle(dissect_NASSecurityParameterstoE_UTRAN_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DefaultPagingDRX, create_dissector_handle(dissect_PagingDRX_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Source_ToTarget_TransparentContainer_Secondary, create_dissector_handle(dissect_Source_ToTarget_TransparentContainer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Target_ToSource_TransparentContainer_Secondary, create_dissector_handle(dissect_Target_ToSource_TransparentContainer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EUTRANRoundTripDelayEstimationInfo, create_dissector_handle(dissect_EUTRANRoundTripDelayEstimationInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_BroadcastCancelledAreaList, create_dissector_handle(dissect_BroadcastCancelledAreaList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ConcurrentWarningMessageIndicator, create_dissector_handle(dissect_ConcurrentWarningMessageIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ExtendedRepetitionPeriod, create_dissector_handle(dissect_ExtendedRepetitionPeriod_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CellAccessMode, create_dissector_handle(dissect_CellAccessMode_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CSGMembershipStatus, create_dissector_handle(dissect_CSGMembershipStatus_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_LPPa_PDU, create_dissector_handle(dissect_LPPa_PDU_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Routing_ID, create_dissector_handle(dissect_Routing_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PS_ServiceNotAvailable, create_dissector_handle(dissect_PS_ServiceNotAvailable_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PagingPriority, create_dissector_handle(dissect_PagingPriority_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_GUMMEIList, create_dissector_handle(dissect_GUMMEIList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_GW_TransportLayerAddress, create_dissector_handle(dissect_TransportLayerAddress_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SourceMME_GUMMEI, create_dissector_handle(dissect_GUMMEI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MME_UE_S1AP_ID_2, create_dissector_handle(dissect_MME_UE_S1AP_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RegisteredLAI, create_dissector_handle(dissect_LAI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RelayNode_Indicator, create_dissector_handle(dissect_RelayNode_Indicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TrafficLoadReductionIndication, create_dissector_handle(dissect_TrafficLoadReductionIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MMERelaySupportIndicator, create_dissector_handle(dissect_MMERelaySupportIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_GWContextReleaseIndication, create_dissector_handle(dissect_GWContextReleaseIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ManagementBasedMDTAllowed, create_dissector_handle(dissect_ManagementBasedMDTAllowed_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PrivacyIndicator, create_dissector_handle(dissect_PrivacyIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_VoiceSupportMatchIndicator, create_dissector_handle(dissect_VoiceSupportMatchIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_GUMMEIType, create_dissector_handle(dissect_GUMMEIType_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Tunnel_Information_for_BBF, create_dissector_handle(dissect_TunnelInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ManagementBasedMDTPLMNList, create_dissector_handle(dissect_MDTPLMNList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ECGIListForRestart, create_dissector_handle(dissect_ECGIListForRestart_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SIPTO_L_GW_TransportLayerAddress, create_dissector_handle(dissect_TransportLayerAddress_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_LHN_ID, create_dissector_handle(dissect_LHN_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_AdditionalCSFallbackIndicator, create_dissector_handle(dissect_AdditionalCSFallbackIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TAIListForRestart, create_dissector_handle(dissect_TAIListForRestart_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UserLocationInformation, create_dissector_handle(dissect_UserLocationInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_KillAllWarningMessages, create_dissector_handle(dissect_KillAllWarningMessages_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Masked_IMEISV, create_dissector_handle(dissect_Masked_IMEISV_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ProSeAuthorized, create_dissector_handle(dissect_ProSeAuthorized_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ExpectedUEBehaviour, create_dissector_handle(dissect_ExpectedUEBehaviour_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UERadioCapabilityForPaging, create_dissector_handle(dissect_UERadioCapabilityForPaging_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeModifiedListBearerModInd, create_dissector_handle(dissect_E_RABToBeModifiedListBearerModInd_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeModifiedItemBearerModInd, create_dissector_handle(dissect_E_RABToBeModifiedItemBearerModInd_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABNotToBeModifiedListBearerModInd, create_dissector_handle(dissect_E_RABNotToBeModifiedListBearerModInd_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABNotToBeModifiedItemBearerModInd, create_dissector_handle(dissect_E_RABNotToBeModifiedItemBearerModInd_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABModifyListBearerModConf, create_dissector_handle(dissect_E_RABModifyListBearerModConf_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABModifyItemBearerModConf, create_dissector_handle(dissect_E_RABModifyItemBearerModConf_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToModifyListBearerModConf, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SON_Information_Report, create_dissector_handle(dissect_SONInformationReport_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeReleasedListBearerModConf, create_dissector_handle(dissect_E_RABList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_AssistanceDataForPaging, create_dissector_handle(dissect_AssistanceDataForPaging_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CellIdentifierAndCELevelForCECapableUEs, create_dissector_handle(dissect_CellIdentifierAndCELevelForCECapableUEs_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_InformationOnRecommendedCellsAndENBsForPaging, create_dissector_handle(dissect_InformationOnRecommendedCellsAndENBsForPaging_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RecommendedCellItem, create_dissector_handle(dissect_RecommendedCellItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RecommendedENBItem, create_dissector_handle(dissect_RecommendedENBItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PWSfailedECGIList, create_dissector_handle(dissect_PWSfailedECGIList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_MME_Group_ID, create_dissector_handle(dissect_MME_Group_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Additional_GUTI, create_dissector_handle(dissect_Additional_GUTI_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_S1_Message, create_dissector_handle(dissect_S1_Message_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CSGMembershipInfo, create_dissector_handle(dissect_CSGMembershipInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Paging_eDRXInformation, create_dissector_handle(dissect_Paging_eDRXInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_RetentionInformation, create_dissector_handle(dissect_UE_RetentionInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_Usage_Type, create_dissector_handle(dissect_UE_Usage_Type_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_extended_UEIdentityIndexValue, create_dissector_handle(dissect_Extended_UEIdentityIndexValue_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NB_IoT_DefaultPagingDRX, create_dissector_handle(dissect_NB_IoT_DefaultPagingDRX_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToResumeListResumeReq, create_dissector_handle(dissect_E_RABFailedToResumeListResumeReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToResumeItemResumeReq, create_dissector_handle(dissect_E_RABFailedToResumeItemResumeReq_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToResumeListResumeRes, create_dissector_handle(dissect_E_RABFailedToResumeListResumeRes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABFailedToResumeItemResumeRes, create_dissector_handle(dissect_E_RABFailedToResumeItemResumeRes_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NB_IoT_Paging_eDRXInformation, create_dissector_handle(dissect_NB_IoT_Paging_eDRXInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UEUserPlaneCIoTSupportIndicator, create_dissector_handle(dissect_UEUserPlaneCIoTSupportIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CE_mode_B_SupportIndicator, create_dissector_handle(dissect_CE_mode_B_SupportIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SRVCCOperationNotPossible, create_dissector_handle(dissect_SRVCCOperationNotPossible_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NB_IoT_UEIdentityIndexValue, create_dissector_handle(dissect_NB_IoT_UEIdentityIndexValue_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_RRC_Resume_Cause, create_dissector_handle(dissect_RRC_Establishment_Cause_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_V2XServicesAuthorized, create_dissector_handle(dissect_V2XServicesAuthorized_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UESidelinkAggregateMaximumBitrate, create_dissector_handle(dissect_UESidelinkAggregateMaximumBitrate_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EnhancedCoverageRestricted, create_dissector_handle(dissect_EnhancedCoverageRestricted_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DLNASPDUDeliveryAckRequest, create_dissector_handle(dissect_DLNASPDUDeliveryAckRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DCN_ID, create_dissector_handle(dissect_DCN_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Coverage_Level, create_dissector_handle(dissect_Coverage_Level_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ServedDCNs, create_dissector_handle(dissect_ServedDCNs_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DL_CP_SecurityInformation, create_dissector_handle(dissect_DL_CP_SecurityInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_Level_QoS_Parameters, create_dissector_handle(dissect_E_RABLevelQoSParameters_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UL_CP_SecurityInformation, create_dissector_handle(dissect_UL_CP_SecurityInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABUsageReportItem, create_dissector_handle(dissect_E_RABUsageReportItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SecondaryRATDataUsageReportItem, create_dissector_handle(dissect_SecondaryRATDataUsageReportItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NRUESecurityCapabilities, create_dissector_handle(dissect_NRUESecurityCapabilities_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SecondaryRATDataUsageRequest, create_dissector_handle(dissect_SecondaryRATDataUsageRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_SecondaryRATDataUsageReportList, create_dissector_handle(dissect_SecondaryRATDataUsageReportList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UE_Application_Layer_Measurement_Capability, create_dissector_handle(dissect_UE_Application_Layer_Measurement_Capability_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_HandoverFlag, create_dissector_handle(dissect_HandoverFlag_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EmergencyAreaIDListForRestart, create_dissector_handle(dissect_EmergencyAreaIDListForRestart_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_CE_ModeBRestricted, create_dissector_handle(dissect_CE_ModeBRestricted_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_AerialUEsubscriptionInformation, create_dissector_handle(dissect_AerialUEsubscriptionInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UECapabilityInfoRequest, create_dissector_handle(dissect_UECapabilityInfoRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EndIndication, create_dissector_handle(dissect_EndIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EDT_Session, create_dissector_handle(dissect_EDT_Session_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_LTE_M_Indication, create_dissector_handle(dissect_LTE_M_Indication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Subscription_Based_UE_DifferentiationInfo, create_dissector_handle(dissect_Subscription_Based_UE_DifferentiationInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PendingDataIndication, create_dissector_handle(dissect_PendingDataIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_WarningAreaCoordinates, create_dissector_handle(dissect_WarningAreaCoordinates_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PSCellInformation, create_dissector_handle(dissect_s1ap_PSCellInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ConnectedengNBList, create_dissector_handle(dissect_ConnectedengNBList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ConnectedengNBToAddList, create_dissector_handle(dissect_ConnectedengNBList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_ConnectedengNBToRemoveList, create_dissector_handle(dissect_ConnectedengNBList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EN_DCSONConfigurationTransfer_ECT, create_dissector_handle(dissect_s1ap_EN_DCSONConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_EN_DCSONConfigurationTransfer_MCT, create_dissector_handle(dissect_s1ap_EN_DCSONConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_TimeSinceSecondaryNodeRelease, create_dissector_handle(dissect_TimeSinceSecondaryNodeRelease_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_AdditionalRRMPriorityIndex, create_dissector_handle(dissect_AdditionalRRMPriorityIndex_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_IAB_Authorized, create_dissector_handle(dissect_IAB_Authorized_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_IAB_Node_Indication, create_dissector_handle(dissect_IAB_Node_Indication_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_IAB_Supported, create_dissector_handle(dissect_IAB_Supported_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DataSize, create_dissector_handle(dissect_DataSize_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NRV2XServicesAuthorized, create_dissector_handle(dissect_NRV2XServicesAuthorized_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NRUESidelinkAggregateMaximumBitrate, create_dissector_handle(dissect_NRUESidelinkAggregateMaximumBitrate_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PC5QoSParameters, create_dissector_handle(dissect_PC5QoSParameters_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_IntersystemSONConfigurationTransferMCT, create_dissector_handle(dissect_s1ap_IntersystemSONConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_IntersystemSONConfigurationTransferECT, create_dissector_handle(dissect_s1ap_IntersystemSONConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UERadioCapabilityID, create_dissector_handle(dissect_UERadioCapabilityID_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UERadioCapability_NR_Format, create_dissector_handle(dissect_UERadioCapability_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_DAPSResponseInfoItem, create_dissector_handle(dissect_DAPSResponseInfoItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NotifySourceeNB, create_dissector_handle(dissect_NotifySourceeNB_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_eNB_EarlyStatusTransfer_TransparentContainer, create_dissector_handle(dissect_ENB_EarlyStatusTransfer_TransparentContainer_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_Bearers_SubjectToEarlyStatusTransfer_Item, create_dissector_handle(dissect_Bearers_SubjectToEarlyStatusTransfer_Item_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_WUS_Assistance_Information, create_dissector_handle(dissect_WUS_Assistance_Information_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_NB_IoT_PagingDRX, create_dissector_handle(dissect_NB_IoT_PagingDRX_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_UERadioCapabilityForPaging_NR_Format, create_dissector_handle(dissect_UERadioCapabilityForPaging_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_PagingCause, create_dissector_handle(dissect_PagingCause_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABSecurityResultItem, create_dissector_handle(dissect_E_RABSecurityResultItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_LTE_NTN_TAI_Information, create_dissector_handle(dissect_LTE_NTN_TAI_Information_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeUpdatedList, create_dissector_handle(dissect_E_RABToBeUpdatedList_PDU, proto_s1ap)); dissector_add_uint("s1ap.ies", id_E_RABToBeUpdatedItem, create_dissector_handle(dissect_E_RABToBeUpdatedItem_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Data_Forwarding_Not_Possible, create_dissector_handle(dissect_Data_Forwarding_Not_Possible_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Time_Synchronisation_Info, create_dissector_handle(dissect_TimeSynchronisationInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_x2TNLConfigurationInfo, create_dissector_handle(dissect_X2TNLConfigurationInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_eNBX2ExtendedTransportLayerAddresses, create_dissector_handle(dissect_ENBX2ExtTLAs_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Correlation_ID, create_dissector_handle(dissect_Correlation_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_MDTConfiguration, create_dissector_handle(dissect_MDT_Configuration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Time_UE_StayedInCell_EnhancedGranularity, create_dissector_handle(dissect_Time_UE_StayedInCell_EnhancedGranularity_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_HO_Cause, create_dissector_handle(dissect_Cause_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_M3Configuration, create_dissector_handle(dissect_M3Configuration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_M4Configuration, create_dissector_handle(dissect_M4Configuration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_M5Configuration, create_dissector_handle(dissect_M5Configuration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_MDT_Location_Info, create_dissector_handle(dissect_MDT_Location_Info_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_MobilityInformation, create_dissector_handle(dissect_MobilityInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SignallingBasedMDTPLMNList, create_dissector_handle(dissect_MDTPLMNList_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_ULCOUNTValueExtended, create_dissector_handle(dissect_COUNTValueExtended_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_DLCOUNTValueExtended, create_dissector_handle(dissect_COUNTValueExtended_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_ReceiveStatusOfULPDCPSDUsExtended, create_dissector_handle(dissect_ReceiveStatusOfULPDCPSDUsExtended_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SIPTO_Correlation_ID, create_dissector_handle(dissect_Correlation_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_TransportInformation, create_dissector_handle(dissect_TransportInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_eNBIndirectX2TransportLayerAddresses, create_dissector_handle(dissect_ENBIndirectX2TransportLayerAddresses_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_LoggedMBSFNMDT, create_dissector_handle(dissect_LoggedMBSFNMDT_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_uE_HistoryInformationFromTheUE, create_dissector_handle(dissect_UE_HistoryInformationFromTheUE_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Muting_Availability_Indication, create_dissector_handle(dissect_MutingAvailabilityIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Muting_Pattern_Information, create_dissector_handle(dissect_MutingPatternInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Synchronisation_Information, create_dissector_handle(dissect_SynchronisationInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_ProSeUEtoNetworkRelaying, create_dissector_handle(dissect_ProSeUEtoNetworkRelaying_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_ULCOUNTValuePDCP_SNlength18, create_dissector_handle(dissect_COUNTvaluePDCP_SNlength18_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_DLCOUNTValuePDCP_SNlength18, create_dissector_handle(dissect_COUNTvaluePDCP_SNlength18_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18, create_dissector_handle(dissect_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_M6Configuration, create_dissector_handle(dissect_M6Configuration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_M7Configuration, create_dissector_handle(dissect_M7Configuration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_RAT_Type, create_dissector_handle(dissect_RAT_Type_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_BearerType, create_dissector_handle(dissect_BearerType_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_extended_e_RAB_MaximumBitrateDL, create_dissector_handle(dissect_ExtendedBitRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_extended_e_RAB_MaximumBitrateUL, create_dissector_handle(dissect_ExtendedBitRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_extended_e_RAB_GuaranteedBitrateDL, create_dissector_handle(dissect_ExtendedBitRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_extended_e_RAB_GuaranteedBitrateUL, create_dissector_handle(dissect_ExtendedBitRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_NRrestrictioninEPSasSecondaryRAT, create_dissector_handle(dissect_NRrestrictioninEPSasSecondaryRAT_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_UEAppLayerMeasConfig, create_dissector_handle(dissect_UEAppLayerMeasConfig_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_extended_uEaggregateMaximumBitRateDL, create_dissector_handle(dissect_ExtendedBitRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_extended_uEaggregateMaximumBitRateUL, create_dissector_handle(dissect_ExtendedBitRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_UnlicensedSpectrumRestriction, create_dissector_handle(dissect_UnlicensedSpectrumRestriction_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_CNTypeRestrictions, create_dissector_handle(dissect_CNTypeRestrictions_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_DownlinkPacketLossRate, create_dissector_handle(dissect_Packet_LossRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_UplinkPacketLossRate, create_dissector_handle(dissect_Packet_LossRate_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_serviceType, create_dissector_handle(dissect_ServiceType_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_BluetoothMeasurementConfiguration, create_dissector_handle(dissect_BluetoothMeasurementConfiguration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_WLANMeasurementConfiguration, create_dissector_handle(dissect_WLANMeasurementConfiguration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_NRrestrictionin5GS, create_dissector_handle(dissect_NRrestrictionin5GS_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_LastNG_RANPLMNIdentity, create_dissector_handle(dissect_PLMNidentity_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_PSCellInformation, create_dissector_handle(dissect_s1ap_PSCellInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_IMSvoiceEPSfallbackfrom5G, create_dissector_handle(dissect_IMSvoiceEPSfallbackfrom5G_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_RequestTypeAdditionalInfo, create_dissector_handle(dissect_RequestTypeAdditionalInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_ContextatSource, create_dissector_handle(dissect_ContextatSource_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_Ethernet_Type, create_dissector_handle(dissect_Ethernet_Type_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_IntersystemMeasurementConfiguration, create_dissector_handle(dissect_IntersystemMeasurementConfiguration_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SourceNodeID, create_dissector_handle(dissect_SourceNodeID_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_NB_IoT_RLF_Report_Container, create_dissector_handle(dissect_NB_IoT_RLF_Report_Container_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_MDTConfigurationNR, create_dissector_handle(dissect_MDT_ConfigurationNR_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_DAPSRequestInfo, create_dissector_handle(dissect_DAPSRequestInfo_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_DAPSResponseInfoList, create_dissector_handle(dissect_DAPSResponseInfoList_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_TraceCollectionEntityURI, create_dissector_handle(dissect_URI_Address_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_EmergencyIndicator, create_dissector_handle(dissect_EmergencyIndicator_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SourceTransportLayerAddress, create_dissector_handle(dissect_TransportLayerAddress_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_lastVisitedPSCellList, create_dissector_handle(dissect_LastVisitedPSCellList_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_RACSIndication, create_dissector_handle(dissect_RACSIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SecurityIndication, create_dissector_handle(dissect_SecurityIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_E_RABSecurityResultList, create_dissector_handle(dissect_E_RABSecurityResultList_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_RAT_Restrictions, create_dissector_handle(dissect_RAT_Restrictions_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_UEContextReferenceatSourceeNB, create_dissector_handle(dissect_ENB_UE_S1AP_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_LTE_NTN_TAI_Information, create_dissector_handle(dissect_LTE_NTN_TAI_Information_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SourceNodeTransportLayerAddress, create_dissector_handle(dissect_TransportLayerAddress_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SourceSNID, create_dissector_handle(dissect_Global_RAN_NODE_ID_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_LoggedMDTTrigger, create_dissector_handle(dissect_LoggedMDTTrigger_PDU, proto_s1ap)); dissector_add_uint("s1ap.extension", id_SensorMeasurementConfiguration, create_dissector_handle(dissect_SensorMeasurementConfiguration_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_HandoverPreparation, create_dissector_handle(dissect_HandoverRequired_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_HandoverPreparation, create_dissector_handle(dissect_HandoverCommand_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_HandoverPreparation, create_dissector_handle(dissect_HandoverPreparationFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_HandoverResourceAllocation, create_dissector_handle(dissect_HandoverRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_HandoverResourceAllocation, create_dissector_handle(dissect_HandoverRequestAcknowledge_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_HandoverResourceAllocation, create_dissector_handle(dissect_HandoverFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_HandoverNotification, create_dissector_handle(dissect_HandoverNotify_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_PathSwitchRequest, create_dissector_handle(dissect_PathSwitchRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_PathSwitchRequest, create_dissector_handle(dissect_PathSwitchRequestAcknowledge_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_PathSwitchRequest, create_dissector_handle(dissect_PathSwitchRequestFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_E_RABSetup, create_dissector_handle(dissect_E_RABSetupRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_E_RABSetup, create_dissector_handle(dissect_E_RABSetupResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_E_RABModify, create_dissector_handle(dissect_E_RABModifyRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_E_RABModify, create_dissector_handle(dissect_E_RABModifyResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_E_RABRelease, create_dissector_handle(dissect_E_RABReleaseCommand_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_E_RABRelease, create_dissector_handle(dissect_E_RABReleaseResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_E_RABReleaseIndication, create_dissector_handle(dissect_E_RABReleaseIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_InitialContextSetup, create_dissector_handle(dissect_InitialContextSetupRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_InitialContextSetup, create_dissector_handle(dissect_InitialContextSetupResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_InitialContextSetup, create_dissector_handle(dissect_InitialContextSetupFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEContextReleaseRequest, create_dissector_handle(dissect_UEContextReleaseRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_Paging, create_dissector_handle(dissect_Paging_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_downlinkNASTransport, create_dissector_handle(dissect_DownlinkNASTransport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_initialUEMessage, create_dissector_handle(dissect_InitialUEMessage_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_uplinkNASTransport, create_dissector_handle(dissect_UplinkNASTransport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_NASNonDeliveryIndication, create_dissector_handle(dissect_NASNonDeliveryIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_HandoverCancel, create_dissector_handle(dissect_HandoverCancel_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_HandoverCancel, create_dissector_handle(dissect_HandoverCancelAcknowledge_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_Reset, create_dissector_handle(dissect_Reset_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_Reset, create_dissector_handle(dissect_ResetAcknowledge_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_ErrorIndication, create_dissector_handle(dissect_ErrorIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_S1Setup, create_dissector_handle(dissect_S1SetupRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_S1Setup, create_dissector_handle(dissect_S1SetupResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_S1Setup, create_dissector_handle(dissect_S1SetupFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_DownlinkS1cdma2000tunnelling, create_dissector_handle(dissect_DownlinkS1cdma2000tunnelling_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_ENBConfigurationUpdate, create_dissector_handle(dissect_ENBConfigurationUpdate_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_ENBConfigurationUpdate, create_dissector_handle(dissect_ENBConfigurationUpdateAcknowledge_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_ENBConfigurationUpdate, create_dissector_handle(dissect_ENBConfigurationUpdateFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_MMEConfigurationUpdate, create_dissector_handle(dissect_MMEConfigurationUpdate_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_MMEConfigurationUpdate, create_dissector_handle(dissect_MMEConfigurationUpdateAcknowledge_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_MMEConfigurationUpdate, create_dissector_handle(dissect_MMEConfigurationUpdateFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UplinkS1cdma2000tunnelling, create_dissector_handle(dissect_UplinkS1cdma2000tunnelling_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEContextModification, create_dissector_handle(dissect_UEContextModificationRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UEContextModification, create_dissector_handle(dissect_UEContextModificationResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_UEContextModification, create_dissector_handle(dissect_UEContextModificationFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UECapabilityInfoIndication, create_dissector_handle(dissect_UECapabilityInfoIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEContextRelease, create_dissector_handle(dissect_UEContextReleaseCommand_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UEContextRelease, create_dissector_handle(dissect_UEContextReleaseComplete_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_eNBStatusTransfer, create_dissector_handle(dissect_ENBStatusTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_MMEStatusTransfer, create_dissector_handle(dissect_MMEStatusTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_DeactivateTrace, create_dissector_handle(dissect_DeactivateTrace_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_TraceStart, create_dissector_handle(dissect_TraceStart_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_TraceFailureIndication, create_dissector_handle(dissect_TraceFailureIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_LocationReportingControl, create_dissector_handle(dissect_LocationReportingControl_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_LocationReportingFailureIndication, create_dissector_handle(dissect_LocationReportingFailureIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_LocationReport, create_dissector_handle(dissect_LocationReport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_OverloadStart, create_dissector_handle(dissect_OverloadStart_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_OverloadStop, create_dissector_handle(dissect_OverloadStop_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_WriteReplaceWarning, create_dissector_handle(dissect_WriteReplaceWarningRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_WriteReplaceWarning, create_dissector_handle(dissect_WriteReplaceWarningResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_eNBDirectInformationTransfer, create_dissector_handle(dissect_ENBDirectInformationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_MMEDirectInformationTransfer, create_dissector_handle(dissect_MMEDirectInformationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_eNBConfigurationTransfer, create_dissector_handle(dissect_ENBConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_MMEConfigurationTransfer, create_dissector_handle(dissect_MMEConfigurationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_CellTrafficTrace, create_dissector_handle(dissect_CellTrafficTrace_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_PrivateMessage, create_dissector_handle(dissect_PrivateMessage_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_PWSRestartIndication, create_dissector_handle(dissect_PWSRestartIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_Kill, create_dissector_handle(dissect_KillRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_Kill, create_dissector_handle(dissect_KillResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_downlinkUEAssociatedLPPaTransport, create_dissector_handle(dissect_DownlinkUEAssociatedLPPaTransport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_uplinkUEAssociatedLPPaTransport, create_dissector_handle(dissect_UplinkUEAssociatedLPPaTransport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_downlinkNonUEAssociatedLPPaTransport, create_dissector_handle(dissect_DownlinkNonUEAssociatedLPPaTransport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_uplinkNonUEAssociatedLPPaTransport, create_dissector_handle(dissect_UplinkNonUEAssociatedLPPaTransport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UERadioCapabilityMatch, create_dissector_handle(dissect_UERadioCapabilityMatchRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UERadioCapabilityMatch, create_dissector_handle(dissect_UERadioCapabilityMatchResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_E_RABModificationIndication, create_dissector_handle(dissect_E_RABModificationIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_E_RABModificationIndication, create_dissector_handle(dissect_E_RABModificationConfirm_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEContextModificationIndication, create_dissector_handle(dissect_UEContextModificationIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UEContextModificationIndication, create_dissector_handle(dissect_UEContextModificationConfirm_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_RerouteNASRequest, create_dissector_handle(dissect_RerouteNASRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_PWSFailureIndication, create_dissector_handle(dissect_PWSFailureIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_ConnectionEstablishmentIndication, create_dissector_handle(dissect_ConnectionEstablishmentIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEContextSuspend, create_dissector_handle(dissect_UEContextSuspendRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UEContextSuspend, create_dissector_handle(dissect_UEContextSuspendResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEContextResume, create_dissector_handle(dissect_UEContextResumeRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UEContextResume, create_dissector_handle(dissect_UEContextResumeResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.uout", id_UEContextResume, create_dissector_handle(dissect_UEContextResumeFailure_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_NASDeliveryIndication, create_dissector_handle(dissect_NASDeliveryIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_RetrieveUEInformation, create_dissector_handle(dissect_RetrieveUEInformation_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UEInformationTransfer, create_dissector_handle(dissect_UEInformationTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_eNBCPRelocationIndication, create_dissector_handle(dissect_ENBCPRelocationIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_MMECPRelocationIndication, create_dissector_handle(dissect_MMECPRelocationIndication_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_SecondaryRATDataUsageReport, create_dissector_handle(dissect_SecondaryRATDataUsageReport_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_UERadioCapabilityIDMapping, create_dissector_handle(dissect_UERadioCapabilityIDMappingRequest_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.sout", id_UERadioCapabilityIDMapping, create_dissector_handle(dissect_UERadioCapabilityIDMappingResponse_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_HandoverSuccess, create_dissector_handle(dissect_HandoverSuccess_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_eNBEarlyStatusTransfer, create_dissector_handle(dissect_ENBEarlyStatusTransfer_PDU, proto_s1ap)); dissector_add_uint("s1ap.proc.imsg", id_MMEEarlyStatusTransfer, create_dissector_handle(dissect_MMEEarlyStatusTransfer_PDU, proto_s1ap)); } /*--- proto_register_s1ap -------------------------------------------*/ void proto_register_s1ap(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_s1ap_transportLayerAddressIPv4, { "transportLayerAddress(IPv4)", "s1ap.transportLayerAddressIPv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_transportLayerAddressIPv6, { "transportLayerAddress(IPv6)", "s1ap.transportLayerAddressIPv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_UTRAN_Trace_ID_TraceID, { "TraceID", "s1ap.E_UTRAN_Trace_ID.TraceID", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_UTRAN_Trace_ID_TraceRecordingSessionReference, { "TraceRecordingSessionReference", "s1ap.E_UTRAN_Trace_ID.TraceRecordingSessionReference", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace_S1_MME, { "S1-MME", "s1ap.interfacesToTrace.S1_MME", FT_BOOLEAN, 8, TFS(&s1ap_tfs_interfacesToTrace), 0x80, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace_X2, { "X2", "s1ap.interfacesToTrace.X2", FT_BOOLEAN, 8, TFS(&s1ap_tfs_interfacesToTrace), 0x40, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace_Uu, { "Uu", "s1ap.interfacesToTrace.Uu", FT_BOOLEAN, 8, TFS(&s1ap_tfs_interfacesToTrace), 0x20, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace_F1_C, { "F1-C", "s1ap.interfacesToTrace.F1_C", FT_BOOLEAN, 8, TFS(&s1ap_tfs_interfacesToTrace), 0x10, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace_E1, { "E1", "s1ap.interfacesToTrace.E1", FT_BOOLEAN, 8, TFS(&s1ap_tfs_interfacesToTrace), 0x08, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace_Reserved, { "Reserved", "s1ap.interfacesToTrace.Reserved", FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL }}, { &hf_s1ap_encryptionAlgorithms_EEA1, { "128-EEA1", "s1ap.encryptionAlgorithms.EEA1", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }}, { &hf_s1ap_encryptionAlgorithms_EEA2, { "128-EEA2", "s1ap.encryptionAlgorithms.EEA2", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }}, { &hf_s1ap_encryptionAlgorithms_EEA3, { "128-EEA3", "s1ap.encryptionAlgorithms.EEA3", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }}, { &hf_s1ap_encryptionAlgorithms_Reserved, { "Reserved", "s1ap.encryptionAlgorithms.Reserved", FT_UINT16, BASE_HEX, NULL, 0x1fff, NULL, HFILL }}, { &hf_s1ap_integrityProtectionAlgorithms_EIA1, { "128-EIA1", "s1ap.integrityProtectionAlgorithms.EIA1", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }}, { &hf_s1ap_integrityProtectionAlgorithms_EIA2, { "128-EIA2", "s1ap.integrityProtectionAlgorithms.EIA2", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }}, { &hf_s1ap_integrityProtectionAlgorithms_EIA3, { "128-EIA3", "s1ap.integrityProtectionAlgorithms.EIA3", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }}, { &hf_s1ap_integrityProtectionAlgorithms_Reserved, { "Reserved", "s1ap.integrityProtectionAlgorithms.Reserved", FT_UINT16, BASE_HEX, NULL, 0x1fff, NULL, HFILL }}, { &hf_s1ap_SerialNumber_gs, { "Geographical Scope", "s1ap.SerialNumber.gs", FT_UINT16, BASE_DEC, VALS(s1ap_serialNumber_gs_vals), 0xc000, NULL, HFILL }}, { &hf_s1ap_SerialNumber_msg_code, { "Message Code", "s1ap.SerialNumber.msg_code", FT_UINT16, BASE_DEC, NULL, 0x3ff0, NULL, HFILL }}, { &hf_s1ap_SerialNumber_upd_nb, { "Update Number", "s1ap.SerialNumber.upd_nb", FT_UINT16, BASE_DEC, NULL, 0x000f, NULL, HFILL }}, { &hf_s1ap_WarningType_value, { "Warning Type Value", "s1ap.WarningType.value", FT_UINT16, BASE_DEC, VALS(s1ap_warningType_vals), 0xfe00, NULL, HFILL }}, { &hf_s1ap_WarningType_emergency_user_alert, { "Emergency User Alert", "s1ap.WarningType.emergency_user_alert", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100, NULL, HFILL }}, { &hf_s1ap_WarningType_popup, { "Popup", "s1ap.WarningType.popup", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080, NULL, HFILL }}, { &hf_s1ap_WarningMessageContents_nb_pages, { "Number of Pages", "s1ap.WarningMessageContents.nb_pages", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WarningMessageContents_decoded_page, { "Decoded Page", "s1ap.WarningMessageContents.decoded_page", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M1, { "M1", "s1ap.measurementsToActivate.M1", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x80, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M2, { "M2", "s1ap.measurementsToActivate.M2", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x40, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M3, { "M3", "s1ap.measurementsToActivate.M3", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x20, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M4, { "M4", "s1ap.measurementsToActivate.M4", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x10, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M5, { "M5", "s1ap.measurementsToActivate.M5", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x08, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_LoggingM1FromEventTriggered, { "LoggingOfM1FromEventTriggeredMeasurementReports", "s1ap.measurementsToActivate.LoggingM1FromEventTriggered", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x04, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M6, { "M6", "s1ap.measurementsToActivate.M6", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x02, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate_M7, { "M7", "s1ap.measurementsToActivate.M7", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x01, NULL, HFILL }}, { &hf_s1ap_MDT_Location_Info_GNSS, { "GNSS", "s1ap.MDT_Location_Info.GNSS", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x80, NULL, HFILL }}, { &hf_s1ap_MDT_Location_Info_E_CID, { "E-CID", "s1ap.MDT_Location_Info.E_CID", FT_BOOLEAN, 8, TFS(&s1ap_tfs_activate_do_not_activate), 0x40, NULL, HFILL }}, { &hf_s1ap_MDT_Location_Info_Reserved, { "Reserved", "s1ap.MDT_Location_Info.Reserved", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL }}, { &hf_s1ap_NRencryptionAlgorithms_NEA1, { "128-NEA1", "s1ap.NRencryptionAlgorithms.NEA1", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }}, { &hf_s1ap_NRencryptionAlgorithms_NEA2, { "128-NEA2", "s1ap.NRencryptionAlgorithms.NEA2", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }}, { &hf_s1ap_NRencryptionAlgorithms_NEA3, { "128-NEA3", "s1ap.NRencryptionAlgorithms.NEA3", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }}, { &hf_s1ap_NRencryptionAlgorithms_Reserved, { "Reserved", "s1ap.NRencryptionAlgorithms.Reserved", FT_UINT16, BASE_HEX, NULL, 0x1fff, NULL, HFILL }}, { &hf_s1ap_NRintegrityProtectionAlgorithms_NIA1, { "128-NIA1", "s1ap.NRintegrityProtectionAlgorithms.NIA1", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }}, { &hf_s1ap_NRintegrityProtectionAlgorithms_NIA2, { "128-NIA2", "s1ap.NRintegrityProtectionAlgorithms.NIA2", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }}, { &hf_s1ap_NRintegrityProtectionAlgorithms_NIA3, { "128-NIA3", "s1ap.NRintegrityProtectionAlgorithms.NIA3", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }}, { &hf_s1ap_NRintegrityProtectionAlgorithms_Reserved, { "Reserved", "s1ap.NRintegrityProtectionAlgorithms.Reserved", FT_UINT16, BASE_HEX, NULL, 0x1fff, NULL, HFILL }}, { &hf_s1ap_UE_Application_Layer_Measurement_Capability_QoE_Measurement_for_streaming_service, { "QoE Measurement for streaming service", "s1ap.UE_Application_Layer_Measurement_Capability.QoE_Measurement_for_streaming_service", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80, NULL, HFILL }}, { &hf_s1ap_UE_Application_Layer_Measurement_Capability_QoE_Measurement_for_MTSI_service, { "QoE Measurement for MTSI service", "s1ap.UE_Application_Layer_Measurement_Capability.QoE_Measurement_for_MTSI_service", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL }}, { &hf_s1ap_UE_Application_Layer_Measurement_Capability_Reserved, { "Reserved", "s1ap.UE_Application_Layer_Measurement_Capability.Reserved", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL }}, { &hf_s1ap_rAT_RestrictionInformation_LEO, { "LEO", "s1ap.rAT_RestrictionInformation.LEO", FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x80, NULL, HFILL }}, { &hf_s1ap_rAT_RestrictionInformation_MEO, { "MEO", "s1ap.rAT_RestrictionInformation.MEO", FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x40, NULL, HFILL }}, { &hf_s1ap_rAT_RestrictionInformation_GEO, { "GEO", "s1ap.rAT_RestrictionInformation.GEO", FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x20, NULL, HFILL }}, { &hf_s1ap_rAT_RestrictionInformation_OTHERSAT, { "OTHERSAT", "s1ap.rAT_RestrictionInformation.OTHERSAT", FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x10, NULL, HFILL }}, { &hf_s1ap_rAT_RestrictionInformation_Reserved, { "Reserved", "s1ap.rAT_RestrictionInformation.Reserved", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL }}, { &hf_s1ap_Additional_GUTI_PDU, { "Additional-GUTI", "s1ap.Additional_GUTI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_AdditionalRRMPriorityIndex_PDU, { "AdditionalRRMPriorityIndex", "s1ap.AdditionalRRMPriorityIndex", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_AerialUEsubscriptionInformation_PDU, { "AerialUEsubscriptionInformation", "s1ap.AerialUEsubscriptionInformation", FT_UINT32, BASE_DEC, VALS(s1ap_AerialUEsubscriptionInformation_vals), 0, NULL, HFILL }}, { &hf_s1ap_AssistanceDataForPaging_PDU, { "AssistanceDataForPaging", "s1ap.AssistanceDataForPaging_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Bearers_SubjectToStatusTransfer_Item_PDU, { "Bearers-SubjectToStatusTransfer-Item", "s1ap.Bearers_SubjectToStatusTransfer_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item_PDU, { "Bearers-SubjectToEarlyStatusTransfer-Item", "s1ap.Bearers_SubjectToEarlyStatusTransfer_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_BearerType_PDU, { "BearerType", "s1ap.BearerType", FT_UINT32, BASE_DEC, VALS(s1ap_BearerType_vals), 0, NULL, HFILL }}, { &hf_s1ap_BluetoothMeasurementConfiguration_PDU, { "BluetoothMeasurementConfiguration", "s1ap.BluetoothMeasurementConfiguration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_BroadcastCancelledAreaList_PDU, { "BroadcastCancelledAreaList", "s1ap.BroadcastCancelledAreaList", FT_UINT32, BASE_DEC, VALS(s1ap_BroadcastCancelledAreaList_vals), 0, NULL, HFILL }}, { &hf_s1ap_BroadcastCompletedAreaList_PDU, { "BroadcastCompletedAreaList", "s1ap.BroadcastCompletedAreaList", FT_UINT32, BASE_DEC, VALS(s1ap_BroadcastCompletedAreaList_vals), 0, NULL, HFILL }}, { &hf_s1ap_Cause_PDU, { "Cause", "s1ap.Cause", FT_UINT32, BASE_DEC, VALS(s1ap_Cause_vals), 0, NULL, HFILL }}, { &hf_s1ap_CellAccessMode_PDU, { "CellAccessMode", "s1ap.CellAccessMode", FT_UINT32, BASE_DEC, VALS(s1ap_CellAccessMode_vals), 0, NULL, HFILL }}, { &hf_s1ap_CellIdentifierAndCELevelForCECapableUEs_PDU, { "CellIdentifierAndCELevelForCECapableUEs", "s1ap.CellIdentifierAndCELevelForCECapableUEs_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CE_mode_B_SupportIndicator_PDU, { "CE-mode-B-SupportIndicator", "s1ap.CE_mode_B_SupportIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_CE_mode_B_SupportIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000PDU_PDU, { "Cdma2000PDU", "s1ap.Cdma2000PDU", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000RATType_PDU, { "Cdma2000RATType", "s1ap.Cdma2000RATType", FT_UINT32, BASE_DEC, VALS(s1ap_Cdma2000RATType_vals), 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000SectorID_PDU, { "Cdma2000SectorID", "s1ap.Cdma2000SectorID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000HOStatus_PDU, { "Cdma2000HOStatus", "s1ap.Cdma2000HOStatus", FT_UINT32, BASE_DEC, VALS(s1ap_Cdma2000HOStatus_vals), 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000HORequiredIndication_PDU, { "Cdma2000HORequiredIndication", "s1ap.Cdma2000HORequiredIndication", FT_UINT32, BASE_DEC, VALS(s1ap_Cdma2000HORequiredIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000OneXSRVCCInfo_PDU, { "Cdma2000OneXSRVCCInfo", "s1ap.Cdma2000OneXSRVCCInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Cdma2000OneXRAND_PDU, { "Cdma2000OneXRAND", "s1ap.Cdma2000OneXRAND", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CNDomain_PDU, { "CNDomain", "s1ap.CNDomain", FT_UINT32, BASE_DEC, VALS(s1ap_CNDomain_vals), 0, NULL, HFILL }}, { &hf_s1ap_CNTypeRestrictions_PDU, { "CNTypeRestrictions", "s1ap.CNTypeRestrictions", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ConcurrentWarningMessageIndicator_PDU, { "ConcurrentWarningMessageIndicator", "s1ap.ConcurrentWarningMessageIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_ConcurrentWarningMessageIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_ConnectedengNBList_PDU, { "ConnectedengNBList", "s1ap.ConnectedengNBList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ContextatSource_PDU, { "ContextatSource", "s1ap.ContextatSource_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Correlation_ID_PDU, { "Correlation-ID", "s1ap.Correlation_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CSFallbackIndicator_PDU, { "CSFallbackIndicator", "s1ap.CSFallbackIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_CSFallbackIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_AdditionalCSFallbackIndicator_PDU, { "AdditionalCSFallbackIndicator", "s1ap.AdditionalCSFallbackIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_AdditionalCSFallbackIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_CSG_Id_PDU, { "CSG-Id", "s1ap.CSG_Id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CSG_IdList_PDU, { "CSG-IdList", "s1ap.CSG_IdList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CSGMembershipStatus_PDU, { "CSGMembershipStatus", "s1ap.CSGMembershipStatus", FT_UINT32, BASE_DEC, VALS(s1ap_CSGMembershipStatus_vals), 0, NULL, HFILL }}, { &hf_s1ap_COUNTValueExtended_PDU, { "COUNTValueExtended", "s1ap.COUNTValueExtended_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_COUNTvaluePDCP_SNlength18_PDU, { "COUNTvaluePDCP-SNlength18", "s1ap.COUNTvaluePDCP_SNlength18_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Coverage_Level_PDU, { "Coverage-Level", "s1ap.Coverage_Level", FT_UINT32, BASE_DEC, VALS(s1ap_Coverage_Level_vals), 0, NULL, HFILL }}, { &hf_s1ap_CriticalityDiagnostics_PDU, { "CriticalityDiagnostics", "s1ap.CriticalityDiagnostics_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DAPSRequestInfo_PDU, { "DAPSRequestInfo", "s1ap.DAPSRequestInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DAPSResponseInfoList_PDU, { "DAPSResponseInfoList", "s1ap.DAPSResponseInfoList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DAPSResponseInfoItem_PDU, { "DAPSResponseInfoItem", "s1ap.DAPSResponseInfoItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DataCodingScheme_PDU, { "DataCodingScheme", "s1ap.DataCodingScheme", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DataSize_PDU, { "DataSize", "s1ap.DataSize", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_bit_bits, 0, NULL, HFILL }}, { &hf_s1ap_DCN_ID_PDU, { "DCN-ID", "s1ap.DCN_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServedDCNs_PDU, { "ServedDCNs", "s1ap.ServedDCNs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DL_CP_SecurityInformation_PDU, { "DL-CP-SecurityInformation", "s1ap.DL_CP_SecurityInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Direct_Forwarding_Path_Availability_PDU, { "Direct-Forwarding-Path-Availability", "s1ap.Direct_Forwarding_Path_Availability", FT_UINT32, BASE_DEC, VALS(s1ap_Direct_Forwarding_Path_Availability_vals), 0, NULL, HFILL }}, { &hf_s1ap_Data_Forwarding_Not_Possible_PDU, { "Data-Forwarding-Not-Possible", "s1ap.Data_Forwarding_Not_Possible", FT_UINT32, BASE_DEC, VALS(s1ap_Data_Forwarding_Not_Possible_vals), 0, NULL, HFILL }}, { &hf_s1ap_DLNASPDUDeliveryAckRequest_PDU, { "DLNASPDUDeliveryAckRequest", "s1ap.DLNASPDUDeliveryAckRequest", FT_UINT32, BASE_DEC, VALS(s1ap_DLNASPDUDeliveryAckRequest_vals), 0, NULL, HFILL }}, { &hf_s1ap_PWSfailedECGIList_PDU, { "PWSfailedECGIList", "s1ap.PWSfailedECGIList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EDT_Session_PDU, { "EDT-Session", "s1ap.EDT_Session", FT_UINT32, BASE_DEC, VALS(s1ap_EDT_Session_vals), 0, NULL, HFILL }}, { &hf_s1ap_EmergencyAreaIDListForRestart_PDU, { "EmergencyAreaIDListForRestart", "s1ap.EmergencyAreaIDListForRestart", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EmergencyIndicator_PDU, { "EmergencyIndicator", "s1ap.EmergencyIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_EmergencyIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_ENB_EarlyStatusTransfer_TransparentContainer_PDU, { "ENB-EarlyStatusTransfer-TransparentContainer", "s1ap.ENB_EarlyStatusTransfer_TransparentContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_Global_ENB_ID_PDU, { "Global-ENB-ID", "s1ap.Global_ENB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_GUMMEIList_PDU, { "GUMMEIList", "s1ap.GUMMEIList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_ENB_StatusTransfer_TransparentContainer_PDU, { "ENB-StatusTransfer-TransparentContainer", "s1ap.ENB_StatusTransfer_TransparentContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENB_UE_S1AP_ID_PDU, { "ENB-UE-S1AP-ID", "s1ap.ENB_UE_S1AP_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBname_PDU, { "ENBname", "s1ap.ENBname", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_EN_DCSONConfigurationTransfer_PDU, { "EN-DCSONConfigurationTransfer", "s1ap.EN_DCSONConfigurationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EndIndication_PDU, { "EndIndication", "s1ap.EndIndication", FT_UINT32, BASE_DEC, VALS(s1ap_EndIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_EnhancedCoverageRestricted_PDU, { "EnhancedCoverageRestricted", "s1ap.EnhancedCoverageRestricted", FT_UINT32, BASE_DEC, VALS(s1ap_EnhancedCoverageRestricted_vals), 0, NULL, HFILL }}, { &hf_s1ap_CE_ModeBRestricted_PDU, { "CE-ModeBRestricted", "s1ap.CE_ModeBRestricted", FT_UINT32, BASE_DEC, VALS(s1ap_CE_ModeBRestricted_vals), 0, NULL, HFILL }}, { &hf_s1ap_E_RABInformationListItem_PDU, { "E-RABInformationListItem", "s1ap.E_RABInformationListItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABList_PDU, { "E-RABList", "s1ap.E_RABList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABItem_PDU, { "E-RABItem", "s1ap.E_RABItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABLevelQoSParameters_PDU, { "E-RABLevelQoSParameters", "s1ap.E_RABLevelQoSParameters_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSecurityResultList_PDU, { "E-RABSecurityResultList", "s1ap.E_RABSecurityResultList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSecurityResultItem_PDU, { "E-RABSecurityResultItem", "s1ap.E_RABSecurityResultItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABUsageReportItem_PDU, { "E-RABUsageReportItem", "s1ap.E_RABUsageReportItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Ethernet_Type_PDU, { "Ethernet-Type", "s1ap.Ethernet_Type", FT_UINT32, BASE_DEC, VALS(s1ap_Ethernet_Type_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_EUTRAN_CGI_PDU, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EUTRANRoundTripDelayEstimationInfo_PDU, { "EUTRANRoundTripDelayEstimationInfo", "s1ap.EUTRANRoundTripDelayEstimationInfo", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_EUTRANRoundTripDelayEstimationInfo_fmt), 0, NULL, HFILL }}, { &hf_s1ap_ExpectedUEBehaviour_PDU, { "ExpectedUEBehaviour", "s1ap.ExpectedUEBehaviour_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ExtendedBitRate_PDU, { "ExtendedBitRate", "s1ap.ExtendedBitRate", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, NULL, HFILL }}, { &hf_s1ap_ExtendedRepetitionPeriod_PDU, { "ExtendedRepetitionPeriod", "s1ap.ExtendedRepetitionPeriod", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_s1ap_Extended_UEIdentityIndexValue_PDU, { "Extended-UEIdentityIndexValue", "s1ap.Extended_UEIdentityIndexValue", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_GUMMEI_PDU, { "GUMMEI", "s1ap.GUMMEI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_GUMMEIType_PDU, { "GUMMEIType", "s1ap.GUMMEIType", FT_UINT32, BASE_DEC, VALS(s1ap_GUMMEIType_vals), 0, NULL, HFILL }}, { &hf_s1ap_GWContextReleaseIndication_PDU, { "GWContextReleaseIndication", "s1ap.GWContextReleaseIndication", FT_UINT32, BASE_DEC, VALS(s1ap_GWContextReleaseIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_HandoverFlag_PDU, { "HandoverFlag", "s1ap.HandoverFlag", FT_UINT32, BASE_DEC, VALS(s1ap_HandoverFlag_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_HandoverRestrictionList_PDU, { "HandoverRestrictionList", "s1ap.HandoverRestrictionList_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverType_PDU, { "HandoverType", "s1ap.HandoverType", FT_UINT32, BASE_DEC, VALS(s1ap_HandoverType_vals), 0, NULL, HFILL }}, { &hf_s1ap_Masked_IMEISV_PDU, { "Masked-IMEISV", "s1ap.Masked_IMEISV", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_InformationOnRecommendedCellsAndENBsForPaging_PDU, { "InformationOnRecommendedCellsAndENBsForPaging", "s1ap.InformationOnRecommendedCellsAndENBsForPaging_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_IntersystemMeasurementConfiguration_PDU, { "IntersystemMeasurementConfiguration", "s1ap.IntersystemMeasurementConfiguration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_IntersystemSONConfigurationTransfer_PDU, { "IntersystemSONConfigurationTransfer", "s1ap.IntersystemSONConfigurationTransfer", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_IMSvoiceEPSfallbackfrom5G_PDU, { "IMSvoiceEPSfallbackfrom5G", "s1ap.IMSvoiceEPSfallbackfrom5G", FT_UINT32, BASE_DEC, VALS(s1ap_IMSvoiceEPSfallbackfrom5G_vals), 0, NULL, HFILL }}, { &hf_s1ap_IAB_Authorized_PDU, { "IAB-Authorized", "s1ap.IAB_Authorized", FT_UINT32, BASE_DEC, VALS(s1ap_IAB_Authorized_vals), 0, NULL, HFILL }}, { &hf_s1ap_IAB_Node_Indication_PDU, { "IAB-Node-Indication", "s1ap.IAB_Node_Indication", FT_UINT32, BASE_DEC, VALS(s1ap_IAB_Node_Indication_vals), 0, NULL, HFILL }}, { &hf_s1ap_IAB_Supported_PDU, { "IAB-Supported", "s1ap.IAB_Supported", FT_UINT32, BASE_DEC, VALS(s1ap_IAB_Supported_vals), 0, NULL, HFILL }}, { &hf_s1ap_KillAllWarningMessages_PDU, { "KillAllWarningMessages", "s1ap.KillAllWarningMessages", FT_UINT32, BASE_DEC, VALS(s1ap_KillAllWarningMessages_vals), 0, NULL, HFILL }}, { &hf_s1ap_LAI_PDU, { "LAI", "s1ap.LAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_LastVisitedEUTRANCellInformation_PDU, { "LastVisitedEUTRANCellInformation", "s1ap.LastVisitedEUTRANCellInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LastVisitedPSCellList_PDU, { "LastVisitedPSCellList", "s1ap.LastVisitedPSCellList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_LastVisitedGERANCellInformation_PDU, { "LastVisitedGERANCellInformation", "s1ap.LastVisitedGERANCellInformation", FT_UINT32, BASE_DEC, VALS(s1ap_LastVisitedGERANCellInformation_vals), 0, NULL, HFILL }}, { &hf_s1ap_LPPa_PDU_PDU, { "LPPa-PDU", "s1ap.LPPa_PDU", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LHN_ID_PDU, { "LHN-ID", "s1ap.LHN_ID", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LoggedMBSFNMDT_PDU, { "LoggedMBSFNMDT", "s1ap.LoggedMBSFNMDT_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LoggedMDTTrigger_PDU, { "LoggedMDTTrigger", "s1ap.LoggedMDTTrigger", FT_UINT32, BASE_DEC, VALS(s1ap_LoggedMDTTrigger_vals), 0, NULL, HFILL }}, { &hf_s1ap_LTE_M_Indication_PDU, { "LTE-M-Indication", "s1ap.LTE_M_Indication", FT_UINT32, BASE_DEC, VALS(s1ap_LTE_M_Indication_vals), 0, NULL, HFILL }}, { &hf_s1ap_LTE_NTN_TAI_Information_PDU, { "LTE-NTN-TAI-Information", "s1ap.LTE_NTN_TAI_Information_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_M3Configuration_PDU, { "M3Configuration", "s1ap.M3Configuration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_M4Configuration_PDU, { "M4Configuration", "s1ap.M4Configuration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_M5Configuration_PDU, { "M5Configuration", "s1ap.M5Configuration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_M6Configuration_PDU, { "M6Configuration", "s1ap.M6Configuration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_M7Configuration_PDU, { "M7Configuration", "s1ap.M7Configuration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MDT_Location_Info_PDU, { "MDT-Location-Info", "s1ap.MDT_Location_Info", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MDT_Configuration_PDU, { "MDT-Configuration", "s1ap.MDT_Configuration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ManagementBasedMDTAllowed_PDU, { "ManagementBasedMDTAllowed", "s1ap.ManagementBasedMDTAllowed", FT_UINT32, BASE_DEC, VALS(s1ap_ManagementBasedMDTAllowed_vals), 0, NULL, HFILL }}, { &hf_s1ap_MDTPLMNList_PDU, { "MDTPLMNList", "s1ap.MDTPLMNList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PrivacyIndicator_PDU, { "PrivacyIndicator", "s1ap.PrivacyIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_PrivacyIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_MDTMode_PDU, { "MDTMode", "s1ap.MDTMode", FT_UINT32, BASE_DEC, VALS(s1ap_MDTMode_vals), 0, NULL, HFILL }}, { &hf_s1ap_MessageIdentifier_PDU, { "MessageIdentifier", "s1ap.MessageIdentifier", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &lte_rrc_messageIdentifier_vals_ext, 0, NULL, HFILL }}, { &hf_s1ap_MobilityInformation_PDU, { "MobilityInformation", "s1ap.MobilityInformation", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEname_PDU, { "MMEname", "s1ap.MMEname", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMERelaySupportIndicator_PDU, { "MMERelaySupportIndicator", "s1ap.MMERelaySupportIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_MMERelaySupportIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_MME_Group_ID_PDU, { "MME-Group-ID", "s1ap.MME_Group_ID", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MME_UE_S1AP_ID_PDU, { "MME-UE-S1AP-ID", "s1ap.MME_UE_S1AP_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MSClassmark2_PDU, { "MSClassmark2", "s1ap.MSClassmark2", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MSClassmark3_PDU, { "MSClassmark3", "s1ap.MSClassmark3", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MutingAvailabilityIndication_PDU, { "MutingAvailabilityIndication", "s1ap.MutingAvailabilityIndication", FT_UINT32, BASE_DEC, VALS(s1ap_MutingAvailabilityIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_MutingPatternInformation_PDU, { "MutingPatternInformation", "s1ap.MutingPatternInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MDT_ConfigurationNR_PDU, { "MDT-ConfigurationNR", "s1ap.MDT_ConfigurationNR", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NAS_PDU_PDU, { "NAS-PDU", "s1ap.NAS_PDU", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NASSecurityParametersfromE_UTRAN_PDU, { "NASSecurityParametersfromE-UTRAN", "s1ap.NASSecurityParametersfromE_UTRAN", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NASSecurityParameterstoE_UTRAN_PDU, { "NASSecurityParameterstoE-UTRAN", "s1ap.NASSecurityParameterstoE_UTRAN", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NB_IoT_DefaultPagingDRX_PDU, { "NB-IoT-DefaultPagingDRX", "s1ap.NB_IoT_DefaultPagingDRX", FT_UINT32, BASE_DEC, VALS(s1ap_NB_IoT_DefaultPagingDRX_vals), 0, NULL, HFILL }}, { &hf_s1ap_NB_IoT_PagingDRX_PDU, { "NB-IoT-PagingDRX", "s1ap.NB_IoT_PagingDRX", FT_UINT32, BASE_DEC, VALS(s1ap_NB_IoT_PagingDRX_vals), 0, NULL, HFILL }}, { &hf_s1ap_NB_IoT_Paging_eDRXInformation_PDU, { "NB-IoT-Paging-eDRXInformation", "s1ap.NB_IoT_Paging_eDRXInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NB_IoT_RLF_Report_Container_PDU, { "NB-IoT-RLF-Report-Container", "s1ap.NB_IoT_RLF_Report_Container", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NB_IoT_UEIdentityIndexValue_PDU, { "NB-IoT-UEIdentityIndexValue", "s1ap.NB_IoT_UEIdentityIndexValue", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NotifySourceeNB_PDU, { "NotifySourceeNB", "s1ap.NotifySourceeNB", FT_UINT32, BASE_DEC, VALS(s1ap_NotifySourceeNB_vals), 0, NULL, HFILL }}, { &hf_s1ap_NRrestrictioninEPSasSecondaryRAT_PDU, { "NRrestrictioninEPSasSecondaryRAT", "s1ap.NRrestrictioninEPSasSecondaryRAT", FT_UINT32, BASE_DEC, VALS(s1ap_NRrestrictioninEPSasSecondaryRAT_vals), 0, NULL, HFILL }}, { &hf_s1ap_NRrestrictionin5GS_PDU, { "NRrestrictionin5GS", "s1ap.NRrestrictionin5GS", FT_UINT32, BASE_DEC, VALS(s1ap_NRrestrictionin5GS_vals), 0, NULL, HFILL }}, { &hf_s1ap_NRUESecurityCapabilities_PDU, { "NRUESecurityCapabilities", "s1ap.NRUESecurityCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NumberofBroadcastRequest_PDU, { "NumberofBroadcastRequest", "s1ap.NumberofBroadcastRequest", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NRV2XServicesAuthorized_PDU, { "NRV2XServicesAuthorized", "s1ap.NRV2XServicesAuthorized_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NRUESidelinkAggregateMaximumBitrate_PDU, { "NRUESidelinkAggregateMaximumBitrate", "s1ap.NRUESidelinkAggregateMaximumBitrate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_OverloadResponse_PDU, { "OverloadResponse", "s1ap.OverloadResponse", FT_UINT32, BASE_DEC, VALS(s1ap_OverloadResponse_vals), 0, NULL, HFILL }}, { &hf_s1ap_Packet_LossRate_PDU, { "Packet-LossRate", "s1ap.Packet_LossRate", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_Packet_LossRate_fmt), 0, NULL, HFILL }}, { &hf_s1ap_Paging_eDRXInformation_PDU, { "Paging-eDRXInformation", "s1ap.Paging_eDRXInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PagingDRX_PDU, { "PagingDRX", "s1ap.PagingDRX", FT_UINT32, BASE_DEC, VALS(s1ap_PagingDRX_vals), 0, NULL, HFILL }}, { &hf_s1ap_PagingPriority_PDU, { "PagingPriority", "s1ap.PagingPriority", FT_UINT32, BASE_DEC, VALS(s1ap_PagingPriority_vals), 0, NULL, HFILL }}, { &hf_s1ap_PagingCause_PDU, { "PagingCause", "s1ap.PagingCause", FT_UINT32, BASE_DEC, VALS(s1ap_PagingCause_vals), 0, NULL, HFILL }}, { &hf_s1ap_PC5QoSParameters_PDU, { "PC5QoSParameters", "s1ap.PC5QoSParameters_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PendingDataIndication_PDU, { "PendingDataIndication", "s1ap.PendingDataIndication", FT_UINT32, BASE_DEC, VALS(s1ap_PendingDataIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_PLMNidentity_PDU, { "PLMNidentity", "s1ap.PLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ProSeAuthorized_PDU, { "ProSeAuthorized", "s1ap.ProSeAuthorized_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ProSeUEtoNetworkRelaying_PDU, { "ProSeUEtoNetworkRelaying", "s1ap.ProSeUEtoNetworkRelaying", FT_UINT32, BASE_DEC, VALS(s1ap_ProSeUEtoNetworkRelaying_vals), 0, NULL, HFILL }}, { &hf_s1ap_PS_ServiceNotAvailable_PDU, { "PS-ServiceNotAvailable", "s1ap.PS_ServiceNotAvailable", FT_UINT32, BASE_DEC, VALS(s1ap_PS_ServiceNotAvailable_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_PSCellInformation_PDU, { "PSCellInformation", "s1ap.PSCellInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RACSIndication_PDU, { "RACSIndication", "s1ap.RACSIndication", FT_UINT32, BASE_DEC, VALS(s1ap_RACSIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_ReceiveStatusOfULPDCPSDUsExtended_PDU, { "ReceiveStatusOfULPDCPSDUsExtended", "s1ap.ReceiveStatusOfULPDCPSDUsExtended", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ReceiveStatusOfULPDCPSDUsPDCP_SNlength18_PDU, { "ReceiveStatusOfULPDCPSDUsPDCP-SNlength18", "s1ap.ReceiveStatusOfULPDCPSDUsPDCP_SNlength18", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RecommendedCellItem_PDU, { "RecommendedCellItem", "s1ap.RecommendedCellItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RecommendedENBItem_PDU, { "RecommendedENBItem", "s1ap.RecommendedENBItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RelativeMMECapacity_PDU, { "RelativeMMECapacity", "s1ap.RelativeMMECapacity", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RelayNode_Indicator_PDU, { "RelayNode-Indicator", "s1ap.RelayNode_Indicator", FT_UINT32, BASE_DEC, VALS(s1ap_RelayNode_Indicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_RAT_Restrictions_PDU, { "RAT-Restrictions", "s1ap.RAT_Restrictions", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RAT_Type_PDU, { "RAT-Type", "s1ap.RAT_Type", FT_UINT32, BASE_DEC, VALS(s1ap_RAT_Type_vals), 0, NULL, HFILL }}, { &hf_s1ap_RequestType_PDU, { "RequestType", "s1ap.RequestType_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RequestTypeAdditionalInfo_PDU, { "RequestTypeAdditionalInfo", "s1ap.RequestTypeAdditionalInfo", FT_UINT32, BASE_DEC, VALS(s1ap_RequestTypeAdditionalInfo_vals), 0, NULL, HFILL }}, { &hf_s1ap_RepetitionPeriod_PDU, { "RepetitionPeriod", "s1ap.RepetitionPeriod", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_s1ap_RRC_Establishment_Cause_PDU, { "RRC-Establishment-Cause", "s1ap.RRC_Establishment_Cause", FT_UINT32, BASE_DEC, VALS(s1ap_RRC_Establishment_Cause_vals), 0, NULL, HFILL }}, { &hf_s1ap_ECGIListForRestart_PDU, { "ECGIListForRestart", "s1ap.ECGIListForRestart", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Routing_ID_PDU, { "Routing-ID", "s1ap.Routing_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SecurityKey_PDU, { "SecurityKey", "s1ap.SecurityKey", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SecurityContext_PDU, { "SecurityContext", "s1ap.SecurityContext_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SecondaryRATDataUsageRequest_PDU, { "SecondaryRATDataUsageRequest", "s1ap.SecondaryRATDataUsageRequest", FT_UINT32, BASE_DEC, VALS(s1ap_SecondaryRATDataUsageRequest_vals), 0, NULL, HFILL }}, { &hf_s1ap_SecondaryRATDataUsageReportList_PDU, { "SecondaryRATDataUsageReportList", "s1ap.SecondaryRATDataUsageReportList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SecondaryRATDataUsageReportItem_PDU, { "SecondaryRATDataUsageReportItem", "s1ap.SecondaryRATDataUsageReportItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SecurityIndication_PDU, { "SecurityIndication", "s1ap.SecurityIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SensorMeasurementConfiguration_PDU, { "SensorMeasurementConfiguration", "s1ap.SensorMeasurementConfiguration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SerialNumber_PDU, { "SerialNumber", "s1ap.SerialNumber", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServiceType_PDU, { "ServiceType", "s1ap.ServiceType", FT_UINT32, BASE_DEC, VALS(s1ap_ServiceType_vals), 0, NULL, HFILL }}, { &hf_s1ap_SONInformationReport_PDU, { "SONInformationReport", "s1ap.SONInformationReport", FT_UINT32, BASE_DEC, VALS(s1ap_SONInformationReport_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_SONConfigurationTransfer_PDU, { "SONConfigurationTransfer", "s1ap.SONConfigurationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SynchronisationInformation_PDU, { "SynchronisationInformation", "s1ap.SynchronisationInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Source_ToTarget_TransparentContainer_PDU, { "Source-ToTarget-TransparentContainer", "s1ap.Source_ToTarget_TransparentContainer", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SRVCCOperationNotPossible_PDU, { "SRVCCOperationNotPossible", "s1ap.SRVCCOperationNotPossible", FT_UINT32, BASE_DEC, VALS(s1ap_SRVCCOperationNotPossible_vals), 0, NULL, HFILL }}, { &hf_s1ap_SRVCCOperationPossible_PDU, { "SRVCCOperationPossible", "s1ap.SRVCCOperationPossible", FT_UINT32, BASE_DEC, VALS(s1ap_SRVCCOperationPossible_vals), 0, NULL, HFILL }}, { &hf_s1ap_SRVCCHOIndication_PDU, { "SRVCCHOIndication", "s1ap.SRVCCHOIndication", FT_UINT32, BASE_DEC, VALS(s1ap_SRVCCHOIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_SourceNodeID_PDU, { "SourceNodeID", "s1ap.SourceNodeID", FT_UINT32, BASE_DEC, VALS(s1ap_SourceNodeID_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU, { "SourceeNB-ToTargeteNB-TransparentContainer", "s1ap.SourceeNB_ToTargeteNB_TransparentContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServedGUMMEIs_PDU, { "ServedGUMMEIs", "s1ap.ServedGUMMEIs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServedPLMNs_PDU, { "ServedPLMNs", "s1ap.ServedPLMNs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SubscriberProfileIDforRFP_PDU, { "SubscriberProfileIDforRFP", "s1ap.SubscriberProfileIDforRFP", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Subscription_Based_UE_DifferentiationInfo_PDU, { "Subscription-Based-UE-DifferentiationInfo", "s1ap.Subscription_Based_UE_DifferentiationInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SupportedTAs_PDU, { "SupportedTAs", "s1ap.SupportedTAs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TimeSynchronisationInfo_PDU, { "TimeSynchronisationInfo", "s1ap.TimeSynchronisationInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_S_TMSI_PDU, { "S-TMSI", "s1ap.S_TMSI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAI_PDU, { "TAI", "s1ap.TAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TargetID_PDU, { "TargetID", "s1ap.TargetID", FT_UINT32, BASE_DEC, VALS(s1ap_TargetID_vals), 0, NULL, HFILL }}, { &hf_s1ap_Global_RAN_NODE_ID_PDU, { "Global-RAN-NODE-ID", "s1ap.Global_RAN_NODE_ID", FT_UINT32, BASE_DEC, VALS(s1ap_Global_RAN_NODE_ID_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU, { "TargeteNB-ToSourceeNB-TransparentContainer", "s1ap.TargeteNB_ToSourceeNB_TransparentContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Target_ToSource_TransparentContainer_PDU, { "Target-ToSource-TransparentContainer", "s1ap.Target_ToSource_TransparentContainer", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TimeToWait_PDU, { "TimeToWait", "s1ap.TimeToWait", FT_UINT32, BASE_DEC, VALS(s1ap_TimeToWait_vals), 0, NULL, HFILL }}, { &hf_s1ap_Time_UE_StayedInCell_EnhancedGranularity_PDU, { "Time-UE-StayedInCell-EnhancedGranularity", "s1ap.Time_UE_StayedInCell_EnhancedGranularity", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_Time_UE_StayedInCell_EnhancedGranularity_fmt), 0, NULL, HFILL }}, { &hf_s1ap_TimeSinceSecondaryNodeRelease_PDU, { "TimeSinceSecondaryNodeRelease", "s1ap.TimeSinceSecondaryNodeRelease", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_s1ap_TransportInformation_PDU, { "TransportInformation", "s1ap.TransportInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TransportLayerAddress_PDU, { "TransportLayerAddress", "s1ap.TransportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TraceActivation_PDU, { "TraceActivation", "s1ap.TraceActivation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_UTRAN_Trace_ID_PDU, { "E-UTRAN-Trace-ID", "s1ap.E_UTRAN_Trace_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TrafficLoadReductionIndication_PDU, { "TrafficLoadReductionIndication", "s1ap.TrafficLoadReductionIndication", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0, NULL, HFILL }}, { &hf_s1ap_TunnelInformation_PDU, { "TunnelInformation", "s1ap.TunnelInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIListForRestart_PDU, { "TAIListForRestart", "s1ap.TAIListForRestart", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEAggregateMaximumBitrate_PDU, { "UEAggregateMaximumBitrate", "s1ap.UEAggregateMaximumBitrate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEAppLayerMeasConfig_PDU, { "UEAppLayerMeasConfig", "s1ap.UEAppLayerMeasConfig_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UECapabilityInfoRequest_PDU, { "UECapabilityInfoRequest", "s1ap.UECapabilityInfoRequest", FT_UINT32, BASE_DEC, VALS(s1ap_UECapabilityInfoRequest_vals), 0, NULL, HFILL }}, { &hf_s1ap_UE_RetentionInformation_PDU, { "UE-RetentionInformation", "s1ap.UE_RetentionInformation", FT_UINT32, BASE_DEC, VALS(s1ap_UE_RetentionInformation_vals), 0, NULL, HFILL }}, { &hf_s1ap_UE_S1AP_IDs_PDU, { "UE-S1AP-IDs", "s1ap.UE_S1AP_IDs", FT_UINT32, BASE_DEC, VALS(s1ap_UE_S1AP_IDs_vals), 0, NULL, HFILL }}, { &hf_s1ap_UE_associatedLogicalS1_ConnectionItem_PDU, { "UE-associatedLogicalS1-ConnectionItem", "s1ap.UE_associatedLogicalS1_ConnectionItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEIdentityIndexValue_PDU, { "UEIdentityIndexValue", "s1ap.UEIdentityIndexValue", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1ap_UE_HistoryInformation_PDU, { "UE-HistoryInformation", "s1ap.UE_HistoryInformation", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UE_HistoryInformationFromTheUE_PDU, { "UE-HistoryInformationFromTheUE", "s1ap.UE_HistoryInformationFromTheUE", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEPagingID_PDU, { "UEPagingID", "s1ap.UEPagingID", FT_UINT32, BASE_DEC, VALS(s1ap_UEPagingID_vals), 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapability_PDU, { "UERadioCapability", "s1ap.UERadioCapability", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapabilityForPaging_PDU, { "UERadioCapabilityForPaging", "s1ap.UERadioCapabilityForPaging", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapabilityID_PDU, { "UERadioCapabilityID", "s1ap.UERadioCapabilityID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UESecurityCapabilities_PDU, { "UESecurityCapabilities", "s1ap.UESecurityCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UESidelinkAggregateMaximumBitrate_PDU, { "UESidelinkAggregateMaximumBitrate", "s1ap.UESidelinkAggregateMaximumBitrate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UE_Usage_Type_PDU, { "UE-Usage-Type", "s1ap.UE_Usage_Type", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UL_CP_SecurityInformation_PDU, { "UL-CP-SecurityInformation", "s1ap.UL_CP_SecurityInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UnlicensedSpectrumRestriction_PDU, { "UnlicensedSpectrumRestriction", "s1ap.UnlicensedSpectrumRestriction", FT_UINT32, BASE_DEC, VALS(s1ap_UnlicensedSpectrumRestriction_vals), 0, NULL, HFILL }}, { &hf_s1ap_URI_Address_PDU, { "URI-Address", "s1ap.URI_Address", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UserLocationInformation_PDU, { "UserLocationInformation", "s1ap.UserLocationInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEUserPlaneCIoTSupportIndicator_PDU, { "UEUserPlaneCIoTSupportIndicator", "s1ap.UEUserPlaneCIoTSupportIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_UEUserPlaneCIoTSupportIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_UE_Application_Layer_Measurement_Capability_PDU, { "UE-Application-Layer-Measurement-Capability", "s1ap.UE_Application_Layer_Measurement_Capability", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_VoiceSupportMatchIndicator_PDU, { "VoiceSupportMatchIndicator", "s1ap.VoiceSupportMatchIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_VoiceSupportMatchIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_V2XServicesAuthorized_PDU, { "V2XServicesAuthorized", "s1ap.V2XServicesAuthorized_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WarningAreaCoordinates_PDU, { "WarningAreaCoordinates", "s1ap.WarningAreaCoordinates", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WarningAreaList_PDU, { "WarningAreaList", "s1ap.WarningAreaList", FT_UINT32, BASE_DEC, VALS(s1ap_WarningAreaList_vals), 0, NULL, HFILL }}, { &hf_s1ap_WarningType_PDU, { "WarningType", "s1ap.WarningType", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WarningSecurityInfo_PDU, { "WarningSecurityInfo", "s1ap.WarningSecurityInfo", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WarningMessageContents_PDU, { "WarningMessageContents", "s1ap.WarningMessageContents", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WLANMeasurementConfiguration_PDU, { "WLANMeasurementConfiguration", "s1ap.WLANMeasurementConfiguration_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WUS_Assistance_Information_PDU, { "WUS-Assistance-Information", "s1ap.WUS_Assistance_Information_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_X2TNLConfigurationInfo_PDU, { "X2TNLConfigurationInfo", "s1ap.X2TNLConfigurationInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBX2ExtTLAs_PDU, { "ENBX2ExtTLAs", "s1ap.ENBX2ExtTLAs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBIndirectX2TransportLayerAddresses_PDU, { "ENBIndirectX2TransportLayerAddresses", "s1ap.ENBIndirectX2TransportLayerAddresses", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverRequired_PDU, { "HandoverRequired", "s1ap.HandoverRequired_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverCommand_PDU, { "HandoverCommand", "s1ap.HandoverCommand_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSubjecttoDataForwardingList_PDU, { "E-RABSubjecttoDataForwardingList", "s1ap.E_RABSubjecttoDataForwardingList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABDataForwardingItem_PDU, { "E-RABDataForwardingItem", "s1ap.E_RABDataForwardingItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverPreparationFailure_PDU, { "HandoverPreparationFailure", "s1ap.HandoverPreparationFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverRequest_PDU, { "HandoverRequest", "s1ap.HandoverRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupListHOReq_PDU, { "E-RABToBeSetupListHOReq", "s1ap.E_RABToBeSetupListHOReq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupItemHOReq_PDU, { "E-RABToBeSetupItemHOReq", "s1ap.E_RABToBeSetupItemHOReq_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverRequestAcknowledge_PDU, { "HandoverRequestAcknowledge", "s1ap.HandoverRequestAcknowledge_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABAdmittedList_PDU, { "E-RABAdmittedList", "s1ap.E_RABAdmittedList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABAdmittedItem_PDU, { "E-RABAdmittedItem", "s1ap.E_RABAdmittedItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABFailedtoSetupListHOReqAck_PDU, { "E-RABFailedtoSetupListHOReqAck", "s1ap.E_RABFailedtoSetupListHOReqAck", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABFailedToSetupItemHOReqAck_PDU, { "E-RABFailedToSetupItemHOReqAck", "s1ap.E_RABFailedToSetupItemHOReqAck_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverFailure_PDU, { "HandoverFailure", "s1ap.HandoverFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverNotify_PDU, { "HandoverNotify", "s1ap.HandoverNotify_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PathSwitchRequest_PDU, { "PathSwitchRequest", "s1ap.PathSwitchRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSwitchedDLList_PDU, { "E-RABToBeSwitchedDLList", "s1ap.E_RABToBeSwitchedDLList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSwitchedDLItem_PDU, { "E-RABToBeSwitchedDLItem", "s1ap.E_RABToBeSwitchedDLItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PathSwitchRequestAcknowledge_PDU, { "PathSwitchRequestAcknowledge", "s1ap.PathSwitchRequestAcknowledge_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSwitchedULList_PDU, { "E-RABToBeSwitchedULList", "s1ap.E_RABToBeSwitchedULList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSwitchedULItem_PDU, { "E-RABToBeSwitchedULItem", "s1ap.E_RABToBeSwitchedULItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeUpdatedList_PDU, { "E-RABToBeUpdatedList", "s1ap.E_RABToBeUpdatedList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeUpdatedItem_PDU, { "E-RABToBeUpdatedItem", "s1ap.E_RABToBeUpdatedItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PathSwitchRequestFailure_PDU, { "PathSwitchRequestFailure", "s1ap.PathSwitchRequestFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverCancel_PDU, { "HandoverCancel", "s1ap.HandoverCancel_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverCancelAcknowledge_PDU, { "HandoverCancelAcknowledge", "s1ap.HandoverCancelAcknowledge_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_HandoverSuccess_PDU, { "HandoverSuccess", "s1ap.HandoverSuccess_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBEarlyStatusTransfer_PDU, { "ENBEarlyStatusTransfer", "s1ap.ENBEarlyStatusTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEEarlyStatusTransfer_PDU, { "MMEEarlyStatusTransfer", "s1ap.MMEEarlyStatusTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupRequest_PDU, { "E-RABSetupRequest", "s1ap.E_RABSetupRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupListBearerSUReq_PDU, { "E-RABToBeSetupListBearerSUReq", "s1ap.E_RABToBeSetupListBearerSUReq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupItemBearerSUReq_PDU, { "E-RABToBeSetupItemBearerSUReq", "s1ap.E_RABToBeSetupItemBearerSUReq_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupResponse_PDU, { "E-RABSetupResponse", "s1ap.E_RABSetupResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupListBearerSURes_PDU, { "E-RABSetupListBearerSURes", "s1ap.E_RABSetupListBearerSURes", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupItemBearerSURes_PDU, { "E-RABSetupItemBearerSURes", "s1ap.E_RABSetupItemBearerSURes_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyRequest_PDU, { "E-RABModifyRequest", "s1ap.E_RABModifyRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeModifiedListBearerModReq_PDU, { "E-RABToBeModifiedListBearerModReq", "s1ap.E_RABToBeModifiedListBearerModReq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeModifiedItemBearerModReq_PDU, { "E-RABToBeModifiedItemBearerModReq", "s1ap.E_RABToBeModifiedItemBearerModReq_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyResponse_PDU, { "E-RABModifyResponse", "s1ap.E_RABModifyResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyListBearerModRes_PDU, { "E-RABModifyListBearerModRes", "s1ap.E_RABModifyListBearerModRes", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyItemBearerModRes_PDU, { "E-RABModifyItemBearerModRes", "s1ap.E_RABModifyItemBearerModRes_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABReleaseCommand_PDU, { "E-RABReleaseCommand", "s1ap.E_RABReleaseCommand_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABReleaseResponse_PDU, { "E-RABReleaseResponse", "s1ap.E_RABReleaseResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABReleaseListBearerRelComp_PDU, { "E-RABReleaseListBearerRelComp", "s1ap.E_RABReleaseListBearerRelComp", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABReleaseItemBearerRelComp_PDU, { "E-RABReleaseItemBearerRelComp", "s1ap.E_RABReleaseItemBearerRelComp_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABReleaseIndication_PDU, { "E-RABReleaseIndication", "s1ap.E_RABReleaseIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_InitialContextSetupRequest_PDU, { "InitialContextSetupRequest", "s1ap.InitialContextSetupRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupListCtxtSUReq_PDU, { "E-RABToBeSetupListCtxtSUReq", "s1ap.E_RABToBeSetupListCtxtSUReq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupItemCtxtSUReq_PDU, { "E-RABToBeSetupItemCtxtSUReq", "s1ap.E_RABToBeSetupItemCtxtSUReq_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_InitialContextSetupResponse_PDU, { "InitialContextSetupResponse", "s1ap.InitialContextSetupResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupListCtxtSURes_PDU, { "E-RABSetupListCtxtSURes", "s1ap.E_RABSetupListCtxtSURes", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupItemCtxtSURes_PDU, { "E-RABSetupItemCtxtSURes", "s1ap.E_RABSetupItemCtxtSURes_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_InitialContextSetupFailure_PDU, { "InitialContextSetupFailure", "s1ap.InitialContextSetupFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Paging_PDU, { "Paging", "s1ap.Paging_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIList_PDU, { "TAIList", "s1ap.TAIList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIItem_PDU, { "TAIItem", "s1ap.TAIItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextReleaseRequest_PDU, { "UEContextReleaseRequest", "s1ap.UEContextReleaseRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextReleaseCommand_PDU, { "UEContextReleaseCommand", "s1ap.UEContextReleaseCommand_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextReleaseComplete_PDU, { "UEContextReleaseComplete", "s1ap.UEContextReleaseComplete_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextModificationRequest_PDU, { "UEContextModificationRequest", "s1ap.UEContextModificationRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextModificationResponse_PDU, { "UEContextModificationResponse", "s1ap.UEContextModificationResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextModificationFailure_PDU, { "UEContextModificationFailure", "s1ap.UEContextModificationFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapabilityMatchRequest_PDU, { "UERadioCapabilityMatchRequest", "s1ap.UERadioCapabilityMatchRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapabilityMatchResponse_PDU, { "UERadioCapabilityMatchResponse", "s1ap.UERadioCapabilityMatchResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DownlinkNASTransport_PDU, { "DownlinkNASTransport", "s1ap.DownlinkNASTransport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_InitialUEMessage_PDU, { "InitialUEMessage", "s1ap.InitialUEMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UplinkNASTransport_PDU, { "UplinkNASTransport", "s1ap.UplinkNASTransport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NASNonDeliveryIndication_PDU, { "NASNonDeliveryIndication", "s1ap.NASNonDeliveryIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RerouteNASRequest_PDU, { "RerouteNASRequest", "s1ap.RerouteNASRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_S1_Message_PDU, { "S1-Message", "s1ap.S1_Message", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NASDeliveryIndication_PDU, { "NASDeliveryIndication", "s1ap.NASDeliveryIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Reset_PDU, { "Reset", "s1ap.Reset_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ResetType_PDU, { "ResetType", "s1ap.ResetType", FT_UINT32, BASE_DEC, VALS(s1ap_ResetType_vals), 0, NULL, HFILL }}, { &hf_s1ap_ResetAcknowledge_PDU, { "ResetAcknowledge", "s1ap.ResetAcknowledge_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UE_associatedLogicalS1_ConnectionListResAck_PDU, { "UE-associatedLogicalS1-ConnectionListResAck", "s1ap.UE_associatedLogicalS1_ConnectionListResAck", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ErrorIndication_PDU, { "ErrorIndication", "s1ap.ErrorIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_S1SetupRequest_PDU, { "S1SetupRequest", "s1ap.S1SetupRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_S1SetupResponse_PDU, { "S1SetupResponse", "s1ap.S1SetupResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_S1SetupFailure_PDU, { "S1SetupFailure", "s1ap.S1SetupFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBConfigurationUpdate_PDU, { "ENBConfigurationUpdate", "s1ap.ENBConfigurationUpdate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBConfigurationUpdateAcknowledge_PDU, { "ENBConfigurationUpdateAcknowledge", "s1ap.ENBConfigurationUpdateAcknowledge_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBConfigurationUpdateFailure_PDU, { "ENBConfigurationUpdateFailure", "s1ap.ENBConfigurationUpdateFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEConfigurationUpdate_PDU, { "MMEConfigurationUpdate", "s1ap.MMEConfigurationUpdate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEConfigurationUpdateAcknowledge_PDU, { "MMEConfigurationUpdateAcknowledge", "s1ap.MMEConfigurationUpdateAcknowledge_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEConfigurationUpdateFailure_PDU, { "MMEConfigurationUpdateFailure", "s1ap.MMEConfigurationUpdateFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DownlinkS1cdma2000tunnelling_PDU, { "DownlinkS1cdma2000tunnelling", "s1ap.DownlinkS1cdma2000tunnelling_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UplinkS1cdma2000tunnelling_PDU, { "UplinkS1cdma2000tunnelling", "s1ap.UplinkS1cdma2000tunnelling_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UECapabilityInfoIndication_PDU, { "UECapabilityInfoIndication", "s1ap.UECapabilityInfoIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBStatusTransfer_PDU, { "ENBStatusTransfer", "s1ap.ENBStatusTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEStatusTransfer_PDU, { "MMEStatusTransfer", "s1ap.MMEStatusTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TraceStart_PDU, { "TraceStart", "s1ap.TraceStart_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TraceFailureIndication_PDU, { "TraceFailureIndication", "s1ap.TraceFailureIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DeactivateTrace_PDU, { "DeactivateTrace", "s1ap.DeactivateTrace_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CellTrafficTrace_PDU, { "CellTrafficTrace", "s1ap.CellTrafficTrace_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LocationReportingControl_PDU, { "LocationReportingControl", "s1ap.LocationReportingControl_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LocationReportingFailureIndication_PDU, { "LocationReportingFailureIndication", "s1ap.LocationReportingFailureIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_LocationReport_PDU, { "LocationReport", "s1ap.LocationReport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_OverloadStart_PDU, { "OverloadStart", "s1ap.OverloadStart_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_OverloadStop_PDU, { "OverloadStop", "s1ap.OverloadStop_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WriteReplaceWarningRequest_PDU, { "WriteReplaceWarningRequest", "s1ap.WriteReplaceWarningRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_WriteReplaceWarningResponse_PDU, { "WriteReplaceWarningResponse", "s1ap.WriteReplaceWarningResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBDirectInformationTransfer_PDU, { "ENBDirectInformationTransfer", "s1ap.ENBDirectInformationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Inter_SystemInformationTransferType_PDU, { "Inter-SystemInformationTransferType", "s1ap.Inter_SystemInformationTransferType", FT_UINT32, BASE_DEC, VALS(s1ap_Inter_SystemInformationTransferType_vals), 0, NULL, HFILL }}, { &hf_s1ap_MMEDirectInformationTransfer_PDU, { "MMEDirectInformationTransfer", "s1ap.MMEDirectInformationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBConfigurationTransfer_PDU, { "ENBConfigurationTransfer", "s1ap.ENBConfigurationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMEConfigurationTransfer_PDU, { "MMEConfigurationTransfer", "s1ap.MMEConfigurationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PrivateMessage_PDU, { "PrivateMessage", "s1ap.PrivateMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_KillRequest_PDU, { "KillRequest", "s1ap.KillRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_KillResponse_PDU, { "KillResponse", "s1ap.KillResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PWSRestartIndication_PDU, { "PWSRestartIndication", "s1ap.PWSRestartIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PWSFailureIndication_PDU, { "PWSFailureIndication", "s1ap.PWSFailureIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DownlinkUEAssociatedLPPaTransport_PDU, { "DownlinkUEAssociatedLPPaTransport", "s1ap.DownlinkUEAssociatedLPPaTransport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UplinkUEAssociatedLPPaTransport_PDU, { "UplinkUEAssociatedLPPaTransport", "s1ap.UplinkUEAssociatedLPPaTransport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_DownlinkNonUEAssociatedLPPaTransport_PDU, { "DownlinkNonUEAssociatedLPPaTransport", "s1ap.DownlinkNonUEAssociatedLPPaTransport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UplinkNonUEAssociatedLPPaTransport_PDU, { "UplinkNonUEAssociatedLPPaTransport", "s1ap.UplinkNonUEAssociatedLPPaTransport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModificationIndication_PDU, { "E-RABModificationIndication", "s1ap.E_RABModificationIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeModifiedListBearerModInd_PDU, { "E-RABToBeModifiedListBearerModInd", "s1ap.E_RABToBeModifiedListBearerModInd", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeModifiedItemBearerModInd_PDU, { "E-RABToBeModifiedItemBearerModInd", "s1ap.E_RABToBeModifiedItemBearerModInd_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABNotToBeModifiedListBearerModInd_PDU, { "E-RABNotToBeModifiedListBearerModInd", "s1ap.E_RABNotToBeModifiedListBearerModInd", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABNotToBeModifiedItemBearerModInd_PDU, { "E-RABNotToBeModifiedItemBearerModInd", "s1ap.E_RABNotToBeModifiedItemBearerModInd_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CSGMembershipInfo_PDU, { "CSGMembershipInfo", "s1ap.CSGMembershipInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModificationConfirm_PDU, { "E-RABModificationConfirm", "s1ap.E_RABModificationConfirm_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyListBearerModConf_PDU, { "E-RABModifyListBearerModConf", "s1ap.E_RABModifyListBearerModConf", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyItemBearerModConf_PDU, { "E-RABModifyItemBearerModConf", "s1ap.E_RABModifyItemBearerModConf_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextModificationIndication_PDU, { "UEContextModificationIndication", "s1ap.UEContextModificationIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextModificationConfirm_PDU, { "UEContextModificationConfirm", "s1ap.UEContextModificationConfirm_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextSuspendRequest_PDU, { "UEContextSuspendRequest", "s1ap.UEContextSuspendRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextSuspendResponse_PDU, { "UEContextSuspendResponse", "s1ap.UEContextSuspendResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextResumeRequest_PDU, { "UEContextResumeRequest", "s1ap.UEContextResumeRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABFailedToResumeListResumeReq_PDU, { "E-RABFailedToResumeListResumeReq", "s1ap.E_RABFailedToResumeListResumeReq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABFailedToResumeItemResumeReq_PDU, { "E-RABFailedToResumeItemResumeReq", "s1ap.E_RABFailedToResumeItemResumeReq_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextResumeResponse_PDU, { "UEContextResumeResponse", "s1ap.UEContextResumeResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABFailedToResumeListResumeRes_PDU, { "E-RABFailedToResumeListResumeRes", "s1ap.E_RABFailedToResumeListResumeRes", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABFailedToResumeItemResumeRes_PDU, { "E-RABFailedToResumeItemResumeRes", "s1ap.E_RABFailedToResumeItemResumeRes_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEContextResumeFailure_PDU, { "UEContextResumeFailure", "s1ap.UEContextResumeFailure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ConnectionEstablishmentIndication_PDU, { "ConnectionEstablishmentIndication", "s1ap.ConnectionEstablishmentIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RetrieveUEInformation_PDU, { "RetrieveUEInformation", "s1ap.RetrieveUEInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UEInformationTransfer_PDU, { "UEInformationTransfer", "s1ap.UEInformationTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBCPRelocationIndication_PDU, { "ENBCPRelocationIndication", "s1ap.ENBCPRelocationIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MMECPRelocationIndication_PDU, { "MMECPRelocationIndication", "s1ap.MMECPRelocationIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_SecondaryRATDataUsageReport_PDU, { "SecondaryRATDataUsageReport", "s1ap.SecondaryRATDataUsageReport_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapabilityIDMappingRequest_PDU, { "UERadioCapabilityIDMappingRequest", "s1ap.UERadioCapabilityIDMappingRequest_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UERadioCapabilityIDMappingResponse_PDU, { "UERadioCapabilityIDMappingResponse", "s1ap.UERadioCapabilityIDMappingResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_S1AP_PDU_PDU, { "S1AP-PDU", "s1ap.S1AP_PDU", FT_UINT32, BASE_DEC, VALS(s1ap_S1AP_PDU_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_SONtransferApplicationIdentity_PDU, { "SONtransferApplicationIdentity", "s1ap.SONtransferApplicationIdentity", FT_UINT32, BASE_DEC, VALS(s1ap_SONtransferApplicationIdentity_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_SONtransferRequestContainer_PDU, { "SONtransferRequestContainer", "s1ap.SONtransferRequestContainer", FT_UINT32, BASE_DEC, VALS(s1ap_SONtransferRequestContainer_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_SONtransferResponseContainer_PDU, { "SONtransferResponseContainer", "s1ap.SONtransferResponseContainer", FT_UINT32, BASE_DEC, VALS(s1ap_SONtransferResponseContainer_vals), 0, NULL, HFILL }}, { &hf_s1ap_s1ap_SONtransferCause_PDU, { "SONtransferCause", "s1ap.SONtransferCause", FT_UINT32, BASE_DEC, VALS(s1ap_SONtransferCause_vals), 0, NULL, HFILL }}, { &hf_s1ap_local, { "local", "s1ap.local", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_s1ap_global, { "global", "s1ap.global", FT_OID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ProtocolIE_Container_item, { "ProtocolIE-Field", "s1ap.ProtocolIE_Field_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_id, { "id", "s1ap.id", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &s1ap_ProtocolIE_ID_vals_ext, 0, "ProtocolIE_ID", HFILL }}, { &hf_s1ap_criticality, { "criticality", "s1ap.criticality", FT_UINT32, BASE_DEC, VALS(s1ap_Criticality_vals), 0, NULL, HFILL }}, { &hf_s1ap_ie_field_value, { "value", "s1ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "T_ie_field_value", HFILL }}, { &hf_s1ap_ProtocolIE_ContainerList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ProtocolExtensionContainer_item, { "ProtocolExtensionField", "s1ap.ProtocolExtensionField_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ext_id, { "id", "s1ap.id", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &s1ap_ProtocolIE_ID_vals_ext, 0, "ProtocolExtensionID", HFILL }}, { &hf_s1ap_extensionValue, { "extensionValue", "s1ap.extensionValue_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PrivateIE_Container_item, { "PrivateIE-Field", "s1ap.PrivateIE_Field_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_private_id, { "id", "s1ap.id", FT_UINT32, BASE_DEC, VALS(s1ap_PrivateIE_ID_vals), 0, "PrivateIE_ID", HFILL }}, { &hf_s1ap_value, { "value", "s1ap.value_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_gUMMEI, { "gUMMEI", "s1ap.gUMMEI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_m_TMSI, { "m-TMSI", "s1ap.m_TMSI", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_iE_Extensions, { "iE-Extensions", "s1ap.iE_Extensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_s1ap_cellBased, { "cellBased", "s1ap.cellBased_element", FT_NONE, BASE_NONE, NULL, 0, "CellBasedMDT", HFILL }}, { &hf_s1ap_tABased, { "tABased", "s1ap.tABased_element", FT_NONE, BASE_NONE, NULL, 0, "TABasedMDT", HFILL }}, { &hf_s1ap_pLMNWide, { "pLMNWide", "s1ap.pLMNWide_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAIBased, { "tAIBased", "s1ap.tAIBased_element", FT_NONE, BASE_NONE, NULL, 0, "TAIBasedMDT", HFILL }}, { &hf_s1ap_cellBased_01, { "cellBased", "s1ap.cellBased_element", FT_NONE, BASE_NONE, NULL, 0, "CellBasedQMC", HFILL }}, { &hf_s1ap_tABased_01, { "tABased", "s1ap.tABased_element", FT_NONE, BASE_NONE, NULL, 0, "TABasedQMC", HFILL }}, { &hf_s1ap_tAIBased_01, { "tAIBased", "s1ap.tAIBased_element", FT_NONE, BASE_NONE, NULL, 0, "TAIBasedQMC", HFILL }}, { &hf_s1ap_pLMNAreaBased, { "pLMNAreaBased", "s1ap.pLMNAreaBased_element", FT_NONE, BASE_NONE, NULL, 0, "PLMNAreaBasedQMC", HFILL }}, { &hf_s1ap_priorityLevel, { "priorityLevel", "s1ap.priorityLevel", FT_UINT32, BASE_DEC, VALS(s1ap_PriorityLevel_vals), 0, NULL, HFILL }}, { &hf_s1ap_pre_emptionCapability, { "pre-emptionCapability", "s1ap.pre_emptionCapability", FT_UINT32, BASE_DEC, VALS(s1ap_Pre_emptionCapability_vals), 0, NULL, HFILL }}, { &hf_s1ap_pre_emptionVulnerability, { "pre-emptionVulnerability", "s1ap.pre_emptionVulnerability", FT_UINT32, BASE_DEC, VALS(s1ap_Pre_emptionVulnerability_vals), 0, NULL, HFILL }}, { &hf_s1ap_cellIdentifierAndCELevelForCECapableUEs, { "cellIdentifierAndCELevelForCECapableUEs", "s1ap.cellIdentifierAndCELevelForCECapableUEs_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_assistanceDataForRecommendedCells, { "assistanceDataForRecommendedCells", "s1ap.assistanceDataForRecommendedCells_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_assistanceDataForCECapableUEs, { "assistanceDataForCECapableUEs", "s1ap.assistanceDataForCECapableUEs_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pagingAttemptInformation, { "pagingAttemptInformation", "s1ap.pagingAttemptInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_recommendedCellsForPaging, { "recommendedCellsForPaging", "s1ap.recommendedCellsForPaging_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Bearers_SubjectToStatusTransferList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_RAB_ID, { "e-RAB-ID", "s1ap.e_RAB_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uL_COUNTvalue, { "uL-COUNTvalue", "s1ap.uL_COUNTvalue_element", FT_NONE, BASE_NONE, NULL, 0, "COUNTvalue", HFILL }}, { &hf_s1ap_dL_COUNTvalue, { "dL-COUNTvalue", "s1ap.dL_COUNTvalue_element", FT_NONE, BASE_NONE, NULL, 0, "COUNTvalue", HFILL }}, { &hf_s1ap_receiveStatusofULPDCPSDUs, { "receiveStatusofULPDCPSDUs", "s1ap.receiveStatusofULPDCPSDUs", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_Bearers_SubjectToEarlyStatusTransferList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dLCOUNT_PDCP_SNlength, { "dLCOUNT-PDCP-SNlength", "s1ap.dLCOUNT_PDCP_SNlength", FT_UINT32, BASE_DEC, VALS(s1ap_DLCOUNT_PDCP_SNlength_vals), 0, NULL, HFILL }}, { &hf_s1ap_bluetoothMeasConfig, { "bluetoothMeasConfig", "s1ap.bluetoothMeasConfig", FT_UINT32, BASE_DEC, VALS(s1ap_BluetoothMeasConfig_vals), 0, NULL, HFILL }}, { &hf_s1ap_bluetoothMeasConfigNameList, { "bluetoothMeasConfigNameList", "s1ap.bluetoothMeasConfigNameList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_bt_rssi, { "bt-rssi", "s1ap.bt_rssi", FT_UINT32, BASE_DEC, VALS(s1ap_T_bt_rssi_vals), 0, "T_bt_rssi", HFILL }}, { &hf_s1ap_BluetoothMeasConfigNameList_item, { "BluetoothName", "s1ap.BluetoothName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_BPLMNs_item, { "PLMNidentity", "s1ap.PLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cellID_Cancelled, { "cellID-Cancelled", "s1ap.cellID_Cancelled", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAI_Cancelled, { "tAI-Cancelled", "s1ap.tAI_Cancelled", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_emergencyAreaID_Cancelled, { "emergencyAreaID-Cancelled", "s1ap.emergencyAreaID_Cancelled", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cellID_Broadcast, { "cellID-Broadcast", "s1ap.cellID_Broadcast", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAI_Broadcast, { "tAI-Broadcast", "s1ap.tAI_Broadcast", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_emergencyAreaID_Broadcast, { "emergencyAreaID-Broadcast", "s1ap.emergencyAreaID_Broadcast", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CancelledCellinEAI_item, { "CancelledCellinEAI-Item", "s1ap.CancelledCellinEAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eCGI, { "eCGI", "s1ap.eCGI_element", FT_NONE, BASE_NONE, NULL, 0, "EUTRAN_CGI", HFILL }}, { &hf_s1ap_numberOfBroadcasts, { "numberOfBroadcasts", "s1ap.numberOfBroadcasts", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CancelledCellinTAI_item, { "CancelledCellinTAI-Item", "s1ap.CancelledCellinTAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_radioNetwork, { "radioNetwork", "s1ap.radioNetwork", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &s1ap_CauseRadioNetwork_vals_ext, 0, "CauseRadioNetwork", HFILL }}, { &hf_s1ap_transport, { "transport", "s1ap.transport", FT_UINT32, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0, "CauseTransport", HFILL }}, { &hf_s1ap_nas, { "nas", "s1ap.nas", FT_UINT32, BASE_DEC, VALS(s1ap_CauseNas_vals), 0, "CauseNas", HFILL }}, { &hf_s1ap_protocol, { "protocol", "s1ap.protocol", FT_UINT32, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0, "CauseProtocol", HFILL }}, { &hf_s1ap_misc, { "misc", "s1ap.misc", FT_UINT32, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0, "CauseMisc", HFILL }}, { &hf_s1ap_global_Cell_ID, { "global-Cell-ID", "s1ap.global_Cell_ID_element", FT_NONE, BASE_NONE, NULL, 0, "EUTRAN_CGI", HFILL }}, { &hf_s1ap_cELevel, { "cELevel", "s1ap.cELevel", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CellID_Broadcast_item, { "CellID-Broadcast-Item", "s1ap.CellID_Broadcast_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CellID_Cancelled_item, { "CellID-Cancelled-Item", "s1ap.CellID_Cancelled_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cellIdListforMDT, { "cellIdListforMDT", "s1ap.cellIdListforMDT", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CellIdListforMDT_item, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cellIdListforQMC, { "cellIdListforQMC", "s1ap.cellIdListforQMC", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CellIdListforQMC_item, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cdma2000OneXMEID, { "cdma2000OneXMEID", "s1ap.cdma2000OneXMEID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cdma2000OneXMSI, { "cdma2000OneXMSI", "s1ap.cdma2000OneXMSI", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cdma2000OneXPilot, { "cdma2000OneXPilot", "s1ap.cdma2000OneXPilot", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cell_Size, { "cell-Size", "s1ap.cell_Size", FT_UINT32, BASE_DEC, VALS(s1ap_Cell_Size_vals), 0, NULL, HFILL }}, { &hf_s1ap_pLMNidentity, { "pLMNidentity", "s1ap.pLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_lAC, { "lAC", "s1ap.lAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cI, { "cI", "s1ap.cI", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_rAC, { "rAC", "s1ap.rAC", FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CNTypeRestrictions_item, { "CNTypeRestrictions-Item", "s1ap.CNTypeRestrictions_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pLMN_Identity, { "pLMN-Identity", "s1ap.pLMN_Identity", FT_BYTES, BASE_NONE, NULL, 0, "PLMNidentity", HFILL }}, { &hf_s1ap_cNType, { "cNType", "s1ap.cNType", FT_UINT32, BASE_DEC, VALS(s1ap_CNType_vals), 0, NULL, HFILL }}, { &hf_s1ap_ConnectedengNBList_item, { "ConnectedengNBItem", "s1ap.ConnectedengNBItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_en_gNB_ID, { "en-gNB-ID", "s1ap.en_gNB_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_supportedTAs, { "supportedTAs", "s1ap.supportedTAs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sourceNG_RAN_node_ID, { "sourceNG-RAN-node-ID", "s1ap.sourceNG_RAN_node_ID", FT_UINT32, BASE_DEC, VALS(s1ap_Global_RAN_NODE_ID_vals), 0, "Global_RAN_NODE_ID", HFILL }}, { &hf_s1ap_rAN_UE_NGAP_ID, { "rAN-UE-NGAP-ID", "s1ap.rAN_UE_NGAP_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CSG_IdList_item, { "CSG-IdList-Item", "s1ap.CSG_IdList_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cSG_Id, { "cSG-Id", "s1ap.cSG_Id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pDCP_SN, { "pDCP-SN", "s1ap.pDCP_SN", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_hFN, { "hFN", "s1ap.hFN", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pDCP_SNExtended, { "pDCP-SNExtended", "s1ap.pDCP_SNExtended", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_hFNModified, { "hFNModified", "s1ap.hFNModified", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pDCP_SNlength18, { "pDCP-SNlength18", "s1ap.pDCP_SNlength18", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_hFNforPDCP_SNlength18, { "hFNforPDCP-SNlength18", "s1ap.hFNforPDCP_SNlength18", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_procedureCode, { "procedureCode", "s1ap.procedureCode", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &s1ap_ProcedureCode_vals_ext, 0, NULL, HFILL }}, { &hf_s1ap_triggeringMessage, { "triggeringMessage", "s1ap.triggeringMessage", FT_UINT32, BASE_DEC, VALS(s1ap_TriggeringMessage_vals), 0, NULL, HFILL }}, { &hf_s1ap_procedureCriticality, { "procedureCriticality", "s1ap.procedureCriticality", FT_UINT32, BASE_DEC, VALS(s1ap_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_s1ap_iEsCriticalityDiagnostics, { "iEsCriticalityDiagnostics", "s1ap.iEsCriticalityDiagnostics", FT_UINT32, BASE_DEC, NULL, 0, "CriticalityDiagnostics_IE_List", HFILL }}, { &hf_s1ap_CriticalityDiagnostics_IE_List_item, { "CriticalityDiagnostics-IE-Item", "s1ap.CriticalityDiagnostics_IE_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_iECriticality, { "iECriticality", "s1ap.iECriticality", FT_UINT32, BASE_DEC, VALS(s1ap_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_s1ap_iE_ID, { "iE-ID", "s1ap.iE_ID", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &s1ap_ProtocolIE_ID_vals_ext, 0, "ProtocolIE_ID", HFILL }}, { &hf_s1ap_typeOfError, { "typeOfError", "s1ap.typeOfError", FT_UINT32, BASE_DEC, VALS(s1ap_TypeOfError_vals), 0, NULL, HFILL }}, { &hf_s1ap_dAPSIndicator, { "dAPSIndicator", "s1ap.dAPSIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_T_dAPSIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_DAPSResponseInfoList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dAPSResponseInfo, { "dAPSResponseInfo", "s1ap.dAPSResponseInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dapsresponseindicator, { "dapsresponseindicator", "s1ap.dapsresponseindicator", FT_UINT32, BASE_DEC, VALS(s1ap_T_dapsresponseindicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_ServedDCNs_item, { "ServedDCNsItem", "s1ap.ServedDCNsItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dCN_ID, { "dCN-ID", "s1ap.dCN_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_relativeDCNCapacity, { "relativeDCNCapacity", "s1ap.relativeDCNCapacity", FT_UINT32, BASE_DEC, NULL, 0, "RelativeMMECapacity", HFILL }}, { &hf_s1ap_dl_NAS_MAC, { "dl-NAS-MAC", "s1ap.dl_NAS_MAC", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dLCOUNTValuePDCP_SNlength12, { "dLCOUNTValuePDCP-SNlength12", "s1ap.dLCOUNTValuePDCP_SNlength12_element", FT_NONE, BASE_NONE, NULL, 0, "COUNTvalue", HFILL }}, { &hf_s1ap_dLCOUNTValuePDCP_SNlength15, { "dLCOUNTValuePDCP-SNlength15", "s1ap.dLCOUNTValuePDCP_SNlength15_element", FT_NONE, BASE_NONE, NULL, 0, "COUNTValueExtended", HFILL }}, { &hf_s1ap_dLCOUNTValuePDCP_SNlength18, { "dLCOUNTValuePDCP-SNlength18", "s1ap.dLCOUNTValuePDCP_SNlength18_element", FT_NONE, BASE_NONE, NULL, 0, "COUNTvaluePDCP_SNlength18", HFILL }}, { &hf_s1ap_ECGIList_item, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PWSfailedECGIList_item, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EmergencyAreaIDList_item, { "EmergencyAreaID", "s1ap.EmergencyAreaID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EmergencyAreaID_Broadcast_item, { "EmergencyAreaID-Broadcast-Item", "s1ap.EmergencyAreaID_Broadcast_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_emergencyAreaID, { "emergencyAreaID", "s1ap.emergencyAreaID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_completedCellinEAI, { "completedCellinEAI", "s1ap.completedCellinEAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EmergencyAreaID_Cancelled_item, { "EmergencyAreaID-Cancelled-Item", "s1ap.EmergencyAreaID_Cancelled_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cancelledCellinEAI, { "cancelledCellinEAI", "s1ap.cancelledCellinEAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CompletedCellinEAI_item, { "CompletedCellinEAI-Item", "s1ap.CompletedCellinEAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ECGI_List_item, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_EmergencyAreaIDListForRestart_item, { "EmergencyAreaID", "s1ap.EmergencyAreaID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_bearers_SubjectToEarlyStatusTransferList, { "bearers-SubjectToEarlyStatusTransferList", "s1ap.bearers_SubjectToEarlyStatusTransferList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_macroENB_ID, { "macroENB-ID", "s1ap.macroENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_20", HFILL }}, { &hf_s1ap_homeENB_ID, { "homeENB-ID", "s1ap.homeENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_28", HFILL }}, { &hf_s1ap_short_macroENB_ID, { "short-macroENB-ID", "s1ap.short_macroENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_18", HFILL }}, { &hf_s1ap_long_macroENB_ID, { "long-macroENB-ID", "s1ap.long_macroENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_21", HFILL }}, { &hf_s1ap_lAI, { "lAI", "s1ap.lAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eNB_ID, { "eNB-ID", "s1ap.eNB_ID", FT_UINT32, BASE_DEC, VALS(s1ap_ENB_ID_vals), 0, NULL, HFILL }}, { &hf_s1ap_GUMMEIList_item, { "GUMMEI", "s1ap.GUMMEI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_bearers_SubjectToStatusTransferList, { "bearers-SubjectToStatusTransferList", "s1ap.bearers_SubjectToStatusTransferList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBX2TLAs_item, { "TransportLayerAddress", "s1ap.TransportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_transfertype, { "transfertype", "s1ap.transfertype", FT_UINT32, BASE_DEC, VALS(s1ap_EN_DCSONTransferType_vals), 0, "EN_DCSONTransferType", HFILL }}, { &hf_s1ap_sONInformation, { "sONInformation", "s1ap.sONInformation", FT_UINT32, BASE_DEC, VALS(s1ap_SONInformation_vals), 0, NULL, HFILL }}, { &hf_s1ap_x2TNLConfigInfo, { "x2TNLConfigInfo", "s1ap.x2TNLConfigInfo_element", FT_NONE, BASE_NONE, NULL, 0, "X2TNLConfigurationInfo", HFILL }}, { &hf_s1ap_request, { "request", "s1ap.request_element", FT_NONE, BASE_NONE, NULL, 0, "EN_DCTransferTypeRequest", HFILL }}, { &hf_s1ap_reply, { "reply", "s1ap.reply_element", FT_NONE, BASE_NONE, NULL, 0, "EN_DCTransferTypeReply", HFILL }}, { &hf_s1ap_sourceeNB, { "sourceeNB", "s1ap.sourceeNB_element", FT_NONE, BASE_NONE, NULL, 0, "EN_DCSONeNBIdentification", HFILL }}, { &hf_s1ap_targetengNB, { "targetengNB", "s1ap.targetengNB_element", FT_NONE, BASE_NONE, NULL, 0, "EN_DCSONengNBIdentification", HFILL }}, { &hf_s1ap_targeteNB, { "targeteNB", "s1ap.targeteNB_element", FT_NONE, BASE_NONE, NULL, 0, "EN_DCSONeNBIdentification", HFILL }}, { &hf_s1ap_associatedTAI, { "associatedTAI", "s1ap.associatedTAI_element", FT_NONE, BASE_NONE, NULL, 0, "TAI", HFILL }}, { &hf_s1ap_broadcast5GSTAI, { "broadcast5GSTAI", "s1ap.broadcast5GSTAI_element", FT_NONE, BASE_NONE, NULL, 0, "FiveGSTAI", HFILL }}, { &hf_s1ap_sourceengNB, { "sourceengNB", "s1ap.sourceengNB_element", FT_NONE, BASE_NONE, NULL, 0, "EN_DCSONengNBIdentification", HFILL }}, { &hf_s1ap_globaleNBID, { "globaleNBID", "s1ap.globaleNBID_element", FT_NONE, BASE_NONE, NULL, 0, "Global_ENB_ID", HFILL }}, { &hf_s1ap_selectedTAI, { "selectedTAI", "s1ap.selectedTAI_element", FT_NONE, BASE_NONE, NULL, 0, "TAI", HFILL }}, { &hf_s1ap_globalengNBID, { "globalengNBID", "s1ap.globalengNBID_element", FT_NONE, BASE_NONE, NULL, 0, "Global_en_gNB_ID", HFILL }}, { &hf_s1ap_EPLMNs_item, { "PLMNidentity", "s1ap.PLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABInformationList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dL_Forwarding, { "dL-Forwarding", "s1ap.dL_Forwarding", FT_UINT32, BASE_DEC, VALS(s1ap_DL_Forwarding_vals), 0, NULL, HFILL }}, { &hf_s1ap_E_RABList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cause, { "cause", "s1ap.cause", FT_UINT32, BASE_DEC, VALS(s1ap_Cause_vals), 0, NULL, HFILL }}, { &hf_s1ap_qCI, { "qCI", "s1ap.qCI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_allocationRetentionPriority, { "allocationRetentionPriority", "s1ap.allocationRetentionPriority_element", FT_NONE, BASE_NONE, NULL, 0, "AllocationAndRetentionPriority", HFILL }}, { &hf_s1ap_gbrQosInformation, { "gbrQosInformation", "s1ap.gbrQosInformation_element", FT_NONE, BASE_NONE, NULL, 0, "GBR_QosInformation", HFILL }}, { &hf_s1ap_E_RABSecurityResultList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_securityResult, { "securityResult", "s1ap.securityResult_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABUsageReportList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_startTimestamp, { "startTimestamp", "s1ap.startTimestamp", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_endTimestamp, { "endTimestamp", "s1ap.endTimestamp", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_usageCountUL, { "usageCountUL", "s1ap.usageCountUL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_octet_octets, 0, "INTEGER_0_18446744073709551615", HFILL }}, { &hf_s1ap_usageCountDL, { "usageCountDL", "s1ap.usageCountDL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_octet_octets, 0, "INTEGER_0_18446744073709551615", HFILL }}, { &hf_s1ap_cell_ID, { "cell-ID", "s1ap.CellIdentity", FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0, "CellIdentity", HFILL }}, { &hf_s1ap_l1Threshold, { "l1Threshold", "s1ap.l1Threshold", FT_UINT32, BASE_DEC, VALS(s1ap_MeasurementThresholdL1LoggedMDT_vals), 0, "MeasurementThresholdL1LoggedMDT", HFILL }}, { &hf_s1ap_hysteresis, { "hysteresis", "s1ap.hysteresis", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_Hysteresis_fmt), 0, NULL, HFILL }}, { &hf_s1ap_timeToTrigger, { "timeToTrigger", "s1ap.timeToTrigger", FT_UINT32, BASE_DEC, VALS(s1ap_TimeToTrigger_vals), 0, NULL, HFILL }}, { &hf_s1ap_outOfCoverage, { "outOfCoverage", "s1ap.outOfCoverage", FT_UINT32, BASE_DEC, VALS(s1ap_T_outOfCoverage_vals), 0, NULL, HFILL }}, { &hf_s1ap_eventL1LoggedMDTConfig, { "eventL1LoggedMDTConfig", "s1ap.eventL1LoggedMDTConfig_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_choice_Extensions, { "choice-Extensions", "s1ap.choice_Extensions_element", FT_NONE, BASE_NONE, NULL, 0, "ProtocolIE_SingleContainer", HFILL }}, { &hf_s1ap_expectedActivity, { "expectedActivity", "s1ap.expectedActivity_element", FT_NONE, BASE_NONE, NULL, 0, "ExpectedUEActivityBehaviour", HFILL }}, { &hf_s1ap_expectedHOInterval, { "expectedHOInterval", "s1ap.expectedHOInterval", FT_UINT32, BASE_DEC, VALS(s1ap_ExpectedHOInterval_vals), 0, NULL, HFILL }}, { &hf_s1ap_expectedActivityPeriod, { "expectedActivityPeriod", "s1ap.expectedActivityPeriod", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_s1ap_expectedIdlePeriod, { "expectedIdlePeriod", "s1ap.expectedIdlePeriod", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_s1ap_sourceofUEActivityBehaviourInformation, { "sourceofUEActivityBehaviourInformation", "s1ap.sourceofUEActivityBehaviourInformation", FT_UINT32, BASE_DEC, VALS(s1ap_SourceOfUEActivityBehaviourInformation_vals), 0, NULL, HFILL }}, { &hf_s1ap_fiveGSTAC, { "fiveGSTAC", "s1ap.fiveGSTAC", FT_UINT24, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ForbiddenTAs_item, { "ForbiddenTAs-Item", "s1ap.ForbiddenTAs_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_forbiddenTACs, { "forbiddenTACs", "s1ap.forbiddenTACs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ForbiddenTACs_item, { "TAC", "s1ap.TAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ForbiddenLAs_item, { "ForbiddenLAs-Item", "s1ap.ForbiddenLAs_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_forbiddenLACs, { "forbiddenLACs", "s1ap.forbiddenLACs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ForbiddenLACs_item, { "LAC", "s1ap.LAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_RAB_MaximumBitrateDL, { "e-RAB-MaximumBitrateDL", "s1ap.e_RAB_MaximumBitrateDL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_e_RAB_MaximumBitrateUL, { "e-RAB-MaximumBitrateUL", "s1ap.e_RAB_MaximumBitrateUL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_e_RAB_GuaranteedBitrateDL, { "e-RAB-GuaranteedBitrateDL", "s1ap.e_RAB_GuaranteedBitrateDL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_e_RAB_GuaranteedBitrateUL, { "e-RAB-GuaranteedBitrateUL", "s1ap.e_RAB_GuaranteedBitrateUL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_mME_Group_ID, { "mME-Group-ID", "s1ap.mME_Group_ID", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_mME_Code, { "mME-Code", "s1ap.mME_Code", FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_servingPLMN, { "servingPLMN", "s1ap.servingPLMN", FT_BYTES, BASE_NONE, NULL, 0, "PLMNidentity", HFILL }}, { &hf_s1ap_equivalentPLMNs, { "equivalentPLMNs", "s1ap.equivalentPLMNs", FT_UINT32, BASE_DEC, NULL, 0, "EPLMNs", HFILL }}, { &hf_s1ap_forbiddenTAs, { "forbiddenTAs", "s1ap.forbiddenTAs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_forbiddenLAs, { "forbiddenLAs", "s1ap.forbiddenLAs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_forbiddenInterRATs, { "forbiddenInterRATs", "s1ap.forbiddenInterRATs", FT_UINT32, BASE_DEC, VALS(s1ap_ForbiddenInterRATs_vals), 0, NULL, HFILL }}, { &hf_s1ap_measurementsToActivate, { "measurementsToActivate", "s1ap.measurementsToActivate", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_m1reportingTrigger, { "m1reportingTrigger", "s1ap.m1reportingTrigger", FT_UINT32, BASE_DEC, VALS(s1ap_M1ReportingTrigger_vals), 0, NULL, HFILL }}, { &hf_s1ap_m1thresholdeventA2, { "m1thresholdeventA2", "s1ap.m1thresholdeventA2_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_m1periodicReporting, { "m1periodicReporting", "s1ap.m1periodicReporting_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_recommendENBsForPaging, { "recommendENBsForPaging", "s1ap.recommendENBsForPaging_element", FT_NONE, BASE_NONE, NULL, 0, "RecommendedENBsForPaging", HFILL }}, { &hf_s1ap_rSRP, { "rSRP", "s1ap.rSRP", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_threshold_nr_rsrp_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_s1ap_rSRQ, { "rSRQ", "s1ap.rSRQ", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_threshold_nr_rsrq_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_s1ap_sINR, { "sINR", "s1ap.sINR", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_threshold_nr_sinr_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_s1ap_interSystemMeasurementParameters, { "interSystemMeasurementParameters", "s1ap.interSystemMeasurementParameters_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_measurementDuration, { "measurementDuration", "s1ap.measurementDuration", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_100", HFILL }}, { &hf_s1ap_interSystemMeasurementList, { "interSystemMeasurementList", "s1ap.interSystemMeasurementList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_InterSystemMeasurementList_item, { "InterSystemMeasurementItem", "s1ap.InterSystemMeasurementItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_freqBandIndicatorNR, { "freqBandIndicatorNR", "s1ap.freqBandIndicatorNR", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1024", HFILL }}, { &hf_s1ap_sSBfrequencies, { "sSBfrequencies", "s1ap.sSBfrequencies", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_maxNARFCN", HFILL }}, { &hf_s1ap_subcarrierSpacingSSB, { "subcarrierSpacingSSB", "s1ap.subcarrierSpacingSSB", FT_UINT32, BASE_DEC, VALS(s1ap_T_subcarrierSpacingSSB_vals), 0, NULL, HFILL }}, { &hf_s1ap_maxRSIndexCellQual, { "maxRSIndexCellQual", "s1ap.maxRSIndexCellQual", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_maxRS_IndexCellQual", HFILL }}, { &hf_s1ap_sMTC, { "sMTC", "s1ap.sMTC", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_threshRS_Index_r15, { "threshRS-Index-r15", "s1ap.threshRS_Index_r15", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sSBToMeasure, { "sSBToMeasure", "s1ap.sSBToMeasure", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sSRSSIMeasurement, { "sSRSSIMeasurement", "s1ap.sSRSSIMeasurement", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_quantityConfigNR_R15, { "quantityConfigNR-R15", "s1ap.quantityConfigNR_R15", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_excludedCellsToAddModList, { "excludedCellsToAddModList", "s1ap.excludedCellsToAddModList", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_UTRAN_Cell, { "e-UTRAN-Cell", "s1ap.e_UTRAN_Cell_element", FT_NONE, BASE_NONE, NULL, 0, "LastVisitedEUTRANCellInformation", HFILL }}, { &hf_s1ap_uTRAN_Cell, { "uTRAN-Cell", "s1ap.uTRAN_Cell", FT_BYTES, BASE_NONE, NULL, 0, "LastVisitedUTRANCellInformation", HFILL }}, { &hf_s1ap_gERAN_Cell, { "gERAN-Cell", "s1ap.gERAN_Cell", FT_UINT32, BASE_DEC, VALS(s1ap_LastVisitedGERANCellInformation_vals), 0, "LastVisitedGERANCellInformation", HFILL }}, { &hf_s1ap_nG_RAN_Cell, { "nG-RAN-Cell", "s1ap.nG_RAN_Cell", FT_BYTES, BASE_NONE, NULL, 0, "LastVisitedNGRANCellInformation", HFILL }}, { &hf_s1ap_cellType, { "cellType", "s1ap.cellType_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_time_UE_StayedInCell, { "time-UE-StayedInCell", "s1ap.time_UE_StayedInCell", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_s1ap_LastVisitedPSCellList_item, { "LastVisitedPSCellInformation", "s1ap.LastVisitedPSCellInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pSCellID, { "pSCellID", "s1ap.pSCellID_element", FT_NONE, BASE_NONE, NULL, 0, "PSCellInformation", HFILL }}, { &hf_s1ap_timeStay, { "timeStay", "s1ap.timeStay", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_40950", HFILL }}, { &hf_s1ap_undefined, { "undefined", "s1ap.undefined_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pattern_period, { "pattern-period", "s1ap.pattern_period", FT_UINT32, BASE_DEC, VALS(s1ap_T_pattern_period_vals), 0, NULL, HFILL }}, { &hf_s1ap_pattern_offset, { "pattern-offset", "s1ap.pattern_offset", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_10239_", HFILL }}, { &hf_s1ap_loggingInterval, { "loggingInterval", "s1ap.loggingInterval", FT_UINT32, BASE_DEC, VALS(s1ap_LoggingInterval_vals), 0, NULL, HFILL }}, { &hf_s1ap_loggingDuration, { "loggingDuration", "s1ap.loggingDuration", FT_UINT32, BASE_DEC, VALS(s1ap_LoggingDuration_vals), 0, NULL, HFILL }}, { &hf_s1ap_mBSFN_ResultToLog, { "mBSFN-ResultToLog", "s1ap.mBSFN_ResultToLog", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_periodical, { "periodical", "s1ap.periodical_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eventTrigger, { "eventTrigger", "s1ap.eventTrigger", FT_UINT32, BASE_DEC, VALS(s1ap_EventTrigger_vals), 0, NULL, HFILL }}, { &hf_s1ap_tACList_In_LTE_NTN, { "tACList-In-LTE-NTN", "s1ap.tACList_In_LTE_NTN", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uE_Location_Derived_TAC, { "uE-Location-Derived-TAC", "s1ap.uE_Location_Derived_TAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, "TAC", HFILL }}, { &hf_s1ap_m3period, { "m3period", "s1ap.m3period", FT_UINT32, BASE_DEC, VALS(s1ap_M3period_vals), 0, NULL, HFILL }}, { &hf_s1ap_m4period, { "m4period", "s1ap.m4period", FT_UINT32, BASE_DEC, VALS(s1ap_M4period_vals), 0, NULL, HFILL }}, { &hf_s1ap_m4_links_to_log, { "m4-links-to-log", "s1ap.m4_links_to_log", FT_UINT32, BASE_DEC, VALS(s1ap_Links_to_log_vals), 0, "Links_to_log", HFILL }}, { &hf_s1ap_m5period, { "m5period", "s1ap.m5period", FT_UINT32, BASE_DEC, VALS(s1ap_M5period_vals), 0, NULL, HFILL }}, { &hf_s1ap_m5_links_to_log, { "m5-links-to-log", "s1ap.m5_links_to_log", FT_UINT32, BASE_DEC, VALS(s1ap_Links_to_log_vals), 0, "Links_to_log", HFILL }}, { &hf_s1ap_m6report_Interval, { "m6report-Interval", "s1ap.m6report_Interval", FT_UINT32, BASE_DEC, VALS(s1ap_M6report_Interval_vals), 0, NULL, HFILL }}, { &hf_s1ap_m6delay_threshold, { "m6delay-threshold", "s1ap.m6delay_threshold", FT_UINT32, BASE_DEC, VALS(s1ap_M6delay_threshold_vals), 0, NULL, HFILL }}, { &hf_s1ap_m6_links_to_log, { "m6-links-to-log", "s1ap.m6_links_to_log", FT_UINT32, BASE_DEC, VALS(s1ap_Links_to_log_vals), 0, "Links_to_log", HFILL }}, { &hf_s1ap_m7period, { "m7period", "s1ap.m7period", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_m7_links_to_log, { "m7-links-to-log", "s1ap.m7_links_to_log", FT_UINT32, BASE_DEC, VALS(s1ap_Links_to_log_vals), 0, "Links_to_log", HFILL }}, { &hf_s1ap_mdt_Activation, { "mdt-Activation", "s1ap.mdt_Activation", FT_UINT32, BASE_DEC, VALS(s1ap_MDT_Activation_vals), 0, NULL, HFILL }}, { &hf_s1ap_areaScopeOfMDT, { "areaScopeOfMDT", "s1ap.areaScopeOfMDT", FT_UINT32, BASE_DEC, VALS(s1ap_AreaScopeOfMDT_vals), 0, NULL, HFILL }}, { &hf_s1ap_mDTMode, { "mDTMode", "s1ap.mDTMode", FT_UINT32, BASE_DEC, VALS(s1ap_MDTMode_vals), 0, NULL, HFILL }}, { &hf_s1ap_MBSFN_ResultToLog_item, { "MBSFN-ResultToLogInfo", "s1ap.MBSFN_ResultToLogInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_mBSFN_AreaId, { "mBSFN-AreaId", "s1ap.mBSFN_AreaId", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_s1ap_carrierFreq, { "carrierFreq", "s1ap.carrierFreq", FT_UINT32, BASE_DEC, NULL, 0, "EARFCN", HFILL }}, { &hf_s1ap_MDTPLMNList_item, { "PLMNidentity", "s1ap.PLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_immediateMDT, { "immediateMDT", "s1ap.immediateMDT_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_loggedMDT, { "loggedMDT", "s1ap.loggedMDT_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_mDTMode_Extension, { "mDTMode-Extension", "s1ap.mDTMode_Extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_threshold_RSRP, { "threshold-RSRP", "s1ap.threshold_RSRP", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_Threshold_RSRP_fmt), 0, NULL, HFILL }}, { &hf_s1ap_threshold_RSRQ, { "threshold-RSRQ", "s1ap.threshold_RSRQ", FT_UINT32, BASE_CUSTOM, CF_FUNC(s1ap_Threshold_RSRQ_fmt), 0, NULL, HFILL }}, { &hf_s1ap_global_ENB_ID, { "global-ENB-ID", "s1ap.global_ENB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAI, { "tAI", "s1ap.tAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_muting_pattern_period, { "muting-pattern-period", "s1ap.muting_pattern_period", FT_UINT32, BASE_DEC, VALS(s1ap_T_muting_pattern_period_vals), 0, NULL, HFILL }}, { &hf_s1ap_muting_pattern_offset, { "muting-pattern-offset", "s1ap.muting_pattern_offset", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_10239_", HFILL }}, { &hf_s1ap_nB_IoT_paging_eDRX_Cycle, { "nB-IoT-paging-eDRX-Cycle", "s1ap.nB_IoT_paging_eDRX_Cycle", FT_UINT32, BASE_DEC, VALS(s1ap_NB_IoT_Paging_eDRX_Cycle_vals), 0, NULL, HFILL }}, { &hf_s1ap_nB_IoT_pagingTimeWindow, { "nB-IoT-pagingTimeWindow", "s1ap.nB_IoT_pagingTimeWindow", FT_UINT32, BASE_DEC, VALS(s1ap_NB_IoT_PagingTimeWindow_vals), 0, NULL, HFILL }}, { &hf_s1ap_pLMNIdentity, { "pLMNIdentity", "s1ap.pLMNIdentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_nRCellIdentity, { "nRCellIdentity", "s1ap.nRCellIdentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_nRencryptionAlgorithms, { "nRencryptionAlgorithms", "s1ap.nRencryptionAlgorithms", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_nRintegrityProtectionAlgorithms, { "nRintegrityProtectionAlgorithms", "s1ap.nRintegrityProtectionAlgorithms", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_vehicleUE, { "vehicleUE", "s1ap.vehicleUE", FT_UINT32, BASE_DEC, VALS(s1ap_VehicleUE_vals), 0, NULL, HFILL }}, { &hf_s1ap_pedestrianUE, { "pedestrianUE", "s1ap.pedestrianUE", FT_UINT32, BASE_DEC, VALS(s1ap_PedestrianUE_vals), 0, NULL, HFILL }}, { &hf_s1ap_uEaggregateMaximumBitRate, { "uEaggregateMaximumBitRate", "s1ap.uEaggregateMaximumBitRate", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_overloadAction, { "overloadAction", "s1ap.overloadAction", FT_UINT32, BASE_DEC, VALS(s1ap_OverloadAction_vals), 0, NULL, HFILL }}, { &hf_s1ap_pagingAttemptCount, { "pagingAttemptCount", "s1ap.pagingAttemptCount", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_intendedNumberOfPagingAttempts, { "intendedNumberOfPagingAttempts", "s1ap.intendedNumberOfPagingAttempts", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_nextPagingAreaScope, { "nextPagingAreaScope", "s1ap.nextPagingAreaScope", FT_UINT32, BASE_DEC, VALS(s1ap_NextPagingAreaScope_vals), 0, NULL, HFILL }}, { &hf_s1ap_paging_eDRX_Cycle, { "paging-eDRX-Cycle", "s1ap.paging_eDRX_Cycle", FT_UINT32, BASE_DEC, VALS(s1ap_Paging_eDRX_Cycle_vals), 0, NULL, HFILL }}, { &hf_s1ap_pagingTimeWindow, { "pagingTimeWindow", "s1ap.pagingTimeWindow", FT_UINT32, BASE_DEC, VALS(s1ap_PagingTimeWindow_vals), 0, NULL, HFILL }}, { &hf_s1ap_pc5QoSFlowList, { "pc5QoSFlowList", "s1ap.pc5QoSFlowList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pc5LinkAggregatedBitRates, { "pc5LinkAggregatedBitRates", "s1ap.pc5LinkAggregatedBitRates", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_PC5QoSFlowList_item, { "PC5QoSFlowItem", "s1ap.PC5QoSFlowItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pQI, { "pQI", "s1ap.pQI", FT_UINT32, BASE_DEC, NULL, 0, "FiveQI", HFILL }}, { &hf_s1ap_pc5FlowBitRates, { "pc5FlowBitRates", "s1ap.pc5FlowBitRates_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_range, { "range", "s1ap.range", FT_UINT32, BASE_DEC, VALS(s1ap_Range_vals), 0, NULL, HFILL }}, { &hf_s1ap_guaranteedFlowBitRate, { "guaranteedFlowBitRate", "s1ap.guaranteedFlowBitRate", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_maximumFlowBitRate, { "maximumFlowBitRate", "s1ap.maximumFlowBitRate", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_reportInterval, { "reportInterval", "s1ap.reportInterval", FT_UINT32, BASE_DEC, VALS(s1ap_ReportIntervalMDT_vals), 0, "ReportIntervalMDT", HFILL }}, { &hf_s1ap_reportAmount, { "reportAmount", "s1ap.reportAmount", FT_UINT32, BASE_DEC, VALS(s1ap_ReportAmountMDT_vals), 0, "ReportAmountMDT", HFILL }}, { &hf_s1ap_plmnListforQMC, { "plmnListforQMC", "s1ap.plmnListforQMC", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_PLMNListforQMC_item, { "PLMNidentity", "s1ap.PLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_proSeDirectDiscovery, { "proSeDirectDiscovery", "s1ap.proSeDirectDiscovery", FT_UINT32, BASE_DEC, VALS(s1ap_ProSeDirectDiscovery_vals), 0, NULL, HFILL }}, { &hf_s1ap_proSeDirectCommunication, { "proSeDirectCommunication", "s1ap.proSeDirectCommunication", FT_UINT32, BASE_DEC, VALS(s1ap_ProSeDirectCommunication_vals), 0, NULL, HFILL }}, { &hf_s1ap_nCGI, { "nCGI", "s1ap.nCGI_element", FT_NONE, BASE_NONE, NULL, 0, "NR_CGI", HFILL }}, { &hf_s1ap_recommendedCellList, { "recommendedCellList", "s1ap.recommendedCellList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RecommendedCellList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eUTRAN_CGI, { "eUTRAN-CGI", "s1ap.eUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_timeStayedInCell, { "timeStayedInCell", "s1ap.timeStayedInCell", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_4095", HFILL }}, { &hf_s1ap_recommendedENBList, { "recommendedENBList", "s1ap.recommendedENBList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_RecommendedENBList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_mMEPagingTarget, { "mMEPagingTarget", "s1ap.mMEPagingTarget", FT_UINT32, BASE_DEC, VALS(s1ap_MMEPagingTarget_vals), 0, NULL, HFILL }}, { &hf_s1ap_RAT_Restrictions_item, { "RAT-RestrictionsItem", "s1ap.RAT_RestrictionsItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_rAT_RestrictionInformation, { "rAT-RestrictionInformation", "s1ap.rAT_RestrictionInformation", FT_BYTES, BASE_NONE, NULL, 0, "T_rAT_RestrictionInformation", HFILL }}, { &hf_s1ap_eventType, { "eventType", "s1ap.eventType", FT_UINT32, BASE_DEC, VALS(s1ap_EventType_vals), 0, NULL, HFILL }}, { &hf_s1ap_reportArea, { "reportArea", "s1ap.reportArea", FT_UINT32, BASE_DEC, VALS(s1ap_ReportArea_vals), 0, NULL, HFILL }}, { &hf_s1ap_rIMInformation, { "rIMInformation", "s1ap.rIMInformation", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_rIMRoutingAddress, { "rIMRoutingAddress", "s1ap.rIMRoutingAddress", FT_UINT32, BASE_DEC, VALS(s1ap_RIMRoutingAddress_vals), 0, NULL, HFILL }}, { &hf_s1ap_gERAN_Cell_ID, { "gERAN-Cell-ID", "s1ap.gERAN_Cell_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_targetRNC_ID, { "targetRNC-ID", "s1ap.targetRNC_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eHRPD_Sector_ID, { "eHRPD-Sector-ID", "s1ap.eHRPD_Sector_ID", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_16", HFILL }}, { &hf_s1ap_uE_RLF_Report_Container, { "uE-RLF-Report-Container", "s1ap.uE_RLF_Report_Container", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uE_RLF_Report_Container_for_extended_bands, { "uE-RLF-Report-Container-for-extended-bands", "s1ap.uE_RLF_Report_Container_for_extended_bands", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ECGIListForRestart_item, { "EUTRAN-CGI", "s1ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_nextHopChainingCount, { "nextHopChainingCount", "s1ap.nextHopChainingCount", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_7", HFILL }}, { &hf_s1ap_nextHopParameter, { "nextHopParameter", "s1ap.nextHopParameter", FT_BYTES, BASE_NONE, NULL, 0, "SecurityKey", HFILL }}, { &hf_s1ap_SecondaryRATDataUsageReportList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_secondaryRATType, { "secondaryRATType", "s1ap.secondaryRATType", FT_UINT32, BASE_DEC, VALS(s1ap_SecondaryRATType_vals), 0, NULL, HFILL }}, { &hf_s1ap_e_RABUsageReportList, { "e-RABUsageReportList", "s1ap.e_RABUsageReportList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_integrityProtectionIndication, { "integrityProtectionIndication", "s1ap.integrityProtectionIndication", FT_UINT32, BASE_DEC, VALS(s1ap_IntegrityProtectionIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_integrityProtectionResult, { "integrityProtectionResult", "s1ap.integrityProtectionResult", FT_UINT32, BASE_DEC, VALS(s1ap_IntegrityProtectionResult_vals), 0, NULL, HFILL }}, { &hf_s1ap_sensorNameConfig, { "sensorNameConfig", "s1ap.sensorNameConfig", FT_UINT32, BASE_DEC, VALS(s1ap_SensorNameConfig_vals), 0, NULL, HFILL }}, { &hf_s1ap_SensorMeasConfigNameList_item, { "SensorMeasConfigNameItem", "s1ap.SensorMeasConfigNameItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sensorMeasConfig, { "sensorMeasConfig", "s1ap.sensorMeasConfig", FT_UINT32, BASE_DEC, VALS(s1ap_SensorMeasConfig_vals), 0, NULL, HFILL }}, { &hf_s1ap_sensorMeasConfigNameList, { "sensorMeasConfigNameList", "s1ap.sensorMeasConfigNameList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uncompensatedBarometricConfig, { "uncompensatedBarometricConfig", "s1ap.uncompensatedBarometricConfig", FT_UINT32, BASE_DEC, VALS(s1ap_T_uncompensatedBarometricConfig_vals), 0, NULL, HFILL }}, { &hf_s1ap_sONInformationRequest, { "sONInformationRequest", "s1ap.sONInformationRequest", FT_UINT32, BASE_DEC, VALS(s1ap_SONInformationRequest_vals), 0, NULL, HFILL }}, { &hf_s1ap_sONInformationReply, { "sONInformationReply", "s1ap.sONInformationReply_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sONInformation_Extension, { "sONInformation-Extension", "s1ap.sONInformation_Extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_x2TNLConfigurationInfo, { "x2TNLConfigurationInfo", "s1ap.x2TNLConfigurationInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_rLFReportInformation, { "rLFReportInformation", "s1ap.rLFReportInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_targeteNB_ID, { "targeteNB-ID", "s1ap.targeteNB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sourceeNB_ID, { "sourceeNB-ID", "s1ap.sourceeNB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sourceStratumLevel, { "sourceStratumLevel", "s1ap.sourceStratumLevel", FT_UINT32, BASE_DEC, NULL, 0, "StratumLevel", HFILL }}, { &hf_s1ap_listeningSubframePattern, { "listeningSubframePattern", "s1ap.listeningSubframePattern_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_aggressoreCGI_List, { "aggressoreCGI-List", "s1ap.aggressoreCGI_List", FT_UINT32, BASE_DEC, NULL, 0, "ECGI_List", HFILL }}, { &hf_s1ap_selected_TAI, { "selected-TAI", "s1ap.selected_TAI_element", FT_NONE, BASE_NONE, NULL, 0, "TAI", HFILL }}, { &hf_s1ap_sourceNgRanNode_ID, { "sourceNgRanNode-ID", "s1ap.sourceNgRanNode_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_sourceNodeID_Extension, { "sourceNodeID-Extension", "s1ap.sourceNodeID_Extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_rRC_Container, { "rRC-Container", "s1ap.rRC_Container", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_RABInformationList, { "e-RABInformationList", "s1ap.e_RABInformationList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_targetCell_ID, { "targetCell-ID", "s1ap.targetCell_ID_element", FT_NONE, BASE_NONE, NULL, 0, "EUTRAN_CGI", HFILL }}, { &hf_s1ap_subscriberProfileIDforRFP, { "subscriberProfileIDforRFP", "s1ap.subscriberProfileIDforRFP", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uE_HistoryInformation, { "uE-HistoryInformation", "s1ap.uE_HistoryInformation", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_global_RAN_NODE_ID, { "global-RAN-NODE-ID", "s1ap.global_RAN_NODE_ID", FT_UINT32, BASE_DEC, VALS(s1ap_Global_RAN_NODE_ID_vals), 0, NULL, HFILL }}, { &hf_s1ap_selected_TAI_01, { "selected-TAI", "s1ap.selected_TAI_element", FT_NONE, BASE_NONE, NULL, 0, "FiveGSTAI", HFILL }}, { &hf_s1ap_ServedGUMMEIs_item, { "ServedGUMMEIsItem", "s1ap.ServedGUMMEIsItem_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_servedPLMNs, { "servedPLMNs", "s1ap.servedPLMNs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_servedGroupIDs, { "servedGroupIDs", "s1ap.servedGroupIDs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_servedMMECs, { "servedMMECs", "s1ap.servedMMECs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServedGroupIDs_item, { "MME-Group-ID", "s1ap.MME_Group_ID", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServedMMECs_item, { "MME-Code", "s1ap.MME_Code", FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ServedPLMNs_item, { "PLMNidentity", "s1ap.PLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_periodicCommunicationIndicator, { "periodicCommunicationIndicator", "s1ap.periodicCommunicationIndicator", FT_UINT32, BASE_DEC, VALS(s1ap_T_periodicCommunicationIndicator_vals), 0, NULL, HFILL }}, { &hf_s1ap_periodicTime, { "periodicTime", "s1ap.periodicTime", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_3600_", HFILL }}, { &hf_s1ap_scheduledCommunicationTime, { "scheduledCommunicationTime", "s1ap.scheduledCommunicationTime_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_stationaryIndication, { "stationaryIndication", "s1ap.stationaryIndication", FT_UINT32, BASE_DEC, VALS(s1ap_T_stationaryIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_trafficProfile, { "trafficProfile", "s1ap.trafficProfile", FT_UINT32, BASE_DEC, VALS(s1ap_T_trafficProfile_vals), 0, NULL, HFILL }}, { &hf_s1ap_batteryIndication, { "batteryIndication", "s1ap.batteryIndication", FT_UINT32, BASE_DEC, VALS(s1ap_T_batteryIndication_vals), 0, NULL, HFILL }}, { &hf_s1ap_dayofWeek, { "dayofWeek", "s1ap.dayofWeek", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_7", HFILL }}, { &hf_s1ap_timeofDayStart, { "timeofDayStart", "s1ap.timeofDayStart", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_86399_", HFILL }}, { &hf_s1ap_timeofDayEnd, { "timeofDayEnd", "s1ap.timeofDayEnd", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_86399_", HFILL }}, { &hf_s1ap_SupportedTAs_item, { "SupportedTAs-Item", "s1ap.SupportedTAs_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAC, { "tAC", "s1ap.tAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_broadcastPLMNs, { "broadcastPLMNs", "s1ap.broadcastPLMNs", FT_UINT32, BASE_DEC, NULL, 0, "BPLMNs", HFILL }}, { &hf_s1ap_stratumLevel, { "stratumLevel", "s1ap.stratumLevel", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_synchronisationStatus, { "synchronisationStatus", "s1ap.synchronisationStatus", FT_UINT32, BASE_DEC, VALS(s1ap_SynchronisationStatus_vals), 0, NULL, HFILL }}, { &hf_s1ap_mMEC, { "mMEC", "s1ap.mMEC", FT_UINT8, BASE_DEC_HEX, NULL, 0, "MME_Code", HFILL }}, { &hf_s1ap_TACList_In_LTE_NTN_item, { "TAC", "s1ap.TAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAIListforMDT, { "tAIListforMDT", "s1ap.tAIListforMDT", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIListforMDT_item, { "TAI", "s1ap.TAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIListforWarning_item, { "TAI", "s1ap.TAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAI_Broadcast_item, { "TAI-Broadcast-Item", "s1ap.TAI_Broadcast_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_completedCellinTAI, { "completedCellinTAI", "s1ap.completedCellinTAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAI_Cancelled_item, { "TAI-Cancelled-Item", "s1ap.TAI_Cancelled_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cancelledCellinTAI, { "cancelledCellinTAI", "s1ap.cancelledCellinTAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAListforMDT, { "tAListforMDT", "s1ap.tAListforMDT", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAListforMDT_item, { "TAC", "s1ap.TAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAListforQMC, { "tAListforQMC", "s1ap.tAListforQMC", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAListforQMC_item, { "TAC", "s1ap.TAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tAIListforQMC, { "tAIListforQMC", "s1ap.tAIListforQMC", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIListforQMC_item, { "TAI", "s1ap.TAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CompletedCellinTAI_item, { "CompletedCellinTAI-Item", "s1ap.CompletedCellinTAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cGI, { "cGI", "s1ap.cGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_targetgNgRanNode_ID, { "targetgNgRanNode-ID", "s1ap.targetgNgRanNode_ID_element", FT_NONE, BASE_NONE, NULL, 0, "TargetNgRanNode_ID", HFILL }}, { &hf_s1ap_rNC_ID, { "rNC-ID", "s1ap.rNC_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_extendedRNC_ID, { "extendedRNC-ID", "s1ap.extendedRNC_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_gNB, { "gNB", "s1ap.gNB_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ng_eNB, { "ng-eNB", "s1ap.ng_eNB_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_global_gNB_ID, { "global-gNB-ID", "s1ap.global_gNB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_gNB_ID, { "gNB-ID", "s1ap.gNB_ID", FT_UINT32, BASE_DEC, VALS(s1ap_GNB_Identity_vals), 0, "GNB_Identity", HFILL }}, { &hf_s1ap_gNB_ID_01, { "gNB-ID", "s1ap.gNB_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_global_ng_eNB_ID, { "global-ng-eNB-ID", "s1ap.global_ng_eNB_ID_element", FT_NONE, BASE_NONE, NULL, 0, "Global_ENB_ID", HFILL }}, { &hf_s1ap_measurementThreshold, { "measurementThreshold", "s1ap.measurementThreshold", FT_UINT32, BASE_DEC, VALS(s1ap_MeasurementThresholdA2_vals), 0, "MeasurementThresholdA2", HFILL }}, { &hf_s1ap_transportLayerAddress, { "transportLayerAddress", "s1ap.transportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uL_GTP_TEID, { "uL-GTP-TEID", "s1ap.uL_GTP_TEID", FT_BYTES, BASE_NONE, NULL, 0, "GTP_TEID", HFILL }}, { &hf_s1ap_e_UTRAN_Trace_ID, { "e-UTRAN-Trace-ID", "s1ap.e_UTRAN_Trace_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_interfacesToTrace, { "interfacesToTrace", "s1ap.interfacesToTrace", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_traceDepth, { "traceDepth", "s1ap.traceDepth", FT_UINT32, BASE_DEC, VALS(s1ap_TraceDepth_vals), 0, NULL, HFILL }}, { &hf_s1ap_traceCollectionEntityIPAddress, { "traceCollectionEntityIPAddress", "s1ap.traceCollectionEntityIPAddress", FT_BYTES, BASE_NONE, NULL, 0, "TransportLayerAddress", HFILL }}, { &hf_s1ap_uDP_Port_Number, { "uDP-Port-Number", "s1ap.uDP_Port_Number", FT_UINT16, BASE_DEC, NULL, 0, "Port_Number", HFILL }}, { &hf_s1ap_TAIListForRestart_item, { "TAI", "s1ap.TAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uEaggregateMaximumBitRateDL, { "uEaggregateMaximumBitRateDL", "s1ap.uEaggregateMaximumBitRateDL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_uEaggregateMaximumBitRateUL, { "uEaggregateMaximumBitRateUL", "s1ap.uEaggregateMaximumBitRateUL", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_containerForAppLayerMeasConfig, { "containerForAppLayerMeasConfig", "s1ap.containerForAppLayerMeasConfig", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_1_1000", HFILL }}, { &hf_s1ap_areaScopeOfQMC, { "areaScopeOfQMC", "s1ap.areaScopeOfQMC", FT_UINT32, BASE_DEC, VALS(s1ap_AreaScopeOfQMC_vals), 0, NULL, HFILL }}, { &hf_s1ap_uE_S1AP_ID_pair, { "uE-S1AP-ID-pair", "s1ap.uE_S1AP_ID_pair_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_mME_UE_S1AP_ID, { "mME-UE-S1AP-ID", "s1ap.MME_UE_S1AP_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eNB_UE_S1AP_ID, { "eNB-UE-S1AP-ID", "s1ap.ENB_UE_S1AP_ID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UE_HistoryInformation_item, { "LastVisitedCell-Item", "s1ap.LastVisitedCell_Item", FT_UINT32, BASE_DEC, VALS(s1ap_LastVisitedCell_Item_vals), 0, NULL, HFILL }}, { &hf_s1ap_s_TMSI, { "s-TMSI", "s1ap.s_TMSI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_iMSI, { "iMSI", "s1ap.iMSI", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_encryptionAlgorithms, { "encryptionAlgorithms", "s1ap.encryptionAlgorithms", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_integrityProtectionAlgorithms, { "integrityProtectionAlgorithms", "s1ap.integrityProtectionAlgorithms", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uESidelinkAggregateMaximumBitRate, { "uESidelinkAggregateMaximumBitRate", "s1ap.uESidelinkAggregateMaximumBitRate", FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, "BitRate", HFILL }}, { &hf_s1ap_ul_NAS_MAC, { "ul-NAS-MAC", "s1ap.ul_NAS_MAC", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ul_NAS_Count, { "ul-NAS-Count", "s1ap.ul_NAS_Count", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eutran_cgi, { "eutran-cgi", "s1ap.eutran_cgi_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_tai, { "tai", "s1ap.tai_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cellIDList, { "cellIDList", "s1ap.cellIDList", FT_UINT32, BASE_DEC, NULL, 0, "ECGIList", HFILL }}, { &hf_s1ap_trackingAreaListforWarning, { "trackingAreaListforWarning", "s1ap.trackingAreaListforWarning", FT_UINT32, BASE_DEC, NULL, 0, "TAIListforWarning", HFILL }}, { &hf_s1ap_emergencyAreaIDList, { "emergencyAreaIDList", "s1ap.emergencyAreaIDList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_wlanMeasConfig, { "wlanMeasConfig", "s1ap.wlanMeasConfig", FT_UINT32, BASE_DEC, VALS(s1ap_WLANMeasConfig_vals), 0, NULL, HFILL }}, { &hf_s1ap_wlanMeasConfigNameList, { "wlanMeasConfigNameList", "s1ap.wlanMeasConfigNameList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_wlan_rssi, { "wlan-rssi", "s1ap.wlan_rssi", FT_UINT32, BASE_DEC, VALS(s1ap_T_wlan_rssi_vals), 0, NULL, HFILL }}, { &hf_s1ap_wlan_rtt, { "wlan-rtt", "s1ap.wlan_rtt", FT_UINT32, BASE_DEC, VALS(s1ap_T_wlan_rtt_vals), 0, NULL, HFILL }}, { &hf_s1ap_WLANMeasConfigNameList_item, { "WLANName", "s1ap.WLANName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pagingProbabilityInformation, { "pagingProbabilityInformation", "s1ap.pagingProbabilityInformation", FT_UINT32, BASE_DEC, VALS(s1ap_PagingProbabilityInformation_vals), 0, NULL, HFILL }}, { &hf_s1ap_eNBX2TransportLayerAddresses, { "eNBX2TransportLayerAddresses", "s1ap.eNBX2TransportLayerAddresses", FT_UINT32, BASE_DEC, NULL, 0, "ENBX2TLAs", HFILL }}, { &hf_s1ap_ENBX2ExtTLAs_item, { "ENBX2ExtTLA", "s1ap.ENBX2ExtTLA_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_iPsecTLA, { "iPsecTLA", "s1ap.iPsecTLA", FT_BYTES, BASE_NONE, NULL, 0, "TransportLayerAddress", HFILL }}, { &hf_s1ap_gTPTLAa, { "gTPTLAa", "s1ap.gTPTLAa", FT_UINT32, BASE_DEC, NULL, 0, "ENBX2GTPTLAs", HFILL }}, { &hf_s1ap_ENBX2GTPTLAs_item, { "TransportLayerAddress", "s1ap.TransportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ENBIndirectX2TransportLayerAddresses_item, { "TransportLayerAddress", "s1ap.TransportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_protocolIEs, { "protocolIEs", "s1ap.protocolIEs", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolIE_Container", HFILL }}, { &hf_s1ap_dL_transportLayerAddress, { "dL-transportLayerAddress", "s1ap.dL_transportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, "TransportLayerAddress", HFILL }}, { &hf_s1ap_dL_gTP_TEID, { "dL-gTP-TEID", "s1ap.dL_gTP_TEID", FT_BYTES, BASE_NONE, NULL, 0, "GTP_TEID", HFILL }}, { &hf_s1ap_uL_TransportLayerAddress, { "uL-TransportLayerAddress", "s1ap.uL_TransportLayerAddress", FT_BYTES, BASE_NONE, NULL, 0, "TransportLayerAddress", HFILL }}, { &hf_s1ap_gTP_TEID, { "gTP-TEID", "s1ap.gTP_TEID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_RABlevelQosParameters, { "e-RABlevelQosParameters", "s1ap.e_RABlevelQosParameters_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_securityIndication, { "securityIndication", "s1ap.securityIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupListBearerSUReq_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_RABlevelQoSParameters, { "e-RABlevelQoSParameters", "s1ap.e_RABlevelQoSParameters_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_nAS_PDU, { "nAS-PDU", "s1ap.nAS_PDU", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupListBearerSURes_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeModifiedListBearerModReq_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_e_RABLevelQoSParameters, { "e-RABLevelQoSParameters", "s1ap.e_RABLevelQoSParameters_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyListBearerModRes_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABReleaseListBearerRelComp_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABToBeSetupListCtxtSUReq_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_E_RABSetupListCtxtSURes_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_TAIList_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_s1_Interface, { "s1-Interface", "s1ap.s1_Interface", FT_UINT32, BASE_DEC, VALS(s1ap_ResetAll_vals), 0, "ResetAll", HFILL }}, { &hf_s1ap_partOfS1_Interface, { "partOfS1-Interface", "s1ap.partOfS1_Interface", FT_UINT32, BASE_DEC, NULL, 0, "UE_associatedLogicalS1_ConnectionListRes", HFILL }}, { &hf_s1ap_UE_associatedLogicalS1_ConnectionListRes_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_UE_associatedLogicalS1_ConnectionListResAck_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_rIMTransfer, { "rIMTransfer", "s1ap.rIMTransfer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_privateIEs, { "privateIEs", "s1ap.privateIEs", FT_UINT32, BASE_DEC, NULL, 0, "PrivateIE_Container", HFILL }}, { &hf_s1ap_dL_GTP_TEID, { "dL-GTP-TEID", "s1ap.dL_GTP_TEID", FT_BYTES, BASE_NONE, NULL, 0, "GTP_TEID", HFILL }}, { &hf_s1ap_cSGMembershipStatus, { "cSGMembershipStatus", "s1ap.cSGMembershipStatus", FT_UINT32, BASE_DEC, VALS(s1ap_CSGMembershipStatus_vals), 0, NULL, HFILL }}, { &hf_s1ap_cellAccessMode, { "cellAccessMode", "s1ap.cellAccessMode", FT_UINT32, BASE_DEC, VALS(s1ap_CellAccessMode_vals), 0, NULL, HFILL }}, { &hf_s1ap_E_RABModifyListBearerModConf_item, { "ProtocolIE-SingleContainer", "s1ap.ProtocolIE_SingleContainer_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_initiatingMessage, { "initiatingMessage", "s1ap.initiatingMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_successfulOutcome, { "successfulOutcome", "s1ap.successfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_unsuccessfulOutcome, { "unsuccessfulOutcome", "s1ap.unsuccessfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_initiatingMessagevalue, { "value", "s1ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "InitiatingMessage_value", HFILL }}, { &hf_s1ap_successfulOutcome_value, { "value", "s1ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "SuccessfulOutcome_value", HFILL }}, { &hf_s1ap_unsuccessfulOutcome_value, { "value", "s1ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "UnsuccessfulOutcome_value", HFILL }}, { &hf_s1ap_cellLoadReporting, { "cellLoadReporting", "s1ap.cellLoadReporting_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_multiCellLoadReporting, { "multiCellLoadReporting", "s1ap.multiCellLoadReporting_element", FT_NONE, BASE_NONE, NULL, 0, "MultiCellLoadReportingRequest", HFILL }}, { &hf_s1ap_eventTriggeredCellLoadReporting, { "eventTriggeredCellLoadReporting", "s1ap.eventTriggeredCellLoadReporting_element", FT_NONE, BASE_NONE, NULL, 0, "EventTriggeredCellLoadReportingRequest", HFILL }}, { &hf_s1ap_hOReporting, { "hOReporting", "s1ap.hOReporting_element", FT_NONE, BASE_NONE, NULL, 0, "HOReport", HFILL }}, { &hf_s1ap_eutranCellActivation, { "eutranCellActivation", "s1ap.eutranCellActivation_element", FT_NONE, BASE_NONE, NULL, 0, "CellActivationRequest", HFILL }}, { &hf_s1ap_energySavingsIndication, { "energySavingsIndication", "s1ap.energySavingsIndication_element", FT_NONE, BASE_NONE, NULL, 0, "CellStateIndication", HFILL }}, { &hf_s1ap_failureEventReporting, { "failureEventReporting", "s1ap.failureEventReporting", FT_UINT32, BASE_DEC, VALS(s1ap_FailureEventReport_vals), 0, "FailureEventReport", HFILL }}, { &hf_s1ap_cellLoadReporting_01, { "cellLoadReporting", "s1ap.cellLoadReporting", FT_UINT32, BASE_DEC, VALS(s1ap_CellLoadReportingResponse_vals), 0, "CellLoadReportingResponse", HFILL }}, { &hf_s1ap_multiCellLoadReporting_01, { "multiCellLoadReporting", "s1ap.multiCellLoadReporting", FT_UINT32, BASE_DEC, NULL, 0, "MultiCellLoadReportingResponse", HFILL }}, { &hf_s1ap_eventTriggeredCellLoadReporting_01, { "eventTriggeredCellLoadReporting", "s1ap.eventTriggeredCellLoadReporting_element", FT_NONE, BASE_NONE, NULL, 0, "EventTriggeredCellLoadReportingResponse", HFILL }}, { &hf_s1ap_hOReporting_01, { "hOReporting", "s1ap.hOReporting_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eutranCellActivation_01, { "eutranCellActivation", "s1ap.eutranCellActivation_element", FT_NONE, BASE_NONE, NULL, 0, "CellActivationResponse", HFILL }}, { &hf_s1ap_energySavingsIndication_01, { "energySavingsIndication", "s1ap.energySavingsIndication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_failureEventReporting_01, { "failureEventReporting", "s1ap.failureEventReporting_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cellLoadReporting_02, { "cellLoadReporting", "s1ap.cellLoadReporting", FT_UINT32, BASE_DEC, VALS(s1ap_CellLoadReportingCause_vals), 0, "CellLoadReportingCause", HFILL }}, { &hf_s1ap_multiCellLoadReporting_02, { "multiCellLoadReporting", "s1ap.multiCellLoadReporting", FT_UINT32, BASE_DEC, VALS(s1ap_CellLoadReportingCause_vals), 0, "CellLoadReportingCause", HFILL }}, { &hf_s1ap_eventTriggeredCellLoadReporting_02, { "eventTriggeredCellLoadReporting", "s1ap.eventTriggeredCellLoadReporting", FT_UINT32, BASE_DEC, VALS(s1ap_CellLoadReportingCause_vals), 0, "CellLoadReportingCause", HFILL }}, { &hf_s1ap_hOReporting_02, { "hOReporting", "s1ap.hOReporting", FT_UINT32, BASE_DEC, VALS(s1ap_HOReportingCause_vals), 0, "HOReportingCause", HFILL }}, { &hf_s1ap_eutranCellActivation_02, { "eutranCellActivation", "s1ap.eutranCellActivation", FT_UINT32, BASE_DEC, VALS(s1ap_CellActivationCause_vals), 0, "CellActivationCause", HFILL }}, { &hf_s1ap_energySavingsIndication_02, { "energySavingsIndication", "s1ap.energySavingsIndication", FT_UINT32, BASE_DEC, VALS(s1ap_CellStateIndicationCause_vals), 0, "CellStateIndicationCause", HFILL }}, { &hf_s1ap_failureEventReporting_02, { "failureEventReporting", "s1ap.failureEventReporting", FT_UINT32, BASE_DEC, VALS(s1ap_FailureEventReportingCause_vals), 0, "FailureEventReportingCause", HFILL }}, { &hf_s1ap_eUTRAN, { "eUTRAN", "s1ap.eUTRAN_element", FT_NONE, BASE_NONE, NULL, 0, "EUTRANcellLoadReportingResponse", HFILL }}, { &hf_s1ap_uTRAN, { "uTRAN", "s1ap.uTRAN", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_gERAN, { "gERAN", "s1ap.gERAN", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_eHRPD, { "eHRPD", "s1ap.eHRPD_element", FT_NONE, BASE_NONE, NULL, 0, "EHRPDSectorLoadReportingResponse", HFILL }}, { &hf_s1ap_compositeAvailableCapacityGroup, { "compositeAvailableCapacityGroup", "s1ap.compositeAvailableCapacityGroup", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cell_ID_01, { "cell-ID", "s1ap.cell_ID", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_eUTRANcellLoadReportingResponse, { "eUTRANcellLoadReportingResponse", "s1ap.eUTRANcellLoadReportingResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eUTRAN_01, { "eUTRAN", "s1ap.eUTRAN", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_eHRPD_01, { "eHRPD", "s1ap.eHRPD", FT_BYTES, BASE_NONE, NULL, 0, "EHRPD_Sector_ID", HFILL }}, { &hf_s1ap_RequestedCellList_item, { "IRAT-Cell-ID", "s1ap.IRAT_Cell_ID", FT_UINT32, BASE_DEC, VALS(s1ap_IRAT_Cell_ID_vals), 0, NULL, HFILL }}, { &hf_s1ap_requestedCellList, { "requestedCellList", "s1ap.requestedCellList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_cell_ID_02, { "cell-ID", "s1ap.cell_ID", FT_UINT32, BASE_DEC, VALS(s1ap_IRAT_Cell_ID_vals), 0, "IRAT_Cell_ID", HFILL }}, { &hf_s1ap_ReportingCellList_item, { "ReportingCellList-Item", "s1ap.ReportingCellList_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_MultiCellLoadReportingResponse_item, { "MultiCellLoadReportingResponse-Item", "s1ap.MultiCellLoadReportingResponse_Item", FT_UINT32, BASE_DEC, VALS(s1ap_MultiCellLoadReportingResponse_Item_vals), 0, NULL, HFILL }}, { &hf_s1ap_eUTRANResponse, { "eUTRANResponse", "s1ap.eUTRANResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_uTRANResponse, { "uTRANResponse", "s1ap.uTRANResponse", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_gERANResponse, { "gERANResponse", "s1ap.gERANResponse", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_eHRPD_02, { "eHRPD", "s1ap.eHRPD_element", FT_NONE, BASE_NONE, NULL, 0, "EHRPDMultiSectorLoadReportingResponseItem", HFILL }}, { &hf_s1ap_numberOfMeasurementReportingLevels, { "numberOfMeasurementReportingLevels", "s1ap.numberOfMeasurementReportingLevels", FT_UINT32, BASE_DEC, VALS(s1ap_NumberOfMeasurementReportingLevels_vals), 0, NULL, HFILL }}, { &hf_s1ap_cellLoadReportingResponse, { "cellLoadReportingResponse", "s1ap.cellLoadReportingResponse", FT_UINT32, BASE_DEC, VALS(s1ap_CellLoadReportingResponse_vals), 0, NULL, HFILL }}, { &hf_s1ap_overloadFlag, { "overloadFlag", "s1ap.overloadFlag", FT_UINT32, BASE_DEC, VALS(s1ap_OverloadFlag_vals), 0, NULL, HFILL }}, { &hf_s1ap_hoType, { "hoType", "s1ap.hoType", FT_UINT32, BASE_DEC, VALS(s1ap_HoType_vals), 0, NULL, HFILL }}, { &hf_s1ap_hoReportType, { "hoReportType", "s1ap.hoReportType", FT_UINT32, BASE_DEC, VALS(s1ap_HoReportType_vals), 0, NULL, HFILL }}, { &hf_s1ap_hosourceID, { "hosourceID", "s1ap.hosourceID", FT_UINT32, BASE_DEC, VALS(s1ap_IRAT_Cell_ID_vals), 0, "IRAT_Cell_ID", HFILL }}, { &hf_s1ap_hoTargetID, { "hoTargetID", "s1ap.hoTargetID", FT_UINT32, BASE_DEC, VALS(s1ap_IRAT_Cell_ID_vals), 0, "IRAT_Cell_ID", HFILL }}, { &hf_s1ap_candidateCellList, { "candidateCellList", "s1ap.candidateCellList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_candidatePCIList, { "candidatePCIList", "s1ap.candidatePCIList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_CandidateCellList_item, { "IRAT-Cell-ID", "s1ap.IRAT_Cell_ID", FT_UINT32, BASE_DEC, VALS(s1ap_IRAT_Cell_ID_vals), 0, NULL, HFILL }}, { &hf_s1ap_CandidatePCIList_item, { "CandidatePCI", "s1ap.CandidatePCI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_pCI, { "pCI", "s1ap.pCI", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_503", HFILL }}, { &hf_s1ap_eARFCN, { "eARFCN", "s1ap.eARFCN", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING", HFILL }}, { &hf_s1ap_cellsToActivateList, { "cellsToActivateList", "s1ap.cellsToActivateList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_minimumActivationTime, { "minimumActivationTime", "s1ap.minimumActivationTime", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_60", HFILL }}, { &hf_s1ap_CellsToActivateList_item, { "CellsToActivateList-Item", "s1ap.CellsToActivateList_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_activatedCellsList, { "activatedCellsList", "s1ap.activatedCellsList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_ActivatedCellsList_item, { "ActivatedCellsList-Item", "s1ap.ActivatedCellsList_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_notificationCellList, { "notificationCellList", "s1ap.notificationCellList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_NotificationCellList_item, { "NotificationCellList-Item", "s1ap.NotificationCellList_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_notifyFlag, { "notifyFlag", "s1ap.notifyFlag", FT_UINT32, BASE_DEC, VALS(s1ap_NotifyFlag_vals), 0, NULL, HFILL }}, { &hf_s1ap_tooEarlyInterRATHOReportFromEUTRAN, { "tooEarlyInterRATHOReportFromEUTRAN", "s1ap.tooEarlyInterRATHOReportFromEUTRAN_element", FT_NONE, BASE_NONE, NULL, 0, "TooEarlyInterRATHOReportReportFromEUTRAN", HFILL }}, { &hf_s1ap_uERLFReportContainer, { "uERLFReportContainer", "s1ap.uERLFReportContainer", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_mobilityInformation, { "mobilityInformation", "s1ap.mobilityInformation", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_dL_EHRPD_CompositeAvailableCapacity, { "dL-EHRPD-CompositeAvailableCapacity", "s1ap.dL_EHRPD_CompositeAvailableCapacity_element", FT_NONE, BASE_NONE, NULL, 0, "EHRPDCompositeAvailableCapacity", HFILL }}, { &hf_s1ap_uL_EHRPD_CompositeAvailableCapacity, { "uL-EHRPD-CompositeAvailableCapacity", "s1ap.uL_EHRPD_CompositeAvailableCapacity_element", FT_NONE, BASE_NONE, NULL, 0, "EHRPDCompositeAvailableCapacity", HFILL }}, { &hf_s1ap_eHRPDSectorCapacityClassValue, { "eHRPDSectorCapacityClassValue", "s1ap.eHRPDSectorCapacityClassValue", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eHRPDCapacityValue, { "eHRPDCapacityValue", "s1ap.eHRPDCapacityValue", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eHRPD_Sector_ID_01, { "eHRPD-Sector-ID", "s1ap.eHRPD_Sector_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_s1ap_eHRPDSectorLoadReportingResponse, { "eHRPDSectorLoadReportingResponse", "s1ap.eHRPDSectorLoadReportingResponse_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_s1ap, &ett_s1ap_TransportLayerAddress, &ett_s1ap_ToTargetTransparentContainer, &ett_s1ap_ToSourceTransparentContainer, &ett_s1ap_RRCContainer, &ett_s1ap_UERadioCapability, &ett_s1ap_RIMInformation, &ett_s1ap_Cdma2000PDU, &ett_s1ap_Cdma2000SectorID, &ett_s1ap_UERadioPagingInformation, &ett_s1ap_UE_HistoryInformationFromTheUE, &ett_s1ap_CELevel, &ett_s1ap_UE_RLF_Report_Container, &ett_s1ap_UE_RLF_Report_Container_for_extended_bands, &ett_s1ap_S1_Message, &ett_s1ap_E_UTRAN_Trace_ID, &ett_s1ap_InterfacesToTrace, &ett_s1ap_EncryptionAlgorithms, &ett_s1ap_IntegrityProtectionAlgorithms, &ett_s1ap_LastVisitedNGRANCellInformation, &ett_s1ap_LastVisitedUTRANCellInformation, &ett_s1ap_SerialNumber, &ett_s1ap_WarningType, &ett_s1ap_DataCodingScheme, &ett_s1ap_WarningMessageContents, &ett_s1ap_MSClassmark, &ett_s1ap_MeasurementsToActivate, &ett_s1ap_MDT_Location_Info, &ett_s1ap_IMSI, &ett_s1ap_NASSecurityParameters, &ett_s1ap_NRencryptionAlgorithms, &ett_s1ap_NRintegrityProtectionAlgorithms, &ett_s1ap_UE_Application_Layer_Measurement_Capability, &ett_s1ap_sMTC, &ett_s1ap_threshRS_Index_r15, &ett_s1ap_sSBToMeasure, &ett_s1ap_sSRSSIMeasurement, &ett_s1ap_quantityConfigNR_R15, &ett_s1ap_excludedCellsToAddModList, &ett_s1ap_NB_IoT_RLF_Report_Container, &ett_s1ap_MDT_ConfigurationNR, &ett_s1ap_IntersystemSONConfigurationTransfer, &ett_s1ap_rAT_RestrictionInformation, &ett_s1ap_PrivateIE_ID, &ett_s1ap_ProtocolIE_Container, &ett_s1ap_ProtocolIE_Field, &ett_s1ap_ProtocolIE_ContainerList, &ett_s1ap_ProtocolExtensionContainer, &ett_s1ap_ProtocolExtensionField, &ett_s1ap_PrivateIE_Container, &ett_s1ap_PrivateIE_Field, &ett_s1ap_Additional_GUTI, &ett_s1ap_AreaScopeOfMDT, &ett_s1ap_AreaScopeOfQMC, &ett_s1ap_AllocationAndRetentionPriority, &ett_s1ap_AssistanceDataForCECapableUEs, &ett_s1ap_AssistanceDataForPaging, &ett_s1ap_AssistanceDataForRecommendedCells, &ett_s1ap_Bearers_SubjectToStatusTransferList, &ett_s1ap_Bearers_SubjectToStatusTransfer_Item, &ett_s1ap_Bearers_SubjectToEarlyStatusTransferList, &ett_s1ap_Bearers_SubjectToEarlyStatusTransfer_Item, &ett_s1ap_BluetoothMeasurementConfiguration, &ett_s1ap_BluetoothMeasConfigNameList, &ett_s1ap_BPLMNs, &ett_s1ap_BroadcastCancelledAreaList, &ett_s1ap_BroadcastCompletedAreaList, &ett_s1ap_CancelledCellinEAI, &ett_s1ap_CancelledCellinEAI_Item, &ett_s1ap_CancelledCellinTAI, &ett_s1ap_CancelledCellinTAI_Item, &ett_s1ap_Cause, &ett_s1ap_CellIdentifierAndCELevelForCECapableUEs, &ett_s1ap_CellID_Broadcast, &ett_s1ap_CellID_Broadcast_Item, &ett_s1ap_CellID_Cancelled, &ett_s1ap_CellID_Cancelled_Item, &ett_s1ap_CellBasedMDT, &ett_s1ap_CellIdListforMDT, &ett_s1ap_CellBasedQMC, &ett_s1ap_CellIdListforQMC, &ett_s1ap_Cdma2000OneXSRVCCInfo, &ett_s1ap_CellType, &ett_s1ap_CGI, &ett_s1ap_CNTypeRestrictions, &ett_s1ap_CNTypeRestrictions_Item, &ett_s1ap_ConnectedengNBList, &ett_s1ap_ConnectedengNBItem, &ett_s1ap_ContextatSource, &ett_s1ap_CSG_IdList, &ett_s1ap_CSG_IdList_Item, &ett_s1ap_COUNTvalue, &ett_s1ap_COUNTValueExtended, &ett_s1ap_COUNTvaluePDCP_SNlength18, &ett_s1ap_CriticalityDiagnostics, &ett_s1ap_CriticalityDiagnostics_IE_List, &ett_s1ap_CriticalityDiagnostics_IE_Item, &ett_s1ap_DAPSRequestInfo, &ett_s1ap_DAPSResponseInfoList, &ett_s1ap_DAPSResponseInfoItem, &ett_s1ap_DAPSResponseInfo, &ett_s1ap_ServedDCNs, &ett_s1ap_ServedDCNsItem, &ett_s1ap_DL_CP_SecurityInformation, &ett_s1ap_DLCOUNT_PDCP_SNlength, &ett_s1ap_ECGIList, &ett_s1ap_PWSfailedECGIList, &ett_s1ap_EmergencyAreaIDList, &ett_s1ap_EmergencyAreaID_Broadcast, &ett_s1ap_EmergencyAreaID_Broadcast_Item, &ett_s1ap_EmergencyAreaID_Cancelled, &ett_s1ap_EmergencyAreaID_Cancelled_Item, &ett_s1ap_CompletedCellinEAI, &ett_s1ap_CompletedCellinEAI_Item, &ett_s1ap_ECGI_List, &ett_s1ap_EmergencyAreaIDListForRestart, &ett_s1ap_ENB_EarlyStatusTransfer_TransparentContainer, &ett_s1ap_ENB_ID, &ett_s1ap_GERAN_Cell_ID, &ett_s1ap_Global_ENB_ID, &ett_s1ap_Global_en_gNB_ID, &ett_s1ap_GUMMEIList, &ett_s1ap_ENB_StatusTransfer_TransparentContainer, &ett_s1ap_ENBX2TLAs, &ett_s1ap_EN_DCSONConfigurationTransfer, &ett_s1ap_EN_DCSONTransferType, &ett_s1ap_EN_DCTransferTypeRequest, &ett_s1ap_EN_DCTransferTypeReply, &ett_s1ap_EN_DCSONeNBIdentification, &ett_s1ap_EN_DCSONengNBIdentification, &ett_s1ap_EPLMNs, &ett_s1ap_E_RABInformationList, &ett_s1ap_E_RABInformationListItem, &ett_s1ap_E_RABList, &ett_s1ap_E_RABItem, &ett_s1ap_E_RABLevelQoSParameters, &ett_s1ap_E_RABSecurityResultList, &ett_s1ap_E_RABSecurityResultItem, &ett_s1ap_E_RABUsageReportList, &ett_s1ap_E_RABUsageReportItem, &ett_s1ap_EUTRAN_CGI, &ett_s1ap_EventL1LoggedMDTConfig, &ett_s1ap_EventTrigger, &ett_s1ap_ExpectedUEBehaviour, &ett_s1ap_ExpectedUEActivityBehaviour, &ett_s1ap_FiveGSTAI, &ett_s1ap_ForbiddenTAs, &ett_s1ap_ForbiddenTAs_Item, &ett_s1ap_ForbiddenTACs, &ett_s1ap_ForbiddenLAs, &ett_s1ap_ForbiddenLAs_Item, &ett_s1ap_ForbiddenLACs, &ett_s1ap_GBR_QosInformation, &ett_s1ap_GUMMEI, &ett_s1ap_HandoverRestrictionList, &ett_s1ap_ImmediateMDT, &ett_s1ap_InformationOnRecommendedCellsAndENBsForPaging, &ett_s1ap_IntersystemMeasurementConfiguration, &ett_s1ap_InterSystemMeasurementParameters, &ett_s1ap_InterSystemMeasurementList, &ett_s1ap_InterSystemMeasurementItem, &ett_s1ap_LAI, &ett_s1ap_LastVisitedCell_Item, &ett_s1ap_LastVisitedEUTRANCellInformation, &ett_s1ap_LastVisitedPSCellList, &ett_s1ap_LastVisitedPSCellInformation, &ett_s1ap_LastVisitedGERANCellInformation, &ett_s1ap_ListeningSubframePattern, &ett_s1ap_LoggedMDT, &ett_s1ap_LoggedMBSFNMDT, &ett_s1ap_LoggedMDTTrigger, &ett_s1ap_LTE_NTN_TAI_Information, &ett_s1ap_M3Configuration, &ett_s1ap_M4Configuration, &ett_s1ap_M5Configuration, &ett_s1ap_M6Configuration, &ett_s1ap_M7Configuration, &ett_s1ap_MDT_Configuration, &ett_s1ap_MBSFN_ResultToLog, &ett_s1ap_MBSFN_ResultToLogInfo, &ett_s1ap_MDTPLMNList, &ett_s1ap_MDTMode, &ett_s1ap_MeasurementThresholdA2, &ett_s1ap_MeasurementThresholdL1LoggedMDT, &ett_s1ap_MMEPagingTarget, &ett_s1ap_MutingPatternInformation, &ett_s1ap_NB_IoT_Paging_eDRXInformation, &ett_s1ap_NR_CGI, &ett_s1ap_NRUESecurityCapabilities, &ett_s1ap_NRV2XServicesAuthorized, &ett_s1ap_NRUESidelinkAggregateMaximumBitrate, &ett_s1ap_OverloadResponse, &ett_s1ap_PagingAttemptInformation, &ett_s1ap_Paging_eDRXInformation, &ett_s1ap_PC5QoSParameters, &ett_s1ap_PC5QoSFlowList, &ett_s1ap_PC5QoSFlowItem, &ett_s1ap_PC5FlowBitRates, &ett_s1ap_M1PeriodicReporting, &ett_s1ap_PLMNAreaBasedQMC, &ett_s1ap_PLMNListforQMC, &ett_s1ap_ProSeAuthorized, &ett_s1ap_PSCellInformation, &ett_s1ap_RecommendedCellsForPaging, &ett_s1ap_RecommendedCellList, &ett_s1ap_RecommendedCellItem, &ett_s1ap_RecommendedENBsForPaging, &ett_s1ap_RecommendedENBList, &ett_s1ap_RecommendedENBItem, &ett_s1ap_RAT_Restrictions, &ett_s1ap_RAT_RestrictionsItem, &ett_s1ap_RequestType, &ett_s1ap_RIMTransfer, &ett_s1ap_RIMRoutingAddress, &ett_s1ap_RLFReportInformation, &ett_s1ap_ECGIListForRestart, &ett_s1ap_SecurityContext, &ett_s1ap_SecondaryRATDataUsageReportList, &ett_s1ap_SecondaryRATDataUsageReportItem, &ett_s1ap_SecurityIndication, &ett_s1ap_SecurityResult, &ett_s1ap_SensorMeasConfigNameItem, &ett_s1ap_SensorMeasConfigNameList, &ett_s1ap_SensorMeasurementConfiguration, &ett_s1ap_SensorNameConfig, &ett_s1ap_SONInformation, &ett_s1ap_SONInformationReply, &ett_s1ap_SONInformationReport, &ett_s1ap_SONConfigurationTransfer, &ett_s1ap_SynchronisationInformation, &ett_s1ap_SourceeNB_ID, &ett_s1ap_SourceNodeID, &ett_s1ap_SourceeNB_ToTargeteNB_TransparentContainer, &ett_s1ap_SourceNgRanNode_ID, &ett_s1ap_ServedGUMMEIs, &ett_s1ap_ServedGUMMEIsItem, &ett_s1ap_ServedGroupIDs, &ett_s1ap_ServedMMECs, &ett_s1ap_ServedPLMNs, &ett_s1ap_Subscription_Based_UE_DifferentiationInfo, &ett_s1ap_ScheduledCommunicationTime, &ett_s1ap_SupportedTAs, &ett_s1ap_SupportedTAs_Item, &ett_s1ap_TimeSynchronisationInfo, &ett_s1ap_S_TMSI, &ett_s1ap_TACList_In_LTE_NTN, &ett_s1ap_TAIBasedMDT, &ett_s1ap_TAIListforMDT, &ett_s1ap_TAIListforWarning, &ett_s1ap_TAI, &ett_s1ap_TAI_Broadcast, &ett_s1ap_TAI_Broadcast_Item, &ett_s1ap_TAI_Cancelled, &ett_s1ap_TAI_Cancelled_Item, &ett_s1ap_TABasedMDT, &ett_s1ap_TAListforMDT, &ett_s1ap_TABasedQMC, &ett_s1ap_TAListforQMC, &ett_s1ap_TAIBasedQMC, &ett_s1ap_TAIListforQMC, &ett_s1ap_CompletedCellinTAI, &ett_s1ap_CompletedCellinTAI_Item, &ett_s1ap_TargetID, &ett_s1ap_TargeteNB_ID, &ett_s1ap_TargetRNC_ID, &ett_s1ap_TargetNgRanNode_ID, &ett_s1ap_Global_RAN_NODE_ID, &ett_s1ap_GNB, &ett_s1ap_Global_GNB_ID, &ett_s1ap_GNB_Identity, &ett_s1ap_NG_eNB, &ett_s1ap_TargeteNB_ToSourceeNB_TransparentContainer, &ett_s1ap_M1ThresholdEventA2, &ett_s1ap_TransportInformation, &ett_s1ap_TraceActivation, &ett_s1ap_TunnelInformation, &ett_s1ap_TAIListForRestart, &ett_s1ap_UEAggregateMaximumBitrate, &ett_s1ap_UEAppLayerMeasConfig, &ett_s1ap_UE_S1AP_IDs, &ett_s1ap_UE_S1AP_ID_pair, &ett_s1ap_UE_associatedLogicalS1_ConnectionItem, &ett_s1ap_UE_HistoryInformation, &ett_s1ap_UEPagingID, &ett_s1ap_UESecurityCapabilities, &ett_s1ap_UESidelinkAggregateMaximumBitrate, &ett_s1ap_UL_CP_SecurityInformation, &ett_s1ap_UserLocationInformation, &ett_s1ap_V2XServicesAuthorized, &ett_s1ap_WarningAreaList, &ett_s1ap_WLANMeasurementConfiguration, &ett_s1ap_WLANMeasConfigNameList, &ett_s1ap_WUS_Assistance_Information, &ett_s1ap_X2TNLConfigurationInfo, &ett_s1ap_ENBX2ExtTLAs, &ett_s1ap_ENBX2ExtTLA, &ett_s1ap_ENBX2GTPTLAs, &ett_s1ap_ENBIndirectX2TransportLayerAddresses, &ett_s1ap_HandoverRequired, &ett_s1ap_HandoverCommand, &ett_s1ap_E_RABDataForwardingItem, &ett_s1ap_HandoverPreparationFailure, &ett_s1ap_HandoverRequest, &ett_s1ap_E_RABToBeSetupItemHOReq, &ett_s1ap_HandoverRequestAcknowledge, &ett_s1ap_E_RABAdmittedItem, &ett_s1ap_E_RABFailedToSetupItemHOReqAck, &ett_s1ap_HandoverFailure, &ett_s1ap_HandoverNotify, &ett_s1ap_PathSwitchRequest, &ett_s1ap_E_RABToBeSwitchedDLItem, &ett_s1ap_PathSwitchRequestAcknowledge, &ett_s1ap_E_RABToBeSwitchedULItem, &ett_s1ap_E_RABToBeUpdatedItem, &ett_s1ap_PathSwitchRequestFailure, &ett_s1ap_HandoverCancel, &ett_s1ap_HandoverCancelAcknowledge, &ett_s1ap_HandoverSuccess, &ett_s1ap_ENBEarlyStatusTransfer, &ett_s1ap_MMEEarlyStatusTransfer, &ett_s1ap_E_RABSetupRequest, &ett_s1ap_E_RABToBeSetupListBearerSUReq, &ett_s1ap_E_RABToBeSetupItemBearerSUReq, &ett_s1ap_E_RABSetupResponse, &ett_s1ap_E_RABSetupListBearerSURes, &ett_s1ap_E_RABSetupItemBearerSURes, &ett_s1ap_E_RABModifyRequest, &ett_s1ap_E_RABToBeModifiedListBearerModReq, &ett_s1ap_E_RABToBeModifiedItemBearerModReq, &ett_s1ap_E_RABModifyResponse, &ett_s1ap_E_RABModifyListBearerModRes, &ett_s1ap_E_RABModifyItemBearerModRes, &ett_s1ap_E_RABReleaseCommand, &ett_s1ap_E_RABReleaseResponse, &ett_s1ap_E_RABReleaseListBearerRelComp, &ett_s1ap_E_RABReleaseItemBearerRelComp, &ett_s1ap_E_RABReleaseIndication, &ett_s1ap_InitialContextSetupRequest, &ett_s1ap_E_RABToBeSetupListCtxtSUReq, &ett_s1ap_E_RABToBeSetupItemCtxtSUReq, &ett_s1ap_InitialContextSetupResponse, &ett_s1ap_E_RABSetupListCtxtSURes, &ett_s1ap_E_RABSetupItemCtxtSURes, &ett_s1ap_InitialContextSetupFailure, &ett_s1ap_Paging, &ett_s1ap_TAIList, &ett_s1ap_TAIItem, &ett_s1ap_UEContextReleaseRequest, &ett_s1ap_UEContextReleaseCommand, &ett_s1ap_UEContextReleaseComplete, &ett_s1ap_UEContextModificationRequest, &ett_s1ap_UEContextModificationResponse, &ett_s1ap_UEContextModificationFailure, &ett_s1ap_UERadioCapabilityMatchRequest, &ett_s1ap_UERadioCapabilityMatchResponse, &ett_s1ap_DownlinkNASTransport, &ett_s1ap_InitialUEMessage, &ett_s1ap_UplinkNASTransport, &ett_s1ap_NASNonDeliveryIndication, &ett_s1ap_RerouteNASRequest, &ett_s1ap_NASDeliveryIndication, &ett_s1ap_Reset, &ett_s1ap_ResetType, &ett_s1ap_UE_associatedLogicalS1_ConnectionListRes, &ett_s1ap_ResetAcknowledge, &ett_s1ap_UE_associatedLogicalS1_ConnectionListResAck, &ett_s1ap_ErrorIndication, &ett_s1ap_S1SetupRequest, &ett_s1ap_S1SetupResponse, &ett_s1ap_S1SetupFailure, &ett_s1ap_ENBConfigurationUpdate, &ett_s1ap_ENBConfigurationUpdateAcknowledge, &ett_s1ap_ENBConfigurationUpdateFailure, &ett_s1ap_MMEConfigurationUpdate, &ett_s1ap_MMEConfigurationUpdateAcknowledge, &ett_s1ap_MMEConfigurationUpdateFailure, &ett_s1ap_DownlinkS1cdma2000tunnelling, &ett_s1ap_UplinkS1cdma2000tunnelling, &ett_s1ap_UECapabilityInfoIndication, &ett_s1ap_ENBStatusTransfer, &ett_s1ap_MMEStatusTransfer, &ett_s1ap_TraceStart, &ett_s1ap_TraceFailureIndication, &ett_s1ap_DeactivateTrace, &ett_s1ap_CellTrafficTrace, &ett_s1ap_LocationReportingControl, &ett_s1ap_LocationReportingFailureIndication, &ett_s1ap_LocationReport, &ett_s1ap_OverloadStart, &ett_s1ap_OverloadStop, &ett_s1ap_WriteReplaceWarningRequest, &ett_s1ap_WriteReplaceWarningResponse, &ett_s1ap_ENBDirectInformationTransfer, &ett_s1ap_Inter_SystemInformationTransferType, &ett_s1ap_MMEDirectInformationTransfer, &ett_s1ap_ENBConfigurationTransfer, &ett_s1ap_MMEConfigurationTransfer, &ett_s1ap_PrivateMessage, &ett_s1ap_KillRequest, &ett_s1ap_KillResponse, &ett_s1ap_PWSRestartIndication, &ett_s1ap_PWSFailureIndication, &ett_s1ap_DownlinkUEAssociatedLPPaTransport, &ett_s1ap_UplinkUEAssociatedLPPaTransport, &ett_s1ap_DownlinkNonUEAssociatedLPPaTransport, &ett_s1ap_UplinkNonUEAssociatedLPPaTransport, &ett_s1ap_E_RABModificationIndication, &ett_s1ap_E_RABToBeModifiedItemBearerModInd, &ett_s1ap_E_RABNotToBeModifiedItemBearerModInd, &ett_s1ap_CSGMembershipInfo, &ett_s1ap_E_RABModificationConfirm, &ett_s1ap_E_RABModifyListBearerModConf, &ett_s1ap_E_RABModifyItemBearerModConf, &ett_s1ap_UEContextModificationIndication, &ett_s1ap_UEContextModificationConfirm, &ett_s1ap_UEContextSuspendRequest, &ett_s1ap_UEContextSuspendResponse, &ett_s1ap_UEContextResumeRequest, &ett_s1ap_E_RABFailedToResumeItemResumeReq, &ett_s1ap_UEContextResumeResponse, &ett_s1ap_E_RABFailedToResumeItemResumeRes, &ett_s1ap_UEContextResumeFailure, &ett_s1ap_ConnectionEstablishmentIndication, &ett_s1ap_RetrieveUEInformation, &ett_s1ap_UEInformationTransfer, &ett_s1ap_ENBCPRelocationIndication, &ett_s1ap_MMECPRelocationIndication, &ett_s1ap_SecondaryRATDataUsageReport, &ett_s1ap_UERadioCapabilityIDMappingRequest, &ett_s1ap_UERadioCapabilityIDMappingResponse, &ett_s1ap_S1AP_PDU, &ett_s1ap_InitiatingMessage, &ett_s1ap_SuccessfulOutcome, &ett_s1ap_UnsuccessfulOutcome, &ett_s1ap_SONtransferRequestContainer, &ett_s1ap_SONtransferResponseContainer, &ett_s1ap_SONtransferCause, &ett_s1ap_CellLoadReportingResponse, &ett_s1ap_EUTRANcellLoadReportingResponse, &ett_s1ap_EUTRANResponse, &ett_s1ap_IRAT_Cell_ID, &ett_s1ap_RequestedCellList, &ett_s1ap_MultiCellLoadReportingRequest, &ett_s1ap_ReportingCellList_Item, &ett_s1ap_ReportingCellList, &ett_s1ap_MultiCellLoadReportingResponse, &ett_s1ap_MultiCellLoadReportingResponse_Item, &ett_s1ap_EventTriggeredCellLoadReportingRequest, &ett_s1ap_EventTriggeredCellLoadReportingResponse, &ett_s1ap_HOReport, &ett_s1ap_CandidateCellList, &ett_s1ap_CandidatePCIList, &ett_s1ap_CandidatePCI, &ett_s1ap_CellActivationRequest, &ett_s1ap_CellsToActivateList, &ett_s1ap_CellsToActivateList_Item, &ett_s1ap_CellActivationResponse, &ett_s1ap_ActivatedCellsList, &ett_s1ap_ActivatedCellsList_Item, &ett_s1ap_CellStateIndication, &ett_s1ap_NotificationCellList, &ett_s1ap_NotificationCellList_Item, &ett_s1ap_FailureEventReport, &ett_s1ap_TooEarlyInterRATHOReportReportFromEUTRAN, &ett_s1ap_EHRPDSectorLoadReportingResponse, &ett_s1ap_EHRPDCompositeAvailableCapacity, &ett_s1ap_EHRPDMultiSectorLoadReportingResponseItem, }; static ei_register_info ei[] = { { &ei_s1ap_number_pages_le15, { "s1ap.number_pages_le15", PI_MALFORMED, PI_ERROR, "Number of pages should be <=15", EXPFILL }} }; module_t *s1ap_module; expert_module_t* expert_s1ap; /* Register protocol */ proto_s1ap = proto_register_protocol(PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array(proto_s1ap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_s1ap = expert_register_protocol(proto_s1ap); expert_register_field_array(expert_s1ap, ei, array_length(ei)); /* Register dissector */ s1ap_handle = register_dissector("s1ap", dissect_s1ap, proto_s1ap); /* Register dissector tables */ s1ap_ies_dissector_table = register_dissector_table("s1ap.ies", "S1AP-PROTOCOL-IES", proto_s1ap, FT_UINT32, BASE_DEC); s1ap_ies_p1_dissector_table = register_dissector_table("s1ap.ies.pair.first", "S1AP-PROTOCOL-IES-PAIR FirstValue", proto_s1ap, FT_UINT32, BASE_DEC); s1ap_ies_p2_dissector_table = register_dissector_table("s1ap.ies.pair.second", "S1AP-PROTOCOL-IES-PAIR SecondValue", proto_s1ap, FT_UINT32, BASE_DEC); s1ap_extension_dissector_table = register_dissector_table("s1ap.extension", "S1AP-PROTOCOL-EXTENSION", proto_s1ap, FT_UINT32, BASE_DEC); s1ap_proc_imsg_dissector_table = register_dissector_table("s1ap.proc.imsg", "S1AP-ELEMENTARY-PROCEDURE InitiatingMessage", proto_s1ap, FT_UINT32, BASE_DEC); s1ap_proc_sout_dissector_table = register_dissector_table("s1ap.proc.sout", "S1AP-ELEMENTARY-PROCEDURE SuccessfulOutcome", proto_s1ap, FT_UINT32, BASE_DEC); s1ap_proc_uout_dissector_table = register_dissector_table("s1ap.proc.uout", "S1AP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_s1ap, FT_UINT32, BASE_DEC); /* Register configuration options for ports */ s1ap_module = prefs_register_protocol(proto_s1ap, NULL); prefs_register_bool_preference(s1ap_module, "dissect_container", "Dissect TransparentContainer", "Dissect TransparentContainers that are opaque to S1AP", &g_s1ap_dissect_container); prefs_register_enum_preference(s1ap_module, "dissect_lte_container_as", "Dissect LTE TransparentContainer as", "Select whether LTE TransparentContainer should be dissected as NB-IOT or legacy LTE", &g_s1ap_dissect_lte_container_as, s1ap_lte_container_vals, FALSE); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-s1ap.h
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-s1ap.h */ /* asn2wrs.py -L -p s1ap -c ./s1ap.cnf -s ./packet-s1ap-template -D . -O ../.. S1AP-CommonDataTypes.asn S1AP-Constants.asn S1AP-Containers.asn S1AP-IEs.asn S1AP-PDU-Contents.asn S1AP-PDU-Descriptions.asn S1AP-SonTransfer-IEs.asn */ /* packet-s1ap.h * Routines for E-UTRAN S1 Application Protocol (S1AP) packet dissection * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_S1AP_H #define PACKET_S1AP_H typedef struct _s1ap_ctx_t { guint32 message_type; guint32 ProcedureCode; guint32 ProtocolIE_ID; guint32 ProtocolExtensionID; } s1ap_ctx_t; extern const value_string s1ap_warningType_vals[]; extern const value_string s1ap_serialNumber_gs_vals[]; void dissect_s1ap_warningMessageContents(tvbuff_t *warning_msg_tvb, proto_tree *tree, packet_info *pinfo, guint8 dcs, int hf_nb_pages, int hf_decoded_page); WS_DLL_PUBLIC const value_string s1ap_Cause_vals[]; WS_DLL_PUBLIC const value_string s1ap_CauseMisc_vals[]; WS_DLL_PUBLIC const value_string s1ap_CauseProtocol_vals[]; WS_DLL_PUBLIC const value_string s1ap_CauseRadioNetwork_vals[]; WS_DLL_PUBLIC const value_string s1ap_CauseTransport_vals[]; WS_DLL_PUBLIC const value_string s1ap_CauseNas_vals[]; extern const value_string s1ap_SONtransferRequestContainer_vals[]; extern const value_string s1ap_SONtransferResponseContainer_vals[]; int dissect_s1ap_Global_ENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_s1ap_SONtransferRequestContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_s1ap_SONtransferResponseContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_s1ap_Global_ENB_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_EN_DCSONConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_EUTRAN_CGI_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_HandoverRestrictionList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_IntersystemSONConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_LastVisitedEUTRANCellInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_LastVisitedGERANCellInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_MDTMode_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_PSCellInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_SONConfigurationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_UE_HistoryInformation_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_SONtransferApplicationIdentity_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_SONtransferRequestContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_SONtransferResponseContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_); #endif /* PACKET_S1AP_H */ /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-s5066dts.c
/* * packet-s5066dts.c * Routines for STANAG 5066 DTS layer packet dissection * * Copyright (c) 2013 * by Ibrahim Can Yuce <canyuce [at] gmail [dot] com> * by M. Baris Demiray <baris.demiray [at] gmail [dot] com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include "packet-tcp.h" /* For tcp_dissect_pdus() */ #include <epan/crc16-tvb.h> #include <epan/crc32-tvb.h> #include <wiretap/wtap.h> #define DISSECTOR_NAME "s5066dts" /* STANAG 5066 DPDU properties */ #define S5066_DPDU_MAX_DPDU_SIZE 1070 #define S5066_DPDU_FRAME_HEADER_LEN 15 /* Header field index (in bytes) and size (in bits) constants */ #define S5066_DPDU_EOW_TYPE_INDEX 2 #define S5066_DPDU_EOW_CONTENT_INDEX 3 #define S5066_DPDU_EOT_INDEX 4 #define S5066_DPDU_SIZE_OF_ADDRESS_INDEX 5 #define S5066_DPDU_SIZE_OF_HEADER_INDEX 5 #define S5066_DPDU_SYNC_SEQUENCE_SIZE 2 /*bytes*/ /* D_PDU message types */ #define S5066_DPDU_DATA_ONLY 0 #define S5066_DPDU_ACK_ONLY 1 #define S5066_DPDU_DATA_ACK 2 #define S5066_DPDU_RESET_WIN_RESYNC 3 #define S5066_DPDU_EXP_DATA_ONLY 4 #define S5066_DPDU_EXP_ACK_ONLY 5 #define S5066_DPDU_MANAGEMENT 6 #define S5066_DPDU_NON_ARQ_DATA 7 #define S5066_DPDU_EXP_NON_ARQ_DATA 8 #define S5066_DPDU_WARNING 15 /* EOW message types */ #define S5066_EOW_RESERVED 0 #define S5066_EOW_DRC_REQUEST 1 #define S5066_EOW_DRC_RESPONSE 2 #define S5066_EOW_UNRECOGNIZED_TYPE 3 #define S5066_EOW_CAPABILITY 4 #define S5066_EOW_ALM_REQUEST 5 #define S5066_EOW_ALM_RESPONSE 6 #define S5066_EOW_HDR_DRC_REQUEST 7 #define S5066_EOW_HFTRP_TOKEN 15 void proto_register_s5066dts(void); static gint proto_s5066dts = -1; /* Configuration parameters */ static gboolean config_proto_desegment = TRUE; /* Initialize expert fields */ static expert_field ei_s5066dts_eow_hdr_drc_request_invalid = EI_INIT; static expert_field ei_s5066dts_eow_hftrp_invalid = EI_INIT; /* TCP port that will be listened by the application that peer * dts layers will be connected through */ static range_t *config_s5066dts_ports = NULL; static gint hf_s5066dts_sync_word = -1; static gint hf_s5066dts_dpdu_type = -1; static gint hf_s5066dts_eow_type = -1; static gint hf_s5066dts_eow_data = -1; static gint hf_s5066dts_eot = -1; static gint hf_s5066dts_address_size = -1; static gint hf_s5066dts_header_size = -1; static gint hf_s5066dts_header_crc = -1; static gint hf_s5066dts_cpdu_crc = -1; static gint hf_s5066dts_segmented_cpdu = -1; static gint hf_s5066dts_dest_addr = -1; static gint hf_s5066dts_src_addr = -1; /* EOW TYPES */ /* { 1, "DRC_REQUEST"}, */ static gint hf_s5066dts_eow_drc_request_data_rate = -1; static gint hf_s5066dts_eow_drc_request_interleaving = -1; static gint hf_s5066dts_eow_drc_request_others = -1; /* { 2, "DRC_RESPONSE"}, */ static gint hf_s5066dts_eow_drc_response_response = -1; static gint hf_s5066dts_eow_drc_response_reason = -1; /* { 3, "UNRECOGNIZED_TYPE"}, */ static gint hf_s5066dts_eow_unrec_type_response = -1; static gint hf_s5066dts_eow_unrec_type_reason = -1; /* { 4, "CAPABILITY"}, */ static gint hf_s5066dts_eow_capability_adaptive = -1; static gint hf_s5066dts_eow_capability_stanag_4529 = -1; static gint hf_s5066dts_eow_capability_mil_std_188_110a = -1; static gint hf_s5066dts_eow_capability_extended = -1; static gint hf_s5066dts_eow_capability_full_duplex = -1; static gint hf_s5066dts_eow_capability_split_frequency = -1; static gint hf_s5066dts_eow_capability_non_arcs_ale = -1; static gint hf_s5066dts_eow_capability_arcs = -1; /* { 5, "ALM_REQUEST"}, */ static gint hf_s5066dts_eow_alm_request_data_rate = -1; static gint hf_s5066dts_eow_alm_request_interleaving = -1; static gint hf_s5066dts_eow_alm_request_others = -1; /* { 6, "ALM_RESPONSE"}, */ static gint hf_s5066dts_eow_alm_response_response = -1; static gint hf_s5066dts_eow_alm_response_reason = -1; /* { 7, "HDR_DRC_REQUEST"}, */ static gint hf_s5066dts_eow_hdr_drc_request_waveform = -1; static gint hf_s5066dts_eow_hdr_drc_request_num_channels = -1; static gint hf_s5066dts_eow_hdr_drc_request_data_rate = -1; static gint hf_s5066dts_eow_hdr_drc_request_interleaver_length = -1; /* {15, "HFTRP FRAME CONTROL"}, */ static gint hf_s5066dts_eow_hftrp_hftrp_token = -1; /* DPDU TYPES */ /* { 0, "DATA_ONLY"}, */ static gint hf_s5066dts_data_only_cpdu_start = -1; static gint hf_s5066dts_data_only_cpdu_end = -1; static gint hf_s5066dts_data_only_deliver_in_order = -1; static gint hf_s5066dts_data_only_drop_cpdu = -1; static gint hf_s5066dts_data_only_tx_win_uwe = -1; static gint hf_s5066dts_data_only_tx_win_lwe = -1; static gint hf_s5066dts_data_only_segmented_cpdu_size = -1; static gint hf_s5066dts_data_only_transmit_sequence_number = -1; /* { 1, "ACK_ONLY"}, */ static gint hf_s5066dts_ack_only_rx_lwe = -1; static gint hf_s5066dts_ack_only_acks = -1; /* { 2, "DATA_ACK"}, */ static gint hf_s5066dts_data_ack_cpdu_start = -1; static gint hf_s5066dts_data_ack_cpdu_end = -1; static gint hf_s5066dts_data_ack_deliver_in_order = -1; static gint hf_s5066dts_data_ack_drop_cpdu = -1; static gint hf_s5066dts_data_ack_tx_win_uwe = -1; static gint hf_s5066dts_data_ack_tx_win_lwe = -1; static gint hf_s5066dts_data_ack_segmented_cpdu_size = -1; static gint hf_s5066dts_data_ack_transmit_sequence_number = -1; static gint hf_s5066dts_data_ack_rx_lwe = -1; static gint hf_s5066dts_data_ack_acks = -1; /* { 3, "RESET_WIN_RESYNC"}, */ static gint hf_s5066dts_reset_win_resync_unused = -1; static gint hf_s5066dts_reset_win_resync_full_reset_command = -1; static gint hf_s5066dts_reset_win_resync_reset_tx_win_rqst = -1; static gint hf_s5066dts_reset_win_resync_reset_rx_win_cmnd = -1; static gint hf_s5066dts_reset_win_resync_reset_ack = -1; static gint hf_s5066dts_reset_win_resync_new_rx_lwe = -1; static gint hf_s5066dts_reset_win_resync_reset_frame_id_number = -1; /* { 4, "EXP_DATA_ONLY"}, */ static gint hf_s5066dts_exp_data_only_cpdu_start = -1; static gint hf_s5066dts_exp_data_only_cpdu_end = -1; static gint hf_s5066dts_exp_data_only_cpdu_id = -1; static gint hf_s5066dts_exp_data_only_segmented_cpdu_size = -1; static gint hf_s5066dts_exp_data_only_transmit_sequence_number = -1; /* { 5, "EXP_ACK_ONLY"}, */ static gint hf_s5066dts_exp_ack_only_rx_lwe = -1; static gint hf_s5066dts_exp_ack_only_acks = -1; /* { 6, "MANAGEMENT"}, */ static gint hf_s5066dts_management_unused = -1; static gint hf_s5066dts_management_extended_message_flag = -1; static gint hf_s5066dts_management_message = -1; static gint hf_s5066dts_management_ack = -1; static gint hf_s5066dts_management_management_frame_id = -1; static gint hf_s5066dts_management_extended_message = -1; static gint hf_s5066dts_management_extended_message_hftrp_payload_size = -1; static gint hf_s5066dts_management_extended_message_hftrp_ra = -1; static gint hf_s5066dts_management_extended_message_hftrp_seq_id = -1; static gint hf_s5066dts_management_extended_message_hftrp_gen_seq_id = -1; static gint hf_s5066dts_management_extended_message_hftrp_new_successor_id = -1; static gint hf_s5066dts_management_extended_message_hftrp_number_of_nodes = -1; /* { 7, "NON_ARQ_DATA"}, */ static gint hf_s5066dts_non_arq_data_cpdu_id_1 = -1; static gint hf_s5066dts_non_arq_data_deliver_in_order = -1; static gint hf_s5066dts_non_arq_data_group_address = -1; static gint hf_s5066dts_non_arq_data_cpdu_id_2 = -1; static gint hf_s5066dts_non_arq_data_cpdu_size = -1; static gint hf_s5066dts_non_arq_data_cpdu_segment_offset = -1; static gint hf_s5066dts_non_arq_data_cpdu_reception_window = -1; static gint hf_s5066dts_non_arq_data_segmented_cpdu_size = -1; /* { 8, "EXP_NON_ARQ_DATA"}, */ static gint hf_s5066dts_exp_non_arq_data_cpdu_id_1 = -1; static gint hf_s5066dts_exp_non_arq_data_deliver_in_order = -1; static gint hf_s5066dts_exp_non_arq_data_group_address = -1; static gint hf_s5066dts_exp_non_arq_data_cpdu_id_2 = -1; static gint hf_s5066dts_exp_non_arq_data_cpdu_size = -1; static gint hf_s5066dts_exp_non_arq_data_cpdu_segment_offset = -1; static gint hf_s5066dts_exp_non_arq_data_cpdu_reception_window = -1; static gint hf_s5066dts_exp_non_arq_data_segmented_cpdu_size = -1; /* {15, "WARNING"}, */ static gint hf_s5066dts_warning_frame_type = -1; static gint hf_s5066dts_warning_reason = -1; static gint ett_s5066dts = -1; static gint ett_s5066dts_eow = -1; static gint ett_s5066dts_address = -1; static gint ett_s5066dts_pdu = -1; static gint ett_s5066dts_hftrp_token = -1; static const value_string s5066dts_dpdu_type[] = { { 0, "DATA_ONLY"}, { 1, "ACK_ONLY"}, { 2, "DATA_ACK"}, { 3, "RESET_WIN_RESYNC"}, { 4, "EXP_DATA_ONLY"}, { 5, "EXP_ACK_ONLY"}, { 6, "MANAGEMENT"}, { 7, "NON_ARQ_DATA"}, { 8, "EXP_NON_ARQ_DATA"}, {15, "WARNING"}, { 0, NULL}, }; static const value_string s5066dts_eow_type[] = { { 0, "RESERVED"}, { 1, "DRC_REQUEST"}, { 2, "DRC_RESPONSE"}, { 3, "UNRECOGNIZED_TYPE"}, { 4, "CAPABILITY"}, { 5, "ALM_REQUEST"}, { 6, "ALM_RESPONSE"}, { 7, "HDR_DRC_REQUEST"}, { 15, "HFTRP_TOKEN"}, { 0, NULL}, }; static const value_string s5066dts_eow_data_rate[] = { { 0, "75 bps"}, { 1, "150 bps"}, { 2, "300 bps"}, { 3, "600 bps"}, { 4, "1200 bps"}, { 5, "2400 bps"}, { 6, "3200 bps"}, { 7, "3600 bps"}, { 8, "4800 bps"}, { 9, "6400 bps"}, { 10, "8000 bps"}, { 11, "9600 bps"}, { 0, NULL}, }; static const value_string s5066dts_eow_interleaving[] = { { 0, "No interleaving"}, { 1, "Short interleaving"}, { 2, "Long interleaving"}, { 3, "Reserved"}, { 0, NULL}, }; static const value_string s5066dts_eow_others[] = { { 0, "Request: Master has independent data rate"}, { 1, "Request: Tx=Rx at master"}, { 2, "Advisory: Advising node has independent data rate"}, { 3, "Advisory: Tx=Rx at advising node"}, { 0, NULL}, }; static const value_string s5066dts_eow_response[] = { { 0, "Accept"}, { 1, "Refuse"}, { 2, "Cancel"}, { 3, "Confirm"}, { 0, NULL}, }; static const value_string s5066dts_eow_reason[] = { { 0, "No reason"}, { 1, "Tx and Rx parameters must be the same"}, { 2, "Not possible to change modem data rate"}, { 3, "Not possible to change modem interleaving"}, { 4, "Not possible to change modem data rate or interleaving"}, { 5, "Not consistent with local conditions"}, { 0, NULL}, }; static const value_string s5066dts_eow_waveform[] = { { 0, "MS110A"}, { 1, "MS110B"}, { 2, "STANAG_4285"}, { 3, "STANAG_4539"}, { 4, "STANAG_4529"}, { 5, "STANAG_4415"}, { 6, "STANAG_4481_FSK"}, { 7, "USER_CONFIGURATION_OPTION_1"}, { 8, "USER_CONFIGURATION_OPTION_2"}, { 9, "USER_CONFIGURATION_OPTION_3"}, { 0, NULL}, }; /* Used in Packet List pane */ static const value_string s5066dts_eow_hftrp_frame_control_abbr[] = { { 1, "RTT"}, { 2, "ACK"}, { 3, "SLS"}, { 4, "SET"}, { 5, "REL"}, { 6, "DEL"}, { 0, NULL}, }; /* Used in Packet Details pane */ static const value_string s5066dts_eow_hftrp_frame_control[] = { { 1, "RTT - Right-to-transmit Token"}, { 2, "ACK - Acknowledgment Token"}, { 3, "SLS - Solicit Successor Token"}, { 4, "SET - Set Successor Token"}, { 5, "REL - Relayed Token"}, { 6, "DEL - Delete Token"}, { 0, NULL}, }; static const value_string s5066dts_alm_reason[] = { { 0, "No reason"}, { 1, "Tx and Rx parameters must be the same"}, { 2, "Not possible to change modem data rate"}, { 3, "Not possible to change modem interleaving"}, { 4, "Not possible to change modem data rate or interleaving"}, { 5, "Not consistent with local conditions"}, { 6, "Not possible to change frequency"}, { 0, NULL}, }; /* Register functions' forward references */ void proto_reg_handoff_s5066dts(void); /* { 1, "DRC_REQUEST"}, */ static void dissect_s5066dts_eow_drc_request(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_eow_drc_request_data_rate, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_drc_request_interleaving, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_drc_request_others, tvb, offset, 1, ENC_BIG_ENDIAN); } /* { 2, "DRC_RESPONSE"}, */ static void dissect_s5066dts_eow_drc_response(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_eow_drc_response_response, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_drc_response_reason, tvb, offset, 1, ENC_BIG_ENDIAN); } /* { 3, "UNRECOGNIZED_TYPE"}, */ static void dissect_s5066dts_eow_unrec_type(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_eow_unrec_type_response, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_unrec_type_reason, tvb, offset, 1, ENC_BIG_ENDIAN); } /* { 4, "CAPABILITY"}, */ static void dissect_s5066dts_eow_capability(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_eow_capability_adaptive, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_stanag_4529, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_mil_std_188_110a, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_extended, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_full_duplex, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_split_frequency, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_non_arcs_ale, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_capability_arcs, tvb, offset, 1, ENC_BIG_ENDIAN); } /* { 5, "ALM_REQUEST"}, */ static void dissect_s5066dts_eow_alm_request(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_eow_alm_request_data_rate, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_alm_request_interleaving, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_alm_request_others, tvb, offset, 1, ENC_BIG_ENDIAN); } /* { 6, "ALM_RESPONSE"}, */ static void dissect_s5066dts_eow_alm_response(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_eow_alm_response_response, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_alm_response_reason, tvb, offset, 1, ENC_BIG_ENDIAN); } /* { 7, "HDR_DRC_REQUEST"}, */ static void dissect_s5066dts_eow_hdr_drc_request(tvbuff_t *tvb, packet_info * pinfo, guint offset, proto_tree *tree, guint pdu_type) { if (pdu_type != S5066_DPDU_MANAGEMENT) { expert_add_info(pinfo, tree, &ei_s5066dts_eow_hdr_drc_request_invalid); return; } proto_tree_add_item(tree, hf_s5066dts_eow_hdr_drc_request_waveform, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_eow_hdr_drc_request_num_channels, tvb, offset, 1, ENC_BIG_ENDIAN); } /* {15, "HFTRP FRAME CONTROL"}, */ static void dissect_s5066dts_eow_hftrp(tvbuff_t *tvb, packet_info * pinfo, guint offset, proto_tree *tree, guint pdu_type) { if (pdu_type != S5066_DPDU_MANAGEMENT) { expert_add_info(pinfo, tree, &ei_s5066dts_eow_hftrp_invalid); return; } proto_tree_add_item(tree, hf_s5066dts_eow_hftrp_hftrp_token, tvb, offset, 1, ENC_BIG_ENDIAN); } /* * Dissect EOW type according to C.5 EOW and Management Message Types */ static guint dissect_s5066dts_eow(tvbuff_t *tvb, packet_info * pinfo, guint offset, proto_tree *tree, guint pdu_type) { proto_tree *eow_tree; guint eow_type; eow_type = tvb_get_guint8(tvb, offset) & 0x0F; eow_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_s5066dts_eow, NULL, "EOW Field"); proto_tree_add_item(eow_tree, hf_s5066dts_eow_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; switch (eow_type) { case S5066_EOW_RESERVED: proto_tree_add_item(eow_tree, hf_s5066dts_eow_data, tvb, offset, 1, ENC_BIG_ENDIAN); break; case S5066_EOW_DRC_REQUEST: dissect_s5066dts_eow_drc_request(tvb, offset, eow_tree); break; case S5066_EOW_DRC_RESPONSE: dissect_s5066dts_eow_drc_response(tvb, offset, eow_tree); break; case S5066_EOW_UNRECOGNIZED_TYPE: dissect_s5066dts_eow_unrec_type(tvb, offset, eow_tree); break; case S5066_EOW_CAPABILITY: dissect_s5066dts_eow_capability(tvb, offset, eow_tree); break; case S5066_EOW_ALM_REQUEST: dissect_s5066dts_eow_alm_request(tvb, offset, eow_tree); break; case S5066_EOW_ALM_RESPONSE: dissect_s5066dts_eow_alm_response(tvb, offset, eow_tree); break; case S5066_EOW_HDR_DRC_REQUEST: dissect_s5066dts_eow_hdr_drc_request(tvb, pinfo, offset, eow_tree, pdu_type); break; case S5066_EOW_HFTRP_TOKEN: dissect_s5066dts_eow_hftrp(tvb, pinfo, offset, eow_tree, pdu_type); break; } return ++offset; } static void s5066dts_address_format( gchar *result, guint32 address_value ) { snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", address_value >> 24, (address_value >> 16) & 0xFF, (address_value >> 8) & 0xFF, address_value & 0xFF); } static guint dissect_s5066dts_address(tvbuff_t *tvb, guint offset, proto_tree *tree, packet_info *pinfo, guint addr_size) { guint32 source_address = 0, destination_address = 0; proto_tree *address_tree; unsigned int i; for ( i = 0; i < addr_size; i++) { destination_address = (destination_address << 4) | ((!(i % 2) ? (tvb_get_guint8(tvb, offset + i / 2) >> 4) : (tvb_get_guint8(tvb, offset + i / 2))) & 0x0F); source_address = (source_address << 4) | ((!((i + addr_size) % 2) ? (tvb_get_guint8(tvb, offset + (i + addr_size) / 2) >> 4) : (tvb_get_guint8(tvb, offset + (i + addr_size) / 2))) & 0x0F); } address_tree = proto_tree_add_subtree(tree, tvb, offset, addr_size, ett_s5066dts_address, NULL, "Destination & Source Addresses"); proto_tree_add_uint(address_tree, hf_s5066dts_dest_addr, tvb, offset, addr_size - addr_size / 2, destination_address); proto_tree_add_uint(address_tree, hf_s5066dts_src_addr, tvb, offset + addr_size / 2, addr_size - addr_size / 2, source_address); col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "%d.%d.%d.%d", source_address >> 24, (source_address >> 16) & 0xFF, (source_address >> 8) & 0xFF, source_address & 0xFF); col_add_fstr(pinfo->cinfo, COL_DEF_DST, "%d.%d.%d.%d", destination_address >> 24, (destination_address >> 16) & 0xFF, (destination_address >> 8) & 0xFF, destination_address & 0xFF); offset += addr_size; return offset; } static guint dissect_s5066dts_header_crc(tvbuff_t *tvb, guint offset, proto_tree *tree, guint address_size, guint header_size) { guint16 header_crc; proto_item *ti; header_crc = crc16_0x9949_tvb_offset_seed(tvb, S5066_DPDU_SYNC_SEQUENCE_SIZE, header_size + address_size - S5066_DPDU_SYNC_SEQUENCE_SIZE, 0); ti = proto_tree_add_item(tree, hf_s5066dts_header_crc, tvb, offset, 2, ENC_BIG_ENDIAN); if (header_crc == tvb_get_letohs(tvb, offset)) proto_item_append_text(ti, " (Correct)"); else proto_item_append_text(ti, " (Incorrect, should be %x)", header_crc); offset += 2; return offset; } static guint dissect_s5066dts_cpdu_crc(tvbuff_t *tvb, guint offset, proto_tree *tree, guint address_size, guint header_size, guint segmented_cpdu_size) { guint32 cpdu_crc; proto_item *ti; cpdu_crc = crc32_0x0AA725CF_tvb_offset_seed(tvb, header_size + address_size + S5066_DPDU_SYNC_SEQUENCE_SIZE, segmented_cpdu_size, 0); ti = proto_tree_add_item(tree, hf_s5066dts_cpdu_crc, tvb, offset, 4, ENC_BIG_ENDIAN); if (cpdu_crc == tvb_get_letohl(tvb, offset)) proto_item_append_text(ti, " (Correct)"); else proto_item_append_text(ti, " (Incorrect, should be %x)", cpdu_crc); offset +=4; return offset; } /* { 0, "DATA_ONLY"}, */ static guint dissect_s5066dts_data_only(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_data_only_cpdu_start, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_only_cpdu_end, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_only_deliver_in_order, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_only_drop_cpdu, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_only_tx_win_uwe, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_only_tx_win_lwe, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_only_segmented_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_data_only_transmit_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* { 1, "ACK_ONLY"}, */ static guint dissect_s5066dts_ack_only(tvbuff_t *tvb, guint offset, proto_tree *tree, guint header_size) { guint ack_size; ack_size = header_size - 7; proto_tree_add_item(tree, hf_s5066dts_ack_only_rx_lwe, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (ack_size > 0){ proto_tree_add_item(tree, hf_s5066dts_ack_only_acks, tvb, offset, ack_size, ENC_NA); offset += ack_size; } return offset; } /* { 2, "DATA_ACK"}, */ static guint dissect_s5066dts_data_ack(tvbuff_t *tvb, guint offset, proto_tree *tree, guint header_size) { guint ack_size; ack_size = header_size - 10; proto_tree_add_item(tree, hf_s5066dts_data_ack_cpdu_start, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_ack_cpdu_end, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_ack_deliver_in_order, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_ack_drop_cpdu, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_ack_tx_win_uwe, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_ack_tx_win_lwe, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_data_ack_segmented_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_data_ack_transmit_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066dts_data_ack_rx_lwe, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (ack_size > 0){ proto_tree_add_item(tree, hf_s5066dts_data_ack_acks, tvb, offset, ack_size, ENC_NA); offset += ack_size; } return offset; } /* { 3, "RESET_WIN_RESYNC"}, */ static guint dissect_s5066dts_reset_win_resync(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_unused, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_full_reset_command, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_reset_tx_win_rqst, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_reset_rx_win_cmnd, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_reset_ack, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_new_rx_lwe, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066dts_reset_win_resync_reset_frame_id_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* { 4, "EXP_DATA_ONLY"}, */ static guint dissect_s5066dts_exp_data_only(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_exp_data_only_cpdu_start, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_exp_data_only_cpdu_end, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_exp_data_only_cpdu_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_exp_data_only_segmented_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_exp_data_only_transmit_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* { 5, "EXP_ACK_ONLY"}, */ static guint dissect_s5066dts_exp_ack_only(tvbuff_t *tvb, guint offset, proto_tree *tree, guint header_size) { guint ack_size; ack_size = header_size - 7; proto_tree_add_item(tree, hf_s5066dts_exp_ack_only_rx_lwe, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (ack_size > 0) proto_tree_add_item(tree, hf_s5066dts_exp_ack_only_acks, tvb, offset, ack_size, ENC_NA); offset += ack_size; return offset; } /* { 6, "MANAGEMENT"}, */ static guint dissect_s5066dts_management(tvbuff_t *tvb, guint offset, proto_tree *tree, guint header_size) { guint8 eow_content; proto_tree *hftrp_token_tree = NULL; guint eow_type; guint extended_message_size; eow_type = tvb_get_guint8(tvb, offset) & 0x0F; eow_content = tvb_get_guint8(tvb, S5066_DPDU_EOW_CONTENT_INDEX); extended_message_size = header_size - 8; proto_tree_add_item(tree, hf_s5066dts_management_unused, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_management_extended_message_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_management_message, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_management_ack, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066dts_management_management_frame_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (eow_type == S5066_EOW_HDR_DRC_REQUEST) { proto_tree_add_item(tree, hf_s5066dts_eow_hdr_drc_request_data_rate, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s5066dts_eow_hdr_drc_request_interleaver_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else if (extended_message_size > 0) { /* If eow type is 15 then parse HFTRP token details */ if (eow_type == S5066_EOW_HFTRP_TOKEN) { /* Add a new subtree for HFTRP token details */ hftrp_token_tree = proto_tree_add_subtree_format(tree, tvb, offset, extended_message_size, ett_s5066dts_hftrp_token, NULL, "HFTRP Token (%s)", val_to_str_const(eow_content, s5066dts_eow_hftrp_frame_control, "UNKNOWN_HFTRP_TOKEN")); proto_tree_add_item(hftrp_token_tree, hf_s5066dts_management_extended_message_hftrp_payload_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hftrp_token_tree, hf_s5066dts_management_extended_message_hftrp_ra, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(hftrp_token_tree, hf_s5066dts_management_extended_message_hftrp_seq_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(hftrp_token_tree, hf_s5066dts_management_extended_message_hftrp_gen_seq_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(hftrp_token_tree, hf_s5066dts_management_extended_message_hftrp_new_successor_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(hftrp_token_tree, hf_s5066dts_management_extended_message_hftrp_number_of_nodes, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } /* otherwise just display it as a byte stream */ else { proto_tree_add_item(tree, hf_s5066dts_management_extended_message, tvb, offset, extended_message_size, ENC_NA); offset += extended_message_size; } } return offset; } /* { 7, "NON_ARQ_DATA"}, */ static guint dissect_s5066dts_non_arq_data(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_non_arq_data_cpdu_id_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_non_arq_data_deliver_in_order, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_non_arq_data_group_address, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_non_arq_data_segmented_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_non_arq_data_cpdu_id_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066dts_non_arq_data_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_non_arq_data_cpdu_segment_offset, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_non_arq_data_cpdu_reception_window, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; return offset; } /* { 8, "EXP_NON_ARQ_DATA"}, */ static guint dissect_s5066dts_exp_non_arq_data(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_cpdu_id_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_deliver_in_order, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_group_address, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_segmented_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_cpdu_id_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_cpdu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_cpdu_segment_offset, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(tree, hf_s5066dts_exp_non_arq_data_cpdu_reception_window, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; return offset; } /* {15, "WARNING"}, */ static guint dissect_s5066dts_warning(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066dts_warning_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066dts_warning_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } static guint calculate_s5066dts_dpdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_, void *data _U_) { guint pdu_type; guint address_size; guint header_size; guint pdu_size; guint segmented_cpdu_size; /* XXX: why is the offset not used to get this value? */ if (tvb_get_guint8(tvb, 0) != 0x90) return 1; else if (tvb_get_guint8(tvb, 1) != 0xEB) return 2; pdu_type = (tvb_get_guint8(tvb, 2) & 0xF0) >> 4; address_size = (tvb_get_guint8(tvb, S5066_DPDU_SIZE_OF_ADDRESS_INDEX) & 0xE0) >> 5; header_size = tvb_get_guint8(tvb, S5066_DPDU_SIZE_OF_HEADER_INDEX) & 0x1F; pdu_size = header_size + address_size + S5066_DPDU_SYNC_SEQUENCE_SIZE; if (pdu_type == S5066_DPDU_DATA_ONLY || pdu_type == S5066_DPDU_DATA_ACK || pdu_type == S5066_DPDU_EXP_DATA_ONLY || pdu_type == S5066_DPDU_NON_ARQ_DATA || pdu_type == S5066_DPDU_EXP_NON_ARQ_DATA) { segmented_cpdu_size = tvb_get_ntohs(tvb, 6 + address_size) & 0x03FF; pdu_size += segmented_cpdu_size + 4; } return pdu_size; } static int dissect_s5066dts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *s5066dts_tree = NULL, *pdu_tree = NULL; proto_item *ti = NULL; guint offset = 0; guint pdu_type; guint address_size; guint header_size; guint segmented_cpdu_size; /* Add EOW (Engineering OrderWire */ guint8 eow_type; guint8 eow_content; if (tvb_get_guint8(tvb, 0) != 0x90 || tvb_get_guint8(tvb, 1) != 0xEB) { /* Cannot find sync pattern at dissect_s5066dts()! */ return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, DISSECTOR_NAME); pdu_type = (tvb_get_guint8(tvb, 2) & 0xF0) >> 4; /* Add DPDU type and name */ col_add_fstr(pinfo->cinfo, COL_INFO, "DpduType=%d (%s)", pdu_type, val_to_str(pdu_type, s5066dts_dpdu_type, "Unknown (0x%02x)")); address_size = (tvb_get_guint8(tvb, S5066_DPDU_SIZE_OF_ADDRESS_INDEX) & 0xE0) >> 5; eow_type = tvb_get_guint8(tvb, S5066_DPDU_EOW_TYPE_INDEX) & 0x0F; eow_content = tvb_get_guint8(tvb, S5066_DPDU_EOW_CONTENT_INDEX); switch (eow_type) { case S5066_EOW_RESERVED: col_append_fstr(pinfo->cinfo, COL_INFO, " EowType=RESERVED"); break; case S5066_EOW_DRC_REQUEST: /* Data Rate Change Request */ case S5066_EOW_DRC_RESPONSE: /* Data Rate Change Response */ case S5066_EOW_UNRECOGNIZED_TYPE: /* Unrecognized Type Error */ case S5066_EOW_CAPABILITY: /* Capability Advertisement */ case S5066_EOW_ALM_REQUEST: /* Frequency Change / ALM Request */ case S5066_EOW_ALM_RESPONSE: /* Frequency Change / ALM Response */ case S5066_EOW_HDR_DRC_REQUEST: /* High Data Rate (HDR) Change Request */ col_append_fstr(pinfo->cinfo, COL_INFO, " EowType=%d (%s)", eow_type, val_to_str_const(eow_type, s5066dts_eow_type, "UNKNOWN_EOW_TYPE")); break; case 8: /* Unspecified/User Defined */ case 9: /* Unspecified/User Defined */ case 10: /* Unspecified/User Defined */ case 11: /* Unspecified/User Defined */ case 12: /* Unspecified/User Defined */ case 13: /* Unspecified/User Defined */ case 14: /* Unspecified/User Defined */ col_append_fstr(pinfo->cinfo, COL_INFO, " EowType=UNSPECIFIED"); break; case S5066_EOW_HFTRP_TOKEN: col_append_fstr(pinfo->cinfo, COL_INFO, " EowType=%d (%s:%s)", eow_type, val_to_str_const(eow_type, s5066dts_eow_type, "UNKNOWN_EOW_TYPE"), val_to_str_const(eow_content, s5066dts_eow_hftrp_frame_control_abbr, "UNKNOWN_HFTRP_TOKEN")); break; } /* Append EOT (End of Transmission) */ col_append_fstr(pinfo->cinfo, COL_INFO, " EOT=%d", tvb_get_guint8(tvb, S5066_DPDU_EOT_INDEX)); /* Append DPDU-specific information */ switch (pdu_type) { case S5066_DPDU_DATA_ONLY: case S5066_DPDU_EXP_DATA_ONLY: col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%d", tvb_get_guint8(tvb, 8 + address_size)); break; case S5066_DPDU_ACK_ONLY: case S5066_DPDU_EXP_ACK_ONLY: col_append_fstr(pinfo->cinfo, COL_INFO, " RxLWE=%d", tvb_get_guint8(tvb, 6 + address_size)); break; case S5066_DPDU_DATA_ACK: col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%d RxLWE=%d", tvb_get_guint8(tvb, 8 + address_size), tvb_get_guint8(tvb, 9 + address_size)); break; case S5066_DPDU_MANAGEMENT: col_append_fstr(pinfo->cinfo, COL_INFO, " FrameID=%d", tvb_get_guint8(tvb, 7 + address_size)); break; } if (tree) { ti = proto_tree_add_protocol_format(tree, proto_s5066dts, tvb, 0, -1, "STANAG 5066 (DTS Layer)"); s5066dts_tree = proto_item_add_subtree(ti, ett_s5066dts); proto_tree_add_item(s5066dts_tree, hf_s5066dts_sync_word, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(s5066dts_tree, hf_s5066dts_dpdu_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset = dissect_s5066dts_eow(tvb, pinfo, offset, s5066dts_tree, pdu_type); /* * Append DPDU type to the root */ proto_item_append_text(ti, ", DPDU Type %s ", val_to_str_const(pdu_type, s5066dts_dpdu_type, "UNKNOWN_DPDU_TYPE")); proto_tree_add_item(s5066dts_tree, hf_s5066dts_eot, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(s5066dts_tree, hf_s5066dts_address_size, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066dts_tree, hf_s5066dts_header_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066dts_address(tvb, offset, s5066dts_tree, pinfo, address_size); header_size = tvb_get_guint8(tvb, S5066_DPDU_SIZE_OF_HEADER_INDEX) & 0x1F; pdu_tree = proto_tree_add_subtree(s5066dts_tree, tvb, offset, header_size - 6, ett_s5066dts_pdu, NULL, "D_PDU Type Specific Header"); switch (pdu_type) { case S5066_DPDU_DATA_ONLY: offset = dissect_s5066dts_data_only(tvb, offset, pdu_tree); break; case S5066_DPDU_ACK_ONLY: offset = dissect_s5066dts_ack_only(tvb, offset, pdu_tree, header_size); break; case S5066_DPDU_DATA_ACK: offset = dissect_s5066dts_data_ack(tvb, offset, pdu_tree, header_size); break; case S5066_DPDU_RESET_WIN_RESYNC: offset = dissect_s5066dts_reset_win_resync(tvb, offset, pdu_tree); break; case S5066_DPDU_EXP_DATA_ONLY: offset = dissect_s5066dts_exp_data_only(tvb, offset, pdu_tree); break; case S5066_DPDU_EXP_ACK_ONLY: offset = dissect_s5066dts_exp_ack_only(tvb, offset, pdu_tree, header_size); break; case S5066_DPDU_MANAGEMENT: offset = dissect_s5066dts_management(tvb, offset, pdu_tree, header_size); break; case S5066_DPDU_NON_ARQ_DATA: offset = dissect_s5066dts_non_arq_data(tvb, offset, pdu_tree); break; case S5066_DPDU_EXP_NON_ARQ_DATA: offset = dissect_s5066dts_exp_non_arq_data(tvb, offset, pdu_tree); break; case S5066_DPDU_WARNING: offset = dissect_s5066dts_warning(tvb, offset, pdu_tree); break; } offset = dissect_s5066dts_header_crc(tvb, offset, s5066dts_tree, address_size, header_size); if (pdu_type == S5066_DPDU_DATA_ONLY || pdu_type == S5066_DPDU_DATA_ACK || pdu_type == S5066_DPDU_EXP_DATA_ONLY || pdu_type == S5066_DPDU_NON_ARQ_DATA || pdu_type == S5066_DPDU_EXP_NON_ARQ_DATA) { segmented_cpdu_size = tvb_get_ntohs(tvb, 6 + address_size) & 0x03FF; proto_tree_add_item(s5066dts_tree, hf_s5066dts_segmented_cpdu, tvb, offset, segmented_cpdu_size, ENC_NA); offset += segmented_cpdu_size; /*offset = */dissect_s5066dts_cpdu_crc(tvb, offset, s5066dts_tree, address_size, header_size, segmented_cpdu_size); } } return tvb_captured_length(tvb); } static int dissect_s5066dts_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint b_length = tvb_captured_length(tvb); /* Make sure there are enough bytes for a DPDU */ if ( b_length < S5066_DPDU_FRAME_HEADER_LEN){ /* "There are not enough bytes for a DPDU! */ return 0; } /* Check if the first two bytes are 0x90 and 0xEB * If not then this is neither a DPDU nor an un-reassembled one */ if ((tvb_get_guint8(tvb, 0) != 0x90) || (tvb_get_guint8(tvb, 1) != 0xEB)) { /* Cannot find sync pattern at dissect_s5066dts_raw()! */ return 0; } calculate_s5066dts_dpdu_len(pinfo, tvb, 0, NULL); dissect_s5066dts(tvb, pinfo, tree, NULL); return b_length; } static int dissect_s5066dts_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint b_length = tvb_captured_length(tvb); /* Make sure there are enough bytes for a DPDU */ if ( b_length < S5066_DPDU_FRAME_HEADER_LEN){ /* "There are not enough bytes for a DPDU! */ return 0; } /* Check if the first two bytes are 0x90 and 0xEB * If not then this is neitger a DPDU nor an un-reassembled one */ if ((tvb_get_guint8(tvb, 0) != 0x90) || (tvb_get_guint8(tvb, 1) != 0xEB)) { /* Cannot find sync pattern at dissect_s5066dts_tcp()! */ return 0; } /* Drop packets with port matches other than the destination port. */ if (!value_is_in_range(config_s5066dts_ports, pinfo->destport)) { /* Configured to dissect TCP destination port matches only, dropping.. */ return 0; } tcp_dissect_pdus(tvb, pinfo, tree, config_proto_desegment, S5066_DPDU_FRAME_HEADER_LEN, calculate_s5066dts_dpdu_len, dissect_s5066dts, data); return b_length; } static void apply_s5066dts_prefs(void) { /* STANAG 5066 uses the port preference for some heuristics */ config_s5066dts_ports = prefs_get_range_value("s5066dts", "tcp.port");; } void proto_register_s5066dts (void) { module_t *s5066dts_module; static hf_register_info hf[] = { { &hf_s5066dts_sync_word, { "Sync preamble", "s5066dts.sync", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_dpdu_type, { "D_PDU type", "s5066dts.type", FT_UINT8, BASE_DEC, VALS(s5066dts_dpdu_type), 0xF0, NULL, HFILL } }, { &hf_s5066dts_eow_type, { "EOW type", "s5066dts.eow.type", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_type), 0x0F, NULL, HFILL } }, { &hf_s5066dts_eow_data, { "EOW data", "s5066dts.eow.data", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_eot, { "EOT", "s5066dts.eot", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_address_size, { "Address size (1/2 bytes)", "s5066dts.address.size", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL } }, { &hf_s5066dts_header_size, { "Header size", "s5066dts.header_size", FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL } }, { &hf_s5066dts_segmented_cpdu, { "C_PDU Segment", "s5066dts.segmented_cpdu", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_dest_addr, { "Destination Address", "s5066dts.dest_addr", FT_UINT32, BASE_CUSTOM, CF_FUNC(s5066dts_address_format), 0x0, NULL, HFILL } }, { &hf_s5066dts_src_addr, { "Source Address", "s5066dts.src_addr", FT_UINT32, BASE_CUSTOM, CF_FUNC(s5066dts_address_format), 0x0, NULL, HFILL } }, { &hf_s5066dts_header_crc, { "CRC on header", "s5066dts.header_crc", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_cpdu_crc, { "CRC on C_PDU segment", "s5066dts.cpdu_crc", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* { 1, "DRC_REQUEST"}, */ { &hf_s5066dts_eow_drc_request_data_rate, { "Data Rate", "s5066dts.eow.drc_request.data_rate", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_data_rate), 0xF0, NULL, HFILL } }, { &hf_s5066dts_eow_drc_request_interleaving, { "Interleaver parameter", "s5066dts.eow.drc_request.interleaving", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_interleaving), 0x0C, NULL, HFILL } }, { &hf_s5066dts_eow_drc_request_others, { "Other parameters", "s5066dts.eow.drc_request.others", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_others), 0x03, NULL, HFILL } }, /* { 2, "DRC_RESPONSE"}, */ { &hf_s5066dts_eow_drc_response_response, { "Response for DRC", "s5066dts.eow.drc_response.response", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_response), 0xE0, NULL, HFILL } }, { &hf_s5066dts_eow_drc_response_reason, { "Reason", "s5066dts.eow.drc_response.reason", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_reason), 0x1F, NULL, HFILL } }, /* { 3, "UNRECOGNIZED_TYPE"}, */ { &hf_s5066dts_eow_unrec_type_response, { "This value should be set to 0", "s5066dts.eow.unrec_type.response", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL } }, { &hf_s5066dts_eow_unrec_type_reason, { "Reason", "s5066dts.eow.unrec_type.reason", FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL } }, /* { 4, "CAPABILITY"}, */ { &hf_s5066dts_eow_capability_adaptive, { "Adaptive modem parameters capable", "s5066dts.eow.capability.adaptive", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_s5066dts_eow_capability_stanag_4529, { "STANAG 4529 available", "s5066dts.eow.capability.stanag_4529", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_s5066dts_eow_capability_mil_std_188_110a, { "MIL-STD-188-110A available", "s5066dts.eow.capability.mil_std_188_110a", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_s5066dts_eow_capability_extended, { "Extended data rate available", "s5066dts.eow.capability.extended", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_s5066dts_eow_capability_full_duplex, { "Full duplex supported", "s5066dts.eow.capability.full_duplex", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_s5066dts_eow_capability_split_frequency, { "Split frequency supported", "s5066dts.eow.capability.split_frequency", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_eow_capability_non_arcs_ale, { "Non-ARCS ALE capable", "s5066dts.eow.capability.non_arcs_ale", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_s5066dts_eow_capability_arcs, { "ARCS capable", "s5066dts.eow.capability.arcs", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, /* { 5, "ALM_REQUEST"}, */ { &hf_s5066dts_eow_alm_request_data_rate, { "Data Rate", "s5066dts.eow.alm_request.data_rate", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_data_rate), 0xF0, NULL, HFILL } }, { &hf_s5066dts_eow_alm_request_interleaving, { "Interleaver parameter", "s5066dts.eow.alm_request.interleaving", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_interleaving), 0x0C, NULL, HFILL } }, { &hf_s5066dts_eow_alm_request_others, { "Other parameters", "s5066dts.eow.alm_request.others", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_others), 0x03, NULL, HFILL } }, /* { 6, "ALM_RESPONSE"}, */ { &hf_s5066dts_eow_alm_response_response, { "Response for DRC", "s5066dts.eow.alm_response.response", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_response), 0xE0, NULL, HFILL } }, { &hf_s5066dts_eow_alm_response_reason, { "Reason", "s5066dts.eow.alm_response.reason", FT_UINT8, BASE_DEC, VALS(s5066dts_alm_reason), 0x1F, NULL, HFILL } }, /* { 7, "HDR_DRC_REQUEST"}, */ { &hf_s5066dts_eow_hdr_drc_request_waveform, { "Modem waveform", "s5066dts.eow.hdr_drc_request.waveform", FT_UINT8, BASE_DEC, VALS(s5066dts_eow_waveform), 0xF8, NULL, HFILL } }, { &hf_s5066dts_eow_hdr_drc_request_num_channels, { "Number of channels", "s5066dts.eow.hdr_drc_request.num_channels", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL } }, { &hf_s5066dts_eow_hdr_drc_request_data_rate, { "Requested data rate for each channel", "s5066dts.eow.hdr_drc_request.data_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_eow_hdr_drc_request_interleaver_length, { "Interleaver length for each channel", "s5066dts.eow.hdr_drc_request.interleaver_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* { 15, "HFTRP FRAME CONTROL"}, */ { &hf_s5066dts_eow_hftrp_hftrp_token, { "HFTRP Token Type", "s5066dts.eow.hftrp.token_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, /* { 0, "DATA_ONLY"}, */ { &hf_s5066dts_data_only_cpdu_start, { "C_PDU Start", "s5066dts.data_only.cpdu_start", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_s5066dts_data_only_cpdu_end, { "C_PDU End", "s5066dts.data_only.cpdu_end", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_s5066dts_data_only_deliver_in_order, { "C_PDU Deliver-in-Order", "s5066dts.data_only.deliver_in_order", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_s5066dts_data_only_drop_cpdu, { "Drop C_PDU", "s5066dts.data_only.drop_cpdu", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_s5066dts_data_only_tx_win_uwe, { "TX WIN UWE", "s5066dts.data_only.tx_win_uwe", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_s5066dts_data_only_tx_win_lwe, { "TX WIN LWE", "s5066dts.data_only.tx_win_lwe", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_data_only_segmented_cpdu_size, { "Size of segmented C_PDU", "s5066dts.data_only.segmented_cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, { &hf_s5066dts_data_only_transmit_sequence_number, { "TX Frame Sequence Number", "s5066dts.data_only.transmit_sequence_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* { 1, "ACK_ONLY"}, */ { &hf_s5066dts_ack_only_rx_lwe, { "RX LWE", "s5066dts.ack_only.rx_lwe", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_ack_only_acks, { "Selective ACK", "s5066dts.ack_only.acks", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* { 2, "DATA_ACK"}, */ { &hf_s5066dts_data_ack_cpdu_start, { "C_PDU Start", "s5066dts.data_ack.cpdu_start", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_s5066dts_data_ack_cpdu_end, { "C_PDU End", "s5066dts.data_ack.cpdu_end", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_s5066dts_data_ack_deliver_in_order, { "C_PDU Deliver-in-Order", "s5066dts.data_ack.deliver_in_order", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_s5066dts_data_ack_drop_cpdu, { "Drop C_PDU", "s5066dts.data_ack.drop_cpdu", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_s5066dts_data_ack_tx_win_uwe, { "TX WIN UWE", "s5066dts.data_ack.tx_win_uwe", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_s5066dts_data_ack_tx_win_lwe, { "TX WIN LWE", "s5066dts.data_ack.tx_win_lwe", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_data_ack_segmented_cpdu_size, { "Size of segmented C_PDU", "s5066dts.data_ack.segmented_cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, { &hf_s5066dts_data_ack_transmit_sequence_number, { "TX frame sequence number", "s5066dts.data_ack.transmit_sequence_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_data_ack_rx_lwe, { "RX LWE", "s5066dts.data_ack.rx_lwe", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_data_ack_acks, { "Selective ACK", "s5066dts.data_ack.acks", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* { 3, "RESET_WIN_RESYNC"}, */ { &hf_s5066dts_reset_win_resync_unused, { "Unused", "s5066dts.reset_win_resync.unused", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066dts_reset_win_resync_full_reset_command, { "Full reset command", "s5066dts.reset_win_resync.full_reset", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_s5066dts_reset_win_resync_reset_tx_win_rqst, { "Reset TX-WIN request", "s5066dts.reset_win_resync.reset_tx_win", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_reset_win_resync_reset_rx_win_cmnd, { "Reset RX-WIN command", "s5066dts.reset_win_resync.reset_rx_win", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_s5066dts_reset_win_resync_reset_ack, { "Reset acknowledgment", "s5066dts.reset_win_resync.reset_ack", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_s5066dts_reset_win_resync_new_rx_lwe, { "New receiver ARQ RX-LWE", "s5066dts.reset_win_resync.new_rx_lwe", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_reset_win_resync_reset_frame_id_number, { "Reset frame ID number", "s5066dts.reset_win_resync.reset_frame_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* { 4, "EXP_DATA_ONLY"}, */ { &hf_s5066dts_exp_data_only_cpdu_start, { "C_PDU Start", "s5066dts.exp_data_only.cpdu_start", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_s5066dts_exp_data_only_cpdu_end, { "C_PDU End", "s5066dts.exp_data_only.cpdu_end", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_s5066dts_exp_data_only_cpdu_id, { "Segmented C_PDU ID", "s5066dts.exp_data_only.cpdu_id", FT_UINT8, BASE_DEC, NULL, 0x3C, NULL, HFILL } }, { &hf_s5066dts_exp_data_only_segmented_cpdu_size, { "Size of segmented C_PDU", "s5066dts.exp_data_only.segmented_cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, { &hf_s5066dts_exp_data_only_transmit_sequence_number, { "TX frame sequence number", "s5066dts.exp_data_only.transmit_sequence_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* { 5, "EXP_ACK_ONLY"}, */ { &hf_s5066dts_exp_ack_only_rx_lwe, { "RX LWE", "s5066dts.exp_ack_only.rx_lwe", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_exp_ack_only_acks, { "Selective ACK", "s5066dts.exp_ack_only.acks", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* { 6, "MANAGEMENT"}, */ { &hf_s5066dts_management_unused, { "Unused", "s5066dts.management.unused", FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_flag, { "Extended message flag", "s5066dts.management.extended_message_flag", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_management_message, { "Valid message", "s5066dts.management.message", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_s5066dts_management_ack, { "Acknowledgment", "s5066dts.management.ack", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_s5066dts_management_management_frame_id, { "Management frame ID number", "s5066dts.management.management_frame_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message, { "Extended management message", "s5066dts.management.extended_message", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_hftrp_payload_size, { "Payload Size", "s5066dts.management.extended_message.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_hftrp_ra, { "Ring Address", "s5066dts.management.extended_message.ring_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_hftrp_seq_id, { "Sequence ID", "s5066dts.management.extended_message.sequence_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_hftrp_gen_seq_id, { "Generation Sequence ID", "s5066dts.management.extended_message.generation_sequence_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_hftrp_new_successor_id, { "New Successor ID", "s5066dts.management.extended_message.new_successor_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_management_extended_message_hftrp_number_of_nodes, { "Number of Nodes", "s5066dts.management.extended_message.number_of_nodes", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* { 7, "NON_ARQ_DATA"}, */ { &hf_s5066dts_non_arq_data_cpdu_id_1, { "C_PDU ID number (field 1)", "s5066dts.non_arq_data.cpdu_id_1", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_deliver_in_order, { "C_PDU Deliver-in-Order", "s5066dts.non_arq_data.deliver_in_order", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_group_address, { "Group Address", "s5066dts.non_arq_data.group_address", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_cpdu_id_2, { "C_PDU ID number (field 2)", "s5066dts.non_arq_data.cpdu_id_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_cpdu_size, { "C_PDU size", "s5066dts.non_arq_data.cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_cpdu_segment_offset, { "Offset of segmented C_PDU", "s5066dts.non_arq_data.cpdu_segment_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_cpdu_reception_window, { "C_PDU reception window", "s5066dts.non_arq_data.cpdu_reception_window", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_non_arq_data_segmented_cpdu_size, { "Size of segmented C_PDU", "s5066dts.non_arq_data.segmented_cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, /* { 8, "EXP_NON_ARQ_DATA"}, */ { &hf_s5066dts_exp_non_arq_data_cpdu_id_1, { "C_PDU ID number (field 1)", "s5066dts.exp_non_arq_data.cpdu_id_1", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_deliver_in_order, { "C_PDU Deliver-in-Order", "s5066dts.exp_non_arq_data.deliver_in_order", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_group_address, { "Group Address", "s5066dts.exp_non_arq_data.group_address", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_cpdu_id_2, { "C_PDU ID number (field 2)", "s5066dts.exp_non_arq_data.cpdu_id_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_cpdu_size, { "C_PDU size", "s5066dts.exp_non_arq_data.cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_cpdu_segment_offset, { "Offset of segmented C_PDU", "s5066dts.exp_non_arq_data.cpdu_segment_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_cpdu_reception_window, { "C_PDU reception window", "s5066dts.exp_non_arq_data.cpdu_reception_window", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066dts_exp_non_arq_data_segmented_cpdu_size, { "Size of segmented C_PDU", "s5066dts.exp_non_arq_data.segmented_cpdu_size", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, /* {15, "WARNING"}, */ { &hf_s5066dts_warning_frame_type, { "Received frame type", "s5066dts.warning.frame_type", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066dts_warning_reason, { "Reason warning sent", "s5066dts.warning.reason", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, }; static gint *ett[] = { &ett_s5066dts, &ett_s5066dts_eow, &ett_s5066dts_address, &ett_s5066dts_pdu, &ett_s5066dts_hftrp_token, }; /* Setup protocol expert items */ static ei_register_info ei[] = { { &ei_s5066dts_eow_hdr_drc_request_invalid, { "s5066dts.eow_hdr_drc_request.invalid", PI_MALFORMED, PI_ERROR, "High data rate change request can only be made in Management D_PDU", EXPFILL }}, { &ei_s5066dts_eow_hftrp_invalid, { "s5066dts.eow_hftrp.invalid", PI_MALFORMED, PI_ERROR, "HFTRP tokens can only be carried with Management D_PDU", EXPFILL }}, }; expert_module_t* expert_s5066dts; if (proto_s5066dts == -1) /* do protocol initialization only once */ { proto_s5066dts = proto_register_protocol ("STANAG 5066(DTS layer)", "STANAG 5066 DTS", "s5066dts"); proto_register_field_array(proto_s5066dts, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_s5066dts = expert_register_protocol(proto_s5066dts); expert_register_field_array(expert_s5066dts, ei, array_length(ei)); register_dissector(DISSECTOR_NAME, dissect_s5066dts_tcp, proto_s5066dts); } s5066dts_module = prefs_register_protocol(proto_s5066dts, apply_s5066dts_prefs); prefs_register_bool_preference(s5066dts_module, "proto_desegment", "Reassemble STANAG 5066 DPDUs spanning multiple TCP segments", "Whether the STANAG 5066 DTS Layer dissector should reassemble DPDUs spanning multiple TCP segments", &config_proto_desegment); } /* Routine that will be called when s5066dts is handing off to the next dissector */ void proto_reg_handoff_s5066dts(void) { dissector_handle_t s5066dts_handle; dissector_handle_t s5066dts_over_tcp_handle; s5066dts_handle = create_dissector_handle(dissect_s5066dts_raw, proto_s5066dts); dissector_add_uint("wtap_encap", WTAP_ENCAP_STANAG_5066_D_PDU, s5066dts_handle); s5066dts_over_tcp_handle = create_dissector_handle(dissect_s5066dts_tcp, proto_s5066dts); dissector_add_for_decode_as_with_preference("tcp.port", s5066dts_over_tcp_handle); apply_s5066dts_prefs(); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-s5066sis.c
/* packet-s5066sis.c * Routines to dissect STANAG 5066 Subnetwork Interface Sublayer (SIS) * packets, as described in Annex A of STANAG 5066. * * Copyright (c) 2005 by Menno Andriesse <s5066 [AT] nc3a.nato.int> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include "packet-tcp.h" /* For tcp_dissect_pdus() */ #include "packet-s5066sis.h" /* SapIDs for RCOP/UDOP clients */ # define SAPID_TMMHS 2 # define SAPID_RCOP 6 # define SAPID_UDOP 7 /* Forward reference */ /* Register functions */ void proto_register_s5066(void); void proto_reg_handoff_s5066(void); /* Main dissectors */ static int dissect_s5066_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data); static guint get_s5066_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data); static int dissect_s5066_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_); /* Client transport layer header dissctor */ static guint dissect_s5066_client_transport_header(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 sapid, guint *client_app_id); /* Service type and address dissectors */ static guint dissect_s5066_servicetype(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_address(tvbuff_t *tvb, guint offset, proto_tree *tree, gint source); /* S-Primitive dissectors */ static guint dissect_s5066_01(tvbuff_t *tvb, guint offset, proto_tree *tree); /* static guint dissect_s5066_02(tvbuff_t *tvb, guint offset, proto_tree *tree); */ static guint dissect_s5066_03(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_04(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_05(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_06(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_07(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_08(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_09(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_10(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_11(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_12(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_13(tvbuff_t *tvb, guint offset, proto_tree *tree); static guint dissect_s5066_14(tvbuff_t *tvb, guint offset, proto_tree *tree); /* static guint dissect_s5066_15(tvbuff_t *tvb, guint offset, proto_tree *tree); */ /* static guint dissect_s5066_16(tvbuff_t *tvb, guint offset, proto_tree *tree); */ /* static guint dissect_s5066_17(tvbuff_t *tvb, guint offset, proto_tree *tree); */ static guint dissect_s5066_18(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size); static guint dissect_s5066_19(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size); static guint dissect_s5066_20(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id); static guint dissect_s5066_21(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size, guint *client_app_id); static guint dissect_s5066_22(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id); static guint dissect_s5066_23(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id); static guint dissect_s5066_24(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id); static guint dissect_s5066_25(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size, guint *client_app_id); static guint dissect_s5066_26(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id); static guint dissect_s5066_27(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id); static gint proto_s5066 = -1; static dissector_table_t s5066sis_dissector_table; /* Enable desegmentation of S5066 over TCP */ static gboolean s5066_desegment = TRUE; /* Dissect old 'edition 1' of STANAG 5066 (It lacks the 'version' field.) */ static gboolean s5066_edition_one = FALSE; /* This port is registered with IANA */ #define S5066_PORT 5066 /* Size of header outside 'size' field */ static gint s5066_header_size = 5; /* Offset of 'size' field */ static gint s5066_size_offset = 3; /* Sync should be 0x90EB */ static gint hf_s5066_sync_word = -1; /* Version should be 0x00 */ static gint hf_s5066_version = -1; /* Total size of the PDU, excluding this size and previous fields */ /* So total size is this + 5 bytes (s5066_header_size) */ static gint hf_s5066_size = -1; /* Th type of PDU */ static gint hf_s5066_type = -1; static const value_string s5066_pdu_type[] = { { 1, "S_BIND_REQUEST"}, { 2, "S_UNBIND_REQUEST"}, { 3, "S_BIND_ACCEPTED"}, { 4, "S_BIND_REJECTED"}, { 5, "S_UNBIND_INDICATION"}, { 6, "S_HARD_LINK_ESTABLISH"}, { 7, "S_HARD_LINK_TERMINATE"}, { 8, "S_HARD_LINK_ESTABLISHED"}, { 9, "S_HARD_LINK_REJECTED"}, {10, "S_HARD_LINK_TERMINATED"}, {11, "S_HARD_LINK_INDICATION"}, {12, "S_HARD_LINK_ACCEPT"}, {13, "S_HARD_LINK_REJECT"}, {14, "S_SUBNET_AVAILABILITY"}, {15, "S_DATAFLOW_ON"}, {16, "S_DATAFLOW_OFF"}, {17, "S_KEEP_ALIVE"}, {18, "S_MANAGEMENT_MESSAGE_REQUEST"}, {19, "S_MANAGEMENT_MESSAGE_INDICATION"}, {20, "S_UNIDATA_REQUEST"}, {21, "S_UNIDATA_INDICATION"}, {22, "S_UNIDATA_REQUEST_CONFIRM"}, {23, "S_UNIDATA_REQUEST_REJECTED"}, {24, "S_EXPEDITED_UNIDATA_REQUEST"}, {25, "S_EXPEDITED_UNIDATA_INDICATION"}, {26, "S_EXPEDITED_UNIDATA_REQUEST_CONFIRM"}, {27, "S_EXPEDITED_UNIDATA_REQUEST_REJECTED"}, { 0, NULL }, }; /* STANAG 5066 Address */ /* Size is defined in nibbles (4 bits) */ static gint hf_s5066_ad_size = -1; /* Group flag: 0 = false, 1 = true */ static gint hf_s5066_ad_group = -1; /* The remainder of the 4 bytes form the address */ static gint hf_s5066_ad_address = -1; /* Service type */ /* Transmission mode: */ static gint hf_s5066_st_txmode = -1; static const value_string s5066_st_txmode[] = { { 0, "Ignore service type field"}, { 1, "ARQ"}, { 2, "Non-ARQ (Broadcast)"}, { 3, "Non-ARQ (with errors)"}, { 4, "Other non-ARQ types"}, { 5, "Other non-ARQ types"}, { 6, "Other non-ARQ types"}, { 7, "Other non-ARQ types"}, { 8, "Other non-ARQ types"}, { 9, "Other non-ARQ types"}, {10, "Other non-ARQ types"}, {11, "Other non-ARQ types"}, {12, "Other non-ARQ types"}, {13, "Other non-ARQ types"}, {14, "Other non-ARQ types"}, {15, "Other non-ARQ types"}, { 0, NULL }, }; /* Delivery confirmation: */ static gint hf_s5066_st_delivery_confirmation = -1; static const value_string s5066_st_delivery_confirmation[] = { { 0, "No confirmation"}, { 1, "Node delivery confirmation"}, { 2, "Client delivery confirmation"}, { 3, "-- Not defined --"}, { 0, NULL }, }; /* Delivery order: */ static gint hf_s5066_st_delivery_order = -1; static const value_string s5066_st_delivery_order[] = { { 0, "In-order delivery"}, { 1, "As-they-arrive"}, { 0, NULL }, }; /* Extended field present: (Never in the current version.) */ static gint hf_s5066_st_extended = -1; static const value_string s5066_st_extended[] = { { 0, "No extended field"}, { 1, "Extended field follows"}, { 0, NULL }, }; /* Number of retransmissions when in Non-ARQ: */ static gint hf_s5066_st_retries = -1; /* Client transport layer header */ static gint hf_s5066_ctl_conn_id = -1; static gint hf_s5066_ctl_reserved = -1; static gint hf_s5066_ctl_updu_id = -1; static gint hf_s5066_ctl_updu_segment = -1; static gint hf_s5066_ctl_app_id = -1; static const value_string s5066_client_application_ids[] = { { S5066_CLIENT_BFTP, "Basic File Transfer Protocol (BFTP) File Transfer Service"}, { S5066_CLIENT_FRAP, "File-Receipt/Acknowledgement Protocol"}, { S5066_CLIENT_FRAP_V2, "File-Receipt/Acknowledgement Protocol Version 2"}, { S5066_CLIENT_S4406_ANNEX_E_TMI_1_P_MUL, "STANAG 4406 ANNEX E: Acp 142 (TMI-1)"}, { S5066_CLIENT_S4406_ANNEX_E_TMI_2, "STANAG 4406 ANNEX E (TMI-2)"}, { S5066_CLIENT_S4406_ANNEX_E_TMI_3, "STANAG 4406 ANNEX E (TMI-3)"}, { S5066_CLIENT_S4406_ANNEX_E_TMI_4_DMP, "STANAG 4406 ANNEX E: DMP (TMI-4)"}, { S5066_CLIENT_S4406_ANNEX_E_TMI_5_ACP_127, "STANAG 4406 ANNEX E: Acp 127 Access Unit (TMI-5)"}, { 0, NULL }, }; /* SAP ID Assignments from Table F-1 */ static const value_string s5066_sapid_assignments[] = { { 0, "Subnet management client"}, { 1, "Character-Oriented Serial Stream (COSS) Client"}, { 2, "STANAG 4406 Annex E - Tactical Military Message Handling (T-MMHS) Client"}, { 3, "HMTP (HF Mail Transfer Protocol)"}, { 4, "HFPOP (HF Post-Office Protocol)"}, { 5, "Operator orderwire (HFCHAT)"}, { 6, "Reliable Connection-Oriented Protocol (RCOP) w/ Extended Client"}, { 7, "Unreliable Datagram Oriented Protocol (UDOP) w/ Extended Client"}, { 8, "ETHER client"}, { 9, "IP client"}, { 10, "RESERVED - for future assignment"}, { 11, "RESERVED - for future assignment"}, { 12, "Compressed File Transport Protocol (CFTP)"}, { 13, "UNASSIGNED - available for arbitrary use"}, { 14, "UNASSIGNED - available for arbitrary use"}, { 15, "UNASSIGNED - available for arbitrary use"}, { 0, NULL }, }; /* Type 1: S_BIND_REQUEST */ static gint hf_s5066_01_sapid = -1; static gint hf_s5066_01_rank = -1; static gint hf_s5066_01_unused = -1; /* Type 2: S_UNBIND_REQUEST */ /* --- no subfields --- */ /* Type 3: S_BIND_ACCEPTED */ static gint hf_s5066_03_sapid = -1; static gint hf_s5066_03_unused = -1; static gint hf_s5066_03_mtu = -1; /* Type 4: S_BIND_REJECTED */ static gint hf_s5066_04_reason = -1; static const value_string s5066_04_reason[] = { { 0, "Unknown reason"}, { 1, "Not enough resources"}, { 2, "Invalid Sap ID"}, { 3, "Sap ID already allocated"}, { 4, "ARQ mode unsupportable during broadcast session"}, { 0, NULL }, }; /* Type 5: S_UNBIND_INDICATION */ static gint hf_s5066_05_reason = -1; static const value_string s5066_05_reason[] = { { 0, "Unknown reason"}, { 1, "Connection pre-empted by higher ranking client"}, { 2, "Inactivity (failure to respond to 'Keep-alive')"}, { 3, "Too many invalid primitives"}, { 4, "Too many expedited data request primitives"}, { 5, "ARQ mode unsupportable during broadcast session"}, { 0, NULL }, }; /* Hard links: hardlinktype value string array. */ static const value_string s5066_hard_link_type[] = { { 0, "Link reservation"}, { 1, "Partial Bandwidth reservation"}, { 2, "Full Bandwidth reservation"}, { 3, "--- undefined ---"}, { 0, NULL }, }; /* Type 6: S_HARD_LINK_ESTABLISH */ static gint hf_s5066_06_link_type = -1; static gint hf_s5066_06_link_priority = -1; static gint hf_s5066_06_sapid = -1; /* Type 7: S_HARD_LINK_TERMINATE */ /* Only remote node address */ /* Type 8: S_HARD_LINK_ESTABLISHED */ static gint hf_s5066_08_remote_status = -1; static const value_string s5066_08_remote_status[] = { { 0, "ERROR"}, { 1, "OK"}, { 0, NULL }, }; static gint hf_s5066_08_link_type = -1; static gint hf_s5066_08_link_priority = -1; static gint hf_s5066_08_sapid = -1; /* Type 9: S_HARD_LINK_REJECTED */ static gint hf_s5066_09_reason = -1; static const value_string s5066_09_reason[] = { { 0, "--- undefined ---"}, { 1, "Remote node busy"}, { 2, "Higher priority link exists"}, { 3, "Remote node not responding"}, { 4, "Destination Sap ID not bound"}, { 5, "Requested Type-0 link exists"}, { 0, NULL }, }; static gint hf_s5066_09_link_type = -1; static gint hf_s5066_09_link_priority = -1; static gint hf_s5066_09_sapid = -1; /* Type 10: S_HARD_LINK_TERMINATED */ static gint hf_s5066_10_reason = -1; static const value_string s5066_10_reason[] = { { 0, "--- undefined ---"}, { 1, "Link terminated by remote node"}, { 2, "Higher priority link requested"}, { 3, "Remote node not responding"}, { 4, "Destination Sap ID not bound"}, { 5, "Physical link broken"}, { 0, NULL }, }; static gint hf_s5066_10_link_type = -1; static gint hf_s5066_10_link_priority = -1; static gint hf_s5066_10_sapid = -1; /* Type 11: S_HARD_LINK_INDICATION */ static gint hf_s5066_11_remote_status = -1; static const value_string s5066_11_remote_status[] = { { 0, "ERROR"}, { 1, "OK"}, { 0, NULL }, }; static gint hf_s5066_11_link_type = -1; static gint hf_s5066_11_link_priority = -1; static gint hf_s5066_11_sapid = -1; /* Type 12: S_HARD_LINK_ACCEPT */ static gint hf_s5066_12_link_type = -1; static gint hf_s5066_12_link_priority = -1; static gint hf_s5066_12_sapid = -1; /* Type 13: S_HARD_LINK_REJECT */ static gint hf_s5066_13_reason = -1; static const value_string s5066_13_reason[] = { { 0, "--- undefined ---"}, { 0, NULL }, }; static gint hf_s5066_13_link_type = -1; static gint hf_s5066_13_link_priority = -1; static gint hf_s5066_13_sapid = -1; /* Type 14: S_SUBNET_AVAILABILITY */ static gint hf_s5066_14_status= -1; static const value_string s5066_14_status[] = { { 0, "Off"}, { 1, "On"}, { 2, "Receive only"}, { 3, "Half-duplex"}, { 4, "Full-duplex"}, { 0, NULL }, }; static gint hf_s5066_14_reason= -1; static const value_string s5066_14_reason[] = { { 0, "Unknown reason"}, { 1, "Local node in EMCON"}, { 2, "Higher priority link requested"}, { 0, NULL }, }; /* Type 15: S_DATAFLOW_ON */ /* --- no subfields --- */ /* Type 16: S_DATAFLOW_OFF */ /* --- no subfields --- */ /* Type 17: S_KEEP_ALIVE */ /* --- no subfields --- */ /* Type 18: S_MANAGEMENT_MESSAGE_REQUEST */ static gint hf_s5066_18_type = -1; static gint hf_s5066_18_body = -1; /* Type 19: S_MANAGEMENT_MESSAGE_INDICATION */ static gint hf_s5066_19_type = -1; static gint hf_s5066_19_body = -1; /* Type 20: S_UNIDATA_REQUEST */ static gint hf_s5066_20_priority = -1; static gint hf_s5066_20_sapid = -1; static gint hf_s5066_20_ttl = -1; static gint hf_s5066_20_size = -1; /* Type 21: S_UNIDATA_INDICATION */ static gint hf_s5066_21_priority = -1; static gint hf_s5066_21_dest_sapid = -1; static gint hf_s5066_21_tx_mode = -1; static gint hf_s5066_21_src_sapid = -1; static gint hf_s5066_21_size = -1; static gint hf_s5066_21_err_blocks = -1; static gint hf_s5066_21_err_ptr = -1; static gint hf_s5066_21_err_size = -1; static gint hf_s5066_21_nrx_blocks = -1; static gint hf_s5066_21_nrx_ptr = -1; static gint hf_s5066_21_nrx_size = -1; /* Type 22: S_UNIDATA_REQUEST_CONFIRM */ static gint hf_s5066_22_unused = -1; static gint hf_s5066_22_sapid = -1; static gint hf_s5066_22_size = -1; static gint hf_s5066_22_data = -1; /* Type 23: S_UNIDATA_REQUEST_REJECTED */ static gint hf_s5066_23_reason = -1; static const value_string s5066_23_reason[] = { { 0, "Unknown reason"}, { 1, "Time-To-Live expired"}, { 2, "Destination SapID not bound"}, { 3, "Destination node not responding"}, { 4, "U_PDU larger than MTU"}, { 5, "Transmission Mode not specified"}, { 0, NULL }, }; static gint hf_s5066_23_sapid = -1; static gint hf_s5066_23_size = -1; static gint hf_s5066_23_data = -1; /* Type 24: S_EXPEDITED_UNIDATA_REQUEST */ static gint hf_s5066_24_unused = -1; static gint hf_s5066_24_sapid = -1; static gint hf_s5066_24_ttl = -1; static gint hf_s5066_24_size = -1; /* Type 25: S_EXPEDITED_UNIDATA_INDICATION */ static gint hf_s5066_25_unused = -1; static gint hf_s5066_25_dest_sapid = -1; static gint hf_s5066_25_tx_mode = -1; static gint hf_s5066_25_src_sapid = -1; static gint hf_s5066_25_size = -1; static gint hf_s5066_25_err_blocks = -1; static gint hf_s5066_25_err_ptr = -1; static gint hf_s5066_25_err_size = -1; static gint hf_s5066_25_nrx_blocks = -1; static gint hf_s5066_25_nrx_ptr = -1; static gint hf_s5066_25_nrx_size = -1; /* Type 26: S_EXPEDITED_UNIDATA_REQUEST_CONFIRM */ static gint hf_s5066_26_unused = -1; static gint hf_s5066_26_sapid = -1; static gint hf_s5066_26_size = -1; static gint hf_s5066_26_data = -1; /* Type 27: S_EXPEDITED_UNIDATA_REQUEST_REJECTED */ static gint hf_s5066_27_reason = -1; static const value_string s5066_27_reason[] = { { 0, "Unknown reason"}, { 1, "Time-To-Live expired"}, { 2, "Destination SapID not bound"}, { 3, "Destination node not responding"}, { 4, "U_PDU larger than MTU"}, { 5, "Transmission Mode not specified"}, { 0, NULL }, }; static gint hf_s5066_27_sapid = -1; static gint hf_s5066_27_size = -1; static gint hf_s5066_27_data = -1; static gint ett_s5066 = -1; static gint ett_s5066_pdu = -1; static gint ett_s5066_servicetype = -1; static gint ett_s5066_client_transport_header = -1; static gint ett_s5066_address = -1; static guint dissect_s5066_address(tvbuff_t *tvb, guint offset, proto_tree *tree, gint source) { proto_tree *s5066_tree_address; guint32 addr; if (source) { s5066_tree_address = proto_tree_add_subtree(tree, tvb, offset, 4, ett_s5066_address, NULL, "Source Address"); } else { s5066_tree_address = proto_tree_add_subtree(tree, tvb, offset, 4, ett_s5066_address, NULL, "Destination Address"); } proto_tree_add_item(s5066_tree_address, hf_s5066_ad_size, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066_tree_address, hf_s5066_ad_group, tvb, offset, 1, ENC_BIG_ENDIAN); addr = tvb_get_ntohl(tvb, offset); addr = addr & 0x1FFFFFFF; proto_tree_add_ipv4(s5066_tree_address, hf_s5066_ad_address, tvb, offset, 4, g_htonl(addr)); return offset + 4; } static guint dissect_s5066_servicetype(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree *s5066_tree_servicetype; s5066_tree_servicetype = proto_tree_add_subtree(tree, tvb, offset, 2, ett_s5066_servicetype, NULL, "Service type"); proto_tree_add_item(s5066_tree_servicetype, hf_s5066_st_txmode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066_tree_servicetype, hf_s5066_st_delivery_confirmation, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066_tree_servicetype, hf_s5066_st_delivery_order, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066_tree_servicetype, hf_s5066_st_extended, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(s5066_tree_servicetype, hf_s5066_st_retries, tvb, offset, 1, ENC_BIG_ENDIAN); return offset; } static guint dissect_s5066_client_transport_header(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 sapid, guint *client_app_id) { proto_tree *s5066_tree_client_transport_header; if (!((sapid == SAPID_TMMHS) || (sapid == SAPID_RCOP) || (sapid == SAPID_UDOP))) { return offset; } s5066_tree_client_transport_header = proto_tree_add_subtree(tree, tvb, offset, 6, ett_s5066_client_transport_header, NULL, "Client Transport Layer Header"); proto_tree_add_item(s5066_tree_client_transport_header, hf_s5066_ctl_conn_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066_tree_client_transport_header, hf_s5066_ctl_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(s5066_tree_client_transport_header, hf_s5066_ctl_updu_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(s5066_tree_client_transport_header, hf_s5066_ctl_updu_segment, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; *client_app_id = tvb_get_ntohs(tvb, offset); proto_tree_add_item(s5066_tree_client_transport_header, hf_s5066_ctl_app_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } /* S_BIND_REQUEST */ static guint dissect_s5066_01(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_01_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_01_rank, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_servicetype(tvb, offset, tree); proto_tree_add_item(tree, hf_s5066_01_unused, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* S_UNBIND_REQUEST */ /* Commented out: does nothing and causes <variable not used> messages. static guint dissect_s5066_02(tvbuff_t *tvb, guint offset, proto_tree *tree) { return offset; } */ /* S_BIND_ACCEPTED */ static guint dissect_s5066_03(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_03_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_03_unused, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_03_mtu, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; return offset; } /* S_BIND_REJECTED */ static guint dissect_s5066_04(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_04_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* S_UNBIND_INDICATION */ static guint dissect_s5066_05(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_05_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* S_HARD_LINK_ESTABLISH */ static guint dissect_s5066_06(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_06_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_06_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_06_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_TERMINATE */ static guint dissect_s5066_07(tvbuff_t *tvb, guint offset, proto_tree *tree) { offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_ESTABLISHED */ static guint dissect_s5066_08(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_08_remote_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_08_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_08_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_08_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_REJECTED */ static guint dissect_s5066_09(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_09_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_09_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_09_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_09_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_TERMINATED */ static guint dissect_s5066_10(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_10_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_10_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_10_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_10_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_INDICATION */ static guint dissect_s5066_11(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_11_remote_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_11_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_11_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_11_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_ACCEPT */ static guint dissect_s5066_12(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_12_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_12_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_12_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_HARD_LINK_REJECT */ static guint dissect_s5066_13(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_13_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_13_link_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_13_link_priority, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_13_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); return offset; } /* S_SUBNET_AVAILABILITY */ static guint dissect_s5066_14(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_s5066_14_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_s5066_14_reason, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset; } /* Following three commented out: do nothing and cause <variable not used> messages. */ /* S_DATA_FLOW_ON */ /* static guint dissect_s5066_15(tvbuff_t *tvb, guint offset, proto_tree *tree) { return offset; } */ /* S_DATA_FLOW_OFF */ /* static guint dissect_s5066_16(tvbuff_t *tvb, guint offset, proto_tree *tree) { return offset; } */ /* S_KEEP_ALIVE */ /* static guint dissect_s5066_17(tvbuff_t *tvb, guint offset, proto_tree *tree) { return offset; } */ /* S_MANAGEMENT_MESSAGE_REQUEST */ static guint dissect_s5066_18(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size) { guint body_size = 0; proto_tree_add_item(tree, hf_s5066_18_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; body_size = pdu_size - offset; proto_tree_add_item(tree, hf_s5066_18_body, tvb, offset, body_size, ENC_NA); offset += body_size; return offset; } /* S_MANAGEMENT_MESSAGE_INDICATION */ static guint dissect_s5066_19(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size) { guint body_size = 0; proto_tree_add_item(tree, hf_s5066_19_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; body_size = pdu_size - offset; proto_tree_add_item(tree, hf_s5066_19_body, tvb, offset, body_size, ENC_NA); offset += body_size; return offset; } /* S_UNIDATA_REQUEST */ static guint dissect_s5066_20(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id) { guint8 sapid; proto_tree_add_item(tree, hf_s5066_20_priority, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_20_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); offset = dissect_s5066_servicetype(tvb, offset, tree); proto_tree_add_item(tree, hf_s5066_20_ttl, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_s5066_20_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_UNIDATA_INDICATION */ static guint dissect_s5066_21(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size, guint *client_app_id) { guint i=0; proto_item *ti = NULL; guint d_pdu_size = 0; guint8 tx_mode = 0; guint16 no_err_blocks = 0; guint16 no_nrx_blocks = 0; gboolean non_arq_w_errors = FALSE; guint sapid; proto_tree_add_item(tree, hf_s5066_21_priority, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_21_dest_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); tx_mode = tvb_get_guint8(tvb, offset); tx_mode = (tx_mode & 0xF0) >> 4; if (tx_mode == 3) { non_arq_w_errors = TRUE; } proto_tree_add_item(tree, hf_s5066_21_tx_mode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_21_src_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, TRUE); d_pdu_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_21_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Handle RockwellCollins (<= v2.1) 4-byte offset */ if ( (pdu_size - offset) == (d_pdu_size + 4) ) { ti = proto_tree_add_item(tree, hf_s5066_21_err_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_item_append_text(ti, ", (Field should not be present. Rockwell Collins v2.1 or earlier.) "); ti = proto_tree_add_item(tree, hf_s5066_21_nrx_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_item_append_text(ti, ", (Field should not be present. Rockwell Collins v2.1 or earlier.) "); } /* Handle Non-ARQ with errors */ if ( non_arq_w_errors ) { no_err_blocks = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_21_err_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<no_err_blocks; i++) { proto_tree_add_item(tree, hf_s5066_21_err_ptr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_21_err_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } no_nrx_blocks = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_21_nrx_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<no_nrx_blocks; i++) { proto_tree_add_item(tree, hf_s5066_21_nrx_ptr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_21_nrx_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } } offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_UNIDATA_REQUEST_CONFIRM */ static guint dissect_s5066_22(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id) { guint pdu_size = 0; guint8 sapid; proto_tree_add_item(tree, hf_s5066_22_unused, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_22_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); pdu_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_22_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_22_data, tvb, offset, pdu_size, ENC_NA); offset += pdu_size; offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_UNIDATA_REQUEST_REJECTED */ static guint dissect_s5066_23(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id) { guint pdu_size = 0; guint8 sapid; proto_tree_add_item(tree, hf_s5066_23_reason, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_23_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); pdu_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_23_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_23_data, tvb, offset, pdu_size, ENC_NA); offset += pdu_size; offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_EXPEDITED_UNIDATA_REQUEST */ static guint dissect_s5066_24(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id) { guint8 sapid; proto_tree_add_item(tree, hf_s5066_24_unused, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_24_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); offset = dissect_s5066_servicetype(tvb, offset, tree); proto_tree_add_item(tree, hf_s5066_24_ttl, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_s5066_24_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_EXPEDITED_UNIDATA_INDICATION */ static guint dissect_s5066_25(tvbuff_t *tvb, guint offset, proto_tree *tree, guint pdu_size, guint *client_app_id) { guint i=0; proto_item *ti = NULL; guint d_pdu_size = 0; guint8 tx_mode = 0; guint16 no_err_blocks = 0; guint16 no_nrx_blocks = 0; gboolean non_arq_w_errors = FALSE; guint8 sapid; proto_tree_add_item(tree, hf_s5066_25_unused, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_25_dest_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); tx_mode = tvb_get_guint8(tvb, offset); tx_mode = (tx_mode & 0xF0) >> 4; if (tx_mode == 3) { non_arq_w_errors = TRUE; } proto_tree_add_item(tree, hf_s5066_25_tx_mode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s5066_25_src_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, TRUE); d_pdu_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_25_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Handle RockwellCollins (<= v2.1) 4-byte offset */ if ( (pdu_size - offset) == (d_pdu_size + 4) ) { ti = proto_tree_add_item(tree, hf_s5066_25_err_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_item_append_text(ti, ", (Field should not be present. Rockwell Collins v2.1 or earlier.) "); ti = proto_tree_add_item(tree, hf_s5066_25_nrx_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_item_append_text(ti, ", (Field should not be present. Rockwell Collins v2.1 or earlier.) "); } /* Handle Non-ARQ with errors */ if ( non_arq_w_errors ) { no_err_blocks = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_25_err_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<no_err_blocks; i++) { proto_tree_add_item(tree, hf_s5066_25_err_ptr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_25_err_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } no_nrx_blocks = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_25_nrx_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<no_nrx_blocks; i++) { proto_tree_add_item(tree, hf_s5066_25_nrx_ptr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_25_nrx_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } } offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_EXPEDITED_UNIDATA_REQUEST_CONFIRM */ static guint dissect_s5066_26(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id) { guint pdu_size = 0; guint8 sapid; proto_tree_add_item(tree, hf_s5066_26_unused, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_26_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); pdu_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_26_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_26_data, tvb, offset, pdu_size, ENC_NA); offset += pdu_size; offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } /* S_EXPEDITED_UNIDATA_REQUEST_REJECTED */ static guint dissect_s5066_27(tvbuff_t *tvb, guint offset, proto_tree *tree, guint *client_app_id) { guint pdu_size = 0; guint8 sapid; proto_tree_add_item(tree, hf_s5066_27_reason, tvb, offset, 1, ENC_BIG_ENDIAN); sapid = tvb_get_guint8(tvb, offset) & 0x0F; proto_tree_add_item(tree, hf_s5066_27_sapid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_s5066_address(tvb, offset, tree, FALSE); pdu_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_s5066_27_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s5066_27_data, tvb, offset, pdu_size, ENC_NA); offset += pdu_size; offset = dissect_s5066_client_transport_header(tvb, offset, tree, sapid, client_app_id); return offset; } static guint get_s5066_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint16 plen; /* Get the length of the S5066 PDU. */ plen = tvb_get_ntohs(tvb, offset + s5066_size_offset); /* That length doesn't include the sync, version and length fields; add that in. */ return plen + s5066_header_size; } static int dissect_s5066_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { /* Make sure there are enough bytes... */ if (tvb_captured_length(tvb) < 5) return 0; /* Check if the first two bytes are 0x90 0xEB: if not, then this is not a S5066 PDU or an unreassembled one. The third byte is the STANAG 5066 version: Right now only 0x00 is defined. */ if( (tvb_get_guint8(tvb, 0) != 0x90) || (tvb_get_guint8(tvb, 1) != 0xEB) || (tvb_get_guint8(tvb, 2) != 0x00) ) { return 0; } tcp_dissect_pdus(tvb, pinfo, tree, s5066_desegment, s5066_header_size, get_s5066_pdu_len, dissect_s5066_common, data); return tvb_captured_length(tvb); } static int dissect_s5066_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint offset = 0; guint pdu_size = 0; proto_item *ti_s5066 = NULL; proto_item *ti_pdu = NULL; tvbuff_t *next_tvb; gint available_length = 0; gint reported_length = 0; gint client_app_id = 0; proto_tree *s5066_tree = NULL; proto_tree *s5066_tree_pdu = NULL; /* Determine PDU type to display in INFO column */ guint8 pdu_type = tvb_get_guint8(tvb, s5066_header_size); col_set_str(pinfo->cinfo, COL_PROTOCOL, "S5066"); /* Clear out stuff in the info column, the add PDU type */ col_add_fstr(pinfo->cinfo, COL_INFO, "PDU type %s", val_to_str(pdu_type, s5066_pdu_type, "Unknown (0x%02x)")); pdu_size = tvb_get_ntohs(tvb, s5066_size_offset) + s5066_header_size; ti_s5066 = proto_tree_add_item(tree, proto_s5066, tvb, 0, -1, ENC_NA); proto_item_append_text(ti_s5066, ", PDU type %s", val_to_str(pdu_type, s5066_pdu_type, "Unknown (0x%02x)")); s5066_tree = proto_item_add_subtree(ti_s5066, ett_s5066); proto_tree_add_item(s5066_tree, hf_s5066_sync_word, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; if (!s5066_edition_one) { proto_tree_add_item(s5066_tree, hf_s5066_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } proto_tree_add_item(s5066_tree, hf_s5066_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; ti_pdu = proto_tree_add_item(s5066_tree, hf_s5066_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; s5066_tree_pdu = proto_item_add_subtree(ti_pdu, ett_s5066_pdu); switch (pdu_type) { case 1: offset = dissect_s5066_01(tvb, offset, s5066_tree_pdu); break; /* case 2: offset = dissect_s5066_02(tvb, offset, s5066_tree_pdu); break; */ case 3: offset = dissect_s5066_03(tvb, offset, s5066_tree_pdu); break; case 4: offset = dissect_s5066_04(tvb, offset, s5066_tree_pdu); break; case 5: offset = dissect_s5066_05(tvb, offset, s5066_tree_pdu); break; case 6: offset = dissect_s5066_06(tvb, offset, s5066_tree_pdu); break; case 7: offset = dissect_s5066_07(tvb, offset, s5066_tree_pdu); break; case 8: offset = dissect_s5066_08(tvb, offset, s5066_tree_pdu); break; case 9: offset = dissect_s5066_09(tvb, offset, s5066_tree_pdu); break; case 10: offset = dissect_s5066_10(tvb, offset, s5066_tree_pdu); break; case 11: offset = dissect_s5066_11(tvb, offset, s5066_tree_pdu); break; case 12: offset = dissect_s5066_12(tvb, offset, s5066_tree_pdu); break; case 13: offset = dissect_s5066_13(tvb, offset, s5066_tree_pdu); break; case 14: offset = dissect_s5066_14(tvb, offset, s5066_tree_pdu); break; /* case 15: offset = dissect_s5066_15(tvb, offset, s5066_tree_pdu); break; */ /* case 16: offset = dissect_s5066_16(tvb, offset, s5066_tree_pdu); break; */ /* case 17: offset = dissect_s5066_17(tvb, offset, s5066_tree_pdu); break; */ case 18: offset = dissect_s5066_18(tvb, offset, s5066_tree_pdu, pdu_size); break; case 19: offset = dissect_s5066_19(tvb, offset, s5066_tree_pdu, pdu_size); break; case 20: offset = dissect_s5066_20(tvb, offset, s5066_tree_pdu, &client_app_id); break; case 21: offset = dissect_s5066_21(tvb, offset, s5066_tree_pdu, pdu_size, &client_app_id); break; case 22: offset = dissect_s5066_22(tvb, offset, s5066_tree_pdu, &client_app_id); break; case 23: offset = dissect_s5066_23(tvb, offset, s5066_tree_pdu, &client_app_id); break; case 24: offset = dissect_s5066_24(tvb, offset, s5066_tree_pdu, &client_app_id); break; case 25: offset = dissect_s5066_25(tvb, offset, s5066_tree_pdu, pdu_size, &client_app_id); break; case 26: offset = dissect_s5066_26(tvb, offset, s5066_tree_pdu, &client_app_id); break; case 27: offset = dissect_s5066_27(tvb, offset, s5066_tree_pdu, &client_app_id); break; } proto_item_set_len(ti_s5066, offset); /* Call sub dissector(s) */ reported_length = pdu_size - offset; available_length = tvb_captured_length(tvb) - offset; next_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(available_length, reported_length), reported_length); if(dissector_try_uint(s5066sis_dissector_table, client_app_id, next_tvb, pinfo, tree) == 0) { call_data_dissector(next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } void proto_register_s5066(void) { static hf_register_info hf[] = { { &hf_s5066_sync_word, { "Sync preamble", "s5066sis.sync", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_version, { "S5066 version", "s5066sis.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_size, { "S_Primitive size", "s5066sis.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_type, { "PDU Type", "s5066sis.type", FT_UINT8, BASE_DEC, VALS(s5066_pdu_type), 0x0, NULL, HFILL } }, /* STANAG 5066 Address */ { &hf_s5066_ad_size, { "Address size (1/2 Bytes)", "s5066sis.address.size", FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL } }, { &hf_s5066_ad_group, { "Group address", "s5066sis.address.group", FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL } }, { &hf_s5066_ad_address, { "Address", "s5066sis.address.address", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, /* Service type */ { &hf_s5066_st_txmode, { "Transmission mode", "s5066sis.st.txmode", FT_UINT8, BASE_HEX, VALS(s5066_st_txmode), 0xF0, NULL, HFILL } }, { &hf_s5066_st_delivery_confirmation, { "Delivery confirmation", "s5066sis.st.confirm", FT_UINT8, BASE_HEX, VALS(s5066_st_delivery_confirmation), 0x0C, NULL, HFILL } }, { &hf_s5066_st_delivery_order, { "Delivery order", "s5066sis.st.order", FT_UINT8, BASE_HEX, VALS(s5066_st_delivery_order), 0x02, NULL, HFILL } }, { &hf_s5066_st_extended, { "Extended field", "s5066sis.st.extended", FT_UINT8, BASE_HEX, VALS(s5066_st_extended), 0x01, NULL, HFILL } }, { &hf_s5066_st_retries, { "Minimum number of retransmissions", "s5066sis.st.retries", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, /* Client transport layer header */ { &hf_s5066_ctl_conn_id, { "Connection ID number", "s5066sis.ctl.conn_id", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_ctl_reserved, { "Reserved", "s5066sis.ctl.reserved", FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL } }, { &hf_s5066_ctl_updu_id, { "UPDU ID number", "s5066sis.ctl.updu_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_ctl_updu_segment, { "UPDU segment number", "s5066sis.ctl.updu_segment", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_ctl_app_id, { "Application identifier", "s5066sis.ctl.app_id", FT_UINT16, BASE_HEX, VALS(s5066_client_application_ids), 0x0, NULL, HFILL } }, /* PDU Type 01: S_BIND_REQUEST */ { &hf_s5066_01_sapid, { "Sap ID", "s5066sis.01.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0xF0, NULL, HFILL } }, { &hf_s5066_01_rank, { "Rank", "s5066sis.01.rank", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_s5066_01_unused, { "(Unused)", "s5066sis.01.unused", FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL } }, /* PDU Type 02: S_UNBIND_REQUEST */ /* --- no subfields --- */ /* PDU Type 03: S_BIND_ACCEPTED */ { &hf_s5066_03_sapid, { "Sap ID", "s5066sis.03.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0xF0, NULL, HFILL } }, { &hf_s5066_03_unused, { "(Unused)", "s5066sis.03.unused", FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL } }, { &hf_s5066_03_mtu, { "MTU", "s5066sis.03.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* PDU Type 04: S_BIND_REJECTED */ { &hf_s5066_04_reason, { "Reason", "s5066sis.04.reason", FT_UINT8, BASE_DEC, VALS(s5066_04_reason), 0x0, NULL, HFILL } }, /* PDU Type 05: S_UNBIND_INDICATION */ { &hf_s5066_05_reason, { "Reason", "s5066sis.05.reason", FT_UINT8, BASE_DEC, VALS(s5066_05_reason), 0x0, NULL, HFILL } }, /* Type 6: S_HARD_LINK_ESTABLISH */ { &hf_s5066_06_link_type, { "Hardlink type", "s5066sis.06.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_06_link_priority, { "Priority", "s5066sis.06.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_06_sapid, { "Remote Sap ID", "s5066sis.06.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 7: S_HARD_LINK_TERMINATE */ /* --- Only remote node address --- */ /* Type 8: S_HARD_LINK_ESTABLISHED */ { &hf_s5066_08_remote_status, { "Remote node status", "s5066sis.08.status", FT_UINT8, BASE_DEC, VALS(s5066_08_remote_status), 0x0, NULL, HFILL } }, { &hf_s5066_08_link_type, { "Hardlink type", "s5066sis.08.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_08_link_priority, { "Priority", "s5066sis.08.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_08_sapid, { "Remote Sap ID", "s5066sis.08.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 9: S_HARD_LINK_REJECTED */ { &hf_s5066_09_reason, { "Reason", "s5066sis.09.reason", FT_UINT8, BASE_DEC, VALS(s5066_09_reason), 0x0, NULL, HFILL } }, { &hf_s5066_09_link_type, { "Hardlink type", "s5066sis.09.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_09_link_priority, { "Priority", "s5066sis.09.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_09_sapid, { "Remote Sap ID", "s5066sis.09.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 10: S_HARD_LINK_TERMINATED */ { &hf_s5066_10_reason, { "Reason", "s5066sis.10.reason", FT_UINT8, BASE_DEC, VALS(s5066_10_reason), 0x0, NULL, HFILL } }, { &hf_s5066_10_link_type, { "Hardlink type", "s5066sis.10.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_10_link_priority, { "Priority", "s5066sis.10.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_10_sapid, { "Remote Sap ID", "s5066sis.10.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 11: S_HARD_LINK_INDICATION */ { &hf_s5066_11_remote_status, { "Remote node status", "s5066sis.11.status", FT_UINT8, BASE_DEC, VALS(s5066_11_remote_status), 0x0, NULL, HFILL } }, { &hf_s5066_11_link_type, { "Hardlink type", "s5066sis.11.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_11_link_priority, { "Priority", "s5066sis.11.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_11_sapid, { "Remote Sap ID", "s5066sis.11.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 12: S_HARD_LINK_ACCEPT */ { &hf_s5066_12_link_type, { "Hardlink type", "s5066sis.12.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_12_link_priority, { "Priority", "s5066sis.12.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_12_sapid, { "Remote Sap ID", "s5066sis.12.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 13: S_HARD_LINK_REJECT */ { &hf_s5066_13_reason, { "Reason", "s5066sis.13.reason", FT_UINT8, BASE_DEC, VALS(s5066_13_reason), 0x0, NULL, HFILL } }, { &hf_s5066_13_link_type, { "Hardlink type", "s5066sis.13.type", FT_UINT8, BASE_DEC, VALS(s5066_hard_link_type), 0xC0, NULL, HFILL } }, { &hf_s5066_13_link_priority, { "Priority", "s5066sis.13.priority", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, { &hf_s5066_13_sapid, { "Remote Sap ID", "s5066sis.13.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, /* Type 14: S_SUBNET_AVAILABILITY */ { &hf_s5066_14_status, { "Status", "s5066sis.14.status", FT_UINT8, BASE_DEC, VALS(s5066_14_status), 0x0, NULL, HFILL } }, { &hf_s5066_14_reason, { "Reason", "s5066sis.14.reason", FT_UINT8, BASE_DEC, VALS(s5066_14_reason), 0x0, NULL, HFILL } }, /* Type 15: S_DATAFLOW_ON */ /* --- no subfields --- */ /* Type 16: S_DATAFLOW_OFF */ /* --- no subfields --- */ /* Type 17: S_KEEP_ALIVE */ /* --- no subfields --- */ /* Type 18: S_MANAGEMENT_MESSAGE_REQUEST */ { &hf_s5066_18_type, { "Message Type", "s5066sis.18.type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_18_body, { "Message Body", "s5066sis.18.body", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Type 19: S_MANAGEMENT_MESSAGE_INDICATION */ { &hf_s5066_19_type, { "Message Type", "s5066sis.19.type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_19_body, { "Message Body", "s5066sis.19.body", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Type 20: S_UNIDATA_REQUEST */ { &hf_s5066_20_priority, { "Priority", "s5066sis.20.priority", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_20_sapid, { "Destination Sap ID", "s5066sis.20.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_20_ttl, { "Time-To-Live (x2 seconds)", "s5066sis.20.ttl", FT_UINT24, BASE_DEC, NULL, 0x0FFFFF, NULL, HFILL } }, { &hf_s5066_20_size, { "U_PDU Size", "s5066sis.20.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Type 21: S_UNIDATA_INDICATION */ { &hf_s5066_21_priority, { "Priority", "s5066sis.21.priority", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_21_dest_sapid, { "Destination Sap ID", "s5066sis.21.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_21_tx_mode, { "Transmission Mode", "s5066sis.21.txmode", FT_UINT8, BASE_HEX, VALS(s5066_st_txmode), 0xF0, NULL, HFILL } }, { &hf_s5066_21_src_sapid, { "Source Sap ID", "s5066sis.21.src_sapid", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_s5066_21_size, { "U_PDU Size", "s5066sis.21.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_21_err_blocks, { "Number of errored blocks", "s5066sis.21.err_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_21_err_ptr, { "Pointer to error block", "s5066sis.21.err_ptr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_21_err_size, { "Size of error block", "s5066sis.21.err_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_21_nrx_blocks, { "Number of non-received blocks", "s5066sis.21.nrx_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_21_nrx_ptr, { "Pointer to non-received block", "s5066sis.21.nrx_ptr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_21_nrx_size, { "Size of non-received block", "s5066sis.21.nrx_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Type 22: S_UNIDATA_REQUEST_CONFIRM */ { &hf_s5066_22_unused, { "(Unused)", "s5066sis.22.unused", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_22_sapid, { "Destination Sap ID", "s5066sis.22.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_22_size, { "U_PDU Size", "s5066sis.22.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_22_data, { "(Part of) Confirmed data", "s5066sis.22.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Type 23: S_UNIDATA_REQUEST_REJECTED */ { &hf_s5066_23_reason, { "Reason", "s5066sis.23.reason", FT_UINT8, BASE_DEC, VALS(s5066_23_reason), 0xF0, NULL, HFILL } }, { &hf_s5066_23_sapid, { "Destination Sap ID", "s5066sis.23.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_23_size, { "U_PDU Size", "s5066sis.23.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_23_data, { "(Part of) Rejected data", "s5066sis.23.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Type 24: S_EXPEDITED_UNIDATA_REQUEST */ { &hf_s5066_24_unused, { "(Unused)", "s5066sis.24.unused", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_24_sapid, { "Destination Sap ID", "s5066sis.24.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_24_ttl, { "Time-To-Live (x2 seconds)", "s5066sis.24.ttl", FT_UINT24, BASE_DEC, NULL, 0x0FFFFF, NULL, HFILL } }, { &hf_s5066_24_size, { "U_PDU Size", "s5066sis.24.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Type 25: S_EXPEDITED_UNIDATA_INDICATION */ { &hf_s5066_25_unused, { "(Unused)", "s5066sis.25.unused", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_25_dest_sapid, { "Destination Sap ID", "s5066sis.25.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_25_tx_mode, { "Transmission Mode", "s5066sis.25.txmode", FT_UINT8, BASE_HEX, VALS(s5066_st_txmode), 0xF0, NULL, HFILL } }, { &hf_s5066_25_src_sapid, { "Source Sap ID", "s5066sis.25.src_sapid", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_s5066_25_size, { "U_PDU Size", "s5066sis.25.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_25_err_blocks, { "Number of errored blocks", "s5066sis.25.err_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_25_err_ptr, { "Pointer to error block", "s5066sis.25.err_ptr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_25_err_size, { "Size of error block", "s5066sis.25.err_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_25_nrx_blocks, { "Number of non-received blocks", "s5066sis.25.nrx_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_25_nrx_ptr, { "Pointer to non-received block", "s5066sis.25.nrx_ptr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_25_nrx_size, { "Size of non-received block", "s5066sis.25.nrx_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Type 26: S_EXPEDITED_UNIDATA_REQUEST_CONFIRM */ { &hf_s5066_26_unused, { "(Unused)", "s5066sis.26.unused", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_s5066_26_sapid, { "Destination Sap ID", "s5066sis.26.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_26_size, { "U_PDU Size", "s5066sis.26.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_26_data, { "(Part of) Confirmed data", "s5066sis.26.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Type 27: S_EXPEDITED_UNIDATA_REQUEST_REJECTED */ { &hf_s5066_27_reason, { "Reason", "s5066sis.27.reason", FT_UINT8, BASE_DEC, VALS(s5066_27_reason), 0xF0, NULL, HFILL } }, { &hf_s5066_27_sapid, { "Destination Sap ID", "s5066sis.27.sapid", FT_UINT8, BASE_DEC, VALS(s5066_sapid_assignments), 0x0F, NULL, HFILL } }, { &hf_s5066_27_size, { "U_PDU Size", "s5066sis.27.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_s5066_27_data, { "(Part of) Rejected data", "s5066sis.27.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_s5066, &ett_s5066_pdu, &ett_s5066_servicetype, &ett_s5066_address, &ett_s5066_client_transport_header, }; module_t *s5066_module; proto_s5066 = proto_register_protocol ("STANAG 5066 (SIS layer)", "STANAG 5066 SIS", "s5066sis"); proto_register_field_array(proto_s5066, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); s5066_module = prefs_register_protocol(proto_s5066, proto_reg_handoff_s5066); prefs_register_bool_preference(s5066_module, "desegment_pdus", "Reassemble S5066 SIS PDUs spanning multiple TCP segments", "Whether the S5066 SIS dissector should reassemble PDUs spanning multiple TCP segments." " The default is to use reassembly.", &s5066_desegment); prefs_register_bool_preference(s5066_module, "edition_one", "Dissect edition 1.0 of STANAG 5066", "Whether the S5066 SIS dissector should dissect this edition of the STANAG." " This edition was never formally approved and is very rare. The common edition is edition 1.2.", &s5066_edition_one); s5066sis_dissector_table = register_dissector_table("s5066sis.ctl.appid", "STANAG 5066 Application Identifier", proto_s5066, FT_UINT16, BASE_DEC); } void proto_reg_handoff_s5066(void) { static gboolean Initialized = FALSE; static dissector_handle_t s5066_tcp_handle; if (!Initialized) { s5066_tcp_handle = create_dissector_handle(dissect_s5066_tcp, proto_s5066); dissector_add_uint_with_preference("tcp.port", S5066_PORT, s5066_tcp_handle); Initialized = TRUE; } if (!s5066_edition_one) { s5066_header_size = 5; s5066_size_offset = 3; } else { s5066_header_size = 4; s5066_size_offset = 2; } } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-s5066sis.h
/* packet-s5066sis.h * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_S5066SIS_H__ #define __PACKET_S5066SIS_H__ /* S5066 Client Application IDs */ #define S5066_CLIENT_BFTP 0x1002 #define S5066_CLIENT_FRAP 0x100B #define S5066_CLIENT_FRAP_V2 0x100C #define S5066_CLIENT_S4406_ANNEX_E_TMI_1_P_MUL 0x2000 #define S5066_CLIENT_S4406_ANNEX_E_TMI_2 0x2001 #define S5066_CLIENT_S4406_ANNEX_E_TMI_3 0x2002 #define S5066_CLIENT_S4406_ANNEX_E_TMI_4_DMP 0x2003 /* TMI-4 is updated with DMP spec. */ #define S5066_CLIENT_S4406_ANNEX_E_TMI_5_ACP_127 0x2004 #endif /* PACKET_S5066SIS_H */ /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-s7comm.c
/* packet-s7comm.c * * Author: Thomas Wiens, 2014 ([email protected]) * Description: Wireshark dissector for S7-Communication * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/reassemble.h> #include <stdlib.h> #include <wsutil/strtoi.h> #include <epan/expert.h> #include "packet-s7comm.h" #include "packet-s7comm_szl_ids.h" #define PROTO_TAG_S7COMM "S7COMM" /* Min. telegram length for heuristic check */ #define S7COMM_MIN_TELEGRAM_LENGTH 10 /* Protocol identifier */ #define S7COMM_PROT_ID 0x32 /* Wireshark ID of the S7COMM protocol */ static int proto_s7comm = -1; /* Forward declarations */ void proto_reg_handoff_s7comm(void); void proto_register_s7comm (void); static guint32 s7comm_decode_ud_tis_data(tvbuff_t *tvb, proto_tree *tree, guint8 type, guint8 subfunc, guint16 td_size, guint32 offset); /************************************************************************** * PDU types */ #define S7COMM_ROSCTR_JOB 0x01 #define S7COMM_ROSCTR_ACK 0x02 #define S7COMM_ROSCTR_ACK_DATA 0x03 #define S7COMM_ROSCTR_USERDATA 0x07 static const value_string rosctr_names[] = { { S7COMM_ROSCTR_JOB, "Job" }, /* Request: job with acknowledgement */ { S7COMM_ROSCTR_ACK, "Ack" }, /* acknowledgement without additional field */ { S7COMM_ROSCTR_ACK_DATA, "Ack_Data" }, /* Response: acknowledgement with additional field */ { S7COMM_ROSCTR_USERDATA, "Userdata" }, { 0, NULL } }; /************************************************************************** * Error classes in header */ #define S7COMM_ERRCLS_NONE 0x00 #define S7COMM_ERRCLS_APPREL 0x81 #define S7COMM_ERRCLS_OBJDEF 0x82 #define S7COMM_ERRCLS_RESOURCE 0x83 #define S7COMM_ERRCLS_SERVICE 0x84 #define S7COMM_ERRCLS_SUPPLIES 0x85 #define S7COMM_ERRCLS_ACCESS 0x87 static const value_string errcls_names[] = { { S7COMM_ERRCLS_NONE, "No error" }, { S7COMM_ERRCLS_APPREL, "Application relationship" }, { S7COMM_ERRCLS_OBJDEF, "Object definition" }, { S7COMM_ERRCLS_RESOURCE, "No resources available" }, { S7COMM_ERRCLS_SERVICE, "Error on service processing" }, { S7COMM_ERRCLS_SUPPLIES, "Error on supplies" }, { S7COMM_ERRCLS_ACCESS, "Access error" }, { 0, NULL } }; /************************************************************************** * Error code in parameter part */ static const value_string param_errcode_names[] = { { 0x0000, "No error" }, { 0x0110, "Invalid block number" }, { 0x0111, "Invalid request length" }, { 0x0112, "Invalid parameter" }, { 0x0113, "Invalid block type" }, { 0x0114, "Block not found" }, { 0x0115, "Block already exists" }, { 0x0116, "Block is write-protected" }, { 0x0117, "The block/operating system update is too large" }, { 0x0118, "Invalid block number" }, { 0x0119, "Incorrect password entered" }, { 0x011A, "PG resource error" }, { 0x011B, "PLC resource error" }, { 0x011C, "Protocol error" }, { 0x011D, "Too many blocks (module-related restriction)" }, { 0x011E, "There is no longer a connection to the database, or S7DOS handle is invalid" }, { 0x011F, "Result buffer too small" }, { 0x0120, "End of block list" }, { 0x0140, "Insufficient memory available" }, { 0x0141, "Job cannot be processed because of a lack of resources" }, { 0x8001, "The requested service cannot be performed while the block is in the current status" }, { 0x8003, "S7 protocol error: Error occurred while transferring the block" }, { 0x8100, "Application, general error: Service unknown to remote module" }, { 0x8104, "This service is not implemented on the module or a frame error was reported" }, { 0x8204, "The type specification for the object is inconsistent" }, { 0x8205, "A copied block already exists and is not linked" }, { 0x8301, "Insufficient memory space or work memory on the module, or specified storage medium not accessible" }, { 0x8302, "Too few resources available or the processor resources are not available" }, { 0x8304, "No further parallel upload possible. There is a resource bottleneck" }, { 0x8305, "Function not available" }, { 0x8306, "Insufficient work memory (for copying, linking, loading AWP)" }, { 0x8307, "Not enough retentive work memory (for copying, linking, loading AWP)" }, { 0x8401, "S7 protocol error: Invalid service sequence (for example, loading or uploading a block)" }, { 0x8402, "Service cannot execute owing to status of the addressed object" }, { 0x8404, "S7 protocol: The function cannot be performed" }, { 0x8405, "Remote block is in DISABLE state (CFB). The function cannot be performed" }, { 0x8500, "S7 protocol error: Wrong frames" }, { 0x8503, "Alarm from the module: Service canceled prematurely" }, { 0x8701, "Error addressing the object on the communications partner (for example, area length error)" }, { 0x8702, "The requested service is not supported by the module" }, { 0x8703, "Access to object refused" }, { 0x8704, "Access error: Object damaged" }, { 0xD001, "Protocol error: Illegal job number" }, { 0xD002, "Parameter error: Illegal job variant" }, { 0xD003, "Parameter error: Debugging function not supported by module" }, { 0xD004, "Parameter error: Illegal job status" }, { 0xD005, "Parameter error: Illegal job termination" }, { 0xD006, "Parameter error: Illegal link disconnection ID" }, { 0xD007, "Parameter error: Illegal number of buffer elements" }, { 0xD008, "Parameter error: Illegal scan rate" }, { 0xD009, "Parameter error: Illegal number of executions" }, { 0xD00A, "Parameter error: Illegal trigger event" }, { 0xD00B, "Parameter error: Illegal trigger condition" }, { 0xD011, "Parameter error in path of the call environment: Block does not exist" }, { 0xD012, "Parameter error: Wrong address in block" }, { 0xD014, "Parameter error: Block being deleted/overwritten" }, { 0xD015, "Parameter error: Illegal tag address" }, { 0xD016, "Parameter error: Test jobs not possible, because of errors in user program" }, { 0xD017, "Parameter error: Illegal trigger number" }, { 0xD025, "Parameter error: Invalid path" }, { 0xD026, "Parameter error: Illegal access type" }, { 0xD027, "Parameter error: This number of data blocks is not permitted" }, { 0xD031, "Internal protocol error" }, { 0xD032, "Parameter error: Wrong result buffer length" }, { 0xD033, "Protocol error: Wrong job length" }, { 0xD03F, "Coding error: Error in parameter section (for example, reserve bytes not equal to 0)" }, { 0xD041, "Data error: Illegal status list ID" }, { 0xD042, "Data error: Illegal tag address" }, { 0xD043, "Data error: Referenced job not found, check job data" }, { 0xD044, "Data error: Illegal tag value, check job data" }, { 0xD045, "Data error: Exiting the ODIS control is not allowed in HOLD" }, { 0xD046, "Data error: Illegal measuring stage during run-time measurement" }, { 0xD047, "Data error: Illegal hierarchy in 'Read job list'" }, { 0xD048, "Data error: Illegal deletion ID in 'Delete job'" }, { 0xD049, "Invalid substitute ID in 'Replace job'" }, { 0xD04A, "Error executing 'program status'" }, { 0xD05F, "Coding error: Error in data section (for example, reserve bytes not equal to 0, ...)" }, { 0xD061, "Resource error: No memory space for job" }, { 0xD062, "Resource error: Job list full" }, { 0xD063, "Resource error: Trigger event occupied" }, { 0xD064, "Resource error: Not enough memory space for one result buffer element" }, { 0xD065, "Resource error: Not enough memory space for several result buffer elements" }, { 0xD066, "Resource error: The timer available for run-time measurement is occupied by another job" }, { 0xD067, "Resource error: Too many 'modify tag' jobs active (in particular multi-processor operation)" }, { 0xD081, "Function not permitted in current mode" }, { 0xD082, "Mode error: Cannot exit HOLD mode" }, { 0xD0A1, "Function not permitted in current protection level" }, { 0xD0A2, "Function not possible at present, because a function is running that modifies memory" }, { 0xD0A3, "Too many 'modify tag' jobs active on the I/O (in particular multi-processor operation)" }, { 0xD0A4, "'Forcing' has already been established" }, { 0xD0A5, "Referenced job not found" }, { 0xD0A6, "Job cannot be disabled/enabled" }, { 0xD0A7, "Job cannot be deleted, for example because it is currently being read" }, { 0xD0A8, "Job cannot be replaced, for example because it is currently being read or deleted" }, { 0xD0A9, "Job cannot be read, for example because it is currently being deleted" }, { 0xD0AA, "Time limit exceeded in processing operation" }, { 0xD0AB, "Invalid job parameters in process operation" }, { 0xD0AC, "Invalid job data in process operation" }, { 0xD0AD, "Operating mode already set" }, { 0xD0AE, "The job was set up over a different connection and can only be handled over this connection" }, { 0xD0C1, "At least one error has been detected while accessing the tag(s)" }, { 0xD0C2, "Change to STOP/HOLD mode" }, { 0xD0C3, "At least one error was detected while accessing the tag(s). Mode change to STOP/HOLD" }, { 0xD0C4, "Timeout during run-time measurement" }, { 0xD0C5, "Display of block stack inconsistent, because blocks were deleted/reloaded" }, { 0xD0C6, "Job was automatically deleted as the jobs it referenced have been deleted" }, { 0xD0C7, "The job was automatically deleted because STOP mode was exited" }, { 0xD0C8, "'Block status' aborted because of inconsistencies between test job and running program" }, { 0xD0C9, "Exit the status area by resetting OB90" }, { 0xD0CA, "Exiting the status range by resetting OB90 and access error reading tags before exiting" }, { 0xD0CB, "The output disable for the peripheral outputs has been activated again" }, { 0xD0CC, "The amount of data for the debugging functions is restricted by the time limit" }, { 0xD201, "Syntax error in block name" }, { 0xD202, "Syntax error in function parameters" }, { 0xD205, "Linked block already exists in RAM: Conditional copying is not possible" }, { 0xD206, "Linked block already exists in EPROM: Conditional copying is not possible" }, { 0xD208, "Maximum number of copied (not linked) blocks on module exceeded" }, { 0xD209, "(At least) one of the given blocks not found on the module" }, { 0xD20A, "The maximum number of blocks that can be linked with one job was exceeded" }, { 0xD20B, "The maximum number of blocks that can be deleted with one job was exceeded" }, { 0xD20C, "OB cannot be copied because the associated priority class does not exist" }, { 0xD20D, "SDB cannot be interpreted (for example, unknown number)" }, { 0xD20E, "No (further) block available" }, { 0xD20F, "Module-specific maximum block size exceeded" }, { 0xD210, "Invalid block number" }, { 0xD212, "Incorrect header attribute (run-time relevant)" }, { 0xD213, "Too many SDBs. Note the restrictions on the module being used" }, { 0xD216, "Invalid user program - reset module" }, { 0xD217, "Protection level specified in module properties not permitted" }, { 0xD218, "Incorrect attribute (active/passive)" }, { 0xD219, "Incorrect block lengths (for example, incorrect length of first section or of the whole block)" }, { 0xD21A, "Incorrect local data length or write-protection code faulty" }, { 0xD21B, "Module cannot compress or compression was interrupted early" }, { 0xD21D, "The volume of dynamic project data transferred is illegal" }, { 0xD21E, "Unable to assign parameters to a module (such as FM, CP). The system data could not be linked" }, { 0xD220, "Invalid programming language. Note the restrictions on the module being used" }, { 0xD221, "The system data for connections or routing are not valid" }, { 0xD222, "The system data of the global data definition contain invalid parameters" }, { 0xD223, "Error in instance data block for communication function block or maximum number of instance DBs exceeded" }, { 0xD224, "The SCAN system data block contains invalid parameters" }, { 0xD225, "The DP system data block contains invalid parameters" }, { 0xD226, "A structural error occurred in a block" }, { 0xD230, "A structural error occurred in a block" }, { 0xD231, "At least one loaded OB cannot be copied because the associated priority class does not exist" }, { 0xD232, "At least one block number of a loaded block is illegal" }, { 0xD234, "Block exists twice in the specified memory medium or in the job" }, { 0xD235, "The block contains an incorrect checksum" }, { 0xD236, "The block does not contain a checksum" }, { 0xD237, "You are about to load the block twice, i.e. a block with the same time stamp already exists on the CPU" }, { 0xD238, "At least one of the blocks specified is not a DB" }, { 0xD239, "At least one of the DBs specified is not available as a linked variant in the load memory" }, { 0xD23A, "At least one of the specified DBs is considerably different from the copied and linked variant" }, { 0xD240, "Coordination rules violated" }, { 0xD241, "The function is not permitted in the current protection level" }, { 0xD242, "Protection violation while processing F blocks" }, { 0xD250, "Update and module ID or version do not match" }, { 0xD251, "Incorrect sequence of operating system components" }, { 0xD252, "Checksum error" }, { 0xD253, "No executable loader available; update only possible using a memory card" }, { 0xD254, "Storage error in operating system" }, { 0xD280, "Error compiling block in S7-300 CPU" }, { 0xD2A1, "Another block function or a trigger on a block is active" }, { 0xD2A2, "A trigger is active on a block. Complete the debugging function first" }, { 0xD2A3, "The block is not active (linked), the block is occupied or the block is currently marked for deletion" }, { 0xD2A4, "The block is already being processed by another block function" }, { 0xD2A6, "It is not possible to save and change the user program simultaneously" }, { 0xD2A7, "The block has the attribute 'unlinked' or is not processed" }, { 0xD2A8, "An active debugging function is preventing parameters from being assigned to the CPU" }, { 0xD2A9, "New parameters are being assigned to the CPU" }, { 0xD2AA, "New parameters are currently being assigned to the modules" }, { 0xD2AB, "The dynamic configuration limits are currently being changed" }, { 0xD2AC, "A running active or deactivate assignment (SFC 12) is temporarily preventing R-KiR process" }, { 0xD2B0, "An error occurred while configuring in RUN (CiR)" }, { 0xD2C0, "The maximum number of technological objects has been exceeded" }, { 0xD2C1, "The same technology data block already exists on the module" }, { 0xD2C2, "Downloading the user program or downloading the hardware configuration is not possible" }, { 0xD401, "Information function unavailable" }, { 0xD402, "Information function unavailable" }, { 0xD403, "Service has already been logged on/off (Diagnostics/PMC)" }, { 0xD404, "Maximum number of nodes reached. No more logons possible for diagnostics/PMC" }, { 0xD405, "Service not supported or syntax error in function parameters" }, { 0xD406, "Required information currently unavailable" }, { 0xD407, "Diagnostics error occurred" }, { 0xD408, "Update aborted" }, { 0xD409, "Error on DP bus" }, { 0xD601, "Syntax error in function parameter" }, { 0xD602, "Incorrect password entered" }, { 0xD603, "The connection has already been legitimized" }, { 0xD604, "The connection has already been enabled" }, { 0xD605, "Legitimization not possible because password does not exist" }, { 0xD801, "At least one tag address is invalid" }, { 0xD802, "Specified job does not exist" }, { 0xD803, "Illegal job status" }, { 0xD804, "Illegal cycle time (illegal time base or multiple)" }, { 0xD805, "No more cyclic read jobs can be set up" }, { 0xD806, "The referenced job is in a state in which the requested function cannot be performed" }, { 0xD807, "Function aborted due to overload, meaning executing the read cycle takes longer than the set scan cycle time" }, { 0xDC01, "Date and/or time invalid" }, { 0xE201, "CPU is already the master" }, { 0xE202, "Connect and update not possible due to different user program in flash module" }, { 0xE203, "Connect and update not possible due to different firmware" }, { 0xE204, "Connect and update not possible due to different memory configuration" }, { 0xE205, "Connect/update aborted due to synchronization error" }, { 0xE206, "Connect/update denied due to coordination violation" }, { 0xEF01, "S7 protocol error: Error at ID2; only 00H permitted in job" }, { 0xEF02, "S7 protocol error: Error at ID2; set of resources does not exist" }, { 0, NULL } }; static value_string_ext param_errcode_names_ext = VALUE_STRING_EXT_INIT(param_errcode_names); /************************************************************************** * Function codes in parameter part */ #define S7COMM_SERV_CPU 0x00 #define S7COMM_SERV_MODETRANS 0x01 #define S7COMM_SERV_SETUPCOMM 0xF0 #define S7COMM_SERV_READVAR 0x04 #define S7COMM_SERV_WRITEVAR 0x05 #define S7COMM_FUNCREQUESTDOWNLOAD 0x1A #define S7COMM_FUNCDOWNLOADBLOCK 0x1B #define S7COMM_FUNCDOWNLOADENDED 0x1C #define S7COMM_FUNCSTARTUPLOAD 0x1D #define S7COMM_FUNCUPLOAD 0x1E #define S7COMM_FUNCENDUPLOAD 0x1F #define S7COMM_FUNCPISERVICE 0x28 #define S7COMM_FUNC_PLC_STOP 0x29 static const value_string param_functionnames[] = { { S7COMM_SERV_CPU, "CPU services" }, { S7COMM_SERV_MODETRANS, "Mode transition" }, { S7COMM_SERV_SETUPCOMM, "Setup communication" }, { S7COMM_SERV_READVAR, "Read Var" }, { S7COMM_SERV_WRITEVAR, "Write Var" }, /* Block management services */ { S7COMM_FUNCREQUESTDOWNLOAD, "Request download" }, { S7COMM_FUNCDOWNLOADBLOCK, "Download block" }, { S7COMM_FUNCDOWNLOADENDED, "Download ended" }, { S7COMM_FUNCSTARTUPLOAD, "Start upload" }, { S7COMM_FUNCUPLOAD, "Upload" }, { S7COMM_FUNCENDUPLOAD, "End upload" }, { S7COMM_FUNCPISERVICE, "PI-Service" }, { S7COMM_FUNC_PLC_STOP, "PLC Stop" }, { 0, NULL } }; /************************************************************************** * Area names */ #define S7COMM_AREA_DATARECORD 0x01 /* Data record, used with RDREC or firmware updates on CP */ #define S7COMM_AREA_SYSINFO 0x03 /* System info of 200 family */ #define S7COMM_AREA_SYSFLAGS 0x05 /* System flags of 200 family */ #define S7COMM_AREA_ANAIN 0x06 /* analog inputs of 200 family */ #define S7COMM_AREA_ANAOUT 0x07 /* analog outputs of 200 family */ #define S7COMM_AREA_P 0x80 /* direct peripheral access */ #define S7COMM_AREA_INPUTS 0x81 #define S7COMM_AREA_OUTPUTS 0x82 #define S7COMM_AREA_FLAGS 0x83 #define S7COMM_AREA_DB 0x84 /* data blocks */ #define S7COMM_AREA_DI 0x85 /* instance data blocks */ #define S7COMM_AREA_LOCAL 0x86 /* local data (should not be accessible over network) */ #define S7COMM_AREA_V 0x87 /* previous (Vorgaenger) local data (should not be accessible over network) */ #define S7COMM_AREA_COUNTER 28 /* S7 counters */ #define S7COMM_AREA_TIMER 29 /* S7 timers */ #define S7COMM_AREA_COUNTER200 30 /* IEC counters (200 family) */ #define S7COMM_AREA_TIMER200 31 /* IEC timers (200 family) */ static const value_string item_areanames[] = { { S7COMM_AREA_DATARECORD, "Data record" }, { S7COMM_AREA_SYSINFO, "System info of 200 family" }, { S7COMM_AREA_SYSFLAGS, "System flags of 200 family" }, { S7COMM_AREA_ANAIN, "Analog inputs of 200 family" }, { S7COMM_AREA_ANAOUT, "Analog outputs of 200 family" }, { S7COMM_AREA_P, "Direct peripheral access (P)" }, { S7COMM_AREA_INPUTS, "Inputs (I)" }, { S7COMM_AREA_OUTPUTS, "Outputs (Q)" }, { S7COMM_AREA_FLAGS, "Flags (M)" }, { S7COMM_AREA_DB, "Data blocks (DB)" }, { S7COMM_AREA_DI, "Instance data blocks (DI)" }, { S7COMM_AREA_LOCAL, "Local data (L)" }, { S7COMM_AREA_V, "Unknown yet (V)" }, { S7COMM_AREA_COUNTER, "S7 counters (C)" }, { S7COMM_AREA_TIMER, "S7 timers (T)" }, { S7COMM_AREA_COUNTER200, "IEC counters (200 family)" }, { S7COMM_AREA_TIMER200, "IEC timers (200 family)" }, { 0, NULL } }; static const value_string item_areanames_short[] = { { S7COMM_AREA_DATARECORD, "RECORD" }, { S7COMM_AREA_SYSINFO, "SI200" }, { S7COMM_AREA_SYSFLAGS, "SF200" }, { S7COMM_AREA_ANAIN, "AI200" }, { S7COMM_AREA_ANAOUT, "AO" }, { S7COMM_AREA_P, "P" }, { S7COMM_AREA_INPUTS, "I" }, { S7COMM_AREA_OUTPUTS, "Q" }, { S7COMM_AREA_FLAGS, "M" }, { S7COMM_AREA_DB, "DB" }, { S7COMM_AREA_DI, "DI" }, { S7COMM_AREA_LOCAL, "L" }, { S7COMM_AREA_V, "V" }, { S7COMM_AREA_COUNTER, "C" }, { S7COMM_AREA_TIMER, "T" }, { S7COMM_AREA_COUNTER200, "C200" }, { S7COMM_AREA_TIMER200, "T200" }, { 0, NULL } }; /************************************************************************** * Transport sizes in item data */ /* types of 1 byte length */ #define S7COMM_TRANSPORT_SIZE_BIT 1 #define S7COMM_TRANSPORT_SIZE_BYTE 2 #define S7COMM_TRANSPORT_SIZE_CHAR 3 /* types of 2 bytes length */ #define S7COMM_TRANSPORT_SIZE_WORD 4 #define S7COMM_TRANSPORT_SIZE_INT 5 /* types of 4 bytes length */ #define S7COMM_TRANSPORT_SIZE_DWORD 6 #define S7COMM_TRANSPORT_SIZE_DINT 7 #define S7COMM_TRANSPORT_SIZE_REAL 8 /* Special types */ #define S7COMM_TRANSPORT_SIZE_DATE 9 #define S7COMM_TRANSPORT_SIZE_TOD 10 #define S7COMM_TRANSPORT_SIZE_TIME 11 #define S7COMM_TRANSPORT_SIZE_S5TIME 12 #define S7COMM_TRANSPORT_SIZE_DT 15 /* Timer or counter */ #define S7COMM_TRANSPORT_SIZE_COUNTER 28 #define S7COMM_TRANSPORT_SIZE_TIMER 29 #define S7COMM_TRANSPORT_SIZE_IEC_COUNTER 30 #define S7COMM_TRANSPORT_SIZE_IEC_TIMER 31 #define S7COMM_TRANSPORT_SIZE_HS_COUNTER 32 static const value_string item_transportsizenames[] = { { S7COMM_TRANSPORT_SIZE_BIT, "BIT" }, { S7COMM_TRANSPORT_SIZE_BYTE, "BYTE" }, { S7COMM_TRANSPORT_SIZE_CHAR, "CHAR" }, { S7COMM_TRANSPORT_SIZE_WORD, "WORD" }, { S7COMM_TRANSPORT_SIZE_INT, "INT" }, { S7COMM_TRANSPORT_SIZE_DWORD, "DWORD" }, { S7COMM_TRANSPORT_SIZE_DINT, "DINT" }, { S7COMM_TRANSPORT_SIZE_REAL, "REAL" }, { S7COMM_TRANSPORT_SIZE_TOD, "TOD" }, { S7COMM_TRANSPORT_SIZE_TIME, "TIME" }, { S7COMM_TRANSPORT_SIZE_S5TIME, "S5TIME" }, { S7COMM_TRANSPORT_SIZE_DT, "DATE_AND_TIME" }, { S7COMM_TRANSPORT_SIZE_COUNTER, "COUNTER" }, { S7COMM_TRANSPORT_SIZE_TIMER, "TIMER" }, { S7COMM_TRANSPORT_SIZE_IEC_COUNTER, "IEC TIMER" }, { S7COMM_TRANSPORT_SIZE_IEC_TIMER, "IEC COUNTER" }, { S7COMM_TRANSPORT_SIZE_HS_COUNTER, "HS COUNTER" }, { 0, NULL } }; /************************************************************************** * Syntax Ids of variable specification */ #define S7COMM_SYNTAXID_S7ANY 0x10 /* Address data S7-Any pointer-like DB1.DBX10.2 */ #define S7COMM_SYNTAXID_SHORT 0x11 #define S7COMM_SYNTAXID_EXT 0x12 #define S7COMM_SYNTAXID_PBC_ID 0x13 /* R_ID for PBC */ #define S7COMM_SYNTAXID_ALARM_LOCKFREESET 0x15 /* Alarm lock/free dataset */ #define S7COMM_SYNTAXID_ALARM_INDSET 0x16 /* Alarm indication dataset */ #define S7COMM_SYNTAXID_ALARM_ACKSET 0x19 /* Alarm acknowledge message dataset */ #define S7COMM_SYNTAXID_ALARM_QUERYREQSET 0x1a /* Alarm query request dataset */ #define S7COMM_SYNTAXID_NOTIFY_INDSET 0x1c /* Notify indication dataset */ #define S7COMM_SYNTAXID_NCK 0x82 /* Sinumerik NCK HMI access (current units) */ #define S7COMM_SYNTAXID_NCK_METRIC 0x83 /* Sinumerik NCK HMI access metric units */ #define S7COMM_SYNTAXID_NCK_INCH 0x84 /* Sinumerik NCK HMI access inch */ #define S7COMM_SYNTAXID_DRIVEESANY 0xa2 /* seen on Drive ES Starter with routing over S7 */ #define S7COMM_SYNTAXID_1200SYM 0xb2 /* Symbolic address mode of S7-1200 */ #define S7COMM_SYNTAXID_DBREAD 0xb0 /* Kind of DB block read, seen only at an S7-400 */ static const value_string item_syntaxid_names[] = { { S7COMM_SYNTAXID_S7ANY, "S7ANY" }, { S7COMM_SYNTAXID_SHORT, "ParameterShort" }, { S7COMM_SYNTAXID_EXT, "ParameterExtended" }, { S7COMM_SYNTAXID_PBC_ID, "PBC-R_ID" }, { S7COMM_SYNTAXID_ALARM_LOCKFREESET, "ALARM_LOCKFREE" }, { S7COMM_SYNTAXID_ALARM_INDSET, "ALARM_IND" }, { S7COMM_SYNTAXID_ALARM_ACKSET, "ALARM_ACK" }, { S7COMM_SYNTAXID_ALARM_QUERYREQSET, "ALARM_QUERYREQ" }, { S7COMM_SYNTAXID_NOTIFY_INDSET, "NOTIFY_IND" }, { S7COMM_SYNTAXID_NCK, "NCK" }, { S7COMM_SYNTAXID_NCK_METRIC, "NCK_M" }, { S7COMM_SYNTAXID_NCK_INCH, "NCK_I" }, { S7COMM_SYNTAXID_DRIVEESANY, "DRIVEESANY" }, { S7COMM_SYNTAXID_1200SYM, "1200SYM" }, { S7COMM_SYNTAXID_DBREAD, "DBREAD" }, { 0, NULL } }; /************************************************************************** * Transport sizes in data */ #define S7COMM_DATA_TRANSPORT_SIZE_NULL 0 #define S7COMM_DATA_TRANSPORT_SIZE_BBIT 3 /* bit access, len is in bits */ #define S7COMM_DATA_TRANSPORT_SIZE_BBYTE 4 /* byte/word/dword access, len is in bits */ #define S7COMM_DATA_TRANSPORT_SIZE_BINT 5 /* integer access, len is in bits */ #define S7COMM_DATA_TRANSPORT_SIZE_BDINT 6 /* integer access, len is in bytes */ #define S7COMM_DATA_TRANSPORT_SIZE_BREAL 7 /* real access, len is in bytes */ #define S7COMM_DATA_TRANSPORT_SIZE_BSTR 9 /* octet string, len is in bytes */ #define S7COMM_DATA_TRANSPORT_SIZE_NCKADDR1 17 /* NCK address description, fixed length */ #define S7COMM_DATA_TRANSPORT_SIZE_NCKADDR2 18 /* NCK address description, fixed length */ static const value_string data_transportsizenames[] = { { S7COMM_DATA_TRANSPORT_SIZE_NULL, "NULL" }, { S7COMM_DATA_TRANSPORT_SIZE_BBIT, "BIT" }, { S7COMM_DATA_TRANSPORT_SIZE_BBYTE, "BYTE/WORD/DWORD" }, { S7COMM_DATA_TRANSPORT_SIZE_BINT, "INTEGER" }, { S7COMM_DATA_TRANSPORT_SIZE_BDINT, "DINTEGER" }, { S7COMM_DATA_TRANSPORT_SIZE_BREAL, "REAL" }, { S7COMM_DATA_TRANSPORT_SIZE_BSTR, "OCTET STRING" }, { S7COMM_DATA_TRANSPORT_SIZE_NCKADDR1, "NCK ADDRESS1" }, { S7COMM_DATA_TRANSPORT_SIZE_NCKADDR2, "NCK ADDRESS2" }, { 0, NULL } }; /************************************************************************** * Returnvalues of an item response */ const value_string s7comm_item_return_valuenames[] = { { S7COMM_ITEM_RETVAL_RESERVED, "Reserved" }, { S7COMM_ITEM_RETVAL_DATA_HW_FAULT, "Hardware error" }, { S7COMM_ITEM_RETVAL_DATA_ACCESS_FAULT, "Accessing the object not allowed" }, { S7COMM_ITEM_RETVAL_DATA_OUTOFRANGE, "Invalid address" }, { S7COMM_ITEM_RETVAL_DATA_NOT_SUP, "Data type not supported" }, { S7COMM_ITEM_RETVAL_DATA_SIZEMISMATCH, "Data type inconsistent" }, { S7COMM_ITEM_RETVAL_DATA_ERR, "Object does not exist" }, { S7COMM_ITEM_RETVAL_DATA_OK, "Success" }, { 0, NULL } }; /************************************************************************** * Block Types, used when blocktype is transfered as string */ #define S7COMM_BLOCKTYPE_OB 0x3038 /* '08' */ #define S7COMM_BLOCKTYPE_CMOD 0x3039 /* '09' */ #define S7COMM_BLOCKTYPE_DB 0x3041 /* '0A' */ #define S7COMM_BLOCKTYPE_SDB 0x3042 /* '0B' */ #define S7COMM_BLOCKTYPE_FC 0x3043 /* '0C' */ #define S7COMM_BLOCKTYPE_SFC 0x3044 /* '0D' */ #define S7COMM_BLOCKTYPE_FB 0x3045 /* '0E' */ #define S7COMM_BLOCKTYPE_SFB 0x3046 /* '0F' */ static const value_string blocktype_names[] = { { S7COMM_BLOCKTYPE_OB, "OB" }, { S7COMM_BLOCKTYPE_CMOD, "CMod" }, { S7COMM_BLOCKTYPE_DB, "DB" }, { S7COMM_BLOCKTYPE_SDB, "SDB" }, { S7COMM_BLOCKTYPE_FC, "FC" }, { S7COMM_BLOCKTYPE_SFC, "SFC" }, { S7COMM_BLOCKTYPE_FB, "FB" }, { S7COMM_BLOCKTYPE_SFB, "SFB" }, { 0, NULL } }; static const value_string blocktype_attribute1_names[] = { { '_', "Complete Module" }, { '$', "Module header for up-loading" }, { 0, NULL } }; static const value_string blocktype_attribute2_names[] = { { 'P', "Passive (copied, but not chained) module" }, { 'A', "Active embedded module" }, { 'B', "Active as well as passive module" }, { 0, NULL } }; /************************************************************************** * Subblk types */ #define S7COMM_SUBBLKTYPE_NONE 0x00 #define S7COMM_SUBBLKTYPE_OB 0x08 #define S7COMM_SUBBLKTYPE_DB 0x0a #define S7COMM_SUBBLKTYPE_SDB 0x0b #define S7COMM_SUBBLKTYPE_FC 0x0c #define S7COMM_SUBBLKTYPE_SFC 0x0d #define S7COMM_SUBBLKTYPE_FB 0x0e #define S7COMM_SUBBLKTYPE_SFB 0x0f static const value_string subblktype_names[] = { { S7COMM_SUBBLKTYPE_NONE, "Not set" }, { S7COMM_SUBBLKTYPE_OB, "OB" }, { S7COMM_SUBBLKTYPE_DB, "DB" }, { S7COMM_SUBBLKTYPE_SDB, "SDB" }, { S7COMM_SUBBLKTYPE_FC, "FC" }, { S7COMM_SUBBLKTYPE_SFC, "SFC" }, { S7COMM_SUBBLKTYPE_FB, "FB" }, { S7COMM_SUBBLKTYPE_SFB, "SFB" }, { 0, NULL } }; /************************************************************************** * Block security */ #define S7COMM_BLOCKSECURITY_OFF 0 #define S7COMM_BLOCKSECURITY_KNOWHOWPROTECT 3 static const value_string blocksecurity_names[] = { { S7COMM_BLOCKSECURITY_OFF, "None" }, { S7COMM_BLOCKSECURITY_KNOWHOWPROTECT, "Know How Protect" }, { 0, NULL } }; /************************************************************************** * Block Languages */ static const value_string blocklanguage_names[] = { { 0x00, "Not defined" }, { 0x01, "AWL" }, { 0x02, "KOP" }, { 0x03, "FUP" }, { 0x04, "SCL" }, { 0x05, "DB" }, { 0x06, "GRAPH" }, { 0x07, "SDB" }, { 0x08, "CPU-DB" }, /* DB was created from Plc programm (CREAT_DB) */ { 0x11, "SDB (after overall reset)" }, /* another SDB, don't know what it means, in SDB 1 and SDB 2, uncertain*/ { 0x12, "SDB (Routing)" }, /* another SDB, in SDB 999 and SDB 1000 (routing information), uncertain */ { 0x29, "ENCRYPT" }, /* block is encrypted with S7-Block-Privacy */ { 0, NULL } }; /************************************************************************** * Names of types in userdata parameter part */ static const value_string userdata_type_names[] = { { S7COMM_UD_TYPE_IND, "Indication" }, { S7COMM_UD_TYPE_REQ, "Request" }, { S7COMM_UD_TYPE_RES, "Response" }, { 0, NULL } }; /************************************************************************** * Subfunctions only used in Sinumerik NC file download */ #define S7COMM_NCPRG_FUNCREQUESTDOWNLOAD 1 #define S7COMM_NCPRG_FUNCDOWNLOADBLOCK 2 #define S7COMM_NCPRG_FUNCCONTDOWNLOAD 3 #define S7COMM_NCPRG_FUNCDOWNLOADENDED 4 #define S7COMM_NCPRG_FUNCSTARTUPLOAD 6 #define S7COMM_NCPRG_FUNCUPLOAD 7 #define S7COMM_NCPRG_FUNCCONTUPLOAD 8 static const value_string userdata_ncprg_subfunc_names[] = { { S7COMM_NCPRG_FUNCREQUESTDOWNLOAD, "Request download" }, { S7COMM_NCPRG_FUNCDOWNLOADBLOCK, "Download block" }, { S7COMM_NCPRG_FUNCCONTDOWNLOAD, "Continue download" }, { S7COMM_NCPRG_FUNCDOWNLOADENDED, "Download ended" }, { S7COMM_NCPRG_FUNCSTARTUPLOAD, "Start upload" }, { S7COMM_NCPRG_FUNCUPLOAD, "Upload" }, { S7COMM_NCPRG_FUNCCONTUPLOAD, "Continue upload" }, { 0, NULL } }; /************************************************************************** * Subfunctions for Data Record Routing to Profibus */ #define S7COMM_DRR_FUNCINIT 1 #define S7COMM_DRR_FUNCFINISH 2 #define S7COMM_DRR_FUNCDATA 3 static const value_string userdata_drr_subfunc_names[] = { { S7COMM_DRR_FUNCINIT, "DRR Init" }, { S7COMM_DRR_FUNCFINISH, "DRR Finish" }, { S7COMM_DRR_FUNCDATA, "DRR Data" }, { 0, NULL } }; /************************************************************************** * Userdata Parameter, last data unit */ #define S7COMM_UD_LASTDATAUNIT_YES 0x00 #define S7COMM_UD_LASTDATAUNIT_NO 0x01 static const value_string userdata_lastdataunit_names[] = { { S7COMM_UD_LASTDATAUNIT_YES, "Yes" }, { S7COMM_UD_LASTDATAUNIT_NO, "No" }, { 0, NULL } }; /************************************************************************** * Names of Function groups in userdata parameter part */ #define S7COMM_UD_FUNCGROUP_TIS 0x01 #define S7COMM_UD_FUNCGROUP_CYCLIC 0x02 #define S7COMM_UD_FUNCGROUP_BLOCK 0x03 #define S7COMM_UD_FUNCGROUP_CPU 0x04 #define S7COMM_UD_FUNCGROUP_SEC 0x05 /* Security functions e.g. plc password */ #define S7COMM_UD_FUNCGROUP_PBC_BSEND 0x06 /* PBC = Programmable Block Communication (PBK in german) */ #define S7COMM_UD_FUNCGROUP_TIME 0x07 #define S7COMM_UD_FUNCGROUP_NCPRG 0x3f #define S7COMM_UD_FUNCGROUP_DRR 0x20 static const value_string userdata_functiongroup_names[] = { { S7COMM_UD_FUNCGROUP_TIS, "Programmer commands" }, { S7COMM_UD_FUNCGROUP_CYCLIC, "Cyclic services" }, /* to read data from plc without a request */ { S7COMM_UD_FUNCGROUP_BLOCK, "Block functions" }, { S7COMM_UD_FUNCGROUP_CPU, "CPU functions" }, { S7COMM_UD_FUNCGROUP_SEC, "Security" }, { S7COMM_UD_FUNCGROUP_PBC_BSEND, "PBC BSEND" }, { S7COMM_UD_FUNCGROUP_TIME, "Time functions" }, { S7COMM_UD_FUNCGROUP_NCPRG, "NC programming" }, { S7COMM_UD_FUNCGROUP_DRR, "DR Routing" }, { 0, NULL } }; /************************************************************************** * Variable status: Area of data request * * Low Hi * 0=M 0=BOOL * 1=E 1=BYTE * 2=A 2=WORD * 3=PEx 3=DWORD * 7=DB * 54=TIMER * 64=COUNTER */ #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MX 0x00 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MB 0x01 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MW 0x02 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MD 0x03 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EX 0x10 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EB 0x11 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EW 0x12 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_ED 0x13 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AX 0x20 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AB 0x21 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AW 0x22 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AD 0x23 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PEB 0x31 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PEW 0x32 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PED 0x33 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBX 0x70 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBB 0x71 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBW 0x72 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBD 0x73 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_T 0x54 #define S7COMM_UD_SUBF_TIS_VARSTAT_AREA_C 0x64 static const value_string userdata_tis_varstat_area_names[] = { { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MX, "MX" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MB, "MB" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MW, "MW" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MD, "MD" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EB, "IB" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EX, "IX" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EW, "IW" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_ED, "ID" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AX, "QX" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AB, "QB" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AW, "QW" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AD, "QD" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PEB, "PIB" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PEW, "PIW" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PED, "PID" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBX, "DBX" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBB, "DBB" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBW, "DBW" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBD, "DBD" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_T, "TIMER" }, { S7COMM_UD_SUBF_TIS_VARSTAT_AREA_C, "COUNTER" }, { 0, NULL } }; /************************************************************************** * Names of userdata subfunctions in group 1 (Programmer commands) * In szl dataset 0x0132/2 these are defined as "Test and installation functions TIS". * The methods supported by the CPU are listed in the funkt_n bits. */ #define S7COMM_UD_SUBF_TIS_BLOCKSTAT 0x01 #define S7COMM_UD_SUBF_TIS_VARSTAT 0x02 #define S7COMM_UD_SUBF_TIS_OUTISTACK 0x03 #define S7COMM_UD_SUBF_TIS_OUTBSTACK 0x04 #define S7COMM_UD_SUBF_TIS_OUTLSTACK 0x05 #define S7COMM_UD_SUBF_TIS_TIMEMEAS 0x06 #define S7COMM_UD_SUBF_TIS_FORCESEL 0x07 #define S7COMM_UD_SUBF_TIS_MODVAR 0x08 #define S7COMM_UD_SUBF_TIS_FORCE 0x09 #define S7COMM_UD_SUBF_TIS_BREAKPOINT 0x0a #define S7COMM_UD_SUBF_TIS_EXITHOLD 0x0b #define S7COMM_UD_SUBF_TIS_MEMORYRES 0x0c #define S7COMM_UD_SUBF_TIS_DISABLEJOB 0x0d #define S7COMM_UD_SUBF_TIS_ENABLEJOB 0x0e #define S7COMM_UD_SUBF_TIS_DELETEJOB 0x0f #define S7COMM_UD_SUBF_TIS_READJOBLIST 0x10 #define S7COMM_UD_SUBF_TIS_READJOB 0x11 #define S7COMM_UD_SUBF_TIS_REPLACEJOB 0x12 #define S7COMM_UD_SUBF_TIS_BLOCKSTAT2 0x13 #define S7COMM_UD_SUBF_TIS_FLASHLED 0x16 static const value_string userdata_tis_subfunc_names[] = { { S7COMM_UD_SUBF_TIS_BLOCKSTAT, "Block status" }, { S7COMM_UD_SUBF_TIS_VARSTAT, "Variable status" }, { S7COMM_UD_SUBF_TIS_OUTISTACK, "Output ISTACK" }, { S7COMM_UD_SUBF_TIS_OUTBSTACK, "Output BSTACK" }, { S7COMM_UD_SUBF_TIS_OUTLSTACK, "Output LSTACK" }, { S7COMM_UD_SUBF_TIS_TIMEMEAS, "Time measurement from to" }, /* never seen yet */ { S7COMM_UD_SUBF_TIS_FORCESEL, "Force selection" }, { S7COMM_UD_SUBF_TIS_MODVAR, "Modify variable" }, { S7COMM_UD_SUBF_TIS_FORCE, "Force" }, { S7COMM_UD_SUBF_TIS_BREAKPOINT, "Breakpoint" }, { S7COMM_UD_SUBF_TIS_EXITHOLD, "Exit HOLD" }, { S7COMM_UD_SUBF_TIS_MEMORYRES, "Memory reset" }, { S7COMM_UD_SUBF_TIS_DISABLEJOB, "Disable job" }, { S7COMM_UD_SUBF_TIS_ENABLEJOB, "Enable job" }, { S7COMM_UD_SUBF_TIS_DELETEJOB, "Delete job" }, { S7COMM_UD_SUBF_TIS_READJOBLIST, "Read job list" }, { S7COMM_UD_SUBF_TIS_READJOB, "Read job" }, { S7COMM_UD_SUBF_TIS_REPLACEJOB, "Replace job" }, { S7COMM_UD_SUBF_TIS_BLOCKSTAT2, "Block status v2" }, { S7COMM_UD_SUBF_TIS_FLASHLED, "Flash LED" }, { 0, NULL } }; /************************************************************************** * Variable status: Trigger point */ static const value_string userdata_varstat_trgevent_names[] = { { 0x0000, "Immediately" }, { 0x0100, "System Trigger" }, { 0x0200, "System checkpoint main cycle start" }, { 0x0300, "System checkpoint main cycle end" }, { 0x0400, "Mode transition RUN-STOP" }, { 0x0500, "After code address" }, { 0x0600, "Code address area" }, { 0x0601, "Code address area with call environment" }, /* Call conditions like opened DB/DI or called block */ { 0x0700, "Data address" }, { 0x0800, "Data address area" }, { 0x0900, "Local data address" }, { 0x0a00, "Local data address area" }, { 0x0b00, "Range trigger" }, { 0x0c00, "Before code address" }, { 0, NULL } }; /************************************************************************** * Names of userdata subfunctions in group 2 (cyclic data) */ #define S7COMM_UD_SUBF_CYCLIC_TRANSF 0x01 #define S7COMM_UD_SUBF_CYCLIC_UNSUBSCRIBE 0x04 #define S7COMM_UD_SUBF_CYCLIC_CHANGE 0x05 #define S7COMM_UD_SUBF_CYCLIC_CHANGE_MOD 0x07 #define S7COMM_UD_SUBF_CYCLIC_RDREC 0x08 static const value_string userdata_cyclic_subfunc_names[] = { { S7COMM_UD_SUBF_CYCLIC_TRANSF, "Cyclic transfer" }, { S7COMM_UD_SUBF_CYCLIC_UNSUBSCRIBE, "Unsubscribe" }, { S7COMM_UD_SUBF_CYCLIC_CHANGE, "Change driven transfer" }, { S7COMM_UD_SUBF_CYCLIC_CHANGE_MOD, "Change driven transfer modify" }, { S7COMM_UD_SUBF_CYCLIC_RDREC, "RDREC" }, { 0, NULL } }; /************************************************************************** * Timebase for cyclic services */ static const value_string cycl_interval_timebase_names[] = { { 0, "100 milliseconds" }, { 1, "1 second" }, { 2, "10 seconds" }, { 0, NULL } }; /************************************************************************** * Names of userdata subfunctions in group 3 (Block functions) */ #define S7COMM_UD_SUBF_BLOCK_LIST 0x01 #define S7COMM_UD_SUBF_BLOCK_LISTTYPE 0x02 #define S7COMM_UD_SUBF_BLOCK_BLOCKINFO 0x03 static const value_string userdata_block_subfunc_names[] = { { S7COMM_UD_SUBF_BLOCK_LIST, "List blocks" }, { S7COMM_UD_SUBF_BLOCK_LISTTYPE, "List blocks of type" }, { S7COMM_UD_SUBF_BLOCK_BLOCKINFO, "Get block info" }, { 0, NULL } }; /************************************************************************** * Names of userdata subfunctions in group 4 (CPU functions) */ #define S7COMM_UD_SUBF_CPU_SCAN_IND 0x09 #define S7COMM_UD_SUBF_CPU_AR_SEND_IND 0x10 static const value_string userdata_cpu_subfunc_names[] = { { S7COMM_UD_SUBF_CPU_READSZL, "Read SZL" }, { S7COMM_UD_SUBF_CPU_MSGS, "Message service" }, /* Header constant is also different here */ { S7COMM_UD_SUBF_CPU_DIAGMSG, "Diagnostic message" }, /* Diagnostic message from PLC */ { S7COMM_UD_SUBF_CPU_ALARM8_IND, "ALARM_8 indication" }, /* PLC is indicating an ALARM message, using ALARM_8 SFBs */ { S7COMM_UD_SUBF_CPU_NOTIFY_IND, "NOTIFY indication" }, /* PLC is indicating a NOTIFY message, using NOTIFY SFBs */ { S7COMM_UD_SUBF_CPU_ALARM8LOCK, "ALARM_8 lock" }, /* Lock an ALARM message from HMI/SCADA */ { S7COMM_UD_SUBF_CPU_ALARM8UNLOCK, "ALARM_8 unlock" }, /* Unlock an ALARM message from HMI/SCADA */ { S7COMM_UD_SUBF_CPU_SCAN_IND, "SCAN indication" }, /* PLC is indicating a SCAN message */ { S7COMM_UD_SUBF_CPU_AR_SEND_IND, "AR_SEND indication" }, /* PLC is indicating a AR_SEND message */ { S7COMM_UD_SUBF_CPU_ALARMS_IND, "ALARM_S indication" }, /* PLC is indicating an ALARM message, using ALARM_S/ALARM_D SFCs */ { S7COMM_UD_SUBF_CPU_ALARMSQ_IND, "ALARM_SQ indication" }, /* PLC is indicating an ALARM message, using ALARM_SQ/ALARM_DQ SFCs */ { S7COMM_UD_SUBF_CPU_ALARMQUERY, "ALARM query" }, /* HMI/SCADA query of ALARMs */ { S7COMM_UD_SUBF_CPU_ALARMACK, "ALARM ack" }, /* Alarm was acknowledged in HMI/SCADA */ { S7COMM_UD_SUBF_CPU_ALARMACK_IND, "ALARM ack indication" }, /* Alarm acknowledge indication from CPU to HMI */ { S7COMM_UD_SUBF_CPU_ALARM8LOCK_IND, "ALARM lock indication" }, /* Alarm lock indication from CPU to HMI */ { S7COMM_UD_SUBF_CPU_ALARM8UNLOCK_IND, "ALARM unlock indication" }, /* Alarm unlock indication from CPU to HMI */ { S7COMM_UD_SUBF_CPU_NOTIFY8_IND, "NOTIFY_8 indication" }, { 0, NULL } }; /************************************************************************** * Names of userdata subfunctions in group 5 (Security?) */ #define S7COMM_UD_SUBF_SEC_PASSWD 0x01 static const value_string userdata_sec_subfunc_names[] = { { S7COMM_UD_SUBF_SEC_PASSWD, "PLC password" }, { 0, NULL } }; /************************************************************************** * Names of userdata subfunctions in group 7 (Time functions) */ #define S7COMM_UD_SUBF_TIME_READ 0x01 #define S7COMM_UD_SUBF_TIME_SET 0x02 #define S7COMM_UD_SUBF_TIME_READF 0x03 #define S7COMM_UD_SUBF_TIME_SET2 0x04 static const value_string userdata_time_subfunc_names[] = { { S7COMM_UD_SUBF_TIME_READ, "Read clock" }, { S7COMM_UD_SUBF_TIME_SET, "Set clock" }, { S7COMM_UD_SUBF_TIME_READF, "Read clock (following)" }, { S7COMM_UD_SUBF_TIME_SET2, "Set clock" }, { 0, NULL } }; /******************************************************************************************************* * Weekday names in DATE_AND_TIME */ static const value_string weekdaynames[] = { { 0, "Undefined" }, { 1, "Sunday" }, { 2, "Monday" }, { 3, "Tuesday" }, { 4, "Wednesday" }, { 5, "Thursday" }, { 6, "Friday" }, { 7, "Saturday" }, { 0, NULL } }; /************************************************************************** **************************************************************************/ /************************************************************************** * Flags for LID access */ #define S7COMM_TIA1200_VAR_ENCAPS_LID 0x2 #define S7COMM_TIA1200_VAR_ENCAPS_IDX 0x3 #define S7COMM_TIA1200_VAR_OBTAIN_LID 0x4 #define S7COMM_TIA1200_VAR_OBTAIN_IDX 0x5 #define S7COMM_TIA1200_VAR_PART_START 0x6 #define S7COMM_TIA1200_VAR_PART_LEN 0x7 static const value_string tia1200_var_lid_flag_names[] = { { S7COMM_TIA1200_VAR_ENCAPS_LID, "Encapsulated LID" }, { S7COMM_TIA1200_VAR_ENCAPS_IDX, "Encapsulated Index" }, { S7COMM_TIA1200_VAR_OBTAIN_LID, "Obtain by LID" }, { S7COMM_TIA1200_VAR_OBTAIN_IDX, "Obtain by Index" }, { S7COMM_TIA1200_VAR_PART_START, "Part Start Address" }, { S7COMM_TIA1200_VAR_PART_LEN, "Part Length" }, { 0, NULL } }; /************************************************************************** * TIA 1200 Area Names for variable access */ #define S7COMM_TIA1200_VAR_ITEM_AREA1_DB 0x8a0e /* Reading DB, 2 byte DB-Number following */ #define S7COMM_TIA1200_VAR_ITEM_AREA1_IQMCT 0x0000 /* Reading I/Q/M/C/T, 2 Byte detail area following */ static const value_string tia1200_var_item_area1_names[] = { { S7COMM_TIA1200_VAR_ITEM_AREA1_DB, "DB" }, { S7COMM_TIA1200_VAR_ITEM_AREA1_IQMCT, "IQMCT" }, { 0, NULL } }; #define S7COMM_TIA1200_VAR_ITEM_AREA2_I 0x50 #define S7COMM_TIA1200_VAR_ITEM_AREA2_Q 0x51 #define S7COMM_TIA1200_VAR_ITEM_AREA2_M 0x52 #define S7COMM_TIA1200_VAR_ITEM_AREA2_C 0x53 #define S7COMM_TIA1200_VAR_ITEM_AREA2_T 0x54 static const value_string tia1200_var_item_area2_names[] = { { S7COMM_TIA1200_VAR_ITEM_AREA2_I, "Inputs (I)" }, { S7COMM_TIA1200_VAR_ITEM_AREA2_Q, "Outputs (Q)" }, { S7COMM_TIA1200_VAR_ITEM_AREA2_M, "Flags (M)" }, { S7COMM_TIA1200_VAR_ITEM_AREA2_C, "Counter (C)" }, { S7COMM_TIA1200_VAR_ITEM_AREA2_T, "Timer (T)" }, { 0, NULL } }; /************************************************************************** * NCK areas */ #define S7COMM_NCK_AREA_N_NCK 0 #define S7COMM_NCK_AREA_B_MODEGROUP 1 #define S7COMM_NCK_AREA_C_CHANNEL 2 #define S7COMM_NCK_AREA_A_AXIS 3 #define S7COMM_NCK_AREA_T_TOOL 4 #define S7COMM_NCK_AREA_V_FEEDDRIVE 5 #define S7COMM_NCK_AREA_H_MAINDRIVE 6 #define S7COMM_NCK_AREA_M_MMC 7 static const value_string nck_area_names[] = { { S7COMM_NCK_AREA_N_NCK, "N - NCK" }, { S7COMM_NCK_AREA_B_MODEGROUP, "B - Mode group" }, { S7COMM_NCK_AREA_C_CHANNEL, "C - Channel" }, { S7COMM_NCK_AREA_A_AXIS, "A - Axis" }, { S7COMM_NCK_AREA_T_TOOL, "T - Tool" }, { S7COMM_NCK_AREA_V_FEEDDRIVE, "V - Feed drive" }, { S7COMM_NCK_AREA_H_MAINDRIVE, "M - Main drive" }, { S7COMM_NCK_AREA_M_MMC, "M - MMC" }, { 0, NULL } }; static const value_string nck_module_names[] = { { 0x10, "Y - Global system data" }, { 0x11, "YNCFL - NCK instruction groups" }, { 0x12, "FU - NCU global settable frames" }, { 0x13, "FA - Active NCU global frames" }, { 0x14, "TO - Tool data" }, { 0x15, "RP - Arithmetic parameters" }, { 0x16, "SE - Setting data" }, { 0x17, "SGUD - SGUD-Block" }, { 0x18, "LUD - Local userdata" }, { 0x19, "TC - Toolholder parameters" }, { 0x1a, "M - Machine data" }, { 0x1c, "WAL - Working area limitation" }, { 0x1e, "DIAG - Internal diagnostic data" }, { 0x1f, "CC - Unknown" }, { 0x20, "FE - Channel-specific external frame" }, { 0x21, "TD - Tool data: General data" }, { 0x22, "TS - Tool edge data: Monitoring data" }, { 0x23, "TG - Tool data: Grinding-specific data" }, { 0x24, "TU - Tool data" }, { 0x25, "TUE - Tool edge data, userdefined data" }, { 0x26, "TV - Tool data, directory" }, { 0x27, "TM - Magazine data: General data" }, { 0x28, "TP - Magazine data: Location data" }, { 0x29, "TPM - Magazine data: Multiple assignment of location data" }, { 0x2a, "TT - Magazine data: Location typ" }, { 0x2b, "TMV - Magazine data: Directory" }, { 0x2c, "TMC - Magazine data: Configuration data" }, { 0x2d, "MGUD - MGUD-Block" }, { 0x2e, "UGUD - UGUD-Block" }, { 0x2f, "GUD4 - GUD4-Block" }, { 0x30, "GUD5 - GUD5-Block" }, { 0x31, "GUD6 - GUD6-Block" }, { 0x32, "GUD7 - GUD7-Block" }, { 0x33, "GUD8 - GUD8-Block" }, { 0x34, "GUD9 - GUD9-Block" }, { 0x35, "PA - Channel-specific protection zones" }, { 0x36, "GD1 - SGUD-Block GD1" }, { 0x37, "NIB - State data: Nibbling" }, { 0x38, "ETP - Types of events" }, { 0x39, "ETPD - Data lists for protocolling" }, { 0x3a, "SYNACT - Channel-specific synchronous actions" }, { 0x3b, "DIAGN - Diagnostic data" }, { 0x3c, "VSYN - Channel-specific user variables for synchronous actions" }, { 0x3d, "TUS - Tool data: user monitoring data" }, { 0x3e, "TUM - Tool data: user magazine data" }, { 0x3f, "TUP - Tool data: user magazine place data" }, { 0x40, "TF - Parameterizing, return parameters of _N_TMGETT, _N_TSEARC" }, { 0x41, "FB - Channel-specific base frames" }, { 0x42, "SSP2 - State data: Spindle" }, { 0x43, "PUD - programmglobale Benutzerdaten" }, { 0x44, "TOS - Edge-related location-dependent fine total offsets" }, { 0x45, "TOST - Edge-related location-dependent fine total offsets, transformed" }, { 0x46, "TOE - Edge-related coarse total offsets, setup offsets" }, { 0x47, "TOET - Edge-related coarse total offsets, transformed setup offsets" }, { 0x48, "AD - Adapter data" }, { 0x49, "TOT - Edge data: Transformed offset data" }, { 0x4a, "AEV - Working offsets: Directory" }, { 0x4b, "YFAFL - NCK instruction groups (Fanuc)" }, { 0x4c, "FS - System-Frame" }, { 0x4d, "SD - Servo data" }, { 0x4e, "TAD - Application-specific data" }, { 0x4f, "TAO - Application-specific cutting edge data" }, { 0x50, "TAS - Application-specific monitoring data" }, { 0x51, "TAM - Application-specific magazine data" }, { 0x52, "TAP - Application-specific magazine location data" }, { 0x53, "MEM - Unknown" }, { 0x54, "SALUC - Alarm actions: List in reverse chronological order" }, { 0x55, "AUXFU - Auxiliary functions" }, { 0x56, "TDC - Tool/Tools" }, { 0x57, "CP - Generic coupling" }, { 0x6e, "SDME - Unknown" }, { 0x6f, "SPARPI - Program pointer on interruption" }, { 0x70, "SEGA - State data: Geometry axes in tool offset memory (extended)" }, { 0x71, "SEMA - State data: Machine axes (extended)" }, { 0x72, "SSP - State data: Spindle" }, { 0x73, "SGA - State data: Geometry axes in tool offset memory" }, { 0x74, "SMA - State data: Machine axes" }, { 0x75, "SALAL - Alarms: List organized according to time" }, { 0x76, "SALAP - Alarms: List organized according to priority" }, { 0x77, "SALA - Alarms: List organized according to time" }, { 0x78, "SSYNAC - Synchronous actions" }, { 0x79, "SPARPF - Program pointers for block search and stop run" }, { 0x7a, "SPARPP - Program pointer in automatic operation" }, { 0x7b, "SNCF - Active G functions" }, { 0x7d, "SPARP - Part program information" }, { 0x7e, "SINF - Part-program-specific status data" }, { 0x7f, "S - State data" }, { 0x80, "0x80 - Unknown" }, { 0x81, "0x81 - Unknown" }, { 0x82, "0x82 - Unknown" }, { 0x83, "0x83 - Unknown" }, { 0x84, "0x84 - Unknown" }, { 0x85, "0x85 - Unknown" }, { 0xfd, "0 - Internal" }, { 0, NULL } }; static value_string_ext nck_module_names_ext = VALUE_STRING_EXT_INIT(nck_module_names); static gint hf_s7comm_tia1200_item_reserved1 = -1; /* 1 Byte Reserved (always 0xff?) */ static gint hf_s7comm_tia1200_item_area1 = -1; /* 2 Byte2 Root area (DB or IQMCT) */ static gint hf_s7comm_tia1200_item_area2 = -1; /* 2 Bytes detail area (I/Q/M/C/T) */ static gint hf_s7comm_tia1200_item_area2unknown = -1; /* 2 Bytes detail area for possible unknown or not seen areas */ static gint hf_s7comm_tia1200_item_dbnumber = -1; /* 2 Bytes DB number */ static gint hf_s7comm_tia1200_item_crc = -1; /* 4 Bytes CRC */ static gint hf_s7comm_tia1200_substructure_item = -1; /* Substructure */ static gint hf_s7comm_tia1200_var_lid_flags = -1; /* LID Flags */ static gint hf_s7comm_tia1200_item_value = -1; /************************************************************************** **************************************************************************/ /* Header Block */ static gint hf_s7comm_header = -1; static gint hf_s7comm_header_protid = -1; /* Header Byte 0 */ static gint hf_s7comm_header_rosctr = -1; /* Header Bytes 1 */ static gint hf_s7comm_header_redid = -1; /* Header Bytes 2, 3 */ static gint hf_s7comm_header_pduref = -1; /* Header Bytes 4, 5 */ static gint hf_s7comm_header_parlg = -1; /* Header Bytes 6, 7 */ static gint hf_s7comm_header_datlg = -1; /* Header Bytes 8, 9 */ static gint hf_s7comm_header_errcls = -1; /* Header Byte 10, only available at type 2 or 3 */ static gint hf_s7comm_header_errcod = -1; /* Header Byte 11, only available at type 2 or 3 */ /* Parameter Block */ static gint hf_s7comm_param = -1; static gint hf_s7comm_param_errcod = -1; /* Parameter part: Error code */ static gint hf_s7comm_param_service = -1; /* Parameter part: service */ static gint hf_s7comm_param_itemcount = -1; /* Parameter part: item count */ static gint hf_s7comm_param_data = -1; /* Parameter part: data */ static gint hf_s7comm_param_neg_pdu_length = -1; /* Parameter part: Negotiate PDU length */ static gint hf_s7comm_param_setup_reserved1 = -1; /* Parameter part: Reserved byte in communication setup pdu*/ static gint hf_s7comm_param_maxamq_calling = -1; /* Parameter part: Max AmQ calling */ static gint hf_s7comm_param_maxamq_called = -1; /* Parameter part: Max AmQ called */ /* Item data */ static gint hf_s7comm_param_item = -1; static gint hf_s7comm_param_subitem = -1; /* Substructure */ static gint hf_s7comm_item_varspec = -1; /* Variable specification */ static gint hf_s7comm_item_varspec_length = -1; /* Length of following address specification */ static gint hf_s7comm_item_syntax_id = -1; /* Syntax Id */ static gint hf_s7comm_item_transport_size = -1; /* Transport size, 1 Byte*/ static gint hf_s7comm_item_length = -1; /* length, 2 Bytes*/ static gint hf_s7comm_item_db = -1; /* DB/M/E/A, 2 Bytes */ static gint hf_s7comm_item_area = -1; /* Area code, 1 byte */ static gint hf_s7comm_item_address = -1; /* Bit address, 3 Bytes */ static gint hf_s7comm_item_address_byte = -1; /* address: Byte address */ static gint hf_s7comm_item_address_bit = -1; /* address: Bit address */ static gint hf_s7comm_item_address_nr = -1; /* address: Timer/Counter/block number */ /* Special variable read with Syntax-Id 0xb0 (DBREAD) */ static gint hf_s7comm_item_dbread_numareas = -1; /* Number of areas following, 1 Byte*/ static gint hf_s7comm_item_dbread_length = -1; /* length, 1 Byte*/ static gint hf_s7comm_item_dbread_db = -1; /* DB number, 2 Bytes*/ static gint hf_s7comm_item_dbread_startadr = -1; /* Start address, 2 Bytes*/ /* Reading frequency inverter parameters via routing */ static gint hf_s7comm_item_driveesany_unknown1 = -1; /* Unknown value 1, 1 Byte */ static gint hf_s7comm_item_driveesany_unknown2 = -1; /* Unknown value 2, 2 Bytes */ static gint hf_s7comm_item_driveesany_unknown3 = -1; /* Unknown value 3, 2 Bytes */ static gint hf_s7comm_item_driveesany_parameter_nr = -1; /* Parameter number, 2 Bytes */ static gint hf_s7comm_item_driveesany_parameter_idx = -1; /* Parameter index, 2 Bytes */ /* NCK access with Syntax-Id 0x82 */ static gint hf_s7comm_item_nck_areaunit = -1; /* Bitmask: aaauuuuu: a=area, u=unit */ static gint hf_s7comm_item_nck_area = -1; static gint hf_s7comm_item_nck_unit = -1; static gint hf_s7comm_item_nck_column = -1; static gint hf_s7comm_item_nck_line = -1; static gint hf_s7comm_item_nck_module = -1; static gint hf_s7comm_item_nck_linecount = -1; static gint hf_s7comm_data = -1; static gint hf_s7comm_data_returncode = -1; /* return code, 1 byte */ static gint hf_s7comm_data_transport_size = -1; /* transport size 1 byte */ static gint hf_s7comm_data_length = -1; /* Length of data, 2 Bytes */ static gint hf_s7comm_data_item = -1; static gint hf_s7comm_readresponse_data = -1; static gint hf_s7comm_data_fillbyte = -1; /* timefunction: s7 timestamp */ static gint hf_s7comm_data_ts = -1; static gint hf_s7comm_data_ts_reserved = -1; static gint hf_s7comm_data_ts_year1 = -1; /* first byte of BCD coded year, should be ignored */ static gint hf_s7comm_data_ts_year2 = -1; /* second byte of BCD coded year, if 00...89 then it's 2000...2089, else 1990...1999*/ static gint hf_s7comm_data_ts_month = -1; static gint hf_s7comm_data_ts_day = -1; static gint hf_s7comm_data_ts_hour = -1; static gint hf_s7comm_data_ts_minute = -1; static gint hf_s7comm_data_ts_second = -1; static gint hf_s7comm_data_ts_millisecond = -1; static gint hf_s7comm_data_ts_weekday = -1; /* userdata, block services */ static gint hf_s7comm_userdata_data = -1; static gint hf_s7comm_userdata_param_type = -1; static gint hf_s7comm_userdata_param_funcgroup = -1; static gint hf_s7comm_userdata_param_subfunc_prog = -1; static gint hf_s7comm_userdata_param_subfunc_cyclic = -1; static gint hf_s7comm_userdata_param_subfunc_block = -1; static gint hf_s7comm_userdata_param_subfunc_cpu = -1; static gint hf_s7comm_userdata_param_subfunc_sec = -1; static gint hf_s7comm_userdata_param_subfunc_time = -1; static gint hf_s7comm_userdata_param_subfunc_ncprg = -1; static gint hf_s7comm_userdata_param_subfunc_drr = -1; static gint hf_s7comm_userdata_param_subfunc = -1; /* for all other subfunctions */ static gint hf_s7comm_userdata_param_seq_num = -1; static gint hf_s7comm_userdata_param_dataunitref = -1; static gint hf_s7comm_userdata_param_dataunit = -1; /* block functions, list blocks of type */ static gint hf_s7comm_ud_blockinfo_block_type = -1; /* Block type, 2 bytes */ static gint hf_s7comm_ud_blockinfo_block_num = -1; /* Block number, 2 bytes as int */ static gint hf_s7comm_ud_blockinfo_block_cnt = -1; /* Count, 2 bytes as int */ static gint hf_s7comm_ud_blockinfo_block_flags = -1; /* Block flags (unknown), 1 byte */ static gint hf_s7comm_ud_blockinfo_block_lang = -1; /* Block language, 1 byte, stringlist blocklanguage_names */ /* block functions, get block infos */ static gint hf_s7comm_ud_blockinfo_block_num_ascii = -1; /* Block number, 5 bytes, ASCII*/ static gint hf_s7comm_ud_blockinfo_filesys = -1; /* Filesystem, 1 byte, ASCII*/ static gint hf_s7comm_ud_blockinfo_res_infolength = -1; /* Length of Info, 2 bytes as int */ static gint hf_s7comm_ud_blockinfo_res_unknown2 = -1; /* Unknown blockinfo 2, 2 bytes, HEX*/ static gint hf_s7comm_ud_blockinfo_res_const3 = -1; /* Constant 3, 2 bytes, ASCII */ static gint hf_s7comm_ud_blockinfo_res_unknown = -1; /* Unknown byte(s) */ static gint hf_s7comm_ud_blockinfo_subblk_type = -1; /* Subblk type, 1 byte, stringlist subblktype_names */ static gint hf_s7comm_ud_blockinfo_load_mem_len = -1; /* Length load memory, 4 bytes, int */ static gint hf_s7comm_ud_blockinfo_blocksecurity = -1; /* Block Security, 4 bytes, stringlist blocksecurity_names*/ static gint hf_s7comm_ud_blockinfo_interface_timestamp = -1;/* Interface Timestamp, string */ static gint hf_s7comm_ud_blockinfo_code_timestamp = -1; /* Code Timestamp, string */ static gint hf_s7comm_ud_blockinfo_ssb_len = -1; /* SSB length, 2 bytes, int */ static gint hf_s7comm_ud_blockinfo_add_len = -1; /* ADD length, 2 bytes, int */ static gint hf_s7comm_ud_blockinfo_localdata_len = -1; /* Length localdata, 2 bytes, int */ static gint hf_s7comm_ud_blockinfo_mc7_len = -1; /* Length MC7 code, 2 bytes, int */ static gint hf_s7comm_ud_blockinfo_author = -1; /* Author, 8 bytes, ASCII */ static gint hf_s7comm_ud_blockinfo_family = -1; /* Family, 8 bytes, ASCII */ static gint hf_s7comm_ud_blockinfo_headername = -1; /* Name (Header), 8 bytes, ASCII */ static gint hf_s7comm_ud_blockinfo_headerversion = -1; /* Version (Header), 8 bytes, ASCII */ static gint hf_s7comm_ud_blockinfo_checksum = -1; /* Block checksum, 2 bytes, HEX */ static gint hf_s7comm_ud_blockinfo_reserved1 = -1; /* Reserved 1, 4 bytes, HEX */ static gint hf_s7comm_ud_blockinfo_reserved2 = -1; /* Reserved 2, 4 bytes, HEX */ static gint hf_s7comm_userdata_blockinfo_flags = -1; /* Some flags in Block info response */ static gint hf_s7comm_userdata_blockinfo_linked = -1; /* Some flags in Block info response */ static gint hf_s7comm_userdata_blockinfo_standard_block = -1; static gint hf_s7comm_userdata_blockinfo_nonretain = -1; /* Some flags in Block info response */ static gint ett_s7comm_userdata_blockinfo_flags = -1; static int * const s7comm_userdata_blockinfo_flags_fields[] = { &hf_s7comm_userdata_blockinfo_linked, &hf_s7comm_userdata_blockinfo_standard_block, &hf_s7comm_userdata_blockinfo_nonretain, NULL }; /* Programmer commands / Test and installation (TIS) functions */ static gint hf_s7comm_tis_parameter = -1; static gint hf_s7comm_tis_data = -1; static gint hf_s7comm_tis_parametersize = -1; static gint hf_s7comm_tis_datasize = -1; static gint hf_s7comm_tis_param1 = -1; static gint hf_s7comm_tis_param2 = -1; static const value_string tis_param2_names[] = { /* Values and their meaning are not always clearly defined in every function */ { 0, "Update Monitor Variables / Activate Modify Values"}, { 1, "Monitor Variable / Modify Variable" }, { 2, "Modify Variable permanent" }, { 256, "Force immediately" }, { 0, NULL } }; static gint hf_s7comm_tis_param3 = -1; static const value_string tis_param3_names[] = { { 0, "Every cycle (permanent)" }, { 1, "Once" }, { 2, "Always (force)" }, { 0, NULL } }; static gint hf_s7comm_tis_answersize = -1; static gint hf_s7comm_tis_param5 = -1; static gint hf_s7comm_tis_param6 = -1; static gint hf_s7comm_tis_param7 = -1; static gint hf_s7comm_tis_param8 = -1; static gint hf_s7comm_tis_param9 = -1; static gint hf_s7comm_tis_trgevent = -1; static gint hf_s7comm_tis_res_param1 = -1; static gint hf_s7comm_tis_res_param2 = -1; static gint hf_s7comm_tis_job_function = -1; static gint hf_s7comm_tis_job_seqnr = -1; static gint hf_s7comm_tis_job_reserved = -1; /* B/I/L Stack */ static gint hf_s7comm_tis_interrupted_blocktype = -1; static gint hf_s7comm_tis_interrupted_blocknr = -1; static gint hf_s7comm_tis_interrupted_address = -1; static gint hf_s7comm_tis_interrupted_prioclass = -1; static gint hf_s7comm_tis_continued_blocktype = -1; static gint hf_s7comm_tis_continued_blocknr = -1; static gint hf_s7comm_tis_continued_address = -1; static gint hf_s7comm_tis_breakpoint_blocktype = -1; static gint hf_s7comm_tis_breakpoint_blocknr = -1; static gint hf_s7comm_tis_breakpoint_address = -1; static gint hf_s7comm_tis_breakpoint_reserved = -1; static gint hf_s7comm_tis_p_callenv = -1; static const value_string tis_p_callenv_names[] = { { 0, "Specified call environment"}, { 2, "Specified global and/or instance data block"}, { 0, NULL } }; static gint hf_s7comm_tis_p_callcond = -1; static const value_string tis_p_callcond_names[] = { { 0x0000, "Not set" }, { 0x0001, "On block number" }, { 0x0101, "On block number with code address" }, { 0x0a00, "On DB1 (DB) content" }, { 0x000a, "On DB2 (DI) content" }, { 0x0a0a, "On DB1 (DB) and DB2 (DI) content" }, { 0, NULL } }; static gint hf_s7comm_tis_p_callcond_blocktype = -1; static gint hf_s7comm_tis_p_callcond_blocknr = -1; static gint hf_s7comm_tis_p_callcond_address = -1; static gint hf_s7comm_tis_register_db1_type = -1; static gint hf_s7comm_tis_register_db2_type = -1; static gint hf_s7comm_tis_register_db1_nr = -1; static gint hf_s7comm_tis_register_db2_nr = -1; static gint hf_s7comm_tis_register_accu1 = -1; static gint hf_s7comm_tis_register_accu2 = -1; static gint hf_s7comm_tis_register_accu3 = -1; static gint hf_s7comm_tis_register_accu4 = -1; static gint hf_s7comm_tis_register_ar1 = -1; static gint hf_s7comm_tis_register_ar2 = -1; static gint hf_s7comm_tis_register_stw = -1; static gint hf_s7comm_tis_exithold_until = -1; static const value_string tis_exithold_until_names[] = { { 0, "Next breakpoint" }, { 1, "Next statement" }, { 0, NULL } }; static gint hf_s7comm_tis_exithold_res1 = -1; static gint hf_s7comm_tis_bstack_nest_depth = -1; static gint hf_s7comm_tis_bstack_reserved = -1; static gint hf_s7comm_tis_istack_reserved = -1; static gint hf_s7comm_tis_lstack_reserved = -1; static gint hf_s7comm_tis_lstack_size = -1; static gint hf_s7comm_tis_lstack_data = -1; static gint hf_s7comm_tis_blockstat_flagsunknown = -1; static gint hf_s7comm_tis_blockstat_number_of_lines = -1; static gint hf_s7comm_tis_blockstat_line_address = -1; static gint hf_s7comm_tis_blockstat_data = -1; static gint hf_s7comm_tis_blockstat_reserved = -1; /* Organization block local data */ static gint hf_s7comm_ob_ev_class = -1; static gint hf_s7comm_ob_scan_1 = -1; static gint hf_s7comm_ob_strt_inf = -1; static gint hf_s7comm_ob_flt_id = -1; static gint hf_s7comm_ob_priority = -1; static gint hf_s7comm_ob_number = -1; static gint hf_s7comm_ob_reserved_1 = -1; static gint hf_s7comm_ob_reserved_2 = -1; static gint hf_s7comm_ob_reserved_3 = -1; static gint hf_s7comm_ob_reserved_4 = -1; static gint hf_s7comm_ob_reserved_4_dw = -1; static gint hf_s7comm_ob_prev_cycle = -1; static gint hf_s7comm_ob_min_cycle = -1; static gint hf_s7comm_ob_max_cycle = -1; static gint hf_s7comm_ob_period_exe = -1; static gint hf_s7comm_ob_sign = -1; static gint hf_s7comm_ob_dtime = -1; static gint hf_s7comm_ob_phase_offset = -1; static gint hf_s7comm_ob_exec_freq = -1; static gint hf_s7comm_ob_io_flag = -1; static gint hf_s7comm_ob_mdl_addr = -1; static gint hf_s7comm_ob_point_addr = -1; static gint hf_s7comm_ob_inf_len = -1; static gint hf_s7comm_ob_alarm_type = -1; static gint hf_s7comm_ob_alarm_slot = -1; static gint hf_s7comm_ob_alarm_spec = -1; static gint hf_s7comm_ob_error_info = -1; static gint hf_s7comm_ob_err_ev_class = -1; static gint hf_s7comm_ob_err_ev_num = -1; static gint hf_s7comm_ob_err_ob_priority = -1; static gint hf_s7comm_ob_err_ob_num = -1; static gint hf_s7comm_ob_rack_cpu = -1; static gint hf_s7comm_ob_8x_fault_flags = -1; static gint hf_s7comm_ob_mdl_type_b = -1; static gint hf_s7comm_ob_mdl_type_w = -1; static gint hf_s7comm_ob_rack_num = -1; static gint hf_s7comm_ob_racks_flt = -1; static gint hf_s7comm_ob_strtup = -1; static gint hf_s7comm_ob_stop = -1; static gint hf_s7comm_ob_strt_info = -1; static gint hf_s7comm_ob_sw_flt = -1; static gint hf_s7comm_ob_blk_type = -1; static gint hf_s7comm_ob_flt_reg = -1; static gint hf_s7comm_ob_flt_blk_num = -1; static gint hf_s7comm_ob_prg_addr = -1; static gint hf_s7comm_ob_mem_area = -1; static gint hf_s7comm_ob_mem_addr = -1; static gint hf_s7comm_diagdata_req_block_type = -1; static gint hf_s7comm_diagdata_req_block_num = -1; static gint hf_s7comm_diagdata_req_startaddr_awl = -1; static gint hf_s7comm_diagdata_req_saz = -1; /* Flags for requested registers in diagnostic data telegrams */ static gint hf_s7comm_diagdata_registerflag = -1; /* Registerflags */ static gint hf_s7comm_diagdata_registerflag_stw = -1; /* STW = Status word */ static gint hf_s7comm_diagdata_registerflag_accu1 = -1; /* Accumulator 1 */ static gint hf_s7comm_diagdata_registerflag_accu2 = -1; /* Accumulator 2 */ static gint hf_s7comm_diagdata_registerflag_ar1 = -1; /* Addressregister 1 */ static gint hf_s7comm_diagdata_registerflag_ar2 = -1; /* Addressregister 2 */ static gint hf_s7comm_diagdata_registerflag_db1 = -1; /* Datablock register 1 */ static gint hf_s7comm_diagdata_registerflag_db2 = -1; /* Datablock register 2 */ static gint ett_s7comm_diagdata_registerflag = -1; static int * const s7comm_diagdata_registerflag_fields[] = { &hf_s7comm_diagdata_registerflag_stw, &hf_s7comm_diagdata_registerflag_accu1, &hf_s7comm_diagdata_registerflag_accu2, &hf_s7comm_diagdata_registerflag_ar1, &hf_s7comm_diagdata_registerflag_ar2, &hf_s7comm_diagdata_registerflag_db1, &hf_s7comm_diagdata_registerflag_db2, NULL }; static heur_dissector_list_t s7comm_heur_subdissector_list; static expert_field ei_s7comm_data_blockcontrol_block_num_invalid = EI_INIT; static expert_field ei_s7comm_ud_blockinfo_block_num_ascii_invalid = EI_INIT; /* PI service name IDs. Index represents the index in pi_service_names */ typedef enum { S7COMM_PI_UNKNOWN = 0, S7COMM_PI_INSE, S7COMM_PI_INS2, S7COMM_PI_DELE, S7COMM_PIP_PROGRAM, S7COMM_PI_MODU, S7COMM_PI_GARB, S7COMM_PI_N_LOGIN_, S7COMM_PI_N_LOGOUT, S7COMM_PI_N_CANCEL, S7COMM_PI_N_DASAVE, S7COMM_PI_N_DIGIOF, S7COMM_PI_N_DIGION, S7COMM_PI_N_DZERO_, S7COMM_PI_N_ENDEXT, S7COMM_PI_N_F_OPER, S7COMM_PI_N_OST_OF, S7COMM_PI_N_OST_ON, S7COMM_PI_N_SCALE_, S7COMM_PI_N_SETUFR, S7COMM_PI_N_STRTLK, S7COMM_PI_N_STRTUL, S7COMM_PI_N_TMRASS, S7COMM_PI_N_F_DELE, S7COMM_PI_N_EXTERN, S7COMM_PI_N_EXTMOD, S7COMM_PI_N_F_DELR, S7COMM_PI_N_F_XFER, S7COMM_PI_N_LOCKE_, S7COMM_PI_N_SELECT, S7COMM_PI_N_SRTEXT, S7COMM_PI_N_F_CLOS, S7COMM_PI_N_F_OPEN, S7COMM_PI_N_F_SEEK, S7COMM_PI_N_ASUP__, S7COMM_PI_N_CHEKDM, S7COMM_PI_N_CHKDNO, S7COMM_PI_N_CONFIG, S7COMM_PI_N_CRCEDN, S7COMM_PI_N_DELECE, S7COMM_PI_N_CREACE, S7COMM_PI_N_CREATO, S7COMM_PI_N_DELETO, S7COMM_PI_N_CRTOCE, S7COMM_PI_N_DELVAR, S7COMM_PI_N_F_COPY, S7COMM_PI_N_F_DMDA, S7COMM_PI_N_F_PROR, S7COMM_PI_N_F_PROT, S7COMM_PI_N_F_RENA, S7COMM_PI_N_FINDBL, S7COMM_PI_N_IBN_SS, S7COMM_PI_N_MMCSEM, S7COMM_PI_N_NCKMOD, S7COMM_PI_N_NEWPWD, S7COMM_PI_N_SEL_BL, S7COMM_PI_N_SETTST, S7COMM_PI_N_TMAWCO, S7COMM_PI_N_TMCRTC, S7COMM_PI_N_TMCRTO, S7COMM_PI_N_TMFDPL, S7COMM_PI_N_TMFPBP, S7COMM_PI_N_TMGETT, S7COMM_PI_N_TMMVTL, S7COMM_PI_N_TMPCIT, S7COMM_PI_N_TMPOSM, S7COMM_PI_N_TRESMO, S7COMM_PI_N_TSEARC } pi_service_e; /* Description for PI service names */ static const string_string pi_service_names[] = { { "UNKNOWN", "PI-Service is currently unknown" }, { "_INSE", "PI-Service _INSE (Activates a PLC module)" }, { "_INS2", "PI-Service _INS2 (Activates a PLC module)" }, { "_DELE", "PI-Service _DELE (Removes module from the PLC's passive file system)" }, { "P_PROGRAM", "PI-Service P_PROGRAM (PLC Start / Stop)" }, { "_MODU", "PI-Service _MODU (PLC Copy Ram to Rom)" }, { "_GARB", "PI-Service _GARB (Compress PLC memory)" }, { "_N_LOGIN_", "PI-Service _N_LOGIN_ (Login)" }, { "_N_LOGOUT", "PI-Service _N_LOGOUT (Logout)" }, { "_N_CANCEL", "PI-Service _N_CANCEL (Cancels NC alarm)" }, { "_N_DASAVE", "PI-Service _N_DASAVE (PI-Service for copying data from SRAM to FLASH)" }, { "_N_DIGIOF", "PI-Service _N_DIGIOF (Turns off digitizing)" }, { "_N_DIGION", "PI-Service _N_DIGION (Turns on digitizing)" }, { "_N_DZERO_", "PI-Service _N_DZERO_ (Set all D nos. invalid for function \"unique D no.\")" }, { "_N_ENDEXT", "PI-Service _N_ENDEXT ()" }, { "_N_F_OPER", "PI-Service _N_F_OPER (Opens a file read-only)" }, { "_N_OST_OF", "PI-Service _N_OST_OF (Overstore OFF)" }, { "_N_OST_ON", "PI-Service _N_OST_ON (Overstore ON)" }, { "_N_SCALE_", "PI-Service _N_SCALE_ (Unit of measurement setting (metric<->INCH))" }, { "_N_SETUFR", "PI-Service _N_SETUFR (Activates user frame)" }, { "_N_STRTLK", "PI-Service _N_STRTLK (The global start disable is set)" }, { "_N_STRTUL", "PI-Service _N_STRTUL (The global start disable is reset)" }, { "_N_TMRASS", "PI-Service _N_TMRASS (Resets the Active status)" }, { "_N_F_DELE", "PI-Service _N_F_DELE (Deletes file)" }, { "_N_EXTERN", "PI-Service _N_EXTERN (Selects external program for execution)" }, { "_N_EXTMOD", "PI-Service _N_EXTMOD (Selects external program for execution)" }, { "_N_F_DELR", "PI-Service _N_F_DELR (Delete file even without access rights)" }, { "_N_F_XFER", "PI-Service _N_F_XFER (Selects file for uploading)" }, { "_N_LOCKE_", "PI-Service _N_LOCKE_ (Locks the active file for editing)" }, { "_N_SELECT", "PI-Service _N_SELECT (Selects program for execution)" }, { "_N_SRTEXT", "PI-Service _N_SRTEXT (A file is being marked in /_N_EXT_DIR)" }, { "_N_F_CLOS", "PI-Service _N_F_CLOS (Closes file)" }, { "_N_F_OPEN", "PI-Service _N_F_OPEN (Opens file)" }, { "_N_F_SEEK", "PI-Service _N_F_SEEK (Position the file search pointer)" }, { "_N_ASUP__", "PI-Service _N_ASUP__ (Assigns interrupt)" }, { "_N_CHEKDM", "PI-Service _N_CHEKDM (Start uniqueness check on D numbers)" }, { "_N_CHKDNO", "PI-Service _N_CHKDNO (Check whether the tools have unique D numbers)" }, { "_N_CONFIG", "PI-Service _N_CONFIG (Reconfigures machine data)" }, { "_N_CRCEDN", "PI-Service _N_CRCEDN (Creates a cutting edge by specifying an edge no.)" }, { "_N_DELECE", "PI-Service _N_DELECE (Deletes a cutting edge)" }, { "_N_CREACE", "PI-Service _N_CREACE (Creates a cutting edge)" }, { "_N_CREATO", "PI-Service _N_CREATO (Creates a tool)" }, { "_N_DELETO", "PI-Service _N_DELETO (Deletes tool)" }, { "_N_CRTOCE", "PI-Service _N_CRTOCE (Generate tool with specified edge number)" }, { "_N_DELVAR", "PI-Service _N_DELVAR (Delete data block)" }, { "_N_F_COPY", "PI-Service _N_F_COPY (Copies file within the NCK)" }, { "_N_F_DMDA", "PI-Service _N_F_DMDA (Deletes MDA memory)" }, { "_N_F_PROR", "PI-Service _N_F_PROR" }, { "_N_F_PROT", "PI-Service _N_F_PROT (Assigns a protection level to a file)" }, { "_N_F_RENA", "PI-Service _N_F_RENA (Renames file)" }, { "_N_FINDBL", "PI-Service _N_FINDBL (Activates search)" }, { "_N_IBN_SS", "PI-Service _N_IBN_SS (Sets the set-up switch)" }, { "_N_MMCSEM", "PI-Service _N_MMCSEM (MMC-Semaphore)" }, { "_N_NCKMOD", "PI-Service _N_NCKMOD (The mode in which the NCK will work is being set)" }, { "_N_NEWPWD", "PI-Service _N_NEWPWD (New password)" }, { "_N_SEL_BL", "PI-Service _N_SEL_BL (Selects a new block)" }, { "_N_SETTST", "PI-Service _N_SETTST (Activate tools for replacement tool group)" }, { "_N_TMAWCO", "PI-Service _N_TMAWCO (Set the active wear group in one magazine)" }, { "_N_TMCRTC", "PI-Service _N_TMCRTC (Create tool with specified edge number)" }, { "_N_TMCRTO", "PI-Service _N_TMCRTO (Creates tool in the tool management)" }, { "_N_TMFDPL", "PI-Service _N_TMFDPL (Searches an empty place for loading)" }, { "_N_TMFPBP", "PI-Service _N_TMFPBP (Searches for empty location)" }, { "_N_TMGETT", "PI-Service _N_TMGETT (Determines T-number for specific toolID with Duplono)" }, { "_N_TMMVTL", "PI-Service _N_TMMVTL (Loads or unloads a tool)" }, { "_N_TMPCIT", "PI-Service _N_TMPCIT (Sets increment value of the piece counter)" }, { "_N_TMPOSM", "PI-Service _N_TMPOSM (Positions a magazine or tool)" }, { "_N_TRESMO", "PI-Service _N_TRESMO (Reset monitoring values)" }, { "_N_TSEARC", "PI-Service _N_TSEARC (Complex search via search screenforms)" }, { NULL, NULL } }; /* Function 0x28 (PI Start) */ static gint hf_s7comm_piservice_unknown1 = -1; /* Unknown bytes */ static gint hf_s7comm_piservice_parameterblock = -1; static gint hf_s7comm_piservice_parameterblock_len = -1; static gint hf_s7comm_piservice_servicename = -1; static gint ett_s7comm_piservice_parameterblock = -1; static gint hf_s7comm_piservice_string_len = -1; static gint hf_s7comm_pi_n_x_addressident = -1; static gint hf_s7comm_pi_n_x_password = -1; static gint hf_s7comm_pi_n_x_filename = -1; static gint hf_s7comm_pi_n_x_editwindowname = -1; static gint hf_s7comm_pi_n_x_seekpointer = -1; static gint hf_s7comm_pi_n_x_windowsize = -1; static gint hf_s7comm_pi_n_x_comparestring = -1; static gint hf_s7comm_pi_n_x_skipcount = -1; static gint hf_s7comm_pi_n_x_interruptnr = -1; static gint hf_s7comm_pi_n_x_priority = -1; static gint hf_s7comm_pi_n_x_liftfast = -1; static gint hf_s7comm_pi_n_x_blsync = -1; static gint hf_s7comm_pi_n_x_magnr = -1; static gint hf_s7comm_pi_n_x_dnr = -1; static gint hf_s7comm_pi_n_x_spindlenumber = -1; static gint hf_s7comm_pi_n_x_wznr = -1; static gint hf_s7comm_pi_n_x_class = -1; static gint hf_s7comm_pi_n_x_tnr = -1; static gint hf_s7comm_pi_n_x_toolnumber = -1; static gint hf_s7comm_pi_n_x_cenumber = -1; static gint hf_s7comm_pi_n_x_datablocknumber = -1; static gint hf_s7comm_pi_n_x_firstcolumnnumber = -1; static gint hf_s7comm_pi_n_x_lastcolumnnumber = -1; static gint hf_s7comm_pi_n_x_firstrownumber = -1; static gint hf_s7comm_pi_n_x_lastrownumber = -1; static gint hf_s7comm_pi_n_x_direction = -1; static gint hf_s7comm_pi_n_x_sourcefilename = -1; static gint hf_s7comm_pi_n_x_destinationfilename = -1; static gint hf_s7comm_pi_n_x_channelnumber = -1; static gint hf_s7comm_pi_n_x_protection = -1; static gint hf_s7comm_pi_n_x_oldfilename = -1; static gint hf_s7comm_pi_n_x_newfilename = -1; static gint hf_s7comm_pi_n_x_findmode = -1; static gint hf_s7comm_pi_n_x_switch = -1; static gint hf_s7comm_pi_n_x_functionnumber = -1; static gint hf_s7comm_pi_n_x_semaphorevalue = -1; static gint hf_s7comm_pi_n_x_onoff = -1; static gint hf_s7comm_pi_n_x_mode = -1; static gint hf_s7comm_pi_n_x_factor = -1; static gint hf_s7comm_pi_n_x_passwordlevel = -1; static gint hf_s7comm_pi_n_x_linenumber = -1; static gint hf_s7comm_pi_n_x_weargroup = -1; static gint hf_s7comm_pi_n_x_toolstatus = -1; static gint hf_s7comm_pi_n_x_wearsearchstrat = -1; static gint hf_s7comm_pi_n_x_toolid = -1; static gint hf_s7comm_pi_n_x_duplonumber = -1; static gint hf_s7comm_pi_n_x_edgenumber = -1; static gint hf_s7comm_pi_n_x_placenr = -1; static gint hf_s7comm_pi_n_x_placerefnr = -1; static gint hf_s7comm_pi_n_x_magrefnr = -1; static gint hf_s7comm_pi_n_x_magnrfrom = -1; static gint hf_s7comm_pi_n_x_placenrfrom = -1; static gint hf_s7comm_pi_n_x_magnrto = -1; static gint hf_s7comm_pi_n_x_placenrto = -1; static gint hf_s7comm_pi_n_x_halfplacesleft = -1; static gint hf_s7comm_pi_n_x_halfplacesright = -1; static gint hf_s7comm_pi_n_x_halfplacesup = -1; static gint hf_s7comm_pi_n_x_halfplacesdown = -1; static gint hf_s7comm_pi_n_x_placetype = -1; static gint hf_s7comm_pi_n_x_searchdirection = -1; static gint hf_s7comm_pi_n_x_toolname = -1; static gint hf_s7comm_pi_n_x_placenrsource = -1; static gint hf_s7comm_pi_n_x_magnrsource = -1; static gint hf_s7comm_pi_n_x_placenrdestination = -1; static gint hf_s7comm_pi_n_x_magnrdestination = -1; static gint hf_s7comm_pi_n_x_incrementnumber = -1; static gint hf_s7comm_pi_n_x_monitoringmode = -1; static gint hf_s7comm_pi_n_x_kindofsearch = -1; static gint hf_s7comm_data_plccontrol_argument = -1; /* Argument, 2 Bytes as char */ static gint hf_s7comm_data_plccontrol_block_cnt = -1; /* Number of blocks, 1 Byte as int */ static gint hf_s7comm_data_pi_inse_unknown = -1; static gint hf_s7comm_data_plccontrol_part2_len = -1; /* Length part 2 in bytes, 1 Byte as Int */ /* block control functions */ static gint hf_s7comm_data_blockcontrol_unknown1 = -1; /* for all unknown bytes in blockcontrol */ static gint hf_s7comm_data_blockcontrol_errorcode = -1; /* Error code 2 bytes as int, 0 is no error */ static gint hf_s7comm_data_blockcontrol_uploadid = -1; static gint hf_s7comm_data_blockcontrol_file_ident = -1; /* File identifier, as ASCII */ static gint hf_s7comm_data_blockcontrol_block_type = -1; /* Block type, 2 Byte */ static gint hf_s7comm_data_blockcontrol_block_num = -1; /* Block number, 5 Bytes, ASCII */ static gint hf_s7comm_data_blockcontrol_dest_filesys = -1; /* Destination filesystem, 1 Byte, ASCII */ static gint hf_s7comm_data_blockcontrol_part2_len = -1; /* Length part 2 in bytes, 1 Byte Int */ static gint hf_s7comm_data_blockcontrol_part2_unknown = -1; /* Unknown char, ASCII */ static gint hf_s7comm_data_blockcontrol_loadmem_len = -1; /* Length load memory in bytes, ASCII */ static gint hf_s7comm_data_blockcontrol_mc7code_len = -1; /* Length of MC7 code in bytes, ASCII */ static gint hf_s7comm_data_blockcontrol_filename_len = -1; static gint hf_s7comm_data_blockcontrol_filename = -1; static gint hf_s7comm_data_blockcontrol_upl_lenstring_len = -1; static gint hf_s7comm_data_blockcontrol_upl_lenstring = -1; static gint hf_s7comm_data_blockcontrol_functionstatus = -1; static gint hf_s7comm_data_blockcontrol_functionstatus_more = -1; static gint hf_s7comm_data_blockcontrol_functionstatus_error = -1; static gint ett_s7comm_data_blockcontrol_status = -1; static int * const s7comm_data_blockcontrol_status_fields[] = { &hf_s7comm_data_blockcontrol_functionstatus_more, &hf_s7comm_data_blockcontrol_functionstatus_error, NULL }; static gint ett_s7comm_plcfilename = -1; static gint hf_s7comm_data_ncprg_unackcount = -1; static gint hf_s7comm_data_ncprg_filelength = -1; static gint hf_s7comm_data_ncprg_filetime = -1; static gint hf_s7comm_data_ncprg_filepath = -1; static gint hf_s7comm_data_ncprg_filedata = -1; /* Data record routing to Profibus */ static gint hf_s7comm_data_drr_data = -1; /* Variable status */ static gint hf_s7comm_varstat_unknown = -1; /* Unknown byte(s), hex */ static gint hf_s7comm_varstat_item_count = -1; /* Item count, 2 bytes, int */ static gint hf_s7comm_varstat_req_memory_area = -1; /* Memory area, 1 byte, stringlist userdata_tis_varstat_area_names */ static gint hf_s7comm_varstat_req_repetition_factor = -1; /* Repetition factor, 1 byte as int */ static gint hf_s7comm_varstat_req_db_number = -1; /* DB number, 2 bytes as int */ static gint hf_s7comm_varstat_req_startaddress = -1; /* Startaddress, 2 bytes as int */ static gint hf_s7comm_varstat_req_bitpos = -1; /* cyclic services */ static gint hf_s7comm_cycl_interval_timebase = -1; /* Interval timebase, 1 byte, int */ static gint hf_s7comm_cycl_interval_time = -1; /* Interval time, 1 byte, int */ static gint hf_s7comm_cycl_function = -1; static gint hf_s7comm_cycl_jobid = -1; /* Read record */ static gint hf_s7comm_rdrec_mlen = -1; /* Max. length in bytes of the data record data to be read */ static gint hf_s7comm_rdrec_index = -1; /* Data record number */ static gint hf_s7comm_rdrec_id = -1; /* Diagnostic address */ static gint hf_s7comm_rdrec_statuslen = -1; /* Length of optional status data */ static gint hf_s7comm_rdrec_statusdata = -1; /* Optional status data */ static gint hf_s7comm_rdrec_recordlen = -1; /* Length of data record data read */ static gint hf_s7comm_rdrec_data = -1; /* The read data record */ static gint hf_s7comm_rdrec_reserved1 = -1; /* PBC, Programmable Block Functions */ static gint hf_s7comm_pbc_unknown = -1; /* unknown, 1 byte */ static gint hf_s7comm_pbc_bsend_r_id = -1; /* Request ID R_ID, 4 bytes as hex */ static gint hf_s7comm_pbc_bsend_len = -1; static gint hf_s7comm_pbc_usend_unknown1 = -1; static gint hf_s7comm_pbc_usend_r_id = -1; static gint hf_s7comm_pbc_usend_unknown2 = -1; static gint hf_s7comm_pbc_arsend_ar_id = -1; static gint hf_s7comm_pbc_arsend_ret = -1; static gint hf_s7comm_pbc_arsend_unknown = -1; static gint hf_s7comm_pbc_arsend_len = -1; /* Alarm messages */ static gint hf_s7comm_cpu_alarm_message_item = -1; static gint hf_s7comm_cpu_alarm_message_obj_item = -1; static gint hf_s7comm_cpu_alarm_message_function = -1; static gint hf_s7comm_cpu_alarm_message_nr_objects = -1; static gint hf_s7comm_cpu_alarm_message_nr_add_values = -1; static gint hf_s7comm_cpu_alarm_message_eventid = -1; static gint hf_s7comm_cpu_alarm_message_timestamp_coming = -1; static gint hf_s7comm_cpu_alarm_message_timestamp_going = -1; static gint hf_s7comm_cpu_alarm_message_associated_value = -1; static gint hf_s7comm_cpu_alarm_message_eventstate = -1; static gint hf_s7comm_cpu_alarm_message_state = -1; static gint hf_s7comm_cpu_alarm_message_ackstate_coming = -1; static gint hf_s7comm_cpu_alarm_message_ackstate_going = -1; static gint hf_s7comm_cpu_alarm_message_event_coming = -1; static gint hf_s7comm_cpu_alarm_message_event_going = -1; static gint hf_s7comm_cpu_alarm_message_event_lastchanged = -1; static gint hf_s7comm_cpu_alarm_message_event_reserved = -1; static gint hf_s7comm_cpu_alarm_message_scan_unknown1 = -1; static gint hf_s7comm_cpu_alarm_message_scan_unknown2 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig1 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig2 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig3 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig4 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig5 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig6 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig7 = -1; static gint hf_s7comm_cpu_alarm_message_signal_sig8 = -1; static gint ett_s7comm_cpu_alarm_message_signal = -1; static int * const s7comm_cpu_alarm_message_signal_fields[] = { &hf_s7comm_cpu_alarm_message_signal_sig1, &hf_s7comm_cpu_alarm_message_signal_sig2, &hf_s7comm_cpu_alarm_message_signal_sig3, &hf_s7comm_cpu_alarm_message_signal_sig4, &hf_s7comm_cpu_alarm_message_signal_sig5, &hf_s7comm_cpu_alarm_message_signal_sig6, &hf_s7comm_cpu_alarm_message_signal_sig7, &hf_s7comm_cpu_alarm_message_signal_sig8, NULL }; static gint hf_s7comm_cpu_alarm_query_unknown1 = -1; static gint hf_s7comm_cpu_alarm_query_querytype = -1; static gint hf_s7comm_cpu_alarm_query_unknown2 = -1; static gint hf_s7comm_cpu_alarm_query_alarmtype = -1; static gint hf_s7comm_cpu_alarm_query_completelen = -1; static gint hf_s7comm_cpu_alarm_query_datasetlen = -1; static gint hf_s7comm_cpu_alarm_query_resunknown1 = -1; /* CPU diagnostic messages */ static gint hf_s7comm_cpu_diag_msg_item = -1; static gint hf_s7comm_cpu_diag_msg_eventid = -1; static gint hf_s7comm_cpu_diag_msg_eventid_class = -1; static gint hf_s7comm_cpu_diag_msg_eventid_ident_entleave = -1; static gint hf_s7comm_cpu_diag_msg_eventid_ident_diagbuf = -1; static gint hf_s7comm_cpu_diag_msg_eventid_ident_interr = -1; static gint hf_s7comm_cpu_diag_msg_eventid_ident_exterr = -1; static gint hf_s7comm_cpu_diag_msg_eventid_nr = -1; static gint hf_s7comm_cpu_diag_msg_prioclass = -1; static gint hf_s7comm_cpu_diag_msg_obnumber = -1; static gint hf_s7comm_cpu_diag_msg_datid = -1; static gint hf_s7comm_cpu_diag_msg_info1 = -1; static gint hf_s7comm_cpu_diag_msg_info2 = -1; static gint ett_s7comm_cpu_diag_msg_eventid = -1; static int * const s7comm_cpu_diag_msg_eventid_fields[] = { &hf_s7comm_cpu_diag_msg_eventid_class, &hf_s7comm_cpu_diag_msg_eventid_ident_entleave, &hf_s7comm_cpu_diag_msg_eventid_ident_diagbuf, &hf_s7comm_cpu_diag_msg_eventid_ident_interr, &hf_s7comm_cpu_diag_msg_eventid_ident_exterr, &hf_s7comm_cpu_diag_msg_eventid_nr, NULL }; static const true_false_string tfs_s7comm_cpu_diag_msg_eventid_ident_entleave = { "Event entering", "Event leaving" }; static const value_string cpu_diag_msg_eventid_class_names[] = { { 0x01, "Standard OB events" }, { 0x02, "Synchronous errors" }, { 0x03, "Asynchronous errors" }, { 0x04, "Mode transitions" }, { 0x05, "Run-time events" }, { 0x06, "Communication events" }, { 0x07, "Events for fail-safe and fault-tolerant systems" }, { 0x08, "Standardized diagnostic data on modules" }, { 0x09, "Predefined user events" }, { 0x0a, "Freely definable events" }, { 0x0b, "Freely definable events" }, { 0x0c, "Reserved" }, { 0x0d, "Reserved" }, { 0x0e, "Reserved" }, { 0x0f, "Events for modules other than CPUs" }, { 0, NULL } }; static const value_string cpu_diag_eventid_fix_names[] = { { 0x113A, "Start request for cyclic interrupt OB with special handling (S7-300 only)" }, { 0x1155, "Status alarm for PROFIBUS DP" }, { 0x1156, "Update interrupt for PROFIBUS DP" }, { 0x1157, "Manufacturer interrupt for PROFIBUS DP" }, { 0x1158, "Status interrupt for PROFINET IO" }, { 0x1159, "Update interrupt for PROFINET IO" }, { 0x115A, "Manufacturer interrupt for PROFINET IO" }, { 0x115B, "IO: Profile-specific interrupt" }, { 0x116A, "Technology synchronization interrupt" }, { 0x1381, "Request for manual warm restart" }, { 0x1382, "Request for automatic warm restart" }, { 0x1383, "Request for manual hot restart" }, { 0x1384, "Request for automatic hot restart" }, { 0x1385, "Request for manual cold restart" }, { 0x1386, "Request for automatic cold restart" }, { 0x1387, "Master CPU: request for manual cold restart" }, { 0x1388, "Master CPU: request for automatic cold restart" }, { 0x138A, "Master CPU: request for manual warm restart" }, { 0x138B, "Master CPU: request for automatic warm restart" }, { 0x138C, "Standby CPU: request for manual hot restart" }, { 0x138D, "Standby CPU: request for automatic hot restart" }, { 0x2521, "BCD conversion error" }, { 0x2522, "Area length error when reading" }, { 0x2523, "Area length error when writing" }, { 0x2524, "Area error when reading" }, { 0x2525, "Area error when writing" }, { 0x2526, "Timer number error" }, { 0x2527, "Counter number error" }, { 0x2528, "Alignment error when reading" }, { 0x2529, "Alignment error when writing" }, { 0x2530, "Write error when accessing the DB" }, { 0x2531, "Write error when accessing the DI" }, { 0x2532, "Block number error when opening a DB" }, { 0x2533, "Block number error when opening a DI" }, { 0x2534, "Block number error when calling an FC" }, { 0x2535, "Block number error when calling an FB" }, { 0x253A, "DB not loaded" }, { 0x253C, "FC not loaded" }, { 0x253D, "SFC not loaded" }, { 0x253E, "FB not loaded" }, { 0x253F, "SFB not loaded" }, { 0x2942, "I/O access error, reading" }, { 0x2943, "I/O access error, writing" }, { 0x3267, "End of module reconfiguration" }, { 0x3367, "Start of module reconfiguration" }, { 0x34A4, "PROFInet Interface DB can be addressed again" }, { 0x3501, "Cycle time exceeded" }, { 0x3502, "User interface (OB or FRB) request error" }, { 0x3503, "Delay too long processing a priority class" }, { 0x3505, "Time-of-day interrupt(s) skipped due to new clock setting" }, { 0x3506, "Time-of-day interrupt(s) skipped when changing to RUN after HOLD" }, { 0x3507, "Multiple OB request errors caused internal buffer overflow" }, { 0x3508, "Synchronous cycle interrupt-timing error" }, { 0x3509, "Interrupt loss due to excess interrupt load" }, { 0x350A, "Resume RUN mode after CiR" }, { 0x350B, "Technology synchronization interrupt - timing error" }, { 0x3571, "Nesting depth too high in nesting levels" }, { 0x3572, "Nesting depth for Master Control Relays too high" }, { 0x3573, "Nesting depth too high after synchronous errors" }, { 0x3574, "Nesting depth for block calls (U stack) too high" }, { 0x3575, "Nesting depth for block calls (B stack) too high" }, { 0x3576, "Local data allocation error" }, { 0x3578, "Unknown instruction" }, { 0x357A, "Jump instruction to target outside of the block" }, { 0x3582, "Memory error detected and corrected by operating system" }, { 0x3583, "Accumulation of detected and corrected memo errors" }, { 0x3585, "Error in the PC operating system (only for LC RTX)" }, { 0x3587, "Multi-bit memory error detected and corrected" }, { 0x35A1, "User interface (OB or FRB) not found" }, { 0x35A2, "OB not loaded (started by SFC or operating system due to configuration)" }, { 0x35A3, "Error when operating system accesses a block" }, { 0x35A4, "PROFInet Interface DB cannot be addressed" }, { 0x35D2, "Diagnostic entries cannot be sent at present" }, { 0x35D3, "Synchronization frames cannot be sent" }, { 0x35D4, "Illegal time jump resulting from synchronization" }, { 0x35D5, "Error adopting the synchronization time" }, { 0x35E1, "Incorrect frame ID in GD" }, { 0x35E2, "GD packet status cannot be entered in DB" }, { 0x35E3, "Frame length error in GD" }, { 0x35E4, "Illegal GD packet number received" }, { 0x35E5, "Error accessing DB in communication SFBs for configured S7 connections" }, { 0x35E6, "GD total status cannot be entered in DB" }, { 0x3821, "BATTF: failure on at least one backup battery of the central rack, problem eliminated" }, { 0x3822, "BAF: failure of backup voltage on central rack, problem eliminated" }, { 0x3823, "24 volt supply failure on central rack, problem eliminated" }, { 0x3825, "BATTF: failure on at least one backup battery of the redundant central rack, problem eliminated" }, { 0x3826, "BAF: failure of backup voltage on redundant central rack, problem eliminated" }, { 0x3827, "24 volt supply failure on redundant central rack, problem eliminated" }, { 0x3831, "BATTF: failure of at least one backup battery of the expansion rack, problem eliminated" }, { 0x3832, "BAF: failure of backup voltage on expansion rack, problem eliminated" }, { 0x3833, "24 volt supply failure on at least one expansion rack, problem eliminated" }, { 0x3842, "Module OK" }, { 0x3854, "PROFINET IO interface submodule/submodule and matches the configured interface submodule/submodule" }, { 0x3855, "PROFINET IO interface submodule/submodule inserted, but does not match the configured interface submodule/submodule" }, { 0x3856, "PROFINET IO interface submodule/submodule inserted, but error in module parameter assignment" }, { 0x3858, "PROFINET IO interface submodule access error corrected" }, { 0x3861, "Module/interface module inserted, module type OK" }, { 0x3863, "Module/interface module plugged in, but wrong module type" }, { 0x3864, "Module/interface module plugged in, but causing problem (type ID unreadable)" }, { 0x3865, "Module plugged in, but error in module parameter assignment" }, { 0x3866, "Module can be addressed again, load voltage error removed" }, { 0x3881, "Interface error leaving state" }, { 0x3884, "Interface module plugged in" }, { 0x38B3, "I/O access error when updating the process image input table" }, { 0x38B4, "I/O access error when transferring the process image to the output modules" }, { 0x38C1, "Expansion rack operational again (1 to 21), leaving state" }, { 0x38C2, "Expansion rack operational again but mismatch between setpoint and actual configuration" }, { 0x38C4, "Distributed I/Os: station failure, leaving state" }, { 0x38C5, "Distributed I/Os: station fault, leaving state" }, { 0x38C6, "Expansion rack operational again, but error(s) in module parameter assignment" }, { 0x38C7, "DP: station operational again, but error(s) in module parameter assignment" }, { 0x38C8, "DP: station operational again, but mismatch between setpoint and actual configuration" }, { 0x38CB, "PROFINET IO station operational again" }, { 0x38CC, "PROFINET IO station error corrected" }, { 0x3921, "BATTF: failure on at least one backup battery of the central rack" }, { 0x3922, "BAF: failure of backup voltage on central rack" }, { 0x3923, "24 volt supply failure on central rack" }, { 0x3925, "BATTF: failure on at least one backup battery of the redundant central rack" }, { 0x3926, "BAF: failure of backup voltage on redundant central rack" }, { 0x3927, "24 volt supply failure on redundant central rack" }, { 0x3931, "BATTF: failure of at least one backup battery of the expansion rack" }, { 0x3932, "BAF: failure of backup voltage on expansion rack" }, { 0x3933, "24 volt supply failure on at least one expansion rack" }, { 0x3942, "Module error" }, { 0x3951, "PROFINET IO submodule removed" }, { 0x3954, "PROFINET IO interface submodule/submodule removed" }, { 0x3961, "Module/interface module removed, cannot be addressed" }, { 0x3966, "Module cannot be addressed, load voltage error" }, { 0x3968, "Module reconfiguration has ended with error" }, { 0x3981, "Interface error entering state" }, { 0x3984, "Interface module removed" }, { 0x3986, "Performance of an H-Sync link negatively affected" }, { 0x39B1, "I/O access error when updating the process image input table" }, { 0x39B2, "I/O access error when transferring the process image to the output modules" }, { 0x39B3, "I/O access error when updating the process image input table" }, { 0x39B4, "I/O access error when transferring the process image to the output modules" }, { 0x39C1, "Expansion rack failure (1 to 21), entering state" }, { 0x39C3, "Distributed I/Os: master system failure entering state" }, { 0x39C4, "Distributed I/Os: station failure, entering state" }, { 0x39C5, "Distributed I/Os: station fault, entering state" }, { 0x39CA, "PROFINET IO system failure" }, { 0x39CB, "PROFINET IO station failure" }, { 0x39CC, "PROFINET IO station error" }, { 0x39CD, "PROFINET IO station operational again, but expected configuration does not match actual configuration" }, { 0x39CE, "PROFINET IO station operational again, but error(s) in module parameter assignment" }, { 0x42F3, "Checksum error detected and corrected by the operating system" }, { 0x42F4, "Standby CPU: connection/update via SFC90 is locked in the master CPU" }, { 0x4300, "Backed-up power on" }, { 0x4301, "Mode transition from STOP to STARTUP" }, { 0x4302, "Mode transition from STARTUP to RUN" }, { 0x4303, "STOP caused by stop switch being activated" }, { 0x4304, "STOP caused by PG STOP operation or by SFB 20 STOP" }, { 0x4305, "HOLD: breakpoint reached" }, { 0x4306, "HOLD: breakpoint exited" }, { 0x4307, "Memory reset started by PG operation" }, { 0x4308, "Memory reset started by switch setting" }, { 0x4309, "Memory reset started automatically (power on not backed up)" }, { 0x430A, "HOLD exited, transition to STOP" }, { 0x430D, "STOP caused by other CPU in multicomputing" }, { 0x430E, "Memory reset executed" }, { 0x430F, "STOP on the module due to STOP on a CPU" }, { 0x4318, "Start of CiR" }, { 0x4319, "CiR completed" }, { 0x4357, "Module watchdog started" }, { 0x4358, "All modules are ready for operation" }, { 0x43B0, "Firmware update was successful" }, { 0x43B4, "Error in firmware fuse" }, { 0x43B6, "Firmware updates canceled by redundant modules" }, { 0x43D3, "STOP on standby CPU" }, { 0x43DC, "Abort during link-up with switchover" }, { 0x43DE, "Updating aborted due to monitoring time being exceeded during the n-th attempt, new update attempt initiated" }, { 0x43DF, "Updating aborted for final time due to monitoring time being exceeded after completing the maximum amount of attempts. User intervention required" }, { 0x43E0, "Change from solo mode after link-up" }, { 0x43E1, "Change from link-up after updating" }, { 0x43E2, "Change from updating to redundant mode" }, { 0x43E3, "Master CPU: change from redundant mode to solo mode" }, { 0x43E4, "Standby CPU: change from redundant mode after error-search mode" }, { 0x43E5, "Standby CPU: change from error-search mode after link-up or STOP" }, { 0x43E6, "Link-up aborted on the standby CPU" }, { 0x43E7, "Updating aborted on the standby CPU" }, { 0x43E8, "Standby CPU: change from link-up after startup" }, { 0x43E9, "Standby CPU: change from startup after updating" }, { 0x43F1, "Reserve-master switchover" }, { 0x43F2, "Coupling of incompatible H-CPUs blocked by system program" }, { 0x4510, "STOP violation of the CPU's data range" }, { 0x4520, "DEFECTIVE: STOP not possible" }, { 0x4521, "DEFECTIVE: failure of instruction processing processor" }, { 0x4522, "DEFECTIVE: failure of clock chip" }, { 0x4523, "DEFECTIVE: failure of clock pulse generator" }, { 0x4524, "DEFECTIVE: failure of timer update function" }, { 0x4525, "DEFECTIVE: failure of multicomputing synchronization" }, { 0x4527, "DEFECTIVE: failure of I/O access monitoring" }, { 0x4528, "DEFECTIVE: failure of scan time monitoring" }, { 0x4530, "DEFECTIVE: memory test error in internal memory" }, { 0x4532, "DEFECTIVE: failure of core resources" }, { 0x4536, "DEFECTIVE: switch defective" }, { 0x4540, "STOP: Memory expansion of the internal work memory has gaps. First memory expansion too small or missing" }, { 0x4541, "STOP caused by priority class system" }, { 0x4542, "STOP caused by object management system" }, { 0x4543, "STOP caused by test functions" }, { 0x4544, "STOP caused by diagnostic system" }, { 0x4545, "STOP caused by communication system" }, { 0x4546, "STOP caused by CPU memory management" }, { 0x4547, "STOP caused by process image management" }, { 0x4548, "STOP caused by I/O management" }, { 0x454A, "STOP caused by configuration: an OB deselected with STEP 7 was being loaded into the CPU during STARTUP" }, { 0x4550, "DEFECTIVE: internal system error" }, { 0x4555, "No restart possible, monitoring time elapsed" }, { 0x4556, "STOP: memory reset request from communication system / due to data inconsistency" }, { 0x4562, "STOP caused by programming error (OB not loaded or not possible)" }, { 0x4563, "STOP caused by I/O access error (OB not loaded or not possible)" }, { 0x4567, "STOP caused by H event" }, { 0x4568, "STOP caused by time error (OB not loaded or not possible)" }, { 0x456A, "STOP caused by diagnostic interrupt (OB not loaded or not possible)" }, { 0x456B, "STOP caused by removing/inserting module (OB not loaded or not possible)" }, { 0x456C, "STOP caused by CPU hardware error (OB not loaded or not possible, or no FRB)" }, { 0x456D, "STOP caused by program sequence error (OB not loaded or not possible)" }, { 0x456E, "STOP caused by communication error (OB not loaded or not possible)" }, { 0x456F, "STOP caused by rack failure OB (OB not loaded or not possible)" }, { 0x4570, "STOP caused by process interrupt (OB not loaded or not possible)" }, { 0x4571, "STOP caused by nesting stack error" }, { 0x4572, "STOP caused by master control relay stack error" }, { 0x4573, "STOP caused by exceeding the nesting depth for synchronous errors" }, { 0x4574, "STOP caused by exceeding interrupt stack nesting depth in the priority class stack" }, { 0x4575, "STOP caused by exceeding block stack nesting depth in the priority class stack" }, { 0x4576, "STOP caused by error when allocating the local data" }, { 0x4578, "STOP caused by unknown opcode" }, { 0x457A, "STOP caused by code length error" }, { 0x457B, "STOP caused by DB not being loaded on on-board I/Os" }, { 0x457D, "Reset/clear request because the version of the internal interface to the integrated technology was changed" }, { 0x457F, "STOP caused by STOP command" }, { 0x4580, "STOP: back-up buffer contents inconsistent (no transition to RUN)" }, { 0x4590, "STOP caused by overloading the internal functions" }, { 0x45D5, "LINK-UP rejected due to mismatched CPU memory configuration of the sub-PLC" }, { 0x45D6, "LINK-UP rejected due to mismatched system program of the sub-PLC" }, { 0x45D8, "DEFECTIVE: hardware fault detected due to other error" }, { 0x45D9, "STOP due to SYNC module error" }, { 0x45DA, "STOP due to synchronization error between H CPUs" }, { 0x45DD, "LINK-UP rejected due to running test or other online functions" }, { 0x4926, "DEFECTIVE: failure of the watchdog for I/O access" }, { 0x4931, "STOP or DEFECTIVE: memory test error in memory submodule" }, { 0x4933, "Checksum error" }, { 0x4934, "DEFECTIVE: memory not available" }, { 0x4935, "DEFECTIVE: cancelled by watchdog/processor exceptions" }, { 0x4949, "STOP caused by continuous hardware interrupt" }, { 0x494D, "STOP caused by I/O error" }, { 0x494E, "STOP caused by power failure" }, { 0x494F, "STOP caused by configuration error" }, { 0x4959, "One or more modules not ready for operation" }, { 0x497C, "STOP caused by integrated technology" }, { 0x49A0, "STOP caused by parameter assignment error or non-permissible variation of setpoint and actual extension: Start-up blocked" }, { 0x49A1, "STOP caused by parameter assignment error: memory reset request" }, { 0x49A2, "STOP caused by error in parameter modification: startup disabled" }, { 0x49A3, "STOP caused by error in parameter modification: memory reset request" }, { 0x49A4, "STOP: inconsistency in configuration data" }, { 0x49A5, "STOP: distributed I/Os: inconsistency in the loaded configuration information" }, { 0x49A6, "STOP: distributed I/Os: invalid configuration information" }, { 0x49A7, "STOP: distributed I/Os: no configuration information" }, { 0x49A8, "STOP: error indicated by the interface module for the distributed I/Os" }, { 0x49B1, "Firmware update data incorrect" }, { 0x49B2, "Firmware update: hardware version does not match firmware" }, { 0x49B3, "Firmware update: module type does not match firmware" }, { 0x49D0, "LINK-UP aborted due to violation of coordination rules" }, { 0x49D1, "LINK-UP/UPDATE sequence aborted" }, { 0x49D2, "Standby CPU changed to STOP due to STOP on the master CPU during link-up" }, { 0x49D4, "STOP on a master, since partner CPU is also a master (link-up error)" }, { 0x49D7, "LINK-UP rejected due to change in user program or in configuration" }, { 0x510F, "A problem as occurred with WinLC. This problem has caused the CPU to go into STOP mode or has caused a fault in the CPU" }, { 0x530D, "New startup information in the STOP mode" }, { 0x5311, "Startup despite Not Ready message from module(s)" }, { 0x5371, "Distributed I/Os: end of the synchronization with a DP master" }, { 0x5380, "Diagnostic buffer entries of interrupt and asynchronous errors disabled" }, { 0x5395, "Distributed I/Os: reset of a DP master" }, { 0x53A2, "Download of technology firmware successful" }, { 0x53A4, "Download of technology DB not successful" }, { 0x53FF, "Reset to factory setting" }, { 0x5445, "Start of System reconfiguration in RUN mode" }, { 0x5481, "All licenses for runtime software are complete again" }, { 0x5498, "No more inconsistency with DP master systems due to CiR" }, { 0x5545, "Start of System reconfiguration in RUN mode" }, { 0x5581, "One or several licenses for runtime software are missing" }, { 0x558A, "Difference between the MLFB of the configured and inserted CPU" }, { 0x558B, "Difference in the firmware version of the configured and inserted CPU" }, { 0x5598, "Start of possible inconsistency with DP master systems due to CiR" }, { 0x55A5, "Version conflict: internal interface with integrated technology" }, { 0x55A6, "The maximum number of technology objects has been exceeded" }, { 0x55A7, "A technology DB of this type is already present" }, { 0x5879, "Diagnostic message from DP interface: EXTF LED off" }, { 0x5960, "Parameter assignment error when switching" }, { 0x5961, "Parameter assignment error" }, { 0x5962, "Parameter assignment error preventing startup" }, { 0x5963, "Parameter assignment error with memory reset request" }, { 0x5966, "Parameter assignment error when switching" }, { 0x5969, "Parameter assignment error with startup blocked" }, { 0x596A, "PROFINET IO: IP address of an IO device already present" }, { 0x596B, "IP address of an Ethernet interface already exists" }, { 0x596C, "Name of an Ethernet interface already exists" }, { 0x596D, "The existing network configuration does not mach the system requirements or configuration" }, { 0x5979, "Diagnostic message from DP interface: EXTF LED on" }, { 0x597C, "DP Global Control command failed or moved" }, { 0x59A0, "The interrupt can not be associated in the CPU" }, { 0x59A1, "Configuration error in the integrated technology" }, { 0x59A3, "Error when downloading the integrated technology" }, { 0x6253, "Firmware update: End of firmware download over the network" }, { 0x6316, "Interface error when starting programmable controller" }, { 0x6353, "Firmware update: Start of firmware download over the network" }, { 0x6390, "Formatting of Micro Memory Card complete" }, { 0x6500, "Connection ID exists twice on module" }, { 0x6501, "Connection resources inadequate" }, { 0x6502, "Error in the connection description" }, { 0x6510, "CFB structure error detected in instance DB when evaluating EPROM" }, { 0x6514, "GD packet number exists twice on the module" }, { 0x6515, "Inconsistent length specifications in GD configuration information" }, { 0x6521, "No memory submodule and no internal memory available" }, { 0x6522, "Illegal memory submodule: replace submodule and reset memory" }, { 0x6523, "Memory reset request due to error accessing submodule" }, { 0x6524, "Memory reset request due to error in block header" }, { 0x6526, "Memory reset request due to memory replacement" }, { 0x6527, "Memory replaced, therefore restart not possible" }, { 0x6528, "Object handling function in the STOP/HOLD mode, no restart possible" }, { 0x6529, "No startup possible during the \"load user program\" function" }, { 0x652A, "No startup because block exists twice in user memory" }, { 0x652B, "No startup because block is too long for submodule - replace submodule" }, { 0x652C, "No startup due to illegal OB on submodule" }, { 0x6532, "No startup because illegal configuration information on submodule" }, { 0x6533, "Memory reset request because of invalid submodule content" }, { 0x6534, "No startup: block exists more than once on submodule" }, { 0x6535, "No startup: not enough memory to transfer block from submodule" }, { 0x6536, "No startup: submodule contains an illegal block number" }, { 0x6537, "No startup: submodule contains a block with an illegal length" }, { 0x6538, "Local data or write-protection ID (for DB) of a block illegal for CPU" }, { 0x6539, "Illegal command in block (detected by compiler)" }, { 0x653A, "Memory reset request because local OB data on submodule too short" }, { 0x6543, "No startup: illegal block type" }, { 0x6544, "No startup: attribute \"relevant for processing\" illegal" }, { 0x6545, "Source language illegal" }, { 0x6546, "Maximum amount of configuration information reached" }, { 0x6547, "Parameter assignment error assigning parameters to modules (not on P bus, cancel download)" }, { 0x6548, "Plausibility error during block check" }, { 0x6549, "Structure error in block" }, { 0x6550, "A block has an error in the CRC" }, { 0x6551, "A block has no CRC" }, { 0x6560, "SCAN overflow" }, { 0x6805, "Resource problem on configured connections, eliminated" }, { 0x6881, "Interface error leaving state" }, { 0x6905, "Resource problem on configured connections" }, { 0x6981, "Interface error entering state" }, { 0x72A2, "Failure of a DP master or a DP master system" }, { 0x72A3, "Redundancy restored on the DP slave" }, { 0x72DB, "Safety program: safety mode disabled" }, { 0x72E0, "Loss of redundancy in communication, problem eliminated" }, { 0x7301, "Loss of redundancy (1 of 2) due to failure of a CPU" }, { 0x7302, "Loss of redundancy (1 of 2) due to STOP on the standby triggered by user" }, { 0x7303, "H system (1 of 2) changed to redundant mode" }, { 0x7323, "Discrepancy found in operating system data" }, { 0x7331, "Standby-master switchover due to master failure" }, { 0x7333, "Standby-master switchover due to system modification during runtime" }, { 0x7334, "Standby-master switchover due to communication error at the synchronization module" }, { 0x7340, "Synchronization error in user program due to elapsed wait time" }, { 0x7341, "Synchronization error in user program due to waiting at different synchronization points" }, { 0x7342, "Synchronization error in operating system due to waiting at different synchronization points" }, { 0x7343, "Synchronization error in operating system due to elapsed wait time" }, { 0x7344, "Synchronization error in operating system due to incorrect data" }, { 0x734A, "The \"Re-enable\" job triggered by SFC 90 \"H_CTRL\" was executed" }, { 0x73A3, "Loss of redundancy on the DP slave" }, { 0x73C1, "Update process canceled" }, { 0x73C2, "Updating aborted due to monitoring time being exceeded during the n-th attempt (1 = n = max. possible number of update attempts after abort due to excessive monitoring time)" }, { 0x73D8, "Safety mode disabled" }, { 0x73DB, "Safety program: safety mode enabled" }, { 0x73E0, "Loss of redundancy in communication" }, { 0x74DD, "Safety program: Shutdown of a fail-save runtime group disabled" }, { 0x74DE, "Safety program: Shutdown of the F program disabled" }, { 0x74DF, "Start of F program initialization" }, { 0x7520, "Error in RAM comparison" }, { 0x7521, "Error in comparison of process image output value" }, { 0x7522, "Error in comparison of memory bits, timers, or counters" }, { 0x75D1, "Safety program: Internal CPU error" }, { 0x75D2, "Safety program error: Cycle time time-out" }, { 0x75D6, "Data corrupted in safety program prior to the output to F I/O" }, { 0x75D7, "Data corrupted in safety program prior to the output to partner F-CPU" }, { 0x75D9, "Invalid REAL number in a DB" }, { 0x75DA, "Safety program: Error in safety data format" }, { 0x75DC, "Runtime group, internal protocol error" }, { 0x75DD, "Safety program: Shutdown of a fail-save runtime group enabled" }, { 0x75DE, "Safety program: Shutdown of the F program enabled" }, { 0x75DF, "End of F program initialization" }, { 0x75E1, "Safety program: Error in FB \"F_PLK\" or \"F_PLK_O\" or \"F_CYC_CO\" or \"F_TEST\" or \"F_TESTC\"" }, { 0x75E2, "Safety program: Area length error" }, { 0x7852, "SYNC module inserted" }, { 0x7855, "SYNC module eliminated" }, { 0x78D3, "Communication error between PROFIsafe and F I/O" }, { 0x78D4, "Error in safety relevant communication between F CPUs" }, { 0x78D5, "Error in safety relevant communication between F CPUs" }, { 0x78E3, "F-I/O device input channel depassivated" }, { 0x78E4, "F-I/O device output channel depassivated" }, { 0x78E5, "F-I/O device depassivated" }, { 0x7934, "Standby-master switchover due to connection problem at the SYNC module" }, { 0x7950, "Synchronization module missing" }, { 0x7951, "Change at the SYNC module without Power On" }, { 0x7952, "SYNC module removed" }, { 0x7953, "Change at the SYNC-module without reset" }, { 0x7954, "SYNC module: rack number assigned twice" }, { 0x7955, "SYNC module error" }, { 0x7956, "Illegal rack number set on SYNC module" }, { 0x7960, "Redundant I/O: Time-out of discrepancy time at digital input, error is not yet localized" }, { 0x7961, "Redundant I/O, digital input error: Signal change after expiration of the discrepancy time" }, { 0x7962, "Redundant I/O: Digital input error" }, { 0x796F, "Redundant I/O: The I/O was globally disabled" }, { 0x7970, "Redundant I/O: Digital output error" }, { 0x7980, "Redundant I/O: Time-out of discrepancy time at analog input" }, { 0x7981, "Redundant I/O: Analog input error" }, { 0x7990, "Redundant I/O: Analog output error" }, { 0x79D3, "Communication error between PROFIsafe and F I/O" }, { 0x79D4, "Error in safety relevant communication between F CPUs" }, { 0x79D5, "Error in safety relevant communication between F CPUs" }, { 0x79E3, "F-I/O device input channel passivated" }, { 0x79E4, "F-I/O device output channel passivated" }, { 0x79E5, "F-I/O device passivated" }, { 0x79E6, "Inconsistent safety program" }, { 0x79E7, "Simulation block (F system block) loaded" }, { 0, NULL } }; static value_string_ext cpu_diag_eventid_fix_names_ext = VALUE_STRING_EXT_INIT(cpu_diag_eventid_fix_names); static const value_string cpu_diag_eventid_0x8_0x9_names[] = { { 0x8000, "Module fault/OK" }, { 0x8001, "Internal error" }, { 0x8002, "External error" }, { 0x8003, "Channel error" }, { 0x8004, "No external auxiliary voltage" }, { 0x8005, "No front connector" }, { 0x8006, "No parameter assignment" }, { 0x8007, "Incorrect parameters in module" }, { 0x8030, "User submodule incorrect/not found" }, { 0x8031, "Communication problem" }, { 0x8032, "Operating mode: RUN/STOP (STOP: entering state, RUN: leaving state)" }, { 0x8033, "Time monitoring responded (watchdog)" }, { 0x8034, "Internal module power failure" }, { 0x8035, "BATTF: battery exhausted" }, { 0x8036, "Total backup failed" }, { 0x8040, "Expansion rack failed" }, { 0x8041, "Processor failure" }, { 0x8042, "EPROM error" }, { 0x8043, "RAM error" }, { 0x8044, "ADC/DAC error" }, { 0x8045, "Fuse blown" }, { 0x8046, "Hardware interrupt lost Any" }, { 0x8050, "Configuration/parameter assignment error" }, { 0x8051, "Common mode error" }, { 0x8052, "Short circuit to phase" }, { 0x8053, "Short circuit to ground" }, { 0x8054, "Wire break" }, { 0x8055, "Reference channel error" }, { 0x8056, "Below measuring range" }, { 0x8057, "Above measuring range Analog input" }, { 0x8060, "Configuration/parameter assignment error" }, { 0x8061, "Common mode error" }, { 0x8062, "Short circuit to phase" }, { 0x8063, "Short circuit to ground" }, { 0x8064, "Wire break" }, { 0x8066, "No load voltage" }, { 0x8070, "Configuration/parameter assignment error" }, { 0x8071, "Chassis ground fault" }, { 0x8072, "Short circuit to phase (sensor)" }, { 0x8073, "Short circuit to ground (sensor)" }, { 0x8074, "Wire break" }, { 0x8075, "No sensor power supply Digital input" }, { 0x8080, "Configuration/parameter assignment error" }, { 0x8081, "Chassis ground fault" }, { 0x8082, "Short circuit to phase" }, { 0x8083, "Short circuit to ground" }, { 0x8084, "Wire break" }, { 0x8085, "Fuse tripped" }, { 0x8086, "No load voltage" }, { 0x8087, "Excess temperature Digital output" }, { 0x80B0, "Counter module, signal A faulty" }, { 0x80B1, "Counter module, signal B faulty" }, { 0x80B2, "Counter module, signal N faulty" }, { 0x80B3, "Counter module, incorrect value passed between the channels" }, { 0x80B4, "Counter module, 5.2 V sensor supply faulty" }, { 0x80B5, "Counter module, 24 V sensor supply faulty" }, { 0x9001, "Automatic/Manual mode (coming=man,going=auto)" }, { 0x9002, "OPEN/CLOSED, ON/OFF" }, { 0x9003, "Manual command enable" }, { 0x9004, "Unit protective command (OPEN/CLOSED)" }, { 0x9005, "Process enable" }, { 0x9006, "System protection command" }, { 0x9007, "Process value monitoring responded" }, { 0x9008, "Manipulated variable monitoring responded" }, { 0x9009, "System deviation greater than permitted" }, { 0x900A, "Limit position error" }, { 0x900B, "Runtime error" }, { 0x900C, "Command execution error (sequencer)" }, { 0x900D, "Operating status running > OPEN" }, { 0x900E, "Operating status running > CLOSED" }, { 0x900F, "Command blocking" }, { 0x9011, "Process status OPEN/ON" }, { 0x9012, "Process status CLOSED/OFF" }, { 0x9013, "Process status intermediate position" }, { 0x9014, "Process status ON via AUTO" }, { 0x9015, "Process status ON via manual" }, { 0x9016, "Process status ON via protective command" }, { 0x9017, "Process status OFF via AUTO" }, { 0x9018, "Process status OFF via manual" }, { 0x9019, "Process status OFF via protective command" }, { 0x9021, "Function error on approach" }, { 0x9022, "Function error on leaving" }, { 0x9031, "Actuator (DE/WE) limit position OPEN" }, { 0x9032, "Actuator (DE/WE) limit position not OPEN" }, { 0x9033, "Actuator (DE/WE) limit position CLOSED" }, { 0x9034, "Actuator (DE/WE) limit position not CLOSED" }, { 0x9041, "Illegal status, tolerance time elapsed" }, { 0x9042, "Illegal status, tolerance time not elapsed" }, { 0x9043, "Interlock error, tolerance time = 0" }, { 0x9044, "Interlock error, tolerance time > 0" }, { 0x9045, "No reaction" }, { 0x9046, "Final status exited illegally, tolerance time = 0" }, { 0x9047, "Final status exited illegally, tolerance time > 0" }, { 0x9050, "Upper limit of signal range USR" }, { 0x9051, "Upper limit of measuring range UMR" }, { 0x9052, "Lower limit of signal range LSR" }, { 0x9053, "Lower limit of measuring range LMR" }, { 0x9054, "Upper alarm limit UAL" }, { 0x9055, "Upper warning limit UWL" }, { 0x9056, "Upper tolerance limit UTL" }, { 0x9057, "Lower tolerance limit LTL" }, { 0x9058, "Lower warning limit LWL" }, { 0x9059, "Lower alarm limit LAL" }, { 0x9060, "GRAPH7 step entering/leaving" }, { 0x9061, "GRAPH7 interlock error" }, { 0x9062, "GRAPH7 execution error" }, { 0x9063, "GRAPH7 error noted" }, { 0x9064, "GRAPH7 error acknowledged" }, { 0x9070, "Trend exceeded in positive direction" }, { 0x9071, "Trend exceeded in negative direction" }, { 0x9072, "No reaction" }, { 0x9073, "Final state exited illegally" }, { 0x9080, "Limit value exceeded, tolerance time = 0" }, { 0x9081, "Limit value exceeded, tolerance time > 0" }, { 0x9082, "Below limit value, tolerance time = 0" }, { 0x9083, "Below limit value, tolerance time > 0" }, { 0x9084, "Gradient exceeded, tolerance time = 0" }, { 0x9085, "Gradient exceeded, tolerance time > 0" }, { 0x9086, "Below gradient, tolerance time = 0" }, { 0x9087, "Below gradient, tolerance time > 0" }, { 0x9090, "User parameter assignment error entering/leaving" }, { 0x90F0, "Overflow" }, { 0x90F1, "Underflow" }, { 0x90F2, "Division by 0" }, { 0x90F3, "Illegal calculation operation" }, { 0, NULL } }; static value_string_ext cpu_diag_eventid_0x8_0x9_names_ext = VALUE_STRING_EXT_INIT(cpu_diag_eventid_0x8_0x9_names); /************************************************************************** * Type of alarmquery in alarm query request */ #define S7COMM_ALARM_MESSAGE_QUERYTYPE_BYALARMTYPE 1 #define S7COMM_ALARM_MESSAGE_QUERYTYPE_BYEVENTID 3 static const value_string alarm_message_querytype_names[] = { { S7COMM_ALARM_MESSAGE_QUERYTYPE_BYALARMTYPE, "ByAlarmtype" }, { S7COMM_ALARM_MESSAGE_QUERYTYPE_BYEVENTID, "ByEventID" }, { 0, NULL } }; /************************************************************************** * Alarmtype in alarm query */ #define S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_SCAN 1 #define S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_ALARM_8 2 #define S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_ALARM_S 4 static const value_string alarm_message_query_alarmtype_names[] = { { S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_SCAN, "SCAN" }, { S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_ALARM_8, "ALARM_8" }, { S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_ALARM_S, "ALARM_S" }, { 0, NULL } }; /* CPU message service */ static gint hf_s7comm_cpu_msgservice_subscribe_events = -1; static gint hf_s7comm_cpu_msgservice_subscribe_events_modetrans = -1; static gint hf_s7comm_cpu_msgservice_subscribe_events_system = -1; static gint hf_s7comm_cpu_msgservice_subscribe_events_userdefined = -1; static gint hf_s7comm_cpu_msgservice_subscribe_events_alarms = -1; static gint ett_s7comm_cpu_msgservice_subscribe_events = -1; static int * const s7comm_cpu_msgservice_subscribe_events_fields[] = { &hf_s7comm_cpu_msgservice_subscribe_events_modetrans, &hf_s7comm_cpu_msgservice_subscribe_events_system, &hf_s7comm_cpu_msgservice_subscribe_events_userdefined, &hf_s7comm_cpu_msgservice_subscribe_events_alarms, NULL }; static gint hf_s7comm_cpu_msgservice_req_reserved1 = -1; static gint hf_s7comm_cpu_msgservice_username = -1; static gint hf_s7comm_cpu_msgservice_almtype = -1; static gint hf_s7comm_cpu_msgservice_req_reserved2 = -1; static gint hf_s7comm_cpu_msgservice_res_result = -1; static gint hf_s7comm_cpu_msgservice_res_reserved1 = -1; static gint hf_s7comm_cpu_msgservice_res_reserved2 = -1; static gint hf_s7comm_cpu_msgservice_res_reserved3 = -1; #define S7COMM_CPU_MSG_ALMTYPE_SCAN_ABORT 0 #define S7COMM_CPU_MSG_ALMTYPE_SCAN_INITIATE 1 #define S7COMM_CPU_MSG_ALMTYPE_ALARM_ABORT 4 #define S7COMM_CPU_MSG_ALMTYPE_ALARM_INITIATE 5 #define S7COMM_CPU_MSG_ALMTYPE_AR_SEND_ABORT 6 #define S7COMM_CPU_MSG_ALMTYPE_AR_SEND_INITIATE 7 #define S7COMM_CPU_MSG_ALMTYPE_ALARM_S_ABORT 8 #define S7COMM_CPU_MSG_ALMTYPE_ALARM_S_INITIATE 9 static const value_string cpu_msgservice_almtype_names[] = { { S7COMM_CPU_MSG_ALMTYPE_SCAN_ABORT, "SCAN_ABORT" }, { S7COMM_CPU_MSG_ALMTYPE_SCAN_INITIATE, "SCAN_INITIATE" }, { S7COMM_CPU_MSG_ALMTYPE_ALARM_ABORT, "ALARM_ABORT" }, { S7COMM_CPU_MSG_ALMTYPE_ALARM_INITIATE, "ALARM_INITIATE" }, { S7COMM_CPU_MSG_ALMTYPE_AR_SEND_ABORT, "AR_SEND_ABORT" }, { S7COMM_CPU_MSG_ALMTYPE_AR_SEND_INITIATE, "AR_SEND_INITIATE" }, { S7COMM_CPU_MSG_ALMTYPE_ALARM_S_ABORT, "ALARM_S_ABORT" }, { S7COMM_CPU_MSG_ALMTYPE_ALARM_S_INITIATE, "ALARM_S_INITIATE" }, { 0, NULL } }; static gint hf_s7comm_modetrans_param_unknown1 = -1; static gint hf_s7comm_modetrans_param_mode = -1; static const value_string modetrans_param_mode_names[] = { { 0, "STOP" }, { 1, "Warm Restart" }, { 2, "RUN" }, { 3, "Hot Restart" }, { 4, "HOLD" }, { 6, "Cold Restart" }, { 9, "RUN_R (H-System redundant)" }, { 11, "LINK-UP" }, { 12, "UPDATE" }, { 0, NULL } }; static gint hf_s7comm_modetrans_param_unknown2 = -1; /* These fields used when reassembling S7COMM fragments */ static gint hf_s7comm_fragments = -1; static gint hf_s7comm_fragment = -1; static gint hf_s7comm_fragment_overlap = -1; static gint hf_s7comm_fragment_overlap_conflict = -1; static gint hf_s7comm_fragment_multiple_tails = -1; static gint hf_s7comm_fragment_too_long_fragment = -1; static gint hf_s7comm_fragment_error = -1; static gint hf_s7comm_fragment_count = -1; static gint hf_s7comm_reassembled_in = -1; static gint hf_s7comm_reassembled_length = -1; static gint ett_s7comm_fragment = -1; static gint ett_s7comm_fragments = -1; static const fragment_items s7comm_frag_items = { /* Fragment subtrees */ &ett_s7comm_fragment, &ett_s7comm_fragments, /* Fragment fields */ &hf_s7comm_fragments, &hf_s7comm_fragment, &hf_s7comm_fragment_overlap, &hf_s7comm_fragment_overlap_conflict, &hf_s7comm_fragment_multiple_tails, &hf_s7comm_fragment_too_long_fragment, &hf_s7comm_fragment_error, &hf_s7comm_fragment_count, /* Reassembled in field */ &hf_s7comm_reassembled_in, /* Reassembled length field */ &hf_s7comm_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "S7COMM fragments" }; static reassembly_table s7comm_reassembly_table; /* These are the ids of the subtrees that we are creating */ static gint ett_s7comm = -1; /* S7 communication tree, parent of all other subtree */ static gint ett_s7comm_header = -1; /* Subtree for header block */ static gint ett_s7comm_param = -1; /* Subtree for parameter block */ static gint ett_s7comm_param_item = -1; /* Subtree for items in parameter block */ static gint ett_s7comm_param_subitem = -1; /* Subtree for subitems under items in parameter block */ static gint ett_s7comm_data = -1; /* Subtree for data block */ static gint ett_s7comm_data_item = -1; /* Subtree for an item in data block */ static gint ett_s7comm_item_address = -1; /* Subtree for an address (byte/bit) */ static gint ett_s7comm_cpu_alarm_message = -1; /* Subtree for an alarm message */ static gint ett_s7comm_cpu_alarm_message_object = -1; /* Subtree for an alarm message block*/ static gint ett_s7comm_cpu_alarm_message_timestamp = -1; /* Subtree for an alarm message timestamp */ static gint ett_s7comm_cpu_alarm_message_associated_value = -1; /* Subtree for an alarm message associated value */ static gint ett_s7comm_cpu_diag_msg = -1; /* Subtree for a CPU diagnostic message */ static gint ett_s7comm_prog_parameter = -1; static gint ett_s7comm_prog_data = -1; static const char mon_names[][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; /******************************************************************************************************* * * Converts a siemens special timestamp to a string of 25+1 bytes length (e.g. "Apr 15, 2009 12:49:30.520"). * The timestamp is 6 bytes long, one word is the number of days since 1.1.1984, and 4 bytes milliseconds of the day * *******************************************************************************************************/ static void s7comm_get_timestring_from_s7time(tvbuff_t *tvb, guint offset, char *str, gint max) { guint16 days; guint32 day_msec; struct tm *mt; time_t t; day_msec = tvb_get_ntohl(tvb, offset); days = tvb_get_ntohs(tvb, offset + 4); t = 441763200L; /* 1.1.1984 00:00:00 */ t += (guint32)days * (24*60*60); t += day_msec / 1000; mt = gmtime(&t); str[0] = '\0'; if (mt != NULL) { snprintf(str, max, "%s %2d, %d %02d:%02d:%02d.%03d", mon_names[mt->tm_mon], mt->tm_mday, mt->tm_year + 1900, mt->tm_hour, mt->tm_min, mt->tm_sec, day_msec % 1000); } } /******************************************************************************************************* * * Helper for time functions * Get int from bcd * *******************************************************************************************************/ static guint8 s7comm_guint8_from_bcd(guint8 i) { return 10 * (i /16) + (i % 16); } /******************************************************************************************************* * * Helper for time functions * Add a BCD coded timestamp (10/8 Bytes length) to tree * *******************************************************************************************************/ static guint32 s7comm_add_timestamp_to_tree(tvbuff_t *tvb, proto_tree *tree, guint32 offset, gboolean append_text, gboolean has_ten_bytes) /* if this is false the [0] reserved and [1] year bytes are missing */ { guint8 timestamp[10]; guint8 i; guint8 tmp; guint8 year_org; guint16 msec; nstime_t tv; proto_item *item = NULL; proto_item *time_tree = NULL; struct tm mt; int timestamp_size = 10; if (has_ten_bytes) { /* The low nibble of byte 10 is weekday, the high nibble the LSD of msec */ for (i = 0; i < 9; i++) { timestamp[i] = s7comm_guint8_from_bcd(tvb_get_guint8(tvb, offset + i)); } tmp = tvb_get_guint8(tvb, offset + 9) >> 4; } else { /* this is a 8 byte timestamp, where the reserved and the year byte is missing */ timestamp_size = 8; timestamp[0] = 0; timestamp[1] = 19; /* start with 19.., will be corrected later */ for (i = 0; i < 7; i++) { timestamp[i + 2] = s7comm_guint8_from_bcd(tvb_get_guint8(tvb, offset + i)); } tmp = tvb_get_guint8(tvb, offset + 7) >> 4; } timestamp[9] = s7comm_guint8_from_bcd(tmp); msec = (guint16)timestamp[8] * 10 + (guint16)timestamp[9]; year_org = timestamp[1]; /* year special: ignore the first byte, since some cpus give 1914 for 2014 * if second byte is below 89, it's 2000..2089, if over 90 it's 1990..1999 */ if (timestamp[2] < 89) { timestamp[1] = 20; } /* convert time to nstime_t */ mt.tm_year = (timestamp[1] * 100 + timestamp[2]) - 1900; mt.tm_mon = timestamp[3] - 1; mt.tm_mday = timestamp[4]; mt.tm_hour = timestamp[5]; mt.tm_min = timestamp[6]; mt.tm_sec = timestamp[7]; mt.tm_isdst = -1; tv.secs = mktime(&mt); tv.nsecs = msec * 1000000; if (mt.tm_mon >= 0 && mt.tm_mon <= 11) { item = proto_tree_add_time_format(tree, hf_s7comm_data_ts, tvb, offset, timestamp_size, &tv, "S7 Timestamp: %s %2d, %d %02d:%02d:%02d.%03d", mon_names[mt.tm_mon], mt.tm_mday, mt.tm_year + 1900, mt.tm_hour, mt.tm_min, mt.tm_sec, msec); time_tree = proto_item_add_subtree(item, ett_s7comm_data_item); /* timefunction: s7 timestamp */ if (has_ten_bytes) { proto_tree_add_uint(time_tree, hf_s7comm_data_ts_reserved, tvb, offset, 1, timestamp[0]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_year1, tvb, offset, 1, year_org); offset += 1; } proto_tree_add_uint(time_tree, hf_s7comm_data_ts_year2, tvb, offset, 1, timestamp[2]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_month, tvb, offset, 1, timestamp[3]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_day, tvb, offset, 1, timestamp[4]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_hour, tvb, offset, 1, timestamp[5]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_minute, tvb, offset, 1, timestamp[6]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_second, tvb, offset, 1, timestamp[7]); offset += 1; proto_tree_add_uint(time_tree, hf_s7comm_data_ts_millisecond, tvb, offset, 2, msec); proto_tree_add_item(time_tree, hf_s7comm_data_ts_weekday, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (append_text == TRUE) { proto_item_append_text(tree, "(Timestamp: %s %2d, %d %02d:%02d:%02d.%03d)", mon_names[mt.tm_mon], mt.tm_mday, mt.tm_year + 1900, mt.tm_hour, mt.tm_min, mt.tm_sec, msec); } } else { /* If the timestamp is invalid, continue as best as we can */ if (has_ten_bytes) { offset += 10; } else { offset += 8; } } return offset; } /******************************************************************************************************* * * Generate a comma separated string for registerflags * *******************************************************************************************************/ static void make_registerflag_string(gchar *str, guint8 flags, gint max) { (void) g_strlcpy(str, "", max); if (flags & 0x01) (void) g_strlcat(str, "STW, ", max); if (flags & 0x02) (void) g_strlcat(str, "ACCU1, ", max); if (flags & 0x04) (void) g_strlcat(str, "ACCU2, ", max); if (flags & 0x08) (void) g_strlcat(str, "AR1, ", max); if (flags & 0x10) (void) g_strlcat(str, "AR2, ", max); if (flags & 0x20) (void) g_strlcat(str, "DB1, ", max); if (flags & 0x40) (void) g_strlcat(str, "DB2, ", max); if (strlen(str) > 2) str[strlen(str) - 2 ] = '\0'; } /******************************************************************************************************* * * Addressdefinition for Syntax ID S7-ANY (Step 7 Classic 300/400 or 1200/1500 not optimized) * type == 0x12, length == 10, syntax-ID == 0x10 * *******************************************************************************************************/ static guint32 s7comm_syntaxid_s7any(tvbuff_t *tvb, guint32 offset, proto_tree *tree) { guint32 t_size = 0; guint32 len = 0; guint32 db = 0; guint32 area = 0; guint32 a_address = 0; guint32 bytepos = 0; guint32 bitpos = 0; proto_item *address_item = NULL; proto_tree *address_item_tree = NULL; /* Transport size, 1 byte */ proto_tree_add_item_ret_uint(tree, hf_s7comm_item_transport_size, tvb, offset, 1, ENC_BIG_ENDIAN, &t_size); offset += 1; /* Special handling of data record */ area = tvb_get_guint8(tvb, offset + 4); /* peek area first */ if (area == S7COMM_AREA_DATARECORD) { /* MLEN, 2 bytes */ proto_tree_add_item_ret_uint(tree, hf_s7comm_rdrec_mlen, tvb, offset, 2, ENC_BIG_ENDIAN, &len); offset += 2; /* INDEX, 2 bytes */ proto_tree_add_item_ret_uint(tree, hf_s7comm_rdrec_index, tvb, offset, 2, ENC_BIG_ENDIAN, &db); offset += 2; /* Area, 1 byte */ proto_tree_add_uint(tree, hf_s7comm_item_area, tvb, offset, 1, area); offset += 1; /* ID, 3 bytes */ proto_tree_add_item_ret_uint(tree, hf_s7comm_rdrec_id, tvb, offset, 3, ENC_BIG_ENDIAN, &a_address); offset += 3; proto_item_append_text(tree, " (RECORD MLEN=%d INDEX=0x%04x ID=%d)", len, db, a_address); } else { /* Length, 2 bytes */ proto_tree_add_item_ret_uint(tree, hf_s7comm_item_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len); offset += 2; /* DB number, 2 bytes */ proto_tree_add_item_ret_uint(tree, hf_s7comm_item_db, tvb, offset, 2, ENC_BIG_ENDIAN, &db); offset += 2; /* Area, 1 byte */ proto_tree_add_uint(tree, hf_s7comm_item_area, tvb, offset, 1, area); offset += 1; /* Address, 3 bytes */ address_item = proto_tree_add_item_ret_uint(tree, hf_s7comm_item_address, tvb, offset, 3, ENC_BIG_ENDIAN, &a_address); address_item_tree = proto_item_add_subtree(address_item, ett_s7comm_item_address); bytepos = a_address / 8; bitpos = a_address % 8; /* build a full address to show item data directly beside the item */ proto_item_append_text(tree, " (%s", val_to_str(area, item_areanames_short, "unknown area 0x%02x")); if (area == S7COMM_AREA_TIMER || area == S7COMM_AREA_COUNTER) { proto_item_append_text(tree, " %d)", a_address); proto_tree_add_uint(address_item_tree, hf_s7comm_item_address_nr, tvb, offset, 3, a_address); } else { proto_tree_add_uint(address_item_tree, hf_s7comm_item_address_byte, tvb, offset, 3, a_address); proto_tree_add_uint(address_item_tree, hf_s7comm_item_address_bit, tvb, offset, 3, a_address); if (area == S7COMM_AREA_DB) { proto_item_append_text(tree, " %d.DBX", db); } else if (area == S7COMM_AREA_DI) { proto_item_append_text(tree, " %d.DIX", db); } proto_item_append_text(tree, " %d.%d %s %d)", bytepos, bitpos, val_to_str(t_size, item_transportsizenames, "Unknown transport size: 0x%02x"), len); } offset += 3; } return offset; } /******************************************************************************************************* * * Addressdefinition to read a DB area (S7-400 special) * type == 0x12, length >= 7, syntax-ID == 0xb0 * *******************************************************************************************************/ static guint32 s7comm_syntaxid_dbread(tvbuff_t *tvb, guint32 offset, proto_tree *tree) { guint32 number_of_areas = 0; guint32 len = 0; guint32 db = 0; guint32 bytepos = 0; guint32 i; proto_item *sub_item = NULL; proto_tree *sub_item_tree = NULL; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_dbread_numareas, tvb, offset, 1, ENC_BIG_ENDIAN, &number_of_areas); proto_item_append_text(tree, " (%d Data-Areas of Syntax-Id DBREAD)", number_of_areas); offset += 1; for (i = 0; i < number_of_areas; i++) { sub_item = proto_tree_add_item(tree, hf_s7comm_param_subitem, tvb, offset, 5, ENC_NA); sub_item_tree = proto_item_add_subtree(sub_item, ett_s7comm_param_subitem); proto_tree_add_item_ret_uint(sub_item_tree, hf_s7comm_item_dbread_length, tvb, offset, 1, ENC_BIG_ENDIAN, &len); offset += 1; proto_tree_add_item_ret_uint(sub_item_tree, hf_s7comm_item_dbread_db, tvb, offset, 2, ENC_BIG_ENDIAN, &db); offset += 2; proto_tree_add_item_ret_uint(sub_item_tree, hf_s7comm_item_dbread_startadr, tvb, offset, 2, ENC_BIG_ENDIAN, &bytepos); offset += 2; /* Display in pseudo S7-Any Format */ proto_item_append_text(sub_item, " [%d]: (DB%d.DBB %d BYTE %d)", i+1, db, bytepos, len); } return offset; } /******************************************************************************************************* * * Addressdefinition for TIA S7 1200 symbolic address mode * type == 0x12, length >= 14, syntax-ID == 0xb2 * *******************************************************************************************************/ static guint32 s7comm_syntaxid_1200sym(tvbuff_t *tvb, guint32 offset, proto_tree *tree, guint8 varspec_length) { guint32 tia_var_area1 = 0; guint32 tia_var_area2 = 0; guint8 tia_lid_flags = 0; guint32 tia_value = 0; guint16 i; proto_item *sub_item = NULL; proto_tree *sub_item_tree = NULL; proto_item_append_text(tree, " 1200 symbolic address"); /* first byte in address seems always to be 0xff */ proto_tree_add_item(tree, hf_s7comm_tia1200_item_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* When Bytes 2/3 == 0, then Bytes 4/5 defines the area as known from classic 300/400 address mode. * When Bytes 2/3 == 0x8a0e then Bytes 4/5 are containing the DB number. */ proto_tree_add_item_ret_uint(tree, hf_s7comm_tia1200_item_area1, tvb, offset, 2, ENC_BIG_ENDIAN, &tia_var_area1); offset += 2; tia_var_area2 = tvb_get_ntohs(tvb, offset); if (tia_var_area1 == S7COMM_TIA1200_VAR_ITEM_AREA1_IQMCT) { proto_tree_add_uint(tree, hf_s7comm_tia1200_item_area2, tvb, offset, 2, tia_var_area2); proto_item_append_text(tree, " - Accessing %s", val_to_str(tia_var_area2, tia1200_var_item_area2_names, "Unknown IQMCT Area: 0x%04x")); offset += 2; } else if (tia_var_area1 == S7COMM_TIA1200_VAR_ITEM_AREA1_DB) { proto_tree_add_uint(tree, hf_s7comm_tia1200_item_dbnumber, tvb, offset, 2, tia_var_area2); proto_item_append_text(tree, " - Accessing DB%d", tia_var_area2); offset += 2; } else { /* for current unknown areas */ proto_tree_add_uint(tree, hf_s7comm_tia1200_item_area2unknown, tvb, offset, 2, tia_var_area2); proto_item_append_text(tree, " - Unknown area specification"); offset += 2; } proto_tree_add_item(tree, hf_s7comm_tia1200_item_crc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; for (i = 0; i < (varspec_length - 10) / 4; i++) { sub_item = proto_tree_add_item(tree, hf_s7comm_tia1200_substructure_item, tvb, offset, 4, ENC_NA); sub_item_tree = proto_item_add_subtree(sub_item, ett_s7comm_param_subitem); tia_lid_flags = tvb_get_guint8(tvb, offset) >> 4; proto_tree_add_item(sub_item_tree, hf_s7comm_tia1200_var_lid_flags, tvb, offset, 1, ENC_BIG_ENDIAN); tia_value = tvb_get_ntohl(tvb, offset) & 0x0fffffff; proto_item_append_text(sub_item, " [%d]: %s, Value: %u", i + 1, val_to_str(tia_lid_flags, tia1200_var_lid_flag_names, "Unknown flags: 0x%02x"), tia_value ); proto_tree_add_item(sub_item_tree, hf_s7comm_tia1200_item_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } return offset; } /******************************************************************************************************* * * Addressdefinition for Sinumeric NCK access * type == 0x12, length == 8, syntax-ID == 0x82 or == 0x83 or == 0x84 * *******************************************************************************************************/ static guint32 s7comm_syntaxid_nck(tvbuff_t *tvb, guint32 offset, proto_tree *tree) { guint32 area = 0; guint32 nck_area = 0; guint32 nck_unit = 0; guint32 nck_column = 0; guint32 nck_line = 0; guint32 nck_module = 0; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_nck_areaunit, tvb, offset, 1, ENC_BIG_ENDIAN, &area); nck_area = area >> 5; nck_unit = area & 0x1f; proto_tree_add_item(tree, hf_s7comm_item_nck_area, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_item_nck_unit, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_nck_column, tvb, offset, 2, ENC_BIG_ENDIAN, &nck_column); offset += 2; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_nck_line, tvb, offset, 2, ENC_BIG_ENDIAN, &nck_line); offset += 2; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_nck_module, tvb, offset, 1, ENC_BIG_ENDIAN, &nck_module); offset += 1; proto_tree_add_item(tree, hf_s7comm_item_nck_linecount, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_item_append_text(tree, " (NCK Area:%d Unit:%d Column:%d Line:%d Module:0x%02x)", nck_area, nck_unit, nck_column, nck_line, nck_module); return offset; } /******************************************************************************************************* * * Addressdefinition for accessing Multimaster / Sinamics frequency convertes via routing from DriveES. * type == 0x12, length == 10, syntax-ID == 0x82 * *******************************************************************************************************/ static guint32 s7comm_syntaxid_driveesany(tvbuff_t *tvb, guint32 offset, proto_tree *tree) { guint32 nr = 0; guint32 idx = 0; proto_tree_add_item(tree, hf_s7comm_item_driveesany_unknown1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_item_driveesany_unknown2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_item_driveesany_unknown3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_driveesany_parameter_nr, tvb, offset, 2, ENC_BIG_ENDIAN, &nr); offset += 2; proto_tree_add_item_ret_uint(tree, hf_s7comm_item_driveesany_parameter_idx, tvb, offset, 2, ENC_BIG_ENDIAN, &idx); offset += 2; proto_item_append_text(tree, " (DriveES Parameter: %d[%d])", nr, idx); return offset; } /******************************************************************************************************* * * Dissect the parameter details of a read/write request (Items) * *******************************************************************************************************/ static guint32 s7comm_decode_param_item(tvbuff_t *tvb, guint32 offset, proto_tree *sub_tree, guint8 item_no) { proto_item *item = NULL; proto_tree *item_tree = NULL; guint8 var_spec_type = 0; guint8 var_spec_length = 0; guint8 var_spec_syntax_id = 0; var_spec_type = tvb_get_guint8(tvb, offset); var_spec_length = tvb_get_guint8(tvb, offset + 1); var_spec_syntax_id = tvb_get_guint8(tvb, offset + 2); /* Insert a new tree for every item */ item = proto_tree_add_item(sub_tree, hf_s7comm_param_item, tvb, offset, var_spec_length + 2, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_param_item); proto_item_append_text(item, " [%d]:", item_no + 1); /* Item head, constant 3 bytes */ proto_tree_add_item(item_tree, hf_s7comm_item_varspec, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_item_varspec_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_item_syntax_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (var_spec_type == 0x12 && var_spec_length == 10 && var_spec_syntax_id == S7COMM_SYNTAXID_S7ANY) { /* Step 7 Classic 300 400 */ offset = s7comm_syntaxid_s7any(tvb, offset, item_tree); } else if (var_spec_type == 0x12 && var_spec_length >= 7 && var_spec_syntax_id == S7COMM_SYNTAXID_DBREAD) { /* S7-400 special address mode (kind of cyclic read) */ offset = s7comm_syntaxid_dbread(tvb, offset, item_tree); } else if (var_spec_type == 0x12 && var_spec_length >= 14 && var_spec_syntax_id == S7COMM_SYNTAXID_1200SYM) { /* TIA S7 1200 symbolic address mode */ offset = s7comm_syntaxid_1200sym(tvb, offset, item_tree, var_spec_length); } else if (var_spec_type == 0x12 && var_spec_length == 8 && ((var_spec_syntax_id == S7COMM_SYNTAXID_NCK) || (var_spec_syntax_id == S7COMM_SYNTAXID_NCK_METRIC) || (var_spec_syntax_id == S7COMM_SYNTAXID_NCK_INCH))) { /* Sinumerik NCK access */ offset = s7comm_syntaxid_nck(tvb, offset, item_tree); } else if (var_spec_type == 0x12 && var_spec_length == 10 && var_spec_syntax_id == S7COMM_SYNTAXID_DRIVEESANY) { /* Accessing frequency inverter parameters (via routing) */ offset = s7comm_syntaxid_driveesany(tvb, offset, item_tree); } else { /* var spec, length and syntax id are still added to tree here */ offset += var_spec_length - 1; proto_item_append_text(item_tree, " Unknown variable specification"); } return offset; } /******************************************************************************************************* * * Decode parameter part of a PDU for setup communication * *******************************************************************************************************/ static guint32 s7comm_decode_pdu_setup_communication(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_param_setup_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_param_maxamq_calling, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_param_maxamq_called, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_param_neg_pdu_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } /******************************************************************************************************* * * PDU Type: Response -> Function Write -> Data part * *******************************************************************************************************/ static guint32 s7comm_decode_response_write_data(tvbuff_t *tvb, proto_tree *tree, guint8 item_count, guint32 offset) { guint8 ret_val = 0; guint8 i = 0; proto_item *item = NULL; proto_tree *item_tree = NULL; for (i = 0; i < item_count; i++) { ret_val = tvb_get_guint8(tvb, offset); /* Insert a new tree for every item */ item = proto_tree_add_item(tree, hf_s7comm_data_item, tvb, offset, 1, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d]: (%s)", i+1, val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown code: 0x%02x")); proto_tree_add_uint(item_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); offset += 1; } return offset; } /******************************************************************************************************* * * PDU Type: Response -> Function Read -> Data part * Request -> Function Write -> Data part * *******************************************************************************************************/ static guint32 s7comm_decode_response_read_data(tvbuff_t *tvb, proto_tree *tree, guint8 item_count, guint32 offset) { guint8 ret_val = 0; guint8 tsize = 0; guint16 len = 0, len2 = 0; guint16 head_len = 4; /* 1 byte res-code, 1 byte transp-size, 2 bytes len */ guint8 i = 0; proto_item *item = NULL; proto_tree *item_tree = NULL; /* Maybe this is only valid for Sinumerik NCK: Pre-check transport-size * If transport size is 0x11 or 0x12, then an array with requested NCK areas will follow. */ tsize = tvb_get_guint8(tvb, offset + 1); if (tsize == S7COMM_DATA_TRANSPORT_SIZE_NCKADDR1 || tsize == S7COMM_DATA_TRANSPORT_SIZE_NCKADDR2) { proto_tree_add_item(tree, hf_s7comm_data_returncode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_uint(tree, hf_s7comm_data_transport_size, tvb, offset + 1, 1, tsize); offset += 2; for (i = 0; i < item_count; i++) { offset = s7comm_decode_param_item(tvb, offset, tree, i); } } else { /* Standard */ for (i = 0; i < item_count; i++) { ret_val = tvb_get_guint8(tvb, offset); if (ret_val == S7COMM_ITEM_RETVAL_RESERVED || ret_val == S7COMM_ITEM_RETVAL_DATA_OK || ret_val == S7COMM_ITEM_RETVAL_DATA_ERR ) { tsize = tvb_get_guint8(tvb, offset + 1); len = tvb_get_ntohs(tvb, offset + 2); /* calculate length in bytes */ if (tsize == S7COMM_DATA_TRANSPORT_SIZE_BBIT || tsize == S7COMM_DATA_TRANSPORT_SIZE_BBYTE || tsize == S7COMM_DATA_TRANSPORT_SIZE_BINT ) { /* given length is in number of bits */ if (len % 8) { /* len is not a multiple of 8, then round up to next number */ len /= 8; len = len + 1; } else { len /= 8; } } /* the PLC places extra bytes at the end of all but last result, if length is not a multiple of 2 */ if ((len % 2) && (i < (item_count-1))) { len2 = len + 1; } else { len2 = len; } } /* Insert a new tree for every item */ item = proto_tree_add_item(tree, hf_s7comm_data_item, tvb, offset, len + head_len, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d]: (%s)", i+1, val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown code: 0x%02x")); proto_tree_add_uint(item_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); proto_tree_add_uint(item_tree, hf_s7comm_data_transport_size, tvb, offset + 1, 1, tsize); proto_tree_add_uint(item_tree, hf_s7comm_data_length, tvb, offset + 2, 2, len); offset += head_len; if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK || ret_val == S7COMM_ITEM_RETVAL_RESERVED) { proto_tree_add_item(item_tree, hf_s7comm_readresponse_data, tvb, offset, len, ENC_NA); offset += len; if (len != len2) { proto_tree_add_item(item_tree, hf_s7comm_data_fillbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } } } return offset; } /******************************************************************************************************* * * PDU Type: Request or Response -> Function 0x29 (PLC control functions -> STOP) * *******************************************************************************************************/ static guint32 s7comm_decode_plc_controls_param_hex29(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { guint8 len; /* The first byte 0x29 is checked and inserted to tree outside, so skip it here */ offset += 1; /* Meaning of first 5 bytes (Part 1) is unknown */ proto_tree_add_item(tree, hf_s7comm_piservice_unknown1, tvb, offset, 5, ENC_NA); offset += 5; /* Part 2 */ len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_s7comm_data_plccontrol_part2_len, tvb, offset, 1, len); offset += 1; /* Function as string */ proto_tree_add_item(tree, hf_s7comm_piservice_servicename, tvb, offset, len, ENC_ASCII); offset += len; return offset; } /******************************************************************************************************* * PI_START Parameters: Decodes a parameter array with string values. *******************************************************************************************************/ static guint32 s7comm_decode_pistart_parameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *param_tree, const guint8 *servicename, guint8 nfields, /* number of fields used */ guint hf[], /* array with header fields */ guint32 offset) { guint8 i; guint8 len; wmem_strbuf_t *args_buf; args_buf = wmem_strbuf_create(pinfo->pool); for (i = 0; i < nfields; i++) { len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(param_tree, hf_s7comm_piservice_string_len, tvb, offset, 1, len); offset += 1; proto_tree_add_item(param_tree, hf[i], tvb, offset, len, ENC_ASCII|ENC_NA); wmem_strbuf_append(args_buf, "\""); wmem_strbuf_append(args_buf, tvb_format_text(pinfo->pool, tvb, offset, len)); if (i < nfields-1) { wmem_strbuf_append(args_buf, "\", "); } else { wmem_strbuf_append(args_buf, "\""); } offset += len + (len % 2 == 0); } proto_item_append_text(param_tree, ": (%s)", wmem_strbuf_get_str(args_buf)); proto_item_append_text(tree, " -> %s(%s)", servicename, wmem_strbuf_get_str(args_buf)); col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s(%s)", servicename, wmem_strbuf_get_str(args_buf)); return offset; } /******************************************************************************************************* * PI-Service *******************************************************************************************************/ static guint32 s7comm_decode_pi_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 plength, guint32 offset) { guint16 len, paramlen; guint32 startoffset; guint32 paramoffset; guint8 count; guint8 i; const guint8 *servicename; const guint8 *str; const guint8 *str1; guint16 blocktype; guint hf[13]; int pi_servicename_idx; const gchar *pi_servicename_descr; proto_item *item = NULL; proto_item *itemadd = NULL; proto_tree *param_tree = NULL; proto_tree *file_tree = NULL; gint32 num = -1; gboolean num_valid; startoffset = offset; /* The first byte is checked and inserted to tree outside, so skip it here */ offset += 1; /* First part is unknown, 7 bytes */ proto_tree_add_item(tree, hf_s7comm_piservice_unknown1, tvb, offset, 7, ENC_NA); offset += 7; if (offset - startoffset >= plength) { return offset; } /* Parameter block */ paramlen = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_s7comm_piservice_parameterblock_len, tvb, offset, 2, paramlen); offset += 2; paramoffset = offset; item = proto_tree_add_item(tree, hf_s7comm_piservice_parameterblock, tvb, offset, paramlen, ENC_NA); param_tree = proto_item_add_subtree(item, ett_s7comm_piservice_parameterblock); offset += paramlen; /* PI servicename */ len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_s7comm_piservice_string_len, tvb, offset, 1, len); offset += 1; item = proto_tree_add_item_ret_string(tree, hf_s7comm_piservice_servicename, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &servicename); offset += len; /* get the index position in pi_service_names, and add infotext with description to the item */ pi_servicename_descr = try_str_to_str_idx((const gchar*)servicename, pi_service_names, &pi_servicename_idx); if (pi_servicename_idx < 0) { pi_servicename_idx = S7COMM_PI_UNKNOWN; pi_servicename_descr = "Unknown PI Service"; } proto_item_append_text(item, " [%s]", pi_servicename_descr); /* Work parameter data, depending on servicename */ switch (pi_servicename_idx) { case S7COMM_PI_INSE: case S7COMM_PI_INS2: case S7COMM_PI_DELE: count = tvb_get_guint8(tvb, paramoffset); /* number of blocks following */ proto_tree_add_uint(param_tree, hf_s7comm_data_plccontrol_block_cnt, tvb, paramoffset, 1, count); paramoffset += 1; /* Unknown, is always 0x00 */ proto_tree_add_item(param_tree, hf_s7comm_data_pi_inse_unknown, tvb, paramoffset, 1, ENC_BIG_ENDIAN); paramoffset += 1; col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s(", servicename); for (i = 0; i < count; i++) { item = proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_filename, tvb, paramoffset, 8, ENC_ASCII); file_tree = proto_item_add_subtree(item, ett_s7comm_plcfilename); blocktype = tvb_get_ntohs(tvb, paramoffset); itemadd = proto_tree_add_item(file_tree, hf_s7comm_data_blockcontrol_block_type, tvb, paramoffset, 2, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(blocktype, blocktype_names, "Unknown Block type: 0x%04x")); paramoffset += 2; proto_tree_add_item_ret_string(file_tree, hf_s7comm_data_blockcontrol_block_num, tvb, paramoffset, 5, ENC_ASCII|ENC_NA, pinfo->pool, &str); paramoffset += 5; num_valid = ws_strtoi32((const char*)str, NULL, &num); proto_item_append_text(file_tree, " [%s ", val_to_str(blocktype, blocktype_names, "Unknown Block type: 0x%04x")); col_append_str(pinfo->cinfo, COL_INFO, val_to_str(blocktype, blocktype_names, "Unknown Block type: 0x%04x")); if (num_valid) { proto_item_append_text(file_tree, "%d]", num); col_append_fstr(pinfo->cinfo, COL_INFO, "%d", num); } else { expert_add_info(pinfo, file_tree, &ei_s7comm_data_blockcontrol_block_num_invalid); proto_item_append_text(file_tree, "NaN]"); col_append_str(pinfo->cinfo, COL_INFO, "NaN"); } if (i+1 < count) { col_append_str(pinfo->cinfo, COL_INFO, ", "); } itemadd = proto_tree_add_item(file_tree, hf_s7comm_data_blockcontrol_dest_filesys, tvb, paramoffset, 1, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", char_val_to_str(tvb_get_guint8(tvb, paramoffset), blocktype_attribute2_names, "Unknown filesys")); paramoffset += 1; } col_append_str(pinfo->cinfo, COL_INFO, ")"); break; case S7COMM_PIP_PROGRAM: case S7COMM_PI_MODU: case S7COMM_PI_GARB: if (paramlen == 0) { proto_item_append_text(param_tree, ": ()"); proto_item_append_text(tree, " -> %s()", servicename); col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s()", servicename); } else { proto_tree_add_item_ret_string(param_tree, hf_s7comm_data_plccontrol_argument, tvb, paramoffset, paramlen, ENC_ASCII|ENC_NA, pinfo->pool, &str1); proto_item_append_text(param_tree, ": (\"%s\")", str1); proto_item_append_text(tree, " -> %s(\"%s\")", servicename, str1); col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s(\"%s\")", servicename, str1); } break; case S7COMM_PI_N_LOGIN_: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_password; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_LOGOUT: case S7COMM_PI_N_CANCEL: case S7COMM_PI_N_DASAVE: case S7COMM_PI_N_DIGIOF: case S7COMM_PI_N_DIGION: case S7COMM_PI_N_DZERO_: case S7COMM_PI_N_ENDEXT: case S7COMM_PI_N_OST_OF: case S7COMM_PI_N_OST_ON: case S7COMM_PI_N_SCALE_: case S7COMM_PI_N_SETUFR: case S7COMM_PI_N_STRTLK: case S7COMM_PI_N_STRTUL: case S7COMM_PI_N_TMRASS: hf[0] = hf_s7comm_pi_n_x_addressident; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 1, hf, paramoffset); break; case S7COMM_PI_N_F_DELE: case S7COMM_PI_N_EXTERN: case S7COMM_PI_N_EXTMOD: case S7COMM_PI_N_F_DELR: case S7COMM_PI_N_F_XFER: case S7COMM_PI_N_LOCKE_: case S7COMM_PI_N_SELECT: case S7COMM_PI_N_SRTEXT: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_filename; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_F_CLOS: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_editwindowname; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_F_OPEN: case S7COMM_PI_N_F_OPER: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_filename; hf[2] = hf_s7comm_pi_n_x_editwindowname; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_F_SEEK: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_editwindowname; hf[2] = hf_s7comm_pi_n_x_seekpointer; hf[3] = hf_s7comm_pi_n_x_windowsize; hf[4] = hf_s7comm_pi_n_x_comparestring; hf[5] = hf_s7comm_pi_n_x_skipcount; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 6, hf, paramoffset); break; case S7COMM_PI_N_ASUP__: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_interruptnr; hf[2] = hf_s7comm_pi_n_x_priority; hf[3] = hf_s7comm_pi_n_x_liftfast; hf[4] = hf_s7comm_pi_n_x_blsync; hf[5] = hf_s7comm_pi_n_x_filename; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 6, hf, paramoffset); break; case S7COMM_PI_N_CHEKDM: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_magnr; hf[2] = hf_s7comm_pi_n_x_dnr; hf[3] = hf_s7comm_pi_n_x_spindlenumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_CHKDNO: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_wznr; hf[2] = hf_s7comm_pi_n_x_wznr; hf[3] = hf_s7comm_pi_n_x_dnr; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_CONFIG: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_class; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_CRCEDN: case S7COMM_PI_N_DELECE: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_tnr; hf[2] = hf_s7comm_pi_n_x_dnr; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_CREACE: case S7COMM_PI_N_CREATO: case S7COMM_PI_N_DELETO: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolnumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_CRTOCE: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolnumber; hf[2] = hf_s7comm_pi_n_x_cenumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_DELVAR: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_datablocknumber; hf[2] = hf_s7comm_pi_n_x_firstcolumnnumber; hf[3] = hf_s7comm_pi_n_x_lastcolumnnumber; hf[4] = hf_s7comm_pi_n_x_firstrownumber; hf[5] = hf_s7comm_pi_n_x_lastrownumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 6, hf, paramoffset); break; case S7COMM_PI_N_F_COPY: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_direction; hf[2] = hf_s7comm_pi_n_x_sourcefilename; hf[3] = hf_s7comm_pi_n_x_destinationfilename; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_F_DMDA: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_channelnumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_F_PROR: case S7COMM_PI_N_F_PROT: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_filename; hf[2] = hf_s7comm_pi_n_x_protection; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_F_RENA: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_oldfilename; hf[2] = hf_s7comm_pi_n_x_newfilename; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_FINDBL: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_findmode; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_IBN_SS: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_switch; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_MMCSEM: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_functionnumber; hf[2] = hf_s7comm_pi_n_x_semaphorevalue; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_NCKMOD: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_onoff; hf[2] = hf_s7comm_pi_n_x_mode; hf[3] = hf_s7comm_pi_n_x_factor; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_NEWPWD: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_password; hf[2] = hf_s7comm_pi_n_x_passwordlevel; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_SEL_BL: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_linenumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 2, hf, paramoffset); break; case S7COMM_PI_N_SETTST: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_magnr; hf[2] = hf_s7comm_pi_n_x_weargroup; hf[3] = hf_s7comm_pi_n_x_toolstatus; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_TMAWCO: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_magnr; hf[2] = hf_s7comm_pi_n_x_weargroup; hf[3] = hf_s7comm_pi_n_x_wearsearchstrat; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_TMCRTC: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolid; hf[2] = hf_s7comm_pi_n_x_toolnumber; hf[3] = hf_s7comm_pi_n_x_duplonumber; hf[4] = hf_s7comm_pi_n_x_edgenumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 5, hf, paramoffset); break; case S7COMM_PI_N_TMCRTO: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolid; hf[2] = hf_s7comm_pi_n_x_toolnumber; hf[3] = hf_s7comm_pi_n_x_duplonumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_TMFDPL: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolnumber; hf[2] = hf_s7comm_pi_n_x_placenr; hf[3] = hf_s7comm_pi_n_x_magnr; hf[4] = hf_s7comm_pi_n_x_placerefnr; hf[5] = hf_s7comm_pi_n_x_magrefnr; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 6, hf, paramoffset); break; case S7COMM_PI_N_TMFPBP: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_magnrfrom; hf[2] = hf_s7comm_pi_n_x_placenrfrom; hf[3] = hf_s7comm_pi_n_x_magnrto; hf[4] = hf_s7comm_pi_n_x_placenrto; hf[5] = hf_s7comm_pi_n_x_magrefnr; hf[6] = hf_s7comm_pi_n_x_placerefnr; hf[7] = hf_s7comm_pi_n_x_halfplacesleft; hf[8] = hf_s7comm_pi_n_x_halfplacesright; hf[9] = hf_s7comm_pi_n_x_halfplacesup; hf[10] = hf_s7comm_pi_n_x_halfplacesdown; hf[11] = hf_s7comm_pi_n_x_placetype; hf[12] = hf_s7comm_pi_n_x_searchdirection; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 13, hf, paramoffset); break; case S7COMM_PI_N_TMGETT: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolname; hf[2] = hf_s7comm_pi_n_x_duplonumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_TMMVTL: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolnumber; hf[2] = hf_s7comm_pi_n_x_placenrsource; hf[3] = hf_s7comm_pi_n_x_magnrsource; hf[4] = hf_s7comm_pi_n_x_placenrdestination; hf[5] = hf_s7comm_pi_n_x_magnrdestination; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 6, hf, paramoffset); break; case S7COMM_PI_N_TMPCIT: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_spindlenumber; hf[2] = hf_s7comm_pi_n_x_incrementnumber; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 3, hf, paramoffset); break; case S7COMM_PI_N_TMPOSM: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolnumber; hf[2] = hf_s7comm_pi_n_x_toolid; hf[3] = hf_s7comm_pi_n_x_duplonumber; hf[4] = hf_s7comm_pi_n_x_placenrsource; hf[5] = hf_s7comm_pi_n_x_magnrsource; hf[6] = hf_s7comm_pi_n_x_placenrdestination; hf[7] = hf_s7comm_pi_n_x_magnrdestination; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 8, hf, paramoffset); break; case S7COMM_PI_N_TRESMO: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_toolnumber; hf[2] = hf_s7comm_pi_n_x_dnr; hf[3] = hf_s7comm_pi_n_x_monitoringmode; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 4, hf, paramoffset); break; case S7COMM_PI_N_TSEARC: hf[0] = hf_s7comm_pi_n_x_addressident; hf[1] = hf_s7comm_pi_n_x_magnrfrom; hf[2] = hf_s7comm_pi_n_x_placenrfrom; hf[3] = hf_s7comm_pi_n_x_magnrto; hf[4] = hf_s7comm_pi_n_x_placenrto; hf[5] = hf_s7comm_pi_n_x_magrefnr; hf[6] = hf_s7comm_pi_n_x_placerefnr; hf[7] = hf_s7comm_pi_n_x_searchdirection; hf[8] = hf_s7comm_pi_n_x_kindofsearch; s7comm_decode_pistart_parameters(tvb, pinfo, tree, param_tree, servicename, 9, hf, paramoffset); break; default: /* Don't know how to interpret the parameters, show only the PI servicename */ col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", servicename); } return offset; } /******************************************************************************************************* * * Decode a blockname/filename used in block/file upload/download * *******************************************************************************************************/ static guint32 s7comm_decode_plc_controls_filename(tvbuff_t *tvb, packet_info *pinfo, proto_tree *param_tree, guint32 offset) { guint8 len; const guint8 *str; guint16 blocktype; gboolean is_plcfilename; proto_item *item = NULL; proto_item *itemadd = NULL; proto_tree *file_tree = NULL; len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(param_tree, hf_s7comm_data_blockcontrol_filename_len, tvb, offset, 1, len); offset += 1; item = proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_filename, tvb, offset, len, ENC_ASCII); /* The filename when uploading from PLC has a well known structure, which can be further dissected. * An upload from a NC is a simple filename string with no deeper structure. * Check for PLC filename, by checking some fixed fields. */ is_plcfilename = FALSE; if (len == 9) { blocktype = tvb_get_ntohs(tvb, offset + 1); if ((tvb_get_guint8(tvb, offset) == '_') && (blocktype >= S7COMM_BLOCKTYPE_OB) && (blocktype <= S7COMM_BLOCKTYPE_SFB)) { gint32 num = 1; gboolean num_valid; is_plcfilename = TRUE; file_tree = proto_item_add_subtree(item, ett_s7comm_plcfilename); itemadd = proto_tree_add_item(file_tree, hf_s7comm_data_blockcontrol_file_ident, tvb, offset, 1, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(tvb_get_guint8(tvb, offset), blocktype_attribute1_names, "Unknown identifier: %c")); offset += 1; itemadd = proto_tree_add_item(file_tree, hf_s7comm_data_blockcontrol_block_type, tvb, offset, 2, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(blocktype, blocktype_names, "Unknown Block type: 0x%04x")); offset += 2; proto_tree_add_item_ret_string(file_tree, hf_s7comm_data_blockcontrol_block_num, tvb, offset, 5, ENC_ASCII|ENC_NA, pinfo->pool, &str); offset += 5; num_valid = ws_strtoi32((const gchar*)str, NULL, &num); proto_item_append_text(file_tree, " [%s", val_to_str(blocktype, blocktype_names, "Unknown Block type: 0x%04x")); col_append_fstr(pinfo->cinfo, COL_INFO, " -> Block:[%s", val_to_str(blocktype, blocktype_names, "Unknown Block type: 0x%04x")); if (num_valid) { proto_item_append_text(file_tree, "%d]", num); col_append_fstr(pinfo->cinfo, COL_INFO, "%d]", num); } else { expert_add_info(pinfo, file_tree, &ei_s7comm_data_blockcontrol_block_num_invalid); proto_item_append_text(file_tree, "NaN]"); col_append_str(pinfo->cinfo, COL_INFO, "NaN]"); } itemadd = proto_tree_add_item(file_tree, hf_s7comm_data_blockcontrol_dest_filesys, tvb, offset, 1, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", char_val_to_str(tvb_get_guint8(tvb, offset), blocktype_attribute2_names, "Unknown filesys")); offset += 1; } } if (is_plcfilename == FALSE) { str = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); col_append_fstr(pinfo->cinfo, COL_INFO, " File:[%s]", str); offset += len; } return offset; } /******************************************************************************************************* * * PDU Type: Request or Response -> Function 0x1d, 0x1e, 0x1f (block control functions) for upload * *******************************************************************************************************/ static guint32 s7comm_decode_plc_controls_updownload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *param_tree, guint16 plength, guint16 dlength, guint32 offset, guint8 rosctr) { guint8 len; guint8 function; guint32 errorcode; const gchar *errorcode_text; proto_item *item = NULL; proto_tree *data_tree = NULL; function = tvb_get_guint8(tvb, offset); offset += 1; errorcode = 0; switch (function) { /*---------------------------------------------------------------------*/ case S7COMM_FUNCREQUESTDOWNLOAD: if (rosctr == S7COMM_ROSCTR_JOB) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 2, ENC_NA); offset += 2; /* on upload this is the upload-id, here it is anything else (or not used ) */ proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 4, ENC_NA); offset += 4; offset = s7comm_decode_plc_controls_filename(tvb, pinfo, param_tree, offset); if (plength > 18) { len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(param_tree, hf_s7comm_data_blockcontrol_part2_len, tvb, offset, 1, len); offset += 1; /* first byte unknown '1' */ proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_part2_unknown, tvb, offset, 1, ENC_ASCII); offset += 1; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_loadmem_len, tvb, offset, 6, ENC_ASCII); offset += 6; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_mc7code_len, tvb, offset, 6, ENC_ASCII); offset += 6; } } else if (rosctr == S7COMM_ROSCTR_ACK_DATA) { if (plength >= 2) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; } } break; /*---------------------------------------------------------------------*/ case S7COMM_FUNCSTARTUPLOAD: proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_uploadid, tvb, offset, 4, ENC_NA); offset += 4; if (rosctr == S7COMM_ROSCTR_JOB) { offset = s7comm_decode_plc_controls_filename(tvb, pinfo, param_tree, offset); } else if (rosctr == S7COMM_ROSCTR_ACK_DATA) { if (plength > 8) { /* If uploading from a PLC, the response has a string with the length * of the complete module in bytes, which maybe transferred/split into many PDUs. * On a NC file upload, there are no such fields. */ len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(param_tree, hf_s7comm_data_blockcontrol_upl_lenstring_len, tvb, offset, 1, len); offset += 1; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_upl_lenstring, tvb, offset, len, ENC_ASCII); offset += len; } } break; /*---------------------------------------------------------------------*/ case S7COMM_FUNCUPLOAD: case S7COMM_FUNCDOWNLOADBLOCK: if (rosctr == S7COMM_ROSCTR_JOB) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 2, ENC_NA); offset += 2; if (function == S7COMM_FUNCUPLOAD) { proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_uploadid, tvb, offset, 4, ENC_NA); offset += 4; } else { proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 4, ENC_NA); offset += 4; offset = s7comm_decode_plc_controls_filename(tvb, pinfo, param_tree, offset); } } else if (rosctr == S7COMM_ROSCTR_ACK_DATA) { if (plength >= 2) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; } if (dlength > 0) { item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); proto_tree_add_item(data_tree, hf_s7comm_data_length, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_readresponse_data, tvb, offset, dlength - 4, ENC_NA); offset += dlength - 4; } } break; /*---------------------------------------------------------------------*/ case S7COMM_FUNCENDUPLOAD: case S7COMM_FUNCDOWNLOADENDED: if (rosctr == S7COMM_ROSCTR_JOB) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; item = proto_tree_add_item_ret_uint(param_tree, hf_s7comm_data_blockcontrol_errorcode, tvb, offset, 2, ENC_BIG_ENDIAN, &errorcode); /* here it uses the same errorcode from parameter part */ if ((errorcode_text = try_val_to_str_ext(errorcode, &param_errcode_names_ext))) { proto_item_append_text(item, " (%s)", errorcode_text); } offset += 2; if (function == S7COMM_FUNCENDUPLOAD) { proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_uploadid, tvb, offset, 4, ENC_NA); offset += 4; } else { proto_tree_add_item(param_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 4, ENC_NA); offset += 4; offset = s7comm_decode_plc_controls_filename(tvb, pinfo, param_tree, offset); } } else if (rosctr == S7COMM_ROSCTR_ACK_DATA) { if (plength >= 2) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; } } break; } /* if an error occurred show in info column */ if (errorcode > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " -> Errorcode:[0x%04x]", errorcode); } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Block status (0x13 or 0x01) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_blockstat(tvbuff_t *tvb, proto_tree *td_tree, guint16 td_size, guint8 type, guint8 subfunc, guint32 offset) { proto_item *item = NULL; proto_tree *item_tree = NULL; guint16 line_nr; guint16 line_cnt; guint16 item_size = 4; guint8 registerflags; gchar str_flags[80]; if (type == S7COMM_UD_TYPE_REQ) { if (subfunc == S7COMM_UD_SUBF_TIS_BLOCKSTAT2) { proto_tree_add_item(td_tree, hf_s7comm_tis_blockstat_flagsunknown, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; line_cnt = tvb_get_guint8(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_tis_blockstat_number_of_lines, tvb, offset, 1, line_cnt); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_blockstat_reserved, tvb, offset, 1, ENC_NA); offset += 1; } else { proto_tree_add_item(td_tree, hf_s7comm_tis_blockstat_reserved, tvb, offset, 1, ENC_NA); offset += 1; line_cnt = (td_size - 2) / 2; } proto_tree_add_bitmask(td_tree, tvb, offset, hf_s7comm_diagdata_registerflag, ett_s7comm_diagdata_registerflag, s7comm_diagdata_registerflag_fields, ENC_BIG_ENDIAN); offset += 1; if (subfunc == S7COMM_UD_SUBF_TIS_BLOCKSTAT2) { item_size = 4; } else { item_size = 2; } for (line_nr = 0; line_nr < line_cnt; line_nr++) { item = proto_tree_add_item(td_tree, hf_s7comm_data_item, tvb, offset, item_size, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); if (subfunc == S7COMM_UD_SUBF_TIS_BLOCKSTAT2) { proto_tree_add_item(item_tree, hf_s7comm_tis_blockstat_line_address, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } proto_tree_add_item(item_tree, hf_s7comm_tis_blockstat_reserved, tvb, offset, 1, ENC_NA); offset += 1; registerflags = tvb_get_guint8(tvb, offset); make_registerflag_string(str_flags, registerflags, sizeof(str_flags)); proto_item_append_text(item, " [%d]: (%s)", line_nr+1, str_flags); proto_tree_add_bitmask(item_tree, tvb, offset, hf_s7comm_diagdata_registerflag, ett_s7comm_diagdata_registerflag, s7comm_diagdata_registerflag_fields, ENC_BIG_ENDIAN); offset += 1; } } else if (type == S7COMM_UD_TYPE_IND) { /* The response data can only be dissected when the requested registers for each line * from the job setup is known. As the STW is only 16 Bits and all other registers 32 Bits, * this has no fixed structure. * The only thing that can be shown is the start address. Next the requested registers, * the start address of next line with the requested registers and so on. */ proto_tree_add_item(td_tree, hf_s7comm_diagdata_req_startaddr_awl, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_blockstat_data, tvb, offset, td_size - 2, ENC_NA); offset += (td_size - 2); } else { /* TODO: Show unknown data as raw bytes */ proto_tree_add_item(td_tree, hf_s7comm_tis_blockstat_reserved, tvb, offset, td_size, ENC_NA); offset += td_size; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Item address * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_item_address(tvbuff_t *tvb, guint32 offset, proto_tree *sub_tree, guint16 item_no, gchar *add_text) { guint32 bytepos = 0; guint16 len = 0; guint16 bitpos = 0; guint16 db = 0; guint8 area = 0; proto_item *item = NULL; /* Insert a new tree with 6 bytes for every item */ item = proto_tree_add_item(sub_tree, hf_s7comm_param_item, tvb, offset, 6, ENC_NA); sub_tree = proto_item_add_subtree(item, ett_s7comm_param_item); proto_item_append_text(item, " [%d]%s:", item_no + 1, add_text); /* Area, 1 byte */ area = tvb_get_guint8(tvb, offset); proto_tree_add_item(sub_tree, hf_s7comm_varstat_req_memory_area, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Length (repetition factor), 1 byte. If area is a bit address, then this is the bit number. * The area is a bit address when the low nibble is zero. */ if (area & 0x0f) { len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(sub_tree, hf_s7comm_varstat_req_repetition_factor, tvb, offset, 1, len); offset += 1; } else { bitpos = tvb_get_guint8(tvb, offset); proto_tree_add_uint(sub_tree, hf_s7comm_varstat_req_bitpos, tvb, offset, 1, bitpos); offset += 1; } /* DB number, 2 bytes */ db = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(sub_tree, hf_s7comm_varstat_req_db_number, tvb, offset, 2, db); offset += 2; /* byte offset, 2 bytes */ bytepos = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(sub_tree, hf_s7comm_varstat_req_startaddress, tvb, offset, 2, bytepos); offset += 2; /* build a full address to show item data directly beside the item */ switch (area) { case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MX: proto_item_append_text(sub_tree, " (M%d.%d)", bytepos, bitpos); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MB: proto_item_append_text(sub_tree, " (M%d.0 BYTE %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MW: proto_item_append_text(sub_tree, " (M%d.0 WORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_MD: proto_item_append_text(sub_tree, " (M%d.0 DWORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EX: proto_item_append_text(sub_tree, " (I%d.%d)", bytepos, bitpos); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EB: proto_item_append_text(sub_tree, " (I%d.0 BYTE %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_EW: proto_item_append_text(sub_tree, " (I%d.0 WORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_ED: proto_item_append_text(sub_tree, " (I%d.0 DWORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AX: proto_item_append_text(sub_tree, " (Q%d.%d)", bytepos, bitpos); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AB: proto_item_append_text(sub_tree, " (Q%d.0 BYTE %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AW: proto_item_append_text(sub_tree, " (Q%d.0 WORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_AD: proto_item_append_text(sub_tree, " (Q%d.0 DWORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PEB: proto_item_append_text(sub_tree, " (PI%d.0 BYTE %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PEW: proto_item_append_text(sub_tree, " (PI%d.0 WORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_PED: proto_item_append_text(sub_tree, " (PI%d.0 DWORD %d)", bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBX: proto_item_append_text(sub_tree, " (DB%d.DBX%d.%d)", db, bytepos, bitpos); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBB: proto_item_append_text(sub_tree, " (DB%d.DBX%d.0 BYTE %d)", db, bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBW: proto_item_append_text(sub_tree, " (DB%d.DBX%d.0 WORD %d)", db, bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_DBD: proto_item_append_text(sub_tree, " (DB%d.DBX%d.0 DWORD %d)", db, bytepos, len); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_T: /* it's possible to read multiple timers */ if (len >1) proto_item_append_text(sub_tree, " (T %d..%d)", bytepos, bytepos + len - 1); else proto_item_append_text(sub_tree, " (T %d)", bytepos); break; case S7COMM_UD_SUBF_TIS_VARSTAT_AREA_C: /* it's possible to read multiple counters */ if (len >1) proto_item_append_text(sub_tree, " (C %d..%d)", bytepos, bytepos + len - 1); else proto_item_append_text(sub_tree, " (C %d)", bytepos); break; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Item value * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_item_value(tvbuff_t *tvb, guint32 offset, proto_tree *sub_tree, guint16 item_no, gchar *add_text) { guint16 len = 0, len2 = 0; guint8 ret_val = 0; guint8 tsize = 0; guint8 head_len = 4; proto_item *item = NULL; ret_val = tvb_get_guint8(tvb, offset); if (ret_val == S7COMM_ITEM_RETVAL_RESERVED || ret_val == S7COMM_ITEM_RETVAL_DATA_OK || ret_val == S7COMM_ITEM_RETVAL_DATA_ERR ) { tsize = tvb_get_guint8(tvb, offset + 1); len = tvb_get_ntohs(tvb, offset + 2); if (tsize == S7COMM_DATA_TRANSPORT_SIZE_BBYTE || tsize == S7COMM_DATA_TRANSPORT_SIZE_BINT) { len /= 8; } /* the PLC places extra bytes at the end if length is not a multiple of 2 */ if (len % 2) { len2 = len + 1; } else { len2 = len; } } /* Insert a new tree for every item */ item = proto_tree_add_item(sub_tree, hf_s7comm_data_item, tvb, offset, len + head_len, ENC_NA); sub_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d]%s: (%s)", item_no + 1, add_text, val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown code: 0x%02x")); proto_tree_add_uint(sub_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); proto_tree_add_uint(sub_tree, hf_s7comm_data_transport_size, tvb, offset + 1, 1, tsize); proto_tree_add_uint(sub_tree, hf_s7comm_data_length, tvb, offset + 2, 2, len); offset += head_len; if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK || ret_val == S7COMM_ITEM_RETVAL_RESERVED) { proto_tree_add_item(sub_tree, hf_s7comm_readresponse_data, tvb, offset, len, ENC_NA); offset += len; if (len != len2) { proto_tree_add_item(sub_tree, hf_s7comm_data_fillbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Force (0x09) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_force(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { guint16 item_count; guint16 i; guint8 ret_val = 0; proto_item *item = NULL; proto_tree *item_tree = NULL; switch (type) { case S7COMM_UD_TYPE_REQ: item_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_varstat_item_count, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { offset = s7comm_decode_ud_tis_item_address(tvb, offset, td_tree, i, " Address to force"); } for (i = 0; i < item_count; i++) { offset = s7comm_decode_ud_tis_item_value(tvb, offset, td_tree, i, " Value to force"); } break; case S7COMM_UD_TYPE_IND: item_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_varstat_item_count, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { item = proto_tree_add_item(td_tree, hf_s7comm_data_item, tvb, offset, 1, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); ret_val = tvb_get_guint8(tvb, offset); proto_tree_add_uint(item_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); proto_item_append_text(item, " [%d]: (%s)", i + 1, val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown code: 0x%02x")); offset += 1; } if (item_count % 2) { proto_tree_add_item(item_tree, hf_s7comm_data_fillbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } break; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands / Test and installation functions * Dissects the parameter part * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_param(tvbuff_t *tvb, proto_tree *tree, guint8 type, guint16 tp_size, guint32 offset) { guint32 start_offset; guint32 callenv_setup = 0; proto_item *item = NULL; proto_tree *tp_tree = NULL; start_offset = offset; if (tp_size > 0) { item = proto_tree_add_item(tree, hf_s7comm_tis_parameter, tvb, offset, tp_size, ENC_NA); tp_tree = proto_item_add_subtree(item, ett_s7comm_prog_parameter); if (type == S7COMM_UD_TYPE_REQ) { if (tp_size >= 4) { proto_tree_add_item(tp_tree, hf_s7comm_tis_param1, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_param2, tvb, offset, 2, ENC_NA); offset += 2; } if (tp_size >= 20) { proto_tree_add_item(tp_tree, hf_s7comm_tis_param3, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_answersize, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_param5, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_param6, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_param7, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_param8, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_param9, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_trgevent, tvb, offset, 2, ENC_NA); offset += 2; } if (tp_size >= 26) { proto_tree_add_item(tp_tree, hf_s7comm_diagdata_req_block_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_diagdata_req_block_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_diagdata_req_startaddr_awl, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } if (tp_size >= 28) { proto_tree_add_item(tp_tree, hf_s7comm_diagdata_req_saz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } if (tp_size >= 36) { proto_tree_add_item_ret_uint(tp_tree, hf_s7comm_tis_p_callenv, tvb, offset, 2, ENC_BIG_ENDIAN, &callenv_setup); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_p_callcond, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (callenv_setup == 2) { proto_tree_add_item(tp_tree, hf_s7comm_tis_register_db1_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_register_db2_nr, tvb, offset, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(tp_tree, hf_s7comm_tis_p_callcond_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_p_callcond_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (tp_size >= 38) { proto_tree_add_item(tp_tree, hf_s7comm_tis_p_callcond_address, tvb, offset, 2, ENC_BIG_ENDIAN); } } } } else { proto_tree_add_item(tp_tree, hf_s7comm_tis_res_param1, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tp_tree, hf_s7comm_tis_res_param2, tvb, offset, 2, ENC_NA); } } /* May be we don't know all values when here, so set offset to the given length */ return start_offset + tp_size; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Disable job (0x0d), Enable job (0x0e), * Delete job (0x0f), Read job list (0x10), * Read job (0x11) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_jobs(tvbuff_t *tvb, proto_tree *td_tree, guint16 td_size, guint8 type, guint8 subfunc, guint32 offset) { guint16 i; proto_item *item = NULL; proto_tree *item_tree = NULL; guint16 job_tp_size; guint16 job_td_size; proto_tree *job_td_tree = NULL; guint8 job_subfunc; if (type == S7COMM_UD_TYPE_REQ) { switch (subfunc) { case S7COMM_UD_SUBF_TIS_DELETEJOB: proto_tree_add_item(td_tree, hf_s7comm_tis_job_reserved, tvb, offset, 2, ENC_NA); offset += 2; /* fallthrough */ case S7COMM_UD_SUBF_TIS_ENABLEJOB: case S7COMM_UD_SUBF_TIS_DISABLEJOB: case S7COMM_UD_SUBF_TIS_READJOB: proto_tree_add_item(td_tree, hf_s7comm_tis_job_function, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_job_seqnr, tvb, offset, 1, ENC_NA); offset += 1; break; case S7COMM_UD_SUBF_TIS_READJOBLIST: /* 4 bytes, possible as filter? */ proto_tree_add_item(td_tree, hf_s7comm_tis_job_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_job_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case S7COMM_UD_SUBF_TIS_REPLACEJOB: proto_tree_add_item(td_tree, hf_s7comm_tis_job_reserved, tvb, offset, 2, ENC_NA); offset += 2; /* The job which has to be replaced */ job_subfunc = tvb_get_guint8(tvb, offset); proto_tree_add_item(td_tree, hf_s7comm_tis_job_function, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_job_seqnr, tvb, offset, 1, ENC_NA); offset += 1; job_tp_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(td_tree, hf_s7comm_tis_parametersize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; job_td_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(td_tree, hf_s7comm_tis_datasize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* New job parameter tree */ if (job_tp_size > 0) { offset = s7comm_decode_ud_tis_param(tvb, td_tree, S7COMM_UD_TYPE_REQ, job_tp_size, offset); } /* New job data tree */ if (job_td_size > 0) { offset = s7comm_decode_ud_tis_data(tvb, td_tree, S7COMM_UD_TYPE_REQ, job_subfunc, job_td_size, offset); } break; } } else { switch (subfunc) { case S7COMM_UD_SUBF_TIS_READJOBLIST: /* 4 bytes each job: * - 2 bytes job id * - 2 bytes status: 1=active, 0=idle/pending? */ for (i = 0; i < td_size / 4; i++) { item = proto_tree_add_item(td_tree, hf_s7comm_data_item, tvb, offset, 4, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d] Job", i + 1); proto_tree_add_item(item_tree, hf_s7comm_tis_job_function, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_tis_job_seqnr, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_tis_job_reserved, tvb, offset, 2, ENC_NA); offset += 2; } break; case S7COMM_UD_SUBF_TIS_READJOB: /* This includes the same data as in the job request. With the disadvantage that is does * not contain information of the function, so the data can't be further dissected. * We need to know the function from the request. */ job_tp_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(td_tree, hf_s7comm_tis_parametersize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; job_td_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(td_tree, hf_s7comm_tis_datasize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Job parameter tree */ if (job_tp_size > 0) { offset = s7comm_decode_ud_tis_param(tvb, td_tree, S7COMM_UD_TYPE_REQ, job_tp_size, offset); } /* Job data tree */ if (job_td_size > 0) { item = proto_tree_add_item(td_tree, hf_s7comm_tis_data, tvb, offset, job_td_size, ENC_NA); job_td_tree = proto_item_add_subtree(item, ett_s7comm_prog_data); proto_tree_add_item(job_td_tree, hf_s7comm_tis_job_reserved, tvb, offset, job_td_size, ENC_NA); offset += job_td_size; } break; } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Variable status (0x03) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_varstat(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { guint16 item_count; guint16 i; switch (type) { case S7COMM_UD_TYPE_REQ: item_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_varstat_item_count, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { offset = s7comm_decode_ud_tis_item_address(tvb, offset, td_tree, i, " Address to read"); } break; case S7COMM_UD_TYPE_IND: item_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_varstat_item_count, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { offset = s7comm_decode_ud_tis_item_value(tvb, offset, td_tree, i, " Read data"); } break; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Modify variable (0x08) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_modvar(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { guint16 item_count; guint16 i; guint8 ret_val = 0; proto_item *item = NULL; proto_tree *item_tree = NULL; switch (type) { case S7COMM_UD_TYPE_REQ: item_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_varstat_item_count, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { offset = s7comm_decode_ud_tis_item_address(tvb, offset, td_tree, i, " Address to write"); } for (i = 0; i < item_count; i++) { offset = s7comm_decode_ud_tis_item_value(tvb, offset, td_tree, i, " Data to write"); } break; case S7COMM_UD_TYPE_IND: item_count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(td_tree, hf_s7comm_varstat_item_count, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { item = proto_tree_add_item(td_tree, hf_s7comm_data_item, tvb, offset, 1, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); ret_val = tvb_get_guint8(tvb, offset); proto_tree_add_uint(item_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); proto_item_append_text(item, " [%d]: (%s)", i + 1, val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown code: 0x%02x")); offset += 1; } if (item_count % 2) { proto_tree_add_item(item_tree, hf_s7comm_data_fillbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } break; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Output ISTACK (0x03) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_istack(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { guint8 ob_number = 0; switch (type) { case S7COMM_UD_TYPE_REQ: proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case S7COMM_UD_TYPE_RES: case S7COMM_UD_TYPE_IND: proto_tree_add_item(td_tree, hf_s7comm_tis_continued_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_continued_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_continued_address, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db1_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db2_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db1_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db2_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_accu1, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_accu2, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_accu3, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_accu4, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_ar1, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_ar2, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_register_stw, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_address, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 4, ENC_NA); offset += 4; /* read the OB number first */ ob_number = tvb_get_guint8(tvb, offset + 3); switch (ob_number) { case 1: /* Cyclic execution */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_scan_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_prev_cycle, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_min_cycle, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_max_cycle, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 10: /* Time of day interrupt 0..7 */ case 11: case 12: case 13: case 14: case 15: case 16: case 17: proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_inf, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_period_exe, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_4, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 20: /* Time delay interrupt 0..3 */ case 21: case 22: case 23: proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_inf, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_scan_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_sign, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_dtime, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 30: /* Cyclic interrupt 0..8 */ case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_inf, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_phase_offset, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_exec_freq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 40: /* Hardware interrupt 0..8 */ case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_inf, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_io_flag, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_point_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 55: /* DP Statusalarm */ case 56: /* DP Updatealarm */ case 57: /* DP Specific alarm */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_inf, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_io_flag, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_inf_len, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_alarm_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_alarm_slot, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_alarm_spec, tvb, offset, 1, ENC_NA); offset += 1; break; case 80: /* Cycle time fault */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_error_info, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ev_num, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ob_num, tvb, offset, 1, ENC_NA); offset += 1; break; case 81: /* Power supply fault */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_rack_cpu, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_4, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 82: /* I/O Point fault 1 */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_io_flag, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_8x_fault_flags, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_type_b, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_8x_fault_flags, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_8x_fault_flags, tvb, offset, 1, ENC_NA); offset += 1; break; case 83: /* I/O Point fault 2 */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_io_flag, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_rack_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_type_w, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 84: /* CPU fault */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_4_dw, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 85: /* OB not loaded fault */ case 87: /* Communication Fault */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ev_num, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_err_ob_num, tvb, offset, 1, ENC_NA); offset += 1; break; case 86: /* Loss of rack fault */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mdl_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_racks_flt, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 90: /* Background cycle */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_inf, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_4_dw, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 100: /* Complete restart */ case 101: /* Restart */ case 102: /* Cold restart */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_strtup, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_stop, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_strt_info, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 121: /* Programming Error */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_sw_flt, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_blk_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_reserved_1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_reg, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_blk_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_prg_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 122: /* Module Access Error */ proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_sw_flt, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_blk_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mem_area, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_mem_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_flt_blk_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_ob_prg_addr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; default: proto_tree_add_item(td_tree, hf_s7comm_ob_ev_class, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_priority, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_ob_number, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_istack_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; } offset = s7comm_add_timestamp_to_tree(tvb, td_tree, offset, FALSE, FALSE); } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Output BSTACK (0x04) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_bstack(tvbuff_t *tvb, proto_tree *td_tree, guint16 td_size, guint8 type, guint32 offset) { guint16 i; guint16 blocktype; guint16 blocknumber; proto_item *item = NULL; proto_tree *item_tree = NULL; int rem; guint32 replen; /* Possible firmware bug in IM151-8 CPU, where also the date size information * in the header is 4 bytes too short. */ replen = tvb_reported_length_remaining(tvb, offset); if (replen < td_size) { /* TODO: Show this mismatch? We fix the length here. */ td_size = replen; } switch (type) { case S7COMM_UD_TYPE_REQ: proto_tree_add_item(td_tree, hf_s7comm_tis_bstack_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case S7COMM_UD_TYPE_RES: case S7COMM_UD_TYPE_IND: rem = td_size; i = 1; while (rem > 16) { item = proto_tree_add_item(td_tree, hf_s7comm_data_item, tvb, offset, 16, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); blocktype = tvb_get_ntohs(tvb, offset); proto_tree_add_item(item_tree, hf_s7comm_tis_interrupted_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; blocknumber = tvb_get_ntohs(tvb, offset); proto_tree_add_item(item_tree, hf_s7comm_tis_interrupted_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(item_tree, hf_s7comm_tis_interrupted_address, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(item_tree, hf_s7comm_tis_register_db1_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_tis_register_db2_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_tis_register_db1_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(item_tree, hf_s7comm_tis_register_db2_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(item_tree, hf_s7comm_tis_bstack_reserved, tvb, offset, 4, ENC_NA); offset += 4; proto_item_append_text(item, " [%d] BSTACK entry for: %s %d", i++, val_to_str(blocktype, subblktype_names, "Unknown Subblk type: 0x%02x"), blocknumber); rem -= 16; if (blocktype == S7COMM_SUBBLKTYPE_OB) { proto_tree_add_item(item_tree, hf_s7comm_tis_interrupted_prioclass, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_tis_bstack_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_tis_bstack_reserved, tvb, offset, 2, ENC_NA); offset += 2; rem -= 4; if (rem >= 8) { offset = s7comm_add_timestamp_to_tree(tvb, item_tree, offset, FALSE, FALSE); rem -= 8; } else { proto_tree_add_item(item_tree, hf_s7comm_tis_bstack_reserved, tvb, offset, rem, ENC_NA); offset += rem; break; } } } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Output LSTACK (0x05) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_lstack(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { guint16 len; if (type == S7COMM_UD_TYPE_REQ) { proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_prioclass, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_bstack_nest_depth, tvb, offset, 1, ENC_NA); offset += 1; } else { proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_address, tvb, offset, 2, ENC_NA); offset += 2; len = tvb_get_ntohs(tvb, offset); proto_tree_add_item(td_tree, hf_s7comm_tis_lstack_size, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_lstack_data, tvb, offset, len, ENC_NA); offset += len; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_prioclass, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_lstack_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_lstack_reserved, tvb, offset, 2, ENC_NA); offset += 2; offset = s7comm_add_timestamp_to_tree(tvb, td_tree, offset, FALSE, FALSE); } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Exit Hold (0x0b) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_exithold(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { /* Only request with data payload was seen */ switch (type) { case S7COMM_UD_TYPE_REQ: proto_tree_add_item(td_tree, hf_s7comm_tis_exithold_until, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_exithold_res1, tvb, offset, 1, ENC_NA); offset += 1; break; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands -> Breakpoint (0x0a) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_breakpoint(tvbuff_t *tvb, proto_tree *td_tree, guint8 type, guint32 offset) { switch (type) { case S7COMM_UD_TYPE_REQ: proto_tree_add_item(td_tree, hf_s7comm_tis_breakpoint_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case S7COMM_UD_TYPE_RES: case S7COMM_UD_TYPE_IND: /* Info: Both blocknumbers and addresses are the same on online-blockview inside a block. * On return out of a block, the first address contains the current breakpoint, the second * address the address from where it was returned (previous block). */ proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_interrupted_address, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_breakpoint_blocktype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_breakpoint_blocknr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_breakpoint_address, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_breakpoint_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_register_stw, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_register_accu1, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_accu2, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_ar1, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_ar2, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db1_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db2_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db1_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(td_tree, hf_s7comm_tis_register_db2_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands / Test and installation functions * Dissects the data part * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_data(tvbuff_t *tvb, proto_tree *tree, guint8 type, guint8 subfunc, guint16 td_size, guint32 offset) { proto_item *item = NULL; proto_tree *td_tree = NULL; if (td_size > 0) { item = proto_tree_add_item(tree, hf_s7comm_tis_data, tvb, offset, td_size, ENC_NA); td_tree = proto_item_add_subtree(item, ett_s7comm_prog_data); switch (subfunc) { case S7COMM_UD_SUBF_TIS_OUTISTACK: offset = s7comm_decode_ud_tis_istack(tvb, td_tree, type, offset); break; case S7COMM_UD_SUBF_TIS_OUTBSTACK: offset = s7comm_decode_ud_tis_bstack(tvb, td_tree, td_size, type, offset); break; case S7COMM_UD_SUBF_TIS_OUTLSTACK: offset = s7comm_decode_ud_tis_lstack(tvb, td_tree, type, offset); break; case S7COMM_UD_SUBF_TIS_BREAKPOINT: offset = s7comm_decode_ud_tis_breakpoint(tvb, td_tree, type, offset); break; case S7COMM_UD_SUBF_TIS_EXITHOLD: offset = s7comm_decode_ud_tis_exithold(tvb, td_tree, type, offset); break; case S7COMM_UD_SUBF_TIS_BLOCKSTAT: case S7COMM_UD_SUBF_TIS_BLOCKSTAT2: offset = s7comm_decode_ud_tis_blockstat(tvb, td_tree, td_size, type, subfunc, offset); break; case S7COMM_UD_SUBF_TIS_VARSTAT: offset = s7comm_decode_ud_tis_varstat(tvb, td_tree, type, offset); break; case S7COMM_UD_SUBF_TIS_DISABLEJOB: case S7COMM_UD_SUBF_TIS_ENABLEJOB: case S7COMM_UD_SUBF_TIS_DELETEJOB: case S7COMM_UD_SUBF_TIS_READJOBLIST: case S7COMM_UD_SUBF_TIS_READJOB: case S7COMM_UD_SUBF_TIS_REPLACEJOB: offset = s7comm_decode_ud_tis_jobs(tvb, td_tree, td_size, type, subfunc, offset); break; case S7COMM_UD_SUBF_TIS_MODVAR: offset = s7comm_decode_ud_tis_modvar(tvb, td_tree, type, offset); break; case S7COMM_UD_SUBF_TIS_FORCE: offset = s7comm_decode_ud_tis_force(tvb, td_tree, type, offset); break; default: proto_tree_add_item(td_tree, hf_s7comm_varstat_unknown, tvb, offset, td_size, ENC_NA); offset += td_size; break; } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 1 -> Programmer commands / Test and installation functions * *******************************************************************************************************/ static guint32 s7comm_decode_ud_tis_subfunc(tvbuff_t *tvb, proto_tree *data_tree, guint8 type, guint8 subfunc, guint32 offset) { guint16 tp_size = 0; guint16 td_size = 0; tp_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(data_tree, hf_s7comm_tis_parametersize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; td_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(data_tree, hf_s7comm_tis_datasize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Parameter tree */ offset = s7comm_decode_ud_tis_param(tvb, data_tree, type, tp_size, offset); /* Data tree */ offset = s7comm_decode_ud_tis_data(tvb, data_tree, type, subfunc, td_size, offset); return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 5 -> Security functions? * *******************************************************************************************************/ static guint32 s7comm_decode_ud_security_subfunc(tvbuff_t *tvb, proto_tree *data_tree, guint32 dlength, guint32 offset) { /* Display dataset as raw bytes. Maybe this part can be extended with further knowledge. */ proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, dlength, ENC_NA); offset += dlength; return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 6 -> PBC, Programmable Block Functions (e.g. BSEND/BRECV), before reassembly * *******************************************************************************************************/ static guint32 s7comm_decode_ud_pbc_bsend_pre_reass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint16 *dlength, guint32 *r_id, /* R_ID of the PBC communication */ guint32 offset) { if ((type == S7COMM_UD_TYPE_REQ || type == S7COMM_UD_TYPE_RES) && (*dlength >= 8)) { proto_tree_add_item(data_tree, hf_s7comm_item_varspec, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_item_varspec_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_item_syntax_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 0x00 when passive partners is sending, 0xcc when active partner is sending? */ proto_tree_add_item(data_tree, hf_s7comm_pbc_unknown, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_pbc_bsend_r_id, tvb, offset, 4, ENC_BIG_ENDIAN); *r_id = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " R_ID=0x%X", *r_id); offset += 4; *dlength -= 8; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 6 -> PBC, Programmable Block Functions (e.g. BSEND/BRECV) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_pbc_bsend_subfunc(tvbuff_t *tvb, proto_tree *data_tree, guint32 dlength, guint32 offset, packet_info *pinfo, proto_tree *tree) { proto_tree_add_item(data_tree, hf_s7comm_pbc_bsend_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, dlength - 2, ENC_NA); /* dissect data */ if (tvb_reported_length_remaining(tvb, offset) > 0) { struct tvbuff *next_tvb = tvb_new_subset_remaining(tvb, offset); heur_dtbl_entry_t *hdtbl_entry; if (!dissector_try_heuristic(s7comm_heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) { call_data_dissector(next_tvb, pinfo, data_tree); } } offset += (dlength - 2); return offset; } /******************************************************************************************************* * * PDU Type: User Data -> PBC, Programmable Block Function USEND * *******************************************************************************************************/ static guint32 s7comm_decode_ud_usend(tvbuff_t *tvb, proto_tree *tree, guint32 dlength, guint32 offset) { proto_item *item = NULL; proto_tree *data_tree = NULL; proto_tree *item_tree = NULL; guint8 tsize; guint16 len; guint16 len2; guint8 ret_val; guint8 item_count; guint8 i; item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); ret_val = tvb_get_guint8(tvb, offset); proto_tree_add_uint(data_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_pbc_usend_unknown1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; item_count = tvb_get_guint8(tvb, offset + 1); /* max. 4 possible */ proto_tree_add_uint(data_tree, hf_s7comm_param_itemcount, tvb, offset, 2, item_count); offset += 2; for (i = 0; i < item_count; i++) { tsize = tvb_get_guint8(tvb, offset + 1); len = tvb_get_ntohs(tvb, offset + 2); /* calculate length in bytes */ if (tsize == S7COMM_DATA_TRANSPORT_SIZE_BBIT || tsize == S7COMM_DATA_TRANSPORT_SIZE_BBYTE || tsize == S7COMM_DATA_TRANSPORT_SIZE_BINT ) { if (len % 8) { len /= 8; len = len + 1; } else { len /= 8; } } if ((len % 2) && (i < (item_count-1))) { len2 = len + 1; } else { len2 = len; } item = proto_tree_add_item(data_tree, hf_s7comm_data_item, tvb, offset, len + 4, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d]", i+1); proto_tree_add_item(item_tree, hf_s7comm_pbc_usend_unknown2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_uint(item_tree, hf_s7comm_data_transport_size, tvb, offset + 1, 1, tsize); proto_tree_add_uint(item_tree, hf_s7comm_data_length, tvb, offset + 2, 2, len); offset += 4; proto_tree_add_item(item_tree, hf_s7comm_readresponse_data, tvb, offset, len, ENC_NA); offset += len; if (len != len2) { proto_tree_add_item(item_tree, hf_s7comm_data_fillbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> NC programming functions (file download/upload), before reassembly * *******************************************************************************************************/ static guint32 s7comm_decode_ud_ncprg_pre_reass(tvbuff_t *tvb, proto_tree *data_tree, guint8 type, guint8 subfunc, guint16 *dlength, guint32 offset) { if ((type == S7COMM_UD_TYPE_RES || type == S7COMM_UD_TYPE_IND) && (subfunc == S7COMM_NCPRG_FUNCDOWNLOADBLOCK || subfunc == S7COMM_NCPRG_FUNCUPLOAD || subfunc == S7COMM_NCPRG_FUNCSTARTUPLOAD)) { proto_tree_add_item(data_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 2, ENC_NA); offset += 2; *dlength -= 2; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> NC programming functions (file download/upload) * *******************************************************************************************************/ static guint32 s7comm_decode_ud_ncprg_subfunc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint8 subfunc, guint32 dlength, guint32 offset) { const guint8 *str_filename; guint32 string_end_offset; guint32 string_len; guint32 filelength; guint32 start_offset; if (dlength >= 2) { if (type == S7COMM_UD_TYPE_REQ && subfunc == S7COMM_NCPRG_FUNCREQUESTDOWNLOAD) { proto_tree_add_item_ret_string(data_tree, hf_s7comm_data_blockcontrol_filename, tvb, offset, dlength, ENC_ASCII|ENC_NA, pinfo->pool, &str_filename); col_append_fstr(pinfo->cinfo, COL_INFO, " File:[%s]", str_filename); offset += dlength; } else if (type == S7COMM_UD_TYPE_REQ && subfunc == S7COMM_NCPRG_FUNCSTARTUPLOAD) { proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_unackcount, tvb, offset, 1, ENC_NA); offset += 1; dlength -= 1; proto_tree_add_item(data_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 1, ENC_NA); offset += 1; dlength -= 1; proto_tree_add_item_ret_string(data_tree, hf_s7comm_data_blockcontrol_filename, tvb, offset, dlength, ENC_ASCII|ENC_NA, pinfo->pool, &str_filename); col_append_fstr(pinfo->cinfo, COL_INFO, " File:[%s]", str_filename); offset += dlength; } else if (type == S7COMM_UD_TYPE_RES && subfunc == S7COMM_NCPRG_FUNCREQUESTDOWNLOAD) { proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_unackcount, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 1, ENC_NA); offset += 1; } else if (type == S7COMM_UD_TYPE_IND && (subfunc == S7COMM_NCPRG_FUNCCONTUPLOAD || subfunc == S7COMM_NCPRG_FUNCCONTDOWNLOAD)) { proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_unackcount, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 1, ENC_NA); offset += 1; } else if ((type == S7COMM_UD_TYPE_RES || type == S7COMM_UD_TYPE_IND) && (subfunc == S7COMM_NCPRG_FUNCDOWNLOADBLOCK || subfunc == S7COMM_NCPRG_FUNCUPLOAD || subfunc == S7COMM_NCPRG_FUNCSTARTUPLOAD)) { start_offset = offset; /* file length may be contain only spaces when downloading a directory */ proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_filelength, tvb, offset, 8, ENC_ASCII); offset += 8; proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_filetime, tvb, offset, 16, ENC_ASCII); offset += 16; /* File path and file data aren't always there */ if (dlength > 24) { if (subfunc == S7COMM_NCPRG_FUNCDOWNLOADBLOCK || subfunc == S7COMM_NCPRG_FUNCSTARTUPLOAD || subfunc == S7COMM_NCPRG_FUNCUPLOAD) { string_end_offset = tvb_find_guint8(tvb, offset, dlength-8-16, 0x0a); if (string_end_offset > 0) { string_len = string_end_offset - offset + 1; /* include 0x0a */ proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_filepath, tvb, offset, string_len, ENC_ASCII); offset += string_len; filelength = dlength - (offset - start_offset); proto_tree_add_item(data_tree, hf_s7comm_data_ncprg_filedata, tvb, offset, filelength, ENC_NA); offset += filelength; } } } } else { proto_tree_add_item(data_tree, hf_s7comm_data_blockcontrol_unknown1, tvb, offset, 2, ENC_NA); offset += 2; dlength -= 2; if (dlength >= 4) { proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, dlength, ENC_NA); offset += dlength; } } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Data record routing to Profibus * *******************************************************************************************************/ static guint32 s7comm_decode_ud_drr_subfunc(tvbuff_t *tvb, proto_tree *tree, guint32 dlength, guint32 offset) { /* As a start add only a data block. At least there are min. 6 bytes of a header. * At some point of the data, parts of the Profinet dissector may be reusable, * as there's an overlap between the Profibus and Profinet Specification. */ if (dlength > 0) { proto_tree_add_item(tree, hf_s7comm_data_drr_data, tvb, offset, dlength, ENC_NA); offset += dlength; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Message services -> AR_SEND parameters on initiate/abort * *******************************************************************************************************/ static guint32 s7comm_decode_message_service_ar_send_args(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 type, guint32 offset) { guint8 item_count; guint8 i; guint32 ar_id; proto_item *item = NULL; proto_tree *item_tree = NULL; item_count = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_s7comm_param_itemcount, tvb, offset, 1, item_count); offset += 1; for (i = 0; i < item_count; i++) { if (type == S7COMM_UD_TYPE_REQ) { item = proto_tree_add_item(tree, hf_s7comm_data_item, tvb, offset, 8, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_tree_add_item(item_tree, hf_s7comm_item_varspec, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_item_varspec_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_item_syntax_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_pbc_arsend_unknown, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item_ret_uint(item_tree, hf_s7comm_pbc_arsend_ar_id, tvb, offset, 4, ENC_BIG_ENDIAN, &ar_id); col_append_fstr(pinfo->cinfo, COL_INFO, "%s0x%X", (i == 0) ? " AR_ID=" : ",", ar_id); proto_item_append_text(item, " [%d]: AR_ID=0x%X", i+1, ar_id); offset += 4; } else if (type == S7COMM_UD_TYPE_RES) { item = proto_tree_add_item(tree, hf_s7comm_data_item, tvb, offset, 1, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d]", i+1); /* Kind of return code. But from what was captured, it doesn't matter if the AR_ID of the request is not available */ proto_tree_add_item(item_tree, hf_s7comm_pbc_arsend_ret, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } /* Fill byte on response if number of items is uneven */ if (type == S7COMM_UD_TYPE_RES && (item_count % 2)) { proto_tree_add_item(tree, hf_s7comm_data_fillbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Message services * *******************************************************************************************************/ static guint32 s7comm_decode_message_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint32 dlength, guint32 offset) { guint8 events; guint8 almtype; gchar events_string[42]; switch (type) { case S7COMM_UD_TYPE_REQ: events = tvb_get_guint8(tvb, offset); proto_tree_add_bitmask(data_tree, tvb, offset, hf_s7comm_cpu_msgservice_subscribe_events, ett_s7comm_cpu_msgservice_subscribe_events, s7comm_cpu_msgservice_subscribe_events_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_req_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; (void) g_strlcpy(events_string, "", sizeof(events_string)); if (events & 0x01) (void) g_strlcat(events_string, "MODE,", sizeof(events_string)); /* Change in mode-transition: Stop, Run, by Push and Function-group=0, Subfunction: 0=Stop, 1=Warm Restart, 2=RUN */ if (events & 0x02) (void) g_strlcat(events_string, "SYS,", sizeof(events_string)); /* System diagnostics */ if (events & 0x04) (void) g_strlcat(events_string, "USR,", sizeof(events_string)); /* User-defined diagnostic messages */ if (events & 0x08) (void) g_strlcat(events_string, "-4-,", sizeof(events_string)); /* currently unknown flag */ if (events & 0x10) (void) g_strlcat(events_string, "-5-,", sizeof(events_string)); /* currently unknown flag */ if (events & 0x20) (void) g_strlcat(events_string, "-6-,", sizeof(events_string)); /* currently unknown flag */ if (events & 0x40) (void) g_strlcat(events_string, "-7-,", sizeof(events_string)); /* currently unknown flag */ if (events & 0x80) (void) g_strlcat(events_string, "ALM,", sizeof(events_string)); /* Program block message, type of message in additional field */ if (strlen(events_string) > 2) events_string[strlen(events_string) - 1 ] = '\0'; col_append_fstr(pinfo->cinfo, COL_INFO, " SubscribedEvents=(%s)", events_string); proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_username, tvb, offset, 8, ENC_ASCII); offset += 8; if ((events & 0x80) && (dlength > 10)) { almtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_almtype, tvb, offset, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " AlmType=%s", val_to_str(almtype, cpu_msgservice_almtype_names, "Unknown type: 0x%02x")); offset += 1; if (almtype == S7COMM_CPU_MSG_ALMTYPE_AR_SEND_INITIATE || almtype == S7COMM_CPU_MSG_ALMTYPE_AR_SEND_ABORT) { offset = s7comm_decode_message_service_ar_send_args(tvb, pinfo, data_tree, type, offset); } else { proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_req_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } break; case S7COMM_UD_TYPE_RES: proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_res_result, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_res_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (dlength > 2) { almtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_almtype, tvb, offset, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " AlmType=%s", val_to_str(almtype, cpu_msgservice_almtype_names, "Unknown type: 0x%02x")); offset += 1; if (almtype == S7COMM_CPU_MSG_ALMTYPE_AR_SEND_INITIATE || almtype == S7COMM_CPU_MSG_ALMTYPE_AR_SEND_ABORT) { offset = s7comm_decode_message_service_ar_send_args(tvb, pinfo, data_tree, type, offset); } else { proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_res_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_cpu_msgservice_res_reserved3, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } break; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> AR_SEND, before reassembly * *******************************************************************************************************/ static guint32 s7comm_decode_ud_cpu_ar_send_pre_reass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint16 *dlength, guint32 offset) { guint32 ar_id; if (*dlength >= 8) { proto_tree_add_item(data_tree, hf_s7comm_item_varspec, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_item_varspec_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_item_syntax_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_pbc_arsend_unknown, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item_ret_uint(data_tree, hf_s7comm_pbc_arsend_ar_id, tvb, offset, 4, ENC_BIG_ENDIAN, &ar_id); col_append_fstr(pinfo->cinfo, COL_INFO, " AR_ID=0x%X", ar_id); offset += 4; *dlength -= 8; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> AR_SEND * *******************************************************************************************************/ static guint32 s7comm_decode_ud_cpu_ar_send(tvbuff_t *tvb, proto_tree *data_tree, guint32 offset) { guint32 len; /* Only the first fragment contains the length. As we get the length after reassembly, it's ok. */ proto_tree_add_item_ret_uint(data_tree, hf_s7comm_pbc_arsend_len, tvb, offset, 2, ENC_LITTLE_ENDIAN, &len); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, len, ENC_NA); offset += len; return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 4 -> alarm, main tree for all except query response * *******************************************************************************************************/ static guint32 s7comm_decode_ud_cpu_alarm_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint8 subfunc, guint32 offset) { guint32 start_offset; guint32 asc_start_offset; guint32 msg_obj_start_offset; guint32 ev_id; proto_item *msg_item = NULL; proto_tree *msg_item_tree = NULL; proto_item *msg_obj_item = NULL; proto_tree *msg_obj_item_tree = NULL; proto_item *msg_work_item = NULL; proto_tree *msg_work_item_tree = NULL; guint8 nr_objects; guint8 i; guint8 syntax_id; guint8 nr_of_additional_values; guint8 signalstate; guint8 sig_nr; guint8 ret_val; guint8 querytype; guint8 varspec_length; start_offset = offset; msg_item = proto_tree_add_item(data_tree, hf_s7comm_cpu_alarm_message_item, tvb, offset, 0, ENC_NA); msg_item_tree = proto_item_add_subtree(msg_item, ett_s7comm_cpu_alarm_message); switch (subfunc) { case S7COMM_UD_SUBF_CPU_SCAN_IND: proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_scan_unknown1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; msg_work_item = proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_timestamp_coming, tvb, offset, 8, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_timestamp); offset = s7comm_add_timestamp_to_tree(tvb, msg_work_item_tree, offset, TRUE, FALSE); proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_scan_unknown2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case S7COMM_UD_SUBF_CPU_ALARM8_IND: case S7COMM_UD_SUBF_CPU_ALARMACK_IND: case S7COMM_UD_SUBF_CPU_ALARMSQ_IND: case S7COMM_UD_SUBF_CPU_ALARMS_IND: case S7COMM_UD_SUBF_CPU_NOTIFY_IND: case S7COMM_UD_SUBF_CPU_NOTIFY8_IND: msg_work_item = proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_timestamp_coming, tvb, offset, 8, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_timestamp); offset = s7comm_add_timestamp_to_tree(tvb, msg_work_item_tree, offset, TRUE, FALSE); break; } proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_function, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; nr_objects = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_item_tree, hf_s7comm_cpu_alarm_message_nr_objects, tvb, offset, 1, nr_objects); offset += 1; for (i = 0; i < nr_objects; i++) { msg_obj_start_offset = offset; msg_obj_item = proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_obj_item, tvb, offset, 0, ENC_NA); msg_obj_item_tree = proto_item_add_subtree(msg_obj_item, ett_s7comm_cpu_alarm_message_object); proto_item_append_text(msg_obj_item_tree, " [%d]", i+1); if (type == S7COMM_UD_TYPE_REQ || type == S7COMM_UD_TYPE_IND) { proto_tree_add_item(msg_obj_item_tree, hf_s7comm_item_varspec, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; varspec_length = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_item_varspec_length, tvb, offset, 1, varspec_length); offset += 1; syntax_id = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_item_syntax_id, tvb, offset, 1, syntax_id); offset += 1; switch (syntax_id) { case S7COMM_SYNTAXID_ALARM_LOCKFREESET: case S7COMM_SYNTAXID_ALARM_INDSET: case S7COMM_SYNTAXID_NOTIFY_INDSET: case S7COMM_SYNTAXID_ALARM_ACKSET: nr_of_additional_values = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_nr_add_values, tvb, offset, 1, nr_of_additional_values); offset += 1; ev_id = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_eventid, tvb, offset, 4, ev_id); offset += 4; proto_item_append_text(msg_obj_item_tree, ": EventID=0x%08x", ev_id); col_append_fstr(pinfo->cinfo, COL_INFO, " EventID=0x%08x", ev_id); if (syntax_id == S7COMM_SYNTAXID_ALARM_INDSET || syntax_id == S7COMM_SYNTAXID_NOTIFY_INDSET) { signalstate = tvb_get_guint8(tvb, offset); proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_eventstate, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; /* show SIG with True values for a quick overview in info-column */ if (signalstate > 0) { col_append_str(pinfo->cinfo, COL_INFO, " On=["); for (sig_nr = 0; sig_nr < 8; sig_nr++) { if (signalstate & 0x01) { signalstate >>= 1; if (signalstate == 0) { col_append_fstr(pinfo->cinfo, COL_INFO, "SIG_%d", sig_nr + 1); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "SIG_%d,", sig_nr + 1); } } else { signalstate >>= 1; } } col_append_str(pinfo->cinfo, COL_INFO, "]"); } proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_state, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; } if (syntax_id == S7COMM_SYNTAXID_ALARM_INDSET || syntax_id == S7COMM_SYNTAXID_ALARM_ACKSET || syntax_id == S7COMM_SYNTAXID_NOTIFY_INDSET) { proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_ackstate_going, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_ackstate_coming, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; } if (syntax_id == S7COMM_SYNTAXID_NOTIFY_INDSET) { proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_event_going, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_event_coming, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_event_lastchanged, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_event_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } if (syntax_id == S7COMM_SYNTAXID_ALARM_INDSET || syntax_id == S7COMM_SYNTAXID_NOTIFY_INDSET) { if (nr_of_additional_values > 0) { asc_start_offset = offset; msg_work_item = proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_associated_value, tvb, offset, 0, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_associated_value); offset = s7comm_decode_response_read_data(tvb, msg_work_item_tree, nr_of_additional_values, offset); proto_item_set_len(msg_work_item_tree, offset - asc_start_offset); } } break; case S7COMM_SYNTAXID_ALARM_QUERYREQSET: proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_unknown1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; querytype = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_querytype, tvb, offset, 1, querytype); offset += 1; proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_unknown2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; ev_id = tvb_get_ntohl(tvb, offset); /* there is a querytype=8, which only occurs when a previous SZL request 0x131 index 0x10 has a missing flag in funk_1 */ switch (querytype) { case S7COMM_ALARM_MESSAGE_QUERYTYPE_BYALARMTYPE: proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_alarmtype, tvb, offset, 4, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " ByAlarmtype=%s", val_to_str(ev_id, alarm_message_query_alarmtype_names, "Unknown Alarmtype: %u")); break; case S7COMM_ALARM_MESSAGE_QUERYTYPE_BYEVENTID: proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_eventid, tvb, offset, 4, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " ByEventID=0x%08x", ev_id); break; default: break; } offset += 4; break; default: /* for current unknown syntax id, set offset to end of dataset. The varspec_length includes * the byte for the syntax_id, so minus one. */ offset += (varspec_length - 1); break; } } else if (type == S7COMM_UD_TYPE_RES) { ret_val = tvb_get_guint8(tvb, offset); proto_item_append_text(msg_obj_item_tree, ": (%s)", val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown code: 0x%02x")); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); offset += 1; } proto_item_set_len(msg_obj_item_tree, offset - msg_obj_start_offset); } proto_item_set_len(msg_item_tree, offset - start_offset); return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 4 -> alarm query response * *******************************************************************************************************/ static guint32 s7comm_decode_ud_cpu_alarm_query_response(tvbuff_t *tvb, proto_tree *data_tree, guint32 offset) { proto_item *msg_item = NULL; proto_tree *msg_item_tree = NULL; proto_item *msg_obj_item = NULL; proto_tree *msg_obj_item_tree = NULL; proto_item *msg_work_item = NULL; proto_tree *msg_work_item_tree = NULL; guint32 start_offset; guint32 msg_obj_start_offset; guint32 asc_start_offset; guint32 ev_id; guint8 returncode; guint8 alarmtype; guint16 complete_length; gint32 remaining_length; gboolean cont; start_offset = offset; msg_item = proto_tree_add_item(data_tree, hf_s7comm_cpu_alarm_message_item, tvb, offset, 0, ENC_NA); msg_item_tree = proto_item_add_subtree(msg_item, ett_s7comm_cpu_alarm_message); /* Maybe this value here is something different, always 0x00 or 0x01 */ proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_function, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_nr_objects, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; returncode = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_item_tree, hf_s7comm_data_returncode, tvb, offset, 1, returncode); offset += 1; proto_tree_add_item(msg_item_tree, hf_s7comm_data_transport_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; complete_length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(msg_item_tree, hf_s7comm_cpu_alarm_query_completelen, tvb, offset, 2, complete_length); remaining_length = (gint32)complete_length; offset += 2; if (returncode == S7COMM_ITEM_RETVAL_DATA_OK) { do { msg_obj_start_offset = offset; msg_obj_item = proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_alarm_message_obj_item, tvb, offset, 0, ENC_NA); msg_obj_item_tree = proto_item_add_subtree(msg_obj_item, ett_s7comm_cpu_alarm_message_object); proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_datasetlen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_resunknown1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* begin of count dataset length */ alarmtype = tvb_get_guint8(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_alarmtype, tvb, offset, 1, alarmtype); proto_item_append_text(msg_obj_item_tree, " (Alarmtype=%s)", val_to_str(alarmtype, alarm_message_query_alarmtype_names, "Unknown Alarmtype: %u")); offset += 1; ev_id = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_eventid, tvb, offset, 4, ev_id); proto_item_append_text(msg_obj_item_tree, ": EventID=0x%08x", ev_id); offset += 4; proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_query_resunknown1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_eventstate, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_ackstate_going, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(msg_obj_item_tree, tvb, offset, hf_s7comm_cpu_alarm_message_ackstate_coming, ett_s7comm_cpu_alarm_message_signal, s7comm_cpu_alarm_message_signal_fields, ENC_BIG_ENDIAN); offset += 1; if (alarmtype == S7COMM_ALARM_MESSAGE_QUERY_ALARMTYPE_ALARM_S) { /* 8 bytes timestamp (coming)*/ msg_work_item = proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_timestamp_coming, tvb, offset, 8, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_timestamp); offset = s7comm_add_timestamp_to_tree(tvb, msg_work_item_tree, offset, TRUE, FALSE); /* Associated value of coming alarm */ asc_start_offset = offset; msg_work_item = proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_associated_value, tvb, offset, 0, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_associated_value); offset = s7comm_decode_response_read_data(tvb, msg_work_item_tree, 1, offset); proto_item_set_len(msg_work_item_tree, offset - asc_start_offset); /* 8 bytes timestamp (going) * If all bytes in timestamp are zero, then the message is still active. */ msg_work_item = proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_timestamp_going, tvb, offset, 8, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_timestamp); offset = s7comm_add_timestamp_to_tree(tvb, msg_work_item_tree, offset, TRUE, FALSE); /* Associated value of going alarm */ asc_start_offset = offset; msg_work_item = proto_tree_add_item(msg_obj_item_tree, hf_s7comm_cpu_alarm_message_associated_value, tvb, offset, 0, ENC_NA); msg_work_item_tree = proto_item_add_subtree(msg_work_item, ett_s7comm_cpu_alarm_message_associated_value); offset = s7comm_decode_response_read_data(tvb, msg_work_item_tree, 1, offset); proto_item_set_len(msg_work_item_tree, offset - asc_start_offset); } remaining_length = remaining_length - (offset - msg_obj_start_offset); proto_item_set_len(msg_obj_item_tree, offset - msg_obj_start_offset); /* when complete_length is 0xffff, then loop until terminating null */ if (complete_length == 0xffff) { cont = (tvb_get_guint8(tvb, offset) > 0); } else { cont = (remaining_length > 0); } } while (cont); } proto_item_set_len(msg_item_tree, offset - start_offset); return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 4 -> diagnostic message * Also used as a dataset in the diagnostic buffer, read with SZL-ID 0x00a0 index 0. * *******************************************************************************************************/ guint32 s7comm_decode_ud_cpu_diagnostic_message(tvbuff_t *tvb, packet_info *pinfo, gboolean add_info_to_col, proto_tree *data_tree, guint32 offset) { proto_item *msg_item = NULL; proto_tree *msg_item_tree = NULL; guint16 eventid; guint16 eventid_masked; const gchar *event_text; gboolean has_text = FALSE; msg_item = proto_tree_add_item(data_tree, hf_s7comm_cpu_diag_msg_item, tvb, offset, 20, ENC_NA); msg_item_tree = proto_item_add_subtree(msg_item, ett_s7comm_cpu_diag_msg); eventid = tvb_get_ntohs(tvb, offset); if ((eventid >= 0x8000) && (eventid <= 0x9fff)) { eventid_masked = eventid & 0xf0ff; if ((event_text = try_val_to_str_ext(eventid_masked, &cpu_diag_eventid_0x8_0x9_names_ext))) { if (add_info_to_col) { col_append_fstr(pinfo->cinfo, COL_INFO, " Event='%s'", event_text); } has_text = TRUE; } else { if (add_info_to_col) { col_append_fstr(pinfo->cinfo, COL_INFO, " EventID=0x%04x", eventid); } } } else if ((eventid >= 0x1000) && (eventid < 0x8000)) { if ((event_text = try_val_to_str_ext(eventid, &cpu_diag_eventid_fix_names_ext))) { if (add_info_to_col) { col_append_fstr(pinfo->cinfo, COL_INFO, " Event='%s'", event_text); } has_text = TRUE; } else { if (add_info_to_col) { col_append_fstr(pinfo->cinfo, COL_INFO, " EventID=0x%04x", eventid); } } } else { if (add_info_to_col) { col_append_fstr(pinfo->cinfo, COL_INFO, " EventID=0x%04x", eventid); } } proto_tree_add_bitmask(msg_item_tree, tvb, offset, hf_s7comm_cpu_diag_msg_eventid, ett_s7comm_cpu_diag_msg_eventid, s7comm_cpu_diag_msg_eventid_fields, ENC_BIG_ENDIAN); if (has_text) { proto_item_append_text(msg_item_tree, ": Event='%s'", event_text); } else { proto_item_append_text(msg_item_tree, ": EventID=0x%04x", eventid); } offset += 2; proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_diag_msg_prioclass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_diag_msg_obnumber, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_diag_msg_datid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_diag_msg_info1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(msg_item_tree, hf_s7comm_cpu_diag_msg_info2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset = s7comm_add_timestamp_to_tree(tvb, msg_item_tree, offset, FALSE, FALSE); return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 7 -> time functions * *******************************************************************************************************/ static guint32 s7comm_decode_ud_time_subfunc(tvbuff_t *tvb, proto_tree *data_tree, guint8 type, guint8 subfunc, guint8 ret_val, /* Return value in data part */ guint32 dlength, guint32 offset) { gboolean know_data = FALSE; switch (subfunc) { case S7COMM_UD_SUBF_TIME_READ: case S7COMM_UD_SUBF_TIME_READF: if (type == S7COMM_UD_TYPE_RES) { if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK) { proto_item_append_text(data_tree, ": "); offset = s7comm_add_timestamp_to_tree(tvb, data_tree, offset, TRUE, TRUE); } know_data = TRUE; } break; case S7COMM_UD_SUBF_TIME_SET: case S7COMM_UD_SUBF_TIME_SET2: if (type == S7COMM_UD_TYPE_REQ) { if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK) { proto_item_append_text(data_tree, ": "); offset = s7comm_add_timestamp_to_tree(tvb, data_tree, offset, TRUE, TRUE); } know_data = TRUE; } break; default: break; } if (know_data == FALSE && dlength > 0) { proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, dlength, ENC_NA); offset += dlength; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 3 -> block functions * *******************************************************************************************************/ static guint32 s7comm_decode_ud_block_subfunc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint8 subfunc, guint8 ret_val, /* Return value in data part */ guint8 tsize, /* transport size in data part */ guint32 dlength, guint32 offset) { guint32 count; guint32 i; const guint8 *pBlocknumber; guint16 blocknumber; guint8 blocktype; guint16 blocktype16; gboolean know_data = FALSE; proto_item *item = NULL; proto_tree *item_tree = NULL; proto_item *itemadd = NULL; char str_timestamp[30]; char str_version[10]; switch (subfunc) { /************************************************* * List blocks */ case S7COMM_UD_SUBF_BLOCK_LIST: if (type == S7COMM_UD_TYPE_REQ) { /* Is this a possible combination? Never seen it... */ } else if (type == S7COMM_UD_TYPE_RES) { count = dlength / 4; for (i = 0; i < count; i++) { /* Insert a new tree of 4 byte length for every item */ item = proto_tree_add_item(data_tree, hf_s7comm_data_item, tvb, offset, 4, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); blocktype16 = tvb_get_ntohs(tvb, offset); proto_item_append_text(item, " [%d]: (Block type %s)", i+1, val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); itemadd = proto_tree_add_item(item_tree, hf_s7comm_ud_blockinfo_block_type, tvb, offset, 2, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); offset += 2; proto_tree_add_item(item_tree, hf_s7comm_ud_blockinfo_block_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } know_data = TRUE; } break; /************************************************* * List blocks of type */ case S7COMM_UD_SUBF_BLOCK_LISTTYPE: if (type == S7COMM_UD_TYPE_REQ) { if (tsize != S7COMM_DATA_TRANSPORT_SIZE_NULL) { blocktype16 = tvb_get_ntohs(tvb, offset); itemadd = proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_block_type, tvb, offset, 2, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); col_append_fstr(pinfo->cinfo, COL_INFO, " Type:[%s]", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); proto_item_append_text(data_tree, ": (%s)", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); offset += 2; } know_data = TRUE; } else if (type == S7COMM_UD_TYPE_RES) { if (tsize != S7COMM_DATA_TRANSPORT_SIZE_NULL) { count = dlength / 4; for (i = 0; i < count; i++) { /* Insert a new tree of 4 byte length for every item */ item = proto_tree_add_item(data_tree, hf_s7comm_data_item, tvb, offset, 4, ENC_NA); item_tree = proto_item_add_subtree(item, ett_s7comm_data_item); proto_item_append_text(item, " [%d]: (Block number %d)", i+1, tvb_get_ntohs(tvb, offset)); proto_tree_add_item(item_tree, hf_s7comm_ud_blockinfo_block_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* The first Byte is unknown, kind of flags? */ proto_tree_add_item(item_tree, hf_s7comm_ud_blockinfo_block_flags, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(item_tree, hf_s7comm_ud_blockinfo_block_lang, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } know_data = TRUE; } break; /************************************************* * Get block infos */ case S7COMM_UD_SUBF_BLOCK_BLOCKINFO: if (type == S7COMM_UD_TYPE_REQ) { if (tsize != S7COMM_DATA_TRANSPORT_SIZE_NULL) { gint32 num = -1; gboolean num_valid; /* 8 Bytes of Data follow, 1./ 2. type, 3-7 blocknumber as ascii number */ blocktype16 = tvb_get_ntohs(tvb, offset); itemadd = proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_block_type, tvb, offset, 2, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); offset += 2; proto_tree_add_item_ret_string(data_tree, hf_s7comm_ud_blockinfo_block_num_ascii, tvb, offset, 5, ENC_ASCII|ENC_NA, pinfo->pool, &pBlocknumber); num_valid = ws_strtoi32((const gchar*)pBlocknumber, NULL, &num); proto_item_append_text(data_tree, " [%s ", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); col_append_fstr(pinfo->cinfo, COL_INFO, " -> Block:[%s ", val_to_str(blocktype16, blocktype_names, "Unknown Block type: 0x%04x")); if (num_valid) { proto_item_append_text(data_tree, "%d]", num); col_append_fstr(pinfo->cinfo, COL_INFO, "%d]", num); } else { expert_add_info(pinfo, data_tree, &ei_s7comm_ud_blockinfo_block_num_ascii_invalid); proto_item_append_text(data_tree, "NaN]"); col_append_str(pinfo->cinfo, COL_INFO, "NaN]"); } offset += 5; itemadd = proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_filesys, tvb, offset, 1, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", char_val_to_str(tvb_get_guint8(tvb, offset), blocktype_attribute2_names, "Unknown filesys")); offset += 1; } know_data = TRUE; } else if (type == S7COMM_UD_TYPE_RES) { /* 78 Bytes */ if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK) { itemadd = proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_block_type, tvb, offset, 2, ENC_ASCII); proto_item_append_text(itemadd, " (%s)", val_to_str(tvb_get_ntohs(tvb, offset), blocktype_names, "Unknown Block type: 0x%04x")); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_res_infolength, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_res_unknown2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_res_const3, tvb, offset, 2, ENC_ASCII); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_res_unknown, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_bitmask(data_tree, tvb, offset, hf_s7comm_userdata_blockinfo_flags, ett_s7comm_userdata_blockinfo_flags, s7comm_userdata_blockinfo_flags_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_block_lang, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; blocktype = tvb_get_guint8(tvb, offset); proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_subblk_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; blocknumber = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(data_tree, hf_s7comm_ud_blockinfo_block_num, tvb, offset, 2, blocknumber); /* Add block type and number to info column */ col_append_fstr(pinfo->cinfo, COL_INFO, " -> Block:[%s %d]", val_to_str(blocktype, subblktype_names, "Unknown Subblk type: 0x%02x"), blocknumber); proto_item_append_text(data_tree, ": (Block:[%s %d])", val_to_str(blocktype, subblktype_names, "Unknown Subblk type: 0x%02x"), blocknumber); offset += 2; /* "Length Load mem" -> the length in Step7 Manager seems to be this length +6 bytes */ proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_load_mem_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_blocksecurity, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; s7comm_get_timestring_from_s7time(tvb, offset, str_timestamp, sizeof(str_timestamp)); proto_tree_add_string(data_tree, hf_s7comm_ud_blockinfo_code_timestamp, tvb, offset, 6, str_timestamp); offset += 6; s7comm_get_timestring_from_s7time(tvb, offset, str_timestamp, sizeof(str_timestamp)); proto_tree_add_string(data_tree, hf_s7comm_ud_blockinfo_interface_timestamp, tvb, offset, 6, str_timestamp); offset += 6; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_ssb_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_add_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_localdata_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_mc7_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_author, tvb, offset, 8, ENC_ASCII); offset += 8; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_family, tvb, offset, 8, ENC_ASCII); offset += 8; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_headername, tvb, offset, 8, ENC_ASCII); offset += 8; snprintf(str_version, sizeof(str_version), "%d.%d", ((tvb_get_guint8(tvb, offset) & 0xf0) >> 4), tvb_get_guint8(tvb, offset) & 0x0f); proto_tree_add_string(data_tree, hf_s7comm_ud_blockinfo_headerversion, tvb, offset, 1, str_version); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_res_unknown, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_checksum(data_tree, tvb, offset, hf_s7comm_ud_blockinfo_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 2; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_reserved1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_reserved2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } know_data = TRUE; } break; default: break; } if (know_data == FALSE && dlength > 0) { proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, dlength, ENC_NA); offset += dlength; } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 2 -> Read record * *******************************************************************************************************/ static guint32 s7comm_decode_ud_readrec(tvbuff_t *tvb, proto_tree *tree, guint8 type, guint32 offset) { guint32 ret_val; guint32 statuslen; guint32 reclen; guint8 item_count; if (type == S7COMM_UD_TYPE_REQ) { proto_tree_add_item(tree, hf_s7comm_rdrec_reserved1, tvb, offset, 1, ENC_NA); offset += 1; /* Although here is an item_count field, values above 1 aren't allowed or at least never seen */ item_count = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_s7comm_param_itemcount, tvb, offset, 1, item_count); offset += 1; if (item_count > 0) { offset = s7comm_decode_param_item(tvb, offset, tree, 0); } } else if (type == S7COMM_UD_TYPE_RES) { /* The item with data is used for optional status code similar to the * STATUS output of SFB52 RDREC used in Plc code. */ proto_tree_add_item(tree, hf_s7comm_rdrec_reserved1, tvb, offset, 1, ENC_NA); offset += 1; item_count = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_s7comm_param_itemcount, tvb, offset, 1, item_count); offset += 1; /* As all testsubjects have shown that no more than one item is allowed, * we decode only the first item here. */ if (item_count > 0) { proto_tree_add_item_ret_uint(tree, hf_s7comm_data_returncode, tvb, offset, 1, ENC_BIG_ENDIAN, &ret_val); offset += 1; if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK) { proto_tree_add_item(tree, hf_s7comm_data_transport_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } proto_tree_add_item_ret_uint(tree, hf_s7comm_rdrec_statuslen, tvb, offset, 1, ENC_BIG_ENDIAN, &statuslen); offset += 1; if (statuslen > 0) { proto_tree_add_item(tree, hf_s7comm_rdrec_statusdata, tvb, offset, statuslen, ENC_NA); offset += statuslen; } else { offset += 1; /* Fillbyte */ } if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK) { proto_tree_add_item_ret_uint(tree, hf_s7comm_rdrec_recordlen, tvb, offset, 2, ENC_BIG_ENDIAN, &reclen); offset += 2; if (reclen > 0) { proto_tree_add_item(tree, hf_s7comm_rdrec_data, tvb, offset, reclen, ENC_NA); offset += reclen; } } } } return offset; } /******************************************************************************************************* * * PDU Type: User Data -> Function group 2 -> cyclic services * *******************************************************************************************************/ static guint32 s7comm_decode_ud_cyclic_subfunc(tvbuff_t *tvb, packet_info *pinfo, guint8 seq_num, proto_tree *data_tree, guint8 type, guint8 subfunc, guint32 dlength, guint32 offset) { gboolean know_data = FALSE; guint32 offset_old; guint32 len_item; guint8 item_count; guint8 i; guint8 job_id; switch (subfunc) { case S7COMM_UD_SUBF_CYCLIC_CHANGE_MOD: if (type == S7COMM_UD_TYPE_REQ) { col_append_fstr(pinfo->cinfo, COL_INFO, " JobID=%d", seq_num); } /* fall through */ case S7COMM_UD_SUBF_CYCLIC_TRANSF: case S7COMM_UD_SUBF_CYCLIC_CHANGE: item_count = tvb_get_guint8(tvb, offset + 1); /* first byte reserved??? */ proto_tree_add_uint(data_tree, hf_s7comm_param_itemcount, tvb, offset, 2, item_count); offset += 2; if (type == S7COMM_UD_TYPE_REQ) { proto_tree_add_item(data_tree, hf_s7comm_cycl_interval_timebase, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_cycl_interval_time, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; for (i = 0; i < item_count; i++) { offset_old = offset; offset = s7comm_decode_param_item(tvb, offset, data_tree, i); /* if length is not a multiple of 2 and this is not the last item, then add a fill-byte */ len_item = offset - offset_old; if ((len_item % 2) && (i < (item_count-1))) { offset += 1; } } } else if (type == S7COMM_UD_TYPE_RES || type == S7COMM_UD_TYPE_IND) { col_append_fstr(pinfo->cinfo, COL_INFO, " JobID=%d", seq_num); offset = s7comm_decode_response_read_data(tvb, data_tree, item_count, offset); } know_data = TRUE; break; case S7COMM_UD_SUBF_CYCLIC_UNSUBSCRIBE: if (type == S7COMM_UD_TYPE_REQ) { proto_tree_add_item(data_tree, hf_s7comm_cycl_function, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_cycl_jobid, tvb, offset, 1, ENC_BIG_ENDIAN); job_id = tvb_get_guint8(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " JobID=%d", job_id); offset += 1; know_data = TRUE; } else if (type == S7COMM_UD_TYPE_RES) { col_append_fstr(pinfo->cinfo, COL_INFO, " JobID=%d", seq_num); } break; case S7COMM_UD_SUBF_CYCLIC_RDREC: offset = s7comm_decode_ud_readrec(tvb, data_tree, type, offset); know_data = TRUE; break; } if (know_data == FALSE && dlength > 0) { proto_tree_add_item(data_tree, hf_s7comm_userdata_data, tvb, offset, dlength, ENC_NA); offset += dlength; } return offset; } /******************************************************************************************************* * * PDU Type: User Data: Data part and reassembly * *******************************************************************************************************/ static guint32 s7comm_decode_ud_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 dlength, guint8 type, guint8 funcgroup, guint8 subfunc, guint8 seq_num, guint8 data_unit_ref, guint8 last_data_unit, guint32 offset, proto_tree *root_tree) { proto_item *item = NULL; proto_tree *data_tree = NULL; guint8 tsize; guint16 len; guint8 ret_val; guint32 length_rem = 0; gboolean save_fragmented; guint32 frag_id = 0; gboolean more_frags = FALSE; gboolean is_fragmented = FALSE; tvbuff_t* new_tvb = NULL; tvbuff_t* next_tvb = NULL; fragment_head *fd_head; gchar str_fragadd[32]; /* The first 4 bytes of the data part of a userdata telegram are the same for all types. * This is also the minumum length of the data part. */ if (dlength >= 4) { item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); ret_val = tvb_get_guint8(tvb, offset); proto_tree_add_uint(data_tree, hf_s7comm_data_returncode, tvb, offset, 1, ret_val); offset += 1; /* Not definitely known part, kind of "transport size"? constant 0x09, 1 byte * The position is the same as in a data response/write telegram, */ tsize = tvb_get_guint8(tvb, offset); proto_tree_add_uint(data_tree, hf_s7comm_data_transport_size, tvb, offset, 1, tsize); offset += 1; len = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(data_tree, hf_s7comm_data_length, tvb, offset, 2, len); offset += 2; if (len >= 2) { more_frags = (last_data_unit == S7COMM_UD_LASTDATAUNIT_NO); /* Some packets have an additional header before the payload, which must be * extracted from the data before reassembly. */ switch (funcgroup) { case S7COMM_UD_FUNCGROUP_NCPRG: offset = s7comm_decode_ud_ncprg_pre_reass(tvb, data_tree, type, subfunc, &len, offset); /* Unfortunately on NC programming the first PDU is always shown as reassembled also when not fragmented, * because data_unit_ref may overflow and start again at 0 on big file transfers. */ is_fragmented = TRUE; frag_id = seq_num; break; case S7COMM_UD_FUNCGROUP_PBC_BSEND: /* The R_ID is used for fragment identification */ offset = s7comm_decode_ud_pbc_bsend_pre_reass(tvb, pinfo, data_tree, type, &len, &frag_id, offset); is_fragmented = data_unit_ref > 0 || seq_num > 0; break; case S7COMM_UD_FUNCGROUP_CPU: if (subfunc == S7COMM_UD_SUBF_CPU_AR_SEND_IND) { offset = s7comm_decode_ud_cpu_ar_send_pre_reass(tvb, pinfo, data_tree, &len, offset); } /* fragment identification is always the same here */ is_fragmented = (data_unit_ref > 0); frag_id = data_unit_ref; break; default: is_fragmented = (data_unit_ref > 0); frag_id = data_unit_ref; break; } /* Reassembly of fragmented data part */ save_fragmented = pinfo->fragmented; if (is_fragmented) { /* fragmented */ pinfo->fragmented = TRUE; /* NC programming uses a different method of fragment indication. The sequence number is used as reference-id, * the data unit reference number is increased with every packet, as the sender does not need to wait for * the acknowledge of the packet. Also different in NC programming is, that also when a packet is not * fragmented, data_unit_ref is > 0 and "reassembled" would be displayed even when not fragmented (count number of fragments?) * Using fragment number does not work here, as it's only one byte. And if there are more than 255 fragments this would fail. */ fd_head = fragment_add_seq_next(&s7comm_reassembly_table, tvb, offset, pinfo, frag_id, /* ID for fragments belonging together */ NULL, /* void *data */ len, /* fragment length - to the end */ more_frags); /* More fragments? */ snprintf(str_fragadd, sizeof(str_fragadd), " id=%d", frag_id); new_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled S7COMM", fd_head, &s7comm_frag_items, NULL, tree); if (new_tvb) { /* take it all */ /* add reassembly info only when there's more than one fragment */ if (fd_head && fd_head->next) { col_append_fstr(pinfo->cinfo, COL_INFO, " (S7COMM reassembled%s)", str_fragadd); proto_item_append_text(data_tree, " (S7COMM reassembled%s)", str_fragadd); } next_tvb = new_tvb; offset = 0; } else { /* make a new subset */ next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, -1); col_append_fstr(pinfo->cinfo, COL_INFO, " (S7COMM fragment%s)", str_fragadd); proto_item_append_text(data_tree, " (S7COMM fragment%s)", str_fragadd); offset = 0; } } else { /* Not fragmented */ next_tvb = tvb; } pinfo->fragmented = save_fragmented; length_rem = tvb_reported_length_remaining(next_tvb, offset); if (last_data_unit == S7COMM_UD_LASTDATAUNIT_YES && length_rem > 0) { switch (funcgroup) { case S7COMM_UD_FUNCGROUP_TIS: offset = s7comm_decode_ud_tis_subfunc(next_tvb, data_tree, type, subfunc, offset); break; case S7COMM_UD_FUNCGROUP_CYCLIC: offset = s7comm_decode_ud_cyclic_subfunc(next_tvb, pinfo, seq_num, data_tree, type, subfunc, length_rem, offset); break; case S7COMM_UD_FUNCGROUP_BLOCK: offset = s7comm_decode_ud_block_subfunc(next_tvb, pinfo, data_tree, type, subfunc, ret_val, tsize, length_rem, offset); break; case S7COMM_UD_FUNCGROUP_CPU: switch (subfunc) { case S7COMM_UD_SUBF_CPU_READSZL: offset = s7comm_decode_ud_cpu_szl_subfunc(next_tvb, pinfo, data_tree, type, ret_val, length_rem, offset); break; case S7COMM_UD_SUBF_CPU_NOTIFY_IND: case S7COMM_UD_SUBF_CPU_NOTIFY8_IND: case S7COMM_UD_SUBF_CPU_ALARMSQ_IND: case S7COMM_UD_SUBF_CPU_ALARMS_IND: case S7COMM_UD_SUBF_CPU_SCAN_IND: case S7COMM_UD_SUBF_CPU_ALARMACK: case S7COMM_UD_SUBF_CPU_ALARMACK_IND: case S7COMM_UD_SUBF_CPU_ALARM8_IND: case S7COMM_UD_SUBF_CPU_ALARM8LOCK: case S7COMM_UD_SUBF_CPU_ALARM8LOCK_IND: case S7COMM_UD_SUBF_CPU_ALARM8UNLOCK: case S7COMM_UD_SUBF_CPU_ALARM8UNLOCK_IND: offset = s7comm_decode_ud_cpu_alarm_main(next_tvb, pinfo, data_tree, type, subfunc, offset); break; case S7COMM_UD_SUBF_CPU_ALARMQUERY: if (type == S7COMM_UD_TYPE_RES) { offset = s7comm_decode_ud_cpu_alarm_query_response(next_tvb, data_tree, offset); } else { offset = s7comm_decode_ud_cpu_alarm_main(next_tvb, pinfo, data_tree, type, subfunc, offset); } break; case S7COMM_UD_SUBF_CPU_DIAGMSG: offset = s7comm_decode_ud_cpu_diagnostic_message(next_tvb, pinfo, TRUE, data_tree, offset); break; case S7COMM_UD_SUBF_CPU_MSGS: offset = s7comm_decode_message_service(next_tvb, pinfo, data_tree, type, length_rem, offset); break; case S7COMM_UD_SUBF_CPU_AR_SEND_IND: offset = s7comm_decode_ud_cpu_ar_send(next_tvb, data_tree, offset); break; default: /* print other currently unknown data as raw bytes */ proto_tree_add_item(data_tree, hf_s7comm_userdata_data, next_tvb, offset, length_rem, ENC_NA); break; } break; case S7COMM_UD_FUNCGROUP_SEC: offset = s7comm_decode_ud_security_subfunc(next_tvb, data_tree, length_rem, offset); break; case S7COMM_UD_FUNCGROUP_PBC_BSEND: offset = s7comm_decode_ud_pbc_bsend_subfunc(next_tvb, data_tree, length_rem, offset, pinfo, root_tree); break; case S7COMM_UD_FUNCGROUP_TIME: offset = s7comm_decode_ud_time_subfunc(next_tvb, data_tree, type, subfunc, ret_val, length_rem, offset); break; case S7COMM_UD_FUNCGROUP_NCPRG: offset = s7comm_decode_ud_ncprg_subfunc(next_tvb, pinfo, data_tree, type, subfunc, length_rem, offset); break; case S7COMM_UD_FUNCGROUP_DRR: offset = s7comm_decode_ud_drr_subfunc(next_tvb, data_tree, length_rem, offset); break; default: break; } } } } return offset; } /******************************************************************************************************* ******************************************************************************************************* * * PDU Type: User Data * ******************************************************************************************************* *******************************************************************************************************/ static guint32 s7comm_decode_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 plength, guint16 dlength, guint32 offset, proto_tree *root_tree) { proto_item *item = NULL; proto_tree *param_tree = NULL; guint32 errorcode; guint32 offset_temp; guint8 function; guint8 type; guint8 funcgroup; guint8 subfunc; guint8 mode; guint8 data_unit_ref = 0; guint8 last_data_unit = 0; guint8 seq_num; guint32 r_id; guint8 varspec_syntax_id = 0; /* Add parameter tree */ item = proto_tree_add_item(tree, hf_s7comm_param, tvb, offset, plength, ENC_NA); param_tree = proto_item_add_subtree(item, ett_s7comm_param); offset_temp = offset; function = tvb_get_guint8(tvb, offset_temp); proto_tree_add_uint(param_tree, hf_s7comm_param_service, tvb, offset_temp, 1, function); offset_temp += 1; /* It's like an itemcounter, but only the value of 1 is allowed. */ proto_tree_add_item(param_tree, hf_s7comm_param_itemcount, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; if (function == S7COMM_SERV_MODETRANS) { /* Mode transition indication needs a separate handling */ proto_item_append_text(param_tree, ": ->(Mode transition indication)"); col_append_fstr(pinfo->cinfo, COL_INFO, " Function:[Mode transition indication]"); proto_tree_add_item(param_tree, hf_s7comm_modetrans_param_unknown1, tvb, offset_temp, 4, ENC_BIG_ENDIAN); offset_temp += 4; mode = tvb_get_guint8(tvb, offset_temp); proto_tree_add_uint(param_tree, hf_s7comm_modetrans_param_mode, tvb, offset_temp, 1, mode); offset_temp += 1; col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(mode, modetrans_param_mode_names, "Unknown mode: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(mode, modetrans_param_mode_names, "Unknown mode: 0x%02x")); proto_tree_add_item(param_tree, hf_s7comm_modetrans_param_unknown2, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; /* No data part here */ return offset_temp; } proto_tree_add_item(param_tree, hf_s7comm_item_varspec, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; proto_tree_add_item(param_tree, hf_s7comm_item_varspec_length, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; varspec_syntax_id = tvb_get_guint8(tvb, offset_temp); proto_tree_add_item(param_tree, hf_s7comm_item_syntax_id, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; if (varspec_syntax_id == S7COMM_SYNTAXID_PBC_ID) { /* When the R_ID occurs here, it's USEND and needs a separate handling */ proto_item_append_text(param_tree, ": (Indication) ->(USEND)"); col_append_fstr(pinfo->cinfo, COL_INFO, " Function:[Indication] -> [USEND]"); proto_tree_add_item(param_tree, hf_s7comm_pbc_unknown, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; proto_tree_add_item_ret_uint(param_tree, hf_s7comm_pbc_usend_r_id, tvb, offset_temp, 4, ENC_BIG_ENDIAN, &r_id); col_append_fstr(pinfo->cinfo, COL_INFO, " R_ID=0x%X", r_id); /* USEND data must fit in a single PDU. Fragmentation is not possible and we can dissect the data part here. */ offset += plength; /* To start of data part */ offset = s7comm_decode_ud_usend(tvb, tree, dlength, offset); /* Return here as all data is decoded */ return offset; } /* Left 2 bits for indication/request/response * Right 6 bits for the function group */ type = (tvb_get_guint8(tvb, offset_temp) & 0xc0) >> 6; funcgroup = (tvb_get_guint8(tvb, offset_temp) & 0x3f); proto_tree_add_item(param_tree, hf_s7comm_userdata_param_type, tvb, offset_temp, 1, ENC_BIG_ENDIAN); proto_tree_add_item(param_tree, hf_s7comm_userdata_param_funcgroup, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; col_append_fstr(pinfo->cinfo, COL_INFO, " Function:[%s] -> [%s]", val_to_str(type, userdata_type_names, "Unknown type: 0x%02x"), val_to_str(funcgroup, userdata_functiongroup_names, "Unknown function group: 0x%02x") ); proto_item_append_text(param_tree, ": (%s)", val_to_str(type, userdata_type_names, "Unknown type: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(funcgroup, userdata_functiongroup_names, "Unknown function group: 0x%02x")); /* 1 Byte subfunction */ subfunc = tvb_get_guint8(tvb, offset_temp); switch (funcgroup) { case S7COMM_UD_FUNCGROUP_TIS: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_prog, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_tis_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_tis_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_CYCLIC: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_cyclic, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_cyclic_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_cyclic_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_BLOCK: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_block, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_block_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_block_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_CPU: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_cpu, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_cpu_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_cpu_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_SEC: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_sec, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_sec_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_sec_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_TIME: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_time, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_time_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_time_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_DRR: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_drr, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_drr_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_drr_subfunc_names, "Unknown subfunc: 0x%02x")); break; case S7COMM_UD_FUNCGROUP_NCPRG: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc_ncprg, tvb, offset_temp, 1, subfunc); col_append_fstr(pinfo->cinfo, COL_INFO, " -> [%s]", val_to_str(subfunc, userdata_ncprg_subfunc_names, "Unknown subfunc: 0x%02x")); proto_item_append_text(param_tree, " ->(%s)", val_to_str(subfunc, userdata_ncprg_subfunc_names, "Unknown subfunc: 0x%02x")); break; default: proto_tree_add_uint(param_tree, hf_s7comm_userdata_param_subfunc, tvb, offset_temp, 1, subfunc); break; } offset_temp += 1; /* 1 Byte sequence number */ seq_num = tvb_get_guint8(tvb, offset_temp); proto_tree_add_item(param_tree, hf_s7comm_userdata_param_seq_num, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; if (varspec_syntax_id == S7COMM_SYNTAXID_EXT) { /* 1 Byte data unit reference. If packet is fragmented, all packets with this number belong together. * But there are function which use a different fragment identification methon. */ data_unit_ref = tvb_get_guint8(tvb, offset_temp); proto_tree_add_item(param_tree, hf_s7comm_userdata_param_dataunitref, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; /* 1 Byte fragmented flag, if this is not the last data unit (telegram is fragmented) this is != 0 */ last_data_unit = tvb_get_guint8(tvb, offset_temp); proto_tree_add_item(param_tree, hf_s7comm_userdata_param_dataunit, tvb, offset_temp, 1, ENC_BIG_ENDIAN); offset_temp += 1; proto_tree_add_item_ret_uint(param_tree, hf_s7comm_param_errcod, tvb, offset_temp, 2, ENC_BIG_ENDIAN, &errorcode); if (errorcode > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " -> Errorcode:[0x%04x]", errorcode); } } offset += plength; offset = s7comm_decode_ud_data(tvb, pinfo, tree, dlength, type, funcgroup, subfunc, seq_num, data_unit_ref, last_data_unit, offset, root_tree); return offset; } /******************************************************************************************************* * * PDU Type: Request or Response * *******************************************************************************************************/ static guint32 s7comm_decode_req_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 plength, guint16 dlength, guint32 offset, guint8 rosctr) { proto_item *item = NULL; proto_tree *param_tree = NULL; proto_tree *data_tree = NULL; guint8 function = 0; guint8 item_count = 0; guint8 i; guint32 offset_old; guint32 len; if (plength > 0) { /* Add parameter tree */ item = proto_tree_add_item(tree, hf_s7comm_param, tvb, offset, plength, ENC_NA); param_tree = proto_item_add_subtree(item, ett_s7comm_param); /* Analyze function */ function = tvb_get_guint8(tvb, offset); /* add param.function to info column */ col_append_fstr(pinfo->cinfo, COL_INFO, " Function:[%s]", val_to_str(function, param_functionnames, "Unknown function: 0x%02x")); proto_tree_add_uint(param_tree, hf_s7comm_param_service, tvb, offset, 1, function); /* show param.function code at the tree */ proto_item_append_text(param_tree, ": (%s)", val_to_str(function, param_functionnames, "Unknown function: 0x%02x")); offset += 1; if (rosctr == S7COMM_ROSCTR_JOB) { switch (function){ case S7COMM_SERV_READVAR: case S7COMM_SERV_WRITEVAR: item_count = tvb_get_guint8(tvb, offset); proto_tree_add_uint(param_tree, hf_s7comm_param_itemcount, tvb, offset, 1, item_count); offset += 1; /* parse item data */ for (i = 0; i < item_count; i++) { offset_old = offset; offset = s7comm_decode_param_item(tvb, offset, param_tree, i); /* if length is not a multiple of 2 and this is not the last item, then add a fill-byte */ len = offset - offset_old; if ((len % 2) && (i < (item_count-1))) { offset += 1; } } /* in write-function there is a data part */ if ((function == S7COMM_SERV_WRITEVAR) && (dlength > 0)) { item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); /* Add returned data to data-tree */ offset = s7comm_decode_response_read_data(tvb, data_tree, item_count, offset); } break; case S7COMM_SERV_SETUPCOMM: offset = s7comm_decode_pdu_setup_communication(tvb, param_tree, offset); break; /* Special functions */ case S7COMM_FUNCREQUESTDOWNLOAD: case S7COMM_FUNCDOWNLOADBLOCK: case S7COMM_FUNCDOWNLOADENDED: case S7COMM_FUNCSTARTUPLOAD: case S7COMM_FUNCUPLOAD: case S7COMM_FUNCENDUPLOAD: offset = s7comm_decode_plc_controls_updownload(tvb, pinfo, tree, param_tree, plength, dlength, offset -1, rosctr); break; case S7COMM_FUNCPISERVICE: offset = s7comm_decode_pi_service(tvb, pinfo, param_tree, plength, offset -1); break; case S7COMM_FUNC_PLC_STOP: offset = s7comm_decode_plc_controls_param_hex29(tvb, param_tree, offset -1); break; default: /* Print unknown part as raw bytes */ if (plength > 1) { proto_tree_add_item(param_tree, hf_s7comm_param_data, tvb, offset, plength - 1, ENC_NA); } offset += plength - 1; /* 1 byte function code */ if (dlength > 0) { /* Add data tree * First 2 bytes in data seem to be a length indicator of (dlength -4 ), so next 2 bytes * seem to indicate something else. But I'm not sure, so leave it as it is..... */ item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); proto_tree_add_item(data_tree, hf_s7comm_readresponse_data, tvb, offset, dlength, ENC_NA); offset += dlength; } break; } } else if (rosctr == S7COMM_ROSCTR_ACK_DATA) { switch (function){ case S7COMM_SERV_READVAR: case S7COMM_SERV_WRITEVAR: /* This is a read-response, so the requested data may follow when address in request was ok */ item_count = tvb_get_guint8(tvb, offset); proto_tree_add_uint(param_tree, hf_s7comm_param_itemcount, tvb, offset, 1, item_count); offset += 1; /* Add data tree */ item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); /* Add returned data to data-tree */ if ((function == S7COMM_SERV_READVAR) && (dlength > 0)) { offset = s7comm_decode_response_read_data(tvb, data_tree, item_count, offset); } else if ((function == S7COMM_SERV_WRITEVAR) && (dlength > 0)) { offset = s7comm_decode_response_write_data(tvb, data_tree, item_count, offset); } break; case S7COMM_SERV_SETUPCOMM: offset = s7comm_decode_pdu_setup_communication(tvb, param_tree, offset); break; case S7COMM_FUNCREQUESTDOWNLOAD: case S7COMM_FUNCDOWNLOADBLOCK: case S7COMM_FUNCDOWNLOADENDED: case S7COMM_FUNCSTARTUPLOAD: case S7COMM_FUNCUPLOAD: case S7COMM_FUNCENDUPLOAD: offset = s7comm_decode_plc_controls_updownload(tvb, pinfo, tree, param_tree, plength, dlength, offset -1, rosctr); break; case S7COMM_FUNCPISERVICE: if (plength >= 2) { proto_tree_add_bitmask(param_tree, tvb, offset, hf_s7comm_data_blockcontrol_functionstatus, ett_s7comm_data_blockcontrol_status, s7comm_data_blockcontrol_status_fields, ENC_BIG_ENDIAN); offset += 1; } break; default: /* Print unknown part as raw bytes */ if (plength > 1) { proto_tree_add_item(param_tree, hf_s7comm_param_data, tvb, offset, plength - 1, ENC_NA); } offset += plength - 1; /* 1 byte function code */ if (dlength > 0) { /* Add data tree * First 2 bytes in data seem to be a length indicator of (dlength -4 ), so next 2 bytes * seem to indicate something else. But I'm not sure, so leave it as it is..... */ item = proto_tree_add_item(tree, hf_s7comm_data, tvb, offset, dlength, ENC_NA); data_tree = proto_item_add_subtree(item, ett_s7comm_data); proto_tree_add_item(data_tree, hf_s7comm_readresponse_data, tvb, offset, dlength, ENC_NA); offset += dlength; } break; } } } return offset; } /******************************************************************************************************* ******************************************************************************************************* * * S7-Protocol (main tree) * ******************************************************************************************************* *******************************************************************************************************/ static gboolean dissect_s7comm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *s7comm_item = NULL; proto_item *s7comm_sub_item = NULL; proto_tree *s7comm_tree = NULL; proto_tree *s7comm_header_tree = NULL; guint32 offset = 0; guint8 rosctr = 0; guint8 hlength = 10; /* Header 10 Bytes, when type 2 or 3 (Response) -> 12 Bytes */ guint16 plength = 0; guint16 dlength = 0; guint16 errorcode = 0; /*----------------- Heuristic Checks - Begin */ /* 1) check for minimum length */ if(tvb_captured_length(tvb) < S7COMM_MIN_TELEGRAM_LENGTH) return FALSE; /* 2) first byte must be 0x32 */ if (tvb_get_guint8(tvb, 0) != S7COMM_PROT_ID) return FALSE; /* 3) second byte is a type field and only can contain values between 0x01-0x07 (1/2/3/7) */ if (tvb_get_guint8(tvb, 1) < 0x01 || tvb_get_guint8(tvb, 1) > 0x07) return FALSE; /*----------------- Heuristic Checks - End */ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_S7COMM); col_clear(pinfo->cinfo, COL_INFO); col_append_sep_str(pinfo->cinfo, COL_INFO, " | ", ""); rosctr = tvb_get_guint8(tvb, 1); /* Get the type byte */ if (rosctr == 2 || rosctr == 3) hlength = 12; /* Header 10 Bytes, when type 2 or 3 (response) -> 12 Bytes */ /* display some infos in info-column of wireshark */ col_append_fstr(pinfo->cinfo, COL_INFO, "ROSCTR:[%-8s]", val_to_str(rosctr, rosctr_names, "Unknown: 0x%02x")); s7comm_item = proto_tree_add_item(tree, proto_s7comm, tvb, 0, -1, ENC_NA); s7comm_tree = proto_item_add_subtree(s7comm_item, ett_s7comm); /* insert header tree */ s7comm_sub_item = proto_tree_add_item(s7comm_tree, hf_s7comm_header, tvb, offset, hlength, ENC_NA); /* insert sub-items in header tree */ s7comm_header_tree = proto_item_add_subtree(s7comm_sub_item, ett_s7comm_header); /* Protocol Identifier, constant 0x32 */ proto_tree_add_item(s7comm_header_tree, hf_s7comm_header_protid, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* ROSCTR (Remote Operating Service Control) - PDU Type */ proto_tree_add_uint(s7comm_header_tree, hf_s7comm_header_rosctr, tvb, offset, 1, rosctr); /* Show pdu type beside the header tree */ proto_item_append_text(s7comm_header_tree, ": (%s)", val_to_str(rosctr, rosctr_names, "Unknown ROSCTR: 0x%02x")); offset += 1; /* Redundancy ID, reserved */ proto_tree_add_item(s7comm_header_tree, hf_s7comm_header_redid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Protocol Data Unit Reference */ proto_tree_add_item(s7comm_header_tree, hf_s7comm_header_pduref, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Parameter length */ plength = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(s7comm_header_tree, hf_s7comm_header_parlg, tvb, offset, 2, plength); offset += 2; /* Data length */ dlength = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(s7comm_header_tree, hf_s7comm_header_datlg, tvb, offset, 2, dlength); offset += 2; /* when type is 2 or 3 there are 2 bytes with errorclass and errorcode */ if (hlength == 12) { errorcode = tvb_get_ntohs(tvb, offset); /* this uses the same errorcodes (combined) from parameter part */ proto_tree_add_item(s7comm_header_tree, hf_s7comm_header_errcls, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(s7comm_header_tree, hf_s7comm_header_errcod, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* when there is an error, use the errorcode from parameterpart*/ if (errorcode > 0) { s7comm_item = proto_tree_add_item(s7comm_header_tree, hf_s7comm_param_errcod, tvb, offset-2, 2, ENC_BIG_ENDIAN); proto_item_set_generated (s7comm_item); } } switch (rosctr) { case S7COMM_ROSCTR_JOB: case S7COMM_ROSCTR_ACK_DATA: s7comm_decode_req_resp(tvb, pinfo, s7comm_tree, plength, dlength, offset, rosctr); break; case S7COMM_ROSCTR_USERDATA: s7comm_decode_ud(tvb, pinfo, s7comm_tree, plength, dlength, offset, tree); break; } /* Add the errorcode from header as last entry in info column */ if (errorcode > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " -> Errorcode:[0x%04x]", errorcode); } /* set fence as there may be more than one S7comm PDU in one frame */ col_set_fence(pinfo->cinfo, COL_INFO); return TRUE; } /******************************************************************************************************* * Reassembly of S7COMM *******************************************************************************************************/ static void s7comm_defragment_init(void) { reassembly_table_init(&s7comm_reassembly_table, &addresses_ports_reassembly_table_functions); } /******************************************************************************************************* *******************************************************************************************************/ void proto_register_s7comm (void) { expert_module_t* expert_s7comm; /* format: * {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}. */ static hf_register_info hf[] = { { &hf_s7comm_header, { "Header", "s7comm.header", FT_NONE, BASE_NONE, NULL, 0x0, "This is the header of S7 communication", HFILL }}, { &hf_s7comm_header_protid, { "Protocol Id", "s7comm.header.protid", FT_UINT8, BASE_HEX, NULL, 0x0, "Protocol Identification, 0x32 for S7", HFILL }}, { &hf_s7comm_header_rosctr, { "ROSCTR", "s7comm.header.rosctr", FT_UINT8, BASE_DEC, VALS(rosctr_names), 0x0, "Remote Operating Service Control", HFILL }}, { &hf_s7comm_header_redid, { "Redundancy Identification (Reserved)", "s7comm.header.redid", FT_UINT16, BASE_HEX, NULL, 0x0, "Redundancy Identification (Reserved), should be always 0x0000", HFILL }}, { &hf_s7comm_header_pduref, { "Protocol Data Unit Reference", "s7comm.header.pduref", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_header_parlg, { "Parameter length", "s7comm.header.parlg", FT_UINT16, BASE_DEC, NULL, 0x0, "Specifies the entire length of the parameter block in bytes", HFILL }}, { &hf_s7comm_header_datlg, { "Data length", "s7comm.header.datlg", FT_UINT16, BASE_DEC, NULL, 0x0, "Specifies the entire length of the data block in bytes", HFILL }}, { &hf_s7comm_header_errcls, { "Error class", "s7comm.header.errcls", FT_UINT8, BASE_HEX, VALS(errcls_names), 0x0, NULL, HFILL }}, { &hf_s7comm_header_errcod, { "Error code", "s7comm.header.errcod", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_param, { "Parameter", "s7comm.param", FT_NONE, BASE_NONE, NULL, 0x0, "This is the parameter part of S7 communication", HFILL }}, { &hf_s7comm_param_errcod, { "Error code", "s7comm.param.errcod", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &param_errcode_names_ext, 0x0, NULL, HFILL }}, { &hf_s7comm_param_service, { "Function", "s7comm.param.func", FT_UINT8, BASE_HEX, VALS(param_functionnames), 0x0, "Indicates the function of parameter/data", HFILL }}, { &hf_s7comm_param_maxamq_calling, { "Max AmQ (parallel jobs with ack) calling", "s7comm.param.maxamq_calling", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_param_maxamq_called, { "Max AmQ (parallel jobs with ack) called", "s7comm.param.maxamq_called", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_param_setup_reserved1, { "Reserved", "s7comm.param.setup_reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_param_neg_pdu_length, { "PDU length", "s7comm.param.pdu_length", FT_UINT16, BASE_DEC, NULL, 0x0, "Negotiated PDU length", HFILL }}, { &hf_s7comm_param_itemcount, { "Item count", "s7comm.param.itemcount", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of Items in parameter/data part", HFILL }}, { &hf_s7comm_param_data, { "Parameter data", "s7comm.param.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_param_item, { "Item", "s7comm.param.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_param_subitem, { "Subitem", "s7comm.param.subitem", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_varspec, { "Variable specification", "s7comm.param.item.varspec", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_varspec_length, { "Length of following address specification", "s7comm.param.item.varspec_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_syntax_id, { "Syntax Id", "s7comm.param.item.syntaxid", FT_UINT8, BASE_HEX, VALS(item_syntaxid_names), 0x0, "Syntax Id, format type of following address specification", HFILL }}, { &hf_s7comm_item_transport_size, { "Transport size", "s7comm.param.item.transp_size", FT_UINT8, BASE_DEC, VALS(item_transportsizenames), 0x0, NULL, HFILL }}, { &hf_s7comm_item_length, { "Length", "s7comm.param.item.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_db, { "DB number", "s7comm.param.item.db", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_area, { "Area", "s7comm.param.item.area", FT_UINT8, BASE_HEX, VALS(item_areanames), 0x0, NULL, HFILL }}, { &hf_s7comm_item_address, { "Address", "s7comm.param.item.address", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_address_byte, { "Byte Address", "s7comm.param.item.address.byte", FT_UINT24, BASE_DEC, NULL, 0x07fff8, NULL, HFILL }}, { &hf_s7comm_item_address_bit, { "Bit Address", "s7comm.param.item.address.bit", FT_UINT24, BASE_DEC, NULL, 0x000007, NULL, HFILL }}, { &hf_s7comm_item_address_nr, { "Number (T/C/BLOCK)", "s7comm.param.item.address.number", FT_UINT24, BASE_DEC, NULL, 0x00ffff, NULL, HFILL }}, /* Special variable read with Syntax-Id 0xb0 (DBREAD) */ { &hf_s7comm_item_dbread_numareas, { "Number of areas", "s7comm.param.item.dbread.numareas", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of area specifications following", HFILL }}, { &hf_s7comm_item_dbread_length, { "Bytes to read", "s7comm.param.item.dbread.length", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of bytes to read", HFILL }}, { &hf_s7comm_item_dbread_db, { "DB number", "s7comm.param.item.dbread.db", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_dbread_startadr, { "Start address", "s7comm.param.item.dbread.startaddress", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* Reading frequency inverter parameters via routing */ { &hf_s7comm_item_driveesany_unknown1, { "DriveES Unknown 1", "s7comm.param.item.driveesany.unknown1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_driveesany_unknown2, { "DriveES Unknown 2", "s7comm.param.item.driveesany.unknown2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_driveesany_unknown3, { "DriveES Unknown 3", "s7comm.param.item.driveesany.unknown3", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_driveesany_parameter_nr, { "DriveES Parameter number", "s7comm.param.item.driveesany.parameternr", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_driveesany_parameter_idx, { "DriveES Parameter index", "s7comm.param.item.driveesany.parameteridx", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* NCK access with Syntax-Id 0x82 */ { &hf_s7comm_item_nck_areaunit, { "NCK Area/Unit", "s7comm.param.item.nck.area_unit", FT_UINT8, BASE_HEX, NULL, 0x0, "NCK Area/Unit: Bitmask aaauuuuu: a=area, u=unit", HFILL }}, { &hf_s7comm_item_nck_area, { "NCK Area", "s7comm.param.item.nck.area", FT_UINT8, BASE_DEC, VALS(nck_area_names), 0xe0, NULL, HFILL }}, { &hf_s7comm_item_nck_unit, { "NCK Unit", "s7comm.param.item.nck.unit", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }}, { &hf_s7comm_item_nck_column, { "NCK Column number", "s7comm.param.item.nck.column", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_nck_line, { "NCK Line number", "s7comm.param.item.nck.line", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_item_nck_module, { "NCK Module", "s7comm.param.item.nck.module", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &nck_module_names_ext, 0x0, NULL, HFILL }}, { &hf_s7comm_item_nck_linecount, { "NCK Linecount", "s7comm.param.item.nck.linecount", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data, { "Data", "s7comm.data", FT_NONE, BASE_NONE, NULL, 0x0, "This is the data part of S7 communication", HFILL }}, { &hf_s7comm_data_returncode, { "Return code", "s7comm.data.returncode", FT_UINT8, BASE_HEX, VALS(s7comm_item_return_valuenames), 0x0, NULL, HFILL }}, { &hf_s7comm_data_transport_size, { "Transport size", "s7comm.data.transportsize", FT_UINT8, BASE_HEX, VALS(data_transportsizenames), 0x0, "Data type / Transport size. If 3, 4 or 5 the following length gives the number of bits, otherwise the number of bytes.", HFILL }}, { &hf_s7comm_data_length, { "Length", "s7comm.data.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of data", HFILL }}, { &hf_s7comm_data_item, { "Item", "s7comm.data.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_readresponse_data, { "Data", "s7comm.resp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_fillbyte, { "Fill byte", "s7comm.data.fillbyte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_data, { "Data", "s7comm.data.userdata", FT_BYTES, BASE_NONE, NULL, 0x0, "Userdata data", HFILL }}, /* Userdata parameter 8/12 Bytes len*/ { &hf_s7comm_userdata_param_type, { "Type", "s7comm.param.userdata.type", FT_UINT8, BASE_DEC, VALS(userdata_type_names), 0xc0, "Type of parameter", HFILL }}, { &hf_s7comm_userdata_param_funcgroup, { "Function group", "s7comm.param.userdata.funcgroup", FT_UINT8, BASE_DEC, VALS(userdata_functiongroup_names), 0x3f, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_prog, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_tis_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_cyclic, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_cyclic_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_block, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_block_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_cpu, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_cpu_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_sec, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_sec_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_time, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_time_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_ncprg, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_ncprg_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_subfunc_drr, { "Subfunction", "s7comm.param.userdata.subfunc", FT_UINT8, BASE_DEC, VALS(userdata_drr_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_seq_num, { "Sequence number", "s7comm.param.userdata.seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_param_dataunitref, { "Data unit reference number", "s7comm.param.userdata.dataunitref", FT_UINT8, BASE_DEC, NULL, 0x0, "Data unit reference number if PDU is fragmented", HFILL }}, { &hf_s7comm_userdata_param_dataunit, { "Last data unit", "s7comm.param.userdata.lastdataunit", FT_UINT8, BASE_HEX, VALS(userdata_lastdataunit_names), 0x0, NULL, HFILL }}, /* block functions / info */ { &hf_s7comm_ud_blockinfo_block_type, { "Block type", "s7comm.blockinfo.blocktype", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_block_cnt, { "Block count", "s7comm.blockinfo.block_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_block_num, { "Block number", "s7comm.blockinfo.block_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_block_flags, { "Block flags (unknown)", "s7comm.blockinfo.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_block_lang, { "Block language", "s7comm.blockinfo.block_lang", FT_UINT8, BASE_DEC, VALS(blocklanguage_names), 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_block_num_ascii, { "Block number", "s7comm.data.blockinfo.block_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_filesys, { "Filesystem", "s7comm.data.blockinfo.filesys", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_res_infolength, { "Length of Info", "s7comm.blockinfo.res_infolength", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of Info in bytes", HFILL }}, { &hf_s7comm_ud_blockinfo_res_unknown2, { "Unknown blockinfo 2", "s7comm.blockinfo.res_unknown2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_res_const3, { "Constant 3", "s7comm.blockinfo.res_const3", FT_STRING, BASE_NONE, NULL, 0x0, "Possible constant 3, seems to be always 'pp'", HFILL }}, { &hf_s7comm_ud_blockinfo_res_unknown, { "Unknown byte(s) blockinfo", "s7comm.blockinfo.res_unknown", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_subblk_type, { "Subblk type", "s7comm.blockinfo.subblk_type", FT_UINT8, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_load_mem_len, { "Length load memory", "s7comm.blockinfo.load_mem_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of load memory in bytes", HFILL }}, { &hf_s7comm_ud_blockinfo_blocksecurity, { "Block Security", "s7comm.blockinfo.blocksecurity", FT_UINT32, BASE_DEC, VALS(blocksecurity_names), 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_interface_timestamp, { "Interface timestamp", "s7comm.blockinfo.interface_timestamp", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_code_timestamp, { "Code timestamp", "s7comm.blockinfo.code_timestamp", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_ssb_len, { "SSB length", "s7comm.blockinfo.ssb_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_add_len, { "ADD length", "s7comm.blockinfo.add_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_localdata_len, { "Localdata length", "s7comm.blockinfo.localdata_len", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of localdata in bytes", HFILL }}, { &hf_s7comm_ud_blockinfo_mc7_len, { "MC7 code length", "s7comm.blockinfo.mc7_len", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of MC7 code in bytes", HFILL }}, { &hf_s7comm_ud_blockinfo_author, { "Author", "s7comm.blockinfo.author", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_family, { "Family", "s7comm.blockinfo.family", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_headername, { "Name (Header)", "s7comm.blockinfo.headername", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_headerversion, { "Version (Header)", "s7comm.blockinfo.headerversion", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_checksum, { "Block checksum", "s7comm.blockinfo.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_reserved1, { "Reserved 1", "s7comm.blockinfo.reserved1", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ud_blockinfo_reserved2, { "Reserved 2", "s7comm.blockinfo.reserved2", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* Flags in blockinfo response */ { &hf_s7comm_userdata_blockinfo_flags, { "Block flags", "s7comm.param.userdata.blockinfo.flags", FT_UINT8, BASE_HEX, NULL, 0xff, "Some block configuration flags", HFILL }}, /* Bit : 0 -> DB Linked = true */ { &hf_s7comm_userdata_blockinfo_linked, { "Linked", "s7comm.param.userdata.blockinfo.linked", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }}, /* Bit : 1 -> Standard block = true */ { &hf_s7comm_userdata_blockinfo_standard_block, { "Standard block", "s7comm.param.userdata.blockinfo.standard_block", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }}, /* Bit : 5 -> DB Non Retain = true */ { &hf_s7comm_userdata_blockinfo_nonretain, { "Non Retain", "s7comm.param.userdata.blockinfo.nonretain", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }}, /* Programmer commands / Test and installation (TIS) functions */ { &hf_s7comm_tis_parameter, { "TIS Parameter", "s7comm.tis.parameter", FT_NONE, BASE_NONE, NULL, 0x0, "TIS Test and Installation: Parameter", HFILL }}, { &hf_s7comm_tis_data, { "TIS Data", "s7comm.cpu.tis.data", FT_NONE, BASE_NONE, NULL, 0x0, "TIS Test and Installation: Data", HFILL }}, { &hf_s7comm_tis_parametersize, { "TIS Parameter size", "s7comm.tis.parametersize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_datasize, { "TIS Data size", "s7comm.tis.datasize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param1, { "TIS Parameter 1", "s7comm.tis.param1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param2, { "TIS Parameter 2 - Trigger type", "s7comm.tis.param2", FT_UINT16, BASE_DEC, VALS(tis_param2_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param3, { "TIS Parameter 3 - Trigger frequency", "s7comm.tis.param3", FT_UINT16, BASE_DEC, VALS(tis_param3_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_answersize, { "TIS Parameter 4 - Answer size", "s7comm.tis.answersize", FT_UINT16, BASE_DEC, NULL, 0x0, "TIS Answer size: Expected data size of PLC answer to this job", HFILL }}, { &hf_s7comm_tis_param5, { "TIS Parameter 5", "s7comm.tis.param5", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param6, { "TIS Parameter 6", "s7comm.tis.param6", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param7, { "TIS Parameter 7", "s7comm.tis.param7", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param8, { "TIS Parameter 8", "s7comm.tis.param8", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_param9, { "TIS Parameter 9", "s7comm.tis.param9", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_trgevent, { "TIS Parameter 10 - Trigger event", "s7comm.varstat.trgevent", FT_UINT16, BASE_HEX, VALS(userdata_varstat_trgevent_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_res_param1, { "TIS Response Parameter 1", "s7comm.tis.res.param1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_res_param2, { "TIS Response Parameter 2", "s7comm.tis.res.param2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_job_function, { "Job function", "s7comm.tis.job.function", FT_UINT8, BASE_DEC, VALS(userdata_tis_subfunc_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_job_seqnr, { "Job reference sequence number", "s7comm.tis.job.response_seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, "Job reference sequence number (find function setup with s7comm.param.userdata.seq_num)", HFILL }}, { &hf_s7comm_tis_job_reserved, { "Job Reserved / Unknown", "s7comm.tis.job.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_interrupted_blocktype, { "Interrupted block type", "s7comm.tis.interrupted.blocktype", FT_UINT16, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_interrupted_blocknr, { "Interrupted block number", "s7comm.tis.interrupted.blocknumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_interrupted_address, { "Interrupted code address", "s7comm.tis.interrupted.address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_interrupted_prioclass, { "Interrupted priority class", "s7comm.tis.interrupted.priorityclass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_continued_blocktype, { "Continued block type", "s7comm.tis.continued.blocktype", FT_UINT16, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_continued_blocknr, { "Continued block number", "s7comm.tis.continued.blocknumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_continued_address, { "Continued code address", "s7comm.tis.continued.address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_breakpoint_blocktype, { "Breakpoint block type", "s7comm.tis.breakpoint.blocktype", FT_UINT16, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_breakpoint_blocknr, { "Breakpoint block number", "s7comm.tis.breakpoint.blocknumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_breakpoint_address, { "Breakpoint code address", "s7comm.tis.breakpoint.address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_breakpoint_reserved, { "Breakpoint Reserved / Unknown", "s7comm.tis.breakpoint.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_p_callenv, { "Call environment setup", "s7comm.tis.callenv_setup", FT_UINT16, BASE_DEC, VALS(tis_p_callenv_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_p_callcond, { "Call condition", "s7comm.tis.callenv_cond", FT_UINT16, BASE_DEC, VALS(tis_p_callcond_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_p_callcond_blocktype, { "Call condition block type", "s7comm.tis.callenv_cond_blocktype", FT_UINT16, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_p_callcond_blocknr, { "Call condition block number", "s7comm.tis.callenv_cond_blocknumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_p_callcond_address, { "Call condition code address", "s7comm.tis.callenv_cond_blockaddress", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_db1_type, { "Register DB1 content type", "s7comm.tis.db1.type", FT_UINT8, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_db2_type, { "Register DB2 content type", "s7comm.tis.db2.type", FT_UINT8, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_db1_nr, { "Register DB1 block number", "s7comm.tis.db1.number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_db2_nr, { "Register DB2 block number", "s7comm.tis.db2.number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_accu1, { "Register ACCU1", "s7comm.tis.accu1", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_accu2, { "Register ACCU2", "s7comm.tis.accu2", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_accu3, { "Register ACCU3", "s7comm.tis.accu3", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_accu4, { "Register ACCU4", "s7comm.tis.accu4", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_ar1, { "Register AR1", "s7comm.tis.ar1", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_ar2, { "Register AR2", "s7comm.tis.ar2", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_register_stw, { "Register STW", "s7comm.tis.stw", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_exithold_until, { "Exit HOLD state until", "s7comm.tis.exithold_until", FT_UINT8, BASE_DEC, VALS(tis_exithold_until_names), 0x0, NULL, HFILL }}, { &hf_s7comm_tis_exithold_res1 , { "Exit HOLD Reserved / Unknown", "s7comm.tis.exithold_res1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_bstack_nest_depth, { "BSTACK nesting depth", "s7comm.tis.bstack.neting_depth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_bstack_reserved, { "BSTACK Reserved / Unknown", "s7comm.tis.bstack.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_istack_reserved, { "ISTACK Reserved / Unknown", "s7comm.tis.istack.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_lstack_reserved, { "LSTACK Reserved / Unknown", "s7comm.tis.lstack.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_lstack_size, { "Localdata stack size", "s7comm.tis.lstack.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_lstack_data, { "Localdata stack data", "s7comm.tis.lstack.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_blockstat_flagsunknown, { "Blockstat flags", "s7comm.tis.blockstat.flagsunknown", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_blockstat_number_of_lines, { "Number of lines", "s7comm.tis.blockstat.number_of_lines", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_blockstat_line_address, { "Address", "s7comm.tis.blockstat.line_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_blockstat_data, { "Blockstatus data", "s7comm.tis.blockstat.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tis_blockstat_reserved, { "Blockstatus Reserved / Unknown", "s7comm.tis.blockstat.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Organization block local data */ { &hf_s7comm_ob_ev_class, { "OB Event class", "s7comm.ob.ev_class", FT_UINT8, BASE_HEX, NULL, 0x0, "OB Event class (Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)", HFILL }}, { &hf_s7comm_ob_scan_1, { "OB Scan 1", "s7comm.ob.scan_1", FT_UINT8, BASE_HEX, NULL, 0x0, "OB Scan 1 (1=Cold restart scan 1 of OB 1), 3=Scan 2-n of OB 1)", HFILL }}, { &hf_s7comm_ob_strt_inf, { "OB Start info", "s7comm.ob.strt_info", FT_UINT8, BASE_HEX, NULL, 0x0, "OB Start info (OB n has started)", HFILL }}, { &hf_s7comm_ob_flt_id, { "OB Fault identification code", "s7comm.ob.flt_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_priority, { "OB Priority", "s7comm.ob.priority", FT_UINT8, BASE_DEC, NULL, 0x0, "OB Priority (1 is lowest)", HFILL }}, { &hf_s7comm_ob_number, { "OB Number", "s7comm.ob.number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_reserved_1, { "OB Reserved 1", "s7comm.ob.reserved_1", FT_UINT8, BASE_HEX, NULL, 0x0, "OB Reserved 1 (Reserved for System)", HFILL }}, { &hf_s7comm_ob_reserved_2, { "OB Reserved 2", "s7comm.ob.reserved_2", FT_UINT8, BASE_HEX, NULL, 0x0, "OB Reserved 2 (Reserved for System)", HFILL }}, { &hf_s7comm_ob_reserved_3, { "OB Reserved 3", "s7comm.ob.reserved_3", FT_UINT16, BASE_HEX, NULL, 0x0, "OB Reserved 3 (Reserved for System)", HFILL }}, { &hf_s7comm_ob_reserved_4, { "OB Reserved 4", "s7comm.ob.reserved_4", FT_UINT16, BASE_HEX, NULL, 0x0, "OB Reserved 4 (Reserved for System)", HFILL }}, { &hf_s7comm_ob_reserved_4_dw, { "OB Reserved 4", "s7comm.ob.reserved_4_dw", FT_UINT32, BASE_HEX, NULL, 0x0, "OB Reserved 4 (Reserved for System)", HFILL }}, { &hf_s7comm_ob_prev_cycle, { "OB Cycle time of previous OB scan (ms)", "s7comm.ob.prev_cycle", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_min_cycle, { "OB Minimum cycle time of OB (ms)", "s7comm.ob.min_cycle", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_max_cycle, { "OB Maximum cycle time of OB (ms)", "s7comm.ob.max_cycle", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_period_exe, { "OB Period of execution", "s7comm.ob.period_exe", FT_UINT16, BASE_HEX, NULL, 0x0, "OB Period of execution (once, per minute/hour/day/week/month/year)", HFILL }}, { &hf_s7comm_ob_sign, { "OB Identifier input (SIGN) attached to SRT_DINT", "s7comm.ob.sign", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_dtime, { "OB Delay time (DTIME) input to SRT_DINT instruction", "s7comm.ob.dtime", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_phase_offset, { "OB Phase offset (ms)", "s7comm.ob.phase_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_exec_freq, { "OB Frequency of execution (ms)", "s7comm.ob.exec_freq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_io_flag, { "OB IO flags", "s7comm.ob.io_flag", FT_UINT16, BASE_DEC, NULL, 0x0, "OB IO flags (0x54=input module, 0x55=output module)", HFILL }}, { &hf_s7comm_ob_mdl_addr, { "OB Base address of module initiating interrupt", "s7comm.ob.mdl_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_point_addr, { "OB Address of interrupt point on module", "s7comm.ob.point_addr", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_inf_len, { "OB Length of information", "s7comm.ob.inf_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_alarm_type, { "OB Type of alarm", "s7comm.ob.alarm_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_alarm_slot, { "OB Slot", "s7comm.ob.alarm_slot", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_alarm_spec, { "OB Specifier", "s7comm.ob.alarm_spec", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_error_info, { "OB Error information on event", "s7comm.ob.error_info", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_err_ev_class, { "OB Class of event causing error", "s7comm.ob.err_ev_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_err_ev_num, { "OB Number of event causing error", "s7comm.ob.err_ev_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_err_ob_priority, { "OB Priority of OB causing error", "s7comm.ob.err_ob_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_err_ob_num, { "OB Number of OB causing error", "s7comm.ob.err_ob_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_rack_cpu, { "OB Rack / CPU number", "s7comm.ob.rack_cpu", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_8x_fault_flags, { "OB 8x Fault flags", "s7comm.ob.8x_fault_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_mdl_type_b, { "OB Type of module", "s7comm.ob.mdl_type_b", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_mdl_type_w, { "OB Module type with point fault", "s7comm.ob.mdl_type_w", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_rack_num, { "OB Number of rack that has module with point fault", "s7comm.ob.rack_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_racks_flt, { "OB Racks in fault", "s7comm.ob.racks_flt", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_strtup, { "OB Method of startup", "s7comm.ob.strtup", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_stop, { "OB Event that caused CPU to stop", "s7comm.ob.stop", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_strt_info, { "OB Information on how system started", "s7comm.ob.strt_info", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_sw_flt, { "OB Software programming fault", "s7comm.ob.sw_flt", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_blk_type, { "OB Type of block fault occurred in", "s7comm.ob.blk_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_flt_reg, { "OB Specific register that caused fault", "s7comm.ob.flt_reg", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_flt_blk_num, { "OB Number of block that programming fault occurred in", "s7comm.ob.flt_blk_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_prg_addr, { "OB Address in block where programming fault occurred", "s7comm.ob.prg_addr", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_mem_area, { "OB Memory area where access error occurred", "s7comm.ob.mem_area", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_ob_mem_addr, { "OB Memory address where access error occurred", "s7comm.ob.mem_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_diagdata_req_block_type, { "Block type", "s7comm.diagdata.req.blocktype", FT_UINT16, BASE_DEC, VALS(subblktype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_diagdata_req_block_num, { "Block number", "s7comm.diagdata.req.blocknumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_diagdata_req_startaddr_awl, { "Start address AWL", "s7comm.diagdata.req.startaddr_awl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_diagdata_req_saz, { "Step address counter (SAZ)", "s7comm.diagdata.req.saz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* Flags for requested registers in diagnostic data telegrams */ { &hf_s7comm_diagdata_registerflag, { "Registers", "s7comm.diagdata.register", FT_UINT8, BASE_HEX, NULL, 0x00, "Requested registers", HFILL }}, { &hf_s7comm_diagdata_registerflag_stw, { "STW", "s7comm.diagdata.register.stw", FT_BOOLEAN, 8, NULL, 0x01, "STW / Status word", HFILL }}, { &hf_s7comm_diagdata_registerflag_accu1, { "ACCU1", "s7comm.diagdata.register.accu1", FT_BOOLEAN, 8, NULL, 0x02, "ACCU1 / Accumulator 1", HFILL }}, { &hf_s7comm_diagdata_registerflag_accu2, { "ACCU2", "s7comm.diagdata.register.accu2", FT_BOOLEAN, 8, NULL, 0x04, "ACCU2 / Accumulator 2", HFILL }}, { &hf_s7comm_diagdata_registerflag_ar1, { "AR1", "s7comm.diagdata.register.ar1", FT_BOOLEAN, 8, NULL, 0x08, "AR1 / Addressregister 1", HFILL }}, { &hf_s7comm_diagdata_registerflag_ar2, { "AR2", "s7comm.diagdata.register.ar2", FT_BOOLEAN, 8, NULL, 0x10, "AR2 / Addressregister 2", HFILL }}, { &hf_s7comm_diagdata_registerflag_db1, { "DB1", "s7comm.diagdata.register.db1", FT_BOOLEAN, 8, NULL, 0x20, "DB1 (global)/ Datablock register 1", HFILL }}, { &hf_s7comm_diagdata_registerflag_db2, { "DB2", "s7comm.diagdata.register.db2", FT_BOOLEAN, 8, NULL, 0x40, "DB2 (instance) / Datablock register 2", HFILL }}, /* timefunction: s7 timestamp */ { &hf_s7comm_data_ts, { "S7 Timestamp", "s7comm.data.ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, "S7 Timestamp, BCD coded", HFILL }}, { &hf_s7comm_data_ts_reserved, { "S7 Timestamp - Reserved", "s7comm.data.ts_reserved", FT_UINT8, BASE_HEX, NULL, 0x00, "S7 Timestamp: Reserved byte", HFILL }}, { &hf_s7comm_data_ts_year1, { "S7 Timestamp - Year 1", "s7comm.data.ts_year1", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded year thousands/hundreds, should be ignored (19 or 20)", HFILL }}, { &hf_s7comm_data_ts_year2, { "S7 Timestamp - Year 2", "s7comm.data.ts_year2", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded year, if 00...89 then it's 2000...2089, else 1990...1999", HFILL }}, { &hf_s7comm_data_ts_month, { "S7 Timestamp - Month", "s7comm.data.ts_month", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded month", HFILL }}, { &hf_s7comm_data_ts_day, { "S7 Timestamp - Day", "s7comm.data.ts_day", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded day", HFILL }}, { &hf_s7comm_data_ts_hour, { "S7 Timestamp - Hour", "s7comm.data.ts_hour", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded hour", HFILL }}, { &hf_s7comm_data_ts_minute, { "S7 Timestamp - Minute", "s7comm.data.ts_minute", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded minute", HFILL }}, { &hf_s7comm_data_ts_second, { "S7 Timestamp - Second", "s7comm.data.ts_second", FT_UINT8, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded second", HFILL }}, { &hf_s7comm_data_ts_millisecond, { "S7 Timestamp - Milliseconds", "s7comm.data.ts_millisecond", FT_UINT16, BASE_DEC, NULL, 0x00, "S7 Timestamp: BCD coded milliseconds (left 3 nibbles)", HFILL }}, { &hf_s7comm_data_ts_weekday, { "S7 Timestamp - Weekday", "s7comm.data.ts_weekday", FT_UINT16, BASE_DEC, VALS(weekdaynames), 0x000f, "S7 Timestamp: Weekday number (right nibble, 1=Su,2=Mo,..)", HFILL }}, /* Function 0x28 (PI service) and 0x29 */ { &hf_s7comm_piservice_unknown1, { "Unknown bytes", "s7comm.param.pistart.unknown1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_piservice_parameterblock_len, { "Parameter block length", "s7comm.param.pistart.parameterblock_len", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of Parameter block in bytes", HFILL }}, { &hf_s7comm_piservice_parameterblock, { "Parameter block", "s7comm.param.pistart.parameterblock", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_piservice_servicename, { "PI (program invocation) Service", "s7comm.param.pistart.servicename", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, /* PI Service parameters for NC services */ { &hf_s7comm_piservice_string_len, { "String length", "s7comm.param.pi.n_x.string_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of the following string. If LengthByte + Stringlen is uneven, a fillbyte is added", HFILL }}, { &hf_s7comm_pi_n_x_addressident, { "Addressidentification", "s7comm.param.pi.n_x.addressident", FT_STRING, BASE_NONE, NULL, 0x0, "Addressidentification (RangeID / Index)", HFILL }}, { &hf_s7comm_pi_n_x_filename, { "Filename", "s7comm.param.pi.n_x.filename", FT_STRING, BASE_NONE, NULL, 0x0, "Name of the file or directory", HFILL }}, { &hf_s7comm_pi_n_x_editwindowname, { "Editor Window Name", "s7comm.param.pi.n_x.editwindowname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pi_n_x_password, { "Password", "s7comm.param.pi.n_x.password", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pi_n_x_seekpointer, { "Seek pointer", "s7comm.param.pi.n_x.seekpointer", FT_STRING, BASE_NONE, NULL, 0x0, "SeekPointer string with exact 9 digit/character(s)", HFILL }}, { &hf_s7comm_pi_n_x_windowsize, { "Window size", "s7comm.param.pi.n_x.windowsize", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pi_n_x_comparestring, { "Compare String", "s7comm.param.pi.n_x.comparestring", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pi_n_x_skipcount, { "Skip Count", "s7comm.param.pi.n_x.skipcount", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pi_n_x_interruptnr, { "Interrupt Number", "s7comm.param.pi.n_x.interruptnr", FT_STRING, BASE_NONE, NULL, 0x0, "Interrupt Number: Interrupt number corresponds to the input number which caused the interrupt" , HFILL }}, { &hf_s7comm_pi_n_x_priority, { "Priority", "s7comm.param.pi.n_x.priority", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_liftfast, { "Liftfast", "s7comm.param.pi.n_x.liftfast", FT_STRING, BASE_NONE, NULL, 0x0, "Liftfast: Indicates whether an interrupt routine should simultaneously cause a fast lift-off motion" , HFILL }}, { &hf_s7comm_pi_n_x_blsync, { "Blsync", "s7comm.param.pi.n_x.blsync", FT_STRING, BASE_NONE, NULL, 0x0, "Blsync: Indicates whether the interrupt has to be synchronized to the next block end" , HFILL }}, { &hf_s7comm_pi_n_x_magnr, { "Magnr", "s7comm.param.pi.n_x.magnr", FT_STRING, BASE_NONE, NULL, 0x0, "Magnr: Magazine number" , HFILL }}, { &hf_s7comm_pi_n_x_dnr, { "DNr", "s7comm.param.pi.n_x.dnr", FT_STRING, BASE_NONE, NULL, 0x0, "DNr: D number" , HFILL }}, { &hf_s7comm_pi_n_x_spindlenumber, { "Spindle Number", "s7comm.param.pi.n_x.spindlenumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pi_n_x_wznr, { "WZ-Nr", "s7comm.param.pi.n_x.wznr", FT_STRING, BASE_NONE, NULL, 0x0, "WZ-Nr: Tool number" , HFILL }}, { &hf_s7comm_pi_n_x_class, { "Class", "s7comm.param.pi.n_x.class", FT_STRING, BASE_NONE, NULL, 0x0, "Class: Classify machine data" , HFILL }}, { &hf_s7comm_pi_n_x_tnr, { "TNr", "s7comm.param.pi.n_x.tnr", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_toolnumber, { "Tool Number", "s7comm.param.pi.n_x.toolnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_cenumber, { "CE-Number", "s7comm.param.pi.n_x.cenumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_datablocknumber, { "Datablock Number", "s7comm.param.pi.n_x.datablocknumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_firstcolumnnumber, { "First Column Number", "s7comm.param.pi.n_x.firstcolumnnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_lastcolumnnumber, { "Last Column Number", "s7comm.param.pi.n_x.lastcolumnnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_firstrownumber, { "First Row Number", "s7comm.param.pi.n_x.firstrownnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_lastrownumber, { "Last Row Number", "s7comm.param.pi.n_x.lastrownnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_direction, { "Direction", "s7comm.param.pi.n_x.direction", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_sourcefilename, { "Source-Filename", "s7comm.param.pi.n_x.sourcefilename", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_destinationfilename, { "Destination-Filename", "s7comm.param.pi.n_x.destinationfilename", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_channelnumber, { "Channel Number", "s7comm.param.pi.n_x.channelnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_protection, { "Protection", "s7comm.param.pi.n_x.protection", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_oldfilename, { "Old Filename", "s7comm.param.pi.n_x.oldfilename", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_newfilename, { "New Filename", "s7comm.param.pi.n_x.newfilename", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_findmode, { "Findmode", "s7comm.param.pi.n_x.findmode", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_switch, { "Switch", "s7comm.param.pi.n_x.switch", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_functionnumber, { "Function Number", "s7comm.param.pi.n_x.functionnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_semaphorevalue, { "Semaphore Value", "s7comm.param.pi.n_x.semaphorevalue", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_onoff, { "OnOff", "s7comm.param.pi.n_x.onoff", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_mode, { "Mode", "s7comm.param.pi.n_x.mode", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_factor, { "Factor", "s7comm.param.pi.n_x.factor", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_passwordlevel, { "Password Level", "s7comm.param.pi.n_x.passwordlevel", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_linenumber, { "Line Number", "s7comm.param.pi.n_x.linenumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_weargroup, { "Wear Group", "s7comm.param.pi.n_x.weargroup", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_toolstatus, { "Tool Status", "s7comm.param.pi.n_x.toolstatus", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_wearsearchstrat, { "Search Strategy", "s7comm.param.pi.n_x.wearsearchstrat", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_toolid, { "Tool ID", "s7comm.param.pi.n_x.toolid", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_duplonumber, { "Duplo Number", "s7comm.param.pi.n_x.duplonumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_edgenumber, { "Edge Number", "s7comm.param.pi.n_x.edgenumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placenr, { "Place Number", "s7comm.param.pi.n_x.placenr", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placerefnr, { "Place Reference Number", "s7comm.param.pi.n_x.placerefnr", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_magrefnr, { "Magazine Reference Number", "s7comm.param.pi.n_x.magrefnr", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placenrfrom, { "Place Number from", "s7comm.param.pi.n_x.placenrfrom", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_magnrfrom, { "Magazine Number from", "s7comm.param.pi.n_x.magnrfrom", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placenrto, { "Place Number to", "s7comm.param.pi.n_x.placenrto", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_magnrto, { "Magazine Number to", "s7comm.param.pi.n_x.magnrto", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_halfplacesleft, { "Half places left", "s7comm.param.pi.n_x.halfplacesleft", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_halfplacesright, { "Half places right", "s7comm.param.pi.n_x.halfplacesright", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_halfplacesup, { "Half places up", "s7comm.param.pi.n_x.halfplacesup", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_halfplacesdown, { "Half places down", "s7comm.param.pi.n_x.halfplacesdown", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placetype, { "Place type index", "s7comm.param.pi.n_x.placetype", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_searchdirection, { "Search direction", "s7comm.param.pi.n_x.searchdirection", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_toolname, { "Tool Name", "s7comm.param.pi.n_x.toolname", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placenrsource, { "Place Number Source", "s7comm.param.pi.n_x.placenrsource", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_magnrsource, { "Magazine Number Source", "s7comm.param.pi.n_x.magnrsource", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_placenrdestination, { "Place Number Destination", "s7comm.param.pi.n_x.placenrdestination", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_magnrdestination, { "Magazine Number Destination", "s7comm.param.pi.n_x.magnrdestination", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_incrementnumber, { "Increment Number", "s7comm.param.pi.n_x.incrementnumber", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_monitoringmode, { "Monitoring mode", "s7comm.param.pi.n_x.monitoringmode", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_pi_n_x_kindofsearch, { "Kind of search", "s7comm.param.pi.n_x.kindofsearch", FT_STRING, BASE_NONE, NULL, 0x0, NULL , HFILL }}, { &hf_s7comm_data_pi_inse_unknown, { "Unknown byte", "s7comm.param.pi.inse.unknown", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_plccontrol_argument, { "Argument", "s7comm.param.pistart.argument", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_plccontrol_block_cnt, { "Number of blocks", "s7comm.data.plccontrol.block_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_plccontrol_part2_len, { "Length part 2", "s7comm.data.plccontrol.part2_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of part 2 in bytes", HFILL }}, /* block control functions */ { &hf_s7comm_data_blockcontrol_unknown1, { "Unknown byte(s) in blockcontrol", "s7comm.data.blockcontrol.unknown1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_errorcode, { "Errorcode", "s7comm.data.blockcontrol.errorcode", FT_UINT16, BASE_HEX, NULL, 0x0, "Errorcode, 0 on success", HFILL }}, { &hf_s7comm_data_blockcontrol_uploadid, { "UploadID", "s7comm.data.blockcontrol.uploadid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_file_ident, { "File identifier", "s7comm.data.blockcontrol.file_identifier", FT_STRING, BASE_NONE, NULL, 0x0, "File identifier: '_'=complete module; '$'=Module header for up-loading", HFILL }}, { &hf_s7comm_data_blockcontrol_block_type, { "Block type", "s7comm.data.blockcontrol.block_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_block_num, { "Block number", "s7comm.data.blockcontrol.block_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_dest_filesys, { "Destination filesystem", "s7comm.data.blockcontrol.dest_filesys", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_part2_len, { "Length part 2", "s7comm.data.blockcontrol.part2_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of part 2 in bytes", HFILL }}, { &hf_s7comm_data_blockcontrol_part2_unknown, { "Unknown char before load mem", "s7comm.data.blockcontrol.part2_unknown", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_loadmem_len, { "Length of load memory", "s7comm.data.blockcontrol.loadmem_len", FT_STRING, BASE_NONE, NULL, 0x0, "Length of load memory in bytes", HFILL }}, { &hf_s7comm_data_blockcontrol_mc7code_len, { "Length of MC7 code", "s7comm.data.blockcontrol.mc7code_len", FT_STRING, BASE_NONE, NULL, 0x0, "Length of MC7 code in bytes", HFILL }}, { &hf_s7comm_data_blockcontrol_filename_len, { "Filename Length", "s7comm.param.blockcontrol.filename_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length following filename in bytes", HFILL }}, { &hf_s7comm_data_blockcontrol_filename, { "Filename", "s7comm.param.blockcontrol.filename", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_blockcontrol_upl_lenstring_len, { "Blocklengthstring Length", "s7comm.param.blockcontrol.upl_lenstring_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length following blocklength string in bytes", HFILL }}, { &hf_s7comm_data_blockcontrol_upl_lenstring, { "Blocklength", "s7comm.param.blockcontrol.upl_lenstring", FT_STRING, BASE_NONE, NULL, 0x0, "Length of the complete uploadblock in bytes, may be split into many PDUs", HFILL }}, { &hf_s7comm_data_blockcontrol_functionstatus, { "Function Status", "s7comm.param.blockcontrol.functionstatus", FT_UINT8, BASE_HEX, NULL, 0x0, "0=no error, 1=more data, 2=error", HFILL }}, { &hf_s7comm_data_blockcontrol_functionstatus_more, { "More data following", "s7comm.param.blockcontrol.functionstatus.more", FT_BOOLEAN, 8, NULL, 0x01, "More data of the block/file can be retrieved with another request", HFILL }}, { &hf_s7comm_data_blockcontrol_functionstatus_error, { "Error", "s7comm.param.blockcontrol.functionstatus.error", FT_BOOLEAN, 8, NULL, 0x02, "An error occurred", HFILL }}, /* NC programming functions */ { &hf_s7comm_data_ncprg_unackcount, { "Number of telegrams sent without acknowledge", "s7comm.data.ncprg.unackcount", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_ncprg_filelength, { "NC file length", "s7comm.data.ncprg.filelength", FT_STRING, BASE_NONE, NULL, 0x0, "NC file length: length of file date + file path", HFILL }}, { &hf_s7comm_data_ncprg_filetime, { "NC file timestamp", "s7comm.data.ncprg.filetime", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_ncprg_filepath, { "NC file path", "s7comm.data.ncprg.filepath", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_data_ncprg_filedata, { "NC file data", "s7comm.data.ncprg.filedata", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Data record routing to Profibus */ { &hf_s7comm_data_drr_data, { "DRR Data", "s7comm.data.drr.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Variable status */ { &hf_s7comm_varstat_unknown, { "Unknown byte(s) varstat", "s7comm.varstat.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_varstat_item_count, { "Item count", "s7comm.varstat.item_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_varstat_req_memory_area, { "Memory area", "s7comm.varstat.req.memory_area", FT_UINT8, BASE_DEC, VALS(userdata_tis_varstat_area_names), 0x0, NULL, HFILL }}, { &hf_s7comm_varstat_req_repetition_factor, { "Repetition factor", "s7comm.varstat.req.repetition_factor", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_varstat_req_db_number, { "DB number", "s7comm.varstat.req.db_number", FT_UINT16, BASE_DEC, NULL, 0x0, "DB number, when area is DB", HFILL }}, { &hf_s7comm_varstat_req_startaddress, { "Startaddress", "s7comm.varstat.req.startaddress", FT_UINT16, BASE_DEC, NULL, 0x0, "Startaddress / byteoffset", HFILL }}, { &hf_s7comm_varstat_req_bitpos, { "Bitposition", "s7comm.varstat.req.bitpos", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* cyclic services */ { &hf_s7comm_cycl_interval_timebase, { "Interval timebase", "s7comm.cyclic.interval_timebase", FT_UINT8, BASE_DEC, VALS(cycl_interval_timebase_names), 0x0, NULL, HFILL }}, { &hf_s7comm_cycl_interval_time, { "Interval time factor", "s7comm.cyclic.interval_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cycl_function, { "Function", "s7comm.cyclic.function", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cycl_jobid, { "Job-ID", "s7comm.cyclic.job_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* Read record */ { &hf_s7comm_rdrec_mlen, { "Rdrec Mlen", "s7comm.readrec.mlen", FT_UINT16, BASE_DEC, NULL, 0x0, "MLEN, Max. length in bytes of the data record data to be read", HFILL }}, { &hf_s7comm_rdrec_index, { "Rdrec Index", "s7comm.readrec.index", FT_UINT16, BASE_HEX, NULL, 0x0, "INDEX, Data record number", HFILL }}, { &hf_s7comm_rdrec_id, { "Rdrec ID", "s7comm.readrec.id", FT_UINT24, BASE_DEC, NULL, 0x0, "ID, Diagnostic address", HFILL }}, { &hf_s7comm_rdrec_statuslen, { "Rdrec Status Len", "s7comm.readrec.statuslen", FT_UINT8, BASE_DEC, NULL, 0x0, "STATUS LEN, Length of status data", HFILL }}, { &hf_s7comm_rdrec_statusdata, { "Rdrec Status", "s7comm.readrec.status", FT_BYTES, BASE_NONE, NULL, 0x0, "STATUS, Status data", HFILL }}, { &hf_s7comm_rdrec_recordlen, { "Rdrec Len", "s7comm.readrec.len", FT_UINT16, BASE_DEC, NULL, 0x0, "LEN, Length of data record data read", HFILL }}, { &hf_s7comm_rdrec_data, { "Rdrec Data", "s7comm.readrec.data", FT_BYTES, BASE_NONE, NULL, 0x0, "DATA, The read data record", HFILL }}, { &hf_s7comm_rdrec_reserved1, { "Rdrec reserved", "s7comm.readrec.reserved1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* PBC, Programmable Block Functions */ { &hf_s7comm_pbc_unknown, { "PBC unknown", "s7comm.pbc.unknown", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_bsend_r_id, { "PBC BSEND R_ID", "s7comm.pbc.req.bsend.r_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_bsend_len, { "PBC BSEND LEN", "s7comm.pbc.req.bsend.len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_usend_unknown1, { "PBC USEND unknown 1", "s7comm.pbc.usend.unknown1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_usend_r_id, { "PBC USEND R_ID", "s7comm.pbc.usend.r_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_usend_unknown2, { "PBC USEND unknown 2", "s7comm.pbc.usend.unknown2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_arsend_ret, { "PBC AR_SEND Returncode", "s7comm.pbc.arsend.ret", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_arsend_unknown, { "PBC AR_SEND unknown", "s7comm.pbc.arsend.unknown", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_arsend_ar_id, { "PBC AR_SEND AR_ID", "s7comm.pbc.arsend.ar_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_pbc_arsend_len, { "PBC AR_SEND LEN", "s7comm.pbc.arsend.len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* CPU alarms */ { &hf_s7comm_cpu_alarm_message_item, { "Alarm message", "s7comm.alarm.message", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_obj_item, { "Message object", "s7comm.alarm.message_object", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_function, { "Function identifier", "s7comm.alarm.function", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_nr_objects, { "Number of message objects", "s7comm.alarm.nr_objects", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_nr_add_values, { "Number of associated values", "s7comm.alarm.nr_add_values", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_eventid, { "EventID", "s7comm.alarm.event_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_timestamp_coming, { "Timestamp message coming", "s7comm.alarm.timestamp_coming", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_timestamp_going, { "Timestamp message going", "s7comm.alarm.timestamp_going", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_associated_value, { "Associated value(s)", "s7comm.alarm.associated_value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_eventstate, { "EventState", "s7comm.alarm.eventstate", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig1, { "SIG_1", "s7comm.alarm.signal.sig1", FT_BOOLEAN, 8, NULL, 0x01, "Current state of Signal SIG_1", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig2, { "SIG_2", "s7comm.alarm.signal.sig2", FT_BOOLEAN, 8, NULL, 0x02, "Current state of Signal SIG_2", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig3, { "SIG_3", "s7comm.alarm.signal.sig3", FT_BOOLEAN, 8, NULL, 0x04, "Current state of Signal SIG_3", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig4, { "SIG_4", "s7comm.alarm.signal.sig4", FT_BOOLEAN, 8, NULL, 0x08, "Current state of Signal SIG_4", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig5, { "SIG_5", "s7comm.alarm.signal.sig5", FT_BOOLEAN, 8, NULL, 0x10, "Current state of Signal SIG_5", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig6, { "SIG_6", "s7comm.alarm.signal.sig6", FT_BOOLEAN, 8, NULL, 0x20, "Current state of Signal SIG_6", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig7, { "SIG_7", "s7comm.alarm.signal.sig7", FT_BOOLEAN, 8, NULL, 0x40, "Current state of Signal SIG_7", HFILL }}, { &hf_s7comm_cpu_alarm_message_signal_sig8, { "SIG_8", "s7comm.alarm.signal.sig8", FT_BOOLEAN, 8, NULL, 0x80, "Current state of Signal SIG_8", HFILL }}, { &hf_s7comm_cpu_alarm_message_state, { "State", "s7comm.alarm.state", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_ackstate_coming, { "AckState coming", "s7comm.alarm.ack_state.coming", FT_UINT8, BASE_HEX, NULL, 0x0, "Acknowledge state coming (1=Event acknowledged, 0=Event not acknowledged)", HFILL }}, { &hf_s7comm_cpu_alarm_message_ackstate_going, { "AckState going", "s7comm.alarm.ack_state.going", FT_UINT8, BASE_HEX, NULL, 0x0, "Acknowledge state going (1=Event acknowledged, 0=Event not acknowledged)", HFILL }}, { &hf_s7comm_cpu_alarm_message_event_coming, { "Event coming", "s7comm.alarm.event.coming", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_event_going, { "Event going", "s7comm.alarm.event.going", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_event_lastchanged, { "Event last changed", "s7comm.alarm.event.lastchanged", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_event_reserved, { "Reserved", "s7comm.alarm.event.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_scan_unknown1, { "SCAN unknown 1", "s7comm.alarm.scan.unknown1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_message_scan_unknown2, { "SCAN unknown 2", "s7comm.alarm.scan.unknown2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* Alarm message query */ { &hf_s7comm_cpu_alarm_query_unknown1, { "Unknown/Reserved (1)", "s7comm.alarm.query.unknown1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_query_querytype, { "Querytype", "s7comm.alarm.query.querytype", FT_UINT8, BASE_DEC, VALS(alarm_message_querytype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_query_unknown2, { "Unknown/Reserved (2)", "s7comm.alarm.query.unknown2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_query_alarmtype, { "Alarmtype", "s7comm.alarm.query.alarmtype", FT_UINT32, BASE_DEC, VALS(alarm_message_query_alarmtype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_query_completelen, { "Complete data length", "s7comm.alarm.query.complete_length", FT_UINT32, BASE_DEC, NULL, 0x0, "Complete data length (with ALARM_S this is 0xffff, as they might be split into many telegrams)", HFILL }}, { &hf_s7comm_cpu_alarm_query_datasetlen, { "Length of dataset", "s7comm.alarm.query.dataset_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_alarm_query_resunknown1, { "Unknown", "s7comm.alarm.query.resunknown1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* CPU diagnostic messages */ { &hf_s7comm_cpu_diag_msg_item, { "CPU diagnostic message", "s7comm.cpu.diag_msg", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid, { "Event ID", "s7comm.cpu.diag_msg.eventid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid_class, { "Event class", "s7comm.cpu.diag_msg.eventid.class", FT_UINT16, BASE_HEX, VALS(cpu_diag_msg_eventid_class_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid_ident_entleave, { "Event entering state", "s7comm.cpu.diag_msg.eventid.ident.entleave", FT_BOOLEAN, 16, TFS(&tfs_s7comm_cpu_diag_msg_eventid_ident_entleave), 0x0100, "Event identifier: 0=Event leaving state,1=Event entering state", HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid_ident_diagbuf, { "Entry in diagnostic buffer", "s7comm.cpu.diag_msg.eventid.ident.diagbuf", FT_BOOLEAN, 16, NULL, 0x0200, "Event identifier: Entry in diagnostic buffer", HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid_ident_interr, { "Internal error", "s7comm.cpu.diag_msg.eventid.ident.interr", FT_BOOLEAN, 16, NULL, 0x0400, "Event identifier: Internal error", HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid_ident_exterr, { "External error", "s7comm.cpu.diag_msg.eventid.ident.exterr", FT_BOOLEAN, 16, NULL, 0x0800, "Event identifier: External error", HFILL }}, { &hf_s7comm_cpu_diag_msg_eventid_nr, { "Event number", "s7comm.cpu.diag_msg.eventid.nr", FT_UINT16, BASE_HEX, NULL, 0x00ff, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_prioclass, { "Priority class", "s7comm.cpu.diag_msg.prioclass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_obnumber, { "OB number", "s7comm.cpu.diag_msg.obnumber", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_datid, { "DatID", "s7comm.cpu.diag_msg.datid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_info1, { "INFO1 Additional information 1", "s7comm.cpu.diag_msg.info1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_diag_msg_info2, { "INFO2 Additional information 2", "s7comm.cpu.diag_msg.info2", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* CPU message service */ { &hf_s7comm_cpu_msgservice_subscribe_events, { "Subscribed events", "s7comm.cpu.msg.events", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_subscribe_events_modetrans, { "Mode-transition", "s7comm.cpu.msg.events.modetrans", FT_BOOLEAN, 8, NULL, 0x01, "MODE: Register for mode-transition events via func-group=0 and subfunction=state", HFILL }}, { &hf_s7comm_cpu_msgservice_subscribe_events_system, { "System-diagnostics", "s7comm.cpu.msg.events.system", FT_BOOLEAN, 8, NULL, 0x02, "SYS: Register for system diagnostic events", HFILL }}, { &hf_s7comm_cpu_msgservice_subscribe_events_userdefined, { "Userdefined", "s7comm.cpu.msg.events.userdefined", FT_BOOLEAN, 8, NULL, 0x04, "USR: Register system user-defined diagnostic messages", HFILL }}, { &hf_s7comm_cpu_msgservice_subscribe_events_alarms, { "Alarms", "s7comm.cpu.msg.events.alarms", FT_BOOLEAN, 8, NULL, 0x80, "ALM: Register alarm events (ALARM, SCAN, ALARM_S) type of event defined in additional field", HFILL }}, { &hf_s7comm_cpu_msgservice_req_reserved1, { "Reserved/Unknown", "s7comm.cpu.msg.req_reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_username, { "Username", "s7comm.cpu.msg.username", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_almtype, { "Alarm type", "s7comm.cpu.msg.almtype", FT_UINT8, BASE_DEC, VALS(cpu_msgservice_almtype_names), 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_req_reserved2, { "Reserved/Unknown", "s7comm.cpu.msg.req_reserved2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_res_result, { "Result", "s7comm.cpu.msg.res_result", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_res_reserved1, { "Reserved/Unknown", "s7comm.cpu.msg.res_reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_res_reserved2, { "Reserved/Unknown", "s7comm.cpu.msg.res_reserved2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_cpu_msgservice_res_reserved3, { "Reserved/Unknown", "s7comm.cpu.msg.res_reserved3", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_modetrans_param_unknown1, { "Reserved/Unknown", "s7comm.param.modetrans.unknown1", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_modetrans_param_mode, { "Current mode", "s7comm.param.modetrans.mode", FT_UINT8, BASE_DEC, VALS(modetrans_param_mode_names), 0x0, NULL, HFILL }}, { &hf_s7comm_modetrans_param_unknown2, { "Reserved/Unknown", "s7comm.param.modetrans.unknown2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* TIA Portal stuff */ { &hf_s7comm_tia1200_item_reserved1, { "1200 sym Reserved", "s7comm.tiap.item.reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tia1200_item_area1, { "1200 sym root area 1", "s7comm.tiap.item.area1", FT_UINT16, BASE_HEX, VALS(tia1200_var_item_area1_names), 0x0, "Area from where to read: DB or Inputs, Outputs, etc.", HFILL }}, { &hf_s7comm_tia1200_item_area2, { "1200 sym root area 2", "s7comm.tiap.item.area2", FT_UINT16, BASE_HEX, VALS(tia1200_var_item_area2_names), 0x0, "Specifies the area from where to read", HFILL }}, { &hf_s7comm_tia1200_item_area2unknown, { "1200 sym root area 2 unknown", "s7comm.tiap.item.area2unknown", FT_UINT16, BASE_HEX, NULL, 0x0, "For current unknown areas", HFILL }}, { &hf_s7comm_tia1200_item_dbnumber, { "1200 sym root DB number", "s7comm.tiap.item.dbnumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tia1200_item_crc, { "1200 sym CRC", "s7comm.tiap.item.crc", FT_UINT32, BASE_HEX, NULL, 0x0, "CRC generated out of symbolic name with (x^32+x^31+x^30+x^29+x^28+x^26+x^23+x^21+x^19+x^18+x^15+x^14+x^13+x^12+x^9+x^8+x^4+x+1)", HFILL }}, { &hf_s7comm_tia1200_var_lid_flags, { "LID flags", "s7comm.tiap.item.lid_flags", FT_UINT8, BASE_DEC, VALS(tia1200_var_lid_flag_names), 0xf0, NULL, HFILL }}, { &hf_s7comm_tia1200_substructure_item, { "Substructure", "s7comm.tiap.item.substructure", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_tia1200_item_value, { "Value", "s7comm.tiap.item.value", FT_UINT32, BASE_DEC, NULL, 0x0fffffff, NULL, HFILL }}, /* Fragment fields */ { &hf_s7comm_fragment_overlap, { "Fragment overlap", "s7comm.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL }}, { &hf_s7comm_fragment_overlap_conflict, { "Conflicting data in fragment overlap", "s7comm.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL }}, { &hf_s7comm_fragment_multiple_tails, { "Multiple tail fragments found", "s7comm.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL }}, { &hf_s7comm_fragment_too_long_fragment, { "Fragment too long", "s7comm.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL }}, { &hf_s7comm_fragment_error, { "Defragmentation error", "s7comm.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL }}, { &hf_s7comm_fragment_count, { "Fragment count", "s7comm.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_reassembled_in, { "Reassembled in", "s7comm.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "S7COMM fragments are reassembled in the given packet", HFILL }}, { &hf_s7comm_reassembled_length, { "Reassembled S7COMM length", "s7comm.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL }}, { &hf_s7comm_fragment, { "S7COMM Fragment", "s7comm.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_fragments, { "S7COMM Fragments", "s7comm.fragments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static ei_register_info ei[] = { { &ei_s7comm_data_blockcontrol_block_num_invalid, { "s7comm.data.blockcontrol.block_number.invalid", PI_MALFORMED, PI_ERROR, "Block number must be a string containing an integer", EXPFILL }}, { &ei_s7comm_ud_blockinfo_block_num_ascii_invalid, { "s7comm.data.blockinfo.block_number.invalid", PI_MALFORMED, PI_ERROR, "Block info must be a string containing an integer", EXPFILL }} }; static gint *ett[] = { &ett_s7comm, &ett_s7comm_header, &ett_s7comm_param, &ett_s7comm_param_item, &ett_s7comm_param_subitem, &ett_s7comm_data, &ett_s7comm_data_item, &ett_s7comm_item_address, &ett_s7comm_diagdata_registerflag, &ett_s7comm_userdata_blockinfo_flags, &ett_s7comm_cpu_alarm_message, &ett_s7comm_cpu_alarm_message_object, &ett_s7comm_cpu_alarm_message_signal, &ett_s7comm_cpu_alarm_message_timestamp, &ett_s7comm_cpu_alarm_message_associated_value, &ett_s7comm_cpu_diag_msg, &ett_s7comm_cpu_diag_msg_eventid, &ett_s7comm_cpu_msgservice_subscribe_events, &ett_s7comm_piservice_parameterblock, &ett_s7comm_data_blockcontrol_status, &ett_s7comm_plcfilename, &ett_s7comm_prog_parameter, &ett_s7comm_prog_data, &ett_s7comm_fragments, &ett_s7comm_fragment, }; proto_s7comm = proto_register_protocol ( "S7 Communication", /* name */ "S7COMM", /* short name */ "s7comm" /* abbrev */ ); proto_register_field_array(proto_s7comm, hf, array_length (hf)); s7comm_register_szl_types(proto_s7comm); proto_register_subtree_array(ett, array_length (ett)); expert_s7comm = expert_register_protocol(proto_s7comm); expert_register_field_array(expert_s7comm, ei, array_length(ei)); register_init_routine(s7comm_defragment_init); s7comm_heur_subdissector_list = register_heur_dissector_list("s7comm-bsend", proto_s7comm); } /* Register this protocol */ void proto_reg_handoff_s7comm(void) { /* register ourself as an heuristic cotp (ISO 8073) payload dissector */ heur_dissector_add("cotp", dissect_s7comm, "S7 Communication over COTP", "s7comm_cotp", proto_s7comm, HEURISTIC_ENABLE); heur_dissector_add("cotp_is", dissect_s7comm, "S7 Communication over COTP (inactive subset)", "s7comm_cotp_is", proto_s7comm, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-s7comm.h
/* packet-s7comm.h * * Author: Thomas Wiens, 2014 ([email protected]) * Description: Wireshark dissector for S7-Communication * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_S7COMM_H__ #define __PACKET_S7COMM_H__ /************************************************************************** * Returnvalues of an item response */ #define S7COMM_ITEM_RETVAL_RESERVED 0x00 #define S7COMM_ITEM_RETVAL_DATA_HW_FAULT 0x01 #define S7COMM_ITEM_RETVAL_DATA_ACCESS_FAULT 0x03 #define S7COMM_ITEM_RETVAL_DATA_OUTOFRANGE 0x05 /* the desired address is beyond limit for this PLC */ #define S7COMM_ITEM_RETVAL_DATA_NOT_SUP 0x06 /* Type is not supported */ #define S7COMM_ITEM_RETVAL_DATA_SIZEMISMATCH 0x07 /* Data type inconsistent */ #define S7COMM_ITEM_RETVAL_DATA_ERR 0x0a /* the desired item is not available in the PLC, e.g. when trying to read a non existing DB*/ #define S7COMM_ITEM_RETVAL_DATA_OK 0xff /************************************************************************** * Names of userdata subfunctions in group 4 (CPU functions) */ #define S7COMM_UD_SUBF_CPU_READSZL 0x01 #define S7COMM_UD_SUBF_CPU_MSGS 0x02 #define S7COMM_UD_SUBF_CPU_DIAGMSG 0x03 #define S7COMM_UD_SUBF_CPU_ALARM8_IND 0x05 #define S7COMM_UD_SUBF_CPU_NOTIFY_IND 0x06 #define S7COMM_UD_SUBF_CPU_ALARM8LOCK 0x07 #define S7COMM_UD_SUBF_CPU_ALARM8UNLOCK 0x08 #define S7COMM_UD_SUBF_CPU_ALARMACK 0x0b #define S7COMM_UD_SUBF_CPU_ALARMACK_IND 0x0c #define S7COMM_UD_SUBF_CPU_ALARM8LOCK_IND 0x0d #define S7COMM_UD_SUBF_CPU_ALARM8UNLOCK_IND 0x0e #define S7COMM_UD_SUBF_CPU_ALARMSQ_IND 0x11 #define S7COMM_UD_SUBF_CPU_ALARMS_IND 0x12 #define S7COMM_UD_SUBF_CPU_ALARMQUERY 0x13 #define S7COMM_UD_SUBF_CPU_NOTIFY8_IND 0x16 /************************************************************************** * Names of types in userdata parameter part */ #define S7COMM_UD_TYPE_IND 0x0 #define S7COMM_UD_TYPE_REQ 0x1 #define S7COMM_UD_TYPE_RES 0x2 extern const value_string s7comm_item_return_valuenames[]; guint32 s7comm_decode_ud_cpu_diagnostic_message(tvbuff_t *tvb, packet_info *pinfo, gboolean add_info_to_col, proto_tree *data_tree, guint32 offset); #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-s7comm_szl_ids.c
/* packet-s7comm_szl_ids.c * * Author: Thomas Wiens, 2014 ([email protected]) * Description: Wireshark dissector for S7-Communication * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include "packet-s7comm.h" #include "packet-s7comm_szl_ids.h" static gint ett_s7comm_szl = -1; static gint hf_s7comm_userdata_szl_partial_list = -1; /* Partial list in szl response */ static gint hf_s7comm_userdata_szl_id = -1; /* SZL id */ static const value_string szl_module_type_names[] = { { 0x0000, "CPU" }, /* Binary: 0000 */ { 0x0100, "IM" }, /* Binary: 0100 */ { 0xC000, "CP" }, /* Binary: 1100 */ { 0x8000, "FM" }, /* Binary: 1000 */ { 0, NULL } }; static gint hf_s7comm_userdata_szl_id_type = -1; static gint hf_s7comm_userdata_szl_id_partlist_ex = -1; static gint hf_s7comm_userdata_szl_id_partlist_num = -1; static gint hf_s7comm_userdata_szl_id_partlist_len = -1; static gint hf_s7comm_userdata_szl_id_partlist_cnt = -1; static gint ett_s7comm_userdata_szl_id = -1; static int * const s7comm_userdata_szl_id_fields[] = { &hf_s7comm_userdata_szl_id_type, &hf_s7comm_userdata_szl_id_partlist_ex, &hf_s7comm_userdata_szl_id_partlist_num, NULL }; /* Partial list extract names */ static const value_string szl_id_partlist_ex_names[] = { { 0x0000, "All SZL partial lists of the module" }, { 0x0011, "All identification data records of a module" }, { 0x0012, "All characteristics" }, { 0x0013, "Data records of all memory areas" }, { 0x0014, "All system areas of a module" }, { 0x0015, "Data records of all block types of a module" }, { 0x0016, "Data records of all priority classes" }, { 0x0017, "All SDBs of a module" }, { 0x0018, "All data records" }, { 0x0019, "Status of all LEDs" }, { 0x001c, "Identification of all components" }, { 0x0021, "Data records of all possible interrupts on a module" }, { 0x0022, "Data records of all possible interrupts on a module" }, { 0x0023, "Data records of all priority classes of a module" }, { 0x0024, "All modules that can occur on the module" }, { 0x0031, "Not defined" }, { 0x0033, "All stations logged on for messages and diagnostic events" }, { 0x0037, "Details of all Ethernet interfaces" }, { 0x0071, "Information about the current status of the H system" }, { 0x0074, "Status of all LEDs" }, { 0x0081, "Startup information of all OBs" }, { 0x0082, "All startup events" }, { 0x0090, "Information of all DP master systems known to the CPU" }, { 0x0091, "Module status information of all plugged in modules and submodules" }, { 0x0092, "Expected status of the central racks/stations of a DP master system connected via an integrated DP interface" }, { 0x0094, "Expected status of the rack in the central configuration/the stations of a DP master system/IO controller system that is connected via an integrated DP/PN interface module" }, { 0x0095, "Extended information on a DP master system/PROFINET IO system" }, { 0x00a0, "All entries possible in the current mode" }, { 0x00b1, "Obtain the first 4 diagnostic bytes of a module with diagnostic capability" }, { 0x00b2, "Obtain diagnostic data record 1 of a module in a central rack, rack/slot specified by index" }, { 0x00b3, "Obtain diagnostic data of a module, logical base address specified by index" }, { 0x00b4, "Obtain diagnostic data of a DP slave, diagnostic address of the module specified by index" }, { 0x0100, "A partial list with all partial list extracts" }, { 0x0111, "A single identification data record" }, { 0x0112, "Characteristics of a group, specified by index" }, { 0x0113, "Data record for one memory area, specified by index" }, { 0x0114, "One system area, specified by index" }, { 0x0115, "Data record of a block type, specified by index" }, { 0x0116, "Data record of the specified priority class, specified by index" }, { 0x0117, "One single SDB, specified by index" }, { 0x0118, "One data record, specified by index" }, { 0x0119, "Status of one LED, specified by index" }, { 0x011c, "Identification of one component" }, { 0x0121, "Data records of all possible interrupts of one class, class specified by index" }, { 0x0122, "Data records of all possible interrupts of one class, class specified by index" }, { 0x0123, "Data record of one priority class, specified by index" }, { 0x0124, "Information about the last mode transition" }, { 0x0131, "Information about a communication unit, specified by index" }, { 0x0132, "Status data for one communication section of the CPU, section specified by index" }, { 0x0137, "Details of one Ethernet interface" }, { 0x0174, "Status of an LED, specified by index" }, { 0x0181, "Startup information of all synchronous error OBs" }, { 0x0182, "Startup events of all synchronous error OBs" }, { 0x0190, "Information of one DP master system" }, { 0x0191, "Status information of all modules/racks with wrong type identifier" }, { 0x01a0, "The most recent entries, the number of most recent entries specified by index" }, { 0x0200, "A partial list extract" }, { 0x021c, "Identification of all components of a CPU in an H system" }, { 0x0221, "Data records for the specified interrupt, interrupt (OB no.) specified by index" }, { 0x0222, "Data records for the specified interrupt, interrupt (OB no.) specified by index" }, { 0x0223, "Data records of the priority classes being processed" }, { 0x0224, "Processed mode transition" }, { 0x0281, "Startup information of all synchronous error OBs of one priority class" }, { 0x0282, "Startup events of all synchronous error OBs of one priority class" }, { 0x0291, "Status information of all faulty modules" }, { 0x0292, "Actual status of the central racks/stations of a DP master system connected via an integrated DP interface" }, { 0x0294, "Actual status of the rack in the central configuration/the stations of a DP master system/IO controller system that is connected via an integrated DP/PN interface module" }, { 0x0300, "Possible indexes of a partial list extract" }, { 0x031c, "Identification of one component of all redundant CPUs in an H system" }, { 0x0381, "Startup information of all OBs of one priority class" }, { 0x0382, "Startup events of all OBs of a priority class" }, { 0x0391, "Status information of all modules that are not available" }, { 0x0392, "State of the battery backup of the racks in a central configuration" }, { 0x0424, "Current mode transition" }, { 0x0492, "State of the total backup of the racks in a central configuration" }, { 0x04a0, "Start information of all standard OBs" }, { 0x0524, "Specified mode transition, specified by index" }, { 0x0581, "Startup information of all synchronous error OBs before processing" }, { 0x0582, "Startup events of all synchronous error OBs before processing" }, { 0x0591, "Status information of all submodules of the host module" }, { 0x0592, "State of the 24 V power supply of the modules in a central configuration" }, { 0x05a0, "All entries from communications units" }, { 0x0681, "Startup information of all synchronous error OBs of a priority class before processing" }, { 0x0682, "Startup events of all synchronous error OBs of a priority class before processing" }, { 0x0692, "OK state of the expansion racks in the central configuration / of the stations of a DP master system connected via an integrated DP interface" }, { 0x0694, "Status of the expansion racks in the central configuration/the stations of a DP master system/IO controller system that is connected via an integrated DP/PN interface module" }, { 0x0696, "Module status information on all interface modules in a specified module (with PROFIBUS DP and central modules, the interface module level is not present)" }, { 0x06a0, "All entries of the object management system" }, { 0x0781, "Startup information of all OBs of one priority class before processing" }, { 0x0782, "Startup events of all OBs of one priority class before processing" }, { 0x07a0, "All entries of the test and installation function" }, { 0x0822, "Data records of all interrupts of one class and for which the corresponding interrupt OB is loaded, class specified by index" }, { 0x0881, "Startup information of all OBs before processing" }, { 0x0882, "Startup events of all OBs before processing" }, { 0x08a0, "All entries due to operating statuses" }, { 0x0921, "Data records of all interrupts of one class and for which the corresponding interrupt OB is loaded, class specified by index" }, { 0x0922, "Data records of all interrupts for which the corresponding interrupt OB is loaded" }, { 0x0981, "Startup information of all synchronous error OBs being processed" }, { 0x0982, "Startup events of all synchronous error OBs being processed" }, { 0x0991, "Module status information of a DP master system" }, { 0x09a0, "All entries caused by asynchronous errors" }, { 0x0a21, "Data records of all interrupts for which the corresponding interrupt OB is loaded" }, { 0x0a81, "Startup information of all synchronous error OBs of a priority class being processed" }, { 0x0a82, "Startup events of all synchronous error OBs of a priority class being processed" }, { 0x0a91, "Module status information of all DP master systems" }, { 0x0aa0, "All entries caused by synchronous errors" }, { 0x0b81, "Startup information of all OBs of one priority class being processed" }, { 0x0b82, "Startup events of all OBs of one priority class being processed" }, { 0x0ba0, "All entries caused by STOP, abort, mode transition" }, { 0x0c75, "Communication status between the H system and a switched DP slave, slave specified by index" }, { 0x0c81, "Startup information of all OBs being processed" }, { 0x0c82, "Startup events of all OBs being processed" }, { 0x0c91, "Status information of a module in the central rack or connected to an integrated DP communications processor via the logical base address" }, { 0x0c96, "Module status information on a module/interface module centrally or at a PROFIBUS DP/PROFINET interface module via the start address" }, { 0x0ca0, "All entries caused by fault-tolerant/fail-safe events" }, { 0x0d91, "Module status information of all modules in the specified rack/in the specified station (DP or PROFINET)" }, { 0x0da0, "All diagnostic entries" }, { 0x0e91, "Module status information of all configured modules" }, { 0x0ea0, "All user entries" }, { 0x0f00, "List of all the SZL-IDs of a module, only partial list header information" }, { 0x0f11, "Module identification, only partial list header information" }, { 0x0f12, "CPU characteristics, only partial list header information" }, { 0x0f13, "User memory areas, only partial list header information" }, { 0x0f14, "System areas, only partial list header information" }, { 0x0f15, "Block types, only partial list header information" }, { 0x0f16, "Priority classes, only partial list header information" }, { 0x0f17, "List of the permitted SDBs, only partial list header information" }, { 0x0f18, "Maximum S7-300 I/O configuration, only partial list header information" }, { 0x0f19, "Status of the module LEDs, only partial list header information" }, { 0x0f1c, "Component Identification, only partial list header information" }, { 0x0f21, "Interrupt / error assignment, only partial list header information" }, { 0x0f22, "Interrupt status, only partial list header information" }, { 0x0f23, "Priority classes, only partial list header information" }, { 0x0f24, "Modes, only partial list header information" }, { 0x0f31, "Communication capability parameters, only partial list header information" }, { 0x0f32, "Communication status data, only partial list header information" }, { 0x0f33, "Diagnostics: device logon list, only partial list header information" }, { 0x0f37, "Ethernet - Details of a Module, only partial list header information" }, { 0x0f71, "H CPU group information, only partial list header information" }, { 0x0f81, "Start information list, only partial list header information" }, { 0x0f82, "Start event list, only partial list header information" }, { 0x0f90, "DP Master System Information, only partial list header information" }, { 0x0f91, "Module status information, only partial list header information" }, { 0x0f92, "Rack / station status information, only partial list header information" }, { 0x0f94, "Rack / station status information, only partial list header information" }, { 0x0f95, "Extended DP master system information, only partial list header information" }, { 0x0fa0, "Diagnostic buffer of the CPU, only partial list header information" }, { 0x4092, "Expected status of the stations of a DP master system connected via an external DP interface" }, { 0x4292, "Actual status of the stations of a DP master system connected via an external DP interface" }, { 0x4692, "OK state of the stations of a DP master system connected via an external DP interface" }, { 0x4c91, "Status information of a module connected to an external DP communications processor via the logical base address" }, { 0x4f92, "Only partial list header information of the '4x92' list" }, { 0, NULL } }; static value_string_ext szl_id_partlist_ex_names_ext = VALUE_STRING_EXT_INIT(szl_id_partlist_ex_names); static const value_string szl_partial_list_names[] = { { 0x0000, "List of all the SZL-IDs of a module" }, { 0x0011, "Module identification" }, { 0x0012, "CPU characteristics" }, { 0x0013, "User memory areas" }, { 0x0014, "System areas" }, { 0x0015, "Block types" }, { 0x0016, "Priority classes" }, { 0x0017, "List of the permitted SDBs with a number < 1000" }, { 0x0018, "Maximum S7-300 I/O configuration" }, { 0x0019, "Status of the module LEDs" }, { 0x001c, "Component Identification" }, { 0x0021, "Interrupt / error assignment" }, { 0x0022, "Interrupt status" }, { 0x0023, "Priority classes" }, { 0x0024, "Modes" }, { 0x0025, "Assignment between process image partitions and OBs" }, { 0x0031, "Communication capability parameters" }, { 0x0032, "Communication status data" }, { 0x0033, "Diagnostics: device logon list" }, { 0x0037, "Ethernet - Details of a Module" }, { 0x0071, "H CPU group information" }, { 0x0074, "Status of the module LEDs" }, { 0x0075, "Switched DP slaves in the H-system" }, { 0x0081, "Start information list" }, { 0x0082, "Start event list" }, { 0x0090, "DP Master System Information" }, { 0x0091, "Module status information" }, { 0x0092, "Rack / station status information" }, { 0x0094, "Rack / station status information" }, { 0x0095, "Extended DP master system information" }, { 0x0096, "Module status information, PROFINET IO and PROFIBUS DP" }, { 0x00a0, "Diagnostic buffer of the CPU" }, { 0x00b1, "Module diagnostic information (data record 0)" }, { 0x00b2, "Module diagnostic information (data record 1), geographical address" }, { 0x00b3, "Module diagnostic information (data record 1), logical address" }, { 0x00b4, "Diagnostic data of a DP slave" }, { 0, NULL } }; static value_string_ext szl_partial_list_names_ext = VALUE_STRING_EXT_INIT(szl_partial_list_names); static gint hf_s7comm_userdata_szl_index = -1; /* SZL index */ static gint hf_s7comm_userdata_szl_tree = -1; /* SZL item tree */ /* Index description for SZL Requests */ static const value_string szl_0111_index_names[] = { { 0x0001, "Identification of the module" }, { 0x0006, "Identification of the basic hardware" }, { 0x0007, "Identification of the basic firmware" }, { 0x0081, "Identification of the firmware-extension" }, { 0, NULL } }; static const value_string szl_0112_index_names[] = { { 0x0000, "MC7 processing unit" }, { 0x0100, "Time system" }, { 0x0200, "System response" }, { 0x0300, "Language description of the CPU" }, { 0x0400, "Availability of SFC 87 and SFC 88" }, { 0, NULL } }; static const value_string szl_0113_index_names[] = { { 0x0001, "Work memory" }, { 0x0002, "Load memory integrated" }, { 0x0003, "Load memory plugged in" }, { 0x0004, "Maximum plug-in load memory" }, { 0x0005, "Size of the backup memory" }, { 0x0006, "Size of the memory reserved by the system for CFBs" }, { 0, NULL } }; static const value_string szl_0114_index_names[] = { { 0x0001, "PII (number in bytes)" }, { 0x0002, "PIQ (number in bytes)" }, { 0x0003, "Memory (number)" }, { 0x0004, "Timers (number)" }, { 0x0005, "Counters (number)" }, { 0x0006, "Number of bytes in the logical address area" }, { 0x0007, "Size of the entire local data area of the CPU in bytes" }, { 0x0008, "Memory (number in bytes)" }, { 0x0009, "Local data (entire local data area of the CPU in Kbytes)" }, { 0, NULL } }; static const value_string szl_0115_index_names[] = { { 0x0800, "OB" }, { 0x0a00, "DB" }, { 0x0b00, "SDB" }, { 0x0c00, "FC" }, { 0x0e00, "FB" }, { 0, NULL } }; static const value_string szl_0116_index_names[] = { { 0x0000, "Free cycle" }, { 0x000a, "Time-of-day interrupt" }, { 0x0014, "Time-delay interrupt" }, { 0x001e, "Cyclic interrupt" }, { 0x0028, "Hardware interrupt" }, { 0x0050, "Asynchronous error interrupt" }, { 0x005a, "Background" }, { 0x0064, "Startup" }, { 0x0078, "Synchronous error interrupt" }, { 0, NULL } }; static const value_string szl_0118_index_names[] = { { 0x0001, "Number of the rack: 1" }, { 0x0002, "Number of the rack: 2" }, { 0x0003, "Number of the rack: 3" }, { 0x00ff, "Maximum number of racks (racknr) and total number of possible slots (anzst)" }, { 0, NULL } }; static const value_string szl_0121_index_names[] = { { 0x0000, "Free cycle" }, { 0x0a0a, "Time-of-day interrupt" }, { 0x1414, "Time-delay interrupt" }, { 0x1e23, "Cyclic interrupt" }, { 0x2828, "Hardware interrupt" }, { 0x5050, "Asynchronous error interrupt" }, { 0x005a, "Background" }, { 0x0064, "Startup" }, { 0x7878, "Synchronous error interrupt" }, { 0, NULL } }; static const value_string szl_0222_index_names[] = { { 0x0000, "Free cycle" }, { 0x000a, "Time-of-day interrupt" }, { 0x0014, "Time-delay interrupt" }, { 0x001e, "Cyclic interrupt" }, { 0x0028, "Hardware interrupt" }, { 0x0032, "DP interrupt" }, { 0x003c, "Multicomputing or synchronous cycle (isochrone) interrupt" }, { 0x0048, "Redundancy interrupt (on with S7-400H systems)" }, { 0x0050, "Asynchronous error interrupt" }, { 0x005a, "Background" }, { 0x0064, "Startup" }, { 0x0078, "Synchronous error interrupt" }, { 0, NULL } }; static const value_string szl_0524_index_names[] = { { 0x5000, "Mode STOP" }, { 0x5010, "Mode STARTUP" }, { 0x5020, "Mode RUN" }, { 0x5030, "Mode HOLD" }, { 0x4520, "Mode DEFECT" }, { 0, NULL } }; static const value_string szl_0131_index_names[] = { { 0x0001, "General data for communication" }, { 0x0002, "Test and installation function constants" }, { 0x0003, "Operator interface (O/I)" }, { 0x0004, "Object management system (OMS)" }, { 0x0005, "Diagnostics" }, { 0x0006, "Communication function block (CFB)" }, { 0x0007, "Global data" }, { 0x0008, "Test and installation function time information" }, { 0x0009, "Time-of-day capability parameters" }, { 0x0010, "Message parameters" }, { 0x0011, "SCAN capability parameters" }, { 0, NULL } }; static const value_string szl_0132_index_names[] = { { 0x0001, "General data for communication" }, { 0x0002, "Test and installation status" }, { 0x0003, "Operator interface status" }, { 0x0004, "Object management system status" }, { 0x0005, "Diagnostics" }, { 0x0006, "Data exchange with CFBs" }, { 0x0007, "Global data" }, { 0x0008, "Time system" }, { 0x0009, "MPI status" }, { 0x000a, "Communication bus status" }, { 0x000b, "32-bit runtime meters 0-7" }, { 0x000c, "32-bit runtime meters 8-15" }, { 0x0010, "S7-SCAN part 1" }, { 0x0011, "S7-SCAN part 2" }, { 0, NULL } }; static const value_string szl_0119_0174_ledid_index_names[] = { { 0x0001, "SF (group error)" }, { 0x0002, "INTF (internal error)" }, { 0x0003, "EXTF (external error)" }, { 0x0004, "RUN" }, { 0x0005, "STOP" }, { 0x0006, "FRCE (force)" }, { 0x0007, "CRST (cold restart)" }, { 0x0008, "BAF (battery fault/overload, short circuit of battery voltage on bus)" }, { 0x0009, "USR (user-defined)" }, { 0x000a, "USR1 (user-defined)" }, { 0x000b, "BUS1F (bus error interface 1)" }, { 0x000c, "BUS2F (bus error interface 2)" }, { 0x000d, "REDF (redundancy error)" }, { 0x000e, "MSTR (master)" }, { 0x000f, "RACK0 (rack number 0)" }, { 0x0010, "RACK1 (rack number 1)" }, { 0x0011, "RACK2 (rack number 2)" }, { 0x0012, "IFM1F (interface error interface module 1)" }, { 0x0013, "IFM2F (interface error interface module 2)" }, { 0x0014, "BUS3F (bus fault interface 3)" }, { 0x0015, "MAINT (maintenance demand)" }, { 0x0016, "DC24V" }, { 0x0080, "IF (init failure)" }, { 0x0081, "UF (user failure)" }, { 0x0082, "MF (monitoring failure)" }, { 0x0083, "CF (communication failure)" }, { 0x0084, "TF (task failure)" }, { 0x00ec, "APPL_STATE_RED" }, { 0x00ed, "APPL_STATE_GREEN" }, { 0, NULL } }; static const value_string szl_xy1c_index_names[] = { { 0x0001, "Name of the automation system" }, { 0x0002, "Name of the module" }, { 0x0003, "Plant designation of the module" }, { 0x0004, "Copyright entry" }, { 0x0005, "Serial number of the module" }, { 0x0007, "Module type name" }, { 0x0008, "Serial number of the memory card" }, { 0x0009, "Manufacturer and profile of a CPU module" }, { 0x000a, "OEM ID of a module" }, { 0x000b, "Location ID of a module" }, { 0, NULL } }; /* Header fields of the SZL */ static gint hf_s7comm_szl_0000_0000_szl_id = -1; static gint hf_s7comm_szl_0000_0000_module_type_class = -1; static gint hf_s7comm_szl_0000_0000_partlist_extr_nr = -1; static gint hf_s7comm_szl_0000_0000_partlist_nr = -1; static gint hf_s7comm_szl_xy12_0x00_charac = -1; static const value_string szl_xy12_cpu_characteristic_names[] = { { 0x0000, "MC7 processing unit group" }, { 0x0001, "MC7 processing generating code" }, { 0x0002, "MC7 interpreter" }, { 0x0100, "Time system group" }, { 0x0101, "1 ms resolution" }, { 0x0102, "10 ms resolution" }, { 0x0103, "No real time clock" }, { 0x0104, "BCD time-of-day format" }, { 0x0105, "All time-of-day functions (set time-of-day, set and read time-of-day, time-of-day synchronization: time-of-day slave and time-of-day master)" }, { 0x0106, "SFC 78 OB_RT is available" }, { 0x0200, "System response group" }, { 0x0201, "Capable of multiprocessor mode" }, { 0x0202, "Cold restart, warm restart and hot restart possible" }, { 0x0203, "Cold restart and hot restart possible" }, { 0x0204, "Warm restart and hot restart possible" }, { 0x0205, "Only warm restart possible" }, { 0x0206, "New distributed I/O configuration is possible during RUN by using predefined resources" }, { 0x0207, "H-CPU in stand-alone mode: New distributed I/O configuration is possible during RUN by using predefined resources" }, { 0x0208, "For taking motion control functionality into account" }, { 0x0300, "Language description of the CPU group" }, { 0x0301, "Reserved" }, { 0x0302, "All 32 bit fixed-point instructions" }, { 0x0303, "All floating-point instructions" }, { 0x0304, "sin, asin, cos, acos, tan, atan, sqr, sqrt, ln, exp" }, { 0x0305, "Accumulator 3/accumulator 4 with corresponding instructions (ENT,PUSH,POP,LEAVE)" }, { 0x0306, "Master Control Relay instructions" }, { 0x0307, "Address register 1 exists with corresponding instructions" }, { 0x0308, "Address register 2 exists with corresponding instructions" }, { 0x0309, "Operations for area-crossing addressing" }, { 0x030A, "Operations for area-internal addressing" }, { 0x030B, "All memory-indirect addressing instructions for bit memory (M)" }, { 0x030C, "All memory-indirect addressing instructions for data blocks (DB)" }, { 0x030D, "All memory-indirect addressing instructions for data blocks (DI)" }, { 0x030E, "All memory-indirect addressing instructions for local data (L)" }, { 0x030F, "All instructions for parameter transfer in FCs" }, { 0x0310, "Memory bit edge instructions for process image input (I)" }, { 0x0311, "Memory bit edge instructions for process image output (Q)" }, { 0x0312, "Memory bit edge instructions for bit memory (M)" }, { 0x0313, "Memory bit edge instructions for data blocks (DB)" }, { 0x0314, "Memory bit edge instructions for data blocks (DI)" }, { 0x0315, "Memory bit edge instructions for local data (L)" }, { 0x0316, "Dynamic evaluation of the FC bit" }, { 0x0317, "Dynamic local data area with the corresponding instructions" }, { 0x0318, "Reserved" }, { 0x0319, "Reserved" }, { 0x0401, "SFC 87 C_DIAG is available" }, { 0x0402, "SFC 88 C_CNTRL is available" }, { 0, NULL } }; static gint hf_s7comm_szl_0013_0000_index = -1; static gint hf_s7comm_szl_0013_0000_code = -1; static const value_string szl_memory_type_names[] = { { 0x0001, "volatile memory (RAM)" }, { 0x0002, "non-volatile memory (FEPROM)" }, { 0x0003, "mixed memory (RAM + FEPROM)" }, { 0, NULL } }; static gint hf_s7comm_szl_0013_0000_size = -1; static gint hf_s7comm_szl_0013_0000_mode = -1; static gint hf_s7comm_szl_0013_0000_mode_0 = -1; static gint hf_s7comm_szl_0013_0000_mode_1 = -1; static gint hf_s7comm_szl_0013_0000_mode_2 = -1; static gint hf_s7comm_szl_0013_0000_mode_3 = -1; static gint hf_s7comm_szl_0013_0000_mode_4 = -1; static gint hf_s7comm_szl_0013_0000_granu = -1; static gint hf_s7comm_szl_0013_0000_ber1 = -1; static gint hf_s7comm_szl_0013_0000_belegt1 = -1; static gint hf_s7comm_szl_0013_0000_block1 = -1; static gint hf_s7comm_szl_0013_0000_ber2 = -1; static gint hf_s7comm_szl_0013_0000_belegt2 = -1; static gint hf_s7comm_szl_0013_0000_block2 = -1; static gint hf_s7comm_szl_xy11_0001_index = -1; static gint hf_s7comm_szl_xy11_0001_mlfb = -1; static gint hf_s7comm_szl_xy11_0001_bgtyp = -1; static gint hf_s7comm_szl_xy11_0001_ausbg = -1; static gint hf_s7comm_szl_xy11_0001_ausbe = -1; static gint hf_s7comm_szl_xy14_000x_index = -1; static gint hf_s7comm_szl_xy14_000x_code = -1; static gint hf_s7comm_szl_xy14_000x_quantity = -1; static gint hf_s7comm_szl_xy14_000x_reman = -1; static gint hf_s7comm_szl_xy15_000x_index = -1; static gint hf_s7comm_szl_xy15_000x_maxanz = -1; static gint hf_s7comm_szl_xy15_000x_maxlng = -1; static gint hf_s7comm_szl_xy15_000x_maxabl = -1; static gint hf_s7comm_szl_xy22_00xx_info = -1; static gint hf_s7comm_szl_xy22_00xx_al1 = -1; static gint hf_s7comm_szl_xy22_00xx_al1_0 = -1; static gint hf_s7comm_szl_xy22_00xx_al1_1 = -1; static gint hf_s7comm_szl_xy22_00xx_al1_2 = -1; static gint hf_s7comm_szl_xy22_00xx_al1_4 = -1; static gint hf_s7comm_szl_xy22_00xx_al1_5 = -1; static gint hf_s7comm_szl_xy22_00xx_al1_6 = -1; static gint hf_s7comm_szl_xy22_00xx_al2 = -1; static gint hf_s7comm_szl_xy22_00xx_al2_0 = -1; static gint hf_s7comm_szl_xy22_00xx_al2_1 = -1; static gint hf_s7comm_szl_xy22_00xx_al2_2 = -1; static gint hf_s7comm_szl_xy22_00xx_al2_3 = -1; static gint hf_s7comm_szl_xy22_00xx_al3 = -1; static gint ett_s7comm_szl_xy22_00xx_al1 = -1; static int * const s7comm_szl_xy22_00xx_al1_fields[] = { &hf_s7comm_szl_xy22_00xx_al1_0, &hf_s7comm_szl_xy22_00xx_al1_1, &hf_s7comm_szl_xy22_00xx_al1_2, &hf_s7comm_szl_xy22_00xx_al1_4, &hf_s7comm_szl_xy22_00xx_al1_5, &hf_s7comm_szl_xy22_00xx_al1_6, NULL }; static gint ett_s7comm_szl_xy22_00xx_al2 = -1; static int * const s7comm_szl_xy22_00xx_al2_fields[] = { &hf_s7comm_szl_xy22_00xx_al2_0, &hf_s7comm_szl_xy22_00xx_al2_1, &hf_s7comm_szl_xy22_00xx_al2_2, &hf_s7comm_szl_xy22_00xx_al2_3, NULL }; static gint hf_s7comm_szl_0131_0001_index = -1; static gint hf_s7comm_szl_0131_0001_pdu = -1; static gint hf_s7comm_szl_0131_0001_anz= -1; static gint hf_s7comm_szl_0131_0001_mpi_bps = -1; static gint hf_s7comm_szl_0131_0001_kbus_bps = -1; static gint hf_s7comm_szl_0131_0001_res = -1; static gint hf_s7comm_szl_0131_0002_index = -1; static gint hf_s7comm_szl_0131_0002_funkt_0 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_0 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_1 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_2 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_3 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_4 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_5 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_6 = -1; static gint hf_s7comm_szl_0131_0002_funkt_0_7 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_0 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_1 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_2 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_3 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_4 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_5 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_6 = -1; static gint hf_s7comm_szl_0131_0002_funkt_1_7 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_0 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_1 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_2 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_3 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_4 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_5 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_6 = -1; static gint hf_s7comm_szl_0131_0002_funkt_2_7 = -1; static gint hf_s7comm_szl_0131_0002_funkt_3 = -1; static gint hf_s7comm_szl_0131_0002_funkt_4 = -1; static gint hf_s7comm_szl_0131_0002_funkt_5 = -1; static gint hf_s7comm_szl_0131_0002_aseg = -1; static gint hf_s7comm_szl_0131_0002_eseg = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_0 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_1 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_2 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_3 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_4 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_5 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_6 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_0_7 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_0 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_1 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_2 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_3 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_4 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_5 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_6 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_1_7 = -1; static gint hf_s7comm_szl_0131_0002_trgereig_2 = -1; static gint hf_s7comm_szl_0131_0002_trgbed = -1; static gint hf_s7comm_szl_0131_0002_pfad = -1; static gint hf_s7comm_szl_0131_0002_tiefe = -1; static gint hf_s7comm_szl_0131_0002_systrig = -1; static gint hf_s7comm_szl_0131_0002_erg_par = -1; static gint hf_s7comm_szl_0131_0002_erg_pat_1 = -1; static gint hf_s7comm_szl_0131_0002_erg_pat_2 = -1; static gint hf_s7comm_szl_0131_0002_force = -1; static gint hf_s7comm_szl_0131_0002_time = -1; static gint hf_s7comm_szl_0131_0002_res = -1; static gint ett_s7comm_szl_0131_0002_funkt_0 = -1; static int * const s7comm_szl_0131_0002_funkt_0_fields[] = { &hf_s7comm_szl_0131_0002_funkt_0_0, &hf_s7comm_szl_0131_0002_funkt_0_1, &hf_s7comm_szl_0131_0002_funkt_0_2, &hf_s7comm_szl_0131_0002_funkt_0_3, &hf_s7comm_szl_0131_0002_funkt_0_4, &hf_s7comm_szl_0131_0002_funkt_0_5, &hf_s7comm_szl_0131_0002_funkt_0_6, &hf_s7comm_szl_0131_0002_funkt_0_7, NULL }; static gint ett_s7comm_szl_0131_0002_funkt_1 = -1; static int * const s7comm_szl_0131_0002_funkt_1_fields[] = { &hf_s7comm_szl_0131_0002_funkt_1_0, &hf_s7comm_szl_0131_0002_funkt_1_1, &hf_s7comm_szl_0131_0002_funkt_1_2, &hf_s7comm_szl_0131_0002_funkt_1_3, &hf_s7comm_szl_0131_0002_funkt_1_4, &hf_s7comm_szl_0131_0002_funkt_1_5, &hf_s7comm_szl_0131_0002_funkt_1_6, &hf_s7comm_szl_0131_0002_funkt_1_7, NULL }; static gint ett_s7comm_szl_0131_0002_funkt_2 = -1; static int * const s7comm_szl_0131_0002_funkt_2_fields[] = { &hf_s7comm_szl_0131_0002_funkt_2_0, &hf_s7comm_szl_0131_0002_funkt_2_1, &hf_s7comm_szl_0131_0002_funkt_2_2, &hf_s7comm_szl_0131_0002_funkt_2_3, &hf_s7comm_szl_0131_0002_funkt_2_4, &hf_s7comm_szl_0131_0002_funkt_2_5, &hf_s7comm_szl_0131_0002_funkt_2_6, &hf_s7comm_szl_0131_0002_funkt_2_7, NULL }; static gint ett_s7comm_szl_0131_0002_trgereig_0 = -1; static int * const s7comm_szl_0131_0002_trgereig_0_fields[] = { &hf_s7comm_szl_0131_0002_trgereig_0_0, &hf_s7comm_szl_0131_0002_trgereig_0_1, &hf_s7comm_szl_0131_0002_trgereig_0_2, &hf_s7comm_szl_0131_0002_trgereig_0_3, &hf_s7comm_szl_0131_0002_trgereig_0_4, &hf_s7comm_szl_0131_0002_trgereig_0_5, &hf_s7comm_szl_0131_0002_trgereig_0_6, &hf_s7comm_szl_0131_0002_trgereig_0_7, NULL }; static gint ett_s7comm_szl_0131_0002_trgereig_1 = -1; static int * const s7comm_szl_0131_0002_trgereig_1_fields[] = { &hf_s7comm_szl_0131_0002_trgereig_1_0, &hf_s7comm_szl_0131_0002_trgereig_1_1, &hf_s7comm_szl_0131_0002_trgereig_1_2, &hf_s7comm_szl_0131_0002_trgereig_1_3, &hf_s7comm_szl_0131_0002_trgereig_1_4, &hf_s7comm_szl_0131_0002_trgereig_1_5, &hf_s7comm_szl_0131_0002_trgereig_1_6, &hf_s7comm_szl_0131_0002_trgereig_1_7, NULL }; static gint hf_s7comm_szl_0131_0003_index = -1; static gint hf_s7comm_szl_0131_0003_funkt_0 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_0 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_1 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_2 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_3 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_4 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_5 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_6 = -1; static gint hf_s7comm_szl_0131_0003_funkt_0_7 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_0 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_1 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_2 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_3 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_4 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_5 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_6 = -1; static gint hf_s7comm_szl_0131_0003_funkt_1_7 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_0 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_1 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_2 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_3 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_4 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_5 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_6 = -1; static gint hf_s7comm_szl_0131_0003_funkt_2_7 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_0 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_1 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_2 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_3 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_4 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_5 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_6 = -1; static gint hf_s7comm_szl_0131_0003_funkt_3_7 = -1; static gint hf_s7comm_szl_0131_0003_data = -1; static gint hf_s7comm_szl_0131_0003_anz = -1; static gint hf_s7comm_szl_0131_0003_per_min = -1; static gint hf_s7comm_szl_0131_0003_per_max = -1; static gint hf_s7comm_szl_0131_0003_res = -1; static gint ett_s7comm_szl_0131_0003_funkt_0 = -1; static int * const s7comm_szl_0131_0003_funkt_0_fields[] = { &hf_s7comm_szl_0131_0003_funkt_0_0, &hf_s7comm_szl_0131_0003_funkt_0_1, &hf_s7comm_szl_0131_0003_funkt_0_2, &hf_s7comm_szl_0131_0003_funkt_0_3, &hf_s7comm_szl_0131_0003_funkt_0_4, &hf_s7comm_szl_0131_0003_funkt_0_5, &hf_s7comm_szl_0131_0003_funkt_0_6, &hf_s7comm_szl_0131_0003_funkt_0_7, NULL }; static gint ett_s7comm_szl_0131_0003_funkt_1 = -1; static int * const s7comm_szl_0131_0003_funkt_1_fields[] = { &hf_s7comm_szl_0131_0003_funkt_1_0, &hf_s7comm_szl_0131_0003_funkt_1_1, &hf_s7comm_szl_0131_0003_funkt_1_2, &hf_s7comm_szl_0131_0003_funkt_1_3, &hf_s7comm_szl_0131_0003_funkt_1_4, &hf_s7comm_szl_0131_0003_funkt_1_5, &hf_s7comm_szl_0131_0003_funkt_1_6, &hf_s7comm_szl_0131_0003_funkt_1_7, NULL }; static gint ett_s7comm_szl_0131_0003_funkt_2 = -1; static int * const s7comm_szl_0131_0003_funkt_2_fields[] = { &hf_s7comm_szl_0131_0003_funkt_2_0, &hf_s7comm_szl_0131_0003_funkt_2_1, &hf_s7comm_szl_0131_0003_funkt_2_2, &hf_s7comm_szl_0131_0003_funkt_2_3, &hf_s7comm_szl_0131_0003_funkt_2_4, &hf_s7comm_szl_0131_0003_funkt_2_5, &hf_s7comm_szl_0131_0003_funkt_2_6, &hf_s7comm_szl_0131_0003_funkt_2_7, NULL }; static gint ett_s7comm_szl_0131_0003_funkt_3 = -1; static int * const s7comm_szl_0131_0003_funkt_3_fields[] = { &hf_s7comm_szl_0131_0003_funkt_3_0, &hf_s7comm_szl_0131_0003_funkt_3_1, &hf_s7comm_szl_0131_0003_funkt_3_2, &hf_s7comm_szl_0131_0003_funkt_3_3, &hf_s7comm_szl_0131_0003_funkt_3_4, &hf_s7comm_szl_0131_0003_funkt_3_5, &hf_s7comm_szl_0131_0003_funkt_3_6, &hf_s7comm_szl_0131_0003_funkt_3_7, NULL }; static gint hf_s7comm_szl_0131_0004_index = -1; static gint hf_s7comm_szl_0131_0004_funkt_0 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_0 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_1 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_2 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_3 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_4 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_5 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_6 = -1; static gint hf_s7comm_szl_0131_0004_funkt_0_7 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_0 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_1 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_2 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_3 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_4 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_5 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_6 = -1; static gint hf_s7comm_szl_0131_0004_funkt_1_7 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_0 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_1 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_2 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_3 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_4 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_5 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_6 = -1; static gint hf_s7comm_szl_0131_0004_funkt_2_7 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_0 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_1 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_2 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_3 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_4 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_5 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_6 = -1; static gint hf_s7comm_szl_0131_0004_funkt_3_7 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_0 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_1 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_2 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_3 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_4 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_5 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_6 = -1; static gint hf_s7comm_szl_0131_0004_funkt_4_7 = -1; static gint hf_s7comm_szl_0131_0004_funkt_5 = -1; static gint hf_s7comm_szl_0131_0004_funkt_6 = -1; static gint hf_s7comm_szl_0131_0004_funkt_7 = -1; static gint hf_s7comm_szl_0131_0004_kop = -1; static gint hf_s7comm_szl_0131_0004_del = -1; static gint hf_s7comm_szl_0131_0004_kett = -1; static gint hf_s7comm_szl_0131_0004_hoch = -1; static gint hf_s7comm_szl_0131_0004_ver = -1; static gint hf_s7comm_szl_0131_0004_res = -1; static gint ett_s7comm_szl_0131_0004_funkt_0 = -1; static int * const s7comm_szl_0131_0004_funkt_0_fields[] = { &hf_s7comm_szl_0131_0004_funkt_0_0, &hf_s7comm_szl_0131_0004_funkt_0_1, &hf_s7comm_szl_0131_0004_funkt_0_2, &hf_s7comm_szl_0131_0004_funkt_0_3, &hf_s7comm_szl_0131_0004_funkt_0_4, &hf_s7comm_szl_0131_0004_funkt_0_5, &hf_s7comm_szl_0131_0004_funkt_0_6, &hf_s7comm_szl_0131_0004_funkt_0_7, NULL }; static gint ett_s7comm_szl_0131_0004_funkt_1 = -1; static int * const s7comm_szl_0131_0004_funkt_1_fields[] = { &hf_s7comm_szl_0131_0004_funkt_1_0, &hf_s7comm_szl_0131_0004_funkt_1_1, &hf_s7comm_szl_0131_0004_funkt_1_2, &hf_s7comm_szl_0131_0004_funkt_1_3, &hf_s7comm_szl_0131_0004_funkt_1_4, &hf_s7comm_szl_0131_0004_funkt_1_5, &hf_s7comm_szl_0131_0004_funkt_1_6, &hf_s7comm_szl_0131_0004_funkt_1_7, NULL }; static gint ett_s7comm_szl_0131_0004_funkt_2 = -1; static int * const s7comm_szl_0131_0004_funkt_2_fields[] = { &hf_s7comm_szl_0131_0004_funkt_2_0, &hf_s7comm_szl_0131_0004_funkt_2_1, &hf_s7comm_szl_0131_0004_funkt_2_2, &hf_s7comm_szl_0131_0004_funkt_2_3, &hf_s7comm_szl_0131_0004_funkt_2_4, &hf_s7comm_szl_0131_0004_funkt_2_5, &hf_s7comm_szl_0131_0004_funkt_2_6, &hf_s7comm_szl_0131_0004_funkt_2_7, NULL }; static gint ett_s7comm_szl_0131_0004_funkt_3 = -1; static int * const s7comm_szl_0131_0004_funkt_3_fields[] = { &hf_s7comm_szl_0131_0004_funkt_3_0, &hf_s7comm_szl_0131_0004_funkt_3_1, &hf_s7comm_szl_0131_0004_funkt_3_2, &hf_s7comm_szl_0131_0004_funkt_3_3, &hf_s7comm_szl_0131_0004_funkt_3_4, &hf_s7comm_szl_0131_0004_funkt_3_5, &hf_s7comm_szl_0131_0004_funkt_3_6, &hf_s7comm_szl_0131_0004_funkt_3_7, NULL }; static gint ett_s7comm_szl_0131_0004_funkt_4 = -1; static int * const s7comm_szl_0131_0004_funkt_4_fields[] = { &hf_s7comm_szl_0131_0004_funkt_4_0, &hf_s7comm_szl_0131_0004_funkt_4_1, &hf_s7comm_szl_0131_0004_funkt_4_2, &hf_s7comm_szl_0131_0004_funkt_4_3, &hf_s7comm_szl_0131_0004_funkt_4_4, &hf_s7comm_szl_0131_0004_funkt_4_5, &hf_s7comm_szl_0131_0004_funkt_4_6, &hf_s7comm_szl_0131_0004_funkt_4_7, NULL }; static gint hf_s7comm_szl_0131_0005_index = -1; static gint hf_s7comm_szl_0131_0005_funkt_0 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_0 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_1 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_2 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_3 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_4 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_5 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_6 = -1; static gint hf_s7comm_szl_0131_0005_funkt_0_7 = -1; static gint hf_s7comm_szl_0131_0005_funkt_1 = -1; static gint hf_s7comm_szl_0131_0005_funkt_2 = -1; static gint hf_s7comm_szl_0131_0005_funkt_3 = -1; static gint hf_s7comm_szl_0131_0005_funkt_4 = -1; static gint hf_s7comm_szl_0131_0005_funkt_5 = -1; static gint hf_s7comm_szl_0131_0005_funkt_6 = -1; static gint hf_s7comm_szl_0131_0005_funkt_7 = -1; static gint hf_s7comm_szl_0131_0005_anz_sen = -1; static gint hf_s7comm_szl_0131_0005_anz_ein = -1; static gint hf_s7comm_szl_0131_0005_anz_mel = -1; static gint hf_s7comm_szl_0131_0005_res = -1; static gint ett_s7comm_szl_0131_0005_funkt_0 = -1; static int * const s7comm_szl_0131_0005_funkt_0_fields[] = { &hf_s7comm_szl_0131_0005_funkt_0_0, &hf_s7comm_szl_0131_0005_funkt_0_1, &hf_s7comm_szl_0131_0005_funkt_0_2, &hf_s7comm_szl_0131_0005_funkt_0_3, &hf_s7comm_szl_0131_0005_funkt_0_4, &hf_s7comm_szl_0131_0005_funkt_0_5, &hf_s7comm_szl_0131_0005_funkt_0_6, &hf_s7comm_szl_0131_0005_funkt_0_7, NULL }; static gint hf_s7comm_szl_0131_0006_index = -1; static gint hf_s7comm_szl_0131_0006_funkt_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_0_7 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_1_7 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_2_7 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_3_7 = -1; static gint hf_s7comm_szl_0131_0006_funkt_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_6_7 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_0 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_1 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_2 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_3 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_4 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_5 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_6 = -1; static gint hf_s7comm_szl_0131_0006_funkt_7_7 = -1; static gint hf_s7comm_szl_0131_0006_schnell = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_0_7 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_1_7 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_2_7 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_3_7 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_6_7 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_0 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_1 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_2 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_3 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_4 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_5 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_6 = -1; static gint hf_s7comm_szl_0131_0006_zugtyp_7_7 = -1; static gint hf_s7comm_szl_0131_0006_res1 = -1; static gint hf_s7comm_szl_0131_0006_max_sd_empf = -1; static gint hf_s7comm_szl_0131_0006_max_sd_al8p = -1; static gint hf_s7comm_szl_0131_0006_max_inst = -1; static gint hf_s7comm_szl_0131_0006_res2 = -1; static gint hf_s7comm_szl_0131_0006_verb_proj = -1; static gint hf_s7comm_szl_0131_0006_verb_prog = -1; static gint hf_s7comm_szl_0131_0006_res3 = -1; static gint ett_s7comm_szl_0131_0006_funkt_0 = -1; static int * const s7comm_szl_0131_0006_funkt_0_fields[] = { &hf_s7comm_szl_0131_0006_funkt_0_0, &hf_s7comm_szl_0131_0006_funkt_0_1, &hf_s7comm_szl_0131_0006_funkt_0_2, &hf_s7comm_szl_0131_0006_funkt_0_3, &hf_s7comm_szl_0131_0006_funkt_0_4, &hf_s7comm_szl_0131_0006_funkt_0_5, &hf_s7comm_szl_0131_0006_funkt_0_6, &hf_s7comm_szl_0131_0006_funkt_0_7, NULL }; static gint ett_s7comm_szl_0131_0006_funkt_1 = -1; static int * const s7comm_szl_0131_0006_funkt_1_fields[] = { &hf_s7comm_szl_0131_0006_funkt_1_0, &hf_s7comm_szl_0131_0006_funkt_1_1, &hf_s7comm_szl_0131_0006_funkt_1_2, &hf_s7comm_szl_0131_0006_funkt_1_3, &hf_s7comm_szl_0131_0006_funkt_1_4, &hf_s7comm_szl_0131_0006_funkt_1_5, &hf_s7comm_szl_0131_0006_funkt_1_6, &hf_s7comm_szl_0131_0006_funkt_1_7, NULL }; static gint ett_s7comm_szl_0131_0006_funkt_2 = -1; static int * const s7comm_szl_0131_0006_funkt_2_fields[] = { &hf_s7comm_szl_0131_0006_funkt_2_0, &hf_s7comm_szl_0131_0006_funkt_2_1, &hf_s7comm_szl_0131_0006_funkt_2_2, &hf_s7comm_szl_0131_0006_funkt_2_3, &hf_s7comm_szl_0131_0006_funkt_2_4, &hf_s7comm_szl_0131_0006_funkt_2_5, &hf_s7comm_szl_0131_0006_funkt_2_6, &hf_s7comm_szl_0131_0006_funkt_2_7, NULL }; static gint ett_s7comm_szl_0131_0006_funkt_3 = -1; static int * const s7comm_szl_0131_0006_funkt_3_fields[] = { &hf_s7comm_szl_0131_0006_funkt_3_0, &hf_s7comm_szl_0131_0006_funkt_3_1, &hf_s7comm_szl_0131_0006_funkt_3_2, &hf_s7comm_szl_0131_0006_funkt_3_3, &hf_s7comm_szl_0131_0006_funkt_3_4, &hf_s7comm_szl_0131_0006_funkt_3_5, &hf_s7comm_szl_0131_0006_funkt_3_6, &hf_s7comm_szl_0131_0006_funkt_3_7, NULL }; static gint ett_s7comm_szl_0131_0006_funkt_6 = -1; static int * const s7comm_szl_0131_0006_funkt_6_fields[] = { &hf_s7comm_szl_0131_0006_funkt_6_0, &hf_s7comm_szl_0131_0006_funkt_6_1, &hf_s7comm_szl_0131_0006_funkt_6_2, &hf_s7comm_szl_0131_0006_funkt_6_3, &hf_s7comm_szl_0131_0006_funkt_6_4, &hf_s7comm_szl_0131_0006_funkt_6_5, &hf_s7comm_szl_0131_0006_funkt_6_6, &hf_s7comm_szl_0131_0006_funkt_6_7, NULL }; static gint ett_s7comm_szl_0131_0006_funkt_7 = -1; static int * const s7comm_szl_0131_0006_funkt_7_fields[] = { &hf_s7comm_szl_0131_0006_funkt_7_0, &hf_s7comm_szl_0131_0006_funkt_7_1, &hf_s7comm_szl_0131_0006_funkt_7_2, &hf_s7comm_szl_0131_0006_funkt_7_3, &hf_s7comm_szl_0131_0006_funkt_7_4, &hf_s7comm_szl_0131_0006_funkt_7_5, &hf_s7comm_szl_0131_0006_funkt_7_6, &hf_s7comm_szl_0131_0006_funkt_7_7, NULL }; static gint ett_s7comm_szl_0131_0006_zugtyp_0 = -1; static int * const s7comm_szl_0131_0006_zugtyp_0_fields[] = { &hf_s7comm_szl_0131_0006_zugtyp_0_0, &hf_s7comm_szl_0131_0006_zugtyp_0_1, &hf_s7comm_szl_0131_0006_zugtyp_0_2, &hf_s7comm_szl_0131_0006_zugtyp_0_3, &hf_s7comm_szl_0131_0006_zugtyp_0_4, &hf_s7comm_szl_0131_0006_zugtyp_0_5, &hf_s7comm_szl_0131_0006_zugtyp_0_6, &hf_s7comm_szl_0131_0006_zugtyp_0_7, NULL }; static gint ett_s7comm_szl_0131_0006_zugtyp_1 = -1; static int * const s7comm_szl_0131_0006_zugtyp_1_fields[] = { &hf_s7comm_szl_0131_0006_zugtyp_1_0, &hf_s7comm_szl_0131_0006_zugtyp_1_1, &hf_s7comm_szl_0131_0006_zugtyp_1_2, &hf_s7comm_szl_0131_0006_zugtyp_1_3, &hf_s7comm_szl_0131_0006_zugtyp_1_4, &hf_s7comm_szl_0131_0006_zugtyp_1_5, &hf_s7comm_szl_0131_0006_zugtyp_1_6, &hf_s7comm_szl_0131_0006_zugtyp_1_7, NULL }; static gint ett_s7comm_szl_0131_0006_zugtyp_2 = -1; static int * const s7comm_szl_0131_0006_zugtyp_2_fields[] = { &hf_s7comm_szl_0131_0006_zugtyp_2_0, &hf_s7comm_szl_0131_0006_zugtyp_2_1, &hf_s7comm_szl_0131_0006_zugtyp_2_2, &hf_s7comm_szl_0131_0006_zugtyp_2_3, &hf_s7comm_szl_0131_0006_zugtyp_2_4, &hf_s7comm_szl_0131_0006_zugtyp_2_5, &hf_s7comm_szl_0131_0006_zugtyp_2_6, &hf_s7comm_szl_0131_0006_zugtyp_2_7, NULL }; static gint ett_s7comm_szl_0131_0006_zugtyp_3 = -1; static int * const s7comm_szl_0131_0006_zugtyp_3_fields[] = { &hf_s7comm_szl_0131_0006_zugtyp_3_0, &hf_s7comm_szl_0131_0006_zugtyp_3_1, &hf_s7comm_szl_0131_0006_zugtyp_3_2, &hf_s7comm_szl_0131_0006_zugtyp_3_3, &hf_s7comm_szl_0131_0006_zugtyp_3_4, &hf_s7comm_szl_0131_0006_zugtyp_3_5, &hf_s7comm_szl_0131_0006_zugtyp_3_6, &hf_s7comm_szl_0131_0006_zugtyp_3_7, NULL }; static gint ett_s7comm_szl_0131_0006_zugtyp_6 = -1; static int * const s7comm_szl_0131_0006_zugtyp_6_fields[] = { &hf_s7comm_szl_0131_0006_zugtyp_6_0, &hf_s7comm_szl_0131_0006_zugtyp_6_1, &hf_s7comm_szl_0131_0006_zugtyp_6_2, &hf_s7comm_szl_0131_0006_zugtyp_6_3, &hf_s7comm_szl_0131_0006_zugtyp_6_4, &hf_s7comm_szl_0131_0006_zugtyp_6_5, &hf_s7comm_szl_0131_0006_zugtyp_6_6, &hf_s7comm_szl_0131_0006_zugtyp_6_7, NULL }; static gint ett_s7comm_szl_0131_0006_zugtyp_7 = -1; static int * const s7comm_szl_0131_0006_zugtyp_7_fields[] = { &hf_s7comm_szl_0131_0006_zugtyp_7_0, &hf_s7comm_szl_0131_0006_zugtyp_7_1, &hf_s7comm_szl_0131_0006_zugtyp_7_2, &hf_s7comm_szl_0131_0006_zugtyp_7_3, &hf_s7comm_szl_0131_0006_zugtyp_7_4, &hf_s7comm_szl_0131_0006_zugtyp_7_5, &hf_s7comm_szl_0131_0006_zugtyp_7_6, &hf_s7comm_szl_0131_0006_zugtyp_7_7, NULL }; static gint hf_s7comm_szl_0131_0007_index = -1; static gint hf_s7comm_szl_0131_0007_funkt_0 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_0 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_1 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_2 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_3 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_4 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_5 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_6 = -1; static gint hf_s7comm_szl_0131_0007_funkt_0_7 = -1; static gint hf_s7comm_szl_0131_0007_funkt_1 = -1; static gint hf_s7comm_szl_0131_0007_obj_0 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_0 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_1 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_2 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_3 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_4 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_5 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_6 = -1; static gint hf_s7comm_szl_0131_0007_obj_0_7 = -1; static gint hf_s7comm_szl_0131_0007_obj_1 = -1; static gint hf_s7comm_szl_0131_0007_kons = -1; static gint hf_s7comm_szl_0131_0007_sen = -1; static gint hf_s7comm_szl_0131_0007_rec = -1; static gint hf_s7comm_szl_0131_0007_time = -1; static gint hf_s7comm_szl_0131_0007_proj = -1; static gint hf_s7comm_szl_0131_0007_alarm = -1; static gint hf_s7comm_szl_0131_0007_mode = -1; static gint hf_s7comm_szl_0131_0007_mode_0 = -1; static gint hf_s7comm_szl_0131_0007_mode_1 = -1; static gint hf_s7comm_szl_0131_0007_kreis = -1; static gint hf_s7comm_szl_0131_0007_sk_1 = -1; static gint hf_s7comm_szl_0131_0007_sk_2 = -1; static gint hf_s7comm_szl_0131_0007_ek_1 = -1; static gint hf_s7comm_szl_0131_0007_ek_2 = -1; static gint hf_s7comm_szl_0131_0007_len_1 = -1; static gint hf_s7comm_szl_0131_0007_len_2 = -1; static gint hf_s7comm_szl_0131_0007_len_3 = -1; static gint hf_s7comm_szl_0131_0007_res = -1; static gint ett_s7comm_szl_0131_0007_funkt_0 = -1; static int * const s7comm_szl_0131_0007_funkt_0_fields[] = { &hf_s7comm_szl_0131_0007_funkt_0_0, &hf_s7comm_szl_0131_0007_funkt_0_1, &hf_s7comm_szl_0131_0007_funkt_0_2, &hf_s7comm_szl_0131_0007_funkt_0_3, &hf_s7comm_szl_0131_0007_funkt_0_4, &hf_s7comm_szl_0131_0007_funkt_0_5, &hf_s7comm_szl_0131_0007_funkt_0_6, &hf_s7comm_szl_0131_0007_funkt_0_7, NULL }; static gint ett_s7comm_szl_0131_0007_obj_0 = -1; static int * const s7comm_szl_0131_0007_obj_0_fields[] = { &hf_s7comm_szl_0131_0007_obj_0_0, &hf_s7comm_szl_0131_0007_obj_0_1, &hf_s7comm_szl_0131_0007_obj_0_2, &hf_s7comm_szl_0131_0007_obj_0_3, &hf_s7comm_szl_0131_0007_obj_0_4, &hf_s7comm_szl_0131_0007_obj_0_5, &hf_s7comm_szl_0131_0007_obj_0_6, &hf_s7comm_szl_0131_0007_obj_0_7, NULL }; static gint ett_s7comm_szl_0131_0007_mode = -1; static int * const s7comm_szl_0131_0007_mode_fields[] = { &hf_s7comm_szl_0131_0007_mode_0, &hf_s7comm_szl_0131_0007_mode_1, NULL }; static gint hf_s7comm_szl_0131_0008_index = -1; static gint hf_s7comm_szl_0131_0008_last_1 = -1; static gint hf_s7comm_szl_0131_0008_last_1_tb = -1; static gint hf_s7comm_szl_0131_0008_last_2 = -1; static gint hf_s7comm_szl_0131_0008_last_2_tb = -1; static gint hf_s7comm_szl_0131_0008_last_3 = -1; static gint hf_s7comm_szl_0131_0008_last_3_tb = -1; static gint hf_s7comm_szl_0131_0008_merker = -1; static gint hf_s7comm_szl_0131_0008_merker_tb = -1; static gint hf_s7comm_szl_0131_0008_ea = -1; static gint hf_s7comm_szl_0131_0008_ea_tb = -1; static gint hf_s7comm_szl_0131_0008_tz = -1; static gint hf_s7comm_szl_0131_0008_tz_tb = -1; static gint hf_s7comm_szl_0131_0008_db = -1; static gint hf_s7comm_szl_0131_0008_db_tb = -1; static gint hf_s7comm_szl_0131_0008_ld = -1; static gint hf_s7comm_szl_0131_0008_ld_tb = -1; static gint hf_s7comm_szl_0131_0008_reg = -1; static gint hf_s7comm_szl_0131_0008_reg_tb = -1; static gint hf_s7comm_szl_0131_0008_ba_stali1 = -1; static gint hf_s7comm_szl_0131_0008_ba_stali1_tb = -1; static gint hf_s7comm_szl_0131_0008_ba_stali2 = -1; static gint hf_s7comm_szl_0131_0008_ba_stali2_tb = -1; static gint hf_s7comm_szl_0131_0008_ba_stali3 = -1; static gint hf_s7comm_szl_0131_0008_ba_stali3_tb = -1; static gint hf_s7comm_szl_0131_0008_akku = -1; static gint hf_s7comm_szl_0131_0008_akku_tb = -1; static gint hf_s7comm_szl_0131_0008_address = -1; static gint hf_s7comm_szl_0131_0008_address_tb = -1; static gint hf_s7comm_szl_0131_0008_dbreg = -1; static gint hf_s7comm_szl_0131_0008_dbreg_tb = -1; static gint hf_s7comm_szl_0131_0008_res = -1; static const value_string s7comm_szl_0131_0008_timebase_names[] = { { 0, "100 ps" }, { 1, "1 ns" }, { 2, "10 ns" }, { 3, "100 ns" }, { 4, "1 us" }, { 5, "10 us" }, { 6, "100 us" }, { 7, "1 ms" }, { 8, "10 ms" }, { 9, "100 ms" }, { 10, "1 s" }, { 11, "10 s" }, { 12, "100 s" }, { 13, "1000 s" }, { 14, "10000 s" }, { 15, "1000000 s" }, { 0, NULL } }; static gint hf_s7comm_szl_0131_0009_index = -1; static gint hf_s7comm_szl_0131_0009_sync_k = -1; static gint hf_s7comm_szl_0131_0009_sync_k_0 = -1; static gint hf_s7comm_szl_0131_0009_sync_k_1 = -1; static gint hf_s7comm_szl_0131_0009_sync_k_2 = -1; static gint hf_s7comm_szl_0131_0009_sync_mpi = -1; static gint hf_s7comm_szl_0131_0009_sync_mpi_0 = -1; static gint hf_s7comm_szl_0131_0009_sync_mpi_1 = -1; static gint hf_s7comm_szl_0131_0009_sync_mpi_2 = -1; static gint hf_s7comm_szl_0131_0009_sync_mfi = -1; static gint hf_s7comm_szl_0131_0009_sync_mfi_0 = -1; static gint hf_s7comm_szl_0131_0009_sync_mfi_1 = -1; static gint hf_s7comm_szl_0131_0009_sync_mfi_2 = -1; static gint hf_s7comm_szl_0131_0009_res1 = -1; static gint hf_s7comm_szl_0131_0009_abw_puf = -1; static gint hf_s7comm_szl_0131_0009_abw_5v = -1; static gint hf_s7comm_szl_0131_0009_anz_bsz = -1; static gint hf_s7comm_szl_0131_0009_res2 = -1; static gint ett_s7comm_szl_0131_0009_sync_k = -1; static int * const s7comm_szl_0131_0009_sync_k_fields[] = { &hf_s7comm_szl_0131_0009_sync_k_0, &hf_s7comm_szl_0131_0009_sync_k_1, &hf_s7comm_szl_0131_0009_sync_k_2, NULL }; static gint ett_s7comm_szl_0131_0009_sync_mpi = -1; static int * const s7comm_szl_0131_0009_sync_mpi_fields[] = { &hf_s7comm_szl_0131_0009_sync_mpi_0, &hf_s7comm_szl_0131_0009_sync_mpi_1, &hf_s7comm_szl_0131_0009_sync_mpi_2, NULL }; static gint ett_s7comm_szl_0131_0009_sync_mfi = -1; static int * const s7comm_szl_0131_0009_sync_mfi_fields[] = { &hf_s7comm_szl_0131_0009_sync_mfi_0, &hf_s7comm_szl_0131_0009_sync_mfi_1, &hf_s7comm_szl_0131_0009_sync_mfi_2, NULL }; static gint hf_s7comm_szl_0131_0010_index = -1; static gint hf_s7comm_szl_0131_0010_funk_1 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_0 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_1 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_2 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_3 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_4 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_5 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_6 = -1; static gint hf_s7comm_szl_0131_0010_funk_1_7 = -1; static gint hf_s7comm_szl_0131_0010_funk_2 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_0 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_1 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_2 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_3 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_4 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_5 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_6 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_1_7 = -1; static gint hf_s7comm_szl_0131_0010_ber_meld_2 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_0 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_1 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_2 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_3 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_4 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_5 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_6 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_1_7 = -1; static gint hf_s7comm_szl_0131_0010_ber_zus_2 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_0 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_1 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_2 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_3 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_4 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_5 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_6 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_1_7 = -1; static gint hf_s7comm_szl_0131_0010_typ_zus_2 = -1; static gint hf_s7comm_szl_0131_0010_maxanz_arch = -1; static gint hf_s7comm_szl_0131_0010_res = -1; static gint ett_s7comm_szl_0131_0010_funk_1 = -1; static int * const s7comm_szl_0131_0010_funk_1_fields[] = { &hf_s7comm_szl_0131_0010_funk_1_0, &hf_s7comm_szl_0131_0010_funk_1_1, &hf_s7comm_szl_0131_0010_funk_1_2, &hf_s7comm_szl_0131_0010_funk_1_3, &hf_s7comm_szl_0131_0010_funk_1_4, &hf_s7comm_szl_0131_0010_funk_1_5, &hf_s7comm_szl_0131_0010_funk_1_6, &hf_s7comm_szl_0131_0010_funk_1_7, NULL }; static gint ett_s7comm_szl_0131_0010_ber_meld_1 = -1; static int * const s7comm_szl_0131_0010_ber_meld_1_fields[] = { &hf_s7comm_szl_0131_0010_ber_meld_1_0, &hf_s7comm_szl_0131_0010_ber_meld_1_1, &hf_s7comm_szl_0131_0010_ber_meld_1_2, &hf_s7comm_szl_0131_0010_ber_meld_1_3, &hf_s7comm_szl_0131_0010_ber_meld_1_4, &hf_s7comm_szl_0131_0010_ber_meld_1_5, &hf_s7comm_szl_0131_0010_ber_meld_1_6, &hf_s7comm_szl_0131_0010_ber_meld_1_7, NULL }; static gint ett_s7comm_szl_0131_0010_ber_zus_1 = -1; static int * const s7comm_szl_0131_0010_ber_zus_1_fields[] = { &hf_s7comm_szl_0131_0010_ber_zus_1_0, &hf_s7comm_szl_0131_0010_ber_zus_1_1, &hf_s7comm_szl_0131_0010_ber_zus_1_2, &hf_s7comm_szl_0131_0010_ber_zus_1_3, &hf_s7comm_szl_0131_0010_ber_zus_1_4, &hf_s7comm_szl_0131_0010_ber_zus_1_5, &hf_s7comm_szl_0131_0010_ber_zus_1_6, &hf_s7comm_szl_0131_0010_ber_zus_1_7, NULL }; static gint ett_s7comm_szl_0131_0010_typ_zus_1 = -1; static int * const s7comm_szl_0131_0010_typ_zus_1_fields[] = { &hf_s7comm_szl_0131_0010_typ_zus_1_0, &hf_s7comm_szl_0131_0010_typ_zus_1_1, &hf_s7comm_szl_0131_0010_typ_zus_1_2, &hf_s7comm_szl_0131_0010_typ_zus_1_3, &hf_s7comm_szl_0131_0010_typ_zus_1_4, &hf_s7comm_szl_0131_0010_typ_zus_1_5, &hf_s7comm_szl_0131_0010_typ_zus_1_6, &hf_s7comm_szl_0131_0010_typ_zus_1_7, NULL }; static gint hf_s7comm_szl_0132_0001_index = -1; static gint hf_s7comm_szl_0132_0001_res_pg = -1; static gint hf_s7comm_szl_0132_0001_res_os = -1; static gint hf_s7comm_szl_0132_0001_u_pg = -1; static gint hf_s7comm_szl_0132_0001_u_os = -1; static gint hf_s7comm_szl_0132_0001_proj = -1; static gint hf_s7comm_szl_0132_0001_auf = -1; static gint hf_s7comm_szl_0132_0001_free = -1; static gint hf_s7comm_szl_0132_0001_used = -1; static gint hf_s7comm_szl_0132_0001_last = -1; static gint hf_s7comm_szl_0132_0001_res = -1; static gint hf_s7comm_szl_0132_0002_index = -1; static gint hf_s7comm_szl_0132_0002_anz = -1; static gint hf_s7comm_szl_0132_0002_res = -1; static gint hf_s7comm_szl_0132_0004_index = -1; static gint hf_s7comm_szl_0132_0004_key = -1; static gint hf_s7comm_szl_0132_0004_param = -1; static gint hf_s7comm_szl_0132_0004_real = -1; static gint hf_s7comm_szl_0132_0004_bart_sch = -1; static const value_string szl_bart_sch_names[] = { { 0, "undefined or cannot be ascertained" }, { 1, "RUN" }, { 2, "RUN_P" }, { 3, "STOP" }, { 4, "MRES" }, { 0, NULL } }; static gint hf_s7comm_szl_0132_0004_crst_wrst = -1; static const value_string szl_crst_wrst_names[] = { { 0, "undefined, does not exist or cannot be ascertained" }, { 1, "CRST" }, { 2, "WRST" }, { 0, NULL } }; static gint hf_s7comm_szl_0132_0004_ken_f = -1; static gint hf_s7comm_szl_0132_0004_ken_rel = -1; static gint hf_s7comm_szl_0132_0004_ken_ver1_hw = -1; static gint hf_s7comm_szl_0132_0004_ken_ver2_hw = -1; static gint hf_s7comm_szl_0132_0004_ken_ver1_awp = -1; static gint hf_s7comm_szl_0132_0004_ken_ver2_awp = -1; static gint hf_s7comm_szl_0132_0004_res = -1; static gint hf_s7comm_szl_0132_0005_index = -1; static gint hf_s7comm_szl_0132_0005_erw = -1; static gint hf_s7comm_szl_0132_0005_send = -1; static gint hf_s7comm_szl_0132_0005_moeg = -1; static gint hf_s7comm_szl_0132_0005_ltmerz = -1; static gint hf_s7comm_szl_0132_0005_res = -1; static const value_string szl_0132_0005_func_exist_names[] = { { 0x0, "No" }, { 0x1, "Yes" }, { 0, NULL } }; static gint hf_s7comm_szl_0132_0006_index = -1; static gint hf_s7comm_szl_0132_0006_used_0 = -1; static gint hf_s7comm_szl_0132_0006_used_1 = -1; static gint hf_s7comm_szl_0132_0006_used_2 = -1; static gint hf_s7comm_szl_0132_0006_used_3 = -1; static gint hf_s7comm_szl_0132_0006_used_4 = -1; static gint hf_s7comm_szl_0132_0006_used_5 = -1; static gint hf_s7comm_szl_0132_0006_used_6 = -1; static gint hf_s7comm_szl_0132_0006_used_7 = -1; static gint hf_s7comm_szl_0132_0006_anz_schnell = -1; static gint hf_s7comm_szl_0132_0006_anz_inst = -1; static gint hf_s7comm_szl_0132_0006_anz_multicast = -1; static gint hf_s7comm_szl_0132_0006_res = -1; static gint hf_s7comm_szl_0132_0008_index = -1; static gint hf_s7comm_szl_0132_0008_zykl = -1; static gint hf_s7comm_szl_0132_0008_korr = -1; static gint hf_s7comm_szl_0132_0008_clock0 = -1; static gint hf_s7comm_szl_0132_0008_clock1 = -1; static gint hf_s7comm_szl_0132_0008_clock2 = -1; static gint hf_s7comm_szl_0132_0008_clock3 = -1; static gint hf_s7comm_szl_0132_0008_clock4 = -1; static gint hf_s7comm_szl_0132_0008_clock5 = -1; static gint hf_s7comm_szl_0132_0008_clock6 = -1; static gint hf_s7comm_szl_0132_0008_clock7 = -1; static gint hf_s7comm_szl_0132_0008_time = -1; static gint hf_s7comm_szl_0132_0008_res = -1; static gint hf_s7comm_szl_0132_000b_index = -1; static gint hf_s7comm_szl_0132_000b_bszl_0 = -1; static gint hf_s7comm_szl_0132_000b_bszl_1 = -1; static gint hf_s7comm_szl_0132_000b_bszu_0 = -1; static gint hf_s7comm_szl_0132_000b_bszu_1 = -1; static gint hf_s7comm_szl_0132_000b_clock0 = -1; static gint hf_s7comm_szl_0132_000b_clock1 = -1; static gint hf_s7comm_szl_0132_000b_clock2 = -1; static gint hf_s7comm_szl_0132_000b_clock3 = -1; static gint hf_s7comm_szl_0132_000b_clock4 = -1; static gint hf_s7comm_szl_0132_000b_clock5 = -1; static gint hf_s7comm_szl_0132_000b_clock6 = -1; static gint hf_s7comm_szl_0132_000b_clock7 = -1; static gint hf_s7comm_szl_0132_000b_res = -1; static gint hf_s7comm_szl_0132_000c_index = -1; static gint hf_s7comm_szl_0132_000c_bszl_0 = -1; static gint hf_s7comm_szl_0132_000c_bszl_1 = -1; static gint hf_s7comm_szl_0132_000c_bszu_0 = -1; static gint hf_s7comm_szl_0132_000c_bszu_1 = -1; static gint hf_s7comm_szl_0132_000c_clock8 = -1; static gint hf_s7comm_szl_0132_000c_clock9 = -1; static gint hf_s7comm_szl_0132_000c_clock10 = -1; static gint hf_s7comm_szl_0132_000c_clock11 = -1; static gint hf_s7comm_szl_0132_000c_clock12 = -1; static gint hf_s7comm_szl_0132_000c_clock13 = -1; static gint hf_s7comm_szl_0132_000c_clock14 = -1; static gint hf_s7comm_szl_0132_000c_clock15 = -1; static gint hf_s7comm_szl_0132_000c_res = -1; static gint hf_s7comm_szl_001c_000x_index = -1; static gint hf_s7comm_szl_001c_0001_name = -1; static gint hf_s7comm_szl_001c_0002_name = -1; static gint hf_s7comm_szl_001c_0003_tag = -1; static gint hf_s7comm_szl_001c_0004_copyright = -1; static gint hf_s7comm_szl_001c_0005_serialn = -1; static gint hf_s7comm_szl_001c_0007_cputypname = -1; static gint hf_s7comm_szl_001c_0008_snmcmmc = -1; static gint hf_s7comm_szl_001c_0009_manufacturer_id = -1; static gint hf_s7comm_szl_001c_0009_profile_id = -1; static gint hf_s7comm_szl_001c_0009_profile_spec_typ = -1; static gint hf_s7comm_szl_001c_000a_oem_copyright_string = -1; static gint hf_s7comm_szl_001c_000a_oem_id = -1; static gint hf_s7comm_szl_001c_000a_oem_add_id = -1; static gint hf_s7comm_szl_001c_000b_loc_id = -1; static gint hf_s7comm_szl_001c_000x_res = -1; static gint hf_s7comm_szl_0091_0000_adr1 = -1; static gint hf_s7comm_szl_0091_0000_adr2 = -1; static gint hf_s7comm_szl_0091_0000_logadr = -1; static gint hf_s7comm_szl_0091_0000_solltyp = -1; static gint hf_s7comm_szl_0091_0000_isttyp = -1; static gint hf_s7comm_szl_0091_0000_res1 = -1; static gint hf_s7comm_szl_0091_0000_res1_0c_4c_4d = -1; static gint hf_s7comm_szl_0091_0000_res1_0d = -1; static gint hf_s7comm_szl_0091_0000_eastat = -1; static gint hf_s7comm_szl_0091_0000_eastat_0 = -1; static gint hf_s7comm_szl_0091_0000_eastat_1 = -1; static gint hf_s7comm_szl_0091_0000_eastat_2 = -1; static gint hf_s7comm_szl_0091_0000_eastat_3 = -1; static gint hf_s7comm_szl_0091_0000_eastat_4 = -1; static gint hf_s7comm_szl_0091_0000_eastat_5 = -1; static gint hf_s7comm_szl_0091_0000_eastat_6 = -1; static gint hf_s7comm_szl_0091_0000_eastat_7 = -1; static gint hf_s7comm_szl_0091_0000_eastat_dataid = -1; static gint hf_s7comm_szl_0091_0000_berbgbr = -1; static gint hf_s7comm_szl_0091_0000_berbgbr_0_2 = -1; static gint hf_s7comm_szl_0091_0000_berbgbr_3 = -1; static gint hf_s7comm_szl_0091_0000_berbgbr_areaid = -1; static gint hf_s7comm_szl_0091_0000_berbgbr_7 = -1; static const value_string szl_0091_0000_eastat_dataid_names[] = { { 0xb4, "Input" }, { 0xb5, "Output" }, { 0xff, "External DP interface" }, { 0, NULL } }; static const value_string szl_0091_0000_berbgbr_areaid_names[] = { { 0, "S7-400" }, { 1, "S7-300" }, { 2, "ET area" }, { 3, "P area" }, { 4, "Q area" }, { 5, "IM3 area" }, { 6, "IM4 area" }, { 0, NULL } }; static gint ett_s7comm_szl_0091_0000_eastat = -1; static int * const s7comm_szl_0091_0000_eastat_fields[] = { &hf_s7comm_szl_0091_0000_eastat_0, &hf_s7comm_szl_0091_0000_eastat_1, &hf_s7comm_szl_0091_0000_eastat_2, &hf_s7comm_szl_0091_0000_eastat_3, &hf_s7comm_szl_0091_0000_eastat_4, &hf_s7comm_szl_0091_0000_eastat_5, &hf_s7comm_szl_0091_0000_eastat_6, &hf_s7comm_szl_0091_0000_eastat_7, &hf_s7comm_szl_0091_0000_eastat_dataid, NULL }; static gint ett_s7comm_szl_0091_0000_berbgbr = -1; static int * const s7comm_szl_0091_0000_berbgbr_fields[] = { &hf_s7comm_szl_0091_0000_berbgbr_0_2, &hf_s7comm_szl_0091_0000_berbgbr_3, &hf_s7comm_szl_0091_0000_berbgbr_areaid, &hf_s7comm_szl_0091_0000_berbgbr_7, NULL }; static gint ett_s7comm_szl_xx9x_station_info = -1; static gint hf_s7comm_szl_xx9x_station_info = -1; static gint hf_s7comm_szl_0092_0xxx_status_0 = -1; static gint hf_s7comm_szl_0092_0xxx_status_1 = -1; static gint hf_s7comm_szl_0092_0xxx_status_2 = -1; static gint hf_s7comm_szl_0092_0xxx_status_3 = -1; static gint hf_s7comm_szl_0092_0xxx_status_4 = -1; static gint hf_s7comm_szl_0092_0xxx_status_5 = -1; static gint hf_s7comm_szl_0092_0xxx_status_6 = -1; static gint hf_s7comm_szl_0092_0xxx_status_7 = -1; static gint hf_s7comm_szl_0092_0xxx_status_8 = -1; static gint hf_s7comm_szl_0092_0xxx_status_9 = -1; static gint hf_s7comm_szl_0092_0xxx_status_10 = -1; static gint hf_s7comm_szl_0092_0xxx_status_11 = -1; static gint hf_s7comm_szl_0092_0xxx_status_12 = -1; static gint hf_s7comm_szl_0092_0xxx_status_13 = -1; static gint hf_s7comm_szl_0092_0xxx_status_14 = -1; static gint hf_s7comm_szl_0092_0xxx_status_15 = -1; static gint hf_s7comm_szl_0094_xxxx_index = -1; static gint hf_s7comm_szl_0094_xxxx_status_0 = -1; static gint hf_s7comm_szl_0094_xxxx_status_1_2047 = -1; static gint hf_s7comm_szl_0096_xxxx_logadr_adr = -1; static gint hf_s7comm_szl_0096_xxxx_logadr_area = -1; static const true_false_string tfs_szl_0096_xxx_logadr_area = { "Input", "Output" }; static gint hf_s7comm_szl_0096_xxxx_system = -1; static gint hf_s7comm_szl_0096_xxxx_api = -1; static gint hf_s7comm_szl_0096_xxxx_station = -1; static gint hf_s7comm_szl_0096_xxxx_slot = -1; static gint hf_s7comm_szl_0096_xxxx_subslot = -1; static gint hf_s7comm_szl_0096_xxxx_offset = -1; static gint hf_s7comm_szl_0096_xxxx_solltyp1 = -1; static gint hf_s7comm_szl_0096_xxxx_solltyp2 = -1; static gint hf_s7comm_szl_0096_xxxx_solltyp3 = -1; static gint hf_s7comm_szl_0096_xxxx_solltyp4_5 = -1; static gint hf_s7comm_szl_0096_xxxx_solltyp6_7 = -1; static gint hf_s7comm_szl_0096_xxxx_expactid = -1; static gint hf_s7comm_szl_0096_xxxx_reserve1 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_0 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_1 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_2 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_3 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_4 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_5 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_6 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_7 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_8 = -1; static gint hf_s7comm_szl_0096_xxxx_eastat_9 = -1; static gint ett_s7comm_szl_0096_xxxx_eastat = -1; static int * const s7comm_szl_0096_xxxx_eastat_fields[] = { &hf_s7comm_szl_0096_xxxx_eastat_0, &hf_s7comm_szl_0096_xxxx_eastat_1, &hf_s7comm_szl_0096_xxxx_eastat_2, &hf_s7comm_szl_0096_xxxx_eastat_3, &hf_s7comm_szl_0096_xxxx_eastat_4, &hf_s7comm_szl_0096_xxxx_eastat_5, &hf_s7comm_szl_0096_xxxx_eastat_6, &hf_s7comm_szl_0096_xxxx_eastat_7, &hf_s7comm_szl_0096_xxxx_eastat_8, &hf_s7comm_szl_0096_xxxx_eastat_9, NULL }; static gint hf_s7comm_szl_0096_xxxx_berbgbr = -1; static gint hf_s7comm_szl_0096_xxxx_berbgbr_0_2 = -1; static gint hf_s7comm_szl_0096_xxxx_berbgbr_3 = -1; static gint hf_s7comm_szl_0096_xxxx_berbgbr_areaid = -1; static gint hf_s7comm_szl_0096_xxxx_berbgbr_7 = -1; static gint ett_s7comm_szl_0096_xxxx_berbgbr = -1; static int * const s7comm_szl_0096_xxxx_berbgbr_fields[] = { &hf_s7comm_szl_0096_xxxx_berbgbr_0_2, &hf_s7comm_szl_0096_xxxx_berbgbr_3, &hf_s7comm_szl_0096_xxxx_berbgbr_areaid, &hf_s7comm_szl_0096_xxxx_berbgbr_7, NULL }; static gint hf_s7comm_szl_0096_xxxx_reserve2 = -1; static gint hf_s7comm_szl_0424_0000_ereig = -1; static gint hf_s7comm_szl_0424_0000_ae = -1; static gint hf_s7comm_szl_0424_0000_bzu_id = -1; static gint hf_s7comm_szl_0424_0000_bzu_id_req = -1; static gint hf_s7comm_szl_0424_0000_bzu_id_pre = -1; static const value_string szl_0424_0000_bzu_id_names[] = { { 0x1, "STOP (update)" }, { 0x2, "STOP (memory reset)" }, { 0x3, "STOP (self initialization)" }, { 0x4, "STOP (internal)" }, { 0x5, "Startup (complete restart)" }, { 0x7, "Restart" }, { 0x8, "RUN" }, { 0xa, "HOLD" }, { 0xd, "DEFECT" }, { 0, NULL } }; static gint ett_s7comm_szl_0424_0000_bzu_id = -1; static int * const s7comm_szl_0424_0000_bzu_id_fields[] = { &hf_s7comm_szl_0424_0000_bzu_id_req, &hf_s7comm_szl_0424_0000_bzu_id_pre, NULL }; static gint hf_s7comm_szl_0424_0000_res = -1; static gint hf_s7comm_szl_0424_0000_anlinfo1 = -1; static gint hf_s7comm_szl_0424_0000_anlinfo2 = -1; static const value_string szl_0424_0000_anlinfo2_names[] = { { 0x01, "Complete restart in multicomputing" }, { 0x03, "Complete restart set at mode selector" }, { 0x04, "Complete restart command via MPI" }, { 0x0a, "Restart in multicomputing" }, { 0x0b, "Restart set at mode selector" }, { 0x0c, "Restart command via MPI" }, { 0x10, "Automatic complete restart after battery-backed power on" }, { 0x13, "Complete restart set at mode selector; last power on battery backed" }, { 0x14, "Complete restart command via MPI; last power on battery backed" }, { 0x20, "Automatic complete restart after non battery backed power on (with memory reset by system)" }, { 0x23, "Complete restart set at mode selector; last power on unbattery backed" }, { 0x24, "Complete restart command via MPI; last power on unbattery backed" }, { 0xa0, "Automatic restart after battery backed power on according to parameter assignment" }, { 0, NULL } }; static gint hf_s7comm_szl_0424_0000_anlinfo3 = -1; static gint hf_s7comm_szl_0424_0000_anlinfo4 = -1; static const value_string szl_0424_0000_anlinfo4_names[] = { { 0x00, "No startup type" }, { 0x01, "Complete restart in multicomputing" }, { 0x03, "Complete restart due to switch setting" }, { 0x04, "Complete restart command via MPI" }, { 0x0a, "Restart in multicomputing" }, { 0x0b, "Restart set at mode selector" }, { 0x0c, "Restart command via MPI" }, { 0x10, "Automatic complete restart after battery-backed power on" }, { 0x13, "Complete restart set at mode selector; last power on battery backed" }, { 0x14, "Complete restart command via MPI; last power on battery backed" }, { 0x20, "Automatic complete restart after non battery backed power on (with memory reset by system)" }, { 0x23, "Complete restart set at mode selector; last power on unbattery backed" }, { 0x24, "Complete restart command via MPI; last power on unbattery backed" }, { 0xa0, "Automatic restart after battery backed power on according to parameter assignment" }, { 0, NULL } }; static gint hf_s7comm_szl_0424_0000_time = -1; static gint hf_s7comm_szl_xy74_0000_cpu_led_id = -1; static gint hf_s7comm_szl_xy74_0000_cpu_led_id_rackno = -1; static gint hf_s7comm_szl_xy74_0000_cpu_led_id_cputype = -1; static gint hf_s7comm_szl_xy74_0000_cpu_led_id_id = -1; static gint hf_s7comm_szl_xy74_0000_led_on = -1; static const value_string szl_xy74_0000_led_on_names[] = { { 0x0, "Off" }, { 0x1, "On" }, { 0, NULL } }; static gint hf_s7comm_szl_xy74_0000_led_blink = -1; static const value_string szl_xy74_0000_led_blink_names[] = { { 0x0, "Not flashing" }, { 0x1, "Flashing normally (2 Hz)" }, { 0x2, "Flashing slowly (0.5 Hz)" }, { 0, NULL } }; /******************************************************************************************************* * * Get the textual description of the szl index. Returns NULL if not description available * *******************************************************************************************************/ static const gchar* s7comm_get_szl_id_index_description_text(guint16 id, guint16 idx) { const gchar* str = NULL; switch (id) { case 0x0111: str = val_to_str_const(idx, szl_0111_index_names, "No description available"); break; case 0x0112: str = val_to_str_const(idx, szl_0112_index_names, "No description available"); break; case 0x0113: str = val_to_str_const(idx, szl_0113_index_names, "No description available"); break; case 0x0114: str = val_to_str_const(idx, szl_0114_index_names, "No description available"); break; case 0x0115: str = val_to_str_const(idx, szl_0115_index_names, "No description available"); break; case 0x0116: str = val_to_str_const(idx, szl_0116_index_names, "No description available"); break; case 0x0118: str = val_to_str_const(idx, szl_0118_index_names, "No description available"); break; case 0x0119: str = val_to_str_const(idx, szl_0119_0174_ledid_index_names, "No description available"); break; case 0x0121: str = val_to_str_const(idx, szl_0121_index_names, "No description available"); break; case 0x0222: str = val_to_str_const(idx, szl_0222_index_names, "No description available"); break; case 0x0524: str = val_to_str_const(idx, szl_0524_index_names, "No description available"); break; case 0x0131: str = val_to_str_const(idx, szl_0131_index_names, "No description available"); break; case 0x0132: str = val_to_str_const(idx, szl_0132_index_names, "No description available"); break; case 0x0174: str = val_to_str_const(idx, szl_0119_0174_ledid_index_names, "No description available"); break; case 0x011c: case 0x031c: str = val_to_str_const(idx, szl_xy1c_index_names, "No description available"); break; } return str; } /******************************************************************************************************* ******************************************************************************************************* * * PDU Type: User Data -> Function group 4 -> SZL functions -> All known SZD-ID and Indices * ******************************************************************************************************* *******************************************************************************************************/ /******************************************************************************************************* * * SZL-ID: 0xxy00 * Content: * If you read the partial lists with SZL-ID W#16#xy00, you obtain the * SZL-IDs supported by the module. * * The SZL-ID of the partial list extract * W#16#0000H: all SZL partial lists of the module * W#16#0100H: a partial list with all partial list extracts * W#16#0200H: a partial list extract * W#16#0300H: possible indexes of a partial list extract * W#16#0F00H: only partial list header information * *******************************************************************************************************/ static void s7comm_szl_0000_0000_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0000_0000_szl_id, { "SZL ID that exists", "s7comm.szl.0000.0000.szl_id", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &szl_id_partlist_ex_names_ext, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0000_0000_module_type_class, { "Module type class", "s7comm.szl.0000.0000.module_type_class", FT_UINT16, BASE_HEX, NULL, 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0000_0000_partlist_extr_nr, { "Number of the SZL partial list extract", "s7comm.szl.0000.0000.partlist_extr_nr", FT_UINT16, BASE_HEX, NULL, 0x0f00, NULL, HFILL }}, { &hf_s7comm_szl_0000_0000_partlist_nr, { "Number of the SZL partial list", "s7comm.szl.0000.0000.partlist_nr", FT_UINT16, BASE_HEX, NULL, 0x00ff, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy00(tvbuff_t *tvb, proto_tree *tree, guint16 id, guint16 idx, guint32 offset) { if (id == 0 && idx == 0) { proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_szl_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else if (id == 0x0100) { proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_module_type_class, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_partlist_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else if (id == 0x0200 || id == 0x0300) { proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_module_type_class, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_partlist_extr_nr, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_partlist_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else { /* 0x0f00 / 0x000: Partial list header information (number of all SZL-IDs of the module */ proto_tree_add_item(tree, hf_s7comm_szl_0000_0000_szl_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } return offset; } /******************************************************************************************************* * * SZL-ID: 0x0013 * Index: 0x0000 * Content: * If you read the partial list with SZL-ID W#16#xy13, you obtain information * about the memory areas of the module. * * The SZL-ID of the partial list extract * W#16#0013: data records of all memory areas * W#16#0113: data record for one memory area, You specify the memory area with the INDEX parameter. * W#16#0F13: only partial list header information * *******************************************************************************************************/ static void s7comm_szl_0013_0000_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0013_0000_index, { "Index", "s7comm.szl.0013.0000.index", FT_UINT16, BASE_HEX, VALS(szl_0113_index_names), 0x0, "Index of an identification data record", HFILL }}, { &hf_s7comm_szl_0013_0000_code, { "Code (Memory type)", "s7comm.szl.0013.0000.code", FT_UINT16, BASE_HEX, VALS(szl_memory_type_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_size, { "Size (Total size of the selected memory, total of area 1 and area 2)", "s7comm.szl.0013.0000.size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_mode, { "Mode (Logical mode of the memory)", "s7comm.szl.0013.0000.mode", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_mode_0, { "Volatile memory area", "s7comm.szl.0013.0000.mode.vol_mem", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Volatile memory area", HFILL }}, { &hf_s7comm_szl_0013_0000_mode_1, { "Non-volatile memory area", "s7comm.szl.0013.0000.mode.nvol_mem", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Non-volatile memory area", HFILL }}, { &hf_s7comm_szl_0013_0000_mode_2, { "Mixed memory area", "s7comm.szl.0013.0000.mode.mixed_mem", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Mixed memory area", HFILL }}, { &hf_s7comm_szl_0013_0000_mode_3, { "Code and data separate (for work memory)", "s7comm.szl.0013.0000.mode.cd_sep", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Code and data separate (for work memory)", HFILL }}, { &hf_s7comm_szl_0013_0000_mode_4, { "Code and data together (for work memory)", "s7comm.szl.0013.0000.mode.cd_tog", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Code and data together (for work memory)", HFILL }}, { &hf_s7comm_szl_0013_0000_granu, { "Granu", "s7comm.szl.0013.0000.granu", FT_UINT16, BASE_HEX, NULL, 0x0, "Granu (Always has the value 0)", HFILL }}, { &hf_s7comm_szl_0013_0000_ber1, { "ber1 (Size of the volatile memory area in bytes)", "s7comm.szl.0013.0000.ber1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_belegt1, { "belegt1 (Size of the volatile memory area being used)", "s7comm.szl.0013.0000.belegt1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_block1, { "block1 (Largest free block in the volatile memory area)", "s7comm.szl.0013.0000.block1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_ber2, { "ber2 (Size of the non-volatile memory area in bytes)", "s7comm.szl.0013.0000.ber2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_belegt2, { "belegt2 (Size of the non-volatile memory area being used)", "s7comm.szl.0013.0000.belegt2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0013_0000_block2, { "block2 (Largest free block in the non-volatile memory area)", "s7comm.szl.0013.0000.block2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0013_idx_0000(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_code, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_mode, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_mode_0, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_mode_1, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_mode_2, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_mode_3, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_mode_4, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_granu, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_ber1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_belegt1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_block1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_ber2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_belegt2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0013_0000_block2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy14 * Index: 0x000x * Content: * If you read the system status list with SZL-ID W#16#xy14, you obtain * information about the system areas of the module. * *******************************************************************************************************/ static void s7comm_szl_xy14_000x_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_xy14_000x_index, { "Index", "s7comm.szl.xy14.000x.index", FT_UINT16, BASE_HEX, VALS(szl_0114_index_names), 0x0, "Index of the system area", HFILL }}, { &hf_s7comm_szl_xy14_000x_code, { "Code (Memory type)", "s7comm.szl.xy14.000x.code", FT_UINT16, BASE_HEX, VALS(szl_memory_type_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy14_000x_quantity, { "Quantity (Number of elements of the system area)", "s7comm.szl.xy14.000x.quantity", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy14_000x_reman, { "Reman (Number of retentive elements)", "s7comm.szl.xy14.000x.reman", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy14_idx_000x(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_xy14_000x_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy14_000x_code, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy14_000x_quantity, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy14_000x_reman, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy15 * Index: 0x000x * Content: * If you read the system status list with SZL-ID W#16#xy14, you obtain * the block types that exist on the module. * *******************************************************************************************************/ static void s7comm_szl_xy15_000x_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_xy15_000x_index, { "Index", "s7comm.szl.xy15.000x.index", FT_UINT16, BASE_HEX, VALS(szl_0115_index_names), 0x0, "Block type number", HFILL }}, { &hf_s7comm_szl_xy15_000x_maxanz, { "MaxAnz (Maximum number of blocks of the type)", "s7comm.szl.xy15.000x.maxanz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy15_000x_maxlng, { "MaxLng (Maximum total size of the object to be loaded in Kbytes)", "s7comm.szl.xy15.000x.maxlng", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy15_000x_maxabl, { "MaxAbl (Maximum length of the work memory part of a block in bytes)", "s7comm.szl.xy15.000x.maxabl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy15_idx_000x(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_xy15_000x_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy15_000x_maxanz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy15_000x_maxlng, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy15_000x_maxabl, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy11 * Index: 0x0001 * Content: * If you read the system status list with SZL-ID W#16#xy11, you obtain the * module identification of the module. * *******************************************************************************************************/ static void s7comm_szl_xy11_0001_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_xy11_0001_index, { "Index", "s7comm.szl.xy11.0001.index", FT_UINT16, BASE_HEX, VALS(szl_0111_index_names), 0x0, "Index of an identification data record", HFILL }}, { &hf_s7comm_szl_xy11_0001_mlfb, { "MlfB (Order number of the module)", "s7comm.szl.xy11.0001.anz", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy11_0001_bgtyp, { "BGTyp (Module type ID)", "s7comm.szl.xy11.0001.bgtyp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy11_0001_ausbg, { "Ausbg (Version of the module or release of the operating system)", "s7comm.szl.xy11.0001.ausbg", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy11_0001_ausbe, { "Ausbe (Release of the PG description file)", "s7comm.szl.xy11.0001.ausbe", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0111_idx_0001(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_xy11_0001_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy11_0001_mlfb, tvb, offset, 20, ENC_ASCII); offset += 20; proto_tree_add_item(tree, hf_s7comm_szl_xy11_0001_bgtyp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy11_0001_ausbg, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy11_0001_ausbe, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy22 * Index: 0x00xx * Content: * Contains information about the current status of interrupt * processing and interrupt generation in the module. * *******************************************************************************************************/ static void s7comm_szl_xy22_00xx_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_xy22_00xx_info, { "Start info for the given OB", "s7comm.szl.xy22.00xx.info", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1, { "al1 (Processing identifiers)", "s7comm.szl.xy22.00xx.al1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1_0, { "Interrupt event is caused by parameters disabled", "s7comm.szl.xy22.00xx.al1.evpd", FT_BOOLEAN, 16, NULL, 0x0001, "Bit 0: Interrupt event is caused by parameters, 0=Enabled, 1=Disabled", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1_1, { "Interrupt event as per SFC 39 locked", "s7comm.szl.xy22.00xx.al1.iel", FT_BOOLEAN, 16, NULL, 0x0002, "Bit 1: Interrupt event as per SFC 39, 0=Not locked, 1=Locked", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1_2, { "Interrupt source is active", "s7comm.szl.xy22.00xx.al1.isia", FT_BOOLEAN, 16, NULL, 0x0004, "Bit 2: Interrupt source is active", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1_4, { "Interrupt OB is loaded", "s7comm.szl.xy22.00xx.al1.ioil", FT_BOOLEAN, 16, NULL, 0x0010, "Bit 4: Interrupt OB, 0=Is not loaded, 1=Is loaded", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1_5, { "Interrupt OB is locked by TIS", "s7comm.szl.xy22.00xx.al1.ioilbt", FT_BOOLEAN, 16, NULL, 0x0020, "Bit 5: Interrupt OB is by TIS, 1=Locked", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al1_6, { "Entry in diagnostic buffer locked", "s7comm.szl.xy22.00xx.al1.eidbl", FT_BOOLEAN, 16, NULL, 0x0040, "Bit 6: Entry in diagnostic buffer, 1=Locked", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al2, { "al2 (Reaction with not loaded/locked OB)", "s7comm.szl.xy22.00xx.al2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy22_00xx_al2_0, { "Lock interrupt source", "s7comm.szl.xy22.00xx.al2.lis", FT_BOOLEAN, 16, NULL, 0x0001, "Bit 0: Lock interrupt source", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al2_1, { "Generate interrupt event error", "s7comm.szl.xy22.00xx.al2.giee", FT_BOOLEAN, 16, NULL, 0x0002, "Bit 1: Generate interrupt event error", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al2_2, { "CPU goes into STOP mode", "s7comm.szl.xy22.00xx.al2.gism", FT_BOOLEAN, 16, NULL, 0x0004, "Bit 2: CPU goes into STOP mode", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al2_3, { "Interrupt only discarded", "s7comm.szl.xy22.00xx.al2.iod", FT_BOOLEAN, 16, NULL, 0x0008, "Bit 3: Interrupt only discarded", HFILL }}, { &hf_s7comm_szl_xy22_00xx_al3, { "al3 (Discarded by TIS functions)", "s7comm.szl.xy22.00xx.al3", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy22_idx_00xx(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_xy22_00xx_info, tvb, offset, 20, ENC_NA); offset += 20; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_xy22_00xx_al1, ett_s7comm_szl_xy22_00xx_al1, s7comm_szl_xy22_00xx_al1_fields, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_xy22_00xx_al2, ett_s7comm_szl_xy22_00xx_al2, s7comm_szl_xy22_00xx_al2_fields, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy22_00xx_al3, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0001 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0001 * contains general data about the communication of a communication unit. * *******************************************************************************************************/ static void s7comm_szl_0131_0001_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0001_index, { "Index", "s7comm.szl.0131.0001.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0001: Index for general communication data", HFILL }}, { &hf_s7comm_szl_0131_0001_pdu, { "pdu (Maximum PDU size in bytes)", "s7comm.szl.0131.0001.pdu", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum PDU size in bytes", HFILL }}, { &hf_s7comm_szl_0131_0001_anz, { "anz (Maximum number of communication connections)", "s7comm.szl.0131.0001.anz", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum number of communication connections", HFILL }}, { &hf_s7comm_szl_0131_0001_mpi_bps, { "mpi_bps (Maximum data rate of the MPI in hexadecimal format)", "s7comm.szl.0131.0001.mpi_bps", FT_UINT32, BASE_HEX, NULL, 0x0, "Maximum data rate of the MPI in hexadecimal format, Example: 0x2DC6C corresponds to 187500 bps", HFILL }}, { &hf_s7comm_szl_0131_0001_kbus_bps, { "mkbus_bps (Maximum data rate of the communication bus)", "s7comm.szl.0131.0001.kbus_bps", FT_UINT32, BASE_HEX, NULL, 0x0, "Maximum data rate of the communication bus", HFILL }}, { &hf_s7comm_szl_0131_0001_res, { "res (Reserved)", "s7comm.szl.0131.0001.res", FT_BYTES, BASE_NONE, NULL, 0x0, "Reserved", HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0001(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0001_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0001_pdu, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0001_anz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0001_mpi_bps, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0131_0001_kbus_bps, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0131_0001_res, tvb, offset, 26, ENC_NA); offset += 26; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0002 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0002 * contains information about the test and installation constants of the module. * *******************************************************************************************************/ static void s7comm_szl_0131_0002_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0002_index, { "Index", "s7comm.szl.0131.0002.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0002: test and installation", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0, { "funkt_0", "s7comm.szl.0131.0002.funkt_0", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted TIS (Test and Installation) functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_0, { "Reserved", "s7comm.szl.0131.0002.funkt_0.bit0_res", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_1, { "Block status", "s7comm.szl.0131.0002.funkt_0.block_stat", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Block status", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_2, { "Variable status", "s7comm.szl.0131.0002.funkt_0.var_stat", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Variable status", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_3, { "Output ISTACK", "s7comm.szl.0131.0002.funkt_0.outp_istack", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Output ISTACK", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_4, { "Output BSTACK", "s7comm.szl.0131.0002.funkt_0.outp_bstack", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Output BSTACK", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_5, { "Output LSTACK", "s7comm.szl.0131.0002.funkt_0.outp_lstack", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Output LSTACK", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_6, { "Time measurement from ... to ...", "s7comm.szl.0131.0002.funkt_0.time_meas", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Time measurement from ... to ...", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_0_7, { "Force selection", "s7comm.szl.0131.0002.funkt_0.force_sel", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Force selection", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1, { "funkt_1", "s7comm.szl.0131.0002.funkt_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted TIS (Test and Installation) functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_0, { "Modify variable", "s7comm.szl.0131.0002.funkt_1.mod_var", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Modify variable", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_1, { "Force", "s7comm.szl.0131.0002.funkt_1.force", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Force", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_2, { "Breakpoint", "s7comm.szl.0131.0002.funkt_1.breakp", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Breakpoint", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_3, { "Exit HOLD", "s7comm.szl.0131.0002.funkt_1.exit_hold", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Exit HOLD", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_4, { "Memory reset", "s7comm.szl.0131.0002.funkt_1.mem_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Memory reset", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_5, { "Disable job", "s7comm.szl.0131.0002.funkt_1.dis_job", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Disable job", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_6, { "Enable job", "s7comm.szl.0131.0002.funkt_1.en_job", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Enable job", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_1_7, { "Delete job", "s7comm.szl.0131.0002.funkt_1.del_job", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Delete job", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2, { "funkt_2", "s7comm.szl.0131.0002.funkt_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted TIS (Test and Installation) functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_0, { "Read job list", "s7comm.szl.0131.0002.funkt_2.rd_job_list", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Read job list", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_1, { "Read job", "s7comm.szl.0131.0002.funkt_2.rd_job", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Read job", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_2, { "Replace job", "s7comm.szl.0131.0002.funkt_2.repl_job", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Replace job", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_3, { "Block status v2", "s7comm.szl.0131.0002.funkt_2.block_stat_v2", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Block status v2", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_4, { "Reserved", "s7comm.szl.0131.0002.funkt_2.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_5, { "Reserved", "s7comm.szl.0131.0002.funkt_2.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_6, { "Flash LED", "s7comm.szl.0131.0002.funkt_2.flash_led", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Flash LED", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_2_7, { "Reserved", "s7comm.szl.0131.0002.funkt_2.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_3, { "funkt_3 (Reserved)", "s7comm.szl.0131.0002.funkt_3", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted TIS (Test and Installation) functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_4, { "funkt_4 (Reserved)", "s7comm.szl.0131.0002.funkt_4", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted TIS (Test and Installation) functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0002_funkt_5, { "funkt_5 (Reserved)", "s7comm.szl.0131.0002.funkt_5", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted TIS (Test and Installation) functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0002_aseg, { "aseg", "s7comm.szl.0131.0002.aseg", FT_BYTES, BASE_NONE, NULL, 0x0, "aseg (Non-relevant system data)", HFILL }}, { &hf_s7comm_szl_0131_0002_eseg, { "eseg", "s7comm.szl.0131.0002.eseg", FT_BYTES, BASE_NONE, NULL, 0x0, "eseg (Non-relevant system data)", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0, { "trgereig_0 (Permitted trigger events)", "s7comm.szl.0131.0002.trgereig_0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_0, { "Immediately", "s7comm.szl.0131.0002.trgereig_0.immed", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: immediately", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_1, { "System trigger", "s7comm.szl.0131.0002.trgereig_0.sys_trig", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: System trigger", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_2, { "System checkpoint main cycle start", "s7comm.szl.0131.0002.trgereig_0.sys_cp_mcs", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: System checkpoint main cycle start", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_3, { "System checkpoint main cycle end", "s7comm.szl.0131.0002.trgereig_0.sys_cp_mce", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: System checkpoint main cycle end", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_4, { "Mode transition RUN-STOP", "s7comm.szl.0131.0002.trgereig_0.mtrans_rs", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Mode transition RUN-STOP", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_5, { "After code address", "s7comm.szl.0131.0002.trgereig_0.acode_adr", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: After code address", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_6, { "Code address area", "s7comm.szl.0131.0002.trgereig_0.code_adr_a", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Code address area", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_0_7, { "Data address", "s7comm.szl.0131.0002.trgereig_0.data_adr", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Data Address", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1, { "trgereig_1 (Permitted trigger events)", "s7comm.szl.0131.0002.trgereig_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_0, { "Data address area", "s7comm.szl.0131.0002.trgereig_1.data_adr_a", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Data address area", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_1, { "Local data address", "s7comm.szl.0131.0002.trgereig_1.loc_adr", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Local data address", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_2, { "Local data address area", "s7comm.szl.0131.0002.trgereig_1.loc_adr_a", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Local data address area", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_3, { "Range trigger", "s7comm.szl.0131.0002.trgereig_1.range_trig", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Range trigger", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_4, { "Before code address", "s7comm.szl.0131.0002.trgereig_1.bcode_adr", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Before code address", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_5, { "Reserved", "s7comm.szl.0131.0002.trgereig_1.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_6, { "Reserved", "s7comm.szl.0131.0002.trgereig_1.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_1_7, { "Reserved", "s7comm.szl.0131.0002.trgereig_1.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0002_trgereig_2, { "trgereig_2 (Permitted trigger events, reserved)", "s7comm.szl.0131.0002.trgereig_2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_trgbed, { "trgbed (System data with no relevance)", "s7comm.szl.0131.0002.trgbed", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_pfad, { "pfad (System data with no relevance)", "s7comm.szl.0131.0002.pfad", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_tiefe, { "tiefe (System data with no relevance)", "s7comm.szl.0131.0002.tiefe", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_systrig, { "systrig (System data with no relevance)", "s7comm.szl.0131.0002.systrig", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_erg_par, { "erg par (System data with no relevance)", "s7comm.szl.0131.0002.erg_par", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_erg_pat_1, { "erg pat 1 (System data with no relevance)", "s7comm.szl.0131.0002.erg_pat_1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_erg_pat_2, { "erg pat 2 (System data with no relevance)", "s7comm.szl.0131.0002.erg_pat_2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_force, { "force (Number of modifiable Variables)", "s7comm.szl.0131.0002.force", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0002_time, { "time", "s7comm.szl.0131.0002.time", FT_UINT16, BASE_HEX, NULL, 0x0, "time (Upper time limit run-time meas, Format: bits 0 to 11 contain the time value (0 to 4K-1); bits 12 to 15 contain the time base: 0H= 10^-10s, 1H = 10^-9s,...,AH = 100s, ... FH = 105s)", HFILL }}, { &hf_s7comm_szl_0131_0002_res, { "res (Reserved)", "s7comm.szl.0131.0002.res", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0002(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0002_funkt_0, ett_s7comm_szl_0131_0002_funkt_0, s7comm_szl_0131_0002_funkt_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0002_funkt_1, ett_s7comm_szl_0131_0002_funkt_1, s7comm_szl_0131_0002_funkt_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0002_funkt_2, ett_s7comm_szl_0131_0002_funkt_2, s7comm_szl_0131_0002_funkt_2_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_funkt_3, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_funkt_4, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_funkt_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_aseg, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_eseg, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0002_trgereig_0, ett_s7comm_szl_0131_0002_trgereig_0, s7comm_szl_0131_0002_trgereig_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0002_trgereig_1, ett_s7comm_szl_0131_0002_trgereig_1, s7comm_szl_0131_0002_trgereig_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_trgereig_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_trgbed, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_pfad, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_tiefe, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_systrig, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_erg_par, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_erg_pat_1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_erg_pat_2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_force, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_time, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0002_res, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0003 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0003 * contains information about the communication parameters of the module for * connection to a unit for operator interface functions. * *******************************************************************************************************/ static void s7comm_szl_0131_0003_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0003_index, { "Index", "s7comm.szl.0131.0003.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0003: Index for operator interface functions", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0, { "funkt_0", "s7comm.szl.0131.0003.funkt_0", FT_UINT8, BASE_HEX, NULL, 0x0, "Bits indicating the available functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_0, { "Read once", "s7comm.szl.0131.0003.funkt_0.read_once", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Read once", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_1, { "Write once", "s7comm.szl.0131.0003.funkt_0.write_once", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Write once", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_2, { "Initialize cyclic reading (start implicitly)", "s7comm.szl.0131.0003.funkt_0.init_cycl_read_impl", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Initialize cyclic reading (start implicitly)", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_3, { "Initialize cyclic reading (start explicitly)", "s7comm.szl.0131.0003.funkt_0.init_cycl_read_expl", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Initialize cyclic reading (start explicitly)", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_4, { "Start cyclic reading", "s7comm.szl.0131.0003.funkt_0.start_cycl_read", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Start cyclic reading", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_5, { "Stop cyclic reading", "s7comm.szl.0131.0003.funkt_0.stop_cycl_read", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Stop cyclic reading", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_6, { "Clear cyclic reading", "s7comm.szl.0131.0002.funkt_0.clr_cycl_read", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Clear cyclic reading", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_0_7, { "Reserved", "s7comm.szl.0131.0002.funkt_0.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1, { "funkt_1", "s7comm.szl.0131.0003.funkt_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Bits indicating the available functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_0, { "Reserved", "s7comm.szl.0131.0003.funkt_1.bit0_res", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_1, { "Reserved", "s7comm.szl.0131.0003.funkt_1.bit1_res", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_2, { "Reserved", "s7comm.szl.0131.0003.funkt_1.bit2_res", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_3, { "Reserved", "s7comm.szl.0131.0003.funkt_1.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_4, { "Peripheral I/Os", "s7comm.szl.0131.0003.funkt_1.periph_io", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Peripheral I/Os", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_5, { "Inputs", "s7comm.szl.0131.0003.funkt_1.inputs", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Inputs", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_6, { "Outputs", "s7comm.szl.0131.0002.funkt_1.outputs", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Outputs", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_1_7, { "Bit memory", "s7comm.szl.0131.0002.funkt_1.bit_mem", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Bit memory", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2, { "funkt_2", "s7comm.szl.0131.0003.funkt_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Bits indicating the available functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_0, { "User DB", "s7comm.szl.0131.0003.funkt_2.user_db", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: User DB", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_1, { "Data record", "s7comm.szl.0131.0003.funkt_2.data_rec", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Data record", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_2, { "Reserved", "s7comm.szl.0131.0003.funkt_2.bit2_res", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_3, { "Reserved", "s7comm.szl.0131.0003.funkt_2.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_4, { "Reserved", "s7comm.szl.0131.0003.funkt_2.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_5, { "Reserved", "s7comm.szl.0131.0003.funkt_2.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_6, { "Reserved", "s7comm.szl.0131.0002.funkt_2.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_2_7, { "S7 counter", "s7comm.szl.0131.0002.funkt_2.s7_counter", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: S7 counter", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3, { "funkt_3", "s7comm.szl.0131.0003.funkt_3", FT_UINT8, BASE_HEX, NULL, 0x0, "Bits indicating the available functions (bit = 1: function exists)", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_0, { "S7 timer", "s7comm.szl.0131.0003.funkt_3.s7_timer", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: S7 timer", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_1, { "IEC counter", "s7comm.szl.0131.0003.funkt_3.iec_counter", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: IEC counter", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_2, { "IEC timer", "s7comm.szl.0131.0003.funkt_3.iec_timer", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: IEC timer", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_3, { "High speed counter", "s7comm.szl.0131.0003.funkt_3.hs_counter", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: High speed counter", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_4, { "Reserved", "s7comm.szl.0131.0003.funkt_3.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_5, { "Reserved", "s7comm.szl.0131.0003.funkt_3.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_6, { "Reserved", "s7comm.szl.0131.0002.funkt_3.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_funkt_3_7, { "Reserved", "s7comm.szl.0131.0002.funkt_3.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0003_data, { "data (Maximum size of consistently readable data)", "s7comm.szl.0131.0003.data", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0003_anz, { "anz (Maximum number of cyclic read jobs)", "s7comm.szl.0131.0003.anz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0003_per_min, { "per min (Minimum period for cyclic read jobs (n x 100 ms))", "s7comm.szl.0131.0003.per_min", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0003_per_max, { "per max (Maximum period for cyclic read jobs (n x 100 ms))", "s7comm.szl.0131.0003.per_max", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0003_res, { "res (Reserved)", "s7comm.szl.0131.0003.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0003(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0003_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0003_funkt_0, ett_s7comm_szl_0131_0003_funkt_0, s7comm_szl_0131_0003_funkt_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0003_funkt_1, ett_s7comm_szl_0131_0003_funkt_1, s7comm_szl_0131_0003_funkt_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0003_funkt_2, ett_s7comm_szl_0131_0003_funkt_2, s7comm_szl_0131_0003_funkt_2_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0003_funkt_3, ett_s7comm_szl_0131_0003_funkt_3, s7comm_szl_0131_0003_funkt_3_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0003_data, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0003_anz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0003_per_min, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0003_per_max, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0003_res, tvb, offset, 26, ENC_NA); offset += 26; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0004 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0004 * contains information about the object management system (OMS) of the * module. * *******************************************************************************************************/ static void s7comm_szl_0131_0004_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0004_index, { "Index", "s7comm.szl.0131.0004.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0004 Index for OMS", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0, { "funkt_0", "s7comm.szl.0131.0004.funkt_0", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_0, { "Reserved", "s7comm.szl.0131.0004.funkt_0.bit0_res", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_1, { "Directory (hierarchy 1)", "s7comm.szl.0131.0004.funkt_0.dir_h1", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Directory (hierarchy 1)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_2, { "Directory (hierarchy 2)", "s7comm.szl.0131.0004.funkt_0.dir_h2", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Directory (hierarchy 2)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_3, { "Directory (hierarchy 3)", "s7comm.szl.0131.0004.funkt_0.dir_h3", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Directory (hierarchy 3)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_4, { "Copy", "s7comm.szl.0131.0004.funkt_0.copy", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Copy", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_5, { "Chain (list)", "s7comm.szl.0131.0004.funkt_0.chain_list", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Chain (list)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_6, { "Chain (all copied)", "s7comm.szl.0131.0004.funkt_0.chain_copied", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Chain (all copied)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_0_7, { "Delete (list)", "s7comm.szl.0131.0004.funkt_0.delete_list", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Delete (list)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1, { "funkt_1", "s7comm.szl.0131.0004.funkt_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_0, { "Upload on PG", "s7comm.szl.0131.0004.funkt_1.upl_on_pg", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Upload on PG", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_1, { "Assign parameters when chaining", "s7comm.szl.0131.0004.funkt_1.asgn_w_chain", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Assign parameters when chaining", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_2, { "LOAD function when exchanging data with CFBs", "s7comm.szl.0131.0004.funkt_1.load_w_chg", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: LOAD function when exchanging data with CFBs", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_3, { "Reserved", "s7comm.szl.0131.0004.funkt_1.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_4, { "Reserved", "s7comm.szl.0131.0004.funkt_1.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_5, { "Reserved", "s7comm.szl.0131.0004.funkt_1.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_6, { "Reserved", "s7comm.szl.0131.0004.funkt_1.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_1_7, { "Delete *.*", "s7comm.szl.0131.0004.funkt_1.delete_all", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Delete *.*", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2, { "funkt_2", "s7comm.szl.0131.0004.funkt_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_0, { "Load user program (RAM)", "s7comm.szl.0131.0004.funkt_2.load_ram", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Load user program (RAM)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_1, { "Load user program (EPROM)", "s7comm.szl.0131.0004.funkt_2.load_eprom", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Load user program (EPROM)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_2, { "Save user program (RAM)", "s7comm.szl.0131.0004.funkt_2.save_ram", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Save user program (RAM)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_3, { "Save user program (EPROM)", "s7comm.szl.0131.0004.funkt_2.save_eprom", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Save user program (EPROM)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_4, { "Save user program (all)", "s7comm.szl.0131.0004.funkt_2.save_all", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Save user program (all)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_5, { "Compress (external)", "s7comm.szl.0131.0004.funkt_2.compress", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Compress (external)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_6, { "Firmware update (using communication)", "s7comm.szl.0131.0004.funkt_2.fw_update", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Firmware update (using communication)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_2_7, { "Set RAM memory mode", "s7comm.szl.0131.0004.funkt_2.set_ram_mode", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Set RAM memory mode", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3, { "funkt_3", "s7comm.szl.0131.0004.funkt_3", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_0, { "Set EPROM memory mode", "s7comm.szl.0131.0004.funkt_3.set_eprom_mode", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Set EPROM memory mode", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_1, { "Reserved", "s7comm.szl.0131.0004.funkt_3.bit1_res", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_2, { "Reserved", "s7comm.szl.0131.0004.funkt_3.bit2_res", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_3, { "Reserved", "s7comm.szl.0131.0004.funkt_3.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_4, { "Reserved", "s7comm.szl.0131.0004.funkt_3.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_5, { "Reserved", "s7comm.szl.0131.0004.funkt_3.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_6, { "Assign parameters to newly plugged in modules", "s7comm.szl.0131.0004.funkt_3.asgn_par_mod", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Assign parameters to newly plugged in modules", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_3_7, { "Assign parameters when evaluating memory card", "s7comm.szl.0131.0004.funkt_3.asgn_par_mc", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Assign parameters when evaluating memory card", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4, { "funkt_4", "s7comm.szl.0131.0004.funkt_4", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_0, { "Assign parameters when loading user program", "s7comm.szl.0131.0004.funkt_4.asgn_par_lprog", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Assign parameters when loading user program", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_1, { "Assign parameters in complete restart", "s7comm.szl.0131.0004.funkt_4.asgn_par_cres", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Assign parameters in complete restart", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_2, { "Assign parameters in restart", "s7comm.szl.0131.0004.funkt_4.asgn_par_res", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Assign parameters in restart", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_3, { "Compress (SFC25 COMPRESS)", "s7comm.szl.0131.0004.funkt_4.compress", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Compress (SFC25 COMPRESS)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_4, { "Evaluate memory card after switch setting", "s7comm.szl.0131.0004.funkt_4.ev_mc", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Evaluate memory card after switch setting", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_5, { "Firmware update using memory card", "s7comm.szl.0131.0004.funkt_4.fw_update_mc", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Firmware update using memory card", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_6, { "Reserved", "s7comm.szl.0131.0004.funkt_4.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_4_7, { "Reserved", "s7comm.szl.0131.0004.funkt_4.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_5, { "funkt_5 (Reserved)", "s7comm.szl.0131.0004.funkt_5", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_6, { "funkt_6 (Reserved)", "s7comm.szl.0131.0004.funkt_6", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_funkt_7, { "funkt_7 (Reserved)", "s7comm.szl.0131.0004.funkt_7", FT_UINT8, BASE_HEX, NULL, 0x0, "Available object management system functions: (Bit = 1: functions available on the CPU)", HFILL }}, { &hf_s7comm_szl_0131_0004_kop, { "kop (Maximum number of copied blocks)", "s7comm.szl.0131.0004.kop", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0004_del, { "del (Maximum number of uninterruptable, deletable blocks)", "s7comm.szl.0131.0004.del", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0004_kett, { "kett (Maximum number of blocks chained in one job)", "s7comm.szl.0131.0004.kett", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0004_hoch, { "hoch (Maximum number of simultaneous upload procedures)", "s7comm.szl.0131.0004.hoch", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0004_ver, { "ver (Maximum size (in bytes) of shiftable blocks in RUN)", "s7comm.szl.0131.0004.ver", FT_UINT8, BASE_DEC, NULL, 0x0, "ver (Maximum size (in bytes) of shiftable blocks in RUN) With an S7-300, this size refers to the entire block,with the S7-400, it refers to the part of the block relevant to running the program.", HFILL }}, { &hf_s7comm_szl_0131_0004_res, { "res (Reserved)", "s7comm.szl.0131.0004.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0004(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0004_funkt_0, ett_s7comm_szl_0131_0004_funkt_0, s7comm_szl_0131_0004_funkt_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0004_funkt_1, ett_s7comm_szl_0131_0004_funkt_1, s7comm_szl_0131_0004_funkt_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0004_funkt_2, ett_s7comm_szl_0131_0004_funkt_2, s7comm_szl_0131_0004_funkt_2_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0004_funkt_3, ett_s7comm_szl_0131_0004_funkt_3, s7comm_szl_0131_0004_funkt_3_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0004_funkt_4, ett_s7comm_szl_0131_0004_funkt_4, s7comm_szl_0131_0004_funkt_4_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_funkt_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_funkt_6, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_funkt_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_kop, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_del, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_kett, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_hoch, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_ver, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0004_res, tvb, offset, 25, ENC_NA); offset += 25; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0005 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0005 * contains information about the diagnostic capabilities of the module. * *******************************************************************************************************/ static void s7comm_szl_0131_0005_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0005_index, { "Index", "s7comm.szl.0131.0005.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0005 Index for Diagnostics", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0, { "funkt_0 (Available diagnostic functions)", "s7comm.szl.0131.0005.funkt_0", FT_UINT8, BASE_HEX, NULL, 0x0, "Available diagnostic functions: (Bit = 1: functions exists)", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_0, { "Reserved", "s7comm.szl.0131.0005.funkt_0.bit0_res", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_1, { "Diagnostic buffer exists", "s7comm.szl.0131.0005.funkt_0.diag_buf", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Diagnostic buffer exists", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_2, { "Sending system diagnostic data possible", "s7comm.szl.0131.0005.funkt_0.sysdiag", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Sending system diagnostic data possible", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_3, { "Sending user-defined diagnostic messages possible", "s7comm.szl.0131.0005.funkt_0.userdiag", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Sending user-defined diagnostic messages possible", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_4, { "Sending VMD status possible", "s7comm.szl.0131.0005.funkt_0.vmdstat", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Sending VMD status possible", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_5, { "Evaluating diagnostic interrupts", "s7comm.szl.0131.0005.funkt_0.evaldiagint", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Evaluating diagnostic interrupts", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_6, { "Diagnostic interrupt exists on module", "s7comm.szl.0131.0005.funkt_0.diagint", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Diagnostic interrupt exists on module", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_0_7, { "Reserved", "s7comm.szl.0131.0005.funkt_0.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_1, { "funkt_1 (Reserved)", "s7comm.szl.0131.0005.funkt_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_2, { "funkt_2 (Reserved)", "s7comm.szl.0131.0005.funkt_2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_3, { "funkt_3 (Reserved)", "s7comm.szl.0131.0005.funkt_3", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_4, { "funkt_4 (Reserved)", "s7comm.szl.0131.0005.funkt_4", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_5, { "funkt_5 (Reserved)", "s7comm.szl.0131.0005.funkt_5", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_6, { "funkt_6 (Reserved)", "s7comm.szl.0131.0005.funkt_6", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_funkt_7, { "funkt_7 (Reserved)", "s7comm.szl.0131.0005.funkt_7", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_anz_sen, { "anz_sen (Maximum number of diagnostic data sinks)", "s7comm.szl.0131.0005.anz_sen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_anz_ein, { "anz_ein (Maximum number of entries in the diagnostic buffer)", "s7comm.szl.0131.0005.anz_ein", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_anz_mel, { "anz_mel (Maximum number of process control group messages)", "s7comm.szl.0131.0005.anz_mel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0005_res, { "res (Reserved)", "s7comm.szl.0131.0005.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0005(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0005_funkt_0, ett_s7comm_szl_0131_0005_funkt_0, s7comm_szl_0131_0005_funkt_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_3, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_4, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_6, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_funkt_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_anz_sen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_anz_ein, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_anz_mel, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0005_res, tvb, offset, 24, ENC_NA); offset += 24; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0006 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0006 * contains information about the functions available for data exchange with * communication SFBs for configured connections on the module. * *******************************************************************************************************/ static void s7comm_szl_0131_0006_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0006_index, { "Index", "s7comm.szl.0131.0006.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0006 Data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0, { "funkt_0", "s7comm.szl.0131.0006.funkt_0", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_0, { "Bit 0: USEND", "s7comm.szl.0131.0006.funkt_0.usend", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_1, { "Bit 1: URCV", "s7comm.szl.0131.0006.funkt_0.urcv", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_2, { "Bit 2: SEND", "s7comm.szl.0131.0006.funkt_0.send", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_3, { "Bit 3: RCV", "s7comm.szl.0131.0006.funkt_0.rcv", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_4, { "Bit 4: BSEND", "s7comm.szl.0131.0006.funkt_0.bsend", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_5, { "Bit 5: BRCV", "s7comm.szl.0131.0006.funkt_0.brcv", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_6, { "Bit 6: GET", "s7comm.szl.0131.0006.funkt_0.get", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_0_7, { "Bit 7: PUT", "s7comm.szl.0131.0006.funkt_0.put", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1, { "funkt_1", "s7comm.szl.0131.0006.funkt_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_0, { "Bit 0: PRINT", "s7comm.szl.0131.0006.funkt_1.print", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_1, { "Bit 1: ABORT", "s7comm.szl.0131.0006.funkt_1.abort", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_2, { "Bit 2: INITIATE", "s7comm.szl.0131.0006.funkt_1.initiate", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_3, { "Bit 3: START", "s7comm.szl.0131.0006.funkt_1.start", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_4, { "Bit 4: STOP", "s7comm.szl.0131.0006.funkt_1.stop", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_5, { "Bit 5: RESUME", "s7comm.szl.0131.0006.funkt_1.resume", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_6, { "Bit 6: STATUS", "s7comm.szl.0131.0006.funkt_1.status", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_1_7, { "Bit 7: USTATUS", "s7comm.szl.0131.0006.funkt_1.ustatus", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2, { "funkt_2", "s7comm.szl.0131.0006.funkt_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_0, { "Bit 0: PI", "s7comm.szl.0131.0006.funkt_2.pi", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_1, { "Bit 1: READ", "s7comm.szl.0131.0006.funkt_2.read", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_2, { "Bit 2: WRITE", "s7comm.szl.0131.0006.funkt_2.write", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_3, { "Bit 3: LOAD", "s7comm.szl.0131.0006.funkt_2.load", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_4, { "Bit 4: LOAD_ME", "s7comm.szl.0131.0006.funkt_2.load_me", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_5, { "Bit 5: ALARM", "s7comm.szl.0131.0006.funkt_2.alarm", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_6, { "Bit 6: ALARM_8", "s7comm.szl.0131.0006.funkt_2.alarm_8", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_2_7, { "Bit 7: ALARM_8P", "s7comm.szl.0131.0006.funkt_2.alarm_8p", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3, { "funkt_3", "s7comm.szl.0131.0006.funkt_3", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_0, { "Bit 0: NOTIFY", "s7comm.szl.0131.0006.funkt_3.notify", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_1, { "Bit 1: AR_SEND", "s7comm.szl.0131.0006.funkt_3.ar_send", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_2, { "Bit 2: Reserved", "s7comm.szl.0131.0006.funkt_3.bit2_res", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_3, { "Bit 3: Reserved", "s7comm.szl.0131.0006.funkt_3.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_4, { "Bit 4: Reserved", "s7comm.szl.0131.0006.funkt_3.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_5, { "Bit 5: Reserved", "s7comm.szl.0131.0006.funkt_3.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_6, { "Bit 6: Reserved", "s7comm.szl.0131.0006.funkt_3.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_3_7, { "Bit 7: Reserved", "s7comm.szl.0131.0006.funkt_3.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_4, { "funkt_4", "s7comm.szl.0131.0006.funkt_4", FT_UINT8, BASE_HEX, NULL, 0x0, "Reserved", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_5, { "funkt_5", "s7comm.szl.0131.0006.funkt_5", FT_UINT8, BASE_HEX, NULL, 0x0, "Reserved", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6, { "funkt_6", "s7comm.szl.0131.0006.funkt_6", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_0, { "Bit 0: X_SEND", "s7comm.szl.0131.0006.funkt_6.x_send", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_1, { "Bit 1: X_RCV", "s7comm.szl.0131.0006.funkt_6.x_rcv", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_2, { "Bit 2: X_GET", "s7comm.szl.0131.0006.funkt_6.x_get", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_3, { "Bit 3: X_PUT", "s7comm.szl.0131.0006.funkt_6.x_put", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_4, { "Bit 4: X_ABORT", "s7comm.szl.0131.0006.funkt_6.x_abort", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_5, { "Bit 5: I_GET", "s7comm.szl.0131.0006.funkt_6.i_get", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_6, { "Bit 6: I_PUT", "s7comm.szl.0131.0006.funkt_6.i_put", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_6_7, { "Bit 7: I_ABORT", "s7comm.szl.0131.0006.funkt_6.i_abort", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7, { "funkt_7", "s7comm.szl.0131.0006.funkt_7", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_0, { "Bit 0: SCAN_SND", "s7comm.szl.0131.0006.funkt_7.scan_snd", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_1, { "Bit 1: ALARM_SQ", "s7comm.szl.0131.0006.funkt_7.alarm_sq", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_2, { "Bit 2: ALARM_S", "s7comm.szl.0131.0006.funkt_7.alarm_s", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_3, { "Bit 3: ALARM_SC", "s7comm.szl.0131.0006.funkt_7.alarm_sc", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_4, { "Bit 4: EN_MSG", "s7comm.szl.0131.0006.funkt_7.en_msg", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_5, { "Bit 5: DIS_MSG", "s7comm.szl.0131.0006.funkt_7.dis_msg", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_6, { "Bit 6: CONTROL", "s7comm.szl.0131.0006.funkt_7.control", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_funkt_7_7, { "Bit 7: Reserved", "s7comm.szl.0131.0006.funkt_7.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_schnell, { "schnell (Fast reaction yes/no)", "s7comm.szl.0131.0006.schnell", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0, { "zugtyp_0", "s7comm.szl.0131.0006.zugtyp_0", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_0 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_0, { "Bit 0: USEND", "s7comm.szl.0131.0006.zugtyp_0.usend", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_1, { "Bit 1: URCV", "s7comm.szl.0131.0006.zugtyp_0.urcv", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_2, { "Bit 2: SEND", "s7comm.szl.0131.0006.zugtyp_0.send", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_3, { "Bit 3: RCV", "s7comm.szl.0131.0006.zugtyp_0.rcv", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_4, { "Bit 4: BSEND", "s7comm.szl.0131.0006.zugtyp_0.bsend", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_5, { "Bit 5: BRCV", "s7comm.szl.0131.0006.zugtyp_0.brcv", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_6, { "Bit 6: GET", "s7comm.szl.0131.0006.zugtyp_0.get", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_0_7, { "Bit 7: PUT", "s7comm.szl.0131.0006.zugtyp_0.put", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1, { "zugtyp_1", "s7comm.szl.0131.0006.zugtyp_1", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_1 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_0, { "Bit 0: PRINT", "s7comm.szl.0131.0006.zugtyp_1.print", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_1, { "Bit 1: ABORT", "s7comm.szl.0131.0006.zugtyp_1abort", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_2, { "Bit 2: INITIATE", "s7comm.szl.0131.0006.zugtyp_1.initiate", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_3, { "Bit 3: START", "s7comm.szl.0131.0006.zugtyp_1.start", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_4, { "Bit 4: STOP", "s7comm.szl.0131.0006.zugtyp_1.stop", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_5, { "Bit 5: RESUME", "s7comm.szl.0131.0006.zugtyp_1.resume", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_6, { "Bit 6: STATUS", "s7comm.szl.0131.0006.zugtyp_1.status", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_1_7, { "Bit 7: USTATUS", "s7comm.szl.0131.0006.zugtyp_1.ustatus", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2, { "zugtyp_2", "s7comm.szl.0131.0006.zugtyp_2", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_2 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_0, { "Bit 0: PI", "s7comm.szl.0131.0006.zugtyp_2.pi", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_1, { "Bit 1: READ", "s7comm.szl.0131.0006.zugtyp_2.read", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_2, { "Bit 2: WRITE", "s7comm.szl.0131.0006.zugtyp_2.write", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_3, { "Bit 3: LOAD", "s7comm.szl.0131.0006.zugtyp_2.load", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_4, { "Bit 4: LOAD_ME", "s7comm.szl.0131.0006.zugtyp_2.load_me", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_5, { "Bit 5: ALARM", "s7comm.szl.0131.0006.zugtyp_2.alarm", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_6, { "Bit 6: ALARM_8", "s7comm.szl.0131.0006.zugtyp_2.alarm_8", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_2_7, { "Bit 7: ALARM_8P", "s7comm.szl.0131.0006.zugtyp_2.alarm_8p", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3, { "zugtyp_3", "s7comm.szl.0131.0006.zugtyp_3", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_3 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_0, { "Bit 0: NOTIFY", "s7comm.szl.0131.0006.zugtyp_3.notify", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_1, { "Bit 1: AR_SEND", "s7comm.szl.0131.0006.zugtyp_3.ar_send", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_2, { "Bit 2: Reserved", "s7comm.szl.0131.0006.zugtyp_3.bit2_res", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_3, { "Bit 3: Reserved", "s7comm.szl.0131.0006.zugtyp_3.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_4, { "Bit 4: Reserved", "s7comm.szl.0131.0006.zugtyp_3.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_5, { "Bit 5: Reserved", "s7comm.szl.0131.0006.zugtyp_3.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_6, { "Bit 6: Reserved", "s7comm.szl.0131.0006.zugtyp_3.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_3_7, { "Bit 7: Reserved", "s7comm.szl.0131.0006.zugtyp_3.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_4, { "zugtyp_4", "s7comm.szl.0131.0006.zugtyp_4", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_4 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_5, { "zugtyp_5", "s7comm.szl.0131.0006.zugtyp_5", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_5 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6, { "zugtyp_6", "s7comm.szl.0131.0006.zugtyp_6", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_6 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_0, { "Bit 0: X_SEND", "s7comm.szl.0131.0006.zugtyp_6.x_send", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_1, { "Bit 1: X_RCV", "s7comm.szl.0131.0006.zugtyp_6.x_rcv", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_2, { "Bit 2: X_GET", "s7comm.szl.0131.0006.zugtyp_6.x_get", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_3, { "Bit 3: X_PUT", "s7comm.szl.0131.0006.zugtyp_6.x_put", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_4, { "Bit 4: X_ABORT", "s7comm.szl.0131.0006.zugtyp_6.x_abort", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_5, { "Bit 5: I_GET", "s7comm.szl.0131.0006.zugtyp_6.i_get", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_6, { "Bit 6: I_PUT", "s7comm.szl.0131.0006.zugtyp_6.i_put", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_6_7, { "Bit 7: I_ABORT", "s7comm.szl.0131.0006.zugtyp_6.i_abort", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7, { "zugtyp_7", "s7comm.szl.0131.0006.zugtyp_7", FT_UINT8, BASE_HEX, NULL, 0x0, "zugtyp_7 (Permitted module types for fast reaction)", HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_0, { "Bit 0: SCAN_SND", "s7comm.szl.0131.0006.zugtyp_7.scan_snd", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_1, { "Bit 1: ALARM_SQ", "s7comm.szl.0131.0006.zugtyp_7.alarm_sq", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_2, { "Bit 2: ALARM_S", "s7comm.szl.0131.0006.zugtyp_7.alarm_s", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_3, { "Bit 3: ALARM_SC", "s7comm.szl.0131.0006.zugtyp_7.alarm_sc", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_4, { "Bit 4: EN_MSG", "s7comm.szl.0131.0006.zugtyp_7.en_msg", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_5, { "Bit 5: DIS_MSG", "s7comm.szl.0131.0006.zugtyp_7.dis_msg", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_6, { "Bit 6: CONTROL", "s7comm.szl.0131.0006.zugtyp_7.control", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_zugtyp_7_7, { "Bit 7: Reserved", "s7comm.szl.0131.0006.zugtyp_7.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_res1, { "res1 (Reserved)", "s7comm.szl.0131.0006.res1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_max_sd_empf, { "max_sd_empf (Maximum number of send and receive parameters per block)", "s7comm.szl.0131.0006.max_sd_empf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_max_sd_al8p, { "max_sd_al8p (Maximum number of send parameters for ALARM_8P)", "s7comm.szl.0131.0006.max_sd_al8p", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_max_inst, { "max_inst (Maximum number of instances for communication SFBs for configured connections)", "s7comm.szl.0131.0006.max_inst", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_res2, { "res2 (Reserved)", "s7comm.szl.0131.0006.res2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_verb_proj, { "verb_proj (Connection configured (yes=1) possible)", "s7comm.szl.0131.0006.verb_proj", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_verb_prog, { "verb_prog (Connection programmed (yes=1) possible)", "s7comm.szl.0131.0006.verb_prog", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0006_res3, { "res3 (Reserved)", "s7comm.szl.0131.0006.res3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0006(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_funkt_0, ett_s7comm_szl_0131_0006_funkt_0, s7comm_szl_0131_0006_funkt_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_funkt_1, ett_s7comm_szl_0131_0006_funkt_1, s7comm_szl_0131_0006_funkt_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_funkt_2, ett_s7comm_szl_0131_0006_funkt_2, s7comm_szl_0131_0006_funkt_2_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_funkt_3, ett_s7comm_szl_0131_0006_funkt_3, s7comm_szl_0131_0006_funkt_3_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_4, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_funkt_6, ett_s7comm_szl_0131_0006_funkt_6, s7comm_szl_0131_0006_funkt_6_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_funkt_7, ett_s7comm_szl_0131_0006_funkt_7, s7comm_szl_0131_0006_funkt_7_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_schnell, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_zugtyp_0, ett_s7comm_szl_0131_0006_zugtyp_0, s7comm_szl_0131_0006_zugtyp_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_zugtyp_1, ett_s7comm_szl_0131_0006_zugtyp_1, s7comm_szl_0131_0006_zugtyp_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_zugtyp_2, ett_s7comm_szl_0131_0006_zugtyp_2, s7comm_szl_0131_0006_zugtyp_2_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_zugtyp_3, ett_s7comm_szl_0131_0006_zugtyp_3, s7comm_szl_0131_0006_zugtyp_3_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_zugtyp_4, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_zugtyp_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_zugtyp_6, ett_s7comm_szl_0131_0006_zugtyp_6, s7comm_szl_0131_0006_zugtyp_6_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0006_zugtyp_7, ett_s7comm_szl_0131_0006_zugtyp_7, s7comm_szl_0131_0006_zugtyp_7_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_res1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_max_sd_empf, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_max_sd_al8p, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_max_inst, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_res2, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_verb_proj, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_verb_prog, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_res3, tvb, offset, 10, ENC_NA); offset += 10; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0007 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0007 * contains information about the functions available for global data * communication on the module. * *******************************************************************************************************/ static void s7comm_szl_0131_0007_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0007_index, { "Index", "s7comm.szl.0131.0007.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0007 Global data communication", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0, { "funkt_0 (Available GD functions)", "s7comm.szl.0131.0007.funkt_0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_0, { "Cyclic", "s7comm.szl.0131.0007.funkt_0.cyclic", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Cyclic", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_1, { "GD_SND", "s7comm.szl.0131.0007.funkt_0.gd_snd", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: GD_SND", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_2, { "GD_RCV", "s7comm.szl.0131.0007.funkt_0.gd_rcv", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: GD_RCV", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_3, { "Reserved", "s7comm.szl.0131.0007.funkt_0.bit3_res", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_4, { "Reserved", "s7comm.szl.0131.0007.funkt_0.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_5, { "Reserved", "s7comm.szl.0131.0007.funkt_0.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_6, { "Reserved", "s7comm.szl.0131.0007.funkt_0.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_0_7, { "Reserved", "s7comm.szl.0131.0007.funkt_0.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_funkt_1, { "funkt_1 (Reserved)", "s7comm.szl.0131.0007.funkt_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0, { "obj_0 (Addressable objects)", "s7comm.szl.0131.0007.obj_0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_0, { "M", "s7comm.szl.0131.0007.obj_0.m", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: M", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_1, { "PII", "s7comm.szl.0131.0007.obj_0.pii", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: PII", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_2, { "PIQ", "s7comm.szl.0131.0007.obj_0.piq", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: PIQ", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_3, { "T", "s7comm.szl.0131.0007.obj_0.t", FT_BOOLEAN, 8, NULL, 0x08, "Bit 3: T", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_4, { "C", "s7comm.szl.0131.0007.obj_0.c", FT_BOOLEAN, 8, NULL, 0x10, "Bit 4: C", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_5, { "DB", "s7comm.szl.0131.0007.obj_0.db", FT_BOOLEAN, 8, NULL, 0x20, "Bit 5: DB", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_6, { "Reserved", "s7comm.szl.0131.0007.obj_0.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, "Bit 6: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_0_7, { "Reserved", "s7comm.szl.0131.0007.obj_0.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0131_0007_obj_1, { "obj_1 (Reserved)", "s7comm.szl.0131.0007.obj_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_kons, { "kons (Consistent length in bytes)", "s7comm.szl.0131.0007.kons", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_sen, { "sen (Minimum scan rate for sending)", "s7comm.szl.0131.0007.sen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_rec, { "rec (Minimum scan rate for receiving)", "s7comm.szl.0131.0007.rec", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_time, { "time (Time monitoring when receiving yes/no)", "s7comm.szl.0131.0007.time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_proj, { "proj (Re-configuration possible in RUN yes/no)", "s7comm.szl.0131.0007.proj", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_alarm, { "alarm (Communication interrupt yes/no)", "s7comm.szl.0131.0007.alarm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_mode, { "mode", "s7comm.szl.0131.0007.mode", FT_UINT8, BASE_HEX, NULL, 0x0, "mode: Party line/MPI, communication bus", HFILL }}, { &hf_s7comm_szl_0131_0007_mode_0, { "Party line/MPI", "s7comm.szl.0131.0007.mode.pl_mpi", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Party line/MPI", HFILL }}, { &hf_s7comm_szl_0131_0007_mode_1, { "Communication bus", "s7comm.szl.0131.0007.mode.comm_bus", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Communication bus", HFILL }}, { &hf_s7comm_szl_0131_0007_kreis, { "kreis (Maximum number of GD groups of the CPU)", "s7comm.szl.0131.0007.kreis", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_sk_1, { "sk_1 (Maximum number of GD packets to be sent per GD circle of the CPU)", "s7comm.szl.0131.0007.sk_1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_sk_2, { "sk_2 (Maximum number of GD packets to be sent for all GD circles of the CPU)", "s7comm.szl.0131.0007.sk_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_ek_1, { "ek_1 (Maximum number of GD packets to be received per GD circle of the CPU)", "s7comm.szl.0131.0007.ek_1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_ek_2, { "ek_2 (Maximum number of GD packets to be received for all GD circles of the CPU)", "s7comm.szl.0131.0007.ek_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_len_1, { "len_1 (Maximum length of a GD packet)", "s7comm.szl.0131.0007.len_1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_len_2, { "len_2 (Maximum length of a GD packet header)", "s7comm.szl.0131.0007.len_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_len_3, { "len_3 (Length of the object description header)", "s7comm.szl.0131.0007.len_3", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0007_res, { "res (Reserved)", "s7comm.szl.0131.0007.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0007(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0007_funkt_0, ett_s7comm_szl_0131_0007_funkt_0, s7comm_szl_0131_0007_funkt_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_funkt_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0007_obj_0, ett_s7comm_szl_0131_0007_obj_0, s7comm_szl_0131_0007_obj_0_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_obj_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_kons, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_sen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_rec, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_time, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_proj, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_alarm, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0007_mode, ett_s7comm_szl_0131_0007_mode, s7comm_szl_0131_0007_mode_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_kreis, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_sk_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_sk_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_ek_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_ek_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_len_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_len_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_len_3, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0007_res, tvb, offset, 19, ENC_NA); offset += 19; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0008 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0008 * contains information about the time required for test and installation * functions. * *******************************************************************************************************/ static void s7comm_szl_0131_0008_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0008_index, { "Index", "s7comm.szl.0131.0008.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0008 Test and installation function time information", HFILL }}, /* Time format: * - Bit 0 to bit 11 contains the time value * - Bit 12 to bit 15 contains the time base: 0=10e-10 sec, 1=10e-9 sec, 0xa = 10e0 sec, 0xf=10e5 sec */ { &hf_s7comm_szl_0131_0008_last_1, { "last_1 (Basic overhead for status block) time value", "s7comm.szl.0131.0008.last_1", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_last_1_tb, { "last_1 (Basic overhead for status block) time base", "s7comm.szl.0131.0008.last_1_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_last_2, { "last_2 (Basic overhead for monitor variables) time value", "s7comm.szl.0131.0008.last_2", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_last_2_tb, { "last_2 (Basic overhead for monitor variables) time base", "s7comm.szl.0131.0008.last_2_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_last_3, { "last_3 (Basic overhead for modify variables) time value", "s7comm.szl.0131.0008.last_3", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_last_3_tb, { "last_3 (Basic overhead for modify variables) time base", "s7comm.szl.0131.0008.last_3_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_merker, { "merker (Time for one variable address 'memory bit') time value", "s7comm.szl.0131.0008.merker", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_merker_tb, { "merker (Time for one variable address 'memory bit') time base", "s7comm.szl.0131.0008.merker_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ea, { "ea (Time for one variable address 'input' or 'output') time value", "s7comm.szl.0131.0008.ea", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ea_tb, { "ea (Time for one variable address 'input' or 'output') time base", "s7comm.szl.0131.0008.ea_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_tz, { "tz (Time for one variable address 'timer' or 'counter') time value", "s7comm.szl.0131.0008.tz", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_tz_tb, { "tz (Time for one variable address 'timer' or 'counter') time base", "s7comm.szl.0131.0008.tz_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_db, { "db (Time for one variable address 'data block DB') time value", "s7comm.szl.0131.0008.db", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_db_tb, { "db (Time for one variable address 'data block DB') time base", "s7comm.szl.0131.0008.db_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ld, { "ld (Time for one variable address 'ADB' or 'local data') time value", "s7comm.szl.0131.0008.ld", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ld_tb, { "ld (Time for one variable address 'ADB' or 'local data') time base", "s7comm.szl.0131.0008.ld_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_reg, { "reg (Time for one variable address 'register') time value", "s7comm.szl.0131.0008.reg", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_reg_tb, { "reg (Time for one variable address 'register') time base", "s7comm.szl.0131.0008.reg_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ba_stali1, { "ba_stali1 (Basic time for a status list ID of group 1) time value", "s7comm.szl.0131.0008.ba_stali1", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ba_stali1_tb, { "ba_stali1 (Basic time for a status list ID of group 1) time base", "s7comm.szl.0131.0008.ba_stali1_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ba_stali2, { "ba_stali2 (Basic time for a status list ID of group 2) time value", "s7comm.szl.0131.0008.ba_stali2", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ba_stali2_tb, { "ba_stali2 (Basic time for a status list ID of group 2) time base", "s7comm.szl.0131.0008.ba_stali2_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ba_stali3, { "ba_stali3 (Basic time for a status list ID of group 3) time value", "s7comm.szl.0131.0008.ba_stali3", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_ba_stali3_tb, { "ba_stali3 (Basic time for a status list ID of group 3) time base", "s7comm.szl.0131.0008.ba_stali3_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_akku, { "akku (Accumulators added to basic time when ACCU 1, 2 addressed) time value", "s7comm.szl.0131.0008.akku", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_akku_tb, { "akku (Accumulators added to basic time when ACCU 1, 2 addressed) time base", "s7comm.szl.0131.0008.akku_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_address, { "address (Address register added to basic time when AR 1 or AR 2 addressed) time value", "s7comm.szl.0131.0008.address", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_address_tb, { "address (Address register added to basic time when AR 1 or AR 2 addressed) time base", "s7comm.szl.0131.0008.address_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_dbreg, { "dbreg (DB register added to basic time when DB register addressed) time value", "s7comm.szl.0131.0008.dbreg", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_dbreg_tb, { "dbreg (DB register added to basic time when DB register addressed) time base", "s7comm.szl.0131.0008.dbreg_tb", FT_UINT16, BASE_HEX, VALS(s7comm_szl_0131_0008_timebase_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_szl_0131_0008_res, { "res (Reserved)", "s7comm.szl.0131.0008.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0008(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_last_1, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_last_1_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_last_2, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_last_2_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_last_3, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_last_3_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_merker, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_merker_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ea, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ea_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_tz, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_tz_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_db, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_db_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ld, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ld_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_reg, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_reg_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ba_stali1, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ba_stali1_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ba_stali2, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ba_stali2_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ba_stali3, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_ba_stali3_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_akku, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_akku_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_address, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_address_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_dbreg, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_dbreg_tb, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0008_res, tvb, offset, 8, ENC_NA); offset += 8; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0009 * Content: * The partial list extract with SZL-ID W#16#0131 and the index W#16#0009 * contains time-of-day capability parameters. * *******************************************************************************************************/ static void s7comm_szl_0131_0009_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0009_index, { "Index", "s7comm.szl.0131.0009.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0009 Time-of-day capability", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_k, { "sync_k (Time synchronization C bus)", "s7comm.szl.0131.0009.sync_k", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_sync_k_0, { "Time-of-day synchronization neutral", "s7comm.szl.0131.0009.sync_k.neutral", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Time-of-day synchronization neutral", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_k_1, { "Capable of being slave for time-of-day synchronization", "s7comm.szl.0131.0009.sync_k.slave", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Capable of being slave for time-of-day synchronization", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_k_2, { "Capable of being master for time-of-day synchronization", "s7comm.szl.0131.0009.sync_k.master", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Capable of being master for time-of-day synchronization", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mpi, { "sync_mpi (Time synchronization via MPI)", "s7comm.szl.0131.0009.sync_mpi", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mpi_0, { "Time-of-day synchronization neutral", "s7comm.szl.0131.0009.sync_mpi.neutral", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Time-of-day synchronization neutral", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mpi_1, { "Capable of being slave for time-of-day synchronization", "s7comm.szl.0131.0009.sync_mpi.slave", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Capable of being slave for time-of-day synchronization", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mpi_2, { "Capable of being master for time-of-day synchronization", "s7comm.szl.0131.0009.sync_mpi.master", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Capable of being master for time-of-day synchronization", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mfi, { "sync_k (Time synchronization via MFI)", "s7comm.szl.0131.0009.sync_mfi", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mfi_0, { "Time-of-day synchronization neutral", "s7comm.szl.0131.0009.sync_mfi.neutral", FT_BOOLEAN, 8, NULL, 0x01, "Bit 0: Time-of-day synchronization neutral", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mfi_1, { "Capable of being slave for time-of-day synchronization", "s7comm.szl.0131.0009.sync_mfi.slave", FT_BOOLEAN, 8, NULL, 0x02, "Bit 1: Capable of being slave for time-of-day synchronization", HFILL }}, { &hf_s7comm_szl_0131_0009_sync_mfi_2, { "Capable of being master for time-of-day synchronization", "s7comm.szl.0131.0009.sync_mfi.master", FT_BOOLEAN, 8, NULL, 0x04, "Bit 2: Capable of being master for time-of-day synchronization", HFILL }}, { &hf_s7comm_szl_0131_0009_res1, { "res1 (Reserved)", "s7comm.szl.0131.0009.res1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_abw_puf, { "abw_puf (Clock deviation in ms/day when backed up)", "s7comm.szl.0131.0009.abw_puf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_abw_5v, { "abw_5v (Clock deviation in ms/day in 5V operation)", "s7comm.szl.0131.0009.abw_5v", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_anz_bsz, { "anz_bsz (Number of run-time meters)", "s7comm.szl.0131.0009.anz_bsz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0009_res2, { "res2 (Reserved)", "s7comm.szl.0131.0009.res2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0009(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0009_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0009_sync_k, ett_s7comm_szl_0131_0009_sync_k, s7comm_szl_0131_0009_sync_k_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0009_sync_mpi, ett_s7comm_szl_0131_0009_sync_mpi, s7comm_szl_0131_0009_sync_mpi_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0009_sync_mfi, ett_s7comm_szl_0131_0009_sync_mfi, s7comm_szl_0131_0009_sync_mfi_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0009_res1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0009_abw_puf, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0009_abw_5v, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0009_anz_bsz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0009_res2, tvb, offset, 28, ENC_NA); offset += 28; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0131 * Index: 0x0010 * Content: * The partial list extract with SZL-ID W#16#0131 and index W#16#0010 * contains message parameters. * *******************************************************************************************************/ static void s7comm_szl_0131_0010_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0131_0010_index, { "Index", "s7comm.szl.0131.0010.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0010 Message parameter", HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1, { "funk_1", "s7comm.szl.0131.0010.funk_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Block types available for data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_0, { "Bit 0: Group status messages exist", "s7comm.szl.0131.0010.funk_1.grp_status_msg", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_1, { "Bit 1: Scan possible", "s7comm.szl.0131.0010.funk_1.scan_possible", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_2, { "Bit 2: NOTIFY, ALARM, ALARM_8P, ALARM_8, (multicast) possible", "s7comm.szl.0131.0010.funk_1.notify_alarm", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_3, { "Bit 3: Sending archive data possible", "s7comm.szl.0131.0010.funk_1.send_arc", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_4, { "Bit 4: Reserved", "s7comm.szl.0131.0010.funk_1.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_5, { "Bit 5: Reserved", "s7comm.szl.0131.0010.funk_1.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_6, { "Bit 6: Reserved", "s7comm.szl.0131.0010.funk_1.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_1_7, { "Bit 7: Reserved", "s7comm.szl.0131.0010.funk_1.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_funk_2, { "funk_2", "s7comm.szl.0131.0010.funk_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Reserved", HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1, { "ber_meld_1", "s7comm.szl.0131.0010.ber_meld_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted address areas for messages (SCAN)", HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_0, { "Bit 0: PII", "s7comm.szl.0131.0010.ber_meld_1.pii", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_1, { "Bit 1: PIQ", "s7comm.szl.0131.0010.ber_meld_1.piq", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_2, { "Bit 2: M", "s7comm.szl.0131.0010.ber_meld_1.m", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_3, { "Bit 3: DB", "s7comm.szl.0131.0010.ber_meld_1.db", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_4, { "Bit 4: Reserved", "s7comm.szl.0131.0010.ber_meld_1.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_5, { "Bit 5: Reserved", "s7comm.szl.0131.0010.ber_meld_1.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_6, { "Bit 6: Reserved", "s7comm.szl.0131.0010.ber_meld_1.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_1_7, { "Bit 7: Reserved", "s7comm.szl.0131.0010.ber_meld_1.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_meld_2, { "ber_meld_2", "s7comm.szl.0131.0010.ber_meld_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Reserved", HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1, { "ber_zus_1", "s7comm.szl.0131.0010.ber_zus_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted address areas for messages (SCAN)", HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_0, { "Bit 0: PII", "s7comm.szl.0131.0010.ber_zus_1.pii", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_1, { "Bit 1: PIQ", "s7comm.szl.0131.0010.ber_zus_1.piq", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_2, { "Bit 2: M", "s7comm.szl.0131.0010.ber_zus_1.m", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_3, { "Bit 3: DB", "s7comm.szl.0131.0010.ber_zus_1.db", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_4, { "Bit 4: Reserved", "s7comm.szl.0131.0010.ber_zus_1.bit4_res", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_5, { "Bit 5: Reserved", "s7comm.szl.0131.0010.ber_zus_1.bit5_res", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_6, { "Bit 6: Reserved", "s7comm.szl.0131.0010.ber_zus_1.bit6_res", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_1_7, { "Bit 7: Reserved", "s7comm.szl.0131.0010.ber_zus_1.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_ber_zus_2, { "ber_zus_2", "s7comm.szl.0131.0010.ber_zus_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Reserved", HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1, { "typ_zus_1", "s7comm.szl.0131.0010.typ_zus_1", FT_UINT8, BASE_HEX, NULL, 0x0, "Permitted data types for additional values (SCAN)", HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_0, { "Bit 0: Bit", "s7comm.szl.0131.0010.typ_zus_1.bit", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_1, { "Bit 1: Byte", "s7comm.szl.0131.0010.typ_zus_1.byte", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_2, { "Bit 2: Word", "s7comm.szl.0131.0010.typ_zus_1.word", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_3, { "Bit 3: DWord", "s7comm.szl.0131.0010.typ_zus_1.dword", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_4, { "Bit 4: Timer", "s7comm.szl.0131.0010.typ_zus_1.timer", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_5, { "Bit 5: Counter", "s7comm.szl.0131.0010.typ_zus_1.counter", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_6, { "Bit 6: Array of char[16]", "s7comm.szl.0131.0010.typ_zus_1.array_char", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_1_7, { "Bit 7: Reserved", "s7comm.szl.0131.0010.typ_zus_1.bit7_res", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_typ_zus_2, { "typ_zus_2", "s7comm.szl.0131.0010.typ_zus_2", FT_UINT8, BASE_HEX, NULL, 0x0, "Reserved", HFILL }}, { &hf_s7comm_szl_0131_0010_maxanz_arch, { "maxanz_arch (Maximum number of archives for 'Send Archive')", "s7comm.szl.0132.0010.maxanz_arch", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0131_0010_res, { "res (Reserved)", "s7comm.szl.0131.0010.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0131_idx_0010(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0010_funk_1, ett_s7comm_szl_0131_0010_funk_1, s7comm_szl_0131_0010_funk_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_funk_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0010_ber_meld_1, ett_s7comm_szl_0131_0010_ber_meld_1, s7comm_szl_0131_0010_ber_meld_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_ber_meld_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0010_ber_zus_1, ett_s7comm_szl_0131_0010_ber_zus_1, s7comm_szl_0131_0010_ber_zus_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_ber_zus_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0131_0010_typ_zus_1, ett_s7comm_szl_0131_0010_typ_zus_1, s7comm_szl_0131_0010_typ_zus_1_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_typ_zus_2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_maxanz_arch, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0131_0010_res, tvb, offset, 28, ENC_NA); offset += 28; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x0001 * Content: * The partial list extract with SZL-ID W#16#0132 and index W#16#0001 * contains general communication status data. * *******************************************************************************************************/ static void s7comm_szl_0132_0001_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_0001_index, { "Index", "s7comm.szl.0132.0001.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0001: General status data for communication", HFILL }}, { &hf_s7comm_szl_0132_0001_res_pg, { "res pg (Guaranteed number of PG connections)", "s7comm.szl.0132.0001.res_pg", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_res_os, { "res os (Guaranteed number of OS connections)", "s7comm.szl.0132.0001.res_os", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_u_pg, { "u pg (Current number of PG connections)", "s7comm.szl.0132.0001.u_pg", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_u_os, { "u os (Current number of OS connections)", "s7comm.szl.0132.0001.u_os", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_proj, { "proj (Current number of configured connections)", "s7comm.szl.0132.0001.proj", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_auf, { "auf (Current number of connections established by proj)", "s7comm.szl.0132.0001.auf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_free, { "free (Number of free connections)", "s7comm.szl.0132.0001.free", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_used, { "used (Number of free connections used)", "s7comm.szl.0132.0001.used", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_last, { "last (Maximum selected communication load of the CPU in %)", "s7comm.szl.0132.0001.last", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0001_res, { "res (Reserved)", "s7comm.szl.0132.0001.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_0001(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_res_pg, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_res_os, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_u_pg, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_u_os, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_proj, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_auf, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_free, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_used, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_last, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0001_res, tvb, offset, 20, ENC_NA); offset += 20; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x0002 * Content: * The partial list extract with SZL-ID W#16#0132 and the index W#16#0002 * contains information about the test and installation function status of the module. * *******************************************************************************************************/ static void s7comm_szl_0132_0002_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_0002_index, { "Index", "s7comm.szl.0132.0002.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0002: Test and installation status", HFILL }}, { &hf_s7comm_szl_0132_0002_anz, { "anz (Number of initialized test and installation jobs)", "s7comm.szl.0132.0002.anz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0002_res, { "res (Reserved)", "s7comm.szl.0132.0002.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_0002(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_0002_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0002_anz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0002_res, tvb, offset, 36, ENC_NA); offset += 36; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x0004 * Content: * The partial list extract with SZL-ID W#16#0132 and the index W#16#0004 * contains information about the protection level of the module. * *******************************************************************************************************/ static void s7comm_szl_0132_0004_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_0004_index, { "Index", "s7comm.szl.0132.0004.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0004 Protection status data", HFILL }}, { &hf_s7comm_szl_0132_0004_key, { "key (Protection level for the key switch, possible values: 1,2 or 3)", "s7comm.szl.0132.0004.key", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0004_param, { "param (Assigned protection level, possible values: 0, 1, 2 or 3)", "s7comm.szl.0132.0004.param", FT_UINT16, BASE_DEC, NULL, 0x0, "param (Assigned protection level (possible values: 0, 1, 2 or 3;0 means: no password assigned, assigned protection level is not valid)", HFILL }}, { &hf_s7comm_szl_0132_0004_real, { "real (Valid protection level of the CPU, possible values: 1, 2 or 3)", "s7comm.szl.0132.0004.real", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0004_bart_sch, { "bart_sch (Position of the mode switch)", "s7comm.szl.0132.0004.bart_sch", FT_UINT16, BASE_DEC, VALS(szl_bart_sch_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0004_crst_wrst, { "crst_wrst (Setting of the CRST/WRST switch)", "s7comm.szl.0132.0004.crst_wrst", FT_UINT16, BASE_DEC, VALS(szl_crst_wrst_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0004_ken_f, { "ken_f (Reserved)", "s7comm.szl.0132.0004.ken_f", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0004_ken_rel, { "ken_rel (ID for valid version identifications/checksums)", "s7comm.szl.0132.0004.ken_rel", FT_UINT16, BASE_HEX, NULL, 0x0, "ken_rel (ID for valid version identifications/checksums) 0=invalid", HFILL }}, { &hf_s7comm_szl_0132_0004_ken_ver1_hw, { "ken_ver1_hw (Version ID/checksum 1 of the hardware configuration)", "s7comm.szl.0132.0004.ken_ver1_hw", FT_UINT16, BASE_HEX, NULL, 0x0, "ken_ver1_hw: Version ID/checksum 1 of the hardware configuration: XOR over the length of all SDBs", HFILL }}, { &hf_s7comm_szl_0132_0004_ken_ver2_hw, { "ken_ver2_hw (Version ID/checksum 2 of the hardware configuration)", "s7comm.szl.0132.0004.ken_ver2_hw", FT_UINT16, BASE_HEX, NULL, 0x0, "ken_ver2_hw: Version ID/checksum 2 of the hardware configuration: XOR over the checksums of all SDBs", HFILL }}, { &hf_s7comm_szl_0132_0004_ken_ver1_awp, { "ken_ver1_awp (Version ID/checksum 1 of the user program)", "s7comm.szl.0132.0004.ken_ver1_awp", FT_UINT16, BASE_HEX, NULL, 0x0, "ken_ver1_awp: Version ID/checksum 1 of the user program): XOR over the length of all OBs, DBs, FBs, FCs", HFILL }}, { &hf_s7comm_szl_0132_0004_ken_ver2_awp, { "ken_ver2_awp (Version ID/checksum 2 of the user program)", "s7comm.szl.0132.0004.ken_ver2_awp", FT_UINT16, BASE_HEX, NULL, 0x0, "ken_ver2_awp: Version ID/checksum 2 of the user program): XOR over the checksums of all OBs, DBs, FBs, FCs", HFILL }}, { &hf_s7comm_szl_0132_0004_res, { "res (Reserved)", "s7comm.szl.0132.0004.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_0004(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_key, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_param, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_real, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_bart_sch, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_crst_wrst, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_ken_f, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_ken_rel, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_ken_ver1_hw, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_ken_ver2_hw, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_ken_ver1_awp, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_ken_ver2_awp, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0004_res, tvb, offset, 16, ENC_NA); offset += 16; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x0005 * Content: * The partial list extract with SZL-ID W#16#0132 and index W#16#0005 * contains information about the status of the diagnostics on the module. * *******************************************************************************************************/ static void s7comm_szl_0132_0005_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_0005_index, { "Index", "s7comm.szl.0132.0005.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0005: Diagnostics", HFILL }}, { &hf_s7comm_szl_0132_0005_erw, { "erw (Extended functions)", "s7comm.szl.0132.0005.erw", FT_UINT16, BASE_DEC, VALS(szl_0132_0005_func_exist_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0005_send, { "send (Automatic sending)", "s7comm.szl.0132.0005.send", FT_UINT16, BASE_DEC, VALS(szl_0132_0005_func_exist_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0005_moeg, { "moeg (Sending user-defined diagnostic messages currently possible)", "s7comm.szl.0132.0005.moeg", FT_UINT16, BASE_DEC, VALS(szl_0132_0005_func_exist_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0005_ltmerz, { "ltmerz (Generation of status message active)", "s7comm.szl.0132.0005.ltmerz", FT_UINT16, BASE_DEC, VALS(szl_0132_0005_func_exist_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0005_res, { "res (Reserved)", "s7comm.szl.0132.0005.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_0005(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_0005_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0005_erw, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0005_send, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0005_moeg, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0005_ltmerz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0005_res, tvb, offset, 30, ENC_NA); offset += 30; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x0006 * Content: * The partial list extract with SZL-ID W#16#0132 and index W#16#0006 * contains status data about data exchange with communication SFBs for * configured connections. * *******************************************************************************************************/ static void s7comm_szl_0132_0006_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_0006_index, { "Index", "s7comm.szl.0132.0006.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0006: Data exchange with communication SFBs for configured connections", HFILL }}, { &hf_s7comm_szl_0132_0006_used_0, { "used_0 (Blocks used)", "s7comm.szl.0132.0006.used_0", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_1, { "used_1 (Blocks used)", "s7comm.szl.0132.0006.used_1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_2, { "used_2 (Blocks used)", "s7comm.szl.0132.0006.used_2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_3, { "used_3 (Blocks used)", "s7comm.szl.0132.0006.used_3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_4, { "used_4 (Blocks used)", "s7comm.szl.0132.0006.used_4", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_5, { "used_5 (Blocks used)", "s7comm.szl.0132.0006.used_5", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_6, { "used_6 (Blocks used)", "s7comm.szl.0132.0006.used_6", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_used_7, { "used_7 (Blocks used)", "s7comm.szl.0132.0006.used_7", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_anz_schnell, { "anz_schnell (Reserved)", "s7comm.szl.0132.0006.anz_schnell", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_anz_inst, { "anz_inst (Number of loaded SFB instances)", "s7comm.szl.0132.0006.anz_inst", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_anz_multicast, { "anz_multicast (Number of blocks used for multicast)", "s7comm.szl.0132.0006.anz_multicast", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0006_res, { "res (Reserved)", "s7comm.szl.0132.0006.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_0006(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_0, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_0_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_1, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_1_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_2, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_2_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_3, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_3_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_4, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_5, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_6, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_6_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_used_7, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0131_0006_funkt_7_7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_anz_schnell, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_anz_inst, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_anz_multicast, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0006_res, tvb, offset, 25, ENC_NA); offset += 25; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x0008 * Content: * The partial list extract with SZL-ID W#16#0132 and index W#16#0008 * contains information on the status of the modules time system. * *******************************************************************************************************/ static void s7comm_szl_0132_0008_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_0008_index, { "Index", "s7comm.szl.0132.0008.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#0008: Time system status", HFILL }}, { &hf_s7comm_szl_0132_0008_zykl, { "zykl (Cycle time of the synchronization frames)", "s7comm.szl.0132.0008.zykl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_korr, { "korr (Correction factor for time-of-day)", "s7comm.szl.0132.0008.korr", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock0, { "clock 0 (Run-time meter 0: Time in hours)", "s7comm.szl.0132.0008.clock0", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock1, { "clock 1 (Run-time meter 1: Time in hours)", "s7comm.szl.0132.0008.clock1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock2, { "clock 2 (Run-time meter 2: Time in hours)", "s7comm.szl.0132.0008.clock2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock3, { "clock 3 (Run-time meter 3: Time in hours)", "s7comm.szl.0132.0008.clock3", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock4, { "clock 4 (Run-time meter 4: Time in hours)", "s7comm.szl.0132.0008.clock4", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock5, { "clock 5 (Run-time meter 5: Time in hours)", "s7comm.szl.0132.0008.clock5", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock6, { "clock 6 (Run-time meter 6: Time in hours)", "s7comm.szl.0132.0008.clock6", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_clock7, { "clock 7 (Run-time meter 7: Time in hours)", "s7comm.szl.0132.0008.clock7", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_0008_time, { "time (Current date and time)", "s7comm.szl.0132.0008.time", FT_BYTES, BASE_NONE, NULL, 0x0, "time (Current date and time) format: date_and_time", HFILL }}, { &hf_s7comm_szl_0132_0008_res, { "res (Reserved)", "s7comm.szl.0132.0008.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_0008(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_zykl, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_korr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock0, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock4, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock5, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock6, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_clock7, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_time, tvb, offset, 8, ENC_NA); offset += 8; proto_tree_add_item(tree, hf_s7comm_szl_0132_0008_res, tvb, offset, 10, ENC_NA); offset += 10; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x000b * Content: * The partial list extract with SZL-ID W#16#0132 and index W#16#000B * contains information about the status of the 32-bit run-time meters 0..7 of the module. * *******************************************************************************************************/ static void s7comm_szl_0132_000b_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_000b_index, { "Index", "s7comm.szl.0132.000b.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#000B: Time system status", HFILL }}, { &hf_s7comm_szl_0132_000b_bszl_0, { "bszl_0 (Status of run-time meter)", "s7comm.szl.0132.000b.bszl_0", FT_UINT8, BASE_HEX, NULL, 0x0, "bszl_0 (Status of run-time meter): Bit = 1: run-time meter is busy" , HFILL }}, { &hf_s7comm_szl_0132_000b_bszl_1, { "bszl_1 (Reserved)", "s7comm.szl.0132.000b.bszl_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_bszu_0, { "bszu_0 (Overflow of run-time meter)", "s7comm.szl.0132.000b.bszu_0", FT_UINT8, BASE_HEX, NULL, 0x0, "bszu_0 (Overflow of run-time meter): Bit = 1: overflow", HFILL }}, { &hf_s7comm_szl_0132_000b_bszu_1, { "bszu_1 (Reserved)", "s7comm.szl.0132.000b.bszu_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock0, { "clock 0 (Run-time meter 0: Time in hours)", "s7comm.szl.0132.000b.clock0", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock1, { "clock 1 (Run-time meter 1: Time in hours)", "s7comm.szl.0132.000b.clock1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock2, { "clock 2 (Run-time meter 2: Time in hours)", "s7comm.szl.0132.000b.clock2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock3, { "clock 3 (Run-time meter 3: Time in hours)", "s7comm.szl.0132.000b.clock3", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock4, { "clock 4 (Run-time meter 4: Time in hours)", "s7comm.szl.0132.000b.clock4", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock5, { "clock 5 (Run-time meter 5: Time in hours)", "s7comm.szl.0132.000b.clock5", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock6, { "clock 6 (Run-time meter 6: Time in hours)", "s7comm.szl.0132.000b.clock6", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_clock7, { "clock 7 (Run-time meter 7: Time in hours)", "s7comm.szl.0132.000b.clock7", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000b_res, { "res (Reserved)", "s7comm.szl.0132.000b.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_000b(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_bszl_0, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_bszl_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_bszu_0, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_bszu_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock0, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock3, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock4, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock5, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock6, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_clock7, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000b_res, tvb, offset, 2, ENC_NA); offset += 2; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0132 * Index: 0x000c * Content: * The partial list extract with SZL-ID W#16#0132 and index W#16#000C * contains information about the status of the 32-bit run-time meters 8..15 of the module. * *******************************************************************************************************/ static void s7comm_szl_0132_000c_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0132_000c_index, { "Index", "s7comm.szl.0132.000c.index", FT_UINT16, BASE_HEX, NULL, 0x0, "W#16#000C: Time system status", HFILL }}, { &hf_s7comm_szl_0132_000c_bszl_0, { "bszl_0 (Status of run-time meter)", "s7comm.szl.0132.000c.bszl_0", FT_UINT8, BASE_HEX, NULL, 0x0, "bszl_0 (Status of run-time meter): Bit = 1: run-time meter is busy" , HFILL }}, { &hf_s7comm_szl_0132_000c_bszl_1, { "bszl_1 (Reserved)", "s7comm.szl.0132.000c.bszl_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_bszu_0, { "bszu_0 (Overflow of run-time meter)", "s7comm.szl.0132.000c.bszu_0", FT_UINT8, BASE_HEX, NULL, 0x0, "bszu_0 (Overflow of run-time meter): Bit = 1: overflow", HFILL }}, { &hf_s7comm_szl_0132_000c_bszu_1, { "bszu_1 (Reserved)", "s7comm.szl.0132.000c.bszu_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock8, { "clock 8 (Run-time meter 8: Time in hours)", "s7comm.szl.0132.000c.clock8", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock9, { "clock 9 (Run-time meter 9: Time in hours)", "s7comm.szl.0132.000c.clock9", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock10, { "clock 10 (Run-time meter 10: Time in hours)", "s7comm.szl.0132.000c.clock10", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock11, { "clock 11 (Run-time meter 11: Time in hours)", "s7comm.szl.0132.000c.clock11", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock12, { "clock 12 (Run-time meter 12: Time in hours)", "s7comm.szl.0132.000c.clock12", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock13, { "clock 13 (Run-time meter 13: Time in hours)", "s7comm.szl.0132.000c.clock13", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock14, { "clock 14 (Run-time meter 14: Time in hours)", "s7comm.szl.0132.000c.clock14", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_clock15, { "clock 15 (Run-time meter 15: Time in hours)", "s7comm.szl.0132.000c.clock15", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0132_000c_res, { "res (Reserved)", "s7comm.szl.0132.000c.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0132_idx_000c(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_bszl_0, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_bszl_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_bszu_0, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_bszu_1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock8, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock9, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock10, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock11, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock12, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock13, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock14, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_clock15, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0132_000c_res, tvb, offset, 2, ENC_NA); offset += 2; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy74 * Index: 0x0000 * Content: * If you read the partial list SSL-ID W#16#xy74, with standard CPUs (if present) and * with the H CPUs, you obtain the status of the module LEDs. * *******************************************************************************************************/ static void s7comm_szl_xy74_0000_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_xy74_0000_cpu_led_id, { "cpu_led_id", "s7comm.szl.xy74.0000.cpu_led_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_xy74_0000_cpu_led_id_rackno, { "Bits 0, 1, 2: Rack number", "s7comm.szl.xy74.0000.cpu_led_id.rackno", FT_UINT16, BASE_DEC, NULL, 0x0700, NULL, HFILL }}, { &hf_s7comm_szl_xy74_0000_cpu_led_id_cputype, { "Bit 3: CPU Type (0=Standby, 1=Master)", "s7comm.szl.xy74.0000.cpu_led_id.cputype", FT_UINT16, BASE_DEC, NULL, 0x0800, NULL, HFILL }}, { &hf_s7comm_szl_xy74_0000_cpu_led_id_id, { "Byte 1: LED ID", "s7comm.szl.xy74.0000.cpu_led_id.id", FT_UINT16, BASE_DEC, VALS(szl_0119_0174_ledid_index_names), 0x00ff, NULL, HFILL }}, { &hf_s7comm_szl_xy74_0000_led_on, { "Status of the LED", "s7comm.szl.xy74.0000.led_on", FT_UINT8, BASE_DEC, VALS(szl_xy74_0000_led_on_names), 0x00, NULL, HFILL }}, { &hf_s7comm_szl_xy74_0000_led_blink, { "Flashing status of the LED", "s7comm.szl.xy74.0000.led_blink", FT_UINT8, BASE_DEC, VALS(szl_xy74_0000_led_blink_names), 0x00, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy74_idx_0000(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_xy74_0000_cpu_led_id, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_xy74_0000_cpu_led_id_rackno, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_xy74_0000_cpu_led_id_cputype, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_xy74_0000_cpu_led_id_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_xy74_0000_led_on, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_xy74_0000_led_blink, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy1c * Index: 0x000x * Content: * If you read the partial list SSL-ID W#16#xy1c, you obtain the CPU or PLC identification. * *******************************************************************************************************/ static void s7comm_szl_xy1c_000x_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_001c_000x_index, { "Index", "s7comm.szl.001c.000x.index", FT_UINT16, BASE_HEX, VALS(szl_xy1c_index_names), 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_000x_res, { "Reserved", "s7comm.szl.001c.000x.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0001_name, { "Name (Name of the PLC)", "s7comm.szl.001c.0001.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0002_name, { "Name (Name of the module)", "s7comm.szl.001c.0002.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0003_tag, { "Tag (Plant identification of the module)", "s7comm.szl.001c.0003.tag", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0004_copyright, { "Copyright", "s7comm.szl.001c.0004.copyright", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0005_serialn, { "Serialn (Serialnumber of the module)", "s7comm.szl.001c.0005.serialn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0007_cputypname, { "Cputypname (Module type namee)", "s7comm.szl.001c.0007.cputypname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0008_snmcmmc, { "Sn_mc/mmc (Serial number of the Memory Card/Micro Memory Card)", "s7comm.szl.001c.0008.snmcmmc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_0009_manufacturer_id, { "Manufacturer_id", "s7comm.szl.001c.0009.manufacturer_id", FT_UINT16, BASE_HEX, NULL, 0x0, "Manufacturer_id (PROFIBUS / PROFINET Identification & Maintenance)", HFILL }}, { &hf_s7comm_szl_001c_0009_profile_id, { "Profile_id", "s7comm.szl.001c.0009.profile_id", FT_UINT16, BASE_HEX, NULL, 0x0, "Profile_id (PROFIBUS / PROFINET Identification & Maintenance)", HFILL }}, { &hf_s7comm_szl_001c_0009_profile_spec_typ, { "Profile_spec_typ", "s7comm.szl.001c.0009.profile_spec_typ", FT_UINT16, BASE_HEX, NULL, 0x0, "Profile_spec_typ (PROFIBUS / PROFINET Identification & Maintenance)", HFILL }}, { &hf_s7comm_szl_001c_000a_oem_copyright_string, { "Oem_copyright_string (OEM Copyright ID)", "s7comm.szl.001c.000a.oem_copyright_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_000a_oem_id, { "Oem_id (OEM ID)", "s7comm.szl.001c.000a.oem_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_000a_oem_add_id, { "Oem_add_id (OEM additional ID)", "s7comm.szl.001c.000a.oem_add_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_001c_000b_loc_id, { "Loc_id (Location designation)", "s7comm.szl.001c.000b.loc_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy1c_idx_000x(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { guint32 idx; proto_tree_add_item_ret_uint(tree, hf_s7comm_szl_001c_000x_index, tvb, offset, 2, ENC_BIG_ENDIAN, &idx); offset += 2; /* For redundant H-CPUs there may be some upper bits set to identify the CPU */ switch (idx & 0x000f) { case 0x0001: proto_tree_add_item(tree, hf_s7comm_szl_001c_0001_name, tvb, offset, 24, ENC_ASCII); offset += 24; proto_tree_add_item(tree, hf_s7comm_szl_001c_000x_res, tvb, offset, 8, ENC_NA); offset += 8; break; case 0x0002: proto_tree_add_item(tree, hf_s7comm_szl_001c_0002_name, tvb, offset, 24, ENC_ASCII); offset += 24; proto_tree_add_item(tree, hf_s7comm_szl_001c_000x_res, tvb, offset, 8, ENC_NA); offset += 8; break; case 0x0003: proto_tree_add_item(tree, hf_s7comm_szl_001c_0003_tag, tvb, offset, 32, ENC_ASCII); offset += 32; break; case 0x0004: proto_tree_add_item(tree, hf_s7comm_szl_001c_0004_copyright, tvb, offset, 26, ENC_ASCII); offset += 26; proto_tree_add_item(tree, hf_s7comm_szl_001c_000x_res, tvb, offset, 6, ENC_NA); offset += 6; break; case 0x0005: proto_tree_add_item(tree, hf_s7comm_szl_001c_0005_serialn, tvb, offset, 24, ENC_ASCII); offset += 24; proto_tree_add_item(tree, hf_s7comm_szl_001c_000x_res, tvb, offset, 8, ENC_NA); offset += 8; break; case 0x0007: proto_tree_add_item(tree, hf_s7comm_szl_001c_0007_cputypname, tvb, offset, 32, ENC_ASCII); offset += 32; break; case 0x0008: proto_tree_add_item(tree, hf_s7comm_szl_001c_0008_snmcmmc, tvb, offset, 32, ENC_ASCII); offset += 32; break; case 0x0009: proto_tree_add_item(tree, hf_s7comm_szl_001c_0009_manufacturer_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_001c_0009_profile_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_001c_0009_profile_spec_typ, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_001c_000x_res, tvb, offset, 26, ENC_NA); offset += 26; break; case 0x000a: proto_tree_add_item(tree, hf_s7comm_szl_001c_000a_oem_copyright_string, tvb, offset, 26, ENC_ASCII); offset += 26; proto_tree_add_item(tree, hf_s7comm_szl_001c_000a_oem_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_001c_000a_oem_add_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 0x000b: proto_tree_add_item(tree, hf_s7comm_szl_001c_000b_loc_id, tvb, offset, 32, ENC_ASCII); offset += 32; break; default: proto_tree_add_item(tree, hf_s7comm_szl_001c_000x_res, tvb, offset, 32, ENC_NA); offset += 32; break; } return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy91 * Index: 0x0000 * Content: * If you read the partial list SSL-ID W#16#xy91, you obtain the status information of modules assigned * to the CPU. * *******************************************************************************************************/ static void s7comm_szl_xy91_0000_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0091_0000_adr1, { "Adr1", "s7comm.szl.0091.0000.adr1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_adr2, { "Adr2", "s7comm.szl.0091.0000.adr2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_logadr, { "Logadr", "s7comm.szl.0091.0000.logadr", FT_UINT16, BASE_DEC, NULL, 0x0, "Logadr (First assigned logical I/O address (base address)", HFILL }}, { &hf_s7comm_szl_0091_0000_solltyp, { "Expected type", "s7comm.szl.0091.0000.exptype", FT_UINT16, BASE_HEX, NULL, 0x0, "Solltyp (PROFINET IO: expected (configured) type, otherwise reserved", HFILL }}, { &hf_s7comm_szl_0091_0000_isttyp, { "Actual type", "s7comm.szl.0091.0000.acttype", FT_UINT16, BASE_HEX, NULL, 0x0, "Isttyp (PROFINET IO: actual type, otherwise reserved", HFILL }}, /* Field depends on the first byte of the SZL-ID */ { &hf_s7comm_szl_0091_0000_res1, { "Reserved", "s7comm.szl.0091.0000.res1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_res1_0c_4c_4d, { "Reserved (number of actually existing interface modules)", "s7comm.szl.0091.0000.res1_0c_4c_4d", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_res1_0d, { "Reserved (number of interface modules)", "s7comm.szl.0091.0000.res1_0d", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_eastat, { "I/O status", "s7comm.szl.0091.0000.eastat", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_0, { "Module error", "s7comm.szl.0091.0000.eastat.moderror", FT_BOOLEAN, 16, NULL, 0x0001, "Bit 0: Module error", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_1, { "Module exists", "s7comm.szl.0091.0000.eastat.modexists", FT_BOOLEAN, 16, NULL, 0x0002, "Bit 1: Module exists", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_2, { "Module not available", "s7comm.szl.0091.0000.eastat.modnotav", FT_BOOLEAN, 16, NULL, 0x0004, "Bit 2: Module not available", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_3, { "Module disabled", "s7comm.szl.0091.0000.eastat.moddisabl", FT_BOOLEAN, 16, NULL, 0x0008, "Bit 3: Module disabled", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_4, { "Station error", "s7comm.szl.0091.0000.eastat.staterr", FT_BOOLEAN, 16, NULL, 0x0010, "Bit 4: Station error", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_5, { "CiR event busy", "s7comm.szl.0091.0000.eastat.cirbusy", FT_BOOLEAN, 16, NULL, 0x0020, "Bit 5: A CiR event at this module/station is busy or not yet completed", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_6, { "Reserved", "s7comm.szl.0091.0000.eastat.res", FT_BOOLEAN, 16, NULL, 0x0040, "Bit 6: Reserved for S7-400", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_7, { "Module in local bus segment", "s7comm.szl.0091.0000.eastat.modlocseg", FT_BOOLEAN, 16, NULL, 0x0080, "Bit 7: Module in local bus segment", HFILL }}, { &hf_s7comm_szl_0091_0000_eastat_dataid, { "Data ID for logical address", "s7comm.szl.0091.0000.eastat.dataid", FT_UINT16, BASE_HEX, VALS(szl_0091_0000_eastat_dataid_names), 0xff00, "Bit 8 to 15: Data ID for logical address", HFILL }}, { &hf_s7comm_szl_0091_0000_berbgbr, { "Ber_bgbr (Area ID/module width)", "s7comm.szl.0091.0000.berbgbr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0091_0000_berbgbr_0_2, { "Module width", "s7comm.szl.0091.0000.berbgbr.width", FT_UINT16, BASE_DEC, NULL, 0x0007, "Bit 0 to 2: Module width", HFILL }}, { &hf_s7comm_szl_0091_0000_berbgbr_3, { "Reserved", "s7comm.szl.0091.0000.berbgbr.bit3_res", FT_BOOLEAN, 16, NULL, 0x0008, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0091_0000_berbgbr_areaid, { "Area ID", "s7comm.szl.0091.0000.berbgbr.areaid", FT_UINT16, BASE_DEC, VALS(szl_0091_0000_berbgbr_areaid_names), 0x0070, "Bit 4 to 6: Area ID", HFILL }}, { &hf_s7comm_szl_0091_0000_berbgbr_7, { "Reserved", "s7comm.szl.0091.0000.berbgbr.bit7_res", FT_BOOLEAN, 16, NULL, 0x0080, "Bit 7: Reserved", HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy91_idx_0000(tvbuff_t *tvb, proto_tree *tree, guint16 id, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_adr1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_adr2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_logadr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_solltyp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_isttyp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; switch (id) { case 0x0c91: case 0x4c91: case 0x4d91: proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_res1_0c_4c_4d, tvb, offset, 2, ENC_BIG_ENDIAN); break; case 0x0d91: proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_res1_0d, tvb, offset, 2, ENC_BIG_ENDIAN); break; default: proto_tree_add_item(tree, hf_s7comm_szl_0091_0000_res1, tvb, offset, 2, ENC_BIG_ENDIAN); break; } offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0091_0000_eastat, ett_s7comm_szl_0091_0000_eastat, s7comm_szl_0091_0000_eastat_fields, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0091_0000_berbgbr, ett_s7comm_szl_0091_0000_berbgbr, s7comm_szl_0091_0000_berbgbr_fields, ENC_BIG_ENDIAN); offset += 2; return offset; } /******************************************************************************************************* * * SZL-ID: 0xxy92 * Index: 0x0000 * Content: * If you read the partial list SSL-ID W#16#xy92, you obtain information about the expected and the * current hardware configuration of centrally installed racks and stations of a DP master system. * *******************************************************************************************************/ static void s7comm_szl_xy92_xxxx_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0092_0xxx_status_0, { "status_0", "s7comm.szl.0092.xxxx.status_0", FT_UINT8, BASE_HEX, NULL, 0x0, "status_0: Status of station 1..8", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_1, { "status_1", "s7comm.szl.0092.xxxx.status_1", FT_UINT8, BASE_HEX, NULL, 0x0, "status_1: Status of station 9..16", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_2, { "status_2", "s7comm.szl.0092.xxxx.status_2", FT_UINT8, BASE_HEX, NULL, 0x0, "status_2: Status of station 17..24", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_3, { "status_3", "s7comm.szl.0092.xxxx.status_3", FT_UINT8, BASE_HEX, NULL, 0x0, "status_3: Status of station 25..32", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_4, { "status_4", "s7comm.szl.0092.xxxx.status_4", FT_UINT8, BASE_HEX, NULL, 0x0, "status_4: Status of station 33..40", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_5, { "status_5", "s7comm.szl.0092.xxxx.status_5", FT_UINT8, BASE_HEX, NULL, 0x0, "status_5: Status of station 41..48", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_6, { "status_6", "s7comm.szl.0092.xxxx.status_6", FT_UINT8, BASE_HEX, NULL, 0x0, "status_6: Status of station 49..56", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_7, { "status_7", "s7comm.szl.0092.xxxx.status_7", FT_UINT8, BASE_HEX, NULL, 0x0, "status_7: Status of station 57..64", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_8, { "status_8", "s7comm.szl.0092.xxxx.status_8", FT_UINT8, BASE_HEX, NULL, 0x0, "status_8: Status of station 65..72", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_9, { "status_9", "s7comm.szl.0092.xxxx.status_9", FT_UINT8, BASE_HEX, NULL, 0x0, "status_9: Status of station 73..80", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_10, { "status_10", "s7comm.szl.0092.xxxx.status_10", FT_UINT8, BASE_HEX, NULL, 0x0, "status_0: Status of station 81..88", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_11, { "status_11", "s7comm.szl.0092.xxxx.status_11", FT_UINT8, BASE_HEX, NULL, 0x0, "status_11: Status of station 89..96", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_12, { "status_12", "s7comm.szl.0092.xxxx.status_12", FT_UINT8, BASE_HEX, NULL, 0x0, "status_12: Status of station 97..104", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_13, { "status_13", "s7comm.szl.0092.xxxx.status_13", FT_UINT8, BASE_HEX, NULL, 0x0, "status_13: Status of station 105..112", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_14, { "status_14", "s7comm.szl.0092.xxxx.status_14", FT_UINT8, BASE_HEX, NULL, 0x0, "status_14: Status of station 113..120", HFILL }}, { &hf_s7comm_szl_0092_0xxx_status_15, { "status_15", "s7comm.szl.0092.xxxx.status_15", FT_UINT8, BASE_HEX, NULL, 0x0, "status_15: Status of station 121..128", HFILL }}, }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 add_station_byte_with_bitinfo(tvbuff_t *tvb, proto_tree *tree, gint hf, const gchar *info_text, guint32 start, guint32 offset) { proto_item *pi = NULL; proto_item *pti = NULL; proto_tree *pt = NULL; guint32 val; guint32 i; pi = proto_tree_add_item_ret_uint(tree, hf, tvb, offset, 1, ENC_BIG_ENDIAN, &val); /* Add the rack/station number when information bit is set */ if (val) { pt = proto_item_add_subtree(pi, ett_s7comm_szl_xx9x_station_info); for (i = 0; i < 8; i++) { if (val & 1) { pti = proto_tree_add_item(pt, hf_s7comm_szl_xx9x_station_info, tvb, offset, 1, ENC_NA); proto_item_set_text(pti, "%s: %d", info_text, start + i); } val >>= 1; } } return offset + 1; } static guint32 s7comm_decode_szl_id_xy92_idx_xxxx(tvbuff_t *tvb, proto_tree *tree, guint16 id, guint32 offset) { gchar *txt; switch (id) { case 0x0092: txt = "Rack/Station configured"; break; case 0x4092: txt = "Station configured"; break; case 0x0192: txt = "Station configured and activated"; break; case 0x0292: txt = "Rack/Station exists, activated and not failed"; break; case 0x0492: txt = "Station exists, activated and not failed"; break; case 0x0692: txt = "Modules of a station in a expansion rack not OK or station deactivated"; break; case 0x4692: txt = "Modules of a station not OK or station deactivated"; break; default: txt = "Station info bit set"; break; } offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_0, txt, 1, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_1, txt, 9, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_2, txt, 17, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_3, txt, 25, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_4, txt, 33, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_5, txt, 41, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_6, txt, 49, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_7, txt, 57, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_8, txt, 65, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_9, txt, 73, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_10, txt, 81, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_11, txt, 89, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_12, txt, 97, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_13, txt, 105, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_14, txt, 113, offset); offset = add_station_byte_with_bitinfo(tvb, tree, hf_s7comm_szl_0092_0xxx_status_15, txt, 121, offset); return offset; } /******************************************************************************************************* * * SZL-ID: 0x0x94 * Index: 0x0000 * Content: * Partial list SSL-ID W#16#0x94 contains information about the expected and actual * configuration of module racks in central configurations and stations of a * PROFIBUS DP mastersystem/PROFINET IO controller system. * *******************************************************************************************************/ static void s7comm_szl_0x94_xxxx_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0094_xxxx_index, { "Index", "s7comm.szl.0094.xxxx.index", FT_UINT16, BASE_HEX, NULL, 0x0, "Index: 0=central module, 1-32=distributed module on PROFIBUS DP, 100-115=distributed module on PROFINET IO", HFILL }}, { &hf_s7comm_szl_0094_xxxx_status_0, { "status_0 (Group information)", "s7comm.szl.0094.xxxx.status_0", FT_BOOLEAN, 8, NULL, 0x01, "status_0 (Group information): 1=at least one of the following status bis has the value 1", HFILL }}, { &hf_s7comm_szl_0094_xxxx_status_1_2047, { "Status", "s7comm.szl.0094.xxxx.status_1_2047", FT_BYTES, BASE_NONE, NULL, 0x0, "Status of Station 1 to 2047", HFILL }}, }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0x94_idx_xxxx(tvbuff_t *tvb, proto_tree *tree, guint16 id, guint32 offset) { proto_item *pi = NULL; proto_item *pti = NULL; proto_tree *pt = NULL; guint8 val; guint32 i, j; guint32 offset_tmp; guint32 n; gchar *txt; proto_tree_add_item(tree, hf_s7comm_szl_0094_xxxx_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0094_xxxx_status_0, tvb, offset, 1, ENC_BIG_ENDIAN); pi = proto_tree_add_item(tree, hf_s7comm_szl_0094_xxxx_status_1_2047, tvb, offset, 256, ENC_NA); offset_tmp = offset; val = tvb_get_guint8(tvb, offset_tmp); /* If first bit is set, there is at least one station with active information */ if (val & 1) { switch (id) { case 0x0094: txt = "Rack/Station configured"; break; case 0x0194: txt = "Station configured and deactivated"; break; case 0x0294: txt = "Rack/Station exists, activated and not failed"; break; case 0x0694: txt = "Rack/Station with at least one module disrupted or deactivated"; break; case 0x0794: txt = "Rack/Station with problem and/or maintenance requirement/request"; break; default: txt = "Station info bit set"; break; } pt = proto_item_add_subtree(pi, ett_s7comm_szl_xx9x_station_info); n = 0; /* Add the rack/station number when information bit is set */ for (i = 0; i < 256; i++) { val = tvb_get_guint8(tvb, offset_tmp); if (val) { for (j = 0; j < 8; j++) { if ((val & 1) && !(n == 0 && j == 0)) { /* skip group information bit */ pti = proto_tree_add_item(pt, hf_s7comm_szl_xx9x_station_info, tvb, offset_tmp, 1, ENC_NA); proto_item_set_text(pti, "%s: %d", txt, n + j); } val >>= 1; } } n += 8; offset_tmp += 1; } } return offset + 256; } /******************************************************************************************************* * * SZL-ID: 0xxy96 * Index: 0xxxxx * Content: * The partial list SSL-ID W#16#xy96 contains status information on all the modules assigned to the CPU. * *******************************************************************************************************/ static void s7comm_szl_xy96_xxxx_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0096_xxxx_logadr_adr, { "logadr (Address of the module)", "s7comm.szl.xx96.xxxx.logadr.adr", FT_UINT16, BASE_HEX, NULL, 0x7fff, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_logadr_area, { "logadr (Area)", "s7comm.szl.xx96.xxxx.logadr.area", FT_BOOLEAN, 16, TFS(&tfs_szl_0096_xxx_logadr_area), 0x8000, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_system, { "System (Identifier for the central module/DP master system ID /PROFINET IO system ID)", "s7comm.szl.xx96.xxxx.system", FT_UINT16, BASE_DEC, NULL, 0x0, "System: 0=central module, 1-32=distributed module on PROFIBUS DP, 100-115=distributed module on PROFINET IO", HFILL }}, { &hf_s7comm_szl_0096_xxxx_api, { "API (Configured Application Profile)", "s7comm.szl.xx96.xxxx.api", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_station, { "Station (Rack no./station number/device number)", "s7comm.szl.xx96.xxxx.station", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_slot, { "Slot (Slot number)", "s7comm.szl.xx96.xxxx.slot", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_subslot, { "Subslot (Interface module slot)", "s7comm.szl.xx96.xxxx.subslot", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_offset, { "Offset (Offset in the user data address range of the associated module)", "s7comm.szl.xx96.xxxx.offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_solltyp1, { "Solltyp1 (Expected Type: Manufacturer no. or profile identification)", "s7comm.szl.xx96.xxxx.solltyp1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_solltyp2, { "Solltyp2 (Device)", "s7comm.szl.xx96.xxxx.solltyp2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_solltyp3, { "Solltyp3 (Sequential number or profile index)", "s7comm.szl.xx96.xxxx.solltyp3", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_solltyp4_5, { "Solltyp4_5 (Submodule identification)", "s7comm.szl.xx96.xxxx.solltyp4_5", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_solltyp6_7, { "Solltyp6_7 (Interface module identification)", "s7comm.szl.xx96.xxxx.solltyp6_7", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_expactid, { "Expected/actual identifier", "s7comm.szl.xx96.xxxx.expactid", FT_UINT16, BASE_HEX, NULL, 0x0, "Expected/actual identifier: Bit0=0 -> Expected the same as actual, Bit0=1 -> Expected not same as actual", HFILL }}, { &hf_s7comm_szl_0096_xxxx_reserve1, { "Reserve 1", "s7comm.szl.xx96.xxxx.reserve1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* From here almost identical with ID 0x0091, but there are some differences and it's also convenient to have separate filter fields */ { &hf_s7comm_szl_0096_xxxx_eastat, { "I/O status", "s7comm.szl.xx96.xxxx.eastat", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_0, { "Module disrupted", "s7comm.szl.xx96.xxxx.eastat.moddisrupt", FT_BOOLEAN, 16, NULL, 0x0001, "Bit 0: Module disrupted (detected over diagnostic interrupt)", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_1, { "Module exists", "s7comm.szl.xx96.xxxx.eastat.modexists", FT_BOOLEAN, 16, NULL, 0x0002, "Bit 1: Module exists", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_2, { "Module not available", "s7comm.szl.xx96.xxxx.eastat.modnotav", FT_BOOLEAN, 16, NULL, 0x0004, "Bit 2: Module not available", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_3, { "Module disabled", "s7comm.szl.xx96.xxxx.eastat.moddisabl", FT_BOOLEAN, 16, NULL, 0x0008, "Bit 3: Module disabled", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_4, { "Problem on station", "s7comm.szl.xx96.xxxx.eastat.statproblem", FT_BOOLEAN, 16, NULL, 0x0010, "Bit 4: Problem on station (representative slot only)", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_5, { "CiR event active", "s7comm.szl.xx96.xxxx.eastat.ciractive", FT_BOOLEAN, 16, NULL, 0x0020, "Bit 5: A CiR event at this module/station is active or not yet completed", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_6, { "Reserved", "s7comm.szl.xx96.xxxx.eastat.res", FT_BOOLEAN, 16, NULL, 0x0040, "Bit 6: Reserved for S7-400", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_7, { "Module in local bus segment", "s7comm.szl.xx96.xxxx.eastat.modlocseg", FT_BOOLEAN, 16, NULL, 0x0080, "Bit 7: Module in local bus segment", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_8, { "Module maintenance required", "s7comm.szl.xx96.xxxx.eastat.modmaintreq", FT_BOOLEAN, 16, NULL, 0x0100, "Bit 8: Module maintenance required (green)", HFILL }}, { &hf_s7comm_szl_0096_xxxx_eastat_9, { "Module maintenance demand", "s7comm.szl.xx96.xxxx.eastat.modmaintdem", FT_BOOLEAN, 16, NULL, 0x0200, "Bit 9: Module maintenance demand (yellow)", HFILL }}, { &hf_s7comm_szl_0096_xxxx_berbgbr, { "Ber_bgbr (Area ID/module width)", "s7comm.szl.xx96.xxxx.berbgbr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0096_xxxx_berbgbr_0_2, { "Module width", "s7comm.szl.xx96.xxxx.berbgbr.width", FT_UINT16, BASE_DEC, NULL, 0x0007, "Bit 0 to 2: Module width", HFILL }}, { &hf_s7comm_szl_0096_xxxx_berbgbr_3, { "Reserved", "s7comm.szl.xx96.xxxx.berbgbr.bit3_res", FT_BOOLEAN, 16, NULL, 0x0008, "Bit 3: Reserved", HFILL }}, { &hf_s7comm_szl_0096_xxxx_berbgbr_areaid, { "Area ID", "s7comm.szl.xx96.xxxx.berbgbr.areaid", FT_UINT16, BASE_DEC, VALS(szl_0091_0000_berbgbr_areaid_names), 0x0070, "Bit 4 to 6: Area ID", HFILL }}, { &hf_s7comm_szl_0096_xxxx_berbgbr_7, { "Reserved", "s7comm.szl.xx96.xxxx.berbgbr.bit7_res", FT_BOOLEAN, 16, NULL, 0x0080, "Bit 7: Reserved", HFILL }}, { &hf_s7comm_szl_0096_xxxx_reserve2, { "res (Reserved)", "s7comm.szl.xx96.xxxx.reserve2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_xy96_idx_xxxx(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_logadr_adr, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_logadr_area, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_system, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_api, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_station, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_slot, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_subslot, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_offset, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_solltyp1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_solltyp2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_solltyp3, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_solltyp4_5, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_solltyp6_7, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_expactid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_reserve1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0096_xxxx_eastat, ett_s7comm_szl_0096_xxxx_eastat, s7comm_szl_0096_xxxx_eastat_fields, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0096_xxxx_berbgbr, ett_s7comm_szl_0096_xxxx_berbgbr, s7comm_szl_0096_xxxx_berbgbr_fields, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0096_xxxx_reserve2, tvb, offset, 10, ENC_NA); offset += 10; return offset; } /******************************************************************************************************* * * SZL-ID: 0x0424 * Index: 0x0000 * Content: * If you read the system status list with SZL-ID W#16#xy24, you obtain * information about the modes of the module. * *******************************************************************************************************/ static void s7comm_szl_0424_0000_register(int proto) { static hf_register_info hf[] = { { &hf_s7comm_szl_0424_0000_ereig, { "ereig", "s7comm.szl.0424.0000.ereig", FT_UINT16, BASE_HEX, NULL, 0x0, "Event ID", HFILL }}, { &hf_s7comm_szl_0424_0000_ae, { "ae", "s7comm.szl.0424.0000.ae", FT_UINT8, BASE_HEX, NULL, 0x0, "ae (B#16#FF)", HFILL }}, { &hf_s7comm_szl_0424_0000_bzu_id, { "bzu-id", "s7comm.szl.0424.0000.bzu_id", FT_UINT8, BASE_HEX, NULL, 0x0, "bzu-id (ID of the mode change divided into 4 bits, Bit 0 to 3: Requested mode, Bit 4 to 7: Previous mode", HFILL }}, { &hf_s7comm_szl_0424_0000_bzu_id_req, { "Requested mode", "s7comm.szl.0424.0000.bzu_id.req", FT_UINT8, BASE_HEX, VALS(szl_0424_0000_bzu_id_names), 0x0f, "bzu-id Requested mode", HFILL }}, { &hf_s7comm_szl_0424_0000_bzu_id_pre, { "Previous mode", "s7comm.szl.0424.0000.bzu_id.pre", FT_UINT8, BASE_HEX, VALS(szl_0424_0000_bzu_id_names), 0xf0, "bzu-id Previous mode", HFILL }}, { &hf_s7comm_szl_0424_0000_res, { "res (Reserved)", "s7comm.szl.0424.0000.res", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0424_0000_anlinfo1, { "anlinfo1", "s7comm.szl.0424.0000.anlinfo1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_szl_0424_0000_anlinfo2, { "anlinfo2", "s7comm.szl.0424.0000.anlinfo2", FT_UINT8, BASE_HEX, VALS(szl_0424_0000_anlinfo2_names), 0x0, "Type of startup just exceeded", HFILL }}, { &hf_s7comm_szl_0424_0000_anlinfo3, { "anlinfo3", "s7comm.szl.0424.0000.anlinfo3", FT_UINT8, BASE_HEX, NULL, 0x0, "Permissibility of startup types", HFILL }}, { &hf_s7comm_szl_0424_0000_anlinfo4, { "anlinfo4", "s7comm.szl.0424.0000.anlinfo4", FT_UINT8, BASE_HEX, VALS(szl_0424_0000_anlinfo4_names), 0x0, "Last valid operation or setting of the automatic startup type at power on", HFILL }}, { &hf_s7comm_szl_0424_0000_time, { "time", "s7comm.szl.0424.0000.time", FT_BYTES, BASE_NONE, NULL, 0x0, "time (Time stamp)", HFILL }} }; proto_register_field_array(proto, hf, array_length(hf)); } /*----------------------------------------------------------------------------------------------------*/ static guint32 s7comm_decode_szl_id_0424_idx_0000(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_ereig, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_ae, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_s7comm_szl_0424_0000_bzu_id, ett_s7comm_szl_0424_0000_bzu_id, s7comm_szl_0424_0000_bzu_id_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_res, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_anlinfo1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_anlinfo2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_anlinfo3, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_anlinfo4, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_s7comm_szl_0424_0000_time, tvb, offset, 8, ENC_NA); offset += 8; return offset; } /******************************************************************************************************* * * Register SZL header fields * *******************************************************************************************************/ void s7comm_register_szl_types(int proto) { static hf_register_info hf[] = { /*** SZL functions ***/ { &hf_s7comm_userdata_szl_partial_list, { "SZL partial list data", "s7comm.param.userdata.szl_part_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* SZL ID */ { &hf_s7comm_userdata_szl_id, { "SZL-ID", "s7comm.data.userdata.szl_id", FT_UINT16, BASE_HEX, NULL, 0x0, "SZL-ID (System Status List) Bits 15-12: Diagnostic type, Bits 11-8: Number of the partial list extract, Bits 7-0: Number of the partial list", HFILL }}, /* N.B. 2nd member of the bitfield test covers all 16 bits.. */ { &hf_s7comm_userdata_szl_id_type, { "Diagnostic type", "s7comm.data.userdata.szl_id.diag_type", FT_UINT16, BASE_HEX, VALS(szl_module_type_names), 0xf000, NULL, HFILL }}, { &hf_s7comm_userdata_szl_id_partlist_ex, { "Number of the partial list extract", "s7comm.data.userdata.szl_id.partlist_ex", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &szl_id_partlist_ex_names_ext, 0xffff, NULL, HFILL }}, { &hf_s7comm_userdata_szl_id_partlist_num, { "Number of the partial list", "s7comm.data.userdata.szl_id.partlist_num", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &szl_partial_list_names_ext, 0x00ff, NULL, HFILL }}, /* SZL index */ { &hf_s7comm_userdata_szl_index, { "SZL-Index", "s7comm.data.userdata.szl_index", FT_UINT16, BASE_HEX, NULL, 0x0, "SZL-Index (System Status List)", HFILL }}, { &hf_s7comm_userdata_szl_tree, { "SZL data tree", "s7comm.data.userdata.szl_data_tree", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_szl_id_partlist_len, { "SZL partial list length in bytes", "s7comm.data.userdata.szl_id.partlist_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_s7comm_userdata_szl_id_partlist_cnt, { "SZL partial list count", "s7comm.data.userdata.szl_id.partlist_cnt", FT_UINT16, BASE_DEC, NULL, 0x0, "SZL partial list count: the number of datasets in the results", HFILL }}, { &hf_s7comm_szl_xy12_0x00_charac, { "Characteristic", "s7comm.szl.xy12.0x00.charac", FT_UINT16, BASE_HEX, VALS(szl_xy12_cpu_characteristic_names), 0x0, NULL, HFILL }}, /* For general usage as a station information */ { &hf_s7comm_szl_xx9x_station_info, { "Station", "s7comm.szl.xy12.xx9x.station_info", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; /* Register Subtrees */ static gint *ett[] = { &ett_s7comm_szl, &ett_s7comm_userdata_szl_id, &ett_s7comm_szl_xy22_00xx_al1, &ett_s7comm_szl_xy22_00xx_al2, &ett_s7comm_szl_0131_0002_funkt_0, &ett_s7comm_szl_0131_0002_funkt_1, &ett_s7comm_szl_0131_0002_funkt_2, &ett_s7comm_szl_0131_0002_trgereig_0, &ett_s7comm_szl_0131_0002_trgereig_1, &ett_s7comm_szl_0131_0003_funkt_0, &ett_s7comm_szl_0131_0003_funkt_1, &ett_s7comm_szl_0131_0003_funkt_2, &ett_s7comm_szl_0131_0003_funkt_3, &ett_s7comm_szl_0131_0004_funkt_0, &ett_s7comm_szl_0131_0004_funkt_1, &ett_s7comm_szl_0131_0004_funkt_2, &ett_s7comm_szl_0131_0004_funkt_3, &ett_s7comm_szl_0131_0004_funkt_4, &ett_s7comm_szl_0131_0005_funkt_0, &ett_s7comm_szl_0131_0006_funkt_0, &ett_s7comm_szl_0131_0006_funkt_1, &ett_s7comm_szl_0131_0006_funkt_2, &ett_s7comm_szl_0131_0006_funkt_3, &ett_s7comm_szl_0131_0006_funkt_6, &ett_s7comm_szl_0131_0006_funkt_7, &ett_s7comm_szl_0131_0006_zugtyp_0, &ett_s7comm_szl_0131_0006_zugtyp_1, &ett_s7comm_szl_0131_0006_zugtyp_2, &ett_s7comm_szl_0131_0006_zugtyp_3, &ett_s7comm_szl_0131_0006_zugtyp_6, &ett_s7comm_szl_0131_0006_zugtyp_7, &ett_s7comm_szl_0131_0007_funkt_0, &ett_s7comm_szl_0131_0007_obj_0, &ett_s7comm_szl_0131_0007_mode, &ett_s7comm_szl_0131_0009_sync_k, &ett_s7comm_szl_0131_0009_sync_mpi, &ett_s7comm_szl_0131_0009_sync_mfi, &ett_s7comm_szl_0131_0010_funk_1, &ett_s7comm_szl_0131_0010_ber_meld_1, &ett_s7comm_szl_0131_0010_ber_zus_1, &ett_s7comm_szl_0131_0010_typ_zus_1, &ett_s7comm_szl_0091_0000_eastat, &ett_s7comm_szl_0091_0000_berbgbr, &ett_s7comm_szl_0096_xxxx_eastat, &ett_s7comm_szl_0096_xxxx_berbgbr, &ett_s7comm_szl_xx9x_station_info, &ett_s7comm_szl_0424_0000_bzu_id, }; proto_register_subtree_array(ett, array_length (ett)); proto_register_field_array(proto, hf, array_length(hf)); /* Register the SZL fields */ s7comm_szl_0000_0000_register(proto); s7comm_szl_0013_0000_register(proto); s7comm_szl_xy14_000x_register(proto); s7comm_szl_xy15_000x_register(proto); s7comm_szl_xy11_0001_register(proto); s7comm_szl_xy22_00xx_register(proto); s7comm_szl_0131_0001_register(proto); s7comm_szl_0131_0002_register(proto); s7comm_szl_0131_0003_register(proto); s7comm_szl_0131_0004_register(proto); s7comm_szl_0131_0005_register(proto); s7comm_szl_0131_0006_register(proto); s7comm_szl_0131_0007_register(proto); s7comm_szl_0131_0008_register(proto); s7comm_szl_0131_0009_register(proto); s7comm_szl_0131_0010_register(proto); s7comm_szl_0132_0001_register(proto); s7comm_szl_0132_0002_register(proto); s7comm_szl_0132_0004_register(proto); s7comm_szl_0132_0005_register(proto); s7comm_szl_0132_0006_register(proto); s7comm_szl_0132_0008_register(proto); s7comm_szl_0132_000b_register(proto); s7comm_szl_0132_000c_register(proto); s7comm_szl_xy1c_000x_register(proto); s7comm_szl_xy91_0000_register(proto); s7comm_szl_xy92_xxxx_register(proto); s7comm_szl_0x94_xxxx_register(proto); s7comm_szl_xy96_xxxx_register(proto); s7comm_szl_xy74_0000_register(proto); s7comm_szl_0424_0000_register(proto); } /******************************************************************************************************* * * PDU Type: User Data -> Function group 4 -> SZL functions * *******************************************************************************************************/ guint32 s7comm_decode_ud_cpu_szl_subfunc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, /* Type of data (request/response) */ guint8 ret_val, /* Return value in data part */ guint32 dlength, guint32 offset) { guint16 id; guint16 idx; guint16 list_len; guint16 list_count; guint16 i; guint32 start_offset; proto_item *szl_item = NULL; proto_tree *szl_item_tree = NULL; proto_item *szl_item_entry = NULL; const gchar* szl_index_description; gboolean szl_decoded = FALSE; start_offset = offset; if (type == S7COMM_UD_TYPE_REQ) { id = tvb_get_ntohs(tvb, offset); proto_tree_add_bitmask(data_tree, tvb, offset, hf_s7comm_userdata_szl_id, ett_s7comm_userdata_szl_id, s7comm_userdata_szl_id_fields, ENC_BIG_ENDIAN); offset += 2; idx = tvb_get_ntohs(tvb, offset); szl_item_entry = proto_tree_add_item(data_tree, hf_s7comm_userdata_szl_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; szl_index_description = s7comm_get_szl_id_index_description_text(id, idx); if (szl_index_description != NULL) { proto_item_append_text(szl_item_entry, " [%s]", szl_index_description); } proto_item_append_text(data_tree, " (SZL-ID: 0x%04x, Index: 0x%04x)", id, idx); col_append_fstr(pinfo->cinfo, COL_INFO, " ID=0x%04x Index=0x%04x" , id, idx); } else if (type == S7COMM_UD_TYPE_RES) { if (ret_val == S7COMM_ITEM_RETVAL_DATA_OK) { id = tvb_get_ntohs(tvb, offset); proto_tree_add_bitmask(data_tree, tvb, offset, hf_s7comm_userdata_szl_id, ett_s7comm_userdata_szl_id, s7comm_userdata_szl_id_fields, ENC_BIG_ENDIAN); offset += 2; idx = tvb_get_ntohs(tvb, offset); szl_item_entry = proto_tree_add_item(data_tree, hf_s7comm_userdata_szl_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; szl_index_description = s7comm_get_szl_id_index_description_text(id, idx); if (szl_index_description != NULL) { proto_item_append_text(szl_item_entry, " [%s]", szl_index_description); } proto_item_append_text(data_tree, " (SZL-ID: 0x%04x, Index: 0x%04x)", id, idx); col_append_fstr(pinfo->cinfo, COL_INFO, " ID=0x%04x Index=0x%04x" , id, idx); /* SZL-Data, 4 Bytes header, 4 bytes id/index = 8 bytes */ list_len = tvb_get_ntohs(tvb, offset); /* Length of an list set in bytes */ proto_tree_add_uint(data_tree, hf_s7comm_userdata_szl_id_partlist_len, tvb, offset, 2, list_len); offset += 2; list_count = tvb_get_ntohs(tvb, offset); /* count of partlists */ proto_tree_add_uint(data_tree, hf_s7comm_userdata_szl_id_partlist_cnt, tvb, offset, 2, list_count); offset += 2; /* Check the listcount, as in fragmented packets some CPUs (firmware bug?) send 0xffff as list count */ if (((guint32)list_count * (guint32)list_len) > (dlength - (offset - start_offset))) { /* TODO: Make entry in expert field */ list_count = (dlength - (offset - start_offset)) / list_len; } /* Add a Data element for each partlist */ if (dlength > 8) { /* minimum length of a correct szl data part is 8 bytes */ for (i = 1; i <= list_count && (list_count * list_len != 0); i++) { /* Add a separate tree for the SZL data */ szl_item = proto_tree_add_item(data_tree, hf_s7comm_userdata_szl_tree, tvb, offset, list_len, ENC_NA); szl_item_tree = proto_item_add_subtree(szl_item, ett_s7comm_szl); proto_item_append_text(szl_item, " (list count no. %d)", i); szl_decoded = FALSE; /* lets try to decode some known szl-id and indexes */ switch (id) { case 0x0000: offset = s7comm_decode_szl_id_xy00(tvb, szl_item_tree, id, idx, offset); szl_decoded = TRUE; break; case 0x0012: case 0x0112: proto_tree_add_item(szl_item_tree, hf_s7comm_szl_xy12_0x00_charac, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; szl_decoded = TRUE; break; case 0x0013: case 0x0113: if (idx == 0x0000) { offset = s7comm_decode_szl_id_0013_idx_0000(tvb, szl_item_tree, offset); szl_decoded = TRUE; } break; case 0x0014: case 0x0114: offset = s7comm_decode_szl_id_xy14_idx_000x(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0015: case 0x0115: offset = s7comm_decode_szl_id_xy15_idx_000x(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0011: case 0x0111: /* It's (almost) the same structure for all possible indexes */ offset = s7comm_decode_szl_id_0111_idx_0001(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0222: offset = s7comm_decode_szl_id_xy22_idx_00xx(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x00a0: case 0x01a0: case 0x04a0: case 0x05a0: case 0x06a0: case 0x07a0: case 0x08a0: case 0x09a0: case 0x0aa0: case 0x0ba0: case 0x0ca0: case 0x0da0: case 0x0ea0: /* the data structure is the same as used when CPU is sending online such messages */ offset = s7comm_decode_ud_cpu_diagnostic_message(tvb, pinfo, FALSE, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x001c: case 0x011c: case 0x021c: case 0x031c: offset = s7comm_decode_szl_id_xy1c_idx_000x(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0131: switch (idx) { case 0x0001: offset = s7comm_decode_szl_id_0131_idx_0001(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0002: offset = s7comm_decode_szl_id_0131_idx_0002(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0003: offset = s7comm_decode_szl_id_0131_idx_0003(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0004: offset = s7comm_decode_szl_id_0131_idx_0004(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0005: offset = s7comm_decode_szl_id_0131_idx_0005(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0006: offset = s7comm_decode_szl_id_0131_idx_0006(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0007: offset = s7comm_decode_szl_id_0131_idx_0007(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0008: offset = s7comm_decode_szl_id_0131_idx_0008(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0009: offset = s7comm_decode_szl_id_0131_idx_0009(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0010: offset = s7comm_decode_szl_id_0131_idx_0010(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; } break; case 0x0132: switch (idx) { case 0x0001: offset = s7comm_decode_szl_id_0132_idx_0001(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0002: offset = s7comm_decode_szl_id_0132_idx_0002(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0004: offset = s7comm_decode_szl_id_0132_idx_0004(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0005: offset = s7comm_decode_szl_id_0132_idx_0005(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0006: offset = s7comm_decode_szl_id_0132_idx_0006(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0008: offset = s7comm_decode_szl_id_0132_idx_0008(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x000b: offset = s7comm_decode_szl_id_0132_idx_000b(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x000c: offset = s7comm_decode_szl_id_0132_idx_000c(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; } break; case 0x0019: case 0x0119: case 0x0074: case 0x0174: offset = s7comm_decode_szl_id_xy74_idx_0000(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0091: case 0x0191: case 0x0291: case 0x0391: case 0x0491: case 0x0591: case 0x0991: case 0x0a91: case 0x0c91: case 0x4c91: case 0x0d91: case 0x0e91: offset = s7comm_decode_szl_id_xy91_idx_0000(tvb, szl_item_tree, id, offset); szl_decoded = TRUE; break; case 0x0092: case 0x0192: case 0x0292: case 0x0392: case 0x0492: case 0x0592: case 0x0692: case 0x4092: case 0x4292: case 0x4692: offset = s7comm_decode_szl_id_xy92_idx_xxxx(tvb, szl_item_tree, id, offset); szl_decoded = TRUE; break; case 0x0094: case 0x0194: case 0x0294: case 0x0694: case 0x0794: offset = s7comm_decode_szl_id_0x94_idx_xxxx(tvb, szl_item_tree, id, offset); szl_decoded = TRUE; break; case 0x0696: case 0x0c96: offset = s7comm_decode_szl_id_xy96_idx_xxxx(tvb, szl_item_tree, offset); szl_decoded = TRUE; break; case 0x0124: case 0x0424: if (idx == 0x0000) { offset = s7comm_decode_szl_id_0424_idx_0000(tvb, szl_item_tree, offset); szl_decoded = TRUE; } break; default: szl_decoded = FALSE; break; } if (szl_decoded == FALSE) { proto_tree_add_item(szl_item_tree, hf_s7comm_userdata_szl_partial_list, tvb, offset, list_len, ENC_NA); offset += list_len; } } /* ...for */ } } else { col_append_fstr(pinfo->cinfo, COL_INFO, " Return value:[%s]", val_to_str(ret_val, s7comm_item_return_valuenames, "Unknown return value:0x%02x")); } } return offset; } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-s7comm_szl_ids.h
/* packet-s7comm_szl_ids.h * * Author: Thomas Wiens, 2014 ([email protected]) * Description: Wireshark dissector for S7-Communication * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_S7COMM_SZL_IDS_H__ #define __PACKET_S7COMM_SZL_IDS_H__ guint32 s7comm_decode_ud_cpu_szl_subfunc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint8 ret_val, guint32 dlength, guint32 offset); void s7comm_register_szl_types(int proto); #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sabp.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-sabp.c */ /* asn2wrs.py -L -p sabp -c ./sabp.cnf -s ./packet-sabp-template -D . -O ../.. SABP-CommonDataTypes.asn SABP-Constants.asn SABP-Containers.asn SABP-IEs.asn SABP-PDU-Contents.asn SABP-PDU-Descriptions.asn */ /* packet-sabp-template.c * Routines for UTRAN Iu-BC Interface: Service Area Broadcast Protocol (SABP) packet dissection * Copyright 2007, Tomas Kukosa <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * Ref: 3GPP TS 25.419 version V9.0.0 (2009-12) */ #include "config.h" #include <epan/packet.h> #include <epan/asn1.h> #include "packet-tcp.h" #include "packet-per.h" #include "packet-e212.h" #include "packet-gsm_map.h" #include "packet-gsm_sms.h" #include <epan/sctpppids.h> #include "packet-cell_broadcast.h" #define PNAME "UTRAN IuBC interface SABP signaling" #define PSNAME "SABP" #define PFNAME "sabp" #define maxNrOfErrors 256 #define maxnoofSAI 65535 #define maxProtocolExtensions 65535 #define maxProtocolIEs 65535 #define maxNrOfLevels 256 typedef enum _ProcedureCode_enum { id_Write_Replace = 0, id_Kill = 1, id_Load_Status_Enquiry = 2, id_Message_Status_Query = 3, id_Restart_Indication = 4, id_Reset = 5, id_Failure_Indication = 6, id_Error_Indication = 7 } ProcedureCode_enum; typedef enum _ProtocolIE_ID_enum { id_Broadcast_Message_Content = 0, id_Category = 1, id_Cause = 2, id_Criticality_Diagnostics = 3, id_Data_Coding_Scheme = 4, id_Failure_List = 5, id_Message_Identifier = 6, id_New_Serial_Number = 7, id_Number_of_Broadcasts_Completed_List = 8, id_Number_of_Broadcasts_Requested = 9, id_Old_Serial_Number = 10, id_Radio_Resource_Loading_List = 11, id_Recovery_Indication = 12, id_Repetition_Period = 13, id_Serial_Number = 14, id_Service_Areas_List = 15, id_MessageStructure = 16, id_TypeOfError = 17, id_Paging_ETWS_Indicator = 18, id_Warning_Type = 19, id_WarningSecurityInfo = 20, id_Broadcast_Message_Content_Validity_Indicator = 21 } ProtocolIE_ID_enum; void proto_register_sabp(void); void proto_reg_handoff_sabp(void); /* Initialize the protocol and registered fields */ static int proto_sabp = -1; static int hf_sabp_no_of_pages = -1; static int hf_sabp_cb_inf_len = -1; static int hf_sabp_cb_msg_inf_page = -1; static int hf_sabp_cbs_page_content = -1; static int hf_sabp_Broadcast_Message_Content_PDU = -1; /* Broadcast_Message_Content */ static int hf_sabp_Broadcast_Message_Content_Validity_Indicator_PDU = -1; /* Broadcast_Message_Content_Validity_Indicator */ static int hf_sabp_Category_PDU = -1; /* Category */ static int hf_sabp_Cause_PDU = -1; /* Cause */ static int hf_sabp_Criticality_Diagnostics_PDU = -1; /* Criticality_Diagnostics */ static int hf_sabp_MessageStructure_PDU = -1; /* MessageStructure */ static int hf_sabp_Data_Coding_Scheme_PDU = -1; /* Data_Coding_Scheme */ static int hf_sabp_Failure_List_PDU = -1; /* Failure_List */ static int hf_sabp_Message_Identifier_PDU = -1; /* Message_Identifier */ static int hf_sabp_New_Serial_Number_PDU = -1; /* New_Serial_Number */ static int hf_sabp_Number_of_Broadcasts_Completed_List_PDU = -1; /* Number_of_Broadcasts_Completed_List */ static int hf_sabp_Number_of_Broadcasts_Requested_PDU = -1; /* Number_of_Broadcasts_Requested */ static int hf_sabp_Old_Serial_Number_PDU = -1; /* Old_Serial_Number */ static int hf_sabp_Paging_ETWS_Indicator_PDU = -1; /* Paging_ETWS_Indicator */ static int hf_sabp_Radio_Resource_Loading_List_PDU = -1; /* Radio_Resource_Loading_List */ static int hf_sabp_Recovery_Indication_PDU = -1; /* Recovery_Indication */ static int hf_sabp_Repetition_Period_PDU = -1; /* Repetition_Period */ static int hf_sabp_Serial_Number_PDU = -1; /* Serial_Number */ static int hf_sabp_Service_Areas_List_PDU = -1; /* Service_Areas_List */ static int hf_sabp_TypeOfError_PDU = -1; /* TypeOfError */ static int hf_sabp_WarningSecurityInfo_PDU = -1; /* WarningSecurityInfo */ static int hf_sabp_Warning_Type_PDU = -1; /* Warning_Type */ static int hf_sabp_Write_Replace_PDU = -1; /* Write_Replace */ static int hf_sabp_Write_Replace_Complete_PDU = -1; /* Write_Replace_Complete */ static int hf_sabp_Write_Replace_Failure_PDU = -1; /* Write_Replace_Failure */ static int hf_sabp_Kill_PDU = -1; /* Kill */ static int hf_sabp_Kill_Complete_PDU = -1; /* Kill_Complete */ static int hf_sabp_Kill_Failure_PDU = -1; /* Kill_Failure */ static int hf_sabp_Load_Query_PDU = -1; /* Load_Query */ static int hf_sabp_Load_Query_Complete_PDU = -1; /* Load_Query_Complete */ static int hf_sabp_Load_Query_Failure_PDU = -1; /* Load_Query_Failure */ static int hf_sabp_Message_Status_Query_PDU = -1; /* Message_Status_Query */ static int hf_sabp_Message_Status_Query_Complete_PDU = -1; /* Message_Status_Query_Complete */ static int hf_sabp_Message_Status_Query_Failure_PDU = -1; /* Message_Status_Query_Failure */ static int hf_sabp_Reset_PDU = -1; /* Reset */ static int hf_sabp_Reset_Complete_PDU = -1; /* Reset_Complete */ static int hf_sabp_Reset_Failure_PDU = -1; /* Reset_Failure */ static int hf_sabp_Restart_PDU = -1; /* Restart */ static int hf_sabp_Failure_PDU = -1; /* Failure */ static int hf_sabp_Error_Indication_PDU = -1; /* Error_Indication */ static int hf_sabp_SABP_PDU_PDU = -1; /* SABP_PDU */ static int hf_sabp_ProtocolIE_Container_item = -1; /* ProtocolIE_Field */ static int hf_sabp_id = -1; /* ProtocolIE_ID */ static int hf_sabp_criticality = -1; /* Criticality */ static int hf_sabp_protocolIE_Field_value = -1; /* ProtocolIE_Field_value */ static int hf_sabp_ProtocolExtensionContainer_item = -1; /* ProtocolExtensionField */ static int hf_sabp_ext_id = -1; /* ProtocolExtensionID */ static int hf_sabp_extensionValue = -1; /* T_extensionValue */ static int hf_sabp_procedureCode = -1; /* ProcedureCode */ static int hf_sabp_triggeringMessage = -1; /* TriggeringMessage */ static int hf_sabp_procedureCriticality = -1; /* Criticality */ static int hf_sabp_iEsCriticalityDiagnostics = -1; /* CriticalityDiagnostics_IE_List */ static int hf_sabp_iE_Extensions = -1; /* ProtocolExtensionContainer */ static int hf_sabp_CriticalityDiagnostics_IE_List_item = -1; /* CriticalityDiagnostics_IE_List_item */ static int hf_sabp_iECriticality = -1; /* Criticality */ static int hf_sabp_iE_ID = -1; /* ProtocolIE_ID */ static int hf_sabp_repetitionNumber = -1; /* RepetitionNumber0 */ static int hf_sabp_MessageStructure_item = -1; /* MessageStructure_item */ static int hf_sabp_repetitionNumber1 = -1; /* RepetitionNumber1 */ static int hf_sabp_Failure_List_item = -1; /* Failure_List_Item */ static int hf_sabp_service_area_identifier = -1; /* Service_Area_Identifier */ static int hf_sabp_cause = -1; /* Cause */ static int hf_sabp_Number_of_Broadcasts_Completed_List_item = -1; /* Number_of_Broadcasts_Completed_List_Item */ static int hf_sabp_number_of_broadcasts_completed = -1; /* INTEGER_0_65535 */ static int hf_sabp_number_of_broadcasts_completed_info = -1; /* Number_Of_Broadcasts_Completed_Info */ static int hf_sabp_Radio_Resource_Loading_List_item = -1; /* Radio_Resource_Loading_List_Item */ static int hf_sabp_available_bandwidth = -1; /* Available_Bandwidth */ static int hf_sabp_pLMNidentity = -1; /* T_pLMNidentity */ static int hf_sabp_lac = -1; /* OCTET_STRING_SIZE_2 */ static int hf_sabp_sac = -1; /* OCTET_STRING_SIZE_2 */ static int hf_sabp_Service_Areas_List_item = -1; /* Service_Area_Identifier */ static int hf_sabp_protocolIEs = -1; /* ProtocolIE_Container */ static int hf_sabp_protocolExtensions = -1; /* ProtocolExtensionContainer */ static int hf_sabp_initiatingMessage = -1; /* InitiatingMessage */ static int hf_sabp_successfulOutcome = -1; /* SuccessfulOutcome */ static int hf_sabp_unsuccessfulOutcome = -1; /* UnsuccessfulOutcome */ static int hf_sabp_initiatingMessage_value = -1; /* InitiatingMessage_value */ static int hf_sabp_successfulOutcome_value = -1; /* SuccessfulOutcome_value */ static int hf_sabp_unsuccessfulOutcome_value = -1; /* UnsuccessfulOutcome_value */ /* Initialize the subtree pointers */ static int ett_sabp = -1; static int ett_sabp_e212 = -1; static int ett_sabp_cbs_data_coding = -1; static int ett_sabp_bcast_msg = -1; static int ett_sabp_cbs_serial_number = -1; static int ett_sabp_cbs_new_serial_number = -1; static int ett_sabp_cbs_page = -1; static int ett_sabp_cbs_page_content = -1; static gint ett_sabp_ProtocolIE_Container = -1; static gint ett_sabp_ProtocolIE_Field = -1; static gint ett_sabp_ProtocolExtensionContainer = -1; static gint ett_sabp_ProtocolExtensionField = -1; static gint ett_sabp_Criticality_Diagnostics = -1; static gint ett_sabp_CriticalityDiagnostics_IE_List = -1; static gint ett_sabp_CriticalityDiagnostics_IE_List_item = -1; static gint ett_sabp_MessageStructure = -1; static gint ett_sabp_MessageStructure_item = -1; static gint ett_sabp_Failure_List = -1; static gint ett_sabp_Failure_List_Item = -1; static gint ett_sabp_Number_of_Broadcasts_Completed_List = -1; static gint ett_sabp_Number_of_Broadcasts_Completed_List_Item = -1; static gint ett_sabp_Radio_Resource_Loading_List = -1; static gint ett_sabp_Radio_Resource_Loading_List_Item = -1; static gint ett_sabp_Service_Area_Identifier = -1; static gint ett_sabp_Service_Areas_List = -1; static gint ett_sabp_Write_Replace = -1; static gint ett_sabp_Write_Replace_Complete = -1; static gint ett_sabp_Write_Replace_Failure = -1; static gint ett_sabp_Kill = -1; static gint ett_sabp_Kill_Complete = -1; static gint ett_sabp_Kill_Failure = -1; static gint ett_sabp_Load_Query = -1; static gint ett_sabp_Load_Query_Complete = -1; static gint ett_sabp_Load_Query_Failure = -1; static gint ett_sabp_Message_Status_Query = -1; static gint ett_sabp_Message_Status_Query_Complete = -1; static gint ett_sabp_Message_Status_Query_Failure = -1; static gint ett_sabp_Reset = -1; static gint ett_sabp_Reset_Complete = -1; static gint ett_sabp_Reset_Failure = -1; static gint ett_sabp_Restart = -1; static gint ett_sabp_Failure = -1; static gint ett_sabp_Error_Indication = -1; static gint ett_sabp_SABP_PDU = -1; static gint ett_sabp_InitiatingMessage = -1; static gint ett_sabp_SuccessfulOutcome = -1; static gint ett_sabp_UnsuccessfulOutcome = -1; /* Global variables */ static guint32 ProcedureCode; static guint32 ProtocolIE_ID; static guint32 ProtocolExtensionID; static guint8 sms_encoding; #define SABP_PORT 3452 /* Dissector tables */ static dissector_table_t sabp_ies_dissector_table; static dissector_table_t sabp_extension_dissector_table; static dissector_table_t sabp_proc_imsg_dissector_table; static dissector_table_t sabp_proc_sout_dissector_table; static dissector_table_t sabp_proc_uout_dissector_table; static dissector_handle_t sabp_handle; static dissector_handle_t sabp_tcp_handle; static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static void dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static const value_string sabp_Criticality_vals[] = { { 0, "reject" }, { 1, "ignore" }, { 2, "notify" }, { 0, NULL } }; static int dissect_sabp_Criticality(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static const value_string sabp_ProcedureCode_vals[] = { { id_Write_Replace, "id-Write-Replace" }, { id_Kill, "id-Kill" }, { id_Load_Status_Enquiry, "id-Load-Status-Enquiry" }, { id_Message_Status_Query, "id-Message-Status-Query" }, { id_Restart_Indication, "id-Restart-Indication" }, { id_Reset, "id-Reset" }, { id_Failure_Indication, "id-Failure-Indication" }, { id_Error_Indication, "id-Error-Indication" }, { 0, NULL } }; static value_string_ext sabp_ProcedureCode_vals_ext = VALUE_STRING_EXT_INIT(sabp_ProcedureCode_vals); static int dissect_sabp_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, &ProcedureCode, FALSE); col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", val_to_str_ext(ProcedureCode, &sabp_ProcedureCode_vals_ext, "unknown message")); return offset; } static int dissect_sabp_ProtocolExtensionID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &ProtocolExtensionID, FALSE); return offset; } static const value_string sabp_ProtocolIE_ID_vals[] = { { id_Broadcast_Message_Content, "id-Broadcast-Message-Content" }, { id_Category, "id-Category" }, { id_Cause, "id-Cause" }, { id_Criticality_Diagnostics, "id-Criticality-Diagnostics" }, { id_Data_Coding_Scheme, "id-Data-Coding-Scheme" }, { id_Failure_List, "id-Failure-List" }, { id_Message_Identifier, "id-Message-Identifier" }, { id_New_Serial_Number, "id-New-Serial-Number" }, { id_Number_of_Broadcasts_Completed_List, "id-Number-of-Broadcasts-Completed-List" }, { id_Number_of_Broadcasts_Requested, "id-Number-of-Broadcasts-Requested" }, { id_Old_Serial_Number, "id-Old-Serial-Number" }, { id_Radio_Resource_Loading_List, "id-Radio-Resource-Loading-List" }, { id_Recovery_Indication, "id-Recovery-Indication" }, { id_Repetition_Period, "id-Repetition-Period" }, { id_Serial_Number, "id-Serial-Number" }, { id_Service_Areas_List, "id-Service-Areas-List" }, { id_MessageStructure, "id-MessageStructure" }, { id_TypeOfError, "id-TypeOfError" }, { id_Paging_ETWS_Indicator, "id-Paging-ETWS-Indicator" }, { id_Warning_Type, "id-Warning-Type" }, { id_WarningSecurityInfo, "id-WarningSecurityInfo" }, { id_Broadcast_Message_Content_Validity_Indicator, "id-Broadcast-Message-Content-Validity-Indicator" }, { 0, NULL } }; static value_string_ext sabp_ProtocolIE_ID_vals_ext = VALUE_STRING_EXT_INIT(sabp_ProtocolIE_ID_vals); static int dissect_sabp_ProtocolIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &ProtocolIE_ID, FALSE); if (tree) { proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str_ext(ProtocolIE_ID, &sabp_ProtocolIE_ID_vals_ext, "unknown (%d)")); } return offset; } static const value_string sabp_TriggeringMessage_vals[] = { { 0, "initiating-message" }, { 1, "successful-outcome" }, { 2, "unsuccessful-outcome" }, { 3, "outcome" }, { 0, NULL } }; static int dissect_sabp_TriggeringMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, FALSE, 0, NULL); return offset; } static int dissect_sabp_ProtocolIE_Field_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolIEFieldValue); return offset; } static const per_sequence_t ProtocolIE_Field_sequence[] = { { &hf_sabp_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_ID }, { &hf_sabp_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Criticality }, { &hf_sabp_protocolIE_Field_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Field_value }, { NULL, 0, 0, NULL } }; static int dissect_sabp_ProtocolIE_Field(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_ProtocolIE_Field, ProtocolIE_Field_sequence); return offset; } static const per_sequence_t ProtocolIE_Container_sequence_of[1] = { { &hf_sabp_ProtocolIE_Container_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Field }, }; static int dissect_sabp_ProtocolIE_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_ProtocolIE_Container, ProtocolIE_Container_sequence_of, 0, maxProtocolIEs, FALSE); return offset; } static int dissect_sabp_T_extensionValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolExtensionFieldExtensionValue); return offset; } static const per_sequence_t ProtocolExtensionField_sequence[] = { { &hf_sabp_ext_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolExtensionID }, { &hf_sabp_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Criticality }, { &hf_sabp_extensionValue , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_T_extensionValue }, { NULL, 0, 0, NULL } }; static int dissect_sabp_ProtocolExtensionField(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_ProtocolExtensionField, ProtocolExtensionField_sequence); return offset; } static const per_sequence_t ProtocolExtensionContainer_sequence_of[1] = { { &hf_sabp_ProtocolExtensionContainer_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolExtensionField }, }; static int dissect_sabp_ProtocolExtensionContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_ProtocolExtensionContainer, ProtocolExtensionContainer_sequence_of, 1, maxProtocolExtensions, FALSE); return offset; } static int dissect_sabp_Available_Bandwidth(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 20480U, NULL, FALSE); return offset; } static int dissect_sabp_Broadcast_Message_Content(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 1, 9968, FALSE, NULL, 0, &parameter_tvb, NULL); if (!parameter_tvb) return offset; dissect_sabp_cb_data(parameter_tvb, actx->pinfo, tree); return offset; } static const value_string sabp_Broadcast_Message_Content_Validity_Indicator_vals[] = { { 0, "broadcast-Message-Content-not-valid" }, { 0, NULL } }; static int dissect_sabp_Broadcast_Message_Content_Validity_Indicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const value_string sabp_Category_vals[] = { { 0, "high-priority" }, { 1, "background-priority" }, { 2, "normal-priority" }, { 3, "default-priority" }, { 0, NULL } }; static int dissect_sabp_Category(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static const value_string sabp_Cause_vals[] = { { 0, "parameter-not-recognised" }, { 1, "parameter-value-invalid" }, { 2, "valid-CN-message-not-identified" }, { 3, "service-area-identity-not-valid" }, { 4, "unrecognised-message" }, { 5, "missing-mandatory-element" }, { 6, "rNC-capacity-exceeded" }, { 7, "rNC-memory-exceeded" }, { 8, "service-area-broadcast-not-supported" }, { 9, "service-area-broadcast-not-operational" }, { 10, "message-reference-already-used" }, { 11, "unspecifed-error" }, { 12, "transfer-syntax-error" }, { 13, "semantic-error" }, { 14, "message-not-compatible-with-receiver-state" }, { 15, "abstract-syntax-error-reject" }, { 16, "abstract-syntax-error-ignore-and-notify" }, { 17, "abstract-syntax-error-falsely-constructed-message" }, { 0, NULL } }; static value_string_ext sabp_Cause_vals_ext = VALUE_STRING_EXT_INIT(sabp_Cause_vals); static int dissect_sabp_Cause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static int dissect_sabp_RepetitionNumber0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_item_sequence[] = { { &hf_sabp_iECriticality , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_Criticality }, { &hf_sabp_iE_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_ID }, { &hf_sabp_repetitionNumber, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_RepetitionNumber0 }, { &hf_sabp_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_CriticalityDiagnostics_IE_List_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_CriticalityDiagnostics_IE_List_item, CriticalityDiagnostics_IE_List_item_sequence); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_sequence_of[1] = { { &hf_sabp_CriticalityDiagnostics_IE_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_CriticalityDiagnostics_IE_List_item }, }; static int dissect_sabp_CriticalityDiagnostics_IE_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_CriticalityDiagnostics_IE_List, CriticalityDiagnostics_IE_List_sequence_of, 1, maxNrOfErrors, FALSE); return offset; } static const per_sequence_t Criticality_Diagnostics_sequence[] = { { &hf_sabp_procedureCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProcedureCode }, { &hf_sabp_triggeringMessage, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_TriggeringMessage }, { &hf_sabp_procedureCriticality, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_Criticality }, { &hf_sabp_iEsCriticalityDiagnostics, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_CriticalityDiagnostics_IE_List }, { &hf_sabp_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Criticality_Diagnostics(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Criticality_Diagnostics, Criticality_Diagnostics_sequence); return offset; } static int dissect_sabp_RepetitionNumber1(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 256U, NULL, FALSE); return offset; } static const per_sequence_t MessageStructure_item_sequence[] = { { &hf_sabp_iE_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_ID }, { &hf_sabp_repetitionNumber1, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_RepetitionNumber1 }, { &hf_sabp_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_MessageStructure_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_MessageStructure_item, MessageStructure_item_sequence); return offset; } static const per_sequence_t MessageStructure_sequence_of[1] = { { &hf_sabp_MessageStructure_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_MessageStructure_item }, }; static int dissect_sabp_MessageStructure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_MessageStructure, MessageStructure_sequence_of, 1, maxNrOfLevels, FALSE); return offset; } static int dissect_sabp_Data_Coding_Scheme(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; proto_tree *subtree; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_sabp_cbs_data_coding); sms_encoding = dissect_cbs_data_coding_scheme(parameter_tvb, actx->pinfo, subtree, 0); return offset; } static int dissect_sabp_T_pLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, &parameter_tvb); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_sabp_e212); dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_SAI, FALSE); return offset; } static int dissect_sabp_OCTET_STRING_SIZE_2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 2, 2, FALSE, NULL); return offset; } static const per_sequence_t Service_Area_Identifier_sequence[] = { { &hf_sabp_pLMNidentity , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_T_pLMNidentity }, { &hf_sabp_lac , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_OCTET_STRING_SIZE_2 }, { &hf_sabp_sac , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_OCTET_STRING_SIZE_2 }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Service_Area_Identifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Service_Area_Identifier, Service_Area_Identifier_sequence); return offset; } static const per_sequence_t Failure_List_Item_sequence[] = { { &hf_sabp_service_area_identifier, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_Service_Area_Identifier }, { &hf_sabp_cause , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_Cause }, { &hf_sabp_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Failure_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Failure_List_Item, Failure_List_Item_sequence); return offset; } static const per_sequence_t Failure_List_sequence_of[1] = { { &hf_sabp_Failure_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Failure_List_Item }, }; static int dissect_sabp_Failure_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_Failure_List, Failure_List_sequence_of, 1, maxnoofSAI, FALSE); return offset; } static int dissect_sabp_Message_Identifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, &parameter_tvb, NULL); if (!parameter_tvb) return offset; dissect_cbs_message_identifier(parameter_tvb, tree, 0); return offset; } static int dissect_sabp_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; proto_tree *subtree; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, &parameter_tvb, NULL); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_sabp_cbs_serial_number); dissect_cbs_serial_number(parameter_tvb, subtree, 0); return offset; } static int dissect_sabp_New_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; proto_tree *subtree; offset = dissect_sabp_Serial_Number(tvb, offset, actx, tree, hf_index); if (!parameter_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_sabp_cbs_new_serial_number); dissect_cbs_serial_number(parameter_tvb, subtree, 0); return offset; } static int dissect_sabp_INTEGER_0_65535(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static const value_string sabp_Number_Of_Broadcasts_Completed_Info_vals[] = { { 0, "overflow" }, { 1, "unknown" }, { 0, NULL } }; static int dissect_sabp_Number_Of_Broadcasts_Completed_Info(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t Number_of_Broadcasts_Completed_List_Item_sequence[] = { { &hf_sabp_service_area_identifier, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_Service_Area_Identifier }, { &hf_sabp_number_of_broadcasts_completed, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_INTEGER_0_65535 }, { &hf_sabp_number_of_broadcasts_completed_info, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_Number_Of_Broadcasts_Completed_Info }, { &hf_sabp_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Number_of_Broadcasts_Completed_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Number_of_Broadcasts_Completed_List_Item, Number_of_Broadcasts_Completed_List_Item_sequence); return offset; } static const per_sequence_t Number_of_Broadcasts_Completed_List_sequence_of[1] = { { &hf_sabp_Number_of_Broadcasts_Completed_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Number_of_Broadcasts_Completed_List_Item }, }; static int dissect_sabp_Number_of_Broadcasts_Completed_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_Number_of_Broadcasts_Completed_List, Number_of_Broadcasts_Completed_List_sequence_of, 1, maxnoofSAI, FALSE); return offset; } static const value_string sabp_Number_of_Broadcasts_Requested_vals[] = { { 0, "broadcast-indefinitely" }, { 0, NULL } }; static int dissect_sabp_Number_of_Broadcasts_Requested(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static int dissect_sabp_Old_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_sabp_Serial_Number(tvb, offset, actx, tree, hf_index); return offset; } static const value_string sabp_Paging_ETWS_Indicator_vals[] = { { 0, "paging" }, { 0, NULL } }; static int dissect_sabp_Paging_ETWS_Indicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t Radio_Resource_Loading_List_Item_sequence[] = { { &hf_sabp_service_area_identifier, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_Service_Area_Identifier }, { &hf_sabp_available_bandwidth, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_Available_Bandwidth }, { &hf_sabp_iE_Extensions , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Radio_Resource_Loading_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Radio_Resource_Loading_List_Item, Radio_Resource_Loading_List_Item_sequence); return offset; } static const per_sequence_t Radio_Resource_Loading_List_sequence_of[1] = { { &hf_sabp_Radio_Resource_Loading_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Radio_Resource_Loading_List_Item }, }; static int dissect_sabp_Radio_Resource_Loading_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_Radio_Resource_Loading_List, Radio_Resource_Loading_List_sequence_of, 1, maxnoofSAI, FALSE); return offset; } static const value_string sabp_Recovery_Indication_vals[] = { { 0, "data-lost" }, { 1, "data-available" }, { 0, NULL } }; static int dissect_sabp_Recovery_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static int dissect_sabp_Repetition_Period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 4096U, NULL, FALSE); return offset; } static const per_sequence_t Service_Areas_List_sequence_of[1] = { { &hf_sabp_Service_Areas_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Service_Area_Identifier }, }; static int dissect_sabp_Service_Areas_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sabp_Service_Areas_List, Service_Areas_List_sequence_of, 1, maxnoofSAI, FALSE); return offset; } static const value_string sabp_TypeOfError_vals[] = { { 0, "not-understood" }, { 1, "missing" }, { 0, NULL } }; static int dissect_sabp_TypeOfError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_sabp_WarningSecurityInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 50, 50, FALSE, NULL); return offset; } static int dissect_sabp_Warning_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 2, 2, FALSE, NULL); return offset; } static const per_sequence_t Write_Replace_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Write_Replace(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Write_Replace, Write_Replace_sequence); return offset; } static const per_sequence_t Write_Replace_Complete_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Write_Replace_Complete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Write_Replace_Complete, Write_Replace_Complete_sequence); return offset; } static const per_sequence_t Write_Replace_Failure_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Write_Replace_Failure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Write_Replace_Failure, Write_Replace_Failure_sequence); return offset; } static const per_sequence_t Kill_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Kill(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Kill, Kill_sequence); return offset; } static const per_sequence_t Kill_Complete_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Kill_Complete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Kill_Complete, Kill_Complete_sequence); return offset; } static const per_sequence_t Kill_Failure_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Kill_Failure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Kill_Failure, Kill_Failure_sequence); return offset; } static const per_sequence_t Load_Query_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Load_Query(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Load_Query, Load_Query_sequence); return offset; } static const per_sequence_t Load_Query_Complete_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Load_Query_Complete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Load_Query_Complete, Load_Query_Complete_sequence); return offset; } static const per_sequence_t Load_Query_Failure_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Load_Query_Failure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Load_Query_Failure, Load_Query_Failure_sequence); return offset; } static const per_sequence_t Message_Status_Query_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Message_Status_Query(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Message_Status_Query, Message_Status_Query_sequence); return offset; } static const per_sequence_t Message_Status_Query_Complete_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Message_Status_Query_Complete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Message_Status_Query_Complete, Message_Status_Query_Complete_sequence); return offset; } static const per_sequence_t Message_Status_Query_Failure_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Message_Status_Query_Failure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Message_Status_Query_Failure, Message_Status_Query_Failure_sequence); return offset; } static const per_sequence_t Reset_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Reset(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Reset, Reset_sequence); return offset; } static const per_sequence_t Reset_Complete_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Reset_Complete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Reset_Complete, Reset_Complete_sequence); return offset; } static const per_sequence_t Reset_Failure_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Reset_Failure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Reset_Failure, Reset_Failure_sequence); return offset; } static const per_sequence_t Restart_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Restart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Restart, Restart_sequence); return offset; } static const per_sequence_t Failure_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Failure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Failure, Failure_sequence); return offset; } static const per_sequence_t Error_Indication_sequence[] = { { &hf_sabp_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sabp_ProtocolIE_Container }, { &hf_sabp_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sabp_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sabp_Error_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_Error_Indication, Error_Indication_sequence); return offset; } static int dissect_sabp_InitiatingMessage_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_InitiatingMessageValue); return offset; } static const per_sequence_t InitiatingMessage_sequence[] = { { &hf_sabp_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProcedureCode }, { &hf_sabp_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Criticality }, { &hf_sabp_initiatingMessage_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_InitiatingMessage_value }, { NULL, 0, 0, NULL } }; static int dissect_sabp_InitiatingMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_InitiatingMessage, InitiatingMessage_sequence); return offset; } static int dissect_sabp_SuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_SuccessfulOutcomeValue); return offset; } static const per_sequence_t SuccessfulOutcome_sequence[] = { { &hf_sabp_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProcedureCode }, { &hf_sabp_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Criticality }, { &hf_sabp_successfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_SuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_sabp_SuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_SuccessfulOutcome, SuccessfulOutcome_sequence); return offset; } static int dissect_sabp_UnsuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_UnsuccessfulOutcomeValue); return offset; } static const per_sequence_t UnsuccessfulOutcome_sequence[] = { { &hf_sabp_procedureCode , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_ProcedureCode }, { &hf_sabp_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_Criticality }, { &hf_sabp_unsuccessfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sabp_UnsuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_sabp_UnsuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sabp_UnsuccessfulOutcome, UnsuccessfulOutcome_sequence); return offset; } static const value_string sabp_SABP_PDU_vals[] = { { 0, "initiatingMessage" }, { 1, "successfulOutcome" }, { 2, "unsuccessfulOutcome" }, { 0, NULL } }; static const per_choice_t SABP_PDU_choice[] = { { 0, &hf_sabp_initiatingMessage, ASN1_EXTENSION_ROOT , dissect_sabp_InitiatingMessage }, { 1, &hf_sabp_successfulOutcome, ASN1_EXTENSION_ROOT , dissect_sabp_SuccessfulOutcome }, { 2, &hf_sabp_unsuccessfulOutcome, ASN1_EXTENSION_ROOT , dissect_sabp_UnsuccessfulOutcome }, { 0, NULL, 0, NULL } }; static int dissect_sabp_SABP_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sabp_SABP_PDU, SABP_PDU_choice, NULL); return offset; } /*--- PDUs ---*/ static int dissect_Broadcast_Message_Content_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Broadcast_Message_Content(tvb, offset, &asn1_ctx, tree, hf_sabp_Broadcast_Message_Content_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Broadcast_Message_Content_Validity_Indicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Broadcast_Message_Content_Validity_Indicator(tvb, offset, &asn1_ctx, tree, hf_sabp_Broadcast_Message_Content_Validity_Indicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Category_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Category(tvb, offset, &asn1_ctx, tree, hf_sabp_Category_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Cause(tvb, offset, &asn1_ctx, tree, hf_sabp_Cause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Criticality_Diagnostics_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Criticality_Diagnostics(tvb, offset, &asn1_ctx, tree, hf_sabp_Criticality_Diagnostics_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_MessageStructure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_MessageStructure(tvb, offset, &asn1_ctx, tree, hf_sabp_MessageStructure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Data_Coding_Scheme_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Data_Coding_Scheme(tvb, offset, &asn1_ctx, tree, hf_sabp_Data_Coding_Scheme_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Failure_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Failure_List(tvb, offset, &asn1_ctx, tree, hf_sabp_Failure_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Message_Identifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Message_Identifier(tvb, offset, &asn1_ctx, tree, hf_sabp_Message_Identifier_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_New_Serial_Number_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_New_Serial_Number(tvb, offset, &asn1_ctx, tree, hf_sabp_New_Serial_Number_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Number_of_Broadcasts_Completed_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Number_of_Broadcasts_Completed_List(tvb, offset, &asn1_ctx, tree, hf_sabp_Number_of_Broadcasts_Completed_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Number_of_Broadcasts_Requested_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Number_of_Broadcasts_Requested(tvb, offset, &asn1_ctx, tree, hf_sabp_Number_of_Broadcasts_Requested_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Old_Serial_Number_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Old_Serial_Number(tvb, offset, &asn1_ctx, tree, hf_sabp_Old_Serial_Number_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Paging_ETWS_Indicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Paging_ETWS_Indicator(tvb, offset, &asn1_ctx, tree, hf_sabp_Paging_ETWS_Indicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Radio_Resource_Loading_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Radio_Resource_Loading_List(tvb, offset, &asn1_ctx, tree, hf_sabp_Radio_Resource_Loading_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Recovery_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Recovery_Indication(tvb, offset, &asn1_ctx, tree, hf_sabp_Recovery_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Repetition_Period_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Repetition_Period(tvb, offset, &asn1_ctx, tree, hf_sabp_Repetition_Period_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Serial_Number_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Serial_Number(tvb, offset, &asn1_ctx, tree, hf_sabp_Serial_Number_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Service_Areas_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Service_Areas_List(tvb, offset, &asn1_ctx, tree, hf_sabp_Service_Areas_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_TypeOfError_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_TypeOfError(tvb, offset, &asn1_ctx, tree, hf_sabp_TypeOfError_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_WarningSecurityInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_WarningSecurityInfo(tvb, offset, &asn1_ctx, tree, hf_sabp_WarningSecurityInfo_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Type_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Warning_Type(tvb, offset, &asn1_ctx, tree, hf_sabp_Warning_Type_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Write_Replace_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Write_Replace(tvb, offset, &asn1_ctx, tree, hf_sabp_Write_Replace_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Write_Replace_Complete_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Write_Replace_Complete(tvb, offset, &asn1_ctx, tree, hf_sabp_Write_Replace_Complete_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Write_Replace_Failure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Write_Replace_Failure(tvb, offset, &asn1_ctx, tree, hf_sabp_Write_Replace_Failure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Kill_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Kill(tvb, offset, &asn1_ctx, tree, hf_sabp_Kill_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Kill_Complete_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Kill_Complete(tvb, offset, &asn1_ctx, tree, hf_sabp_Kill_Complete_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Kill_Failure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Kill_Failure(tvb, offset, &asn1_ctx, tree, hf_sabp_Kill_Failure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Load_Query_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Load_Query(tvb, offset, &asn1_ctx, tree, hf_sabp_Load_Query_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Load_Query_Complete_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Load_Query_Complete(tvb, offset, &asn1_ctx, tree, hf_sabp_Load_Query_Complete_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Load_Query_Failure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Load_Query_Failure(tvb, offset, &asn1_ctx, tree, hf_sabp_Load_Query_Failure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Message_Status_Query_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Message_Status_Query(tvb, offset, &asn1_ctx, tree, hf_sabp_Message_Status_Query_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Message_Status_Query_Complete_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Message_Status_Query_Complete(tvb, offset, &asn1_ctx, tree, hf_sabp_Message_Status_Query_Complete_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Message_Status_Query_Failure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Message_Status_Query_Failure(tvb, offset, &asn1_ctx, tree, hf_sabp_Message_Status_Query_Failure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Reset_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Reset(tvb, offset, &asn1_ctx, tree, hf_sabp_Reset_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Reset_Complete_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Reset_Complete(tvb, offset, &asn1_ctx, tree, hf_sabp_Reset_Complete_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Reset_Failure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Reset_Failure(tvb, offset, &asn1_ctx, tree, hf_sabp_Reset_Failure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Restart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Restart(tvb, offset, &asn1_ctx, tree, hf_sabp_Restart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Failure_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Failure(tvb, offset, &asn1_ctx, tree, hf_sabp_Failure_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Error_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_Error_Indication(tvb, offset, &asn1_ctx, tree, hf_sabp_Error_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SABP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sabp_SABP_PDU(tvb, offset, &asn1_ctx, tree, hf_sabp_SABP_PDU_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sabp_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sabp_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sabp_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sabp_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sabp_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } /* 3GPP TS 23.041 version 11.4.0 * 9.4.2.2.5 CB Data */ static void dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *cbs_page_item; proto_tree *subtree; tvbuff_t *page_tvb, *unpacked_tvb; int offset = 0; int n; guint8 nr_pages, len, cb_inf_msg_len; /* Octet 1 Number-of-Pages */ nr_pages = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_sabp_no_of_pages, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* * NOTE: n equal to or less than 15 */ if(nr_pages > 15){ /* Error */ return; } for (n = 0; n < nr_pages; n++) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 83, ett_sabp_cbs_page, NULL, "CB page %u data", n+1); /* octet 2 - 83 CBS-Message-Information-Page 1 */ cbs_page_item = proto_tree_add_item(subtree, hf_sabp_cb_msg_inf_page, tvb, offset, 82, ENC_NA); cb_inf_msg_len = tvb_get_guint8(tvb,offset+82); page_tvb = tvb_new_subset_length(tvb, offset, cb_inf_msg_len); unpacked_tvb = dissect_cbs_data(sms_encoding, page_tvb, subtree, pinfo, 0); len = tvb_captured_length(unpacked_tvb); if (unpacked_tvb != NULL){ if (tree != NULL){ proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content); proto_tree_add_item(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, ENC_UTF_8); } } offset = offset+82; /* 84 CBS-Message-Information-Length 1 */ proto_tree_add_item(subtree, hf_sabp_cb_inf_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } } static int dissect_sabp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *sabp_item = NULL; proto_tree *sabp_tree = NULL; /* make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); /* create the sabp protocol tree */ sabp_item = proto_tree_add_item(tree, proto_sabp, tvb, 0, -1, ENC_NA); sabp_tree = proto_item_add_subtree(sabp_item, ett_sabp); return dissect_SABP_PDU_PDU(tvb, pinfo, sabp_tree, NULL); } /* Note a little bit of a hack assumes length max takes two bytes and that the length starts at byte 4 */ static int dissect_sabp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { guint32 type_length, msg_len; guint tvb_length; int bit_offset; gboolean is_fragmented; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); tvb_length = tvb_reported_length(tvb); if (tvb_length < 5) { pinfo->desegment_offset = 0; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; return tvb_captured_length(tvb); } /* Length should be in the 3:d octet */ bit_offset = 24; /* Get the length of the sabp packet. Offset in bits */ do { bit_offset = dissect_per_length_determinant(tvb, bit_offset, &asn1_ctx, NULL, -1, &type_length, &is_fragmented); bit_offset += 8*type_length; msg_len = (bit_offset + 7) >> 3; if (is_fragmented) { /* Next length field will take 1 or 2 bytes; let's ask for the maximum */ msg_len += 2; } if (msg_len > tvb_length) { pinfo->desegment_offset = 0; pinfo->desegment_len = msg_len - tvb_length; return tvb_captured_length(tvb); } } while (is_fragmented); return dissect_sabp(tvb, pinfo, tree, data); } /*--- proto_register_sabp -------------------------------------------*/ void proto_register_sabp(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_sabp_no_of_pages, { "Number-of-Pages", "sabp.no_of_pages", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_cb_msg_inf_page, { "CBS-Message-Information-Page", "sabp.cb_msg_inf_page", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_cbs_page_content, { "CBS Page Content", "sabp.cb_page_content", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_cb_inf_len, { "CBS-Message-Information-Length", "sabp.cb_inf_len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_Broadcast_Message_Content_PDU, { "Broadcast-Message-Content", "sabp.Broadcast_Message_Content", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Broadcast_Message_Content_Validity_Indicator_PDU, { "Broadcast-Message-Content-Validity-Indicator", "sabp.Broadcast_Message_Content_Validity_Indicator", FT_UINT32, BASE_DEC, VALS(sabp_Broadcast_Message_Content_Validity_Indicator_vals), 0, NULL, HFILL }}, { &hf_sabp_Category_PDU, { "Category", "sabp.Category", FT_UINT32, BASE_DEC, VALS(sabp_Category_vals), 0, NULL, HFILL }}, { &hf_sabp_Cause_PDU, { "Cause", "sabp.Cause", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sabp_Cause_vals_ext, 0, NULL, HFILL }}, { &hf_sabp_Criticality_Diagnostics_PDU, { "Criticality-Diagnostics", "sabp.Criticality_Diagnostics_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_MessageStructure_PDU, { "MessageStructure", "sabp.MessageStructure", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_Data_Coding_Scheme_PDU, { "Data-Coding-Scheme", "sabp.Data_Coding_Scheme", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Failure_List_PDU, { "Failure-List", "sabp.Failure_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_Message_Identifier_PDU, { "Message-Identifier", "sabp.Message_Identifier", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_New_Serial_Number_PDU, { "New-Serial-Number", "sabp.New_Serial_Number", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Number_of_Broadcasts_Completed_List_PDU, { "Number-of-Broadcasts-Completed-List", "sabp.Number_of_Broadcasts_Completed_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_Number_of_Broadcasts_Requested_PDU, { "Number-of-Broadcasts-Requested", "sabp.Number_of_Broadcasts_Requested", FT_UINT32, BASE_DEC, VALS(sabp_Number_of_Broadcasts_Requested_vals), 0, NULL, HFILL }}, { &hf_sabp_Old_Serial_Number_PDU, { "Old-Serial-Number", "sabp.Old_Serial_Number", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Paging_ETWS_Indicator_PDU, { "Paging-ETWS-Indicator", "sabp.Paging_ETWS_Indicator", FT_UINT32, BASE_DEC, VALS(sabp_Paging_ETWS_Indicator_vals), 0, NULL, HFILL }}, { &hf_sabp_Radio_Resource_Loading_List_PDU, { "Radio-Resource-Loading-List", "sabp.Radio_Resource_Loading_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_Recovery_Indication_PDU, { "Recovery-Indication", "sabp.Recovery_Indication", FT_UINT32, BASE_DEC, VALS(sabp_Recovery_Indication_vals), 0, NULL, HFILL }}, { &hf_sabp_Repetition_Period_PDU, { "Repetition-Period", "sabp.Repetition_Period", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_Serial_Number_PDU, { "Serial-Number", "sabp.Serial_Number", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Service_Areas_List_PDU, { "Service-Areas-List", "sabp.Service_Areas_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_TypeOfError_PDU, { "TypeOfError", "sabp.TypeOfError", FT_UINT32, BASE_DEC, VALS(sabp_TypeOfError_vals), 0, NULL, HFILL }}, { &hf_sabp_WarningSecurityInfo_PDU, { "WarningSecurityInfo", "sabp.WarningSecurityInfo", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Warning_Type_PDU, { "Warning-Type", "sabp.Warning_Type", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Write_Replace_PDU, { "Write-Replace", "sabp.Write_Replace_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Write_Replace_Complete_PDU, { "Write-Replace-Complete", "sabp.Write_Replace_Complete_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Write_Replace_Failure_PDU, { "Write-Replace-Failure", "sabp.Write_Replace_Failure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Kill_PDU, { "Kill", "sabp.Kill_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Kill_Complete_PDU, { "Kill-Complete", "sabp.Kill_Complete_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Kill_Failure_PDU, { "Kill-Failure", "sabp.Kill_Failure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Load_Query_PDU, { "Load-Query", "sabp.Load_Query_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Load_Query_Complete_PDU, { "Load-Query-Complete", "sabp.Load_Query_Complete_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Load_Query_Failure_PDU, { "Load-Query-Failure", "sabp.Load_Query_Failure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Message_Status_Query_PDU, { "Message-Status-Query", "sabp.Message_Status_Query_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Message_Status_Query_Complete_PDU, { "Message-Status-Query-Complete", "sabp.Message_Status_Query_Complete_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Message_Status_Query_Failure_PDU, { "Message-Status-Query-Failure", "sabp.Message_Status_Query_Failure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Reset_PDU, { "Reset", "sabp.Reset_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Reset_Complete_PDU, { "Reset-Complete", "sabp.Reset_Complete_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Reset_Failure_PDU, { "Reset-Failure", "sabp.Reset_Failure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Restart_PDU, { "Restart", "sabp.Restart_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Failure_PDU, { "Failure", "sabp.Failure_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_Error_Indication_PDU, { "Error-Indication", "sabp.Error_Indication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_SABP_PDU_PDU, { "SABP-PDU", "sabp.SABP_PDU", FT_UINT32, BASE_DEC, VALS(sabp_SABP_PDU_vals), 0, NULL, HFILL }}, { &hf_sabp_ProtocolIE_Container_item, { "ProtocolIE-Field", "sabp.ProtocolIE_Field_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_id, { "id", "sabp.id", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sabp_ProtocolIE_ID_vals_ext, 0, "ProtocolIE_ID", HFILL }}, { &hf_sabp_criticality, { "criticality", "sabp.criticality", FT_UINT32, BASE_DEC, VALS(sabp_Criticality_vals), 0, NULL, HFILL }}, { &hf_sabp_protocolIE_Field_value, { "value", "sabp.value_element", FT_NONE, BASE_NONE, NULL, 0, "ProtocolIE_Field_value", HFILL }}, { &hf_sabp_ProtocolExtensionContainer_item, { "ProtocolExtensionField", "sabp.ProtocolExtensionField_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_ext_id, { "id", "sabp.id", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionID", HFILL }}, { &hf_sabp_extensionValue, { "extensionValue", "sabp.extensionValue_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_procedureCode, { "procedureCode", "sabp.procedureCode", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sabp_ProcedureCode_vals_ext, 0, NULL, HFILL }}, { &hf_sabp_triggeringMessage, { "triggeringMessage", "sabp.triggeringMessage", FT_UINT32, BASE_DEC, VALS(sabp_TriggeringMessage_vals), 0, NULL, HFILL }}, { &hf_sabp_procedureCriticality, { "procedureCriticality", "sabp.procedureCriticality", FT_UINT32, BASE_DEC, VALS(sabp_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_sabp_iEsCriticalityDiagnostics, { "iEsCriticalityDiagnostics", "sabp.iEsCriticalityDiagnostics", FT_UINT32, BASE_DEC, NULL, 0, "CriticalityDiagnostics_IE_List", HFILL }}, { &hf_sabp_iE_Extensions, { "iE-Extensions", "sabp.iE_Extensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_sabp_CriticalityDiagnostics_IE_List_item, { "CriticalityDiagnostics-IE-List item", "sabp.CriticalityDiagnostics_IE_List_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_iECriticality, { "iECriticality", "sabp.iECriticality", FT_UINT32, BASE_DEC, VALS(sabp_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_sabp_iE_ID, { "iE-ID", "sabp.iE_ID", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sabp_ProtocolIE_ID_vals_ext, 0, "ProtocolIE_ID", HFILL }}, { &hf_sabp_repetitionNumber, { "repetitionNumber", "sabp.repetitionNumber", FT_UINT32, BASE_DEC, NULL, 0, "RepetitionNumber0", HFILL }}, { &hf_sabp_MessageStructure_item, { "MessageStructure item", "sabp.MessageStructure_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_repetitionNumber1, { "repetitionNumber", "sabp.repetitionNumber", FT_UINT32, BASE_DEC, NULL, 0, "RepetitionNumber1", HFILL }}, { &hf_sabp_Failure_List_item, { "Failure-List-Item", "sabp.Failure_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_service_area_identifier, { "service-area-identifier", "sabp.service_area_identifier_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_cause, { "cause", "sabp.cause", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sabp_Cause_vals_ext, 0, NULL, HFILL }}, { &hf_sabp_Number_of_Broadcasts_Completed_List_item, { "Number-of-Broadcasts-Completed-List-Item", "sabp.Number_of_Broadcasts_Completed_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_number_of_broadcasts_completed, { "number-of-broadcasts-completed", "sabp.number_of_broadcasts_completed", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_sabp_number_of_broadcasts_completed_info, { "number-of-broadcasts-completed-info", "sabp.number_of_broadcasts_completed_info", FT_UINT32, BASE_DEC, VALS(sabp_Number_Of_Broadcasts_Completed_Info_vals), 0, NULL, HFILL }}, { &hf_sabp_Radio_Resource_Loading_List_item, { "Radio-Resource-Loading-List-Item", "sabp.Radio_Resource_Loading_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_available_bandwidth, { "available-bandwidth", "sabp.available_bandwidth", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sabp_pLMNidentity, { "pLMNidentity", "sabp.pLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_lac, { "lac", "sabp.lac", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_2", HFILL }}, { &hf_sabp_sac, { "sac", "sabp.sac", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_2", HFILL }}, { &hf_sabp_Service_Areas_List_item, { "Service-Area-Identifier", "sabp.Service_Area_Identifier_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_protocolIEs, { "protocolIEs", "sabp.protocolIEs", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolIE_Container", HFILL }}, { &hf_sabp_protocolExtensions, { "protocolExtensions", "sabp.protocolExtensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_sabp_initiatingMessage, { "initiatingMessage", "sabp.initiatingMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_successfulOutcome, { "successfulOutcome", "sabp.successfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_unsuccessfulOutcome, { "unsuccessfulOutcome", "sabp.unsuccessfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sabp_initiatingMessage_value, { "value", "sabp.value_element", FT_NONE, BASE_NONE, NULL, 0, "InitiatingMessage_value", HFILL }}, { &hf_sabp_successfulOutcome_value, { "value", "sabp.value_element", FT_NONE, BASE_NONE, NULL, 0, "SuccessfulOutcome_value", HFILL }}, { &hf_sabp_unsuccessfulOutcome_value, { "value", "sabp.value_element", FT_NONE, BASE_NONE, NULL, 0, "UnsuccessfulOutcome_value", HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_sabp, &ett_sabp_e212, &ett_sabp_cbs_data_coding, &ett_sabp_bcast_msg, &ett_sabp_cbs_serial_number, &ett_sabp_cbs_new_serial_number, &ett_sabp_cbs_page, &ett_sabp_cbs_page_content, &ett_sabp_ProtocolIE_Container, &ett_sabp_ProtocolIE_Field, &ett_sabp_ProtocolExtensionContainer, &ett_sabp_ProtocolExtensionField, &ett_sabp_Criticality_Diagnostics, &ett_sabp_CriticalityDiagnostics_IE_List, &ett_sabp_CriticalityDiagnostics_IE_List_item, &ett_sabp_MessageStructure, &ett_sabp_MessageStructure_item, &ett_sabp_Failure_List, &ett_sabp_Failure_List_Item, &ett_sabp_Number_of_Broadcasts_Completed_List, &ett_sabp_Number_of_Broadcasts_Completed_List_Item, &ett_sabp_Radio_Resource_Loading_List, &ett_sabp_Radio_Resource_Loading_List_Item, &ett_sabp_Service_Area_Identifier, &ett_sabp_Service_Areas_List, &ett_sabp_Write_Replace, &ett_sabp_Write_Replace_Complete, &ett_sabp_Write_Replace_Failure, &ett_sabp_Kill, &ett_sabp_Kill_Complete, &ett_sabp_Kill_Failure, &ett_sabp_Load_Query, &ett_sabp_Load_Query_Complete, &ett_sabp_Load_Query_Failure, &ett_sabp_Message_Status_Query, &ett_sabp_Message_Status_Query_Complete, &ett_sabp_Message_Status_Query_Failure, &ett_sabp_Reset, &ett_sabp_Reset_Complete, &ett_sabp_Reset_Failure, &ett_sabp_Restart, &ett_sabp_Failure, &ett_sabp_Error_Indication, &ett_sabp_SABP_PDU, &ett_sabp_InitiatingMessage, &ett_sabp_SuccessfulOutcome, &ett_sabp_UnsuccessfulOutcome, }; /* Register protocol */ proto_sabp = proto_register_protocol(PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array(proto_sabp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register dissector */ sabp_handle = register_dissector("sabp", dissect_sabp, proto_sabp); sabp_tcp_handle = register_dissector("sabp.tcp", dissect_sabp_tcp, proto_sabp); /* Register dissector tables */ sabp_ies_dissector_table = register_dissector_table("sabp.ies", "SABP-PROTOCOL-IES", proto_sabp, FT_UINT32, BASE_DEC); sabp_extension_dissector_table = register_dissector_table("sabp.extension", "SABP-PROTOCOL-EXTENSION", proto_sabp, FT_UINT32, BASE_DEC); sabp_proc_imsg_dissector_table = register_dissector_table("sabp.proc.imsg", "SABP-ELEMENTARY-PROCEDURE InitiatingMessage", proto_sabp, FT_UINT32, BASE_DEC); sabp_proc_sout_dissector_table = register_dissector_table("sabp.proc.sout", "SABP-ELEMENTARY-PROCEDURE SuccessfulOutcome", proto_sabp, FT_UINT32, BASE_DEC); sabp_proc_uout_dissector_table = register_dissector_table("sabp.proc.uout", "SABP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_sabp, FT_UINT32, BASE_DEC); } /*--- proto_reg_handoff_sabp ---------------------------------------*/ void proto_reg_handoff_sabp(void) { dissector_add_uint_with_preference("udp.port", SABP_PORT, sabp_handle); dissector_add_uint_with_preference("tcp.port", SABP_PORT, sabp_tcp_handle); dissector_add_uint("sctp.ppi", SABP_PAYLOAD_PROTOCOL_ID, sabp_handle); dissector_add_uint("sabp.ies", id_Message_Identifier, create_dissector_handle(dissect_Message_Identifier_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_New_Serial_Number, create_dissector_handle(dissect_New_Serial_Number_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Old_Serial_Number, create_dissector_handle(dissect_Old_Serial_Number_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Service_Areas_List, create_dissector_handle(dissect_Service_Areas_List_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Category, create_dissector_handle(dissect_Category_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Repetition_Period, create_dissector_handle(dissect_Repetition_Period_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Number_of_Broadcasts_Requested, create_dissector_handle(dissect_Number_of_Broadcasts_Requested_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Data_Coding_Scheme, create_dissector_handle(dissect_Data_Coding_Scheme_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Broadcast_Message_Content, create_dissector_handle(dissect_Broadcast_Message_Content_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Number_of_Broadcasts_Completed_List, create_dissector_handle(dissect_Number_of_Broadcasts_Completed_List_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Criticality_Diagnostics, create_dissector_handle(dissect_Criticality_Diagnostics_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Failure_List, create_dissector_handle(dissect_Failure_List_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Radio_Resource_Loading_List, create_dissector_handle(dissect_Radio_Resource_Loading_List_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Recovery_Indication, create_dissector_handle(dissect_Recovery_Indication_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Serial_Number, create_dissector_handle(dissect_Serial_Number_PDU, proto_sabp)); dissector_add_uint("sabp.ies", id_Cause, create_dissector_handle(dissect_Cause_PDU, proto_sabp)); dissector_add_uint("sabp.extension", id_MessageStructure, create_dissector_handle(dissect_MessageStructure_PDU, proto_sabp)); dissector_add_uint("sabp.extension", id_TypeOfError, create_dissector_handle(dissect_TypeOfError_PDU, proto_sabp)); dissector_add_uint("sabp.extension", id_Paging_ETWS_Indicator, create_dissector_handle(dissect_Paging_ETWS_Indicator_PDU, proto_sabp)); dissector_add_uint("sabp.extension", id_Warning_Type, create_dissector_handle(dissect_Warning_Type_PDU, proto_sabp)); dissector_add_uint("sabp.extension", id_WarningSecurityInfo, create_dissector_handle(dissect_WarningSecurityInfo_PDU, proto_sabp)); dissector_add_uint("sabp.extension", id_Broadcast_Message_Content_Validity_Indicator, create_dissector_handle(dissect_Broadcast_Message_Content_Validity_Indicator_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Write_Replace, create_dissector_handle(dissect_Write_Replace_PDU, proto_sabp)); dissector_add_uint("sabp.proc.sout", id_Write_Replace, create_dissector_handle(dissect_Write_Replace_Complete_PDU, proto_sabp)); dissector_add_uint("sabp.proc.uout", id_Write_Replace, create_dissector_handle(dissect_Write_Replace_Failure_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Kill, create_dissector_handle(dissect_Kill_PDU, proto_sabp)); dissector_add_uint("sabp.proc.sout", id_Kill, create_dissector_handle(dissect_Kill_Complete_PDU, proto_sabp)); dissector_add_uint("sabp.proc.uout", id_Kill, create_dissector_handle(dissect_Kill_Failure_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Load_Status_Enquiry, create_dissector_handle(dissect_Load_Query_PDU, proto_sabp)); dissector_add_uint("sabp.proc.sout", id_Load_Status_Enquiry, create_dissector_handle(dissect_Load_Query_Complete_PDU, proto_sabp)); dissector_add_uint("sabp.proc.uout", id_Load_Status_Enquiry, create_dissector_handle(dissect_Load_Query_Failure_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Message_Status_Query, create_dissector_handle(dissect_Message_Status_Query_PDU, proto_sabp)); dissector_add_uint("sabp.proc.sout", id_Message_Status_Query, create_dissector_handle(dissect_Message_Status_Query_Complete_PDU, proto_sabp)); dissector_add_uint("sabp.proc.uout", id_Message_Status_Query, create_dissector_handle(dissect_Message_Status_Query_Failure_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Reset, create_dissector_handle(dissect_Reset_PDU, proto_sabp)); dissector_add_uint("sabp.proc.sout", id_Reset, create_dissector_handle(dissect_Reset_Complete_PDU, proto_sabp)); dissector_add_uint("sabp.proc.uout", id_Reset, create_dissector_handle(dissect_Reset_Failure_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Restart_Indication, create_dissector_handle(dissect_Restart_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Failure_Indication, create_dissector_handle(dissect_Failure_PDU, proto_sabp)); dissector_add_uint("sabp.proc.imsg", id_Error_Indication, create_dissector_handle(dissect_Error_Indication_PDU, proto_sabp)); }
C
wireshark/epan/dissectors/packet-sadmind.c
/* packet-sadmind.c * Stubs for the Solstice admin daemon RPC service * * Guy Harris <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include "packet-rpc.h" void proto_register_sadmind(void); void proto_reg_handoff_sadmind(void); static int proto_sadmind = -1; static int hf_sadmind_procedure_v1 = -1; static int hf_sadmind_procedure_v2 = -1; static int hf_sadmind_procedure_v3 = -1; static gint ett_sadmind = -1; #define SADMIND_PROGRAM 100232 #define SADMINDPROC_NULL 0 /* proc number, "proc name", dissect_request, dissect_reply */ static const vsff sadmind1_proc[] = { { SADMINDPROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, { 0, NULL, NULL, NULL } }; static const value_string sadmind1_proc_vals[] = { { SADMINDPROC_NULL, "NULL" }, { 0, NULL } }; static const vsff sadmind2_proc[] = { { SADMINDPROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, { 0, NULL, NULL, NULL } }; static const value_string sadmind2_proc_vals[] = { { SADMINDPROC_NULL, "NULL" }, { 0, NULL } }; static const vsff sadmind3_proc[] = { { SADMINDPROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, { 0, NULL, NULL, NULL } }; static const value_string sadmind3_proc_vals[] = { { SADMINDPROC_NULL, "NULL" }, { 0, NULL } }; static const rpc_prog_vers_info sadmind_vers_info[] = { { 1, sadmind1_proc, &hf_sadmind_procedure_v1 }, { 2, sadmind2_proc, &hf_sadmind_procedure_v2 }, { 3, sadmind3_proc, &hf_sadmind_procedure_v3 }, }; void proto_register_sadmind(void) { static hf_register_info hf[] = { { &hf_sadmind_procedure_v1, { "V1 Procedure", "sadmind.procedure_v1", FT_UINT32, BASE_DEC, VALS(sadmind1_proc_vals), 0, NULL, HFILL }}, { &hf_sadmind_procedure_v2, { "V2 Procedure", "sadmind.procedure_v2", FT_UINT32, BASE_DEC, VALS(sadmind2_proc_vals), 0, NULL, HFILL }}, { &hf_sadmind_procedure_v3, { "V3 Procedure", "sadmind.procedure_v3", FT_UINT32, BASE_DEC, VALS(sadmind3_proc_vals), 0, NULL, HFILL }} }; static gint *ett[] = { &ett_sadmind, }; proto_sadmind = proto_register_protocol("SADMIND", "SADMIND", "sadmind"); proto_register_field_array(proto_sadmind, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_sadmind(void) { /* Register the protocol as RPC */ rpc_init_prog(proto_sadmind, SADMIND_PROGRAM, ett_sadmind, G_N_ELEMENTS(sadmind_vers_info), sadmind_vers_info); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sametime.c
/* packet-sametime.c * Routines for SAMETIME dissection * Copyright 2010, Toralf Foerster <toralf.foerster [AT] gmx.de> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/stats_tree.h> #include "packet-tcp.h" #define DEFAULT_SAMETIME_PORT 1533 /* Not IANA registered */ void proto_register_sametime(void); void proto_reg_handoff_sametime(void); static int proto_sametime = -1; static dissector_handle_t sametime_handle; /*preferences*/ static gboolean global_sametime_show_length = FALSE; static gboolean global_sametime_reassemble_packets = TRUE; /*heart beat*/ static int hf_sametime_heartbeat = -1; /*sametime message header*/ static int hf_sametime_message_length = -1; static int hf_sametime_message_type = -1; static int hf_sametime_message_options = -1; static int hf_sametime_message_options_attribute = -1; static int hf_sametime_message_options_encrypted = -1; static int hf_sametime_message_channel = -1; /*common types*/ static int hf_sametime_field_length = -1; static int hf_sametime_field_text = -1; static int hf_sametime_code = -1; static int hf_sametime_login_type = -1; static int hf_sametime_time = -1; /*handshake*/ static int hf_sametime_handshake_major = -1; static int hf_sametime_handshake_minor = -1; static int hf_sametime_handshake_srvrcalc_addr = -1; static int hf_sametime_handshake_loclcalc_addr = -1; /*channel*/ static int hf_sametime_channel_service = -1; static int hf_sametime_channel_id = -1; static int hf_sametime_channel_send_type = -1; static int hf_sametime_channel_awareness = -1; /*user status*/ static int hf_sametime_user_status = -1; /*location*/ static int hf_sametime_location_country = -1; static int hf_sametime_location_postalcode = -1; static int hf_sametime_location_province = -1; static int hf_sametime_location_city = -1; static int hf_sametime_location_phone = -1; static int hf_sametime_location_name = -1; static int hf_sametime_location_timezone = -1; /*packet detail tree*/ static gint ett_sametime = -1; static gint ett_sametime_options = -1; /*statistics*/ static int sametime_tap = -1; static const guint8* st_str_packet = "Sametime Message Count"; static const guint8* st_str_message_type = "Message Type"; static const guint8* st_str_send_type = "Send Type"; static const guint8* st_str_user_status = "User Status"; static int st_node_packet = -1; static int st_node_message_type = -1; static int st_node_send_type = -1; static int st_node_user_status = -1; typedef struct SametimeTap { gint message_type; gint send_type; gint user_status; } SametimeTap; #define SAMETIME_MESSAGETYPE_HEARTBEAT 0x80 #define SAMETIME_MESSAGETYPE_HANDSHAKE 0x0000 #define SAMETIME_MESSAGETYPE_HANDSHAKE_ACK 0x8000 #define SAMETIME_MESSAGETYPE_HANDSHAKE_SYN 0x0025 #define SAMETIME_MESSAGETYPE_LOGIN 0x0001 #define SAMETIME_MESSAGETYPE_LOGIN_ACK 0x8001 #define SAMETIME_MESSAGETYPE_LOGIN_REDIRECT 0x0018 #define SAMETIME_MESSAGETYPE_LOGIN_CONTINUE 0x0016 #define SAMETIME_MESSAGETYPE_CHANNEL_CREATE 0x0002 #define SAMETIME_MESSAGETYPE_CHANNEL_DESTROY 0x0003 #define SAMETIME_MESSAGETYPE_CHANNEL_SEND 0x0004 #define SAMETIME_MESSAGETYPE_CHANNEL_ACCEPT 0x0006 #define SAMETIME_MESSAGETYPE_SET_USER_STATUS 0x0009 #define SAMETIME_MESSAGETYPE_SET_PRIVACY_LIST 0x000b #define SAMETIME_MESSAGETYPE_SENSE_SERVICE 0x0011 #define SAMETIME_MESSAGETYPE_ADMIN 0x0019 #define SAMETIME_MESSAGETYPE_ANNOUNCE 0x0022 static const value_string messagetypenames[] = { { SAMETIME_MESSAGETYPE_HEARTBEAT, "HEARTBEAT" }, { SAMETIME_MESSAGETYPE_HANDSHAKE, "HANDSHAKE" }, { SAMETIME_MESSAGETYPE_HANDSHAKE_SYN, "HANDSHAKE_SYN" }, { SAMETIME_MESSAGETYPE_HANDSHAKE_ACK, "HANDSHAKE_ACK" }, { SAMETIME_MESSAGETYPE_LOGIN, "LOGIN" }, { SAMETIME_MESSAGETYPE_LOGIN_ACK, "LOGIN_ACK" }, { SAMETIME_MESSAGETYPE_LOGIN_REDIRECT, "LOGIN_REDIRECT" }, { SAMETIME_MESSAGETYPE_LOGIN_CONTINUE, "LOGIN_CONTINUE" }, { SAMETIME_MESSAGETYPE_CHANNEL_CREATE, "CHANNEL_CREATE" }, { SAMETIME_MESSAGETYPE_CHANNEL_DESTROY, "CHANNEL_DESTROY" }, { SAMETIME_MESSAGETYPE_CHANNEL_SEND, "CHANNEL_SEND" }, { SAMETIME_MESSAGETYPE_CHANNEL_ACCEPT, "CHANNEL_ACCEPT" }, { SAMETIME_MESSAGETYPE_SET_USER_STATUS, "SET_USER_STATUS" }, { SAMETIME_MESSAGETYPE_SET_PRIVACY_LIST, "SET_PRIVACY_LIST" }, { SAMETIME_MESSAGETYPE_SENSE_SERVICE, "SENSE_SERVICE" }, { SAMETIME_MESSAGETYPE_ADMIN, "ADMIN" }, { SAMETIME_MESSAGETYPE_ANNOUNCE, "ANNOUNCE" }, { 0, NULL } }; #define SAMETIME_MESSAGEOPTION_ENCRYPT 0x4000 #define SAMETIME_MESSAGEOPTION_HAS_ATTRIBS 0x8000 static const value_string optionnames[] = { { 0x0, "" }, { SAMETIME_MESSAGEOPTION_ENCRYPT, "ENCRYPT" }, { SAMETIME_MESSAGEOPTION_HAS_ATTRIBS, "HAS_ATTRIBS" }, { 0, NULL } }; static const value_string userstatusnames[] = { { 0x0020, "ACTIVE" }, /* "I am available" */ { 0x0040, "IDLE" }, /* never seen in the wild, maybe non-pc :-) ? */ { 0x0060, "AWAY" }, /* "I am away from my computer now" */ { 0x0080, "BUSY" }, /* "Please do not disturb me" */ { 0x0008, "MEETING" }, /* "I am in a meeting" */ { 0, NULL } }; #define SAMETIME_SENDTYPE_AWARE_ADD 0x0068 #define SAMETIME_SENDTYPE_OPT_DO_SET 0x00c9 #define SAMETIME_SENDTYPE_AWARE_SNAPSHOT 0x01f4 #define SAMETIME_SENDTYPE_AWARE_UPDATE 0x01f5 #define SAMETIME_SENDTYPE_OPT_GOT_SET 0x0259 static const value_string sendtypenames[] = { { SAMETIME_SENDTYPE_AWARE_ADD, "AWARE_ADD" }, { 0x0069, "AWARE_REMOVE" }, { SAMETIME_SENDTYPE_OPT_DO_SET, "OPT_DO_SET" }, { 0x00cb, "OPT_WATCH" }, { SAMETIME_SENDTYPE_AWARE_SNAPSHOT, "AWARE_SNAPSHOT" }, { SAMETIME_SENDTYPE_AWARE_UPDATE, "AWARE_UPDATE" }, { SAMETIME_SENDTYPE_OPT_GOT_SET, "OPT_GOT_SET" }, { 0x025a, "?" }, { 0x025d, "OPT_DID_SET" }, { 0, NULL } }; static const value_string awarenessnames[] = { { 0x0002, "USER" }, { 0x0003, "GROUP" }, { 0x0008, "SERVER" }, { 0, NULL } }; static const value_string codenames[] = { { 0x00000011, "SERVICE_AWARE" }, { 0x00000015, "SERVICE_RESOLVE" }, { 0x00000018, "SERVICE_STORAGE" }, { 0x0000001a, "SERVICE_DIRECTORY" }, { 0x80000011, "ERR_USER_SKETCHY" }, { 0x80000015, "ERR_TOKEN_INVALID" }, { 0x80000018, "ERR_PORT_IN_USE" }, { 0x80000022, "ERR_CHANNEL_DESTROYED" }, { 0, NULL } }; static int add_text_item(tvbuff_t *tvb, proto_tree *tree, int offset, int hf) { guint16 length; /* heuristic rule, string should start w/ valid character(s) */ if (! tvb_get_guint8(tvb, offset + 2)) return 0; length = tvb_get_ntohs(tvb, offset); if (length) { /* the string length must not exceed the packet length */ if (length > tvb_reported_length_remaining(tvb, offset + 2)) return 0; /* add string length only if preferences is set */ if (global_sametime_show_length) proto_tree_add_item(tree, hf_sametime_field_length, tvb, offset, 2, ENC_BIG_ENDIAN); /* add string */ proto_tree_add_item(tree, hf, tvb, offset + 2, length, ENC_ASCII|ENC_NA); } return 2 + length; } static guint16 dissect_set_user_status(tvbuff_t *tvb, proto_tree *tree, int offset) { guint16 user_status; user_status = tvb_get_ntohs(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(user_status, userstatusnames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_user_status, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_sametime_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; add_text_item(tvb, tree, offset, hf_sametime_field_text); return user_status; } static int dissect_handshake(tvbuff_t *tvb, proto_tree *tree, int offset) { proto_tree_add_item(tree, hf_sametime_handshake_major, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_sametime_handshake_minor, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset += 4; proto_tree_add_item(tree, hf_sametime_handshake_srvrcalc_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sametime_login_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_sametime_handshake_loclcalc_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset += 6; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += 8; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); return offset; } static void dissect_handshake_ack(tvbuff_t *tvb, proto_tree *tree, int offset) { proto_tree_add_item(tree, hf_sametime_handshake_major, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_sametime_handshake_minor, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_sametime_handshake_loclcalc_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset += 4; offset += 4; add_text_item(tvb, tree, offset, hf_sametime_field_text); } static void dissect_login(tvbuff_t *tvb, proto_tree *tree, int offset) { offset += 2; add_text_item(tvb, tree, offset, hf_sametime_field_text); } static void dissect_login_redirect(tvbuff_t *tvb, proto_tree *tree, int offset) { offset += 2; add_text_item(tvb, tree, offset, hf_sametime_field_text); } static void dissect_login_ack(tvbuff_t *tvb, proto_tree *tree, int offset) { offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); proto_tree_add_item(tree, hf_sametime_login_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += 3; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); proto_tree_add_item(tree, hf_sametime_handshake_loclcalc_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += 21; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); add_text_item(tvb, tree, offset, hf_sametime_field_text); } static void dissect_channel_create(tvbuff_t *tvb, proto_tree *tree, int offset) { offset += 4; proto_tree_add_item(tree, hf_sametime_channel_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); proto_tree_add_item(tree, hf_sametime_channel_service, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset += 8; add_text_item(tvb, tree, offset, hf_sametime_field_text); } static guint16 dissect_channel_send(tvbuff_t *tvb, proto_tree *tree, int offset) { guint16 send_type, awareness; guint na; send_type = tvb_get_ntohs(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(send_type, sendtypenames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_channel_send_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; switch (send_type) { case SAMETIME_SENDTYPE_AWARE_ADD: offset += 8; awareness = tvb_get_ntohs(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(awareness, awarenessnames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_channel_awareness, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; add_text_item(tvb, tree, offset, hf_sametime_field_text); break; case SAMETIME_SENDTYPE_OPT_DO_SET: offset += 20; na = tvb_get_ntohl(tvb, offset); offset += 4; if (na == 0x33) { offset += add_text_item(tvb, tree, offset, hf_sametime_location_country); offset += add_text_item(tvb, tree, offset, hf_sametime_location_postalcode); offset += add_text_item(tvb, tree, offset, hf_sametime_location_province); offset += add_text_item(tvb, tree, offset, hf_sametime_location_city); offset += add_text_item(tvb, tree, offset, hf_sametime_location_phone); offset += 1; offset += add_text_item(tvb, tree, offset, hf_sametime_location_name); add_text_item(tvb, tree, offset, hf_sametime_location_timezone); } else { add_text_item(tvb, tree, offset, hf_sametime_field_text); } break; case SAMETIME_SENDTYPE_OPT_GOT_SET: offset += 8; awareness = tvb_get_ntohs(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(awareness, awarenessnames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_channel_awareness, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; while (tvb_reported_length_remaining(tvb, offset) > 2) { int n = add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += (n) ? n : 1; } break; case SAMETIME_SENDTYPE_AWARE_SNAPSHOT: offset += 12; awareness = tvb_get_ntohs(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(awareness, awarenessnames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_channel_awareness, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; add_text_item(tvb, tree, offset, hf_sametime_field_text); break; case SAMETIME_SENDTYPE_AWARE_UPDATE: offset += 4; offset += 4; awareness = tvb_get_ntohs(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(awareness, awarenessnames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_channel_awareness, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += 4; if (tvb_get_guint8(tvb, offset)) { offset += 1; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); dissect_set_user_status(tvb, tree, offset); } break; case 0x0000: offset += 14; add_text_item(tvb, tree, offset, hf_sametime_field_text); break; case 0x0002: offset += 8; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += 3; add_text_item(tvb, tree, offset, hf_sametime_field_text); break; case 0x0005: /* XML */ if (26 <= tvb_reported_length_remaining(tvb, offset + 2)) { offset += 26; add_text_item(tvb, tree, offset, hf_sametime_field_text); } break; case 0x0007: offset += 8; if (4 <= tvb_reported_length_remaining(tvb, offset + 2)) { offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); offset += 3; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); add_text_item(tvb, tree, offset, hf_sametime_field_text); } break; case 0x025a: offset += 10; add_text_item(tvb, tree, offset, hf_sametime_field_text); break; default: break; } return send_type; } static void dissect_channel_accept(tvbuff_t *tvb, proto_tree *tree, int offset) { offset += 34; if (tvb_reported_length_remaining(tvb, offset + 2)) { offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); if (tvb_get_guint8(tvb, offset)) { offset += 1; offset += add_text_item(tvb, tree, offset, hf_sametime_field_text); dissect_set_user_status(tvb, tree, offset); } } } static void dissect_sense_service(tvbuff_t *tvb, proto_tree *tree, int offset) { guint32 code; code = tvb_get_ntohl(tvb, offset); proto_item_append_text(tree, ", %s", val_to_str(code, codenames, "0x%04x")); proto_tree_add_item(tree, hf_sametime_code, tvb, offset, 4, ENC_BIG_ENDIAN); } /* here we really dissect the message(s) */ static int dissect_sametime_content(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *sametime_tree; proto_item *ti; static SametimeTap *sinfo; gint message_type; int packet_length, offset = 0; /* we expect either 1 heartbeat byte (0x80) or a sametime message */ packet_length = tvb_reported_length_remaining(tvb, offset); if (packet_length == 1) { message_type = tvb_get_guint8(tvb, 0); } else if (packet_length < 12) { message_type = -1; } else { message_type = tvb_get_ntohs(tvb, 4); } /* add message type */ col_append_str(pinfo->cinfo, COL_INFO, val_to_str(message_type, messagetypenames, "0x%04x")); col_append_str(pinfo->cinfo, COL_INFO, " "); /* message type statistic */ sinfo = wmem_new(pinfo->pool, struct SametimeTap); sinfo->message_type = message_type; sinfo->send_type = -1; sinfo->user_status = -1; /* packet detail tree */ ti = proto_tree_add_item(tree, proto_sametime, tvb, offset, -1, ENC_NA); sametime_tree = proto_item_add_subtree(ti, ett_sametime); proto_item_append_text(sametime_tree, ", %s", val_to_str(message_type, messagetypenames, "0x%04x")); /* dissect message */ if (message_type == SAMETIME_MESSAGETYPE_HEARTBEAT) { proto_tree_add_item(sametime_tree, hf_sametime_heartbeat, tvb, offset, 1, ENC_BIG_ENDIAN); } else if (message_type != -1) { proto_tree *options_tree; proto_item *op; /* first 4 bytes gives the length of the sametime message */ if (global_sametime_show_length) { proto_tree_add_item(sametime_tree, hf_sametime_message_length, tvb, offset, 4, ENC_BIG_ENDIAN); } offset += 4; /* next 2 bytes gives the message type */ proto_tree_add_item(sametime_tree, hf_sametime_message_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* next 2 bytes are the message options */ op = proto_tree_add_item(sametime_tree, hf_sametime_message_options, tvb, offset, 2, ENC_BIG_ENDIAN); options_tree = proto_item_add_subtree(op, ett_sametime_options); proto_tree_add_item(options_tree, hf_sametime_message_options_attribute, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(options_tree, hf_sametime_message_options_encrypted, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* next 4 bytes contains the channel id */ proto_tree_add_item(sametime_tree, hf_sametime_message_channel, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch (message_type) { case SAMETIME_MESSAGETYPE_HANDSHAKE: dissect_handshake(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_HANDSHAKE_ACK: dissect_handshake_ack(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_HANDSHAKE_SYN: break; case SAMETIME_MESSAGETYPE_LOGIN: dissect_login(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_LOGIN_REDIRECT: dissect_login_redirect(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_LOGIN_ACK: dissect_login_ack(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_CHANNEL_CREATE: dissect_channel_create(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_CHANNEL_SEND: sinfo->send_type = dissect_channel_send(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_CHANNEL_ACCEPT: dissect_channel_accept(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_SET_USER_STATUS: sinfo->user_status = dissect_set_user_status(tvb, sametime_tree, offset); break; case SAMETIME_MESSAGETYPE_SENSE_SERVICE: dissect_sense_service(tvb, sametime_tree, offset); break; default: /* do not fill the statistics with useless data from encrypted packages */ sinfo->message_type = -1; break; } } tap_queue_packet(sametime_tap, pinfo, sinfo); return tvb_captured_length(tvb); } /* tick statistics */ static tap_packet_status sametime_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p, tap_flags_t flags _U_) { const struct SametimeTap *pi = (const struct SametimeTap *)p; tick_stat_node(st, st_str_packet, 0, FALSE); if (pi->message_type != -1) stats_tree_tick_pivot(st, st_node_message_type, val_to_str(pi->message_type, messagetypenames, "Unknown (0x%04x)")); if (pi->send_type != -1) stats_tree_tick_pivot(st, st_node_send_type, val_to_str(pi->send_type, sendtypenames, "Unknown (0x%04x)")); if (pi->user_status != -1) stats_tree_tick_pivot(st, st_node_user_status, val_to_str(pi->user_status, userstatusnames, "Unknown (0x%04x)")); return TAP_PACKET_REDRAW; } /* init statistic */ static void sametime_stats_tree_init(stats_tree* st) { st_node_packet = stats_tree_create_node(st, st_str_packet, 0, STAT_DT_INT, TRUE); st_node_message_type = stats_tree_create_pivot(st, st_str_message_type, st_node_packet); st_node_send_type = stats_tree_create_pivot(st, st_str_send_type, st_node_packet); st_node_user_status = stats_tree_create_pivot(st, st_str_user_status, st_node_packet); } /* length of the sametime message */ static guint get_sametime_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* XXX: Actually: the length of the tvb will always be 4 or greater at this point */ /* because tcp_dissect_pdus was called with 4 as a required "fixed length". */ /* But newer variants of this protocol with a full encrypted network stream */ /* may require a more sophisticated dissection logic here */ guint32 N = tvb_captured_length_remaining(tvb, offset); return (N < 4) ? N : tvb_get_ntohl(tvb, offset) + 4; } /* the dissector itself */ static int dissect_sametime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SAMETIME"); col_clear(pinfo->cinfo,COL_INFO); tcp_dissect_pdus(tvb, pinfo, tree, global_sametime_reassemble_packets, 4, get_sametime_message_len, dissect_sametime_content, data); return tvb_captured_length(tvb); } void proto_register_sametime(void) { static hf_register_info hf[] = { /*tcp payload is one byte : SAMETIME_MESSAGETYPE_HEARTBEAT*/ { &hf_sametime_heartbeat, { "heartbeat", "sametime.heartbeat", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /*sametime message header*/ { &hf_sametime_message_length, { "msg length", "sametime.message_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_sametime_message_type, { "msg type", "sametime.message_type", FT_UINT16, BASE_HEX, VALS(messagetypenames), 0x0, NULL, HFILL } }, { &hf_sametime_message_options, { "msg options", "sametime.message_options", FT_UINT16, BASE_HEX, VALS(optionnames), 0x0, NULL, HFILL } }, { &hf_sametime_message_options_encrypted, { "ENCRYPT", "sametime.message_options.encrypted", FT_BOOLEAN, 16, NULL, SAMETIME_MESSAGEOPTION_ENCRYPT, NULL, HFILL } }, { &hf_sametime_message_options_attribute, { "HAS_ATTRIBS", "sametime.message_options.attribute", FT_BOOLEAN, 16, NULL, SAMETIME_MESSAGEOPTION_HAS_ATTRIBS, NULL, HFILL } }, { &hf_sametime_message_channel, { "msg channel", "sametime.message_channel", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, /*common fields within various message types*/ { &hf_sametime_field_length, { "length", "sametime.field_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_sametime_field_text, { "text", "sametime.field_text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_code, { "code", "sametime.code", FT_UINT32, BASE_HEX, VALS(codenames), 0x0, NULL, HFILL } }, { &hf_sametime_login_type, { "login type", "sametime.login_type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_time, { "time", "sametime.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, /*type handshake*/ { &hf_sametime_handshake_major, { "major", "sametime.handshake.major", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_handshake_minor, { "minor", "sametime.handshake.minor", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_handshake_srvrcalc_addr, { "srvr", "sametime.handshake.srvrcalc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_handshake_loclcalc_addr, { "locl", "sametime.handshake.loclcalc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /*type channel*/ { &hf_sametime_channel_service, { "service id", "sametime.channel.service", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_sametime_channel_id, { "channel id", "sametime.channel.id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_sametime_channel_send_type, { "send type", "sametime.channel.send_type", FT_UINT16, BASE_HEX, VALS(sendtypenames), 0, NULL, HFILL } }, { &hf_sametime_channel_awareness, { "awareness", "sametime.channel.awareness", FT_UINT16, BASE_HEX, VALS(awarenessnames), 0x0, NULL, HFILL } }, /*type user status*/ { &hf_sametime_user_status, { "user status", "sametime.user_status_type", FT_UINT16, BASE_HEX, VALS(userstatusnames), 0x0, NULL, HFILL } }, /*type location*/ { &hf_sametime_location_name, { "name", "sametime.location.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_location_city, { "city", "sametime.location.city", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_location_province, { "province", "sametime.location.province", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_location_postalcode, { "postal code", "sametime.location.postalcode", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_location_country, { "country", "sametime.location.country", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_location_phone, { "phone", "sametime.location.phone", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sametime_location_timezone, { "time zone", "sametime.location.timezone", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_sametime, &ett_sametime_options }; module_t *sametime_module; proto_sametime = proto_register_protocol ("Sametime Protocol", "SAMETIME", "sametime"); proto_register_field_array(proto_sametime, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sametime_tap = register_tap("sametime"); /* Preference setting */ sametime_module = prefs_register_protocol(proto_sametime, NULL); prefs_register_bool_preference(sametime_module, "show_length", "Show length", "Show length of text field", &global_sametime_show_length); prefs_register_bool_preference(sametime_module, "reassemble", "Reassemble","reassemble packets", &global_sametime_reassemble_packets); } /* create / register */ void proto_reg_handoff_sametime(void) { sametime_handle = create_dissector_handle(dissect_sametime, proto_sametime); dissector_add_uint_with_preference("tcp.port", DEFAULT_SAMETIME_PORT, sametime_handle); stats_tree_register("sametime", "sametime", "Sametime/Messages", 0, sametime_stats_tree_packet, sametime_stats_tree_init, NULL ); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sap.c
/* packet-sap.c * Routines for sap packet dissection * RFC 2974 * * Heikki Vatiainen <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * Copied from packet-tftp.c * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #define UDP_PORT_SAP 9875 #define MCAST_SAP_VERSION_MASK 0xE0 /* 3 bits for SAP version*/ #define MCAST_SAP_VERSION_SHIFT 5 /* Right shift 5 bits to get the version */ #define MCAST_SAP_VER0 0 /* Version 0 */ #define MCAST_SAP_VER1PLUS 1 /* Version 1 or later */ void proto_register_sap(void); void proto_reg_handoff_sap(void); static const value_string mcast_sap_ver[] = { { MCAST_SAP_VER0, "SAPv0"}, { MCAST_SAP_VER1PLUS, "SAPv1 or later"}, { 0, NULL} }; static const true_false_string mcast_sap_address_type = {"IPv6", "IPv4"}; static const true_false_string mcast_sap_message_type = { "Deletion", "Announcement"}; static const true_false_string mcast_sap_crypt_type = { "Payload encrypted", "Payload not encrypted"}; static const true_false_string mcast_sap_comp_type = { "Payload compressed", "Payload not compressed"}; static const value_string mcast_sap_auth_ver[] = { { 1, "SAP authentication header v1"}, { 0, NULL} }; static const true_false_string mcast_sap_auth_pad = { "Authentication subheader padded to 32 bits", "No padding required for the authentication subheader" }; #define MCAST_SAP_AUTH_TYPE_MASK 0x0F /* 4 bits for the type of the authentication header */ #define MCAST_SAP_AUTH_TYPE_PGP 0 #define MCAST_SAP_AUTH_TYPE_CMS 1 static const value_string mcast_sap_auth_type[] = { { MCAST_SAP_AUTH_TYPE_PGP, "PGP"}, { MCAST_SAP_AUTH_TYPE_CMS, "CMS"}, { 0, NULL} }; #define MCAST_SAP_BIT_A 0x10 /* Address type: 0 IPv4, 1 IPv6 */ #define MCAST_SAP_BIT_R 0x08 /* Reserved: Must be 0 */ #define MCAST_SAP_BIT_T 0x04 /* Message Type: 0 announcement, 1 deletion */ #define MCAST_SAP_BIT_E 0x02 /* Encryption Bit: 1 payload encrypted */ #define MCAST_SAP_BIT_C 0x01 /* Compressed Bit: 1 payload zlib compressed */ #define MCAST_SAP_AUTH_BIT_P 0x10 /* Padding required for the authentication header */ static int proto_sap = -1; static int hf_sap_flags = -1; static int hf_sap_flags_v = -1; static int hf_sap_flags_a = -1; static int hf_sap_flags_r = -1; static int hf_sap_flags_t = -1; static int hf_sap_flags_e = -1; static int hf_sap_flags_c = -1; static int hf_auth_data = -1; static int hf_auth_flags = -1; static int hf_auth_flags_v = -1; static int hf_auth_flags_p = -1; static int hf_auth_flags_t = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_sap_auth_len = -1; static int hf_sap_originating_source_ipv4 = -1; static int hf_sap_auth_data_padding = -1; static int hf_sap_auth_subheader = -1; static int hf_sap_originating_source_ipv6 = -1; static int hf_sap_message_identifier_hash = -1; static int hf_sap_auth_data_padding_len = -1; static int hf_sap_payload_type = -1; static gint ett_sap = -1; static gint ett_sap_flags = -1; static gint ett_sap_auth = -1; static gint ett_sap_authf = -1; static expert_field ei_sap_compressed_and_encrypted = EI_INIT; static expert_field ei_sap_encrypted = EI_INIT; static expert_field ei_sap_compressed = EI_INIT; /* Generated from convert_proto_tree_add_text.pl */ static expert_field ei_sap_bogus_authentication_or_pad_length = EI_INIT; static dissector_handle_t sdp_handle; static int dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; int sap_version, is_ipv6, is_del, is_enc, is_comp, addr_len; guint8 vers_flags; guint8 auth_len; guint8 auth_flags; tvbuff_t *next_tvb; proto_item *si, *sif; proto_tree *sap_tree = NULL, *sap_flags_tree; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SAP"); col_clear(pinfo->cinfo, COL_INFO); vers_flags = tvb_get_guint8(tvb, offset); is_ipv6 = vers_flags&MCAST_SAP_BIT_A; is_del = vers_flags&MCAST_SAP_BIT_T; is_enc = vers_flags&MCAST_SAP_BIT_E; is_comp = vers_flags&MCAST_SAP_BIT_C; sap_version = (vers_flags&MCAST_SAP_VERSION_MASK)>>MCAST_SAP_VERSION_SHIFT; addr_len = (is_ipv6) ? (int)sizeof(ws_in6_addr) : 4; col_add_fstr(pinfo->cinfo, COL_INFO, "%s (v%u)", (is_del) ? "Deletion" : "Announcement", sap_version); if (tree) { si = proto_tree_add_item(tree, proto_sap, tvb, offset, -1, ENC_NA); sap_tree = proto_item_add_subtree(si, ett_sap); sif = proto_tree_add_item(sap_tree, hf_sap_flags, tvb, offset, 1, ENC_BIG_ENDIAN); sap_flags_tree = proto_item_add_subtree(sif, ett_sap_flags); proto_tree_add_item(sap_flags_tree, hf_sap_flags_v, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sap_flags_tree, hf_sap_flags_a, tvb, offset, 1, ENC_NA); proto_tree_add_item(sap_flags_tree, hf_sap_flags_r, tvb, offset, 1, ENC_NA); proto_tree_add_item(sap_flags_tree, hf_sap_flags_t, tvb, offset, 1, ENC_NA); proto_tree_add_item(sap_flags_tree, hf_sap_flags_e, tvb, offset, 1, ENC_NA); proto_tree_add_item(sap_flags_tree, hf_sap_flags_c, tvb, offset, 1, ENC_NA); } offset++; auth_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(sap_tree, hf_sap_auth_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(sap_tree, hf_sap_message_identifier_hash, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; if (is_ipv6) proto_tree_add_item(sap_tree, hf_sap_originating_source_ipv6, tvb, offset, addr_len, ENC_NA); else proto_tree_add_item(sap_tree, hf_sap_originating_source_ipv4, tvb, offset, addr_len, ENC_BIG_ENDIAN); offset += addr_len; /* Authentication data lives in its own subtree */ if (auth_len > 0) { guint32 auth_data_len; proto_item *sdi, *sai; proto_tree *sa_tree, *saf_tree; int has_pad; guint8 pad_len = 0; auth_data_len = (guint32)(auth_len * sizeof(guint32)); sdi = proto_tree_add_item(sap_tree, hf_auth_data, tvb, offset, auth_data_len, ENC_NA); sa_tree = proto_item_add_subtree(sdi, ett_sap_auth); auth_flags = tvb_get_guint8(tvb, offset); sai = proto_tree_add_item(sa_tree, hf_auth_flags, tvb, offset, 1, ENC_BIG_ENDIAN); saf_tree = proto_item_add_subtree(sai, ett_sap_authf); proto_tree_add_item(saf_tree, hf_auth_flags_v, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(saf_tree, hf_auth_flags_p, tvb, offset, 1, ENC_NA); proto_tree_add_item(saf_tree, hf_auth_flags_t, tvb, offset, 1, ENC_BIG_ENDIAN); has_pad = auth_flags&MCAST_SAP_AUTH_BIT_P; if (has_pad) { pad_len = tvb_get_guint8(tvb, offset+auth_data_len-1); } if ((int) auth_data_len - pad_len - 1 < 0) { expert_add_info_format(pinfo, sai, &ei_sap_bogus_authentication_or_pad_length, "Bogus authentication length (%d) or pad length (%d)", auth_len, pad_len); return tvb_captured_length(tvb); } proto_tree_add_item(sa_tree, hf_sap_auth_subheader, tvb, offset+1, auth_data_len-pad_len-1, ENC_NA); if (has_pad) { proto_tree_add_item(sa_tree, hf_sap_auth_data_padding_len, tvb, offset+auth_data_len-1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sa_tree, hf_sap_auth_data_padding, tvb, offset+auth_data_len-pad_len, pad_len, ENC_NA); } offset += auth_data_len; } if (is_enc || is_comp) { expert_field *mangle; if (is_enc && is_comp) mangle = &ei_sap_compressed_and_encrypted; else if (is_enc) mangle = &ei_sap_encrypted; else mangle = &ei_sap_compressed; proto_tree_add_expert(sap_tree, pinfo, mangle, tvb, offset, -1); return tvb_captured_length(tvb); } if (tree) { /* Do we have the optional payload type aka. MIME content specifier */ if (tvb_strneql(tvb, offset, "v=", strlen("v="))) { gint remaining_len; guint32 pt_len; int pt_string_len; guint8* pt_str; remaining_len = tvb_captured_length_remaining(tvb, offset); if (remaining_len == 0) { /* * "tvb_strneql()" failed because there was no * data left in the packet. * * Set the remaining length to 1, so that * we throw the appropriate exception in * "tvb_get_ptr()", rather than displaying * the payload type. */ remaining_len = 1; } pt_string_len = tvb_strnlen(tvb, offset, remaining_len); if (pt_string_len == -1) { /* * We didn't find a terminating '\0'; run to the * end of the buffer. */ pt_string_len = remaining_len; pt_len = pt_string_len; } else { /* * Include the '\0' in the total item length. */ pt_len = pt_string_len + 1; } pt_str = tvb_get_string_enc(pinfo->pool, tvb, offset, pt_string_len, ENC_ASCII); proto_tree_add_string_format_value(sap_tree, hf_sap_payload_type, tvb, offset, pt_len, pt_str, "%s", pt_str); offset += pt_len; } } /* Done with SAP */ next_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(sdp_handle, next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_sap(void) { static hf_register_info hf[] = { { &hf_sap_flags, { "Flags", "sap.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "Bits in the beginning of the SAP header", HFILL }}, { &hf_sap_flags_v, { "Version Number", "sap.flags.v", FT_UINT8, BASE_DEC, VALS(mcast_sap_ver), MCAST_SAP_VERSION_MASK, "3 bit version field in the SAP header", HFILL }}, { &hf_sap_flags_a, { "Address Type", "sap.flags.a", FT_BOOLEAN, 8, TFS(&mcast_sap_address_type), MCAST_SAP_BIT_A, "Originating source address type", HFILL }}, { &hf_sap_flags_r, { "Reserved", "sap.flags.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MCAST_SAP_BIT_R, NULL, HFILL }}, { &hf_sap_flags_t, { "Message Type", "sap.flags.t", FT_BOOLEAN, 8, TFS(&mcast_sap_message_type), MCAST_SAP_BIT_T, "Announcement type", HFILL }}, { &hf_sap_flags_e, { "Encryption Bit", "sap.flags.e", FT_BOOLEAN, 8, TFS(&mcast_sap_crypt_type), MCAST_SAP_BIT_E, NULL, HFILL }}, { &hf_sap_flags_c, { "Compression Bit", "sap.flags.c", FT_BOOLEAN, 8, TFS(&mcast_sap_comp_type), MCAST_SAP_BIT_C, NULL, HFILL }}, { &hf_auth_data, { "Authentication data", "sap.auth", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_auth_flags, { "Authentication data flags", "sap.auth.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_auth_flags_v, { "Version Number", "sap.auth.flags.v", FT_UINT8, BASE_DEC, VALS(mcast_sap_auth_ver), MCAST_SAP_VERSION_MASK, NULL, HFILL }}, { &hf_auth_flags_p, { "Padding Bit", "sap.auth.flags.p", FT_BOOLEAN, 8, TFS(&mcast_sap_auth_pad), MCAST_SAP_AUTH_BIT_P, NULL, HFILL }}, { &hf_auth_flags_t, { "Authentication Type", "sap.auth.flags.t", FT_UINT8, BASE_DEC, VALS(mcast_sap_auth_type), MCAST_SAP_AUTH_TYPE_MASK, NULL, HFILL }}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_sap_auth_len, { "Authentication Length", "sap.auth.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sap_message_identifier_hash, { "Message Identifier Hash", "sap.message_identifier_hash", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sap_originating_source_ipv4, { "Originating Source", "sap.originating_source", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sap_originating_source_ipv6, { "Originating Source", "sap.originating_source.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sap_auth_subheader, { "Authentication subheader", "sap.auth.subheader", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sap_auth_data_padding, { "Authentication data padding", "sap.auth.data_padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sap_auth_data_padding_len, { "Authentication data pad count (bytes)", "sap.auth.data_padding.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sap_payload_type, { "Payload type", "sap.payload_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_sap, &ett_sap_flags, &ett_sap_auth, &ett_sap_authf, }; static ei_register_info ei[] = { { &ei_sap_compressed_and_encrypted, { "sap.compressed_and_encrypted", PI_UNDECODED, PI_WARN, "The rest of the packet is compressed and encrypted", EXPFILL }}, { &ei_sap_encrypted, { "sap.encrypted", PI_UNDECODED, PI_WARN, "The rest of the packet is encrypted", EXPFILL }}, { &ei_sap_compressed, { "sap.compressed", PI_UNDECODED, PI_WARN, "The rest of the packet is compressed", EXPFILL }}, /* Generated from convert_proto_tree_add_text.pl */ { &ei_sap_bogus_authentication_or_pad_length, { "sap.bogus_authentication_or_pad_length", PI_PROTOCOL, PI_WARN, "Bogus authentication length", EXPFILL }}, }; expert_module_t* expert_sap; proto_sap = proto_register_protocol("Session Announcement Protocol", "SAP", "sap"); proto_register_field_array(proto_sap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sap = expert_register_protocol(proto_sap); expert_register_field_array(expert_sap, ei, array_length(ei)); } void proto_reg_handoff_sap(void) { dissector_handle_t sap_handle; sap_handle = create_dissector_handle(dissect_sap, proto_sap); dissector_add_uint_with_preference("udp.port", UDP_PORT_SAP, sap_handle); /* * Get a handle for the SDP dissector. */ sdp_handle = find_dissector_add_dependency("sdp", proto_sap); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sapdiag.c
/* packet-saphdb.c * Routines for SAP Diag (SAP GUI Protocol) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <wsutil/wmem/wmem.h> #include "packet-sapsnc.h" /* Define default ports. It right range shold be 32NN, but as prot numbers are * proprietary and not IANA assigned, we leave only the one corresponding to the * instance 00. In addition, 3298 it's generally used for the niping tool and 3299 * is associated to SAP Router. */ #define SAPDIAG_PORT_RANGE "3200" /* SAP Diag Header Communication Flag values */ #define SAPDIAG_COM_FLAG_TERM_EOS 0x01 #define SAPDIAG_COM_FLAG_TERM_EOC 0x02 #define SAPDIAG_COM_FLAG_TERM_NOP 0x04 #define SAPDIAG_COM_FLAG_TERM_EOP 0x08 #define SAPDIAG_COM_FLAG_TERM_INI 0x10 #define SAPDIAG_COM_FLAG_TERM_CAS 0x20 #define SAPDIAG_COM_FLAG_TERM_NNM 0x40 #define SAPDIAG_COM_FLAG_TERM_GRA 0x80 /* SAP Diag Header Compression field values */ static const value_string sapdiag_compress_vals[] = { { 0x0, "Compression switched off" }, { 0x1, "Compression switched on" }, { 0x2, "Data encrypted" }, { 0x3, "Data encrypted wrap" }, /* NULL */ { 0x0, NULL } }; /* SAP Diag Header Algorithm field values */ static const value_string sapdiag_algorithm_vals[] = { { 0x10, "LZC" }, { 0x12, "LZH" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag DP Header Request ID values */ static const value_string sapdiag_dp_request_id_vals[] = { { 0x00000000, "NOWP" }, { 0x00000001, "DIA" }, { 0x00000002, "DUPD" }, { 0x00000003, "DENQ" }, { 0x00000004, "DBTC" }, { 0x00000005, "DSPO" }, { 0x00000006, "DUP2" }, /* NULL */ { 0x00000000, NULL} }; /* SAP Diag DP Header Sender ID values */ static const value_string sapdiag_dp_sender_id_vals[] = { { 0x01, "DISPATCHER" }, { 0x02, "WORK_PROCESS" }, { 0x04, "REMOTE_TERMINAL" }, { 0x20, "APPC_TERMINAL" }, { 0x40, "APPC_GATEWAY" }, { 0xC8, "ICMAN" }, { 0xC9, "IC_MONITOR" }, { 0xCB, "LCOM" }, /* NULL */ { 0x00, NULL} }; /* SAP Diag DP Header Action Type values */ static const value_string sapdiag_dp_action_type_vals[] = { { 0x01, "SEND_TO_DP" }, { 0x02, "SEND_TO_WP" }, { 0x03, "SEND_TO_TM" }, { 0x04, "SEND_TO_APPC" }, { 0x05, "SEND_TO_APPCTM" }, { 0x06, "SEND_MSG_TYPE" }, { 0x07, "SEND_MSG_REQUES" }, { 0x08, "SEND_MSG_REPLY" }, { 0x09, "SEND_MSG_ONEWAY" }, { 0x0A, "SEND_MSG_ADMIN" }, { 0x0B, "WAKE_UP_WPS" }, { 0x0C, "SET_TIMEOUT" }, { 0x0D, "DEL_SCHEDULE" }, { 0x0E, "ADD_SOFT_SERV" }, { 0x0F, "SUB_SOFT_SERV" }, { 0x10, "SHUTDOWN" }, { 0x11, "SEND_TO_MSGSERV" }, { 0x12, "SEND_TO_PLUGIN" }, /* NULL */ { 0x00, NULL} }; /* SAP Diag DP Header Request Info Flag constants */ #define SAPDIAG_DP_REQ_INFO_UNDEFINED 0x00 #define SAPDIAG_DP_REQ_INFO_LOGIN 0x01 #define SAPDIAG_DP_REQ_INFO_LOGOFF 0x02 #define SAPDIAG_DP_REQ_INFO_SHUTDOWN 0x04 #define SAPDIAG_DP_REQ_INFO_GRAPHIC_TM 0x08 #define SAPDIAG_DP_REQ_INFO_ALPHA_TM 0x10 #define SAPDIAG_DP_REQ_INFO_ERROR_FROM_APPC 0x20 #define SAPDIAG_DP_REQ_INFO_CANCELMODE 0x40 #define SAPDIAG_DP_REQ_INFO_MSG_WITH_REQ_BUF 0x80 #define SAPDIAG_DP_REQ_INFO_MSG_WITH_OH 0x01 #define SAPDIAG_DP_REQ_INFO_BUFFER_REFRESH 0x02 #define SAPDIAG_DP_REQ_INFO_BTC_SCHEDULER 0x04 #define SAPDIAG_DP_REQ_INFO_APPC_SERVER_DOWN 0x08 #define SAPDIAG_DP_REQ_INFO_MS_ERROR 0x10 #define SAPDIAG_DP_REQ_INFO_SET_SYSTEM_USER 0x20 #define SAPDIAG_DP_REQ_INFO_DP_CANT_HANDLE_REQ 0x40 #define SAPDIAG_DP_REQ_INFO_DP_AUTO_ABAP 0x80 #define SAPDIAG_DP_REQ_INFO_DP_APPL_SERV_INFO 0x01 #define SAPDIAG_DP_REQ_INFO_DP_ADMIN 0x02 #define SAPDIAG_DP_REQ_INFO_DP_SPOOL_ALRM 0x04 #define SAPDIAG_DP_REQ_INFO_DP_HAND_SHAKE 0x08 #define SAPDIAG_DP_REQ_INFO_DP_CANCEL_PRIV 0x10 #define SAPDIAG_DP_REQ_INFO_DP_RAISE_TIMEOUT 0x20 #define SAPDIAG_DP_REQ_INFO_DP_NEW_MODE 0x40 #define SAPDIAG_DP_REQ_INFO_DP_SOFT_CANCEL 0x80 #define SAPDIAG_DP_REQ_INFO_DP_TM_INPUT 0x01 #define SAPDIAG_DP_REQ_INFO_DP_TM_OUTPUT 0x02 #define SAPDIAG_DP_REQ_INFO_DP_ASYNC_RFC 0x04 #define SAPDIAG_DP_REQ_INFO_DP_ICM_EVENT 0x08 #define SAPDIAG_DP_REQ_INFO_DP_AUTO_TH 0x10 #define SAPDIAG_DP_REQ_INFO_DP_RFC_CANCEL 0x20 #define SAPDIAG_DP_REQ_INFO_DP_MS_ADM 0x40 /* SAP Diag Support Bits */ #define SAPDIAG_SUPPORT_BIT_PROGRESS_INDICATOR 0x01 /* 0 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_LABELS 0x02 /* 1 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_DIAGVERSION 0x04 /* 2 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_SELECT_RECT 0x08 /* 3 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_SYMBOL_RIGHT 0x10 /* 4 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_FONT_METRIC 0x20 /* 5 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_COMPR_ENHANCED 0x40 /* 6 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_IMODE 0x80 /* 7 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_LONG_MESSAGE 0x01 /* 8 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_TABLE 0x02 /* 9 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_FOCUS_1 0x04 /* 10 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_PUSHBUTTON_1 0x08 /* 11 */ #define SAPDIAG_SUPPORT_BIT_UPPERCASE 0x10 /* 12 */ #define SAPDIAG_SUPPORT_BIT_SAPGUI_TABPROPERTY 0x20 /* 13 */ #define SAPDIAG_SUPPORT_BIT_INPUT_UPPERCASE 0x40 /* 14 */ #define SAPDIAG_SUPPORT_BIT_RFC_DIALOG 0x80 /* 15 */ #define SAPDIAG_SUPPORT_BIT_LIST_HOTSPOT 0x01 /* 16 */ #define SAPDIAG_SUPPORT_BIT_FKEY_TABLE 0x02 /* 17 */ #define SAPDIAG_SUPPORT_BIT_MENU_SHORTCUT 0x04 /* 18 */ #define SAPDIAG_SUPPORT_BIT_STOP_TRANS 0x08 /* 19 */ #define SAPDIAG_SUPPORT_BIT_FULL_MENU 0x10 /* 20 */ #define SAPDIAG_SUPPORT_BIT_OBJECT_NAMES 0x20 /* 21 */ #define SAPDIAG_SUPPORT_BIT_CONTAINER_TYPE 0x40 /* 22 */ #define SAPDIAG_SUPPORT_BIT_DLGH_FLAGS 0x80 /* 23 */ #define SAPDIAG_SUPPORT_BIT_APPL_MNU 0x01 /* 24 */ #define SAPDIAG_SUPPORT_BIT_MESSAGE_INFO 0x02 /* 25 */ #define SAPDIAG_SUPPORT_BIT_MESDUM_FLAG1 0x04 /* 26 */ #define SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB 0x08 /* 27 */ #define SAPDIAG_SUPPORT_BIT_GUIAPI 0x10 /* 28 */ #define SAPDIAG_SUPPORT_BIT_NOGRAPH 0x20 /* 29 */ #define SAPDIAG_SUPPORT_BIT_NOMESSAGES 0x40 /* 30 */ #define SAPDIAG_SUPPORT_BIT_NORABAX 0x80 /* 31 */ #define SAPDIAG_SUPPORT_BIT_NOSYSMSG 0x01 /* 32 */ #define SAPDIAG_SUPPORT_BIT_NOSAPSCRIPT 0x02 /* 33 */ #define SAPDIAG_SUPPORT_BIT_NORFC 0x04 /* 34 */ #define SAPDIAG_SUPPORT_BIT_NEW_BSD_JUSTRIGHT 0x08 /* 35 */ #define SAPDIAG_SUPPORT_BIT_MESSAGE_VARS 0x10 /* 36 */ #define SAPDIAG_SUPPORT_BIT_OCX_SUPPORT 0x20 /* 37 */ #define SAPDIAG_SUPPORT_BIT_SCROLL_INFOS 0x40 /* 38 */ #define SAPDIAG_SUPPORT_BIT_TABLE_SIZE_OK 0x80 /* 39 */ #define SAPDIAG_SUPPORT_BIT_MESSAGE_INFO2 0x01 /* 40 */ #define SAPDIAG_SUPPORT_BIT_VARINFO_OKCODE 0x02 /* 41 */ #define SAPDIAG_SUPPORT_BIT_CURR_TCODE 0x04 /* 42 */ #define SAPDIAG_SUPPORT_BIT_CONN_WSIZE 0x08 /* 43 */ #define SAPDIAG_SUPPORT_BIT_PUSHBUTTON_2 0x10 /* 44 */ #define SAPDIAG_SUPPORT_BIT_TABSTRIP 0x20 /* 45 */ #define SAPDIAG_SUPPORT_BIT_UNKNOWN_1 0x40 /* 46 (Unknown support bit) */ #define SAPDIAG_SUPPORT_BIT_TABSCROLL_INFOS 0x80 /* 47 */ #define SAPDIAG_SUPPORT_BIT_TABLE_FIELD_NAMES 0x01 /* 48 */ #define SAPDIAG_SUPPORT_BIT_NEW_MODE_REQUEST 0x02 /* 49 */ #define SAPDIAG_SUPPORT_BIT_RFCBLOB_DIAG_PARSER 0x04 /* 50 */ #define SAPDIAG_SUPPORT_BIT_MULTI_LOGIN_USER 0x08 /* 51 */ #define SAPDIAG_SUPPORT_BIT_CONTROL_CONTAINER 0x10 /* 52 */ #define SAPDIAG_SUPPORT_BIT_APPTOOLBAR_FIXED 0x20 /* 53 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_USER_CHECKED 0x40 /* 54 */ #define SAPDIAG_SUPPORT_BIT_NEED_STDDYNPRO 0x80 /* 55 */ #define SAPDIAG_SUPPORT_BIT_TYPE_SERVER 0x01 /* 56 */ #define SAPDIAG_SUPPORT_BIT_COMBOBOX 0x02 /* 57 */ #define SAPDIAG_SUPPORT_BIT_INPUT_REQUIRED 0x04 /* 58 */ #define SAPDIAG_SUPPORT_BIT_ISO_LANGUAGE 0x08 /* 59 */ #define SAPDIAG_SUPPORT_BIT_COMBOBOX_TABLE 0x10 /* 60 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS 0x20 /* 61 */ #define SAPDIAG_SUPPORT_BIT_CHECKRADIO_EVENTS 0x40 /* 62 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_USERID 0x80 /* 63 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_ROLLCOUNT 0x01 /* 64 */ #define SAPDIAG_SUPPORT_BIT_USER_TURNTIME2 0x02 /* 65 */ #define SAPDIAG_SUPPORT_BIT_NUM_FIELD 0x04 /* 66 */ #define SAPDIAG_SUPPORT_BIT_WIN16 0x08 /* 67 */ #define SAPDIAG_SUPPORT_BIT_CONTEXT_MENU 0x10 /* 68 */ #define SAPDIAG_SUPPORT_BIT_SCROLLABLE_TABSTRIP_PAGE 0x20 /* 69 */ #define SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION 0x40 /* 70 */ #define SAPDIAG_SUPPORT_BIT_LABEL_OWNER 0x80 /* 71 */ #define SAPDIAG_SUPPORT_BIT_CLICKABLE_FIELD 0x01 /* 72 */ #define SAPDIAG_SUPPORT_BIT_PROPERTY_BAG 0x02 /* 73 */ #define SAPDIAG_SUPPORT_BIT_UNUSED_1 0x04 /* 74 */ #define SAPDIAG_SUPPORT_BIT_TABLE_ROW_REFERENCES_2 0x08 /* 75 */ #define SAPDIAG_SUPPORT_BIT_PROPFONT_VALID 0x10 /* 76 */ #define SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER 0x20 /* 77 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_IMODEUUID 0x40 /* 78 */ #define SAPDIAG_SUPPORT_BIT_NOTGUI 0x80 /* 79 */ #define SAPDIAG_SUPPORT_BIT_WAN 0x01 /* 80 */ #define SAPDIAG_SUPPORT_BIT_XML_BLOBS 0x02 /* 81 */ #define SAPDIAG_SUPPORT_BIT_RFC_QUEUE 0x04 /* 82 */ #define SAPDIAG_SUPPORT_BIT_RFC_COMPRESS 0x08 /* 83 */ #define SAPDIAG_SUPPORT_BIT_JAVA_BEANS 0x10 /* 84 */ #define SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND 0x20 /* 85 */ #define SAPDIAG_SUPPORT_BIT_CTL_PROPCACHE 0x40 /* 86 */ #define SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID 0x80 /* 87 */ #define SAPDIAG_SUPPORT_BIT_RFC_ASYNC_BLOB 0x01 /* 88 */ #define SAPDIAG_SUPPORT_BIT_KEEP_SCROLLPOS 0x02 /* 89 */ #define SAPDIAG_SUPPORT_BIT_UNUSED_2 0x04 /* 90 */ #define SAPDIAG_SUPPORT_BIT_UNUSED_3 0x08 /* 91 */ #define SAPDIAG_SUPPORT_BIT_XML_PROPERTIES 0x10 /* 92 */ #define SAPDIAG_SUPPORT_BIT_UNUSED_4 0x20 /* 93 */ #define SAPDIAG_SUPPORT_BIT_HEX_FIELD 0x40 /* 94 */ #define SAPDIAG_SUPPORT_BIT_HAS_CACHE 0x80 /* 95 */ #define SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE 0x01 /* 96 */ #define SAPDIAG_SUPPORT_BIT_UNUSED_5 0x02 /* 97 */ #define SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID2 0x04 /* 98 */ #define SAPDIAG_SUPPORT_BIT_ITS 0x08 /* 99 */ #define SAPDIAG_SUPPORT_BIT_NO_EASYACCESS 0x10 /* 100 */ #define SAPDIAG_SUPPORT_BIT_PROPERTYPUMP 0x20 /* 101 */ #define SAPDIAG_SUPPORT_BIT_COOKIE 0x40 /* 102 */ #define SAPDIAG_SUPPORT_BIT_UNUSED_6 0x80 /* 103 */ #define SAPDIAG_SUPPORT_BIT_SUPPBIT_AREA_SIZE 0x01 /* 104 */ #define SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND_WRITE 0x02 /* 105 */ #define SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS 0x04 /* 106 */ #define SAPDIAG_SUPPORT_BIT_ENTRY_HISTORY 0x08 /* 107 */ #define SAPDIAG_SUPPORT_BIT_AUTO_CODEPAGE 0x10 /* 108 */ #define SAPDIAG_SUPPORT_BIT_CACHED_VSETS 0x20 /* 109 */ #define SAPDIAG_SUPPORT_BIT_EMERGENCY_REPAIR 0x40 /* 110 */ #define SAPDIAG_SUPPORT_BIT_AREA2FRONT 0x80 /* 111 */ #define SAPDIAG_SUPPORT_BIT_SCROLLBAR_WIDTH 0x01 /* 112 */ #define SAPDIAG_SUPPORT_BIT_AUTORESIZE 0x02 /* 113 */ #define SAPDIAG_SUPPORT_BIT_EDIT_VARLEN 0x04 /* 114 */ #define SAPDIAG_SUPPORT_BIT_WORKPLACE 0x08 /* 115 */ #define SAPDIAG_SUPPORT_BIT_PRINTDATA 0x10 /* 116 */ #define SAPDIAG_SUPPORT_BIT_UNKNOWN_2 0x20 /* 117 (Unknown support bit) */ #define SAPDIAG_SUPPORT_BIT_SINGLE_SESSION 0x40 /* 118 */ #define SAPDIAG_SUPPORT_BIT_NOTIFY_NEWMODE 0x80 /* 119 */ #define SAPDIAG_SUPPORT_BIT_TOOLBAR_HEIGHT 0x01 /* 120 */ #define SAPDIAG_SUPPORT_BIT_XMLPROP_CONTAINER 0x02 /* 121 */ #define SAPDIAG_SUPPORT_BIT_XMLPROP_DYNPRO 0x04 /* 122 */ #define SAPDIAG_SUPPORT_BIT_DP_HTTP_PUT 0x08 /* 123 */ #define SAPDIAG_SUPPORT_BIT_DYNAMIC_PASSPORT 0x10 /* 124 */ #define SAPDIAG_SUPPORT_BIT_WEBGUI 0x20 /* 125 */ #define SAPDIAG_SUPPORT_BIT_WEBGUI_HELPMODE 0x40 /* 126 */ #define SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST 0x80 /* 127 */ #define SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_2 0x01 /* 128 */ #define SAPDIAG_SUPPORT_BIT_EOKDUMMY_1 0x02 /* 129 */ #define SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING 0x04 /* 130 */ #define SAPDIAG_SUPPORT_BIT_SLC 0x08 /* 131 */ #define SAPDIAG_SUPPORT_BIT_ACCESSIBILITY 0x10 /* 132 */ #define SAPDIAG_SUPPORT_BIT_ECATT 0x20 /* 133 */ #define SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID3 0x40 /* 134 */ #define SAPDIAG_SUPPORT_BIT_ENABLE_UTF8 0x80 /* 135 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_AUTOLOGOUT_TIME 0x01 /* 136 */ #define SAPDIAG_SUPPORT_BIT_VARINFO_ICON_TITLE_LIST 0x02 /* 137 */ #define SAPDIAG_SUPPORT_BIT_ENABLE_UTF16BE 0x04 /* 138 */ #define SAPDIAG_SUPPORT_BIT_ENABLE_UTF16LE 0x08 /* 139 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP 0x10 /* 140 */ #define SAPDIAG_SUPPORT_BIT_ENABLE_APPL4 0x20 /* 141 */ #define SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL 0x40 /* 142 */ #define SAPDIAG_SUPPORT_BIT_CBURBU_NEW_STATE 0x80 /* 143 */ #define SAPDIAG_SUPPORT_BIT_BINARY_EVENTID 0x01 /* 144 */ #define SAPDIAG_SUPPORT_BIT_GUI_THEME 0x02 /* 145 */ #define SAPDIAG_SUPPORT_BIT_TOP_WINDOW 0x04 /* 146 */ #define SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION_1 0x08 /* 147 */ #define SAPDIAG_SUPPORT_BIT_SPLITTER 0x10 /* 148 */ #define SAPDIAG_SUPPORT_BIT_VALUE_4_HISTORY 0x20 /* 149 */ #define SAPDIAG_SUPPORT_BIT_ACC_LIST 0x40 /* 150 */ #define SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING_INFO 0x80 /* 151 */ #define SAPDIAG_SUPPORT_BIT_TEXTEDIT_STREAM 0x01 /* 152 */ #define SAPDIAG_SUPPORT_BIT_DYNT_NOFOCUS 0x02 /* 153 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP_1 0x04 /* 154 */ #define SAPDIAG_SUPPORT_BIT_FRAME_1 0x08 /* 155 */ #define SAPDIAG_SUPPORT_BIT_TICKET4GUI 0x10 /* 156 */ #define SAPDIAG_SUPPORT_BIT_ACC_LIST_PROPS 0x20 /* 157 */ #define SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB_INPUT 0x40 /* 158 */ #define SAPDIAG_SUPPORT_BIT_DEFAULT_TOOLTIP 0x80 /* 159 */ #define SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE_2 0x01 /* 160 */ #define SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_3 0x02 /* 161 */ #define SAPDIAG_SUPPORT_BIT_CELLINFO 0x04 /* 162 */ #define SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST_2 0x08 /* 163 */ #define SAPDIAG_SUPPORT_BIT_TABLE_COLUMNWIDTH_INPUT 0x10 /* 164 */ #define SAPDIAG_SUPPORT_BIT_ITS_PLUGIN 0x20 /* 165 */ #define SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_4_LOGIN_PROCESS 0x40 /* 166 */ #define SAPDIAG_SUPPORT_BIT_RFC_SERVER_4_GUI 0x80 /* 167 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS_2 0x01 /* 168 */ #define SAPDIAG_SUPPORT_BIT_RCUI 0x02 /* 169 */ #define SAPDIAG_SUPPORT_BIT_MENUENTRY_WITH_FCODE 0x04 /* 170 */ #define SAPDIAG_SUPPORT_BIT_WEBSAPCONSOLE 0x08 /* 171 */ #define SAPDIAG_SUPPORT_BIT_R3INFO_KERNEL_VERSION 0x10 /* 172 */ #define SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_LOOP 0x20 /* 173 */ #define SAPDIAG_SUPPORT_BIT_EOKDUMMY_2 0x40 /* 174 */ #define SAPDIAG_SUPPORT_BIT_MESSAGE_INFO3 0x80 /* 175 */ #define SAPDIAG_SUPPORT_BIT_SBA2 0x01 /* 176 */ #define SAPDIAG_SUPPORT_BIT_MAINAREA_SIZE 0x02 /* 177 */ #define SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL_2 0x04 /* 178 */ #define SAPDIAG_SUPPORT_BIT_DISPLAY_SIZE 0x08 /* 179 */ #define SAPDIAG_SUPPORT_BIT_GUI_PACKET 0x10 /* 180 */ #define SAPDIAG_SUPPORT_BIT_DIALOG_STEP_NUMBER 0x20 /* 181 */ #define SAPDIAG_SUPPORT_BIT_TC_KEEP_SCROLL_POSITION 0x40 /* 182 */ #define SAPDIAG_SUPPORT_BIT_MESSAGE_SERVICE_REQUEST 0x80 /* 183 */ #define SAPDIAG_SUPPORT_BIT_DYNT_FOCUS_FRAME 0x01 /* 184 */ #define SAPDIAG_SUPPORT_BIT_MAX_STRING_LEN 0x02 /* 185 */ #define SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_1 0x04 /* 186 */ #define SAPDIAG_SUPPORT_BIT_STD_TOOLBAR_ITEMS 0x08 /* 187 */ #define SAPDIAG_SUPPORT_BIT_XMLPROP_LIST_DYNPRO 0x10 /* 188 */ #define SAPDIAG_SUPPORT_BIT_TRACE_GUI_CONNECT 0x20 /* 189 */ #define SAPDIAG_SUPPORT_BIT_LIST_FULLWIDTH 0x40 /* 190 */ #define SAPDIAG_SUPPORT_BIT_ALLWAYS_SEND_CLIENT 0x80 /* 191 */ #define SAPDIAG_SUPPORT_BIT_UNKNOWN_3 0x01 /* 192 (Unknown support bit) */ #define SAPDIAG_SUPPORT_BIT_GUI_SIGNATURE_COLOR 0x02 /* 193 */ #define SAPDIAG_SUPPORT_BIT_MAX_WSIZE 0x04 /* 194 */ #define SAPDIAG_SUPPORT_BIT_SAP_PERSONAS 0x08 /* 195 */ #define SAPDIAG_SUPPORT_BIT_IDA_ALV 0x10 /* 196 */ #define SAPDIAG_SUPPORT_BIT_IDA_ALV_FRAGMENTS 0x20 /* 197 */ #define SAPDIAG_SUPPORT_BIT_AMC 0x40 /* 198 */ #define SAPDIAG_SUPPORT_BIT_EXTMODE_FONT_METRIC 0x80 /* 199 */ #define SAPDIAG_SUPPORT_BIT_GROUPBOX 0x01 /* 200 */ #define SAPDIAG_SUPPORT_BIT_AGI_ID_TS_BUTTON 0x02 /* 201 */ #define SAPDIAG_SUPPORT_BIT_NO_FOCUS_ON_LIST 0x04 /* 202 */ #define SAPDIAG_SUPPORT_BIT_FIORI_MODE 0x08 /* 203 */ #define SAPDIAG_SUPPORT_BIT_CONNECT_CHECK_DONE 0x10 /* 204 */ #define SAPDIAG_SUPPORT_BIT_MSGINFO_WITH_CODEPAGE 0x20 /* 205 */ #define SAPDIAG_SUPPORT_BIT_AGI_ID 0x40 /* 206 */ #define SAPDIAG_SUPPORT_BIT_AGI_ID_TC 0x80 /* 207 */ #define SAPDIAG_SUPPORT_BIT_FIORI_TOOLBARS 0x01 /* 208 */ #define SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_ENFORCE 0x02 /* 209 */ #define SAPDIAG_SUPPORT_BIT_MESDUMMY_FLAGS_2_3 0x04 /* 210 */ #define SAPDIAG_SUPPORT_BIT_NWBC 0x08 /* 211 */ #define SAPDIAG_SUPPORT_BIT_CONTAINER_LIST 0x10 /* 212 */ #define SAPDIAG_SUPPORT_BIT_GUI_SYSTEM_COLOR 0x20 /* 213 */ #define SAPDIAG_SUPPORT_BIT_GROUPBOX_WITHOUT_BOTTOMLINE 0x40 /* 214 */ /* SAP Diag DP Header New Status values */ static const value_string sapdiag_dp_new_stat_vals[] = { { 0x00, "NO_CHANGE" }, { 0x01, "WP_SLOT_FREE" }, { 0x02, "WP_WAIT" }, { 0x04, "WP_RUN" }, { 0x08, "WP_HOLD" }, { 0x10, "WP_KILLED" }, { 0x20, "WP_SHUTDOWN" }, { 0x40, "WP_RESTRICTED" }, { 0x80, "WP_NEW" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item Type values */ static const value_string sapdiag_item_type_vals[] = { { 0x01, "SES" }, { 0x02, "ICO" }, { 0x03, "TIT" }, { 0x07, "DiagMessage (old format)" }, { 0x08, "OKC" }, { 0x09, "CHL" }, { 0x0a, "SFE" }, { 0x0b, "SBA" }, { 0x0c, "EOM" }, { 0x10, "APPL" }, { 0x11, "DIAG_XMLBLOB" }, { 0x12, "APPL4" }, { 0x13, "SLC" }, { 0x15, "SBA2" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 ID values */ static const value_string sapdiag_item_id_vals[] = { { 0x01, "SCRIPT" }, { 0x02, "GRAPH" }, { 0x03, "IXOS" }, { 0x04, "ST_USER" }, { 0x05, "DYNN" }, { 0x06, "ST_R3INFO" }, { 0x07, "POPU" }, { 0x08, "RFC_TR" }, { 0x09, "DYNT" }, { 0x0a, "CONTAINER" }, { 0x0b, "MNUENTRY" }, { 0x0c, "VARINFO" }, { 0x0e, "CONTROL" }, { 0x0f, "UI_EVENT" }, { 0x12, "ACC_LIST" }, { 0x13, "RCUI" }, { 0x14, "GUI_PACKET" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 SCRIPT SID values */ static const value_string sapdiag_item_appl_script_vals[] = { /* SCRIPT */ { 0x01, "SCRIPT_OTF" }, { 0x02, "SCRIPT_SCREEN" }, { 0x03, "SCRIPT_POSTSCRIPT" }, { 0x04, "SCRIPT_ITF" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 GRAPH SID values */ static const value_string sapdiag_item_appl_graph_vals[] = { /* GRAPH */ { 0x03, "GRAPH RELEASE 3" }, { 0x05, "GRAPH RELEASE 5" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 IXOS SID values */ static const value_string sapdiag_item_appl_ixos_vals[] = { /* IXOS */ { 0x01, "ABLAGE" }, { 0x02, "ANZEIGE" }, { 0x03, "IXOS_COMMAND" }, { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 ST_USER SID values */ static const value_string sapdiag_item_appl_st_user_vals[] = { /* ST_USER */ { 0x01, "V1" }, { 0x02, "CONNECT" }, { 0x03, "SELECTEDRECT" }, { 0x04, "FONTMETRIC" }, { 0x05, "TABLEMETRIC" }, { 0x06, "GUITIME" }, { 0x07, "GUITIMEZONE" }, { 0x08, "TURNTIME" }, { 0x09, "GUIVERSION" }, { 0x0b, "SUPPORTDATA" }, { 0x0c, "RFC_CONNECT" }, { 0x0d, "WSIZE" }, { 0x0e, "V2" }, { 0x0f, "TURNTIME2" }, { 0x10, "RFC_PARENT_UUID" }, { 0x11, "RFC_NEW_UUID" }, { 0x12, "RFC_UUIDS" }, { 0x13, "RFC_UUIDS2" }, { 0x14, "XML_LOGIN" }, { 0x15, "XML_TRANSACTION" }, { 0x16, "SCROLLBAR_WIDTH" }, { 0x17, "TOOLBAR_HEIGHT" }, { 0x18, "PASSPORT_DATA" }, { 0x19, "GUI_STATE" }, { 0x1a, "DECIMALPOINT" }, { 0x1b, "LANGUAGE" }, { 0x1c, "USERNAME" }, { 0x1d, "GUIPATCHLEVEL" }, { 0x1e, "WSIZE_PIXEL" }, { 0x1f, "GUI_OS_VERSION" }, { 0x20, "BROWSER_VERSION" }, { 0x21, "OFFICE_VERSION" }, { 0x22, "JDK_VERSION" }, { 0x23, "GUIXT_VERSION" }, { 0x24, "DISPLAY_SIZE" }, { 0x25, "GUI_TYPE" }, { 0x26, "DIALOG_STEP_NUMBER" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 DYNN SID values */ static const value_string sapdiag_item_appl_dynn_vals[] = { /* DYNN */ { 0x01, "CHL" }, { 0x03, "XMLPROP DYNPRO" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 ST_R3INFO SID values */ static const value_string sapdiag_item_appl_st_r3info_vals[] = { /* ST_R3INFO */ { 0x01, "MODENUMBER" }, { 0x02, "DBNAME" }, { 0x03, "CPUNAME" }, { 0x04, "RFC_TRIGGER" }, { 0x05, "GUI_LABEL" }, { 0x06, "DIAGVERSION" }, { 0x07, "TCODE" }, { 0x08, "RFC_WAITING" }, { 0x09, "RFC_REFRESH" }, { 0x0a, "IMODENUMBER" }, { 0x0b, "MESSAGE" }, { 0x0c, "CLIENT" }, { 0x0d, "DYNPRONAME" }, { 0x0e, "DYNPRONUMBER" }, { 0x0f, "CUANAME" }, { 0x10, "CUASTATUS" }, { 0x11, "SUPPORTDATA" }, { 0x12, "RFC_CONNECT_OK" }, { 0x13, "GUI_FKEY" }, { 0x14, "GUI_FKEYT" }, { 0x15, "STOP_TRANS" }, { 0x16, "RFC_DIAG_BLOCK_SIZE" }, { 0x17, "USER_CHECKED" }, { 0x18, "FLAGS" }, { 0x19, "USERID" }, { 0x1a, "ROLLCOUNT" }, { 0x1b, "GUI_XT_VAR" }, { 0x1c, "IMODEUUID" }, { 0x1d, "IMODEUUID_INVALIDATE" }, { 0x1e, "IMODEUUIDS" }, { 0x1f, "IMODEUUIDS2" }, { 0x20, "CODEPAGE" }, { 0x21, "CONTEXTID" }, { 0x22, "AUTOLOGOUT_TIME" }, { 0x23, "CODEPAGE_DIAG_GUI" }, { 0x24, "CODEPAGE_APP_SERVER" }, { 0x25, "GUI_THEME" }, { 0x26, "GUI_USER_SCRIPTING" }, { 0x27, "CODEPAGE_APP_SERVER_1" }, { 0x28, "TICKET4GUI" }, { 0x29, "KERNEL_VERSION" }, { 0x2a, "STD_TOOLBAR_ITEMS" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 POPU SID values */ static const value_string sapdiag_item_appl_popu_vals[] = { /* POPU */ { 0x02, "DEST" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 RFC_TR SID values */ static const value_string sapdiag_item_appl_rfc_tr_vals[] = { /* RFC_TR */ { 0x00, "RFC_TR_REQ" }, { 0x01, "RFC_TR_RET" }, { 0x02, "RFC_TR_ERR" }, { 0x03, "RFC_TR_RQT" }, { 0x04, "RFC_TR_MOR" }, { 0x05, "RFC_TR_MOB" }, { 0x06, "RFC_TR_RNB" }, { 0x07, "RFC_TR_RNT" }, { 0x08, "RFC_TR_DIS" }, { 0x09, "RFC_TR_CALL" }, { 0x0a, "RFC_TR_CALL_END" }, { 0x0b, "RFC_TR_RES" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 DYNT SID values */ static const value_string sapdiag_item_appl_dynt_vals[] = { /* DYNT */ { 0x01, "DYNT_FOCUS" }, { 0x02, "DYNT_ATOM" }, { 0x03, "DYNT_EVENT_UNUSED" }, { 0x04, "TABLE_ROW_REFERENCE" }, { 0x05, "TABLE_ROW_DAT_INPUT_DUMMY" }, { 0x06, "TABLE_INPUT_HEADER" }, { 0x07, "TABLE_OUTPUT_HEADER" }, { 0x08, "TABLE_ROW_DATA_INPUT" }, { 0x09, "TABLE_ROW_DATA_OUTPUT" }, { 0x0a, "DYNT_NOFOCUS" }, { 0x0b, "DYNT_FOCUS_1" }, { 0x0c, "TABLE_ROW_REFERENCE_1" }, { 0x0d, "TABLE_FIELD_NAMES" }, { 0x0e, "TABLE_HEADER" }, { 0x0f, "DYNT_TABSTRIP_HEADER" }, { 0x10, "DYNT_TABSTRIP_BUTTONS" }, { 0x11, "TABLE_ROW_REFERENCE_2" }, { 0x12, "DYNT_CONTROL_FOCUS" }, { 0x13, "TABLE_FIELD_XMLPROP" }, { 0x14, "DYNT_SPLITTER_HEADER" }, { 0x15, "DYNT_TC_COLUMN_TITLE_XMLP" }, { 0x16, "DYNT_TC_ROW_SELECTOR_NAME" }, { 0x17, "DYNT_FOCUS_FRAME" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 CONTAINER SID values */ static const value_string sapdiag_item_appl_container_vals[] = { /* CONTAINTER */ { 0x01, "RESET" }, { 0x02, "DEFAULT" }, { 0x03, "SUBSCREEN" }, { 0x04, "LOOP" }, { 0x05, "TABLE" }, { 0x06, "NAME" }, { 0x08, "TABSTRIP" }, { 0x09, "TABSTRIP_PAGE" }, { 0x0a, "CONTROL" }, { 0x0c, "XMLPROP" }, { 0x0d, "SPLITTER" }, { 0x0e, "SPLITTER_CELL" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 MNUENTRY SID values */ static const value_string sapdiag_item_appl_mnuentry_vals[] = { /* MNUENTRY */ { 0x01, "MENU_ACT" }, { 0x02, "MENU_MNU" }, { 0x03, "MENU_PFK" }, { 0x04, "MENU_KYB" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 VARINFO SID values */ static const value_string sapdiag_item_appl_varinfo_vals[] = { /* VARINFO */ { 0x01, "MESTYPE" }, { 0x02, "SCROLL_INFOS" }, { 0x03, "MESTYPE2" }, { 0x04, "OKCODE" }, { 0x05, "CONTAINER" }, { 0x06, "SCROLL_INFOS2" }, { 0x07, "AREASIZE" }, { 0x08, "AREA_PIXELSIZE" }, { 0x09, "SESSION_TITLE" }, { 0x0a, "SESSION_ICON" }, { 0x0b, "LIST_CELL_TEXT" }, { 0x0c, "CONTAINER_LOOP" }, { 0x0d, "LIST_FOCUS" }, { 0x0e, "MAINAREA_PIXELSIZE" }, { 0x0f, "SERVICE_REQUEST" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 CONTROl SID values */ static const value_string sapdiag_item_appl_control_vals[] = { /* CONTROL */ { 0x01, "CONTROL_PROPERTIES" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 UI_EVENT SID values */ static const value_string sapdiag_item_appl_ui_event_vals[] = { /* UI_EVENT */ { 0x01, "UI_EVENT_SOURCE" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 ACC_LIST SID values */ static const value_string sapdiag_item_appl_acc_list_vals[] = { /* ACC_LIST */ { 0x01, "ACC_LIST_INFO4FIELD" }, { 0x02, "ACC_LIST_CONTAINER" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 RCUI SID values */ static const value_string sapdiag_item_appl_rcui_vals[] = { /* RCUI */ { 0x01, "RCUI_STREAM" }, { 0x02, "RCUI_SYSTEM_ERROR" }, { 0x03, "RCUI_SPAGPA" }, { 0x04, "RCUI_MEMORYID" }, { 0x05, "RCUI_TXOPTION" }, { 0x06, "RCUI_VALUE" }, { 0x07, "RCUI_COMMAND" }, { 0x08, "RCUI_BDCMSG" }, { 0x09, "RCUI_CONNECT_DATA" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Item APPL/APPL4 GUI_PACKET SID values */ static const value_string sapdiag_item_appl_gui_packet_vals[] = { /* GUI_PACKET */ { 0x01, "GUI_PACKET_STATE" }, { 0x02, "GUI_PACKET_DATA" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Dynt Atom Etype values */ static const value_string sapdiag_item_dynt_atom_item_etype_vals[] = { { 101, "DIAG_DGOTYP_EFIELD" }, { 102, "DIAG_DGOTYP_OFIELD" }, { 103, "DIAG_DGOTYP_KEYWORD" }, { 104, "DIAG_DGOTYP_CHECKBUTTON_4" }, { 105, "DIAG_DGOTYP_RADIOBUTTON_0" }, { 106, "DIAG_DGOTYP_PUSHBUTTON_3" }, { 107, "DIAG_DGOTYP_FRAME_3" }, { 108, "DIAG_DGOTYP_LOOP_6" }, { 109, "DIAG_DGOTYP_SUBSCREEN" }, { 111, "DIAG_DGOTYP_PROPERTY" }, { 112, "DIAG_DGOTYP_ICON_0" }, { 113, "DIAG_DGOTYP_PUSHBUTTON_1" }, { 114, "DIAG_DGOTYP_FNAME" }, { 115, "DIAG_DGOTYP_PUSHBUTTON_2" }, { 116, "DIAG_DGOTYP_TABSTRIP_BUTTON" }, { 117, "DIAG_DGOTYP_COMBOBOX" }, { 118, "DIAG_DGOTYP_CHECKBUTTON_1" }, { 119, "DIAG_DGOTYP_RADIOBUTTON_1" }, { 120, "DIAG_DGOTYP_XMLPROP" }, { 121, "DIAG_DGOTYP_EFIELD_1" }, { 122, "DIAG_DGOTYP_OFIELD_1" }, { 123, "DIAG_DGOTYP_KEYWORD_1_1" }, { 124, "DIAG_DGOTYP_CHECKBUTTON_2" }, { 125, "DIAG_DGOTYP_RADIOBUTTON__0" }, { 126, "DIAG_DGOTYP_COMBOBOX_1" }, { 127, "DIAG_DGOTYP_FRAME_1" }, { 128, "DIAG_DGOTYP_CHECKBUTTON_3" }, { 129, "DIAG_DGOTYP_RADIOBUTTON_3" }, { 130, "DIAG_DGOTYP_EFIELD_2" }, { 131, "DIAG_DGOTYP_OFIELD_2" }, { 132, "DIAG_DGOTYP_KEYWORD_2" }, /* NULL */ { 000, NULL } }; /* SAP Diag UI Event Source Event Type Values */ static const value_string sapdiag_item_ui_event_event_type_vals[] = { { 0x01, "SELECT" }, { 0x02, "HE" }, { 0x03, "VALUEHELP" }, { 0x06, "RESIZE" }, { 0x07, "FUNCTIONKEY" }, { 0x08, "SCROLL" }, { 0x09, "BUTTONPRESSED" }, { 0x0a, "VALUECHANGED" }, { 0x0b, "STATECHANGED" }, { 0x0c, "NAVIGATION" }, /* NULL */ { 0x00, NULL } }; static const value_string sapdiag_item_ui_event_control_type_vals[] = { { 0x00, "NONE" }, { 0x01, "FIELD" }, { 0x02, "RADIOBUTTON" }, { 0x03, "CHECKBUTTON" }, { 0x04, "MENUBUTTON" }, { 0x05, "TOOLBARBUTTON" }, { 0x06, "STANDARDTOOLBARBUTTON" }, { 0x07, "PUSHBUTTON" }, { 0x08, "TABLEVIEW" }, { 0x09, "TABSTRIP" }, { 0x0a, "DYNPRO" }, { 0x0b, "CUSTOM_CONTROL" }, { 0x0d, "FRAME" }, { 0x0e, "TABLEVIEW_COLSEL_BUTTON" }, { 0x0f, "TABLEVIEW_ROWSEL_BUTTON" }, { 0x10, "TABLEVIEW_CELL" }, { 0x11, "CONTEXTMENU" }, { 0x12, "SPLITTER" }, { 0x13, "MESSAGE" }, { 0x14, "OKCODE" }, { 0x15, "ACC_CONTAINER" }, /* NULL */ { 0x00, NULL } }; static const value_string sapdiag_item_ui_event_navigation_data_vals[] = { { 0x01, "TAB" }, { 0x02, "TAB_BACK" }, { 0x03, "JUMP_OVER" }, { 0x04, "JUMP_OVER_BACK" }, { 0x05, "JUMP_OUT" }, { 0x06, "JUMP_OUT_BACK" }, { 0x07, "JUMP_SECTION" }, { 0x08, "JUMP_SECTION_BACK" }, { 0x09, "FIRST_FIELD" }, { 0x0a, "LAST_FIELD" }, /* NULL */ { 0x00, NULL } }; static const value_string sapdiag_item_control_properties_id_vals[] = { { 0x01, "CONTROL_AREA" }, { 0x02, "CONTROL_ID" }, { 0x03, "CONTROL_VISIBLE" }, { 0x04, "CONTROL_ROW" }, { 0x05, "CONTROL_COLUMN" }, { 0x06, "CONTROL_ROWS" }, { 0x07, "CONTROL_COLUMNS" }, /* NULL */ { 0x00, NULL } }; /* SAP Diag Dynt Atom Attr flags */ #define SAPDIAG_ATOM_ATTR_DIAG_BSD_PROTECTED 0x01 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_INVISIBLE 0x02 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_INTENSIFY 0x04 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_JUSTRIGHT 0x08 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_MATCHCODE 0x10 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_PROPFONT 0x20 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_YES3D 0x40 #define SAPDIAG_ATOM_ATTR_DIAG_BSD_COMBOSTYLE 0x80 /* SAP Diag UI Event Source flags */ #define SAPDIAG_UI_EVENT_VALID_FLAG_MENU_POS 0x01 #define SAPDIAG_UI_EVENT_VALID_FLAG_CONTROL_POS 0x02 #define SAPDIAG_UI_EVENT_VALID_FLAG_NAVIGATION_DATA 0x04 #define SAPDIAG_UI_EVENT_VALID_FLAG_FUNCTIONKEY_DATA 0x08 static int proto_sapdiag = -1; static int hf_sapdiag_dp = -1; static int hf_sapdiag_header = -1; static int hf_sapdiag_payload = -1; /* Diag Header */ static int hf_sapdiag_mode = -1; static int hf_sapdiag_com_flag = -1; static int hf_sapdiag_com_flag_TERM_EOS = -1; static int hf_sapdiag_com_flag_TERM_EOC = -1; static int hf_sapdiag_com_flag_TERM_NOP = -1; static int hf_sapdiag_com_flag_TERM_EOP = -1; static int hf_sapdiag_com_flag_TERM_INI = -1; static int hf_sapdiag_com_flag_TERM_CAS = -1; static int hf_sapdiag_com_flag_TERM_NNM = -1; static int hf_sapdiag_com_flag_TERM_GRA = -1; static int hf_sapdiag_mode_stat = -1; static int hf_sapdiag_err_no = -1; static int hf_sapdiag_msg_type = -1; static int hf_sapdiag_msg_info = -1; static int hf_sapdiag_msg_rc = -1; static int hf_sapdiag_compress = -1; /* Error messages */ static int hf_sapdiag_error_message = -1; /* Compression header */ static int hf_sapdiag_compress_header = -1; static int hf_sapdiag_uncomplength = -1; static int hf_sapdiag_algorithm = -1; static int hf_sapdiag_magic = -1; static int hf_sapdiag_special = -1; /* Message Data */ static int hf_sapdiag_item = -1; static int hf_sapdiag_item_type = -1; static int hf_sapdiag_item_id = -1; static int hf_sapdiag_item_sid = -1; static int hf_sapdiag_item_length_short = -1; static int hf_sapdiag_item_length_long = -1; static int hf_sapdiag_item_value = -1; /* Message DP Header */ static int hf_sapdiag_dp_request_id = -1; static int hf_sapdiag_dp_retcode = -1; static int hf_sapdiag_dp_sender_id = -1; static int hf_sapdiag_dp_action_type = -1; static int hf_sapdiag_dp_req_info = -1; static int hf_sapdiag_dp_req_info_LOGIN = -1; static int hf_sapdiag_dp_req_info_LOGOFF = -1; static int hf_sapdiag_dp_req_info_SHUTDOWN = -1; static int hf_sapdiag_dp_req_info_GRAPHIC_TM = -1; static int hf_sapdiag_dp_req_info_ALPHA_TM = -1; static int hf_sapdiag_dp_req_info_ERROR_FROM_APPC = -1; static int hf_sapdiag_dp_req_info_CANCELMODE = -1; static int hf_sapdiag_dp_req_info_MSG_WITH_REQ_BUF = -1; static int hf_sapdiag_dp_req_info_MSG_WITH_OH = -1; static int hf_sapdiag_dp_req_info_BUFFER_REFRESH = -1; static int hf_sapdiag_dp_req_info_BTC_SCHEDULER = -1; static int hf_sapdiag_dp_req_info_APPC_SERVER_DOWN = -1; static int hf_sapdiag_dp_req_info_MS_ERROR = -1; static int hf_sapdiag_dp_req_info_SET_SYSTEM_USER = -1; static int hf_sapdiag_dp_req_info_DP_CANT_HANDLE_REQ = -1; static int hf_sapdiag_dp_req_info_DP_AUTO_ABAP = -1; static int hf_sapdiag_dp_req_info_DP_APPL_SERV_INFO = -1; static int hf_sapdiag_dp_req_info_DP_ADMIN = -1; static int hf_sapdiag_dp_req_info_DP_SPOOL_ALRM = -1; static int hf_sapdiag_dp_req_info_DP_HAND_SHAKE = -1; static int hf_sapdiag_dp_req_info_DP_CANCEL_PRIV = -1; static int hf_sapdiag_dp_req_info_DP_RAISE_TIMEOUT = -1; static int hf_sapdiag_dp_req_info_DP_NEW_MODE = -1; static int hf_sapdiag_dp_req_info_DP_SOFT_CANCEL = -1; static int hf_sapdiag_dp_req_info_DP_TM_INPUT = -1; static int hf_sapdiag_dp_req_info_DP_TM_OUTPUT = -1; static int hf_sapdiag_dp_req_info_DP_ASYNC_RFC = -1; static int hf_sapdiag_dp_req_info_DP_ICM_EVENT = -1; static int hf_sapdiag_dp_req_info_DP_AUTO_TH = -1; static int hf_sapdiag_dp_req_info_DP_RFC_CANCEL = -1; static int hf_sapdiag_dp_req_info_DP_MS_ADM = -1; static int hf_sapdiag_dp_tid = -1; static int hf_sapdiag_dp_uid = -1; static int hf_sapdiag_dp_mode = -1; static int hf_sapdiag_dp_wp_id = -1; static int hf_sapdiag_dp_wp_ca_blk = -1; static int hf_sapdiag_dp_appc_ca_blk = -1; static int hf_sapdiag_dp_len = -1; /* Length of the SAP Diag Items in the login */ static int hf_sapdiag_dp_new_stat = -1; static int hf_sapdiag_dp_rq_id = -1; static int hf_sapdiag_dp_terminal = -1; /* Dynt Atom */ static int hf_sapdiag_item_dynt_atom = -1; static int hf_sapdiag_item_dynt_atom_item = -1; static int hf_sapdiag_item_dynt_atom_item_etype = -1; static int hf_sapdiag_item_dynt_atom_item_attr = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_COMBOSTYLE = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_YES3D = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_PROPFONT = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_MATCHCODE = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_JUSTRIGHT = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_INTENSIFY = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_INVISIBLE = -1; static int hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_PROTECTED = -1; /* Control properties */ static int hf_sapdiag_item_control_properties_id = -1; static int hf_sapdiag_item_control_properties_value = -1; /* UI Event Source */ static int ht_sapdiag_item_ui_event_event_type = -1; static int ht_sapdiag_item_ui_event_control_type = -1; static int ht_sapdiag_item_ui_event_valid = -1; static int ht_sapdiag_item_ui_event_valid_MENU_POS = -1; static int ht_sapdiag_item_ui_event_valid_CONTROL_POS = -1; static int ht_sapdiag_item_ui_event_valid_NAVIGATION_DATA = -1; static int ht_sapdiag_item_ui_event_valid_FUNCTIONKEY_DATA = -1; static int ht_sapdiag_item_ui_event_control_row = -1; static int ht_sapdiag_item_ui_event_control_col = -1; static int ht_sapdiag_item_ui_event_data = -1; static int ht_sapdiag_item_ui_event_navigation_data = -1; static int ht_sapdiag_item_ui_event_container_nrs = -1; static int ht_sapdiag_item_ui_event_container = -1; /* Menu Entries */ static int hf_sapdiag_item_menu_entry = -1; /* Diag Support Bits */ static int hf_SAPDIAG_SUPPORT_BIT_PROGRESS_INDICATOR = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_LABELS = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_DIAGVERSION = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_SELECT_RECT = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_SYMBOL_RIGHT = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_FONT_METRIC = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_COMPR_ENHANCED = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_IMODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_LONG_MESSAGE = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_TABLE = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_FOCUS_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_PUSHBUTTON_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_UPPERCASE = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAPGUI_TABPROPERTY = -1; static int hf_SAPDIAG_SUPPORT_BIT_INPUT_UPPERCASE = -1; static int hf_SAPDIAG_SUPPORT_BIT_RFC_DIALOG = -1; static int hf_SAPDIAG_SUPPORT_BIT_LIST_HOTSPOT = -1; static int hf_SAPDIAG_SUPPORT_BIT_FKEY_TABLE = -1; static int hf_SAPDIAG_SUPPORT_BIT_MENU_SHORTCUT = -1; static int hf_SAPDIAG_SUPPORT_BIT_STOP_TRANS = -1; static int hf_SAPDIAG_SUPPORT_BIT_FULL_MENU = -1; static int hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTAINER_TYPE = -1; static int hf_SAPDIAG_SUPPORT_BIT_DLGH_FLAGS = -1; static int hf_SAPDIAG_SUPPORT_BIT_APPL_MNU = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESDUM_FLAG1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUIAPI = -1; static int hf_SAPDIAG_SUPPORT_BIT_NOGRAPH = -1; static int hf_SAPDIAG_SUPPORT_BIT_NOMESSAGES = -1; static int hf_SAPDIAG_SUPPORT_BIT_NORABAX = -1; static int hf_SAPDIAG_SUPPORT_BIT_NOSYSMSG = -1; static int hf_SAPDIAG_SUPPORT_BIT_NOSAPSCRIPT = -1; static int hf_SAPDIAG_SUPPORT_BIT_NORFC = -1; static int hf_SAPDIAG_SUPPORT_BIT_NEW_BSD_JUSTRIGHT = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESSAGE_VARS = -1; static int hf_SAPDIAG_SUPPORT_BIT_OCX_SUPPORT = -1; static int hf_SAPDIAG_SUPPORT_BIT_SCROLL_INFOS = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABLE_SIZE_OK = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_VARINFO_OKCODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_CURR_TCODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONN_WSIZE = -1; static int hf_SAPDIAG_SUPPORT_BIT_PUSHBUTTON_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABSTRIP = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABSCROLL_INFOS = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABLE_FIELD_NAMES = -1; static int hf_SAPDIAG_SUPPORT_BIT_NEW_MODE_REQUEST = -1; static int hf_SAPDIAG_SUPPORT_BIT_RFCBLOB_DIAG_PARSER = -1; static int hf_SAPDIAG_SUPPORT_BIT_MULTI_LOGIN_USER = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTROL_CONTAINER = -1; static int hf_SAPDIAG_SUPPORT_BIT_APPTOOLBAR_FIXED = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_USER_CHECKED = -1; static int hf_SAPDIAG_SUPPORT_BIT_NEED_STDDYNPRO = -1; static int hf_SAPDIAG_SUPPORT_BIT_TYPE_SERVER = -1; static int hf_SAPDIAG_SUPPORT_BIT_COMBOBOX = -1; static int hf_SAPDIAG_SUPPORT_BIT_INPUT_REQUIRED = -1; static int hf_SAPDIAG_SUPPORT_BIT_ISO_LANGUAGE = -1; static int hf_SAPDIAG_SUPPORT_BIT_COMBOBOX_TABLE = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS = -1; static int hf_SAPDIAG_SUPPORT_BIT_CHECKRADIO_EVENTS = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_USERID = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_ROLLCOUNT = -1; static int hf_SAPDIAG_SUPPORT_BIT_USER_TURNTIME2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_NUM_FIELD = -1; static int hf_SAPDIAG_SUPPORT_BIT_WIN16 = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTEXT_MENU = -1; static int hf_SAPDIAG_SUPPORT_BIT_SCROLLABLE_TABSTRIP_PAGE = -1; static int hf_SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION = -1; static int hf_SAPDIAG_SUPPORT_BIT_LABEL_OWNER = -1; static int hf_SAPDIAG_SUPPORT_BIT_CLICKABLE_FIELD = -1; static int hf_SAPDIAG_SUPPORT_BIT_PROPERTY_BAG = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNUSED_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABLE_ROW_REFERENCES_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_PROPFONT_VALID = -1; static int hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_IMODEUUID = -1; static int hf_SAPDIAG_SUPPORT_BIT_NOTGUI = -1; static int hf_SAPDIAG_SUPPORT_BIT_WAN = -1; static int hf_SAPDIAG_SUPPORT_BIT_XML_BLOBS = -1; static int hf_SAPDIAG_SUPPORT_BIT_RFC_QUEUE = -1; static int hf_SAPDIAG_SUPPORT_BIT_RFC_COMPRESS = -1; static int hf_SAPDIAG_SUPPORT_BIT_JAVA_BEANS = -1; static int hf_SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND = -1; static int hf_SAPDIAG_SUPPORT_BIT_CTL_PROPCACHE = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID = -1; static int hf_SAPDIAG_SUPPORT_BIT_RFC_ASYNC_BLOB = -1; static int hf_SAPDIAG_SUPPORT_BIT_KEEP_SCROLLPOS = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNUSED_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNUSED_3 = -1; static int hf_SAPDIAG_SUPPORT_BIT_XML_PROPERTIES = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNUSED_4 = -1; static int hf_SAPDIAG_SUPPORT_BIT_HEX_FIELD = -1; static int hf_SAPDIAG_SUPPORT_BIT_HAS_CACHE = -1; static int hf_SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNUSED_5 = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_ITS = -1; static int hf_SAPDIAG_SUPPORT_BIT_NO_EASYACCESS = -1; static int hf_SAPDIAG_SUPPORT_BIT_PROPERTYPUMP = -1; static int hf_SAPDIAG_SUPPORT_BIT_COOKIE = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNUSED_6 = -1; static int hf_SAPDIAG_SUPPORT_BIT_SUPPBIT_AREA_SIZE = -1; static int hf_SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND_WRITE = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENTRY_HISTORY = -1; static int hf_SAPDIAG_SUPPORT_BIT_AUTO_CODEPAGE = -1; static int hf_SAPDIAG_SUPPORT_BIT_CACHED_VSETS = -1; static int hf_SAPDIAG_SUPPORT_BIT_EMERGENCY_REPAIR = -1; static int hf_SAPDIAG_SUPPORT_BIT_AREA2FRONT = -1; static int hf_SAPDIAG_SUPPORT_BIT_SCROLLBAR_WIDTH = -1; static int hf_SAPDIAG_SUPPORT_BIT_AUTORESIZE = -1; static int hf_SAPDIAG_SUPPORT_BIT_EDIT_VARLEN = -1; static int hf_SAPDIAG_SUPPORT_BIT_WORKPLACE = -1; static int hf_SAPDIAG_SUPPORT_BIT_PRINTDATA = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_SINGLE_SESSION = -1; static int hf_SAPDIAG_SUPPORT_BIT_NOTIFY_NEWMODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_TOOLBAR_HEIGHT = -1; static int hf_SAPDIAG_SUPPORT_BIT_XMLPROP_CONTAINER = -1; static int hf_SAPDIAG_SUPPORT_BIT_XMLPROP_DYNPRO = -1; static int hf_SAPDIAG_SUPPORT_BIT_DP_HTTP_PUT = -1; static int hf_SAPDIAG_SUPPORT_BIT_DYNAMIC_PASSPORT = -1; static int hf_SAPDIAG_SUPPORT_BIT_WEBGUI = -1; static int hf_SAPDIAG_SUPPORT_BIT_WEBGUI_HELPMODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST = -1; static int hf_SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_EOKDUMMY_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING = -1; static int hf_SAPDIAG_SUPPORT_BIT_SLC = -1; static int hf_SAPDIAG_SUPPORT_BIT_ACCESSIBILITY = -1; static int hf_SAPDIAG_SUPPORT_BIT_ECATT = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID3 = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF8 = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_AUTOLOGOUT_TIME = -1; static int hf_SAPDIAG_SUPPORT_BIT_VARINFO_ICON_TITLE_LIST = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF16BE = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF16LE = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP = -1; static int hf_SAPDIAG_SUPPORT_BIT_ENABLE_APPL4 = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL = -1; static int hf_SAPDIAG_SUPPORT_BIT_CBURBU_NEW_STATE = -1; static int hf_SAPDIAG_SUPPORT_BIT_BINARY_EVENTID = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUI_THEME = -1; static int hf_SAPDIAG_SUPPORT_BIT_TOP_WINDOW = -1; static int hf_SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_SPLITTER = -1; static int hf_SAPDIAG_SUPPORT_BIT_VALUE_4_HISTORY = -1; static int hf_SAPDIAG_SUPPORT_BIT_ACC_LIST = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING_INFO = -1; static int hf_SAPDIAG_SUPPORT_BIT_TEXTEDIT_STREAM = -1; static int hf_SAPDIAG_SUPPORT_BIT_DYNT_NOFOCUS = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_FRAME_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_TICKET4GUI = -1; static int hf_SAPDIAG_SUPPORT_BIT_ACC_LIST_PROPS = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB_INPUT = -1; static int hf_SAPDIAG_SUPPORT_BIT_DEFAULT_TOOLTIP = -1; static int hf_SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_3 = -1; static int hf_SAPDIAG_SUPPORT_BIT_CELLINFO = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_TABLE_COLUMNWIDTH_INPUT = -1; static int hf_SAPDIAG_SUPPORT_BIT_ITS_PLUGIN = -1; static int hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_4_LOGIN_PROCESS = -1; static int hf_SAPDIAG_SUPPORT_BIT_RFC_SERVER_4_GUI = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_RCUI = -1; static int hf_SAPDIAG_SUPPORT_BIT_MENUENTRY_WITH_FCODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_WEBSAPCONSOLE = -1; static int hf_SAPDIAG_SUPPORT_BIT_R3INFO_KERNEL_VERSION = -1; static int hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_LOOP = -1; static int hf_SAPDIAG_SUPPORT_BIT_EOKDUMMY_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO3 = -1; static int hf_SAPDIAG_SUPPORT_BIT_SBA2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_MAINAREA_SIZE = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL_2 = -1; static int hf_SAPDIAG_SUPPORT_BIT_DISPLAY_SIZE = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUI_PACKET = -1; static int hf_SAPDIAG_SUPPORT_BIT_DIALOG_STEP_NUMBER = -1; static int hf_SAPDIAG_SUPPORT_BIT_TC_KEEP_SCROLL_POSITION = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESSAGE_SERVICE_REQUEST = -1; static int hf_SAPDIAG_SUPPORT_BIT_DYNT_FOCUS_FRAME = -1; static int hf_SAPDIAG_SUPPORT_BIT_MAX_STRING_LEN = -1; static int hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_1 = -1; static int hf_SAPDIAG_SUPPORT_BIT_STD_TOOLBAR_ITEMS = -1; static int hf_SAPDIAG_SUPPORT_BIT_XMLPROP_LIST_DYNPRO = -1; static int hf_SAPDIAG_SUPPORT_BIT_TRACE_GUI_CONNECT = -1; static int hf_SAPDIAG_SUPPORT_BIT_LIST_FULLWIDTH = -1; static int hf_SAPDIAG_SUPPORT_BIT_ALLWAYS_SEND_CLIENT = -1; static int hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_3 = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUI_SIGNATURE_COLOR = -1; static int hf_SAPDIAG_SUPPORT_BIT_MAX_WSIZE = -1; static int hf_SAPDIAG_SUPPORT_BIT_SAP_PERSONAS = -1; static int hf_SAPDIAG_SUPPORT_BIT_IDA_ALV = -1; static int hf_SAPDIAG_SUPPORT_BIT_IDA_ALV_FRAGMENTS = -1; static int hf_SAPDIAG_SUPPORT_BIT_AMC = -1; static int hf_SAPDIAG_SUPPORT_BIT_EXTMODE_FONT_METRIC = -1; static int hf_SAPDIAG_SUPPORT_BIT_GROUPBOX = -1; static int hf_SAPDIAG_SUPPORT_BIT_AGI_ID_TS_BUTTON = -1; static int hf_SAPDIAG_SUPPORT_BIT_NO_FOCUS_ON_LIST = -1; static int hf_SAPDIAG_SUPPORT_BIT_FIORI_MODE = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONNECT_CHECK_DONE = -1; static int hf_SAPDIAG_SUPPORT_BIT_MSGINFO_WITH_CODEPAGE = -1; static int hf_SAPDIAG_SUPPORT_BIT_AGI_ID = -1; static int hf_SAPDIAG_SUPPORT_BIT_AGI_ID_TC = -1; static int hf_SAPDIAG_SUPPORT_BIT_FIORI_TOOLBARS = -1; static int hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_ENFORCE = -1; static int hf_SAPDIAG_SUPPORT_BIT_MESDUMMY_FLAGS_2_3 = -1; static int hf_SAPDIAG_SUPPORT_BIT_NWBC = -1; static int hf_SAPDIAG_SUPPORT_BIT_CONTAINER_LIST = -1; static int hf_SAPDIAG_SUPPORT_BIT_GUI_SYSTEM_COLOR = -1; static int hf_SAPDIAG_SUPPORT_BIT_GROUPBOX_WITHOUT_BOTTOMLINE = -1; static gint ett_sapdiag = -1; /* Expert info */ static expert_field ei_sapdiag_item_unknown = EI_INIT; static expert_field ei_sapdiag_item_partial = EI_INIT; static expert_field ei_sapdiag_item_unknown_length = EI_INIT; static expert_field ei_sapdiag_item_offset_invalid = EI_INIT; static expert_field ei_sapdiag_item_length_invalid = EI_INIT; static expert_field ei_sapdiag_atom_item_unknown = EI_INIT; static expert_field ei_sapdiag_atom_item_partial = EI_INIT; static expert_field ei_sapdiag_atom_item_malformed = EI_INIT; static expert_field ei_sapdiag_dynt_focus_more_cont_ids = EI_INIT; static expert_field ei_sapdiag_password_field = EI_INIT; /* Global RFC dissection preference */ static gboolean global_sapdiag_rfc_dissection = TRUE; /* Global SNC dissection preference */ static gboolean global_sapdiag_snc_dissection = TRUE; /* Global port preference */ static range_t *global_sapdiag_port_range; /* Global highlight preference */ static gboolean global_sapdiag_highlight_items = TRUE; /* Protocol handle */ static dissector_handle_t sapdiag_handle; void proto_register_sapdiag(void); void proto_reg_handoff_sapdiag(void); static void dissect_sapdiag_dp_req_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset){ proto_item *ri = NULL; proto_tree *req_info_tree; ri = proto_tree_add_item(tree, hf_sapdiag_dp_req_info, tvb, offset, 4, ENC_BIG_ENDIAN); req_info_tree = proto_item_add_subtree(ri, ett_sapdiag); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_LOGIN, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x08 */ proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_LOGOFF, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_SHUTDOWN, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_GRAPHIC_TM, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_ALPHA_TM, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_ERROR_FROM_APPC, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_CANCELMODE, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_MSG_WITH_REQ_BUF, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_MSG_WITH_OH, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x09 */ proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_BUFFER_REFRESH, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_BTC_SCHEDULER, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_APPC_SERVER_DOWN, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_MS_ERROR, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_SET_SYSTEM_USER, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_CANT_HANDLE_REQ, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_AUTO_ABAP, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_APPL_SERV_INFO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x0a */ proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_ADMIN, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_SPOOL_ALRM, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_HAND_SHAKE, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_CANCEL_PRIV, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_RAISE_TIMEOUT, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_NEW_MODE, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_SOFT_CANCEL, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_TM_INPUT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x0b */ proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_TM_OUTPUT, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_ASYNC_RFC, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_ICM_EVENT, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_AUTO_TH, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_RFC_CANCEL, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(req_info_tree, hf_sapdiag_dp_req_info_DP_MS_ADM, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_sapdiag_dp(tvbuff_t *tvb, proto_tree *tree, guint32 offset){ proto_item *dp = NULL; proto_tree *dp_tree; dp = proto_tree_add_item(tree, hf_sapdiag_dp, tvb, offset, 200, ENC_NA); dp_tree = proto_item_add_subtree(dp, ett_sapdiag); proto_tree_add_item(dp_tree, hf_sapdiag_dp_request_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* 0x00 */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_retcode, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x04 */ offset++; proto_tree_add_item(dp_tree, hf_sapdiag_dp_sender_id, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x05 */ offset++; proto_tree_add_item(dp_tree, hf_sapdiag_dp_action_type, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x06 */ offset++; dissect_sapdiag_dp_req_info(tvb, dp_tree, offset); /* Request info flags */ /* 0x07 */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_tid, tvb, offset, 4, ENC_BIG_ENDIAN); /* 0x0b */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_uid, tvb, offset, 2, ENC_BIG_ENDIAN); /* 0x0f */ offset+=2; proto_tree_add_item(dp_tree, hf_sapdiag_dp_mode, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x11 */ offset++; proto_tree_add_item(dp_tree, hf_sapdiag_dp_wp_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* 0x12 */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_wp_ca_blk, tvb, offset, 4, ENC_BIG_ENDIAN); /* 0x16 */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_appc_ca_blk, tvb, offset, 4, ENC_BIG_ENDIAN); /* 0x1a */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); /* 0x1e */ offset+=4; proto_tree_add_item(dp_tree, hf_sapdiag_dp_new_stat, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0x22 */ offset++; offset+=4; /* Unknown 4 bytes */ /* 0x23 */ proto_tree_add_item(dp_tree, hf_sapdiag_dp_rq_id, tvb, offset, 2, ENC_BIG_ENDIAN); /* 0x27 */ offset+=2; offset+=40; /* Unknown 40 bytes (0x20 * 40) */ /* 0x29 */ proto_tree_add_item(dp_tree, hf_sapdiag_dp_terminal, tvb, offset, 15, ENC_ASCII|ENC_NA); /* 0x51 */ } static void dissect_sapdiag_support_bits(tvbuff_t *tvb, proto_tree *tree, guint32 offset){ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_PROGRESS_INDICATOR, tvb, offset, 1, ENC_BIG_ENDIAN); /* 0 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_LABELS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 1 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_DIAGVERSION, tvb, offset, 1, ENC_BIG_ENDIAN); /* 2 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_SELECT_RECT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 3 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_SYMBOL_RIGHT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 4 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_FONT_METRIC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 5 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_COMPR_ENHANCED, tvb, offset, 1, ENC_BIG_ENDIAN); /* 6 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_IMODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 7 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_LONG_MESSAGE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 8 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_TABLE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 9 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_FOCUS_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 10 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_PUSHBUTTON_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 11 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UPPERCASE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 12 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAPGUI_TABPROPERTY, tvb, offset, 1, ENC_BIG_ENDIAN); /* 13 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_INPUT_UPPERCASE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 14 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RFC_DIALOG, tvb, offset, 1, ENC_BIG_ENDIAN); /* 15 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_LIST_HOTSPOT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 16 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_FKEY_TABLE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 17 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MENU_SHORTCUT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 18 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_STOP_TRANS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 19 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_FULL_MENU, tvb, offset, 1, ENC_BIG_ENDIAN); /* 20 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES, tvb, offset, 1, ENC_BIG_ENDIAN); /* 21 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTAINER_TYPE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 22 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DLGH_FLAGS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 23 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_APPL_MNU, tvb, offset, 1, ENC_BIG_ENDIAN); /* 24 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 25 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESDUM_FLAG1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 26 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB, tvb, offset, 1, ENC_BIG_ENDIAN); /* 27 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUIAPI, tvb, offset, 1, ENC_BIG_ENDIAN); /* 28 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NOGRAPH, tvb, offset, 1, ENC_BIG_ENDIAN); /* 29 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NOMESSAGES, tvb, offset, 1, ENC_BIG_ENDIAN); /* 30 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NORABAX, tvb, offset, 1, ENC_BIG_ENDIAN); /* 31 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NOSYSMSG, tvb, offset, 1, ENC_BIG_ENDIAN); /* 32 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NOSAPSCRIPT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 33 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NORFC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 34 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NEW_BSD_JUSTRIGHT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 35 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESSAGE_VARS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 36 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_OCX_SUPPORT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 37 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SCROLL_INFOS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 38 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABLE_SIZE_OK, tvb, offset, 1, ENC_BIG_ENDIAN); /* 39 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 40 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_VARINFO_OKCODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 41 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CURR_TCODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 42 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONN_WSIZE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 43 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_PUSHBUTTON_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 44 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABSTRIP, tvb, offset, 1, ENC_BIG_ENDIAN); /* 45 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 46 (Unknown support bit) */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABSCROLL_INFOS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 47 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABLE_FIELD_NAMES, tvb, offset, 1, ENC_BIG_ENDIAN); /* 48 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NEW_MODE_REQUEST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 49 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RFCBLOB_DIAG_PARSER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 50 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MULTI_LOGIN_USER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 51 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTROL_CONTAINER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 52 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_APPTOOLBAR_FIXED, tvb, offset, 1, ENC_BIG_ENDIAN); /* 53 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_USER_CHECKED, tvb, offset, 1, ENC_BIG_ENDIAN); /* 54 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NEED_STDDYNPRO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 55 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TYPE_SERVER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 56 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_COMBOBOX, tvb, offset, 1, ENC_BIG_ENDIAN); /* 57 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_INPUT_REQUIRED, tvb, offset, 1, ENC_BIG_ENDIAN); /* 58 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ISO_LANGUAGE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 59 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_COMBOBOX_TABLE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 60 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 61 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CHECKRADIO_EVENTS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 62 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_USERID, tvb, offset, 1, ENC_BIG_ENDIAN); /* 63 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_ROLLCOUNT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 64 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_USER_TURNTIME2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 65 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NUM_FIELD, tvb, offset, 1, ENC_BIG_ENDIAN); /* 66 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_WIN16, tvb, offset, 1, ENC_BIG_ENDIAN); /* 67 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTEXT_MENU, tvb, offset, 1, ENC_BIG_ENDIAN); /* 68 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SCROLLABLE_TABSTRIP_PAGE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 69 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION, tvb, offset, 1, ENC_BIG_ENDIAN); /* 70 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_LABEL_OWNER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 71 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CLICKABLE_FIELD, tvb, offset, 1, ENC_BIG_ENDIAN); /* 72 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_PROPERTY_BAG, tvb, offset, 1, ENC_BIG_ENDIAN); /* 73 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNUSED_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 74 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABLE_ROW_REFERENCES_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 75 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_PROPFONT_VALID, tvb, offset, 1, ENC_BIG_ENDIAN); /* 76 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 77 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_IMODEUUID, tvb, offset, 1, ENC_BIG_ENDIAN); /* 78 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NOTGUI, tvb, offset, 1, ENC_BIG_ENDIAN); /* 79 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_WAN, tvb, offset, 1, ENC_BIG_ENDIAN); /* 80 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XML_BLOBS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 81 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RFC_QUEUE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 82 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RFC_COMPRESS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 83 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_JAVA_BEANS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 84 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND, tvb, offset, 1, ENC_BIG_ENDIAN); /* 85 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CTL_PROPCACHE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 86 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID, tvb, offset, 1, ENC_BIG_ENDIAN); /* 87 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RFC_ASYNC_BLOB, tvb, offset, 1, ENC_BIG_ENDIAN); /* 88 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_KEEP_SCROLLPOS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 89 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNUSED_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 90 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNUSED_3, tvb, offset, 1, ENC_BIG_ENDIAN); /* 91 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XML_PROPERTIES, tvb, offset, 1, ENC_BIG_ENDIAN); /* 92 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNUSED_4, tvb, offset, 1, ENC_BIG_ENDIAN); /* 93 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_HEX_FIELD, tvb, offset, 1, ENC_BIG_ENDIAN); /* 94 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_HAS_CACHE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 95 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 96 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNUSED_5, tvb, offset, 1, ENC_BIG_ENDIAN); /* 97 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 98 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ITS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 99 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NO_EASYACCESS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 100 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_PROPERTYPUMP, tvb, offset, 1, ENC_BIG_ENDIAN); /* 101 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_COOKIE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 102 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNUSED_6, tvb, offset, 1, ENC_BIG_ENDIAN); /* 103 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SUPPBIT_AREA_SIZE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 104 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND_WRITE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 105 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 106 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENTRY_HISTORY, tvb, offset, 1, ENC_BIG_ENDIAN); /* 107 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AUTO_CODEPAGE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 108 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CACHED_VSETS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 109 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EMERGENCY_REPAIR, tvb, offset, 1, ENC_BIG_ENDIAN); /* 110 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AREA2FRONT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 111 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SCROLLBAR_WIDTH, tvb, offset, 1, ENC_BIG_ENDIAN); /* 112 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AUTORESIZE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 113 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EDIT_VARLEN, tvb, offset, 1, ENC_BIG_ENDIAN); /* 114 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_WORKPLACE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 115 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_PRINTDATA, tvb, offset, 1, ENC_BIG_ENDIAN); /* 116 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 117 (Unknown support bit) */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SINGLE_SESSION, tvb, offset, 1, ENC_BIG_ENDIAN); /* 118 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NOTIFY_NEWMODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 119 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TOOLBAR_HEIGHT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 120 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XMLPROP_CONTAINER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 121 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XMLPROP_DYNPRO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 122 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DP_HTTP_PUT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 123 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DYNAMIC_PASSPORT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 124 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_WEBGUI, tvb, offset, 1, ENC_BIG_ENDIAN); /* 125 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_WEBGUI_HELPMODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 126 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 127 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 128 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EOKDUMMY_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 129 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING, tvb, offset, 1, ENC_BIG_ENDIAN); /* 130 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SLC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 131 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ACCESSIBILITY, tvb, offset, 1, ENC_BIG_ENDIAN); /* 132 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ECATT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 133 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID3, tvb, offset, 1, ENC_BIG_ENDIAN); /* 134 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF8, tvb, offset, 1, ENC_BIG_ENDIAN); /* 135 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_AUTOLOGOUT_TIME, tvb, offset, 1, ENC_BIG_ENDIAN); /* 136 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_VARINFO_ICON_TITLE_LIST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 137 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF16BE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 138 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF16LE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 139 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP, tvb, offset, 1, ENC_BIG_ENDIAN); /* 140 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ENABLE_APPL4, tvb, offset, 1, ENC_BIG_ENDIAN); /* 141 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL, tvb, offset, 1, ENC_BIG_ENDIAN); /* 142 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CBURBU_NEW_STATE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 143 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_BINARY_EVENTID, tvb, offset, 1, ENC_BIG_ENDIAN); /* 144 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUI_THEME, tvb, offset, 1, ENC_BIG_ENDIAN); /* 145 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TOP_WINDOW, tvb, offset, 1, ENC_BIG_ENDIAN); /* 146 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 147 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SPLITTER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 148 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_VALUE_4_HISTORY, tvb, offset, 1, ENC_BIG_ENDIAN); /* 149 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ACC_LIST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 150 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING_INFO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 151 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TEXTEDIT_STREAM, tvb, offset, 1, ENC_BIG_ENDIAN); /* 152 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DYNT_NOFOCUS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 153 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 154 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_FRAME_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 155 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TICKET4GUI, tvb, offset, 1, ENC_BIG_ENDIAN); /* 156 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ACC_LIST_PROPS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 157 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB_INPUT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 158 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DEFAULT_TOOLTIP, tvb, offset, 1, ENC_BIG_ENDIAN); /* 159 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 160 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_3, tvb, offset, 1, ENC_BIG_ENDIAN); /* 161 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CELLINFO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 162 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 163 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TABLE_COLUMNWIDTH_INPUT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 164 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ITS_PLUGIN, tvb, offset, 1, ENC_BIG_ENDIAN); /* 165 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_4_LOGIN_PROCESS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 166 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RFC_SERVER_4_GUI, tvb, offset, 1, ENC_BIG_ENDIAN); /* 167 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 168 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_RCUI, tvb, offset, 1, ENC_BIG_ENDIAN); /* 169 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MENUENTRY_WITH_FCODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 170 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_WEBSAPCONSOLE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 171 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_R3INFO_KERNEL_VERSION, tvb, offset, 1, ENC_BIG_ENDIAN); /* 172 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_LOOP, tvb, offset, 1, ENC_BIG_ENDIAN); /* 173 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EOKDUMMY_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 174 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO3, tvb, offset, 1, ENC_BIG_ENDIAN); /* 175 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SBA2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 176 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MAINAREA_SIZE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 177 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL_2, tvb, offset, 1, ENC_BIG_ENDIAN); /* 178 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DISPLAY_SIZE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 179 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUI_PACKET, tvb, offset, 1, ENC_BIG_ENDIAN); /* 180 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DIALOG_STEP_NUMBER, tvb, offset, 1, ENC_BIG_ENDIAN); /* 181 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TC_KEEP_SCROLL_POSITION, tvb, offset, 1, ENC_BIG_ENDIAN); /* 182 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESSAGE_SERVICE_REQUEST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 183 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_DYNT_FOCUS_FRAME, tvb, offset, 1, ENC_BIG_ENDIAN); /* 184 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MAX_STRING_LEN, tvb, offset, 1, ENC_BIG_ENDIAN); /* 185 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_1, tvb, offset, 1, ENC_BIG_ENDIAN); /* 186 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_STD_TOOLBAR_ITEMS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 187 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_XMLPROP_LIST_DYNPRO, tvb, offset, 1, ENC_BIG_ENDIAN); /* 188 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_TRACE_GUI_CONNECT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 189 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_LIST_FULLWIDTH, tvb, offset, 1, ENC_BIG_ENDIAN); /* 190 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_ALLWAYS_SEND_CLIENT, tvb, offset, 1, ENC_BIG_ENDIAN); /* 191 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_3, tvb, offset, 1, ENC_BIG_ENDIAN); /* 192 (Unknown support bit) */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUI_SIGNATURE_COLOR, tvb, offset, 1, ENC_BIG_ENDIAN); /* 193 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MAX_WSIZE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 194 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_SAP_PERSONAS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 195 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_IDA_ALV, tvb, offset, 1, ENC_BIG_ENDIAN); /* 196 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_IDA_ALV_FRAGMENTS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 197 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AMC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 198 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_EXTMODE_FONT_METRIC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 199 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GROUPBOX, tvb, offset, 1, ENC_BIG_ENDIAN); /* 200 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AGI_ID_TS_BUTTON, tvb, offset, 1, ENC_BIG_ENDIAN); /* 201 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NO_FOCUS_ON_LIST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 202 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_FIORI_MODE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 203 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONNECT_CHECK_DONE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 204 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MSGINFO_WITH_CODEPAGE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 205 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AGI_ID, tvb, offset, 1, ENC_BIG_ENDIAN); /* 206 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_AGI_ID_TC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 207 */ offset+=1; proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_FIORI_TOOLBARS, tvb, offset, 1, ENC_BIG_ENDIAN); /* 208 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_ENFORCE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 209 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_MESDUMMY_FLAGS_2_3, tvb, offset, 1, ENC_BIG_ENDIAN); /* 210 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_NWBC, tvb, offset, 1, ENC_BIG_ENDIAN); /* 211 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_CONTAINER_LIST, tvb, offset, 1, ENC_BIG_ENDIAN); /* 212 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GUI_SYSTEM_COLOR, tvb, offset, 1, ENC_BIG_ENDIAN); /* 213 */ proto_tree_add_item(tree, hf_SAPDIAG_SUPPORT_BIT_GROUPBOX_WITHOUT_BOTTOMLINE, tvb, offset, 1, ENC_BIG_ENDIAN); /* 214 */ } static void dissect_sapdiag_rfc_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 item_length){ tvbuff_t *next_tvb = NULL; dissector_handle_t rfc_handle; /* Call the RFC internal dissector. * TODO: This should be enabled when the RFC dissector is merged as they depend on each other. */ if (global_sapdiag_rfc_dissection == TRUE && FALSE){ rfc_handle = find_dissector("saprfcinternal"); if (rfc_handle){ /* Set the column to not writable so the RFC dissector doesn't override the Diag info */ col_set_writable(pinfo->cinfo, -1, FALSE); /* Create a new tvb buffer and call the dissector */ next_tvb = tvb_new_subset_length(tvb, offset, item_length); call_dissector(rfc_handle, next_tvb, pinfo, tree); } } } static gboolean check_length(packet_info *pinfo, proto_tree *tree, guint32 expected, guint32 real, const char *name_string){ if (expected != real){ expert_add_info_format(pinfo, tree, &ei_sapdiag_item_length_invalid, "Item %s length is invalid", name_string); return (FALSE); } else return (TRUE); } static guint8 add_item_value_uint8(tvbuff_t *tvb, proto_item *item, proto_tree *tree, int hf, guint32 offset, const char *text){ proto_tree_add_none_format(tree, hf, tvb, offset, 1, "%s: %d", text, tvb_get_guint8(tvb, offset)); proto_item_append_text(item, ", %s=%d", text, tvb_get_guint8(tvb, offset)); return (tvb_get_guint8(tvb, offset)); } static guint16 add_item_value_uint16(tvbuff_t *tvb, proto_item *item, proto_tree *tree, int hf, guint32 offset, const char *text){ proto_tree_add_none_format(tree, hf, tvb, offset, 2, "%s: %d", text, tvb_get_ntohs(tvb, offset)); proto_item_append_text(item, ", %s=%d", text, tvb_get_ntohs(tvb, offset)); return (tvb_get_ntohs(tvb, offset)); } static guint32 add_item_value_uint32(tvbuff_t *tvb, proto_item *item, proto_tree *tree, int hf, guint32 offset, const char *text){ proto_tree_add_none_format(tree, hf, tvb, offset, 4, "%s: %d", text, tvb_get_ntohl(tvb, offset)); proto_item_append_text(item, ", %s=%d", text, tvb_get_ntohl(tvb, offset)); return (tvb_get_ntohl(tvb, offset)); } static void add_item_value_string(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *tree, int hf, guint32 offset, guint32 length, const char *text, int show_in_tree){ guint8 *string = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII); proto_tree_add_none_format(tree, hf, tvb, offset, length, "%s: %s", text, string); if (show_in_tree) proto_item_append_text(item, ", %s=%s", text, string); } static guint32 add_item_value_stringz(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *tree, int hf, guint32 offset, const char *text, int show_in_tree){ guint32 length = tvb_strsize(tvb, offset); guint8 *string = tvb_get_string_enc(pinfo->pool, tvb, offset, length - 1, ENC_ASCII); proto_tree_add_none_format(tree, hf, tvb, offset, length, "%s: %s", text, string); if (show_in_tree) proto_item_append_text(item, ", %s=%s", text, string); return (length); } static void add_item_value_hexstring(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *tree, int hf, guint32 offset, guint32 length, const char *text){ proto_tree_add_none_format(tree, hf, tvb, offset, length, "%s: %s", text, tvb_bytes_to_str(pinfo->pool, tvb, offset, length)); proto_item_append_text(item, ", %s=%s", text, tvb_bytes_to_str(pinfo->pool, tvb, offset, length)); } static void dissect_sapdiag_dyntatom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 length){ guint32 final = offset + length; guint16 atom_length = 0, atom_item_length = 0; guint8 etype = 0, attr = 0; proto_item *atom = NULL, *atom_item = NULL, *atom_item_attr = NULL; proto_tree *atom_tree = NULL, *atom_item_tree = NULL, *atom_item_attr_tree = NULL; while (offset < final){ etype = tvb_get_guint8(tvb, offset+4); if ((etype != 114) && (etype != 120)) { /* Add a new atom subtree */ atom_length = 0; atom = proto_tree_add_item(tree, hf_sapdiag_item_dynt_atom, tvb, offset, atom_length, ENC_NA); atom_tree = proto_item_add_subtree(atom, ett_sapdiag); proto_item_append_text(atom, ", Etype=%s", val_to_str_const(etype, sapdiag_item_dynt_atom_item_etype_vals, "Unknown")); /* Add the Etype to the Atom tree also */ } /* Check the atom_tree for NULL values. If the atom_tree wasn't created at this point, the atom * starts with an item different to 114 or 120. */ if (atom_tree == NULL){ expert_add_info(pinfo, tree, &ei_sapdiag_atom_item_malformed); break; } /* Add the item atom subtree */ atom_item = proto_tree_add_item(atom_tree, hf_sapdiag_item_dynt_atom_item, tvb, offset, tvb_get_ntohs(tvb, offset), ENC_NA); atom_item_tree = proto_item_add_subtree(atom_item, ett_sapdiag); /* Get the atom item length */ atom_item_length = add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Atom Length"); /* Adjust the length of the atom tree, adding the new item's length and the length field */ atom_length+= atom_item_length; proto_item_set_len(atom_tree, atom_length); /* Continue with the dissection */ offset+=2; atom_item_length-=2; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Dlg Flag 1"); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Dlg Flag 2"); offset+=1; atom_item_length-=1; proto_tree_add_item(atom_item_tree, hf_sapdiag_item_dynt_atom_item_etype, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_append_text(atom_item, ", EType=%d", tvb_get_guint8(tvb, offset)); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Area"); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Block"); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Group"); offset+=1; atom_item_length-=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Row"); offset+=2; atom_item_length-=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Col"); offset+=2; atom_item_length-=2; atom_item_attr = proto_tree_add_item(atom_item_tree, hf_sapdiag_item_dynt_atom_item_attr, tvb, offset, 1, ENC_BIG_ENDIAN); atom_item_attr_tree = proto_item_add_subtree(atom_item_attr, ett_sapdiag); attr = tvb_get_guint8(tvb, offset); proto_item_append_text(atom_item, ", Attr=%d", attr); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_PROTECTED, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_INVISIBLE, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_INTENSIFY, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_JUSTRIGHT, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_MATCHCODE, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_PROPFONT, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_YES3D, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(atom_item_attr_tree, hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_COMBOSTYLE, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; atom_item_length-=1; /* If the attribute is set to invisible we're dealing probably with a password field */ if (attr & SAPDIAG_ATOM_ATTR_DIAG_BSD_INVISIBLE){ expert_add_info(pinfo, atom_item, &ei_sapdiag_password_field); } switch (etype){ case 114:{ /* DIAG_DGOTYP_FNAME */ add_item_value_string(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, atom_item_length, "Text", 1); proto_item_append_text(atom, ", Text=%s", tvb_get_string_enc(pinfo->pool, tvb, offset, atom_item_length, ENC_ASCII)); break; } case 115:{ /* DIAG_DGOTYP_PUSHBUTTON_2 */ add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "V Length"); offset+=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "V Height"); offset+=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Function Code Offset"); offset+=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Text Offset"); offset+=2; offset+=add_item_value_stringz(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Text", 1); add_item_value_stringz(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Function Code", 1); break; } case 116:{ /* DIAG_DGOTYP_TABSTRIP_BUTTON */ add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "V Length"); offset+=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "V Height"); offset+=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Page Id"); offset+=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Function Code Offset"); offset+=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Text Offset"); offset+=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Id Offset"); offset+=2; offset+=add_item_value_stringz(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Text", 1); offset+=add_item_value_stringz(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Function Code", 1); add_item_value_stringz(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "ID", 1); break; } case 118: /* DIAG_DGOTYP_CHECKBUTTON_1" */ case 119:{ /* DIAG_DGOTYP_RADIOBUTTON_1 */ /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, atom_item, &ei_sapdiag_atom_item_partial, "The Diag Atom is dissected partially (0x%.2x)", etype); } break; } case 120:{ /* DIAG_DGOTYP_XMLPROP */ add_item_value_string(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, atom_item_length, "XMLProp", 1); proto_item_append_text(atom, ", XMLProp=%s", tvb_get_string_enc(pinfo->pool, tvb, offset, atom_item_length, ENC_ASCII)); break; } case 121: /* DIAG_DGOTYP_EFIELD_1 */ case 122: /* DIAG_DGOTYP_OFIELD_1 */ case 123:{ /* DIAG_DGOTYP_KEYWORD_1_1 */ /* Found in NW 7.00 and 7.01 versions */ add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Flag1"); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "DLen"); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "MLen"); offset+=1; atom_item_length-=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "MaxNrChars"); offset+=2; atom_item_length-=2; add_item_value_string(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, atom_item_length, "Text", 0); break; } case 127:{ /* DIAG_DGOTYP_FRAME_1 */ add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "DRows"); offset+=2; atom_item_length-=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "DCols"); offset+=2; atom_item_length-=2; add_item_value_string(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, atom_item_length, "Text", 1); offset+=atom_item_length; break; } case 129:{ /* DIAG_DGOTYP_RADIOBUTTON_3 */ add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Button"); offset+=1; atom_item_length-=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Visible Label Length"); offset+=2; atom_item_length-=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "EventID Off"); offset+=2; atom_item_length-=2; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "EventID Len"); offset+=1; atom_item_length-=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Text Off"); offset+=2; atom_item_length-=2; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Text Length"); offset+=2; atom_item_length-=2; add_item_value_string(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, atom_item_length, "Text", 1); break; } case 130: /* DIAG_DGOTYP_EFIELD_2 */ case 131: /* DIAG_DGOTYP_OFIELD_2 */ case 132:{ /* DIAG_DGOTYP_KEYWORD_2 */ add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "Flag1"); offset+=2; atom_item_length-=2; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "DLen"); offset+=1; atom_item_length-=1; add_item_value_uint8(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "MLen"); offset+=1; atom_item_length-=1; add_item_value_uint16(tvb, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, "MaxNrChars"); offset+=2; atom_item_length-=2; add_item_value_string(tvb, pinfo, atom_item, atom_item_tree, hf_sapdiag_item_value, offset, atom_item_length, "Text", 0); break; } default: /* If the preference is set, report the item as unknown in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, atom_item, &ei_sapdiag_atom_item_unknown, "The Diag Atom has a unknown type that is not dissected (%d)", etype); } break; } } } static void dissect_sapdiag_menu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 length){ guint32 final = offset + length; proto_item *menu = NULL; proto_tree *menu_tree = NULL; while (offset < final){ /* Add the menu entry subtree */ menu = proto_tree_add_item(tree, hf_sapdiag_item_menu_entry, tvb, offset, tvb_get_ntohs(tvb, offset), ENC_NA); menu_tree = proto_item_add_subtree(menu, ett_sapdiag); add_item_value_uint16(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Length"); offset+=2; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Position 1"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Position 2"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Position 3"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Position 4"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Flag"); /* XXX: Add flag values */ offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Virtual Key"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Return Code 1"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Return Code 2"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Return Code 3"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Return Code 4"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Return Code 5"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Return Code 6"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Function Code 1"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Function Code 2"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Function Code 3"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Function Code 4"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Function Code 5"); offset+=1; add_item_value_uint8(tvb, menu, menu_tree, hf_sapdiag_item_value, offset, "Function Code 6"); offset+=1; offset+=add_item_value_stringz(tvb, pinfo, menu, menu_tree, hf_sapdiag_item_value, offset, "Text", 1); offset+=add_item_value_stringz(tvb, pinfo, menu, menu_tree, hf_sapdiag_item_value, offset, "Accelerator", 1); add_item_value_stringz(tvb, pinfo, menu, menu_tree, hf_sapdiag_item_value, offset, "Info", 1); } } static void dissect_sapdiag_uievent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 length){ proto_item *event_valid_item = NULL; proto_tree *event_valid_tree = NULL; guint8 event_valid = 0; guint16 container_nrs = 0, i = 0; event_valid = tvb_get_guint8(tvb, offset); event_valid_item = proto_tree_add_item(tree, ht_sapdiag_item_ui_event_valid, tvb, offset, 1, ENC_BIG_ENDIAN); event_valid_tree = proto_item_add_subtree(event_valid_item, ett_sapdiag); proto_tree_add_item(event_valid_tree, ht_sapdiag_item_ui_event_valid_MENU_POS, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(event_valid_tree, ht_sapdiag_item_ui_event_valid_CONTROL_POS, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(event_valid_tree, ht_sapdiag_item_ui_event_valid_NAVIGATION_DATA, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(event_valid_tree, ht_sapdiag_item_ui_event_valid_FUNCTIONKEY_DATA, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1;length-=1; proto_tree_add_item(tree, ht_sapdiag_item_ui_event_event_type, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(tree, ", Event Type=%s", val_to_str_const(tvb_get_ntohs(tvb, offset), sapdiag_item_ui_event_event_type_vals, "Unknown")); offset+=2;length-=2; proto_tree_add_item(tree, ht_sapdiag_item_ui_event_control_type, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(tree, ", Control Type=%s", val_to_str_const(tvb_get_ntohs(tvb, offset), sapdiag_item_ui_event_control_type_vals, "Unknown")); offset+=2;length-=2; /* The semantic of the event data changes depending of the event valid flag and are ignored if the SAPDIAG_UI_EVENT_VALID_FLAG_NAVIGATION_DATA flag or the SAPDIAG_UI_EVENT_VALID_FLAG_FUNCTIONKEY_DATA flags are not set. We dissect them always. */ if (event_valid & SAPDIAG_UI_EVENT_VALID_FLAG_NAVIGATION_DATA){ proto_tree_add_item(tree, ht_sapdiag_item_ui_event_navigation_data, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; } else { /* SAPDIAG_UI_EVENT_VALID_FLAG_FUNCTIONKEY_DATA */ proto_tree_add_item(tree, ht_sapdiag_item_ui_event_data, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; proto_tree_add_item(tree, ht_sapdiag_item_ui_event_data, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; proto_tree_add_item(tree, ht_sapdiag_item_ui_event_data, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; proto_tree_add_item(tree, ht_sapdiag_item_ui_event_data, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; } /* These items are ignored if the flag SAPDIAG_UI_EVENT_VALID_FLAG_CONTROL_POS is not set. We dissect them always. */ proto_tree_add_item(tree, ht_sapdiag_item_ui_event_control_row, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; proto_tree_add_item(tree, ht_sapdiag_item_ui_event_control_col, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; i = container_nrs = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, ht_sapdiag_item_ui_event_container_nrs, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; while (i>0 && length>0){ proto_tree_add_item(tree, ht_sapdiag_item_ui_event_container, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; i--; } if (i>0){ expert_add_info_format(pinfo, tree, &ei_sapdiag_dynt_focus_more_cont_ids, "Number of Container IDs (%d) is invalid", container_nrs); } } static void dissect_sapdiag_item(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *item_value_tree, proto_tree *parent_tree, guint32 offset, guint8 item_type, guint8 item_id, guint8 item_sid, guint32 item_length){ /* SES item */ if (item_type==0x01){ guint8 event_array = 0; check_length(pinfo, item_value_tree, 16, item_length, "SES"); event_array = tvb_get_guint8(tvb, offset); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Event Array"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Event ID 1"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Event ID 2"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Event ID 3"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Event ID 4"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Event ID 5"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Screen Flag"); /* XXX: Add flag values */ offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Modal No"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "X Pos"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Y Pos"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "IMode"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Flag 1"); /* XXX: Add flag values */ offset+=3; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Dim Row"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Dim Col"); /* TODO: Incomplete dissection of this item */ /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_partial, "The SES item is dissected partially (event array = 0x%.2x)", event_array); } } else if (item_type==0x0a) { /* SFE */ check_length(pinfo, item_value_tree, 3, item_length, "SFE"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Control format"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Control color"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Control extended"); } else if (item_type==0x0b) { /* SBA */ check_length(pinfo, item_value_tree, 2, item_length, "SBA"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Control y-position"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Control x-position"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x26){ /* Dialog Step Number */ check_length(pinfo, item_value_tree, 4, item_length, "Dialog Step Number"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Dialog Step Number"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x02){ /* Connect */ check_length(pinfo, item_value_tree, 12, item_length, "Connect"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Protocol Version"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Code Page"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "WS Type"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x04){ /* Font Metric */ check_length(pinfo, item_value_tree, 8, item_length, "Font Metric"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Variable font size (y)"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Variable font size (x)"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Fixed font size (y)"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Fixed font size (x)"); } else if ((item_type==0x10 && item_id==0x04 && item_sid==0x0b) || /* Support Data */ (item_type==0x10 && item_id==0x06 && item_sid==0x11)){ check_length(pinfo, item_value_tree, 32, item_length, "Support Data"); dissect_sapdiag_support_bits(tvb, item_value_tree, offset); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x0d){ /* Window Size */ check_length(pinfo, item_value_tree, 16, item_length, "Window Size"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Area Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Area Width"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x0f){ /* Turn Time 2 (Response time) */ check_length(pinfo, item_value_tree, 4, item_length, "Response time"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Response time"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x16){ /* Scrollbar Width */ check_length(pinfo, item_value_tree, 2, item_length, "Scrollbar Width"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Scrolllbar Width"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x17){ /* Scrollbar Height */ check_length(pinfo, item_value_tree, 2, item_length, "Scrollbar Height"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Scrollbar Height"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x19){ /* Gui State */ check_length(pinfo, item_value_tree, 2, item_length, "Gui State"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Flag 1"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Flag 2"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x1d){ /* GUI patch level */ /* GUI Patch level could be a string in old versions, or a single byte integer in newer ones */ if (item_length == 2){ add_item_value_string(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, 2, "GUI patch level", 1); } else { check_length(pinfo, item_value_tree, 1, item_length, "GUI patch level"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "GUI patch level"); } } else if (item_type==0x10 && item_id==0x04 && item_sid==0x24){ /* Display Size */ check_length(pinfo, item_value_tree, 8, item_length, "Display Size"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Height"); } else if (item_type==0x10 && item_id==0x04 && item_sid==0x25){ /* GUI Type */ check_length(pinfo, item_value_tree, 2, item_length, "GUI Type"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "GUI Type"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x01){ /* Mode Number */ check_length(pinfo, item_value_tree, 2, item_length, "Mode Number"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Mode Number"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x06){ /* Diag version */ check_length(pinfo, item_value_tree, 2, item_length, "Diag version"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Diag version"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x0a){ /* Internal Mode Number */ check_length(pinfo, item_value_tree, 2, item_length, "Internal Mode Number"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Internal Mode Number"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x13){ /* GUI_FKEY */ guint32 length = offset+item_length; offset++; /* TODO: Skip one byte here */ offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Virtual key number", 1); while ((offset < length) && tvb_offset_exists(tvb, offset)){ offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "String number", 1); } /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_partial, "The Diag Item is dissected partially (0x%.2x, 0x%.2x, 0x%.2x)", item_type, item_id, item_sid); } } else if (item_type==0x10 && item_id==0x06 && item_sid==0x14){ /* GUI_FKEYT */ offset++; /* TODO: Skip one byte here */ add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Virtual key number"); offset+=2; /* TODO: Skip one byte here */ add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Virtual key text", 1); /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_partial, "The Diag Item is dissected partially (0x%.2x, 0x%.2x, 0x%.2x)", item_type, item_id, item_sid); } } else if (item_type==0x10 && item_id==0x06 && item_sid==0x16){ /* RFC Diag Block Size */ check_length(pinfo, item_value_tree, 4, item_length, "RFC Diag Block Size"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "RFC Diag Block Size"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x18){ /* Info flags */ check_length(pinfo, item_value_tree, 2, item_length, "Info flags"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Info flags"); /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_partial, "The Diag Item is dissected partially (0x%.2x, 0x%.2x, 0x%.2x)", item_type, item_id, item_sid); } } else if (item_type==0x10 && item_id==0x06 && item_sid==0x19){ /* User ID */ check_length(pinfo, item_value_tree, 2, item_length, "User ID"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "User ID"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x1f){ /* IMode uuids 2 */ guint8 uuids = tvb_get_guint8(tvb, offset); if (!check_length(pinfo, item_value_tree, 1 + 17 * uuids, item_length, "IMode uuids") ) return; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Number of uuids"); offset+=1; while ((uuids > 0) && (tvb_offset_exists(tvb, offset + 16 + 1))){ add_item_value_hexstring(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, 16, "UUID"); offset+=16; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Active context"); offset+=1; uuids--; } } else if (item_type==0x10 && item_id==0x06 && item_sid==0x22){ /* Auto logout time */ check_length(pinfo, item_value_tree, 4, item_length, "Auto logout time"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Auto logout time"); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x23){ /* Codepage Diag GUI */ add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Codepage number (numeric representation)"); offset+=4; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Minimum number of bytes per character"); offset+=1; offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Codepage number (string representation)", 1); add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Codepage description", 1); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x27){ /* Codepage App Server */ add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Codepage number (numeric representation)"); offset+=4; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Minimum number of bytes per character"); offset+=1; offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Codepage number (string representation)", 1); add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Codepage description", 1); } else if (item_type==0x10 && item_id==0x06 && item_sid==0x29){ /* Kernel Version */ offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Database version", 1); offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Kernel version", 1); add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Kernel patch level", 1); } else if (item_type==0x10 && item_id==0x09 && item_sid==0x0b){ /* Dynt Focus */ guint32 length = offset + item_length; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Focus Num of Area ID"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Focus Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Focus Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Focus Row Offset"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Focus Col Offset"); offset+=2; /* Container IDs up to 30 */ if (length-offset > 30){ expert_add_info_format(pinfo, item, &ei_sapdiag_dynt_focus_more_cont_ids, "The Dynt Focus contains more than 30 Container IDs (%d)", offset); } /* Dissect all the remaining container IDs */ while((offset < length) && tvb_offset_exists(tvb, offset)){ add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Focus Container ID"); offset+=1; } } else if (item_type==0x10 && item_id==0x0a && item_sid==0x01){ /* Container Reset */ check_length(pinfo, item_value_tree, 9, item_length, "Container Reset"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Id"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Width"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Height"); } else if (item_type==0x10 && item_id==0x0a && item_sid==0x04){ /* Container Loop */ check_length(pinfo, item_value_tree, 9, item_length, "Container Loop"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Id"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Width"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Height"); } else if (item_type==0x10 && item_id==0x0a && item_sid==0x05){ /* Container Table */ check_length(pinfo, item_value_tree, 9, item_length, "Container Table"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Id"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Width"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Height"); } else if (item_type==0x10 && item_id==0x0a && item_sid==0x06){ /* Container Name */ offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Subscreen name", 1); offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Container name", 1); add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "Subdynpro name", 1); } else if (item_type==0x10 && item_id==0x0a && item_sid==0x08){ /* Container TabStrip */ check_length(pinfo, item_value_tree, 9, item_length, "Container TabStrip"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Id"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Width"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Height"); } else if (item_type==0x10 && item_id==0x0a && item_sid==0x09){ /* Container TabStrip Page */ check_length(pinfo, item_value_tree, 9, item_length, "Container TabStrip Page"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Id"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Width"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Height"); } else if (item_type==0x10 && item_id==0x0a && item_sid==0x0a){ /* Container Control */ check_length(pinfo, item_value_tree, 9, item_length, "Container Control"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Id"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Col"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Width"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Container Height"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x03){ /* Message type */ offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "T", 1); offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "T", 1); offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "T", 1); add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, "T", 1); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x02){ /* Scroll Infos */ check_length(pinfo, item_value_tree, 24, item_length, "Scroll Infos"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Total Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Total Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Data Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Data Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Height Offset"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Width Offset"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x06){ /* Scroll Infos 2 */ check_length(pinfo, item_value_tree, 33, item_length, "Scroll Infos 2"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Total Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Total Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Data Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Data Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Height Offset"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Width Offset"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Visible Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Visible Width"); offset+=4; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Scroll Flag"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x07){ /* Area Size */ check_length(pinfo, item_value_tree, 16, item_length, "Area Size"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Area Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Area Width"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x08){ /* Pixel Size */ check_length(pinfo, item_value_tree, 16, item_length, "Pixel Size"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Width"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Area Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Area Width"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x0c){ /* Container Loop */ check_length(pinfo, item_value_tree, 2, item_length, "Container Loop"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Lines Per Loop Row"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x0d){ /* List focus */ check_length(pinfo, item_value_tree, 5, item_length, "List focus"); add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "List focus version"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "List focus Row"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "List focus Column"); } else if (item_type==0x10 && item_id==0x0c && item_sid==0x0e){ /* Main Area Pixel Size */ check_length(pinfo, item_value_tree, 16, item_length, "Main Area Pixel Size"); add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Height"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Window Width"); /* Dynn items */ } else if ((item_type==0x09) || /* CHL */ (item_type==0x10 && item_id==0x05 && item_sid==0x01)){ /* Dynn Chln */ add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "scrflg"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "chlflag"); offset+=2; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "current row"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "current column"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "V Slider Size"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "dimlistrow"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "dimlistcol"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "H Slider Size"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "dimrow"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "dimcol"); offset+=1; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "maxlistrow"); offset+=2; add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "listrowoffset"); offset+=2; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "maxlistcol"); offset+=1; add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "listcoloffset"); /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_partial, "The Diag Item is dissected partially (0x%.2x, 0x%.2x, 0x%.2x)", item_type, item_id, item_sid); } /* Control Properties */ } else if (item_type==0x10 && item_id==0x0e && item_sid==0x01){ /* Control Properties */ guint32 length = offset + item_length; while((offset < length) && (tvb_offset_exists(tvb, offset + 3))){ /* Check against at least three bytes (2 for ID, 1 for null-terminated value) */ proto_tree_add_item(item_value_tree, hf_sapdiag_item_control_properties_id, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(item, ", Control Property ID=%d", tvb_get_ntohs(tvb, offset)); offset+=2; offset+=add_item_value_stringz(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_control_properties_value, offset, "Control Property Value", 1); } /* UI event source */ } else if (item_type==0x10 && item_id==0x0f && item_sid==0x01){ /* UI Event Source */ dissect_sapdiag_uievent(tvb, pinfo, item_value_tree, offset, item_length); /* GUI Packet state */ } else if (item_type==0x10 && item_id==0x14 && item_sid==0x01){ /* GUI Packet state */ add_item_value_uint8(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Flags"); /* TODO: Add flag values */ offset+=1; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Bytes Total"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Bytes Send"); offset+=4; add_item_value_uint32(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Bytes Received"); /* Dynt items */ } else if ((item_type==0x12 && item_id==0x09 && item_sid==0x02) || /* Dynt Atom */ (item_type==0x10 && item_id==0x09 && item_sid==0x02)) { dissect_sapdiag_dyntatom(tvb, pinfo, item_value_tree, offset, item_length); /* String items */ } else if ((item_type==0x10 && item_id==0x04 && item_sid==0x09) || /* Gui Version */ (item_type==0x10 && item_id==0x04 && item_sid==0x1a) || /* Decimal character */ (item_type==0x10 && item_id==0x04 && item_sid==0x1b) || /* Language */ (item_type==0x10 && item_id==0x04 && item_sid==0x1c) || /* Username */ (item_type==0x10 && item_id==0x04 && item_sid==0x1f) || /* Gui OS Version */ (item_type==0x10 && item_id==0x04 && item_sid==0x20) || /* Browser Version */ (item_type==0x10 && item_id==0x04 && item_sid==0x21) || /* Office Version */ (item_type==0x10 && item_id==0x06 && item_sid==0x02) || /* Database name */ (item_type==0x10 && item_id==0x06 && item_sid==0x03) || /* CPU name */ (item_type==0x10 && item_id==0x06 && item_sid==0x07) || /* Transaction code */ (item_type==0x10 && item_id==0x06 && item_sid==0x0b) || /* Message */ (item_type==0x10 && item_id==0x06 && item_sid==0x0c) || /* Client */ (item_type==0x10 && item_id==0x06 && item_sid==0x0d) || /* Dynpro name */ (item_type==0x10 && item_id==0x06 && item_sid==0x0e) || /* Dynpro number */ (item_type==0x10 && item_id==0x06 && item_sid==0x0f) || /* Cuaname */ (item_type==0x10 && item_id==0x06 && item_sid==0x10) || /* Cuastatus */ (item_type==0x10 && item_id==0x06 && item_sid==0x21) || /* Context ID */ (item_type==0x10 && item_id==0x06 && item_sid==0x24) || /* Codepage application server */ (item_type==0x10 && item_id==0x06 && item_sid==0x25) || /* GUI Theme */ (item_type==0x10 && item_id==0x09 && item_sid==0x12) || /* Control Focus */ (item_type==0x10 && item_id==0x0c && item_sid==0x04) || /* OK Code */ (item_type==0x10 && item_id==0x0c && item_sid==0x09) || /* Session title */ (item_type==0x10 && item_id==0x0c && item_sid==0x0a) || /* Session icon */ (item_type==0x10 && item_id==0x0c && item_sid==0x0b)) /* List Cell text */ { add_item_value_string(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, item_length, "Value", 1); /* RFC Embedded calls */ } else if (item_type==0x10 && item_id==0x08){ /* RFC_TR */ dissect_sapdiag_rfc_call(tvb, pinfo, parent_tree, offset, item_length); /* String items (long text) */ } else if (item_type==0x11){ /* Data Stream */ add_item_value_string(tvb, pinfo, item, item_value_tree, hf_sapdiag_item_value, offset, item_length, "Value", 0); /* Tab Strip Controls */ } else if ((item_type==0x12 && item_id==0x09 && item_sid==0x10)) { dissect_sapdiag_dyntatom(tvb, pinfo, item_value_tree, offset, item_length); /* Menu Entries items */ } else if ((item_type==0x12 && item_id==0x0b)) { dissect_sapdiag_menu(tvb, pinfo, item_value_tree, offset, item_length); } else if (item_type==0x13) { /* SLC */ check_length(pinfo, item_value_tree, 2, item_length, "SLC"); add_item_value_uint16(tvb, item, item_value_tree, hf_sapdiag_item_value, offset, "Field length in characters"); /* Another unknown item */ } else { /* If the preference is set, report the item as unknown in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_unknown, "The Diag Item has a unknown type that is not dissected (0x%.2x, 0x%.2x, 0x%.2x)", item_type, item_id, item_sid); } } } static const char * get_appl_string(guint8 item_id, guint8 item_sid){ const char *item_name_string = NULL; switch (item_id){ case 0x01:{ /* SCRIPT */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_script_vals, "Unknown"); break; } case 0x02:{ /* GRAPH */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_graph_vals, "Unknown"); break; } case 0x03:{ /* IXOS */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_ixos_vals, "Unknown"); break; } case 0x04:{ /* ST_USER */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_st_user_vals, "Unknown"); break; } case 0x05:{ /* DYNN */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_dynn_vals, "Unknown"); break; } case 0x06:{ /* ST_R3INFO */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_st_r3info_vals, "Unknown"); break; } case 0x07:{ /* POPU */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_popu_vals, "Unknown"); break; } case 0x08:{ /* RFC_TR */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_rfc_tr_vals, "Unknown"); break; } case 0x09:{ /* DYNT */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_dynt_vals, "Unknown"); break; } case 0x0a:{ /* CONTAINER */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_container_vals, "Unknown"); break; } case 0x0b:{ /* MNUENTRY */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_mnuentry_vals, "Unknown"); break; } case 0x0c:{ /* VARINFO */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_varinfo_vals, "Unknown"); break; } case 0x0e:{ /* CONTROL */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_control_vals, "Unknown"); break; } case 0x0f:{ /* UI_EVENT */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_ui_event_vals, "Unknown"); break; } case 0x12:{ /* ACC_LIST */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_acc_list_vals, "Unknown"); break; } case 0x13:{ /* RCUI */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_rcui_vals, "Unknown"); break; } case 0x14:{ /* GUI_PACKET */ item_name_string = val_to_str_const(item_sid, sapdiag_item_appl_gui_packet_vals, "Unknown"); break; } } return (item_name_string); } static void dissect_sapdiag_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *parent_tree, guint32 offset){ gint item_value_remaining_length; guint8 item_type, item_long, item_id, item_sid; guint32 item_length, item_value_length; const char *item_name_string = NULL; proto_item *item = NULL, *il = NULL, *item_value = NULL; proto_tree *item_tree, *item_value_tree; while (tvb_offset_exists(tvb, offset)){ item_id = item_sid = item_length = item_value_length = item_long = 0; /* Add the item subtree. We start with a item's length of 1, as we don't have yet the real size of the item */ item = proto_tree_add_item(tree, hf_sapdiag_item, tvb, offset, 1, ENC_NA); item_tree = proto_item_add_subtree(item, ett_sapdiag); /* Get the item type */ item_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(item_tree, hf_sapdiag_item_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; item_length++; proto_item_append_text(item, ": %s", val_to_str_const(item_type, sapdiag_item_type_vals, "Unknown")); switch (item_type){ case 0x01:{ /* SES */ item_value_length = 16; break; } case 0x02:{ /* ICO */ item_value_length = 20; break; } case 0x03:{ /* TIT */ item_value_length = 3; break; } case 0x07:{ /* DiagMessage (old format) */ item_value_length = 76; break; } case 0x08:{ /* OCK */ /* If the preference is set, report the item as partially dissected in the expert info */ if (global_sapdiag_highlight_items){ expert_add_info_format(pinfo, item, &ei_sapdiag_item_unknown_length, "Diag Type of unknown length (0x%.2x)", item_type); } break; } case 0x09:{ /* CHL */ item_value_length = 22; break; } case 0x0a:{ /* SFE */ item_value_length = 3; break; } case 0x0b:{ /* SBA */ item_value_length = 2; break; } case 0x0C:{ /* EOM End of message */ break; } case 0x11:{ /* Data Stream */ item_long = 4; break; } case 0x13:{ /* SLC */ item_value_length = 2; break; } case 0x15:{ /* SBA2 XXX: Find the actual length */ item_value_length = 36; break; } case 0x10: /* APPL */ case 0x12:{ /* APPL4 */ /* Get the APPL(4) ID */ item_id = tvb_get_guint8(tvb, offset); proto_item_append_text(item, ", %s", val_to_str_const(item_id, sapdiag_item_id_vals, "Unknown")); proto_tree_add_item(item_tree, hf_sapdiag_item_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; item_length++; /* Get the APPL item sid value and set the respective name string according to them XXX: Change this for a multi array */ item_sid = tvb_get_guint8(tvb, offset); item_name_string = get_appl_string(item_id, item_sid); proto_item_append_text(item, ", %s", item_name_string); proto_tree_add_uint_format_value(item_tree, hf_sapdiag_item_sid, tvb, offset, 1, item_sid, "%s (0x%.2x)", item_name_string, item_sid); offset++; item_length++; if (item_type==0x10) { item_long = 2; } else if (item_type==0x12) { item_long = 4; } break; } } /* Get the item length (word o dword) */ if (item_long == 2){ item_value_length = tvb_get_ntohs(tvb, offset); il = proto_tree_add_item(item_tree, hf_sapdiag_item_length_short, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; item_length += 2; } else if (item_long == 4){ item_value_length = tvb_get_ntohl(tvb, offset); il = proto_tree_add_item(item_tree, hf_sapdiag_item_length_long, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; item_length += 4; } /* Add the item length */ proto_item_append_text(item, ", Len=%d", item_value_length); /* Now we have the real length of the item, set the proper size */ item_length += item_value_length; proto_item_set_len(item, item_length); /* Add the item value */ if (item_value_length > 0){ /* Check if the item length is valid */ item_value_remaining_length = tvb_reported_length_remaining(tvb, offset); if (item_value_remaining_length < 0){ expert_add_info(pinfo, il, &ei_sapdiag_item_offset_invalid); return; } if ((guint32)item_value_remaining_length < item_value_length){ expert_add_info(pinfo, il, &ei_sapdiag_item_length_invalid); item_value_length = (guint32)item_value_remaining_length; } item_value = proto_tree_add_item(item_tree, hf_sapdiag_item_value, tvb, offset, item_value_length, ENC_NA); item_value_tree = proto_item_add_subtree(item_value, ett_sapdiag); dissect_sapdiag_item(tvb, pinfo, item, item_value_tree, parent_tree, offset, item_type, item_id, item_sid, item_value_length); offset+= item_value_length; } } } static int check_sapdiag_dp(tvbuff_t *tvb, guint32 offset) { /* Since there's no SAP Diag mode 0xff, if the first byte is a 0xFF the * packet probably holds an initialization DP Header */ if ((tvb_reported_length_remaining(tvb, offset) >= 200 + 8) && tvb_get_guint8(tvb, offset) == 0xFF){ return (TRUE); } return (FALSE); } static int check_sapdiag_compression(tvbuff_t *tvb, guint32 offset) { /* We check for the length, the algorithm value and the presence of magic bytes */ if ((tvb_reported_length_remaining(tvb, offset) >= 8) && ((tvb_get_guint8(tvb, offset+4) == 0x11) || (tvb_get_guint8(tvb, offset+4) == 0x12)) && (tvb_get_guint16(tvb, offset+5, ENC_LITTLE_ENDIAN) == 0x9d1f)){ return (TRUE); } return (FALSE); } static void dissect_sapdiag_compressed_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *sapdiag, guint32 offset) { guint32 reported_length = 0; proto_item *compression_header = NULL; proto_tree *compression_header_tree = NULL; /* Add the compression header subtree */ compression_header = proto_tree_add_item(tree, hf_sapdiag_compress_header, tvb, offset, 8, ENC_NA); compression_header_tree = proto_item_add_subtree(compression_header, ett_sapdiag); /* Add the uncompressed length */ reported_length = tvb_get_letohl(tvb, offset); proto_tree_add_uint(compression_header_tree, hf_sapdiag_uncomplength, tvb, offset, 4, reported_length); offset+=4; proto_item_append_text(sapdiag, ", Uncompressed Len: %u", reported_length); col_append_fstr(pinfo->cinfo, COL_INFO, " Uncompressed Length=%u ", reported_length); /* Add the algorithm */ proto_tree_add_item(compression_header_tree, hf_sapdiag_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Add the magic bytes */ proto_tree_add_item(compression_header_tree, hf_sapdiag_magic, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* Add the max bits */ proto_tree_add_item(compression_header_tree, hf_sapdiag_special, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* TODO: Decompression is not yet enabled until the LZC/LZH library is added * Here we just add the payload subtree */ proto_tree_add_item(tree, hf_sapdiag_payload, tvb, offset, -1, ENC_NA); } static void dissect_sapdiag_snc_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sapdiag_tree, proto_tree *tree, guint32 offset){ tvbuff_t *next_tvb = NULL; proto_item *payload = NULL; proto_tree *payload_tree = NULL; /* Call the SNC dissector */ if (global_sapdiag_snc_dissection == TRUE){ next_tvb = dissect_sapsnc_frame(tvb, pinfo, tree, offset); /* If the SNC dissection returned a new tvb, we've a payload to dissect */ if (next_tvb != NULL) { /* Add a new data source for the unwrapped data. From now on, the offset is relative to the new tvb so its zero. */ add_new_data_source(pinfo, next_tvb, "SNC unwrapped Data"); /* Add the payload subtree using the new tvb*/ payload = proto_tree_add_item(sapdiag_tree, hf_sapdiag_payload, next_tvb, 0, -1, ENC_NA); payload_tree = proto_item_add_subtree(payload, ett_sapdiag); if (check_sapdiag_compression(next_tvb, 0)) { dissect_sapdiag_compressed_payload(next_tvb, pinfo, payload_tree, payload, 0); } else { dissect_sapdiag_payload(next_tvb, pinfo, payload_tree, payload, 0); } } } } static int dissect_sapdiag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 compress = 0, error_no = 0; guint32 offset = 0; proto_item *sapdiag = NULL, *header = NULL, *com_flag = NULL, *payload = NULL; proto_tree *sapdiag_tree = NULL, *header_tree = NULL, *com_flag_tree = NULL, *payload_tree = NULL; /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, "SAPDIAG"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); /* Add the main SAPDiag subtree */ sapdiag = proto_tree_add_item(tree, proto_sapdiag, tvb, 0, -1, ENC_NA); sapdiag_tree = proto_item_add_subtree(sapdiag, ett_sapdiag); /* Check if the packet holds a DP Header */ if (check_sapdiag_dp(tvb, offset)){ dissect_sapdiag_dp(tvb, sapdiag_tree, offset); offset+= 200; } /* Check for fixed error messages */ if (tvb_strneql(tvb, 0, "**DPTMMSG**\x00", 12) == 0){ proto_tree_add_item(sapdiag_tree, hf_sapdiag_payload, tvb, offset, -1, ENC_NA); return offset; } else if (tvb_strneql(tvb, 0, "**DPTMOPC**\x00", 12) == 0){ proto_tree_add_item(sapdiag_tree, hf_sapdiag_payload, tvb, offset, -1, ENC_NA); return offset; } /* Add the header subtree */ header = proto_tree_add_item(sapdiag_tree, hf_sapdiag_header, tvb, offset, 8, ENC_NA); header_tree = proto_item_add_subtree(header, ett_sapdiag); /* Add the fields */ proto_tree_add_item(header_tree, hf_sapdiag_mode, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; com_flag = proto_tree_add_item(header_tree, hf_sapdiag_com_flag, tvb, offset, 1, ENC_BIG_ENDIAN); com_flag_tree = proto_item_add_subtree(com_flag, ett_sapdiag); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_EOS, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_EOC, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_NOP, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_EOP, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_INI, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_CAS, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_NNM, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(com_flag_tree, hf_sapdiag_com_flag_TERM_GRA, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(header_tree, hf_sapdiag_mode_stat, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; error_no = tvb_get_guint8(tvb, offset); proto_tree_add_item(header_tree, hf_sapdiag_err_no, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(header_tree, hf_sapdiag_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(header_tree, hf_sapdiag_msg_info, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(header_tree, hf_sapdiag_msg_rc, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; compress = tvb_get_guint8(tvb, offset); proto_tree_add_item(header_tree, hf_sapdiag_compress, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Check for error messages */ if ((error_no != 0x00) && (tvb_reported_length_remaining(tvb, offset) > 0)){ gchar *error_message = NULL; guint32 error_message_length = 0; error_message_length = (guint32)tvb_reported_length_remaining(tvb, offset) - 1; error_message = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, error_message_length, ENC_LITTLE_ENDIAN|ENC_UTF_16); proto_tree_add_string(sapdiag_tree, hf_sapdiag_error_message, tvb, offset, error_message_length, error_message); /* If the message is compressed */ } else if ((compress == 0x01) && (tvb_reported_length_remaining(tvb, offset) >= 8)){ /* Dissect the compressed payload */ dissect_sapdiag_compressed_payload(tvb, pinfo, sapdiag_tree, sapdiag, offset); /* Message wrapped with SNC */ } else if (((compress == 0x02) || (compress == 0x03)) && (tvb_reported_length_remaining(tvb, offset) > 0)){ /* Call the SNC dissector */ dissect_sapdiag_snc_frame(tvb, pinfo, sapdiag_tree, tree, offset); /* Uncompressed payload */ } else { /* Check the payload length */ if (tvb_reported_length_remaining(tvb, offset) > 0){ /* Add the payload subtree */ payload = proto_tree_add_item(sapdiag_tree, hf_sapdiag_payload, tvb, offset, -1, ENC_NA); payload_tree = proto_item_add_subtree(payload, ett_sapdiag); /* Dissect the payload */ dissect_sapdiag_payload(tvb, pinfo, payload_tree, tree, offset); } } return offset; } void proto_register_sapdiag(void) { static hf_register_info hf[] = { { &hf_sapdiag_dp, { "DP Header", "sapdiag.dp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_header, { "Header", "sapdiag.header", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_payload, { "Message", "sapdiag.message", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_mode, { "Mode", "sapdiag.header.mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_com_flag, { "Com Flag", "sapdiag.header.comflag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_EOS, { "Com Flag TERM_EOS", "sapdiag.header.comflag.TERM_EOS", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_EOS, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_EOC, { "Com Flag TERM_EOC", "sapdiag.header.comflag.TERM_EOC", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_EOC, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_NOP, { "Com Flag TERM_NOP", "sapdiag.header.comflag.TERM_NOP", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_NOP, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_EOP, { "Com Flag TERM_EOP", "sapdiag.header.comflag.TERM_EOP", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_EOP, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_INI, { "Com Flag TERM_INI", "sapdiag.header.comflag.TERM_INI", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_INI, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_CAS, { "Com Flag TERM_CAS", "sapdiag.header.comflag.TERM_CAS", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_CAS, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_NNM, { "Com Flag TERM_NNM", "sapdiag.header.comflag.TERM_NNM", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_NNM, NULL, HFILL }}, { &hf_sapdiag_com_flag_TERM_GRA, { "Com Flag TERM_GRA", "sapdiag.header.comflag.TERM_GRA", FT_BOOLEAN, 8, NULL, SAPDIAG_COM_FLAG_TERM_GRA, NULL, HFILL }}, { &hf_sapdiag_mode_stat, { "Mode Stat", "sapdiag.header.modestat", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_err_no, { "Error Number", "sapdiag.header.errorno", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_msg_type, { "Message Type", "sapdiag.header.msgtype", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_msg_info, { "Message Info", "sapdiag.header.msginfo", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_msg_rc, { "Message Rc", "sapdiag.header.msgrc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_compress, { "Compress", "sapdiag.header.compress", FT_UINT8, BASE_HEX, VALS(sapdiag_compress_vals), 0x0, NULL, HFILL }}, /* Error Messages */ { &hf_sapdiag_error_message, { "Error Message", "sapdiag.error_message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Compression header */ { &hf_sapdiag_compress_header, { "Compression Header", "sapdiag.header.compression", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_uncomplength, { "Uncompressed Length", "sapdiag.header.compression.uncomplength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_algorithm, { "Compression Algorithm", "sapdiag.header.compression.algorithm", FT_UINT8, BASE_HEX, VALS(sapdiag_algorithm_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_magic, { "Magic Bytes", "sapdiag.header.compression.magic", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_special, { "Special", "sapdiag.header.compression.special", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* SAPDiag Messages */ { &hf_sapdiag_item, { "Item", "sapdiag.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_type, { "Type", "sapdiag.item.type", FT_UINT8, BASE_HEX, VALS(sapdiag_item_type_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_item_id, { "ID", "sapdiag.item.id", FT_UINT8, BASE_HEX, VALS(sapdiag_item_id_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_item_sid, { "SID", "sapdiag.item.sid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_length_short, { "Length", "sapdiag.item.length_short", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_length_long, { "Length", "sapdiag.item.length_long", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_value, { "Value", "sapdiag.item.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* SAPDiag DP Header */ { &hf_sapdiag_dp_request_id, { "Request ID", "sapdiag.dp.reqid", FT_INT32, BASE_DEC, VALS(sapdiag_dp_request_id_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_retcode, { "Retcode", "sapdiag.dp.retcode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_sender_id, { "Sender ID", "sapdiag.dp.senderid", FT_UINT8, BASE_HEX, VALS(sapdiag_dp_sender_id_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_action_type, { "Action type", "sapdiag.dp.actiontype", FT_UINT8, BASE_HEX, VALS(sapdiag_dp_action_type_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_req_info, { "Request Info", "sapdiag.dp.reqinfo", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* Request Info Flag */ { &hf_sapdiag_dp_req_info_LOGIN, { "Login Flag", "sapdiag.dp.reqinfo.login", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_LOGIN, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_LOGOFF, { "Logoff Flag", "sapdiag.dp.reqinfo.logoff", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_LOGOFF, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_SHUTDOWN, { "Shutdown Flag", "sapdiag.dp.reqinfo.shutdown", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_SHUTDOWN, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_GRAPHIC_TM, { "Graphic TM Flag", "sapdiag.dp.reqinfo.graphictm", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_GRAPHIC_TM, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_ALPHA_TM, { "Alpha TM Flag", "sapdiag.dp.reqinfo.alphatm", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_ALPHA_TM, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_ERROR_FROM_APPC, { "Error from APPC Flag", "sapdiag.dp.reqinfo.errorfromappc", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_ERROR_FROM_APPC, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_CANCELMODE, { "Cancel Mode Flag", "sapdiag.dp.reqinfo.cancelmode", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_CANCELMODE, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_MSG_WITH_REQ_BUF, { "Msg with Req Buf Flag", "sapdiag.dp.reqinfo.msg_with_req_buf", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_MSG_WITH_REQ_BUF, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_MSG_WITH_OH, { "Msg with OH Flag", "sapdiag.dp.reqinfo.msg_with_oh", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_MSG_WITH_OH, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_BUFFER_REFRESH, { "Buffer Refresh Flag", "sapdiag.dp.reqinfo.buffer_refresh", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_BUFFER_REFRESH, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_BTC_SCHEDULER, { "BTC Scheduler Flag", "sapdiag.dp.reqinfo.btc_scheduler", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_BTC_SCHEDULER, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_APPC_SERVER_DOWN, { "APPC Server Down Flag", "sapdiag.dp.reqinfo.appc_server_down", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_APPC_SERVER_DOWN, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_MS_ERROR, { "MS Error Flag", "sapdiag.dp.reqinfo.ms_error", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_MS_ERROR, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_SET_SYSTEM_USER, { "Set System User Flag", "sapdiag.dp.reqinfo.set_system_user", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_SET_SYSTEM_USER, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_CANT_HANDLE_REQ, { "DP Can't handle req Flag", "sapdiag.dp.reqinfo.dp_cant_handle_req", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_CANT_HANDLE_REQ, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_AUTO_ABAP, { "DP Auto ABAP Flag", "sapdiag.dp.reqinfo.dp_auto_abap", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_AUTO_ABAP, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_APPL_SERV_INFO, { "DP Appl Serv Info Flag", "sapdiag.dp.reqinfo.dp_appl_serv_info", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_APPL_SERV_INFO, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_ADMIN, { "DP Admin Flag", "sapdiag.dp.reqinfo.dp_admin", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_ADMIN, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_SPOOL_ALRM, { "DP Spool Alrm Flag", "sapdiag.dp.reqinfo.dp_spool_alrm", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_SPOOL_ALRM, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_HAND_SHAKE, { "DP Hand Shake Flag", "sapdiag.dp.reqinfo.dp_hand_shake", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_HAND_SHAKE, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_CANCEL_PRIV, { "DP Cancel Privileges Flag", "sapdiag.dp.reqinfo.dp_cancel_priv", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_CANCEL_PRIV, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_RAISE_TIMEOUT, { "DP Raise Timeout Flag", "sapdiag.dp.reqinfo.dp_raise_timeout", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_RAISE_TIMEOUT, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_NEW_MODE, { "DP New Mode Flag", "sapdiag.dp.reqinfo.dp_new_mode", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_NEW_MODE, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_SOFT_CANCEL, { "DP Soft Cancel Flag", "sapdiag.dp.reqinfo.dp_soft_cancel", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_SOFT_CANCEL, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_TM_INPUT, { "DP TM Input Flag", "sapdiag.dp.reqinfo.dp_tm_input", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_TM_INPUT, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_TM_OUTPUT, { "DP TM Output Flag", "sapdiag.dp.reqinfo.dp_tm_output", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_TM_OUTPUT, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_ASYNC_RFC, { "DP Async RFC Flag", "sapdiag.dp.reqinfo.dp_async_rfc", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_ASYNC_RFC, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_ICM_EVENT, { "DP ICM Event Flag", "sapdiag.dp.reqinfo.dp_icm_event", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_ICM_EVENT, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_AUTO_TH, { "DP Auto TH Flag", "sapdiag.dp.reqinfo.dp_auto_th", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_AUTO_TH, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_RFC_CANCEL, { "DP RFC Cancel Flag", "sapdiag.dp.reqinfo.dp_rfc_cancel", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_RFC_CANCEL, NULL, HFILL }}, { &hf_sapdiag_dp_req_info_DP_MS_ADM, { "DP MS Adm Flag", "sapdiag.dp.reqinfo.dp_ms_adm", FT_BOOLEAN, 8, NULL, SAPDIAG_DP_REQ_INFO_DP_MS_ADM, NULL, HFILL }}, { &hf_sapdiag_dp_tid, { "TID", "sapdiag.dp.tid", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_uid, { "UID", "sapdiag.dp.uid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_mode, { "Mode", "sapdiag.dp.mode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_wp_id, { "WP Id", "sapdiag.dp.wpid", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_wp_ca_blk, { "WP Ca Blk", "sapdiag.dp.wpcablk", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_appc_ca_blk, { "APPC Ca Blk", "sapdiag.dp.appccablk", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_len, { "Len", "sapdiag.dp.len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_new_stat, { "New Stat", "sapdiag.dp.newstat", FT_UINT8, BASE_HEX, VALS(sapdiag_dp_new_stat_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_rq_id, { "Request ID", "sapdiag.dp.rqid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_dp_terminal, { "Terminal", "sapdiag.dp.terminal", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* SAP Diag Support Bits */ { &hf_SAPDIAG_SUPPORT_BIT_PROGRESS_INDICATOR, { "Support Bit PROGRESS_INDICATOR", "sapdiag.diag.supportbits.PROGRESS_INDICATOR", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_PROGRESS_INDICATOR, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_LABELS, { "Support Bit SAPGUI_LABELS", "sapdiag.diag.supportbits.SAPGUI_LABELS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_LABELS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_DIAGVERSION, { "Support Bit SAPGUI_DIAGVERSION", "sapdiag.diag.supportbits.SAPGUI_DIAGVERSION", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_DIAGVERSION, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_SELECT_RECT, { "Support Bit SAPGUI_SELECT_RECT", "sapdiag.diag.supportbits.SAPGUI_SELECT_RECT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_SELECT_RECT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_SYMBOL_RIGHT, { "Support Bit SAPGUI_SYMBOL_RIGHT", "sapdiag.diag.supportbits.SAPGUI_SYMBOL_RIGHT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_SYMBOL_RIGHT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_FONT_METRIC, { "Support Bit SAPGUI_FONT_METRIC", "sapdiag.diag.supportbits.SAPGUI_FONT_METRIC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_FONT_METRIC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_COMPR_ENHANCED, { "Support Bit SAPGUI_COMPR_ENHANCED", "sapdiag.diag.supportbits.SAPGUI_COMPR_ENHANCED", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_COMPR_ENHANCED, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_IMODE, { "Support Bit SAPGUI_IMODE", "sapdiag.diag.supportbits.SAPGUI_IMODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_IMODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_LONG_MESSAGE, { "Support Bit SAPGUI_LONG_MESSAGE", "sapdiag.diag.supportbits.SAPGUI_LONG_MESSAGE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_LONG_MESSAGE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_TABLE, { "Support Bit SAPGUI_TABLE", "sapdiag.diag.supportbits.SAPGUI_TABLE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_TABLE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_FOCUS_1, { "Support Bit SAPGUI_FOCUS_1", "sapdiag.diag.supportbits.SAPGUI_FOCUS_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_FOCUS_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_PUSHBUTTON_1, { "Support Bit SAPGUI_PUSHBUTTON_1", "sapdiag.diag.supportbits.SAPGUI_PUSHBUTTON_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_PUSHBUTTON_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UPPERCASE, { "Support Bit UPPERCASE", "sapdiag.diag.supportbits.UPPERCASE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UPPERCASE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAPGUI_TABPROPERTY, { "Support Bit SAPGUI_TABPROPERTY", "sapdiag.diag.supportbits.SAPGUI_TABPROPERTY", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAPGUI_TABPROPERTY, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_INPUT_UPPERCASE, { "Support Bit INPUT_UPPERCASE", "sapdiag.diag.supportbits.INPUT_UPPERCASE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_INPUT_UPPERCASE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RFC_DIALOG, { "Support Bit RFC_DIALOG", "sapdiag.diag.supportbits.RFC_DIALOG", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RFC_DIALOG, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_LIST_HOTSPOT, { "Support Bit LIST_HOTSPOT", "sapdiag.diag.supportbits.LIST_HOTSPOT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_LIST_HOTSPOT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_FKEY_TABLE, { "Support Bit FKEY_TABLE", "sapdiag.diag.supportbits.FKEY_TABLE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_FKEY_TABLE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MENU_SHORTCUT, { "Support Bit MENU_SHORTCUT", "sapdiag.diag.supportbits.MENU_SHORTCUT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MENU_SHORTCUT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_STOP_TRANS, { "Support Bit STOP_TRANS", "sapdiag.diag.supportbits.STOP_TRANS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_STOP_TRANS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_FULL_MENU, { "Support Bit FULL_MENU", "sapdiag.diag.supportbits.FULL_MENU", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_FULL_MENU, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES, { "Support Bit OBJECT_NAMES", "sapdiag.diag.supportbits.OBJECT_NAMES", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_OBJECT_NAMES, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTAINER_TYPE, { "Support Bit CONTAINER_TYPE", "sapdiag.diag.supportbits.CONTAINER_TYPE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTAINER_TYPE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DLGH_FLAGS, { "Support Bit DLGH_FLAGS", "sapdiag.diag.supportbits.DLGH_FLAGS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DLGH_FLAGS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_APPL_MNU, { "Support Bit APPL_MNU", "sapdiag.diag.supportbits.APPL_MNU", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_APPL_MNU, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO, { "Support Bit MESSAGE_INFO", "sapdiag.diag.supportbits.MESSAGE_INFO", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESSAGE_INFO, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESDUM_FLAG1, { "Support Bit MESDUM_FLAG1", "sapdiag.diag.supportbits.MESDUM_FLAG1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESDUM_FLAG1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB, { "Support Bit TABSEL_ATTRIB", "sapdiag.diag.supportbits.TABSEL_ATTRIB", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUIAPI, { "Support Bit GUIAPI", "sapdiag.diag.supportbits.GUIAPI", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUIAPI, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NOGRAPH, { "Support Bit NOGRAPH", "sapdiag.diag.supportbits.NOGRAPH", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NOGRAPH, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NOMESSAGES, { "Support Bit NOMESSAGES", "sapdiag.diag.supportbits.NOMESSAGES", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NOMESSAGES, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NORABAX, { "Support Bit NORABAX", "sapdiag.diag.supportbits.NORABAX", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NORABAX, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NOSYSMSG, { "Support Bit NOSYSMSG", "sapdiag.diag.supportbits.NOSYSMSG", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NOSYSMSG, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NOSAPSCRIPT, { "Support Bit NOSAPSCRIPT", "sapdiag.diag.supportbits.NOSAPSCRIPT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NOSAPSCRIPT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NORFC, { "Support Bit NORFC", "sapdiag.diag.supportbits.NORFC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NORFC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NEW_BSD_JUSTRIGHT, { "Support Bit NEW_BSD_JUSTRIGHT", "sapdiag.diag.supportbits.NEW_BSD_JUSTRIGHT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NEW_BSD_JUSTRIGHT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESSAGE_VARS, { "Support Bit MESSAGE_VARS", "sapdiag.diag.supportbits.MESSAGE_VARS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESSAGE_VARS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_OCX_SUPPORT, { "Support Bit OCX_SUPPORT", "sapdiag.diag.supportbits.OCX_SUPPORT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_OCX_SUPPORT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SCROLL_INFOS, { "Support Bit SCROLL_INFOS", "sapdiag.diag.supportbits.SCROLL_INFOS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SCROLL_INFOS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABLE_SIZE_OK, { "Support Bit TABLE_SIZE_OK", "sapdiag.diag.supportbits.TABLE_SIZE_OK", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABLE_SIZE_OK, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO2, { "Support Bit MESSAGE_INFO2", "sapdiag.diag.supportbits.MESSAGE_INFO2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESSAGE_INFO2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_VARINFO_OKCODE, { "Support Bit VARINFO_OKCODE", "sapdiag.diag.supportbits.VARINFO_OKCODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_VARINFO_OKCODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CURR_TCODE, { "Support Bit CURR_TCODE", "sapdiag.diag.supportbits.CURR_TCODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CURR_TCODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONN_WSIZE, { "Support Bit CONN_WSIZE", "sapdiag.diag.supportbits.CONN_WSIZE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONN_WSIZE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_PUSHBUTTON_2, { "Support Bit PUSHBUTTON_2", "sapdiag.diag.supportbits.PUSHBUTTON_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_PUSHBUTTON_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABSTRIP, { "Support Bit TABSTRIP", "sapdiag.diag.supportbits.TABSTRIP", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABSTRIP, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_1, { "Support Bit UNKNOWN_1", "sapdiag.diag.supportbits.UNKNOWN_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNKNOWN_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABSCROLL_INFOS, { "Support Bit TABSCROLL_INFOS", "sapdiag.diag.supportbits.TABSCROLL_INFOS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABSCROLL_INFOS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABLE_FIELD_NAMES, { "Support Bit TABLE_FIELD_NAMES", "sapdiag.diag.supportbits.TABLE_FIELD_NAMES", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABLE_FIELD_NAMES, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NEW_MODE_REQUEST, { "Support Bit NEW_MODE_REQUEST", "sapdiag.diag.supportbits.NEW_MODE_REQUEST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NEW_MODE_REQUEST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RFCBLOB_DIAG_PARSER, { "Support Bit RFCBLOB_DIAG_PARSER", "sapdiag.diag.supportbits.RFCBLOB_DIAG_PARSER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RFCBLOB_DIAG_PARSER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MULTI_LOGIN_USER, { "Support Bit MULTI_LOGIN_USER", "sapdiag.diag.supportbits.MULTI_LOGIN_USER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MULTI_LOGIN_USER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTROL_CONTAINER, { "Support Bit CONTROL_CONTAINER", "sapdiag.diag.supportbits.CONTROL_CONTAINER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTROL_CONTAINER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_APPTOOLBAR_FIXED, { "Support Bit APPTOOLBAR_FIXED", "sapdiag.diag.supportbits.APPTOOLBAR_FIXED", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_APPTOOLBAR_FIXED, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_USER_CHECKED, { "Support Bit R3INFO_USER_CHECKED", "sapdiag.diag.supportbits.R3INFO_USER_CHECKED", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_USER_CHECKED, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NEED_STDDYNPRO, { "Support Bit NEED_STDDYNPRO", "sapdiag.diag.supportbits.NEED_STDDYNPRO", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NEED_STDDYNPRO, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TYPE_SERVER, { "Support Bit TYPE_SERVER", "sapdiag.diag.supportbits.TYPE_SERVER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TYPE_SERVER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_COMBOBOX, { "Support Bit COMBOBOX", "sapdiag.diag.supportbits.COMBOBOX", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_COMBOBOX, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_INPUT_REQUIRED, { "Support Bit INPUT_REQUIRED", "sapdiag.diag.supportbits.INPUT_REQUIRED", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_INPUT_REQUIRED, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ISO_LANGUAGE, { "Support Bit ISO_LANGUAGE", "sapdiag.diag.supportbits.ISO_LANGUAGE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ISO_LANGUAGE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_COMBOBOX_TABLE, { "Support Bit COMBOBOX_TABLE", "sapdiag.diag.supportbits.COMBOBOX_TABLE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_COMBOBOX_TABLE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS, { "Support Bit R3INFO_FLAGS", "sapdiag.diag.supportbits.R3INFO_FLAGS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CHECKRADIO_EVENTS, { "Support Bit CHECKRADIO_EVENTS", "sapdiag.diag.supportbits.CHECKRADIO_EVENTS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CHECKRADIO_EVENTS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_USERID, { "Support Bit R3INFO_USERID", "sapdiag.diag.supportbits.R3INFO_USERID", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_USERID, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_ROLLCOUNT, { "Support Bit R3INFO_ROLLCOUNT", "sapdiag.diag.supportbits.R3INFO_ROLLCOUNT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_ROLLCOUNT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_USER_TURNTIME2, { "Support Bit USER_TURNTIME2", "sapdiag.diag.supportbits.USER_TURNTIME2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_USER_TURNTIME2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NUM_FIELD, { "Support Bit NUM_FIELD", "sapdiag.diag.supportbits.NUM_FIELD", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NUM_FIELD, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_WIN16, { "Support Bit WIN16", "sapdiag.diag.supportbits.WIN16", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_WIN16, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTEXT_MENU, { "Support Bit CONTEXT_MENU", "sapdiag.diag.supportbits.CONTEXT_MENU", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTEXT_MENU, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SCROLLABLE_TABSTRIP_PAGE, { "Support Bit SCROLLABLE_TABSTRIP_PAGE", "sapdiag.diag.supportbits.SCROLLABLE_TABSTRIP_PAGE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SCROLLABLE_TABSTRIP_PAGE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION, { "Support Bit EVENT_DESCRIPTION", "sapdiag.diag.supportbits.EVENT_DESCRIPTION", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_LABEL_OWNER, { "Support Bit LABEL_OWNER", "sapdiag.diag.supportbits.LABEL_OWNER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_LABEL_OWNER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CLICKABLE_FIELD, { "Support Bit CLICKABLE_FIELD", "sapdiag.diag.supportbits.CLICKABLE_FIELD", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CLICKABLE_FIELD, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_PROPERTY_BAG, { "Support Bit PROPERTY_BAG", "sapdiag.diag.supportbits.PROPERTY_BAG", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_PROPERTY_BAG, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNUSED_1, { "Support Bit UNUSED_1", "sapdiag.diag.supportbits.UNUSED_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNUSED_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABLE_ROW_REFERENCES_2, { "Support Bit TABLE_ROW_REFERENCES_2", "sapdiag.diag.supportbits.TABLE_ROW_REFERENCES_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABLE_ROW_REFERENCES_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_PROPFONT_VALID, { "Support Bit PROPFONT_VALID", "sapdiag.diag.supportbits.PROPFONT_VALID", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_PROPFONT_VALID, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER, { "Support Bit VARINFO_CONTAINER", "sapdiag.diag.supportbits.VARINFO_CONTAINER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_IMODEUUID, { "Support Bit R3INFO_IMODEUUID", "sapdiag.diag.supportbits.R3INFO_IMODEUUID", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_IMODEUUID, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NOTGUI, { "Support Bit NOTGUI", "sapdiag.diag.supportbits.NOTGUI", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NOTGUI, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_WAN, { "Support Bit WAN", "sapdiag.diag.supportbits.WAN", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_WAN, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XML_BLOBS, { "Support Bit XML_BLOBS", "sapdiag.diag.supportbits.XML_BLOBS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XML_BLOBS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RFC_QUEUE, { "Support Bit RFC_QUEUE", "sapdiag.diag.supportbits.RFC_QUEUE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RFC_QUEUE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RFC_COMPRESS, { "Support Bit RFC_COMPRESS", "sapdiag.diag.supportbits.RFC_COMPRESS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RFC_COMPRESS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_JAVA_BEANS, { "Support Bit JAVA_BEANS", "sapdiag.diag.supportbits.JAVA_BEANS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_JAVA_BEANS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND, { "Support Bit DPLOADONDEMAND", "sapdiag.diag.supportbits.DPLOADONDEMAND", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CTL_PROPCACHE, { "Support Bit CTL_PROPCACHE", "sapdiag.diag.supportbits.CTL_PROPCACHE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CTL_PROPCACHE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID, { "Support Bit ENJOY_IMODEUUID", "sapdiag.diag.supportbits.ENJOY_IMODEUUID", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RFC_ASYNC_BLOB, { "Support Bit RFC_ASYNC_BLOB", "sapdiag.diag.supportbits.RFC_ASYNC_BLOB", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RFC_ASYNC_BLOB, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_KEEP_SCROLLPOS, { "Support Bit KEEP_SCROLLPOS", "sapdiag.diag.supportbits.KEEP_SCROLLPOS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_KEEP_SCROLLPOS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNUSED_2, { "Support Bit UNUSED_2", "sapdiag.diag.supportbits.UNUSED_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNUSED_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNUSED_3, { "Support Bit UNUSED_3", "sapdiag.diag.supportbits.UNUSED_3", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNUSED_3, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XML_PROPERTIES, { "Support Bit XML_PROPERTIES", "sapdiag.diag.supportbits.XML_PROPERTIES", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XML_PROPERTIES, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNUSED_4, { "Support Bit UNUSED_4", "sapdiag.diag.supportbits.UNUSED_4", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNUSED_4, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_HEX_FIELD, { "Support Bit HEX_FIELD", "sapdiag.diag.supportbits.HEX_FIELD", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_HEX_FIELD, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_HAS_CACHE, { "Support Bit HAS_CACHE", "sapdiag.diag.supportbits.HAS_CACHE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_HAS_CACHE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE, { "Support Bit XML_PROP_TABLE", "sapdiag.diag.supportbits.XML_PROP_TABLE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNUSED_5, { "Support Bit UNUSED_5", "sapdiag.diag.supportbits.UNUSED_5", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNUSED_5, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID2, { "Support Bit ENJOY_IMODEUUID2", "sapdiag.diag.supportbits.ENJOY_IMODEUUID2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ITS, { "Support Bit ITS", "sapdiag.diag.supportbits.ITS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ITS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NO_EASYACCESS, { "Support Bit NO_EASYACCESS", "sapdiag.diag.supportbits.NO_EASYACCESS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NO_EASYACCESS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_PROPERTYPUMP, { "Support Bit PROPERTYPUMP", "sapdiag.diag.supportbits.PROPERTYPUMP", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_PROPERTYPUMP, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_COOKIE, { "Support Bit COOKIE", "sapdiag.diag.supportbits.COOKIE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_COOKIE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNUSED_6, { "Support Bit UNUSED_6", "sapdiag.diag.supportbits.UNUSED_6", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNUSED_6, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SUPPBIT_AREA_SIZE, { "Support Bit SUPPBIT_AREA_SIZE", "sapdiag.diag.supportbits.SUPPBIT_AREA_SIZE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SUPPBIT_AREA_SIZE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND_WRITE, { "Support Bit DPLOADONDEMAND_WRITE", "sapdiag.diag.supportbits.DPLOADONDEMAND_WRITE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DPLOADONDEMAND_WRITE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS, { "Support Bit CONTROL_FOCUS", "sapdiag.diag.supportbits.CONTROL_FOCUS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENTRY_HISTORY, { "Support Bit ENTRY_HISTORY", "sapdiag.diag.supportbits.ENTRY_HISTORY", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENTRY_HISTORY, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AUTO_CODEPAGE, { "Support Bit AUTO_CODEPAGE", "sapdiag.diag.supportbits.AUTO_CODEPAGE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AUTO_CODEPAGE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CACHED_VSETS, { "Support Bit CACHED_VSETS", "sapdiag.diag.supportbits.CACHED_VSETS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CACHED_VSETS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EMERGENCY_REPAIR, { "Support Bit EMERGENCY_REPAIR", "sapdiag.diag.supportbits.EMERGENCY_REPAIR", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EMERGENCY_REPAIR, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AREA2FRONT, { "Support Bit AREA2FRONT", "sapdiag.diag.supportbits.AREA2FRONT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AREA2FRONT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SCROLLBAR_WIDTH, { "Support Bit SCROLLBAR_WIDTH", "sapdiag.diag.supportbits.SCROLLBAR_WIDTH", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SCROLLBAR_WIDTH, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AUTORESIZE, { "Support Bit AUTORESIZE", "sapdiag.diag.supportbits.AUTORESIZE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AUTORESIZE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EDIT_VARLEN, { "Support Bit EDIT_VARLEN", "sapdiag.diag.supportbits.EDIT_VARLEN", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EDIT_VARLEN, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_WORKPLACE, { "Support Bit WORKPLACE", "sapdiag.diag.supportbits.WORKPLACE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_WORKPLACE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_PRINTDATA, { "Support Bit PRINTDATA", "sapdiag.diag.supportbits.PRINTDATA", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_PRINTDATA, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_2, { "Support Bit UNKNOWN_2", "sapdiag.diag.supportbits.UNKNOWN_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNKNOWN_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SINGLE_SESSION, { "Support Bit SINGLE_SESSION", "sapdiag.diag.supportbits.SINGLE_SESSION", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SINGLE_SESSION, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NOTIFY_NEWMODE, { "Support Bit NOTIFY_NEWMODE", "sapdiag.diag.supportbits.NOTIFY_NEWMODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NOTIFY_NEWMODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TOOLBAR_HEIGHT, { "Support Bit TOOLBAR_HEIGHT", "sapdiag.diag.supportbits.TOOLBAR_HEIGHT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TOOLBAR_HEIGHT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XMLPROP_CONTAINER, { "Support Bit XMLPROP_CONTAINER", "sapdiag.diag.supportbits.XMLPROP_CONTAINER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XMLPROP_CONTAINER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XMLPROP_DYNPRO, { "Support Bit XMLPROP_DYNPRO", "sapdiag.diag.supportbits.XMLPROP_DYNPRO", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XMLPROP_DYNPRO, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DP_HTTP_PUT, { "Support Bit DP_HTTP_PUT", "sapdiag.diag.supportbits.DP_HTTP_PUT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DP_HTTP_PUT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DYNAMIC_PASSPORT, { "Support Bit DYNAMIC_PASSPORT", "sapdiag.diag.supportbits.DYNAMIC_PASSPORT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DYNAMIC_PASSPORT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_WEBGUI, { "Support Bit WEBGUI", "sapdiag.diag.supportbits.WEBGUI", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_WEBGUI, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_WEBGUI_HELPMODE, { "Support Bit WEBGUI_HELPMODE", "sapdiag.diag.supportbits.WEBGUI_HELPMODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_WEBGUI_HELPMODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST, { "Support Bit CONTROL_FOCUS_ON_LIST", "sapdiag.diag.supportbits.CONTROL_FOCUS_ON_LIST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_2, { "Support Bit CBU_RBUDUMMY_2", "sapdiag.diag.supportbits.CBU_RBUDUMMY_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EOKDUMMY_1, { "Support Bit EOKDUMMY_1", "sapdiag.diag.supportbits.EOKDUMMY_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EOKDUMMY_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING, { "Support Bit GUI_USER_SCRIPTING", "sapdiag.diag.supportbits.GUI_USER_SCRIPTING", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SLC, { "Support Bit SLC", "sapdiag.diag.supportbits.SLC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SLC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ACCESSIBILITY, { "Support Bit ACCESSIBILITY", "sapdiag.diag.supportbits.ACCESSIBILITY", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ACCESSIBILITY, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ECATT, { "Support Bit ECATT", "sapdiag.diag.supportbits.ECATT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ECATT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID3, { "Support Bit ENJOY_IMODEUUID3", "sapdiag.diag.supportbits.ENJOY_IMODEUUID3", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENJOY_IMODEUUID3, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF8, { "Support Bit ENABLE_UTF8", "sapdiag.diag.supportbits.ENABLE_UTF8", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENABLE_UTF8, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_AUTOLOGOUT_TIME, { "Support Bit R3INFO_AUTOLOGOUT_TIME", "sapdiag.diag.supportbits.R3INFO_AUTOLOGOUT_TIME", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_AUTOLOGOUT_TIME, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_VARINFO_ICON_TITLE_LIST, { "Support Bit VARINFO_ICON_TITLE_LIST", "sapdiag.diag.supportbits.VARINFO_ICON_TITLE_LIST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_VARINFO_ICON_TITLE_LIST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF16BE, { "Support Bit ENABLE_UTF16BE", "sapdiag.diag.supportbits.ENABLE_UTF16BE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENABLE_UTF16BE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENABLE_UTF16LE, { "Support Bit ENABLE_UTF16LE", "sapdiag.diag.supportbits.ENABLE_UTF16LE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENABLE_UTF16LE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP, { "Support Bit R3INFO_CODEPAGE_APP", "sapdiag.diag.supportbits.R3INFO_CODEPAGE_APP", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ENABLE_APPL4, { "Support Bit ENABLE_APPL4", "sapdiag.diag.supportbits.ENABLE_APPL4", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ENABLE_APPL4, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL, { "Support Bit GUIPATCHLEVEL", "sapdiag.diag.supportbits.GUIPATCHLEVEL", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CBURBU_NEW_STATE, { "Support Bit CBURBU_NEW_STATE", "sapdiag.diag.supportbits.CBURBU_NEW_STATE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CBURBU_NEW_STATE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_BINARY_EVENTID, { "Support Bit BINARY_EVENTID", "sapdiag.diag.supportbits.BINARY_EVENTID", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_BINARY_EVENTID, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUI_THEME, { "Support Bit GUI_THEME", "sapdiag.diag.supportbits.GUI_THEME", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUI_THEME, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TOP_WINDOW, { "Support Bit TOP_WINDOW", "sapdiag.diag.supportbits.TOP_WINDOW", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TOP_WINDOW, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION_1, { "Support Bit EVENT_DESCRIPTION_1", "sapdiag.diag.supportbits.EVENT_DESCRIPTION_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EVENT_DESCRIPTION_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SPLITTER, { "Support Bit SPLITTER", "sapdiag.diag.supportbits.SPLITTER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SPLITTER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_VALUE_4_HISTORY, { "Support Bit VALUE_4_HISTORY", "sapdiag.diag.supportbits.VALUE_4_HISTORY", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_VALUE_4_HISTORY, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ACC_LIST, { "Support Bit ACC_LIST", "sapdiag.diag.supportbits.ACC_LIST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ACC_LIST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING_INFO, { "Support Bit GUI_USER_SCRIPTING_INFO", "sapdiag.diag.supportbits.GUI_USER_SCRIPTING_INFO", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUI_USER_SCRIPTING_INFO, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TEXTEDIT_STREAM, { "Support Bit TEXTEDIT_STREAM", "sapdiag.diag.supportbits.TEXTEDIT_STREAM", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TEXTEDIT_STREAM, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DYNT_NOFOCUS, { "Support Bit DYNT_NOFOCUS", "sapdiag.diag.supportbits.DYNT_NOFOCUS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DYNT_NOFOCUS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP_1, { "Support Bit R3INFO_CODEPAGE_APP_1", "sapdiag.diag.supportbits.R3INFO_CODEPAGE_APP_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_CODEPAGE_APP_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_FRAME_1, { "Support Bit FRAME_1", "sapdiag.diag.supportbits.FRAME_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_FRAME_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TICKET4GUI, { "Support Bit TICKET4GUI", "sapdiag.diag.supportbits.TICKET4GUI", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TICKET4GUI, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ACC_LIST_PROPS, { "Support Bit ACC_LIST_PROPS", "sapdiag.diag.supportbits.ACC_LIST_PROPS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ACC_LIST_PROPS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB_INPUT, { "Support Bit TABSEL_ATTRIB_INPUT", "sapdiag.diag.supportbits.TABSEL_ATTRIB_INPUT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABSEL_ATTRIB_INPUT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DEFAULT_TOOLTIP, { "Support Bit DEFAULT_TOOLTIP", "sapdiag.diag.supportbits.DEFAULT_TOOLTIP", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DEFAULT_TOOLTIP, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE_2, { "Support Bit XML_PROP_TABLE_2", "sapdiag.diag.supportbits.XML_PROP_TABLE_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XML_PROP_TABLE_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_3, { "Support Bit CBU_RBUDUMMY_3", "sapdiag.diag.supportbits.CBU_RBUDUMMY_3", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CBU_RBUDUMMY_3, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CELLINFO, { "Support Bit CELLINFO", "sapdiag.diag.supportbits.CELLINFO", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CELLINFO, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST_2, { "Support Bit CONTROL_FOCUS_ON_LIST_2", "sapdiag.diag.supportbits.CONTROL_FOCUS_ON_LIST_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTROL_FOCUS_ON_LIST_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TABLE_COLUMNWIDTH_INPUT, { "Support Bit TABLE_COLUMNWIDTH_INPUT", "sapdiag.diag.supportbits.TABLE_COLUMNWIDTH_INPUT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TABLE_COLUMNWIDTH_INPUT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ITS_PLUGIN, { "Support Bit ITS_PLUGIN", "sapdiag.diag.supportbits.ITS_PLUGIN", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ITS_PLUGIN, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_4_LOGIN_PROCESS, { "Support Bit OBJECT_NAMES_4_LOGIN_PROCESS", "sapdiag.diag.supportbits.OBJECT_NAMES_4_LOGIN_PROCESS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_4_LOGIN_PROCESS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RFC_SERVER_4_GUI, { "Support Bit RFC_SERVER_4_GUI", "sapdiag.diag.supportbits.RFC_SERVER_4_GUI", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RFC_SERVER_4_GUI, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS_2, { "Support Bit R3INFO_FLAGS_2", "sapdiag.diag.supportbits.R3INFO_FLAGS_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_FLAGS_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_RCUI, { "Support Bit RCUI", "sapdiag.diag.supportbits.RCUI", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_RCUI, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MENUENTRY_WITH_FCODE, { "Support Bit MENUENTRY_WITH_FCODE", "sapdiag.diag.supportbits.MENUENTRY_WITH_FCODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MENUENTRY_WITH_FCODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_WEBSAPCONSOLE, { "Support Bit WEBSAPCONSOLE", "sapdiag.diag.supportbits.WEBSAPCONSOLE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_WEBSAPCONSOLE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_R3INFO_KERNEL_VERSION, { "Support Bit R3INFO_KERNEL_VERSION", "sapdiag.diag.supportbits.R3INFO_KERNEL_VERSION", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_R3INFO_KERNEL_VERSION, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_LOOP, { "Support Bit VARINFO_CONTAINER_LOOP", "sapdiag.diag.supportbits.VARINFO_CONTAINER_LOOP", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_LOOP, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EOKDUMMY_2, { "Support Bit EOKDUMMY_2", "sapdiag.diag.supportbits.EOKDUMMY_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EOKDUMMY_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESSAGE_INFO3, { "Support Bit MESSAGE_INFO3", "sapdiag.diag.supportbits.MESSAGE_INFO3", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESSAGE_INFO3, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SBA2, { "Support Bit SBA2", "sapdiag.diag.supportbits.SBA2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SBA2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MAINAREA_SIZE, { "Support Bit MAINAREA_SIZE", "sapdiag.diag.supportbits.MAINAREA_SIZE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MAINAREA_SIZE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL_2, { "Support Bit GUIPATCHLEVEL_2", "sapdiag.diag.supportbits.GUIPATCHLEVEL_2", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUIPATCHLEVEL_2, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DISPLAY_SIZE, { "Support Bit DISPLAY_SIZE", "sapdiag.diag.supportbits.DISPLAY_SIZE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DISPLAY_SIZE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUI_PACKET, { "Support Bit GUI_PACKET", "sapdiag.diag.supportbits.GUI_PACKET", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUI_PACKET, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DIALOG_STEP_NUMBER, { "Support Bit DIALOG_STEP_NUMBER", "sapdiag.diag.supportbits.DIALOG_STEP_NUMBER", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DIALOG_STEP_NUMBER, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TC_KEEP_SCROLL_POSITION, { "Support Bit TC_KEEP_SCROLL_POSITION", "sapdiag.diag.supportbits.TC_KEEP_SCROLL_POSITION", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TC_KEEP_SCROLL_POSITION, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESSAGE_SERVICE_REQUEST, { "Support Bit MESSAGE_SERVICE_REQUEST", "sapdiag.diag.supportbits.MESSAGE_SERVICE_REQUEST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESSAGE_SERVICE_REQUEST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_DYNT_FOCUS_FRAME, { "Support Bit DYNT_FOCUS_FRAME", "sapdiag.diag.supportbits.DYNT_FOCUS_FRAME", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_DYNT_FOCUS_FRAME, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MAX_STRING_LEN, { "Support Bit MAX_STRING_LEN", "sapdiag.diag.supportbits.MAX_STRING_LEN", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MAX_STRING_LEN, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_1, { "Support Bit VARINFO_CONTAINER_1", "sapdiag.diag.supportbits.VARINFO_CONTAINER_1", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_VARINFO_CONTAINER_1, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_STD_TOOLBAR_ITEMS, { "Support Bit STD_TOOLBAR_ITEMS", "sapdiag.diag.supportbits.STD_TOOLBAR_ITEMS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_STD_TOOLBAR_ITEMS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_XMLPROP_LIST_DYNPRO, { "Support Bit XMLPROP_LIST_DYNPRO", "sapdiag.diag.supportbits.XMLPROP_LIST_DYNPRO", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_XMLPROP_LIST_DYNPRO, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_TRACE_GUI_CONNECT, { "Support Bit TRACE_GUI_CONNECT", "sapdiag.diag.supportbits.TRACE_GUI_CONNECT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_TRACE_GUI_CONNECT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_LIST_FULLWIDTH, { "Support Bit LIST_FULLWIDTH", "sapdiag.diag.supportbits.LIST_FULLWIDTH", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_LIST_FULLWIDTH, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_ALLWAYS_SEND_CLIENT, { "Support Bit ALLWAYS_SEND_CLIENT", "sapdiag.diag.supportbits.ALLWAYS_SEND_CLIENT", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_ALLWAYS_SEND_CLIENT, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_UNKNOWN_3, { "Support Bit UNKNOWN_3", "sapdiag.diag.supportbits.UNKNOWN_3", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_UNKNOWN_3, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUI_SIGNATURE_COLOR, { "Support Bit GUI_SIGNATURE_COLOR", "sapdiag.diag.supportbits.GUI_SIGNATURE_COLOR", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUI_SIGNATURE_COLOR, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MAX_WSIZE, { "Support Bit MAX_WSIZE", "sapdiag.diag.supportbits.MAX_WSIZE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MAX_WSIZE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_SAP_PERSONAS, { "Support Bit SAP_PERSONAS", "sapdiag.diag.supportbits.SAP_PERSONAS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_SAP_PERSONAS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_IDA_ALV, { "Support Bit IDA_ALV", "sapdiag.diag.supportbits.IDA_ALV", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_IDA_ALV, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_IDA_ALV_FRAGMENTS, { "Support Bit IDA_ALV_FRAGMENTS", "sapdiag.diag.supportbits.IDA_ALV_FRAGMENTS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_IDA_ALV_FRAGMENTS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AMC, { "Support Bit AMC", "sapdiag.diag.supportbits.AMC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AMC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_EXTMODE_FONT_METRIC, { "Support Bit EXTMODE_FONT_METRIC", "sapdiag.diag.supportbits.EXTMODE_FONT_METRIC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_EXTMODE_FONT_METRIC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GROUPBOX, { "Support Bit GROUPBOX", "sapdiag.diag.supportbits.GROUPBOX", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GROUPBOX, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AGI_ID_TS_BUTTON, { "Support Bit AGI_ID_TS_BUTTON", "sapdiag.diag.supportbits.AGI_ID_TS_BUTTON", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AGI_ID_TS_BUTTON, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NO_FOCUS_ON_LIST, { "Support Bit NO_FOCUS_ON_LIST", "sapdiag.diag.supportbits.NO_FOCUS_ON_LIST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NO_FOCUS_ON_LIST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_FIORI_MODE, { "Support Bit FIORI_MODE", "sapdiag.diag.supportbits.FIORI_MODE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_FIORI_MODE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONNECT_CHECK_DONE, { "Support Bit CONNECT_CHECK_DONE", "sapdiag.diag.supportbits.CONNECT_CHECK_DONE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONNECT_CHECK_DONE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MSGINFO_WITH_CODEPAGE, { "Support Bit MSGINFO_WITH_CODEPAGE", "sapdiag.diag.supportbits.MSGINFO_WITH_CODEPAGE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MSGINFO_WITH_CODEPAGE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AGI_ID, { "Support Bit AGI_ID", "sapdiag.diag.supportbits.AGI_ID", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AGI_ID, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_AGI_ID_TC, { "Support Bit AGI_ID_TC", "sapdiag.diag.supportbits.AGI_ID_TC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_AGI_ID_TC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_FIORI_TOOLBARS, { "Support Bit FIORI_TOOLBARS", "sapdiag.diag.supportbits.FIORI_TOOLBARS", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_FIORI_TOOLBARS, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_ENFORCE, { "Support Bit OBJECT_NAMES_ENFORCE", "sapdiag.diag.supportbits.OBJECT_NAMES_ENFORCE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_OBJECT_NAMES_ENFORCE, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_MESDUMMY_FLAGS_2_3, { "Support Bit MESDUMMY_FLAGS_2_3", "sapdiag.diag.supportbits.MESDUMMY_FLAGS_2_3", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_MESDUMMY_FLAGS_2_3, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_NWBC, { "Support Bit NWBC", "sapdiag.diag.supportbits.NWBC", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_NWBC, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_CONTAINER_LIST, { "Support Bit CONTAINER_LIST", "sapdiag.diag.supportbits.CONTAINER_LIST", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_CONTAINER_LIST, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GUI_SYSTEM_COLOR, { "Support Bit GUI_SYSTEM_COLOR", "sapdiag.diag.supportbits.GUI_SYSTEM_COLOR", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GUI_SYSTEM_COLOR, NULL, HFILL }}, { &hf_SAPDIAG_SUPPORT_BIT_GROUPBOX_WITHOUT_BOTTOMLINE, { "Support Bit GROUPBOX_WITHOUT_BOTTOMLINE", "sapdiag.diag.supportbits.GROUPBOX_WITHOUT_BOTTOMLINE", FT_BOOLEAN, 8, NULL, SAPDIAG_SUPPORT_BIT_GROUPBOX_WITHOUT_BOTTOMLINE, NULL, HFILL }}, /* Dynt Atom */ { &hf_sapdiag_item_dynt_atom, { "Dynt Atom", "sapdiag.item.value.dyntatom", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item, { "Dynt Atom Item", "sapdiag.item.value.dyntatom.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_etype, { "Dynt Atom Item Type", "sapdiag.item.value.dyntatom.item.type", FT_UINT8, BASE_DEC, VALS(sapdiag_item_dynt_atom_item_etype_vals), 0x0, NULL, HFILL }}, /* Dynt Atom Attribute Flags */ { &hf_sapdiag_item_dynt_atom_item_attr, { "Dynt Atom Item Attributes", "sapdiag.item.value.dyntatom.item.attr", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_COMBOSTYLE, { "Dynt Atom Item Attribute Combo Style", "sapdiag.item.value.dyntatom.item.attr.COMBOSTYLE", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_COMBOSTYLE, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_YES3D, { "Dynt Atom Item Attribute Yes3D", "sapdiag.item.value.dyntatom.item.attr.YES3D", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_YES3D, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_PROPFONT, { "Dynt Atom Item Attribute Prop Font", "sapdiag.item.value.dyntatom.item.attr.PROPFONT", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_PROPFONT, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_MATCHCODE, { "Dynt Atom Item Attribute Match Code", "sapdiag.item.value.dyntatom.item.attr.MATCHCODE", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_MATCHCODE, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_JUSTRIGHT, { "Dynt Atom Item Attribute Just Right", "sapdiag.item.value.dyntatom.item.attr.JUSTRIGHT", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_JUSTRIGHT, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_INTENSIFY, { "Dynt Atom Item Attribute Intensify", "sapdiag.item.value.dyntatom.item.attr.INTENSIFY", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_INTENSIFY, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_INVISIBLE, { "Dynt Atom Item Attribute Invisible", "sapdiag.item.value.dyntatom.item.attr.INVISIBLE", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_INVISIBLE, NULL, HFILL }}, { &hf_sapdiag_item_dynt_atom_item_attr_DIAG_BSD_PROTECTED, { "Dynt Atom Item Attribute Protected", "sapdiag.item.value.dyntatom.item.attr.PROTECTED", FT_BOOLEAN, 8, NULL, SAPDIAG_ATOM_ATTR_DIAG_BSD_PROTECTED, NULL, HFILL }}, /* Control Properties fields */ { &hf_sapdiag_item_control_properties_id, { "Control Properties ID", "sapdiag.item.value.controlproperties.id", FT_UINT16, BASE_HEX, VALS(sapdiag_item_control_properties_id_vals), 0x0, NULL, HFILL }}, { &hf_sapdiag_item_control_properties_value, { "Control Properties Value", "sapdiag.item.value.controlproperties.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* UI Event Source fields */ { &ht_sapdiag_item_ui_event_event_type, { "UI Event Source Type", "sapdiag.item.value.uievent.type", FT_UINT16, BASE_DEC, VALS(sapdiag_item_ui_event_event_type_vals), 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_control_type, { "UI Event Control Type", "sapdiag.item.value.uievent.control", FT_UINT16, BASE_DEC, VALS(sapdiag_item_ui_event_control_type_vals), 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_valid, { "UI Event Valid", "sapdiag.item.value.uievent.valid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_valid_MENU_POS, { "UI Event Valid Menu Pos", "sapdiag.item.value.uievent.valid.MENU_POS", FT_BOOLEAN, 8, NULL, SAPDIAG_UI_EVENT_VALID_FLAG_MENU_POS, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_valid_CONTROL_POS, { "UI Event Valid Control Pos", "sapdiag.item.value.uievent.valid.CONTROL_POS", FT_BOOLEAN, 8, NULL, SAPDIAG_UI_EVENT_VALID_FLAG_CONTROL_POS, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_valid_NAVIGATION_DATA, { "UI Event Valid Navigation Data", "sapdiag.item.value.uievent.valid.NAVIGATION_DATA", FT_BOOLEAN, 8, NULL, SAPDIAG_UI_EVENT_VALID_FLAG_NAVIGATION_DATA, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_valid_FUNCTIONKEY_DATA, { "UI Event Valid Function Key Data", "sapdiag.item.value.uievent.valid.FUNCTIONKEY_DATA", FT_BOOLEAN, 8, NULL, SAPDIAG_UI_EVENT_VALID_FLAG_FUNCTIONKEY_DATA, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_control_row, { "UI Event Source Control Row", "sapdiag.item.value.uievent.controlrow", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_control_col, { "UI Event Source Control Column", "sapdiag.item.value.uievent.controlcol", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_navigation_data, { "UI Event Source Navigation Data", "sapdiag.item.value.uievent.navigationdata", FT_UINT32, BASE_DEC, VALS(sapdiag_item_ui_event_navigation_data_vals), 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_data, { "UI Event Source Data", "sapdiag.item.value.uievent.data", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_container_nrs, { "UI Event Source Container IDs Numbers", "sapdiag.item.value.uievent.containernrs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &ht_sapdiag_item_ui_event_container, { "UI Event Source Container ID", "sapdiag.item.value.uievent.container", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* Menu Entries */ { &hf_sapdiag_item_menu_entry, { "Menu Entry", "sapdiag.item.value.menu", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sapdiag }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_sapdiag_item_unknown, { "sapdiag.item.unknown", PI_UNDECODED, PI_WARN, "The Diag Item has a unknown type that is not dissected", EXPFILL }}, { &ei_sapdiag_item_partial, { "sapdiag.item.unknown", PI_UNDECODED, PI_WARN, "The Diag Item is dissected partially", EXPFILL }}, { &ei_sapdiag_item_unknown_length, { "sapdiag.item.length.unknown", PI_UNDECODED, PI_WARN, "Diag Type of unknown length", EXPFILL }}, { &ei_sapdiag_item_offset_invalid, { "sapdiag.item.offset.invalid", PI_MALFORMED, PI_ERROR, "Invalid offset", EXPFILL }}, { &ei_sapdiag_item_length_invalid, { "sapdiag.item.length.invalid", PI_MALFORMED, PI_WARN, "Item length is invalid", EXPFILL }}, { &ei_sapdiag_atom_item_unknown, { "sapdiag.item.value.dyntatom.item.unknown", PI_UNDECODED, PI_WARN, "The Diag Atom has a unknown type that is not dissected", EXPFILL }}, { &ei_sapdiag_atom_item_partial, { "sapdiag.item.value.dyntatom.item.unknown", PI_UNDECODED, PI_WARN, "The Diag Atom is dissected partially", EXPFILL }}, { &ei_sapdiag_atom_item_malformed, { "sapdiag.item.value.dyntatom.invalid", PI_MALFORMED, PI_WARN, "The Diag Atom is malformed", EXPFILL }}, { &ei_sapdiag_dynt_focus_more_cont_ids, { "sapdiag.item.value.uievent.containernrs.invalid", PI_MALFORMED, PI_WARN, "Number of Container IDs is invalid", EXPFILL }}, { &ei_sapdiag_password_field, { "sapdiag.item.value.dyntatom.item.password", PI_SECURITY, PI_WARN, "Password field?", EXPFILL }}, }; module_t *sapdiag_module; expert_module_t* sapdiag_expert; /* Register the protocol */ proto_sapdiag = proto_register_protocol("SAP Diag Protocol", "SAPDIAG", "sapdiag"); proto_register_field_array(proto_sapdiag, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sapdiag_expert = expert_register_protocol(proto_sapdiag); expert_register_field_array(sapdiag_expert, ei, array_length(ei)); register_dissector("sapdiag", dissect_sapdiag, proto_sapdiag); /* Register the preferences */ sapdiag_module = prefs_register_protocol(proto_sapdiag, proto_reg_handoff_sapdiag); range_convert_str(wmem_epan_scope(), &global_sapdiag_port_range, SAPDIAG_PORT_RANGE, MAX_TCP_PORT); prefs_register_range_preference(sapdiag_module, "tcp_ports", "SAP Diag Protocol TCP port numbers", "Port numbers used for SAP Diag Protocol (default " SAPDIAG_PORT_RANGE ")", &global_sapdiag_port_range, MAX_TCP_PORT); prefs_register_bool_preference(sapdiag_module, "rfc_dissection", "Dissect embedded SAP RFC calls", "Whether the SAP Diag Protocol dissector should call the SAP RFC dissector for embedded RFC calls", &global_sapdiag_rfc_dissection); prefs_register_bool_preference(sapdiag_module, "snc_dissection", "Dissect SAP SNC frames", "Whether the SAP Diag Protocol dissector should call the SAP SNC dissector for SNC frames", &global_sapdiag_snc_dissection); prefs_register_bool_preference(sapdiag_module, "highlight_unknown_items", "Highlight unknown SAP Diag Items", "Whether the SAP Diag Protocol dissector should highlight unknown SAP Diag item (might be noise and generate a lot of expert warnings)", &global_sapdiag_highlight_items); } /** * Helpers for dealing with the port range */ static void range_delete_callback (guint32 port, gpointer ptr _U_) { dissector_delete_uint("sapni.port", port, sapdiag_handle); } static void range_add_callback (guint32 port, gpointer ptr _U_) { dissector_add_uint("sapni.port", port, sapdiag_handle); } /** * Register Hand off for the SAP Diag Protocol */ void proto_reg_handoff_sapdiag(void) { static range_t *sapdiag_port_range; static gboolean initialized = FALSE; if (!initialized) { sapdiag_handle = create_dissector_handle(dissect_sapdiag, proto_sapdiag); initialized = TRUE; } else { range_foreach(sapdiag_port_range, range_delete_callback, NULL); wmem_free(wmem_epan_scope(), sapdiag_port_range); } sapdiag_port_range = range_copy(wmem_epan_scope(), global_sapdiag_port_range); range_foreach(sapdiag_port_range, range_add_callback, NULL); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sapenqueue.c
/* packet-sapenqueue.c * Routines for SAP Enqueue (Enqueue Server) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a dissector for the SAP Enqueue Server protocol. * * Some details and example requests can be found in pysap's documentation: https://pysap.readthedocs.io/en/latest/protocols/SAPEnqueue.html. */ #include <config.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/conversation.h> /* Enqueue Server Type values */ static const value_string sapenqueue_type_vals[] = { { 0, "SYNC_REQUEST" }, { 1, "ASYNC_REQUEST" }, { 2, "RESPONSE" }, /* NULL */ { 0, NULL } }; /* Enqueue Server Destination values */ static const value_string sapenqueue_dest_vals[] = { { 1, "SYNC_ENQUEUE" }, { 2, "ASYNC_ENQUEUE" }, { 3, "SERVER_ADMIN" }, { 5, "STAT_QUERY" }, { 6, "CONECTION_ADMIN" }, { 7, "ENQ_TO_REP" }, { 8, "REP_TO_ENQ" }, /* NULL */ { 0, NULL }, }; /* Enqueue Server Admin Opcode values */ static const value_string sapenqueue_server_admin_opcode_vals[] = { { 1, "EnAdmDummyRequest" }, { 2, "EnAdmShutdownRequest" }, { 4, "EnAdmGetReplInfoRequest" }, { 6, "EnAdmTraceRequest" }, /* NULL */ { 0, NULL }, }; /* Enqueue Server Connection Admin Trace Action values */ static const value_string sapenqueue_server_admin_trace_action_vals[] = { { 1, "Raise level" }, { 2, "Lower level" }, { 3, "Get trace state" }, { 4, "Set trace status" }, { 5, "Reset trace files" }, /* NULL */ { 0, NULL } }; /* Enqueue Server Connection Admin Trace Limit values */ static const value_string sapenqueue_server_admin_trace_limit_vals[] = { { 0, "Globally" }, { 1, "Only in enserver" }, { 2, "Only in repserver" }, { 3, "Only in threads of type" }, { 4, "Only in one thread of type" }, /* NULL */ { 0, NULL } }; /* Enqueue Server Connection Admin Trace Thread values */ static const value_string sapenqueue_server_admin_trace_thread_vals[] = { { 0, "All threads" }, { 1, "All I/O threads" }, { 2, "Enqueue Worker thread" }, { 3, "Replication thread" }, { 4, "ADM thread" }, { 5, "Signal thread" }, { 6, "Listener thread" }, /* NULL */ { 0, NULL } }; /* Enqueue Server Connection Admin Opcode values */ static const value_string sapenqueue_conn_admin_opcode_vals[] = { { 0, "Loopback packet" }, { 1, "Parameter Request" }, { 2, "Parameter Response" }, { 3, "Shutdown Read" }, { 4, "Shutdown Write" }, { 5, "Shutdown Both" }, { 6, "Keepalive" }, /* NULL */ { 0, NULL } }; /* Enqueue Server Connection Admin Parameter values */ static const value_string sapenqueue_conn_admin_param_vals[] = { { 0, "ENCPARAM_RECV_LEN" }, { 1, "ENCPARAM_SEND_LEN" }, { 2, "ENCPARAM_MSG_TYPE" }, { 3, "ENCPARAM_SET_NAME" }, { 4, "ENCPARAM_SET_NOSUPP" }, { 5, "ENCPARAM_SET_VERSION" }, { 6, "ENCPARAM_SET_UCSUPPORT" }, /* NULL */ { 0, NULL } }; static int proto_sapenqueue = -1; static int hf_sapenqueue_magic = -1; static int hf_sapenqueue_id = -1; static int hf_sapenqueue_length = -1; static int hf_sapenqueue_length_frag = -1; static int hf_sapenqueue_dest = -1; static int hf_sapenqueue_conn_admin_opcode = -1; static int hf_sapenqueue_more_frags = -1; static int hf_sapenqueue_type = -1; static int hf_sapenqueue_server_admin = -1; static int hf_sapenqueue_server_admin_eyecatcher = -1; static int hf_sapenqueue_server_admin_version = -1; static int hf_sapenqueue_server_admin_flag = -1; static int hf_sapenqueue_server_admin_length = -1; static int hf_sapenqueue_server_admin_opcode = -1; static int hf_sapenqueue_server_admin_flags = -1; static int hf_sapenqueue_server_admin_rc = -1; static int hf_sapenqueue_server_admin_value = -1; static int hf_sapenqueue_server_admin_trace_request = -1; static int hf_sapenqueue_server_admin_trace_protocol_version = -1; static int hf_sapenqueue_server_admin_trace_action = -1; static int hf_sapenqueue_server_admin_trace_limit = -1; static int hf_sapenqueue_server_admin_trace_thread = -1; static int hf_sapenqueue_server_admin_trace_level = -1; static int hf_sapenqueue_server_admin_trace_logging = -1; static int hf_sapenqueue_server_admin_trace_max_file_size = -1; static int hf_sapenqueue_server_admin_trace_nopatterns = -1; static int hf_sapenqueue_server_admin_trace_eyecatcher = -1; static int hf_sapenqueue_server_admin_trace_patterns = -1; static int hf_sapenqueue_server_admin_trace_unknown = -1; static int hf_sapenqueue_server_admin_trace_pattern = -1; static int hf_sapenqueue_server_admin_trace_pattern_len = -1; static int hf_sapenqueue_server_admin_trace_pattern_value = -1; static int hf_sapenqueue_conn_admin = -1; static int hf_sapenqueue_conn_admin_params_count = -1; static int hf_sapenqueue_conn_admin_params = -1; static int hf_sapenqueue_conn_admin_param = -1; static int hf_sapenqueue_conn_admin_param_id = -1; static int hf_sapenqueue_conn_admin_param_len = -1; static int hf_sapenqueue_conn_admin_param_value = -1; static int hf_sapenqueue_conn_admin_param_name = -1; static gint ett_sapenqueue = -1; /* Expert info */ static expert_field ei_sapenqueue_pattern_invalid_length= EI_INIT; static expert_field ei_sapenqueue_support_invalid_offset = EI_INIT; static expert_field ei_sapenqueue_support_invalid_length = EI_INIT; /* Protocol handle */ static dissector_handle_t sapenqueue_handle; /* * */ void proto_reg_handoff_sapenqueue(void); void proto_register_sapenqueue(void); static void dissect_sapenqueue_server_admin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset){ guint8 opcode = 0; proto_item *server_admin = NULL; proto_tree *server_admin_tree = NULL; server_admin = proto_tree_add_item(tree, hf_sapenqueue_server_admin, tvb, offset, -1, ENC_NA); server_admin_tree = proto_item_add_subtree(server_admin, ett_sapenqueue); proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_eyecatcher, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; offset += 3; /* Unknown bytes */ proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_eyecatcher, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_flag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; opcode = tvb_get_guint8(tvb, offset); proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_flags, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_rc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_eyecatcher, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; if (tvb_reported_length_remaining(tvb, offset) > 0){ switch(opcode){ case 0x06:{ /* EnAdmTraceRequest */ guint8 pattern_length = 0; guint32 nopatterns = 0, total_length = 0; proto_item *trace_request = NULL, *trace_request_patterns = NULL, *trace_request_pattern = NULL; proto_tree *trace_request_tree = NULL, *trace_request_patterns_tree = NULL, *trace_request_pattern_tree = NULL; trace_request = proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_trace_request, tvb, offset, -1, ENC_NA); trace_request_tree = proto_item_add_subtree(trace_request, ett_sapenqueue); proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_protocol_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_action, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_limit, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_thread, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_unknown, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_level, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_unknown, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_logging, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_max_file_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; nopatterns = tvb_get_ntohl(tvb, offset); proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_nopatterns, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_unknown, tvb, offset, 8, ENC_NA); offset += 8; proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_eyecatcher, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; /* As we don't have the right size yet, start with 1 byte */ trace_request_patterns = proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_patterns, tvb, offset, 1, ENC_NA); trace_request_patterns_tree = proto_item_add_subtree(trace_request_patterns, ett_sapenqueue); while (nopatterns > 0 && tvb_offset_exists(tvb, offset)){ /* As we don't have the right size yet, start with 1 byte */ trace_request_pattern = proto_tree_add_item(trace_request_patterns_tree, hf_sapenqueue_server_admin_trace_pattern, tvb, offset, 1, ENC_NA); trace_request_pattern_tree = proto_item_add_subtree(trace_request_pattern, ett_sapenqueue); pattern_length = tvb_get_guint8(tvb, offset) + 1; /* Pattern string is null terminated */ proto_tree_add_item(trace_request_pattern_tree, hf_sapenqueue_server_admin_trace_pattern_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Set the max length to the remaining of the packet, just in case a malformed packet arrives */ if (!tvb_offset_exists(tvb, offset + pattern_length)) { pattern_length = (guint8)tvb_reported_length_remaining(tvb, offset); expert_add_info(pinfo, trace_request_pattern, &ei_sapenqueue_pattern_invalid_length); } proto_tree_add_item(trace_request_pattern_tree, hf_sapenqueue_server_admin_trace_pattern_value, tvb, offset, pattern_length, ENC_ASCII|ENC_NA); offset += pattern_length; /* Set the right size for the pattern tree */ pattern_length += 1; /* Add also the length field */ proto_item_set_len(trace_request_pattern, pattern_length); nopatterns -= 1; total_length += pattern_length; } proto_item_set_len(trace_request_patterns, total_length); proto_tree_add_item(trace_request_tree, hf_sapenqueue_server_admin_trace_eyecatcher, tvb, offset, 4, ENC_ASCII|ENC_NA); break; } default:{ proto_tree_add_item(server_admin_tree, hf_sapenqueue_server_admin_value, tvb, offset, -1, ENC_NA); break; } } } } static void dissect_sapenqueue_conn_admin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint8 opcode){ proto_item *conn_admin = NULL; proto_tree *conn_admin_tree = NULL; conn_admin = proto_tree_add_item(tree, hf_sapenqueue_conn_admin, tvb, offset, -1, ENC_NA); conn_admin_tree = proto_item_add_subtree(conn_admin, ett_sapenqueue); switch (opcode){ case 0x01: /* Parameter Request */ case 0x02:{ /* Parameter Response */ gint name_length_remaining = 0; guint8 length = 0, total_length = 0; guint32 count = 0, id = 0, name_length = 0; proto_item *params = NULL, *param = NULL; proto_tree *params_tree = NULL, *param_tree = NULL; count = tvb_get_ntohl(tvb, offset); proto_tree_add_item(conn_admin_tree, hf_sapenqueue_conn_admin_params_count, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; params = proto_tree_add_item(conn_admin_tree, hf_sapenqueue_conn_admin_params, tvb, offset, 1, ENC_NA); params_tree = proto_item_add_subtree(params, ett_sapenqueue); while (count > 0 && tvb_offset_exists(tvb, offset)){ /* As we don't have the right size yet, start with 1 byte */ param = proto_tree_add_item(params_tree, hf_sapenqueue_conn_admin_param, tvb, offset, 1, ENC_NA); param_tree = proto_item_add_subtree(param, ett_sapenqueue); id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(param_tree, hf_sapenqueue_conn_admin_param_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; length = 4; switch(id){ case 0x03:{ /* Set Name parameter */ name_length = tvb_strsize(tvb, offset); if (name_length > 0) { proto_tree_add_item(param_tree, hf_sapenqueue_conn_admin_param_name, tvb, offset, name_length, ENC_ASCII|ENC_NA); offset += name_length; length += name_length; } break; } case 0x04:{ /* No support parameter */ /* This parameter appears to have more fields only for responses */ if (opcode == 0x02) { proto_tree_add_item(param_tree, hf_sapenqueue_conn_admin_param_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; length += 4; } break; } case 0x06:{ /* Set Unicode Support Parameter */ name_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(param_tree, hf_sapenqueue_conn_admin_param_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* If the reported length is not correct, use the remaining of the packet as length */ name_length_remaining = tvb_reported_length_remaining(tvb, offset); if (name_length_remaining < 0){ expert_add_info(pinfo, param, &ei_sapenqueue_support_invalid_offset); break; } if ((guint32)name_length_remaining < name_length) { name_length = (guint32)name_length_remaining; expert_add_info(pinfo, param, &ei_sapenqueue_support_invalid_length); } proto_tree_add_item(param_tree, hf_sapenqueue_conn_admin_param_value, tvb, offset, name_length, ENC_BIG_ENDIAN); offset += name_length; length += 4 + name_length; break; } default: { /* The rest of the parameters have an integer value field */ proto_tree_add_item(param_tree, hf_sapenqueue_conn_admin_param_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; length += 4; } } /* Set the right size for the parameter tree */ proto_item_set_len(param, length); count -= 1; total_length += length; } proto_item_set_len(params, total_length); break; } } } static int dissect_sapenqueue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 dest = 0, type = 0, opcode = 0; guint32 offset = 4; proto_item *ti = NULL; proto_tree *sapenqueue_tree = NULL; /* If the packet has less than 20 bytes we can be sure that is not an * Enqueue server packet. */ if (tvb_reported_length(tvb) < 20){ return 0; } /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, "SAPENQUEUE"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); dest = tvb_get_guint8(tvb, offset + 16); col_append_fstr(pinfo->cinfo, COL_INFO, "Dest=%s", val_to_str_const(dest, sapenqueue_dest_vals, "Unknown")); opcode = tvb_get_guint8(tvb, offset + 17); type = tvb_get_guint8(tvb, offset + 19); col_append_fstr(pinfo->cinfo, COL_INFO, ",Type=%s", val_to_str_const(type, sapenqueue_type_vals, "Unknown")); if (dest == 0x06){ col_append_fstr(pinfo->cinfo, COL_INFO, ",Opcode=%s", val_to_str_const(opcode, sapenqueue_conn_admin_opcode_vals, "Unknown")); } /* Add the main sapenqueue subtree */ ti = proto_tree_add_item(tree, proto_sapenqueue, tvb, 0, -1, ENC_NA); sapenqueue_tree = proto_item_add_subtree(ti, ett_sapenqueue); proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_magic, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_length_frag, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_dest, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (dest == 0x06){ /* This field is only relevant if the destination is Connection Admin */ proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_conn_admin_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); } offset += 1; proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_more_frags, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sapenqueue_tree, hf_sapenqueue_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; switch (dest){ case 0x03:{ /* Server Admin */ dissect_sapenqueue_server_admin(tvb, pinfo, sapenqueue_tree, offset); break; } case 0x06:{ /* Connection Admin */ dissect_sapenqueue_conn_admin(tvb, pinfo, sapenqueue_tree, offset, opcode); break; } } return tvb_reported_length(tvb); } static gboolean dissect_sapenqueue_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_){ conversation_t *conversation = NULL; /* If the first 4 bytes are the magic bytes, we can guess that the * packet is a Enqueue server packet. */ if (tvb_get_ntohl(tvb, 0) != 0xabcde123){ return (FALSE); } /* From now on this conversation is dissected as SAP Enqueue traffic */ conversation = find_or_create_conversation(pinfo); conversation_set_dissector(conversation, sapenqueue_handle); /* Now dissect the packet */ dissect_sapenqueue(tvb, pinfo, tree, data); return (TRUE); } void proto_register_sapenqueue(void) { static hf_register_info hf[] = { /* General Header fields */ { &hf_sapenqueue_magic, { "Magic Bytes", "sapenqueue.magic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_id, { "ID", "sapenqueue.id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_length, { "Length", "sapenqueue.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_length_frag, { "Fragment Length", "sapenqueue.fragment_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_dest, { "Destination", "sapenqueue.destination", FT_UINT8, BASE_DEC, VALS(sapenqueue_dest_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_opcode, { "Opcode", "sapenqueue.opcode", FT_UINT8, BASE_DEC, VALS(sapenqueue_conn_admin_opcode_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_more_frags, { "More Fragments", "sapenqueue.more_frags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_type, { "Type", "sapenqueue.type", FT_UINT8, BASE_DEC, VALS(sapenqueue_type_vals), 0x0, NULL, HFILL }}, /* Server Admin fields */ { &hf_sapenqueue_server_admin, { "Server Admin", "sapenqueue.server_admin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_eyecatcher, { "Eye Catcher", "sapenqueue.server_admin.eyecatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_version, { "Version", "sapenqueue.server_admin.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_flag, { "Flag", "sapenqueue.server_admin.flag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_length, { "Length", "sapenqueue.server_admin.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_opcode, { "Opcode", "sapenqueue.server_admin.opcode", FT_UINT8, BASE_DEC, VALS(sapenqueue_server_admin_opcode_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_flags, { "Flags", "sapenqueue.server_admin.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_rc, { "Return Code", "sapenqueue.server_admin.rc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_value, { "Value", "sapenqueue.server_admin.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Trace Request fields */ { &hf_sapenqueue_server_admin_trace_request, { "Trace Request", "sapenqueue.server_admin.trace", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_protocol_version, { "Trace Protocol Version", "sapenqueue.server_admin.trace.protocol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_action, { "Trace Action", "sapenqueue.server_admin.trace.action", FT_UINT8, BASE_DEC, VALS(sapenqueue_server_admin_trace_action_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_limit, { "Trace Limit", "sapenqueue.server_admin.trace.limit", FT_UINT8, BASE_DEC, VALS(sapenqueue_server_admin_trace_limit_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_thread, { "Trace Thread", "sapenqueue.server_admin.trace.thread", FT_UINT8, BASE_DEC, VALS(sapenqueue_server_admin_trace_thread_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_level, { "Trace Level", "sapenqueue.server_admin.trace.level", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_logging, { "Trace Logging", "sapenqueue.server_admin.trace.logging", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_max_file_size, { "Trace Max File Size", "sapenqueue.server_admin.trace.max_file_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_nopatterns, { "Trace No Patterns", "sapenqueue.server_admin.trace.nopatterns", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_eyecatcher, { "Trace Eye Catcher", "sapenqueue.server_admin.trace.eyecatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_patterns, { "Trace Patterns", "sapenqueue.server_admin.trace.patterns", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_unknown, { "Unknown field", "sapenqueue.server_admin.trace.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Trace Request Pattern fields */ { &hf_sapenqueue_server_admin_trace_pattern, { "Trace Pattern", "sapenqueue.server_admin.trace.pattern", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_pattern_len, { "Trace Pattern Length", "sapenqueue.server_admin.trace.pattern.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_server_admin_trace_pattern_value, { "Trace Pattern Value", "sapenqueue.server_admin.trace.pattern.value", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Connection Admin fields */ { &hf_sapenqueue_conn_admin, { "Connection Admin", "sapenqueue.conn_admin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_params_count, { "Parameters Count", "sapenqueue.conn_admin.params.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_params, { "Parameters", "sapenqueue.conn_admin.params", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_param, { "Parameter", "sapenqueue.conn_admin.params.param", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_param_id, { "Parameter ID", "sapenqueue.conn_admin.params.param.id", FT_UINT32, BASE_DEC, VALS(sapenqueue_conn_admin_param_vals), 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_param_len, { "Parameter Length", "sapenqueue.conn_admin.params.param.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_param_value, { "Parameter Value", "sapenqueue.conn_admin.params.param.value", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapenqueue_conn_admin_param_name, { "Parameter Name", "sapenqueue.conn_admin.params.param.name", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sapenqueue }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_sapenqueue_pattern_invalid_length, { "sapenqueue.server_admin.trace.pattern.length.invalid", PI_MALFORMED, PI_WARN, "The reported length is incorrect", EXPFILL }}, { &ei_sapenqueue_support_invalid_offset, { "sapenqueue.conn_admin.params.param.offset.invalid", PI_MALFORMED, PI_ERROR, "Invalid offset", EXPFILL }}, { &ei_sapenqueue_support_invalid_length, { "sapenqueue.conn_admin.params.param.length.invalid", PI_MALFORMED, PI_WARN, "The reported length is incorrect", EXPFILL }}, }; expert_module_t* sapenqueue_expert; /* Register the protocol */ proto_sapenqueue = proto_register_protocol("SAP Enqueue Protocol", "SAPENQUEUE", "sapenqueue"); proto_register_field_array(proto_sapenqueue, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sapenqueue_expert = expert_register_protocol(proto_sapenqueue); expert_register_field_array(sapenqueue_expert, ei, array_length(ei)); register_dissector("sapenqueue", dissect_sapenqueue, proto_sapenqueue); } void proto_reg_handoff_sapenqueue(void) { sapenqueue_handle = create_dissector_handle(dissect_sapenqueue, proto_sapenqueue); /* Register the heuristic dissector. We need to use a heuristic dissector * here as the Enqueue Server uses the same port number that the Dispatcher * Service (32NN/tcp). */ heur_dissector_add("sapni", dissect_sapenqueue_heur, "SAP Enqueue Protocol", "sapenqueue", proto_sapenqueue, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-saphdb.c
/* packet-saphdb.c * Routines for SAP HDB (HANA SQL Command Network Protocol) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a dissector that partially implements the HDB protocol. Reference of the protocol can be found in SAP's official documentation: * https://help.sap.com/viewer/7e4aba181371442d9e4395e7ff71b777/2.0.03/en-US/d5b80175490741adbf1a1ba5ec8f2695.html * * and the blog series SecureAuth published around the topic "Exploring the SAP HANA SQL Command Network Protocol": * - Protocol Basics and Authentication: https://www.secureauth.com/blog/exploring-sap-hana-sql-command-network-protocol-protocol-basics-and-authentication/ * - Password-based Authentication and TLS: https://www.secureauth.com/blog/exploring-sap-hana-sql-command-network-protocol-password-based-authentication-and-tls/ * - Federated Authentication: https://www.secureauth.com/blog/exploring-the-sap-hana-sql-command-network-protocol-federated-authentication/ */ #include <config.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <wsutil/wmem/wmem.h> #include <epan/wmem_scopes.h> #include "packet-tcp.h" #include "packet-tls.h" /* * Define default ports. The right range should be 3NN13 and 3NN15, but as port numbers are proprietary and not * IANA assigned, we leave only the ones corresponding to the instance 00. */ #define SAPHDB_PORT_RANGE "30013,30015" /* Header Length */ #define SAPHDB_HEADER_LEN 32 /* SAP HDB Packet Options values */ static const value_string saphdb_message_header_packetoptions_vals[] = { { 0, "Uncompressed" }, { 2, "Compressed" }, /* NULL */ { 0x00, NULL } }; /* SAP HDB Segment Kind values */ static const value_string saphdb_segment_segmentkind_vals[] = { { 0, "Invalid" }, { 1, "Request" }, { 2, "Reply" }, { 5, "Error" }, /* NULL */ { 0x00, NULL } }; /* SAP HDB Segment Message Type values */ static const value_string saphdb_segment_messagetype_vals[] = { { 0, "NIL" }, { 2, "EXECUTEDIRECT" }, { 3, "PREPARE" }, { 4, "ABAPSTREAM" }, { 5, "XA_START" }, { 6, "XA_JOIN" }, { 7, "XA_COMMIT" }, { 13, "EXECUTE" }, { 16, "READLOB" }, { 17, "WRITELOB" }, { 18, "FINDLOB" }, { 25, "PING" }, { 65, "AUTHENTICATE" }, { 66, "CONNECT" }, { 67, "COMMIT" }, { 68, "ROLLBACK" }, { 69, "CLOSERESULTSET" }, { 70, "DROPSTATEMENTID" }, { 71, "FETCHNEXT" }, { 72, "FETCHABSOLUTE" }, { 73, "FETCHRELATIVE" }, { 74, "FETCHFIRST" }, { 75, "FETCHLAST" }, { 77, "DISCONNECT" }, { 78, "EXECUTEITAB" }, { 79, "FETCHNEXTITAB" }, { 80, "INSERTNEXTITAB" }, { 81, "BATCHPREPARE" }, { 82, "DBCONNECTINFO" }, { 83, "XOPEN_XASTART" }, { 84, "XOPEN_XAEND" }, { 85, "XOPEN_XAPREPARE" }, { 86, "XOPEN_XACOMMIT" }, { 87, "XOPEN_XAROLLBACK" }, { 88, "XOPEN_XARECOVER" }, { 89, "XOPEN_XAFORGET" }, /* NULL */ { 0x00, NULL } }; /* SAP HDB Segment Function Code values */ static const value_string saphdb_segment_functioncode_vals[] = { { 0, "NIL" }, { 1, "DDL" }, { 2, "INSERT" }, { 3, "UPDATE" }, { 4, "DELETE" }, { 5, "SELECT" }, { 6, "SELECTFORUPDATE" }, { 7, "EXPLAIN" }, { 8, "DBPROCEDURECALL" }, { 9, "DBPROCEDURECALLWITHRESULT" }, { 10, "FETCH" }, { 11, "COMMIT" }, { 12, "ROLLBACK" }, { 13, "SAVEPOINT" }, { 14, "CONNECT" }, { 15, "WRITELOB" }, { 16, "READLOB" }, { 17, "PING" }, { 18, "DISCONNECT" }, { 19, "CLOSECURSOR" }, { 20, "FINDLOB" }, { 21, "ABAPSTREAM" }, { 22, "XASTART" }, { 23, "XAJOIN" }, { 24, "ITABWRITE" }, { 25, "XOPEN_XACONTROL" }, { 26, "XOPEN_XAPREPARE" }, { 27, "XOPEN_XARECOVER" }, /* NULL */ { 0x00, NULL } }; /* SAP HDB Part Kind values */ static const value_string saphdb_part_partkind_vals[] = { { 0, "NIL" }, { 3, "COMMAND" }, { 5, "RESULTSET" }, { 6, "ERROR" }, { 10, "STATEMENTID" }, { 11, "TRANSACTIONID" }, { 12, "ROWSAFFECTED" }, { 13, "RESULTSETID" }, { 15, "TOPOLOGYINFORMATION" }, { 16, "TABLELOCATION" }, { 17, "READLOBREQUEST" }, { 18, "READLOBREPLY" }, { 25, "ABAPISTREAM" }, { 26, "ABAPOSTREAM" }, { 27, "COMMANDINFO" }, { 28, "WRITELOBREQUEST" }, { 29, "CLIENTCONTEXT" }, { 30, "WRITELOBREPLY" }, { 32, "PARAMETERS" }, { 33, "AUTHENTICATION" }, { 34, "SESSIONCONTEXT" }, { 35, "CLIENTID" }, { 38, "PROFILE" }, { 39, "STATEMENTCONTEXT" }, { 40, "PARTITIONINFORMATION" }, { 41, "OUTPUTPARAMETERS" }, { 42, "CONNECTOPTIONS" }, { 43, "COMMITOPTIONS" }, { 44, "FETCHOPTIONS" }, { 45, "FETCHSIZE" }, { 47, "PARAMETERMETADATA" }, { 48, "RESULTSETMETADATA" }, { 49, "FINDLOBREQUEST" }, { 50, "FINDLOBREPLY" }, { 51, "ITABSHM" }, { 53, "ITABCHUNKMETADATA" }, { 55, "ITABMETADATA" }, { 56, "ITABRESULTCHUNK" }, { 57, "CLIENTINFO" }, { 58, "STREAMDATA" }, { 59, "OSTREAMRESULT" }, { 60, "FDAREQUESTMETADATA" }, { 61, "FDAREPLYMETADATA" }, { 62, "BATCHPREPARE" }, { 63, "BATCHEXECUTE" }, { 64, "TRANSACTIONFLAGS" }, { 65, "ROWSLOTIMAGEPARAMMETADATA" }, { 66, "ROWSLOTIMAGERESULTSET" }, { 67, "DBCONNECTINFO" }, { 68, "LOBFLAGS" }, { 69, "RESULTSETOPTIONS" }, { 70, "XATRANSACTIONINFO" }, { 71, "SESSIONVARIABLE" }, { 72, "WORKLOADREPLAYCONTEXT" }, { 73, "SQLREPLYOTIONS" }, /* NULL */ { 0x00, NULL } }; /* SAP HDB Type values */ static const value_string saphdb_part_type_vals[] = { { 0, "NULL" }, { 1, "TINYINT" }, { 2, "SMALLINT" }, { 3, "INT" }, { 4, "BIGINT" }, { 5, "DECIMAL" }, { 6, "REAL" }, { 7, "DOUBLE" }, { 8, "CHAR" }, { 9, "VARCHAR1" }, { 10, "NCHAR" }, { 11, "NVARCHAR" }, { 12, "BINARY" }, { 13, "VARBINARY" }, { 14, "DATE" }, { 15, "TIME" }, { 16, "TIMESTAMP" }, { 17, "TIME_TZ" }, { 18, "TIME_LTZ" }, { 19, "TIMESTAMP_TZ" }, { 20, "TIMESTAMP_LTZ" }, { 21, "INTERVAL_YM" }, { 22, "INTERVAL_DS" }, { 23, "ROWID" }, { 24, "UROWID" }, { 25, "CLOB" }, { 26, "NCLOB" }, { 27, "BLOB" }, { 28, "BOOLEAN" }, { 29, "STRING" }, { 30, "NSTRING" }, { 31, "LOCATOR" }, { 32, "NLOCATOR" }, { 33, "BSTRING" }, { 34, "DECIMAL_DIGIT_ARRAY" }, { 35, "VARCHAR2" }, { 36, "VARCHAR3" }, { 37, "NVARCHAR3" }, { 38, "VARBINARY3" }, { 39, "VARGROUP" }, { 40, "TINYINT_NOTNULL" }, { 41, "SMALLINT_NOTNULL" }, { 42, "INT_NOTNULL" }, { 43, "BIGINT_NOTNULL" }, { 44, "ARGUMENT" }, { 45, "TABLE" }, { 46, "CURSOR" }, { 47, "SMALLDECIMAL" }, { 48, "ABAPSTREAM" }, { 49, "ABAPSTRUCT" }, { 50, "ARRAY" }, { 51, "TEXT" }, { 52, "SHORTTEXT" }, { 53, "FIXEDSTRING" }, { 54, "FIXEDPOINTDECIMAL" }, { 55, "ALPHANUM" }, { 56, "TLOCATOR" }, { 61, "LONGDATE" }, { 62, "SECONDDATE" }, { 63, "DAYDATE" }, { 64, "SECONDTIME" }, { 65, "CSDATE" }, { 66, "CSTIME" }, { 71, "BLOB_DISK" }, { 72, "CLOB_DISK" }, { 73, "NCLOB_DISK" }, { 74, "GEOMETRY" }, { 75, "POINT" }, { 76, "FIXED16" }, { 77, "BLOB_HYBRID" }, { 78, "CLOB_HYBRID" }, { 79, "NCLOB_HYBRID" }, { 80, "POINTZ" }, /* NULL */ { 0x00, NULL } }; /* SAP HDB Error Level values */ static const value_string saphdb_error_level_vals[] = { { 0, "WARNING" }, { 1, "ERROR" }, { 2, "FATALERROR" }, /* NULL */ { 0x00, NULL } }; /* Structure to define Option Parts */ typedef struct _option_part_definition { gint8 value; const gchar *identifier_strptr; gint8 type; } option_part_definition; static const option_part_definition saphdb_part_connect_options_vals[] = { { 1, "Connection ID", 3 }, { 2, "Complete Array Execution", 28 }, { 3, "Client Locale", 29 }, { 4, "Supports Large Bulk Operations", 28 }, { 5, "Distribution Enabled", 28 }, { 6, "Primary Connection ID", 0 }, { 7, "Primary Connection Host", 0 }, { 8, "Primary Connection Port", 0 }, { 9, "Complete Data Type Support", 0 }, { 10, "Large Number of Parameters Support", 28 }, { 11, "System ID", 29 }, { 12, "Data Format Version", 3 }, { 13, "ABAP VARCHAR Mode", 28 }, { 14, "Select for Update Supported", 28 }, { 15, "Client Distribution Mode", 3 }, { 16, "Engine Data Format Version", 3 }, { 17, "Distribution Protocol Version", 3 }, { 18, "Split Batch Commands", 28 }, { 19, "Use Transaction Flags Only", 28 }, { 20, "Row and Column Optimized Format", 28 }, { 21, "Ignore Unknown Parts", 3 }, { 22, "Table Output Parameter", 28 }, { 23, "Data Format Version 2", 3 }, { 24, "ITAB Parameter", 28 }, { 25, "Describe Table Output Parameter", 28 }, { 26, "Columnar Result Set", 0 }, /* This is BITVECTOR type ??? */ { 27, "Scrollable Result Set", 3 }, { 28, "Client Info NULL Value Supported", 28 }, { 29, "Associated Connection ID", 3 }, { 30, "Non-Transactional Prepare", 28 }, { 31, "Fast Data Access Enabled", 28 }, { 32, "OS User", 29 }, { 33, "Row Slot Image Result", 0 }, /* This is BITVECTOR type ??? */ { 34, "Endianness", 3 }, { 35, "Update Topology Anywhere", 28 }, { 36, "Enable Array Type", 28 }, { 37, "Implicit LOB Streaming", 28 }, { 38, "Cached View Property", 28 }, { 39, "X OpenXA Protocol Supported", 28 }, { 40, "Master Commit Redirection Supported", 28 }, { 41, "Active/Active Protocol Version", 3 }, { 42, "Active/Active Connection Origin Site", 3 }, { 43, "Query Timeout Supported", 28 }, { 44, "Full Version String", 29 }, { 45, "Database Name", 29 }, { 46, "Build Platform", 3 }, { 47, "Implicit XA Session Supported", 28 }, { 48, "Client Side Column Encryption Version", 3 }, { 49, "Compression Level And Flags", 3 }, { 50, "Client Side Re-Execution Supported", 28 }, { 51, "Client Reconnect Wait Timeout", 3 }, { 52, "Original Anchor Connection ID", 3 }, { 53, "Flag Set 1", 3 }, { 54, "Topology Network Group", 28 }, { 55, "IP Address", 29 }, { 56, "LRR Ping Time", 3 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_commit_options_vals[] = { { 1, "Hold Cursors Over Commit", 28 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_fetch_options_vals[] = { { 1, "Result Set Pos", 3 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_transaction_flags_vals[] = { { 0, "Rolled Back", 28 }, { 1, "Commited", 28 }, { 2, "New Isolation Level", 3 }, { 3, "DDL Commit Mode Changed", 28 }, { 4, "Write Transaction Started", 28 }, { 5, "No Write Transaction Started", 28 }, { 6, "Session Closing Transaction Error", 28 }, /* NULL */ { 0x00, NULL, 0x00} }; static const option_part_definition saphdb_part_topology_info_vals[] = { { 1, "Host Name", 29 }, { 2, "Host Port Number", 3 }, { 3, "Tenant Name", 29 }, { 4, "Load Factor", 7 }, { 5, "Site Volume ID", 3 }, { 6, "Is Master", 28 }, { 7, "Is Current Session", 28 }, { 8, "Service Type", 3 }, { 9, "Network Domain", 29 }, { 10, "Is Stand-By", 28 }, { 11, "All IP Addresses", 29 }, { 12, "All Host Names", 29 }, { 13, "Site Type", 3 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_command_info_vals[] = { { 1, "Line Number", 3 }, { 2, "Source Module", 29 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_client_context_vals[] = { { 1, "Client Version", 29 }, { 2, "Client Type", 29 }, { 3, "Application Name", 29 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_session_context_vals[] = { { 1, "Primary Connection ID", 3 }, { 2, "Primary Host Name", 29 }, { 3, "Primary Host Port Number", 3 }, { 4, "Master Connection ID", 3 }, { 5, "Master Host Name", 29 }, { 6, "Master Host Port Number", 3 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_statement_context_vals[] = { { 1, "Statement Sequence Info", 33 }, { 2, "Server Processing Time", 4 }, { 3, "Schema Name", 29 }, { 4, "Flag Set", 8 }, { 5, "Query Time Out", 4 }, { 6, "Client Reconnection Wait Timeout", 3 }, { 7, "Server CPU Time", 4 }, { 8, "Server Memory Usage", 4 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_dbconnect_info_flags_vals[] = { { 1, "Database Name", 29 }, { 2, "Host", 29 }, { 3, "Port", 3 }, { 4, "Is Connected", 28 }, /* NULL */ { 0x00, NULL, 0x00 } }; static const option_part_definition saphdb_part_lob_flags_vals[] = { { 0, "Implicit Streaming", 28 }, /* NULL */ { 0x00, NULL, 0x00 } }; static int proto_saphdb = -1; /* SAP HDB Initialization items */ static int hf_saphdb_initialization_request = -1; static int hf_saphdb_initialization_reply = -1; static int hf_saphdb_initialization_reply_product_version_major = -1; static int hf_saphdb_initialization_reply_product_version_minor = -1; static int hf_saphdb_initialization_reply_protocol_version_major = -1; static int hf_saphdb_initialization_reply_protocol_version_minor = -1; /* SAP HDB Message Header items */ static int hf_saphdb_message_header = -1; static int hf_saphdb_message_header_sessionid = -1; static int hf_saphdb_message_header_packetcount = -1; static int hf_saphdb_message_header_varpartlength = -1; static int hf_saphdb_message_header_varpartsize = -1; static int hf_saphdb_message_header_noofsegm = -1; static int hf_saphdb_message_header_packetoptions = -1; static int hf_saphdb_message_header_compressionvarpartlength = -1; static int hf_saphdb_message_header_reserved = -1; /* SAP HDB Message Buffer items */ static int hf_saphdb_message_buffer = -1; static int hf_saphdb_compressed_buffer = -1; /* SAP HDB Segment items */ static int hf_saphdb_segment = -1; static int hf_saphdb_segment_segmentlength = -1; static int hf_saphdb_segment_segmentofs = -1; static int hf_saphdb_segment_noofparts = -1; static int hf_saphdb_segment_segmentno = -1; static int hf_saphdb_segment_segmentkind = -1; static int hf_saphdb_segment_messagetype = -1; static int hf_saphdb_segment_commit = -1; static int hf_saphdb_segment_commandoptions = -1; static int hf_saphdb_segment_functioncode = -1; static int hf_saphdb_segment_reserved = -1; /* SAP HDB Segment Buffer items */ static int hf_saphdb_segment_buffer = -1; /* SAP HDB Part items */ static int hf_saphdb_part = -1; static int hf_saphdb_part_partkind = -1; static int hf_saphdb_part_partattributes = -1; static int hf_saphdb_part_argumentcount = -1; static int hf_saphdb_part_bigargumentcount = -1; static int hf_saphdb_part_bufferlength = -1; static int hf_saphdb_part_buffersize = -1; /* SAP HDB Part Buffer items */ static int hf_saphdb_part_buffer = -1; /* SAP HDB Part Buffer Option Part Data items */ static int hf_saphdb_part_option_argcount = -1; static int hf_saphdb_part_option_name = -1; static int hf_saphdb_part_option_type = -1; static int hf_saphdb_part_option_length = -1; static int hf_saphdb_part_option_value = -1; static int hf_saphdb_part_option_value_bool = -1; static int hf_saphdb_part_option_value_byte = -1; static int hf_saphdb_part_option_value_short = -1; static int hf_saphdb_part_option_value_int = -1; static int hf_saphdb_part_option_value_bigint = -1; static int hf_saphdb_part_option_value_string = -1; static int hf_saphdb_part_option_value_double = -1; /* SAP HDB Part Buffer COMMAND items */ static int hf_saphdb_part_command = -1; /* SAP HDB Part Buffer ERROR items */ static int hf_saphdb_part_error_code = -1; static int hf_saphdb_part_error_position = -1; static int hf_saphdb_part_error_text_length = -1; static int hf_saphdb_part_error_level = -1; static int hf_saphdb_part_error_sqlstate = -1; static int hf_saphdb_part_error_text = -1; /* SAP HDB Part Buffer AUTHENTICATE items */ static int hf_saphdb_part_authentication_field_count = -1; static int hf_saphdb_part_authentication_field_length = -1; static int hf_saphdb_part_authentication_field_value = -1; /* SAP HDB Part Buffer CLIENTID items */ static int hf_saphdb_part_clientid = -1; static gint ett_saphdb = -1; /* Global port preference */ static range_t *global_saphdb_port_range; /* Expert info */ static expert_field ei_saphdb_compressed_unknown = EI_INIT; static expert_field ei_saphdb_option_part_unknown = EI_INIT; static expert_field ei_saphdb_segments_incorrect_order = EI_INIT; static expert_field ei_saphdb_segments_number_incorrect = EI_INIT; static expert_field ei_saphdb_segment_length = EI_INIT; static expert_field ei_saphdb_buffer_length = EI_INIT; static expert_field ei_saphdb_parts_number_incorrect = EI_INIT; static expert_field ei_saphdb_varpartlenght_incorrect = EI_INIT; /* Global highlight preference */ static gboolean global_saphdb_highlight_items = TRUE; /* Protocol handle */ static dissector_handle_t saphdb_handle; static dissector_handle_t saphdb_handle_tls; static dissector_handle_t gssapi_handle; void proto_reg_handoff_saphdb(void); void proto_register_saphdb(void); /* Option Part Value to Option Part Identifier */ static const gchar * opv_to_opi(const gint8 value, const option_part_definition *opd, const char *unknown_str) { gint i = 0; if (opd) { while (opd[i].identifier_strptr) { if (opd[i].value == value) { return(opd[i].identifier_strptr); } i++; } } return unknown_str; } /* Option Part Value to Option Part Type */ static gint8 opv_to_opt(const gint8 value, const option_part_definition *opd) { gint i = 0; if (opd) { while (opd[i].identifier_strptr) { if (opd[i].value == value) { return(opd[i].type); } i++; } } return 0; } static int dissect_saphdb_part_options_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, gint16 argcount, guint8 partkind, const option_part_definition *definition) { guint32 parsed_length = 0; while (argcount > 0 && tvb_reported_length_remaining(tvb, offset + parsed_length) > 2) { gint8 option_key = 0, option_type = 0; gint16 option_length = 0; gint8 option_value_byte = 0; proto_item *option_type_item = NULL; option_key = tvb_get_gint8(tvb, offset + parsed_length); proto_tree_add_int_format(tree, hf_saphdb_part_option_name, tvb, offset + parsed_length, 1, option_key, "Option Name: %s (%d)", opv_to_opi(option_key, definition, "Unknown"), option_key); parsed_length += 1; option_type = tvb_get_gint8(tvb, offset + parsed_length); option_type_item = proto_tree_add_item(tree, hf_saphdb_part_option_type, tvb, offset + parsed_length, 1, ENC_NA); parsed_length += 1; if (option_type != opv_to_opt(option_key, definition)) { if (global_saphdb_highlight_items){ expert_add_info_format(pinfo, option_type_item, &ei_saphdb_option_part_unknown, "Option Type for key %d in part kind %d doesn't match! (expected %d, obtained %d)", option_key, partkind, opv_to_opt(option_key, definition), option_type); } } switch (option_type) { case 1: // TINYINT proto_tree_add_item(tree, hf_saphdb_part_option_value_byte, tvb, offset + parsed_length, 1, ENC_NA); parsed_length += 1; break; case 2: // SMALLINT proto_tree_add_item(tree, hf_saphdb_part_option_value_short, tvb, offset + parsed_length, 2, ENC_LITTLE_ENDIAN); parsed_length += 2; break; case 3: // INT proto_tree_add_item(tree, hf_saphdb_part_option_value_int, tvb, offset + parsed_length, 4, ENC_LITTLE_ENDIAN); parsed_length += 4; break; case 4: // BIGINT proto_tree_add_item(tree, hf_saphdb_part_option_value_bigint, tvb, offset + parsed_length, 8, ENC_LITTLE_ENDIAN); parsed_length += 8; break; case 7: // DOUBLE proto_tree_add_item(tree, hf_saphdb_part_option_value_double, tvb, offset + parsed_length, 8, ENC_LITTLE_ENDIAN); parsed_length += 8; break; case 28: // BOOLEAN option_value_byte = tvb_get_gint8(tvb, offset + parsed_length); proto_tree_add_boolean(tree, hf_saphdb_part_option_value_bool, tvb, offset + parsed_length, 1, option_value_byte); parsed_length += 1; break; case 29: // STRING case 30: // NSTRING case 33: // BSTRING option_length = tvb_get_gint16(tvb, offset + parsed_length, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_saphdb_part_option_length, tvb, offset + parsed_length, 2, ENC_LITTLE_ENDIAN); parsed_length += 2; if (tvb_reported_length_remaining(tvb, offset + parsed_length) >= option_length) { if (option_type == 29) { /* TODO: This need to be CESU-8 decoded */ proto_tree_add_item(tree, hf_saphdb_part_option_value_string, tvb, offset + parsed_length, option_length, ENC_UTF_8); parsed_length += option_length; } else if (option_type == 30) { proto_tree_add_item(tree, hf_saphdb_part_option_value_string, tvb, offset + parsed_length, option_length, ENC_UTF_8); parsed_length += option_length; } else if (option_type == 33) { /* This is binary data, not rendering it as a string */ proto_tree_add_item(tree, hf_saphdb_part_option_value, tvb, offset + parsed_length, option_length, ENC_NA); parsed_length += option_length; } } break; default: // Unknown type, we don't know the length nor how to parse it if (global_saphdb_highlight_items){ expert_add_info_format(pinfo, option_type_item, &ei_saphdb_option_part_unknown, "Option Type %d length unknown", option_type); } break; } argcount--; } return parsed_length; } static int dissect_saphdb_part_multi_line_options_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, gint16 rowcount, guint8 partkind, const option_part_definition *definition) { guint32 parsed_length = 0; /* In Multi-line Option Part, the part's argcount is the number of rows. For each row we need to parse the options. */ while (rowcount > 0 && tvb_reported_length_remaining(tvb, offset + parsed_length) > 2) { gint16 argcount = 0; /* First we read the amount of arguments in this row */ argcount = tvb_get_gint16(tvb, offset + parsed_length, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_saphdb_part_option_argcount, tvb, offset + parsed_length, 2, ENC_LITTLE_ENDIAN); parsed_length += 2; /* Now parse the options in the row if there are*/ if (argcount > 0) { parsed_length += dissect_saphdb_part_options_data(tvb, pinfo, tree, offset + parsed_length, argcount, partkind, definition); } rowcount--; } return parsed_length; } static void dissect_saphdb_gss_authentication_fields(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint8 field_short_length, commtype = 0; guint16 field_count = 0, field_length; /* Parse the field count */ field_count = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_saphdb_part_authentication_field_count, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; for (guint16 field = 0; field < field_count; field++) { /* Parse the field length. If the first byte is 0xFF, the length is contained in the next 2 bytes */ field_short_length = tvb_get_guint8(tvb, offset); if (field_short_length == 0xff) { offset += 1; field_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_saphdb_part_authentication_field_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else { proto_tree_add_item(tree, hf_saphdb_part_authentication_field_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; field_length = field_short_length; } /* We try then to see if we're dealing with the commtype field (second field and with length 1) * and extract it */ if ((field == 1) && (field_length == 1)) { commtype = tvb_get_guint8(tvb, offset); } /* If this is the last value of a three field packet, and is one of the commtypes that carries an * SPNEGO structure, we call the GSSAPI dissector. The Kerberos data is extracted in a new TVB. */ if (((commtype == 3) || (commtype == 6)) && (field_count == 3) && (field == 2)) { tvbuff_t *kerberos_tvb; kerberos_tvb = tvb_new_subset_length(tvb, offset, field_length); add_new_data_source(pinfo, kerberos_tvb, "Kerberos Data"); call_dissector(gssapi_handle, kerberos_tvb, pinfo, tree); } else /* If not we add the field value in plain */ { proto_tree_add_item(tree, hf_saphdb_part_authentication_field_value, tvb, offset, field_length, ENC_NA); } offset += field_length; } } static int dissect_saphdb_part_authentication_fields(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint8 field_short_length; guint16 field_count = 0, field_length; guint32 parsed_length = 0; proto_item *gss_item = NULL; proto_tree *gss_tree = NULL; gboolean is_gss = FALSE; /* Parse the field count */ /* TODO: Should this match with argcount? */ field_count = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_saphdb_part_authentication_field_count, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; parsed_length += 2; for (guint16 field = 0; field < field_count; field++) { /* Parse the field length. If the first byte is 0xFF, the length is contained in the next 2 bytes */ field_short_length = tvb_get_guint8(tvb, offset); if (field_short_length == 0xff) { offset += 1; parsed_length += 1; field_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_saphdb_part_authentication_field_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; parsed_length += 2; } else { proto_tree_add_item(tree, hf_saphdb_part_authentication_field_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; parsed_length += 1; field_length = field_short_length; } /* Add the field value */ gss_item = proto_tree_add_item(tree, hf_saphdb_part_authentication_field_value, tvb, offset, field_length, ENC_NA); /* Check if this is a GSS field so we can parse the remaining fields */ if ((((field_count == 2) && (field == 0)) || ((field_count == 3) && (field == 1))) && (field_length == 3) && (tvb_strneql(tvb, offset, "GSS", 3) != -1)) { is_gss = TRUE; } /* If the method is GSS, and this is the last value, we add a new tree and parse the value */ if (is_gss && field == field_count - 1) { proto_item_append_text(gss_item, ": GSS Token"); gss_tree = proto_item_add_subtree(gss_item, ett_saphdb); dissect_saphdb_gss_authentication_fields(tvb, pinfo, gss_tree, offset); } offset += field_length; parsed_length += field_length; } return parsed_length; } static int dissect_saphdb_part_buffer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 length, gint16 argcount, guint8 partkind, proto_item *partkind_item) { gint32 error_text_length = 0; switch (partkind) { case 3: // COMMAND if ((length > 0) && ((guint32)tvb_reported_length_remaining(tvb, offset) >= length)) { proto_tree_add_item(tree, hf_saphdb_part_command, tvb, offset, length, ENC_ASCII); length = 0; } break; case 6: // ERROR proto_tree_add_item(tree, hf_saphdb_part_error_code, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; length -= 4; proto_tree_add_item(tree, hf_saphdb_part_error_position, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; length -= 4; proto_tree_add_item_ret_int(tree, hf_saphdb_part_error_text_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &error_text_length); offset += 4; length -= 4; proto_tree_add_item(tree, hf_saphdb_part_error_level, tvb, offset, 1, ENC_NA); offset += 1; length -= 1; proto_tree_add_item(tree, hf_saphdb_part_error_sqlstate, tvb, offset, 5, ENC_ASCII); offset += 5; length -= 5; if ((error_text_length > 0) && (tvb_reported_length_remaining(tvb, offset) >= error_text_length)) { proto_tree_add_item(tree, hf_saphdb_part_error_text, tvb, offset, error_text_length, ENC_ASCII); length -= error_text_length; /* Align the error text length to 8 */ if ((error_text_length % 8) != 0) { length += 8 - (error_text_length % 8); } } break; case 33: // AUTHENTICATION dissect_saphdb_part_authentication_fields(tvb, pinfo, tree, offset); break; case 35: // CLIENTID if ((length > 0) && ((guint32)tvb_reported_length_remaining(tvb, offset) >= length)) { proto_tree_add_item(tree, hf_saphdb_part_clientid, tvb, offset, length, ENC_ASCII); length = 0; } break; // Multi-line Option Parts case 15: // TOPOLOGYINFORMATION dissect_saphdb_part_multi_line_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_topology_info_vals); break; // Option Parts case 27: // COMMANDINFO dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_command_info_vals); break; case 29: // CLIENTCONTEXT dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_client_context_vals); break; case 34: // SESSIONCONTEXT dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_session_context_vals); break; case 39: // STATEMENTCONTEXT dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_statement_context_vals); break; case 42: // CONNECTOPTIONS dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_connect_options_vals); break; case 43: // COMMITOPTIONS dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_commit_options_vals); break; case 44: // FETCHOPTIONS dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_fetch_options_vals); break; case 64: // TRANSACTIONFLAGS dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_transaction_flags_vals); break; case 67: // DBCONNECTINFO dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_dbconnect_info_flags_vals); break; case 68: // LOBFLAGS dissect_saphdb_part_options_data(tvb, pinfo, tree, offset, argcount, partkind, saphdb_part_lob_flags_vals); break; default: if (global_saphdb_highlight_items){ expert_add_info_format(pinfo, partkind_item, &ei_saphdb_option_part_unknown, "Part Kind %d unknown", partkind); } break; } return length; } static int dissect_saphdb_part(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_, guint32 offset, gint16 number_of_parts, guint16 part_number) { gint8 partkind = 0; gint16 argcount = 0; gint32 bufferlength = 0; guint32 length = 0; proto_item *part_item = NULL, *partkind_item = NULL, *part_buffer_length_item = NULL, *part_buffer_item = NULL; proto_tree *part_tree = NULL, *part_buffer_tree = NULL; /* Add the Part subtree */ part_item = proto_tree_add_item(tree, hf_saphdb_part, tvb, offset, 16, ENC_NA); part_tree = proto_item_add_subtree(part_item, ett_saphdb); proto_item_append_text(part_item, " (%d/%d)", part_number, number_of_parts); /* Add the Part fields */ partkind = tvb_get_gint8(tvb, offset); proto_item_append_text(part_item, ", %s", val_to_str_const(partkind, saphdb_part_partkind_vals, "Unknown")); partkind_item = proto_tree_add_item(part_tree, hf_saphdb_part_partkind, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; length += 1; proto_tree_add_item(part_tree, hf_saphdb_part_partattributes, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; length += 1; argcount = tvb_get_gint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_item(part_tree, hf_saphdb_part_argumentcount, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; length += 2; proto_tree_add_item(part_tree, hf_saphdb_part_bigargumentcount, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; length += 4; part_buffer_length_item = proto_tree_add_item_ret_int(part_tree, hf_saphdb_part_bufferlength, tvb, offset, 4, ENC_LITTLE_ENDIAN, &bufferlength); offset += 4; length += 4; proto_tree_add_item(part_tree, hf_saphdb_part_buffersize, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; length += 4; /* Check the length */ if (bufferlength < 0) { expert_add_info_format(pinfo, part_buffer_length_item, &ei_saphdb_buffer_length, "Part Buffer length %d is invalid", bufferlength); } /* Align the buffer length to 8 */ if (bufferlength % 8 != 0) { bufferlength += 8 - bufferlength % 8; } /* Adjust the length */ if (bufferlength < 0 || tvb_reported_length_remaining(tvb, offset) < bufferlength) { bufferlength = tvb_reported_length_remaining(tvb, offset); } /* Add the part buffer tree and dissect it */ if (argcount > 0) { part_buffer_item = proto_tree_add_item(part_tree, hf_saphdb_part_buffer, tvb, offset, bufferlength, ENC_NA); part_buffer_tree = proto_item_add_subtree(part_buffer_item, ett_saphdb); dissect_saphdb_part_buffer(tvb, pinfo, part_buffer_tree, offset, bufferlength, argcount, partkind, partkind_item); length += bufferlength; } /* Adjust the item tree length */ proto_item_set_len(part_tree, length); return length; } static int dissect_saphdb_segment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_, guint32 offset, gint16 number_of_segments, guint16 nosegment, gboolean compressed) { gint8 segmentkind = 0, message_type = 0; gint16 number_of_parts = 0, segment_number = 0, function_code = 0; guint32 length = 0, part_length = 0; gint32 segmentlength = 0; proto_item *segment_item = NULL, *segmentlength_item = NULL, *number_of_parts_item = NULL, *segment_number_item = NULL, *segment_buffer_item = NULL; proto_tree *segment_tree = NULL, *segment_buffer_tree = NULL; /* Add the Segment subtree */ segment_item = proto_tree_add_item(tree, hf_saphdb_segment, tvb, offset, 13, ENC_NA); segment_tree = proto_item_add_subtree(segment_item, ett_saphdb); proto_item_append_text(segment_item, " (%d/%d)", nosegment, number_of_segments); /* Add the Segment fields */ segmentlength = tvb_get_gint32(tvb, offset, ENC_LITTLE_ENDIAN); segmentlength_item = proto_tree_add_item(segment_tree, hf_saphdb_segment_segmentlength, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; length += 4; proto_tree_add_item(segment_tree, hf_saphdb_segment_segmentofs, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; length += 4; number_of_parts = tvb_get_gint16(tvb, offset, ENC_LITTLE_ENDIAN); number_of_parts_item = proto_tree_add_item(segment_tree, hf_saphdb_segment_noofparts, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; length += 2; segment_number = tvb_get_gint16(tvb, offset, ENC_LITTLE_ENDIAN); segment_number_item = proto_tree_add_item(segment_tree, hf_saphdb_segment_segmentno, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; length += 2; segmentkind = tvb_get_gint8(tvb, offset); proto_tree_add_item(segment_tree, hf_saphdb_segment_segmentkind, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; length += 1; col_append_fstr(pinfo->cinfo, COL_INFO, "Segment %s (", val_to_str_const(segmentkind, saphdb_segment_segmentkind_vals, "Unknown")); proto_item_append_text(segment_item, ", %s", val_to_str_const(segmentkind, saphdb_segment_segmentkind_vals, "Unknown")); /* Check a couple of fields */ if (segmentlength < 13) { expert_add_info_format(pinfo, segmentlength_item, &ei_saphdb_segment_length, "Segment length %d is invalid", segmentlength); } if (number_of_parts < 0) { expert_add_info_format(pinfo, number_of_parts_item, &ei_saphdb_parts_number_incorrect, "Number of parts %d is invalid", number_of_parts); } if (segment_number < 0 || nosegment != segment_number) { expert_add_info_format(pinfo, segment_number_item, &ei_saphdb_segments_incorrect_order, "Segment number %d is invalid (expected %d)", segment_number, nosegment); } /* Add additional fields according to the segment kind*/ switch (segmentkind) { case 1: /* Request */ message_type = tvb_get_gint8(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, "%s)", val_to_str_const(message_type, saphdb_segment_messagetype_vals, "Unknown")); proto_item_append_text(segment_item, ", %s", val_to_str_const(message_type, saphdb_segment_messagetype_vals, "Unknown")); proto_tree_add_item(segment_tree, hf_saphdb_segment_messagetype, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; length += 1; proto_tree_add_item(segment_tree, hf_saphdb_segment_commit, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; length += 1; proto_tree_add_item(segment_tree, hf_saphdb_segment_commandoptions, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; length += 1; proto_tree_add_item(segment_tree, hf_saphdb_segment_reserved, tvb, offset, 8, ENC_NA); offset += 8; length += 8; break; case 2: /* Reply */ proto_tree_add_item(segment_tree, hf_saphdb_segment_reserved, tvb, offset, 1, ENC_NA); offset += 1; length += 1; function_code = tvb_get_gint16(tvb, offset, ENC_LITTLE_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, "%s)", val_to_str_const(function_code, saphdb_segment_functioncode_vals, "Unknown")); proto_item_append_text(segment_item, ", %s", val_to_str_const(function_code, saphdb_segment_functioncode_vals, "Unknown")); proto_tree_add_item(segment_tree, hf_saphdb_segment_functioncode, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; length += 2; proto_tree_add_item(segment_tree, hf_saphdb_segment_reserved, tvb, offset, 8, ENC_NA); offset += 8; length += 8; break; default: /* Error and other types */ proto_tree_add_item(segment_tree, hf_saphdb_segment_reserved, tvb, offset, 11, ENC_NA); offset += 11; length += 11; col_append_fstr(pinfo->cinfo, COL_INFO, ")"); break; } /* If the packet is compressed, compression will apply from here on. As we don't support compression yet, we stop dissecting here. */ if (compressed) { return length; } /* Add the Segment Buffer subtree */ if (((guint32)segmentlength > length) && (number_of_parts > 0)) { segment_buffer_item = proto_tree_add_item(segment_tree, hf_saphdb_segment_buffer, tvb, offset, segmentlength - length, ENC_NA); segment_buffer_tree = proto_item_add_subtree(segment_buffer_item, ett_saphdb); /* Iterate over the parts and dissect them */ for (guint16 part_number = 1; part_number <= number_of_parts && tvb_reported_length_remaining(tvb, offset) >= 16; part_number++) { part_length = dissect_saphdb_part(tvb, pinfo, segment_buffer_tree, NULL, offset, number_of_parts, part_number); offset += part_length; length += part_length; } } /* Adjust the item tree length */ proto_item_set_len(segment_tree, length); return length; } static int dissect_saphdb_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint32 offset = 0; /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, "SAPHDB"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); /* we are being asked for details */ if (tvb_reported_length(tvb) == 8 || tvb_reported_length(tvb) == 14 || tvb_reported_length(tvb) >= SAPHDB_HEADER_LEN) { proto_item *ti = NULL; proto_tree *saphdb_tree = NULL; /* Add the main saphdb subtree */ ti = proto_tree_add_item(tree, proto_saphdb, tvb, offset, -1, ENC_NA); saphdb_tree = proto_item_add_subtree(ti, ett_saphdb); /* Initialization Request message */ if (tvb_reported_length(tvb) == 14) { proto_tree_add_item(saphdb_tree, hf_saphdb_initialization_request, tvb, offset, 14, ENC_NA); offset += 14; col_add_str(pinfo->cinfo, COL_INFO, "Initialization Request"); /* Initialization Reply message */ } else if (tvb_reported_length(tvb) == 8) { proto_item *initialization_reply = NULL; proto_tree *initialization_reply_tree = NULL; /* Add the Initialization Reply subtree */ initialization_reply = proto_tree_add_item(saphdb_tree, hf_saphdb_initialization_reply, tvb, offset, 8, ENC_NA); initialization_reply_tree = proto_item_add_subtree(initialization_reply, ett_saphdb); proto_tree_add_item(initialization_reply_tree, hf_saphdb_initialization_reply_product_version_major, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(initialization_reply_tree, hf_saphdb_initialization_reply_product_version_minor, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(initialization_reply_tree, hf_saphdb_initialization_reply_protocol_version_major, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(initialization_reply_tree, hf_saphdb_initialization_reply_protocol_version_minor, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; col_add_str(pinfo->cinfo, COL_INFO, "Initialization Reply"); /* All other message types */ } else if (tvb_reported_length(tvb) >= SAPHDB_HEADER_LEN) { gboolean compressed = FALSE; gint16 number_of_segments = 0; guint32 varpartlength = 0; proto_item *message_header_item = NULL, *varpartlength_item = NULL, *number_of_segments_item = NULL, *message_buffer_item = NULL, *compressed_buffer_item = NULL; proto_tree *message_header_tree = NULL, *message_buffer_tree = NULL; /* Add the Message Header subtree */ message_header_item = proto_tree_add_item(saphdb_tree, hf_saphdb_message_header, tvb, offset, SAPHDB_HEADER_LEN, ENC_NA); message_header_tree = proto_item_add_subtree(message_header_item, ett_saphdb); /* Add the Message Header fields */ proto_tree_add_item(message_header_tree, hf_saphdb_message_header_sessionid, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(message_header_tree, hf_saphdb_message_header_packetcount, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; varpartlength_item = proto_tree_add_item_ret_uint(message_header_tree, hf_saphdb_message_header_varpartlength, tvb, offset, 4, ENC_LITTLE_ENDIAN, &varpartlength); offset += 4; proto_tree_add_item(message_header_tree, hf_saphdb_message_header_varpartsize, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; number_of_segments = tvb_get_gint16(tvb, offset, ENC_LITTLE_ENDIAN); number_of_segments_item = proto_tree_add_item(message_header_tree, hf_saphdb_message_header_noofsegm, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; compressed = tvb_get_gint8(tvb, offset) == 2; proto_tree_add_item(message_header_tree, hf_saphdb_message_header_packetoptions, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(message_header_tree, hf_saphdb_message_header_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(message_header_tree, hf_saphdb_message_header_compressionvarpartlength, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(message_header_tree, hf_saphdb_message_header_reserved, tvb, offset, 4, ENC_NA); offset += 4; /* Check the length of the variable part against the remaining packet */ if ((guint32)tvb_reported_length_remaining(tvb, offset) != varpartlength) { expert_add_info_format(pinfo, varpartlength_item, &ei_saphdb_varpartlenght_incorrect, "Length of variable part %d is invalid", varpartlength); varpartlength = tvb_reported_length_remaining(tvb, offset); } /* Add the Message Buffer subtree */ if (varpartlength > 0 && number_of_segments > 0) { message_buffer_item = proto_tree_add_item(saphdb_tree, hf_saphdb_message_buffer, tvb, offset, varpartlength, ENC_NA); message_buffer_tree = proto_item_add_subtree(message_buffer_item, ett_saphdb); /* If the packet is compressed, the message header and the first segment header is sent uncompressed. We dissect the * first segment only and add a new item with the compressed buffer. Adding an expert warning as well. */ if (compressed) { offset += dissect_saphdb_segment(tvb, pinfo, message_buffer_tree, NULL, offset, number_of_segments, 1, compressed); compressed_buffer_item = proto_tree_add_item(message_buffer_tree, hf_saphdb_compressed_buffer, tvb, offset, varpartlength, ENC_NA); if (global_saphdb_highlight_items){ expert_add_info_format(pinfo, compressed_buffer_item, &ei_saphdb_compressed_unknown, "Packet is compressed and decompression is not supported"); } } else { /* Iterate over the segments and dissect them */ for (guint16 segment_number = 1; segment_number <= number_of_segments && tvb_reported_length_remaining(tvb, offset) >= 13; segment_number++) { offset += dissect_saphdb_segment(tvb, pinfo, message_buffer_tree, NULL, offset, number_of_segments, segment_number, compressed); } } } else { expert_add_info_format(pinfo, number_of_segments_item, &ei_saphdb_segments_number_incorrect, "Number of segments %d is invalid", number_of_segments); } } } return offset; } static guint get_saphdb_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* Entire HDB packets are of 32-bytes header plus the value in varpartlength field */ guint32 varpartlength = tvb_get_guint32(tvb, offset + 12, ENC_LITTLE_ENDIAN); return varpartlength + SAPHDB_HEADER_LEN; } static int dissect_saphdb_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return dissect_saphdb_message(tvb, pinfo, tree, FALSE); } static int dissect_saphdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (tvb_reported_length(tvb) == 14 || tvb_reported_length(tvb) == 8) { return dissect_saphdb_tcp(tvb, pinfo, tree, data); } else { /* Header must be present */ if (!tvb_bytes_exist(tvb, 0, SAPHDB_HEADER_LEN)) return 0; /* Filter on reserved bytes */ if(tvb_get_guint8(tvb, 23) || tvb_get_guint32(tvb, 28, ENC_BIG_ENDIAN)) return 0; tcp_dissect_pdus(tvb, pinfo, tree, TRUE, SAPHDB_HEADER_LEN, get_saphdb_pdu_len, dissect_saphdb_tcp, data); } return tvb_reported_length(tvb); } void proto_register_saphdb(void) { static hf_register_info hf[] = { /* Initialization items */ { &hf_saphdb_initialization_request, { "Initialization Request", "saphdb.init_request", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_initialization_reply, { "Initialization Reply", "saphdb.init_reply", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_initialization_reply_product_version_major, { "Product Version Major", "saphdb.init_reply.product_version.major", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_initialization_reply_product_version_minor, { "Product Version Minor", "saphdb.init_reply.product_version.minor", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_initialization_reply_protocol_version_major, { "Protocol Version Major", "saphdb.init_reply.protocol_version.major", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_initialization_reply_protocol_version_minor, { "Protocol Version Minor", "saphdb.init_reply.protocol_version.minor", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* Message Header items */ { &hf_saphdb_message_header, { "Message Header", "saphdb.message_header", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_sessionid, { "Session ID", "saphdb.sessionid", FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_packetcount, { "Packet Count", "saphdb.packetcount", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_varpartlength, { "Var Part Length", "saphdb.varpartlength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_varpartsize, { "Var Part Size", "saphdb.varpartsize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_noofsegm, { "Number of Segments", "saphdb.noofsegm", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_packetoptions, { "Packet Options", "saphdb.packetoptions", FT_INT8, BASE_DEC, VALS(saphdb_message_header_packetoptions_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_compressionvarpartlength, { "Compression Var Part Length", "saphdb.compressionvarpartlength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_message_header_reserved, { "Reserved", "saphdb.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Message Buffer items */ { &hf_saphdb_message_buffer, { "Message Buffer", "saphdb.messagebuffer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_compressed_buffer, { "Compressed Buffer", "saphdb.compressedbuffer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Segment items */ { &hf_saphdb_segment, { "Segment", "saphdb.segment", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_segmentlength, { "Segment Length", "saphdb.segment.length", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_segmentofs, { "Segment Offset", "saphdb.segment.offset", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_noofparts, { "Number of Parts", "saphdb.segment.noofparts", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_segmentno, { "Segment Number", "saphdb.segment.segmentno", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_segmentkind, { "Segment Kind", "saphdb.segment.kind", FT_INT8, BASE_DEC, VALS(saphdb_segment_segmentkind_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_segment_messagetype, { "Message Type", "saphdb.segment.messagetype", FT_INT8, BASE_DEC, VALS(saphdb_segment_messagetype_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_segment_commit, { "Commit", "saphdb.segment.commit", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_commandoptions, { "Command Options", "saphdb.segment.commandoptions", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_segment_functioncode, { "Function Code", "saphdb.segment.functioncode", FT_INT16, BASE_DEC, VALS(saphdb_segment_functioncode_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_segment_reserved, { "Reserved", "saphdb.segment.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Segment Buffer items */ { &hf_saphdb_segment_buffer, { "Segment Buffer", "saphdb.segment.buffer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Part items */ { &hf_saphdb_part, { "Part", "saphdb.segment.part", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_partkind, { "Part Kind", "saphdb.segment.part.partkind", FT_INT8, BASE_DEC, VALS(saphdb_part_partkind_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_part_partattributes, { "Part Attributes", "saphdb.segment.part.partattributes", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_argumentcount, { "Argument Count", "saphdb.segment.part.argumentcount", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_bigargumentcount, { "Big Argument Count", "saphdb.segment.part.bigargumentcount", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_bufferlength, { "Buffer Length", "saphdb.segment.part.bufferlength", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_buffersize, { "Buffer Size", "saphdb.segment.part.buffersize", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* Part Buffer items */ { &hf_saphdb_part_buffer, { "Part Buffer", "saphdb.segment.part.buffer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Part Buffer Option Part Data items */ { &hf_saphdb_part_option_argcount, { "Argument Row Count", "saphdb.segment.part.option.argcount", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_name, { "Option Name", "saphdb.segment.part.option.name", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_type, { "Option Type", "saphdb.segment.part.option.type", FT_INT8, BASE_DEC, VALS(saphdb_part_type_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_length, { "Option Length", "saphdb.segment.part.option.length", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value, { "Option Value", "saphdb.segment.part.option.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_bool, { "Option Value", "saphdb.segment.part.option.value.bool", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_byte, { "Option Value", "saphdb.segment.part.option.value.byte", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_short, { "Option Value", "saphdb.segment.part.option.value.short", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_int, { "Option Value", "saphdb.segment.part.option.value.int", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_bigint, { "Option Value", "saphdb.segment.part.option.value.bigint", FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_string, { "Option Value", "saphdb.segment.part.option.value.string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_option_value_double, { "Option Value", "saphdb.segment.part.option.value.double", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* SAP HDB Part Buffer COMMAND items */ { &hf_saphdb_part_command, { "Command", "saphdb.segment.part.command", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* SAP HDB Part Buffer ERROR items */ { &hf_saphdb_part_error_code, { "Error Code", "saphdb.segment.part.error.code", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_error_position, { "Error Position", "saphdb.segment.part.error.position", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_error_text_length, { "Error Text Length", "saphdb.segment.part.error.text_length", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_error_level, { "Error Level", "saphdb.segment.part.error.level", FT_INT8, BASE_DEC, VALS(saphdb_error_level_vals), 0x0, NULL, HFILL }}, { &hf_saphdb_part_error_sqlstate, { "SQL State", "saphdb.segment.part.error.sqlstate", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_error_text, { "Error Text", "saphdb.segment.part.error.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Part Buffer AUTHENTICATION items */ { &hf_saphdb_part_authentication_field_count, { "Field Count", "saphdb.segment.part.authentication.fieldcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_authentication_field_length, { "Field Length", "saphdb.segment.part.authentication.fieldlength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saphdb_part_authentication_field_value, { "Field Value", "saphdb.segment.part.authentication.fieldvalue", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* SAP HDB Part Buffer CLIENTID items */ { &hf_saphdb_part_clientid, { "Client ID", "saphdb.segment.part.clientid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_saphdb }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_saphdb_compressed_unknown, { "saphdb.compressed", PI_UNDECODED, PI_WARN, "The packet is compressed, and decompression is not supported", EXPFILL }}, { &ei_saphdb_option_part_unknown, { "saphdb.segment.part.option.unknown", PI_UNDECODED, PI_WARN, "The Option Part has a unknown type that is not dissected", EXPFILL }}, { &ei_saphdb_segments_incorrect_order, { "saphdb.segment.segmentno.invalid", PI_MALFORMED, PI_ERROR, "The segments are in incorrect order or are invalid", EXPFILL }}, { &ei_saphdb_segments_number_incorrect, { "saphdb.noofsegm.invalid", PI_MALFORMED, PI_ERROR, "The number of segments is incorrect", EXPFILL }}, { &ei_saphdb_segment_length, { "saphdb.segment.segmentlength.invalid", PI_MALFORMED, PI_ERROR, "The segment length is incorrect", EXPFILL }}, { &ei_saphdb_buffer_length, { "saphdb.segment.part.bufferlength.invalid", PI_MALFORMED, PI_ERROR, "The part buffer length is incorrect", EXPFILL }}, { &ei_saphdb_parts_number_incorrect, { "saphdb.segment.noofparts.invalid", PI_MALFORMED, PI_ERROR, "The number of parts is incorrect", EXPFILL }}, { &ei_saphdb_varpartlenght_incorrect, { "saphdb.varpartlength.invalid", PI_MALFORMED, PI_ERROR, "The length is incorrect", EXPFILL }}, }; module_t *saphdb_module; expert_module_t* saphdb_expert; /* Register the protocol */ proto_saphdb = proto_register_protocol("SAP HANA SQL Command Network Protocol", "SAPHDB", "saphdb"); saphdb_expert = expert_register_protocol(proto_saphdb); expert_register_field_array(saphdb_expert, ei, array_length(ei)); saphdb_handle = register_dissector("saphdb", dissect_saphdb, proto_saphdb); proto_register_field_array(proto_saphdb, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register the preferences */ saphdb_module = prefs_register_protocol(proto_saphdb, proto_reg_handoff_saphdb); range_convert_str(wmem_epan_scope(), &global_saphdb_port_range, SAPHDB_PORT_RANGE, MAX_TCP_PORT); prefs_register_range_preference(saphdb_module, "tcp_ports", "SAP HANA SQL Command Network Protocol port numbers", "Port numbers used for SAP HANA SQL Command Network Protocol (default " SAPHDB_PORT_RANGE ")", &global_saphdb_port_range, MAX_TCP_PORT); prefs_register_bool_preference(saphdb_module, "highlight_unknown_items", "Highlight unknown SAP HANA HDB items", "Whether the SAP HANA HDB Protocol dissector should highlight unknown items (might be noise and generate a lot of expert warnings)", &global_saphdb_highlight_items); } /** * Helpers for dealing with the port range */ static void range_delete_callback (guint32 port, gpointer ptr _U_) { dissector_delete_uint("tcp.port", port, saphdb_handle); } static void range_add_callback (guint32 port, gpointer ptr _U_) { dissector_add_uint("tcp.port", port, saphdb_handle); } /** * Register Hand off for the SAP HDB Protocol */ void proto_reg_handoff_saphdb(void) { static gboolean initialized = FALSE; static range_t *saphdb_port_range; if (!initialized) { saphdb_handle = create_dissector_handle(dissect_saphdb, proto_saphdb); saphdb_handle_tls = register_dissector_with_description("saphdb_tls", "SAPHDB over TLS", dissect_saphdb, proto_saphdb); initialized = TRUE; } else { range_foreach(saphdb_port_range, range_delete_callback, NULL); wmem_free(wmem_epan_scope(), saphdb_port_range); } saphdb_port_range = range_copy(wmem_epan_scope(), global_saphdb_port_range); range_foreach(saphdb_port_range, range_add_callback, NULL); ssl_dissector_add(0, saphdb_handle_tls); gssapi_handle = find_dissector_add_dependency("gssapi", proto_saphdb); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sapigs.c
/* packet-sapigs.c * Routines for SAP IGS (Internet Graphics Server) dissection * Copyright 2022, Yvan Genuer (@iggy38), Devoteam * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a simple dissector for the IGS protocol, initially added by Yvan Genuer as part of their research around the protocol: * https://www.troopers.de/troopers18/agenda/3r38lr/. Some details and example requests can be found in pysap's documentation: * https://pysap.readthedocs.io/en/latest/protocols/SAPIGS.html */ #include <config.h> #include <inttypes.h> #include <stdlib.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <wsutil/strtoi.h> #include <wsutil/wmem/wmem.h> /* * Define default ports. The right range should be 4NNNN, but as port numbers are proprietary and not * IANA assigned, we leave only the ones corresponding to the instance 00. */ #define SAPIGS_PORT_RANGE "40000" /* IGS Functions values */ static const value_string sapigs_function_lst[] = { { 1, "ADM:REGPW"}, /* Register a PortWatcher */ { 2, "ADM:UNREGPW"}, /* Unregsiter a PortWatcher */ { 3, "ADM:REGIP"}, /* Register an Interpreter */ { 4, "ADM:UNREGIP"}, /* Unregsiter an Interpreter */ { 5, "ADM:FREEIP"}, /* Inform than Interpreter is free */ { 6, "ADM:ILLBEBACK"}, /* Call back function */ { 7, "ADM:ABORT"}, /* Abort Interpreter work */ { 8, "ADM:PING"}, /* Ping receive */ { 9, "ADM:PONG"}, /* Ping send */ { 10, "ADM:SHUTDOWNIGS"}, /* Shutdown IGS */ { 11, "ADM:SHUTDOWNPW"}, /* Shutdown PortWatcher */ { 12, "ADM:CHECKCONSUMER"}, /* Check Portwatcher status */ { 13, "ADM:FREECONSUMER"}, /* Inform than portwather is free */ { 14, "ADM:GETLOGFILE"}, /* Display log file */ { 15, "ADM:GETCONFIGFILE"}, /* Display configfile */ { 16, "ADM:GETDUMP"}, /* Display dump file */ { 17, "ADM:DELETEDUMP"}, /* Delete dump file */ { 18, "ADM:INSTALL"}, /* Upload shapefiles for GIS */ { 19, "ADM:SWITCH"}, /* Switch trace log level */ { 20, "ADM:GETVERSION"}, /* Get IGS Version */ { 21, "ADM:STATUS"}, /* Display IGS Status */ { 22, "ADM:STATISTIC"}, /* old Display IGS Statistic */ { 23, "ADM:STATISTICNEW"}, /* Display IGS Statistic */ { 24, "ADM:GETSTATCHART"}, /* Get IGS Statistic chart */ { 25, "ADM:SIM"}, /* Simulation function */ { 30, "ZIPPER"}, /* ZIP provide file(s) */ { 31, "IMGCONV"}, /* Image converter */ { 32, "RSPOCONNECTOR"}, /* Remote Spool Connector */ { 33, "XMLCHART"}, /* Chart generator throught xml input */ { 34, "CHART"}, /* Chart generator throught ABAP Table input */ { 35, "BWGIS"}, /* BW Geographic Information System */ { 36, "SAPGISXML"}, /* old SAP GIS throught xml input */ /* NULL */ { 0, NULL} }; static int proto_sapigs = -1; /* Headers */ static int hf_sapigs_function = -1; static int hf_sapigs_listener = -1; static int hf_sapigs_hostname = -1; static int hf_sapigs_id = -1; static int hf_sapigs_padd1 = -1; static int hf_sapigs_flag1 = -1; static int hf_sapigs_padd2 = -1; static int hf_sapigs_flag2 = -1; static int hf_sapigs_padd3 = -1; /* Data */ static int hf_sapigs_eye_catcher = -1; static int hf_sapigs_padd4 = -1; static int hf_sapigs_codepage = -1; static int hf_sapigs_offset_data = -1; static int hf_sapigs_data_size = -1; static int hf_sapigs_data = -1; /* Table definition */ static int hf_sapigs_tables = -1; static int hf_sapigs_table_version = -1; static int hf_sapigs_table_name = -1; static int hf_sapigs_table_line_number = -1; static int hf_sapigs_table_width = -1; static int hf_sapigs_table_column_name = -1; static int hf_sapigs_table_column_number = -1; static int hf_sapigs_table_column_width = -1; /* Others */ static int hf_sapigs_portwatcher = -1; static int hf_sapigs_portwatcher_version = -1; static int hf_sapigs_portwatcher_info = -1; static int hf_sapigs_interpreter = -1; static int hf_sapigs_chart_config = -1; static gint ett_sapigs = -1; /* Global port preference */ static range_t *global_sapigs_port_range; /* Global highlight preference */ static gboolean global_sapigs_highlight_items = TRUE; /* Protocol handle */ static dissector_handle_t sapigs_handle; void proto_reg_handoff_sapigs(void); void proto_register_sapigs(void); static int dissect_sapigs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint32 offset = 0, err_val = 0; gint data_offset = 0, data_length = 0; gchar *sapigs_info_function = NULL, *illbeback_type = NULL, *is_table = NULL; proto_item *ti = NULL, *sapigs_tables = NULL; proto_tree *sapigs_tree = NULL, *sapigs_tables_tree = NULL; /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, "SAPIGS"); /* Add function name in the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, " function: %s", tvb_get_string_enc(pinfo->pool, tvb, 0, 32, ENC_ASCII)); /* Add the main sapigs subtree */ ti = proto_tree_add_item(tree, proto_sapigs, tvb, 0, -1, ENC_NA); sapigs_tree = proto_item_add_subtree(ti, ett_sapigs); /* Retrieve function name */ sapigs_info_function = (char *)tvb_get_string_enc(pinfo->pool, tvb, offset, 32, ENC_ASCII); /* Headers */ proto_tree_add_item(sapigs_tree, hf_sapigs_function, tvb, offset, 32, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_listener, tvb, offset, 32, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_hostname, tvb, offset, 81, ENC_ASCII|ENC_NA); offset += 81; proto_tree_add_item(sapigs_tree, hf_sapigs_id, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; proto_tree_add_item(sapigs_tree, hf_sapigs_padd1, tvb, offset, 15, ENC_ASCII); offset += 15; proto_tree_add_item(sapigs_tree, hf_sapigs_flag1, tvb, offset, 1, ENC_ASCII); offset += 1; proto_tree_add_item(sapigs_tree, hf_sapigs_padd2, tvb, offset, 20, ENC_ASCII); offset += 20; proto_tree_add_item(sapigs_tree, hf_sapigs_flag2, tvb, offset, 1, ENC_ASCII); offset += 1; proto_tree_add_item(sapigs_tree, hf_sapigs_padd3, tvb, offset, 6, ENC_ASCII); offset += 6; /* switch over function name value */ switch (str_to_val(sapigs_info_function, sapigs_function_lst, err_val)){ case 8:{ /* ADM:PING */ proto_tree_add_item(sapigs_tree, hf_sapigs_portwatcher, tvb, offset, 5, ENC_ASCII|ENC_NA); break; } case 9:{ /* ADM:PONG */ break; } case 1:{ /* ADM:REGPW */ proto_tree_add_item(sapigs_tree, hf_sapigs_portwatcher, tvb, offset, 5, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_portwatcher_version, tvb, offset, 16, ENC_ASCII|ENC_NA); break; } case 3: /* ADM:REGIP */ case 5:{ /* ADM:FREEIP */ proto_tree_add_item(sapigs_tree, hf_sapigs_portwatcher, tvb, offset, 5, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_interpreter, tvb, offset, 16, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_portwatcher_version, tvb, offset, 16, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_portwatcher_info, tvb, offset, 16, ENC_ASCII|ENC_NA); break; } case 6:{ /* ADM:ILLBEBACK */ illbeback_type = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 10, ENC_ASCII|ENC_NA); if (strncmp("TransMagic", illbeback_type, 10) == 0){ /* data is raw after eye_catcher */ proto_tree_add_item(sapigs_tree, hf_sapigs_eye_catcher, tvb, offset, 10, ENC_ASCII|ENC_NA); offset += 16; proto_tree_add_item(sapigs_tree, hf_sapigs_data, tvb, offset, -1, ENC_NA); } else { /* we receive sized data */ ws_strtoi((gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 5, ENC_ASCII), NULL, &data_length); proto_tree_add_item(sapigs_tree, hf_sapigs_data_size, tvb, offset, 5, ENC_ASCII|ENC_NA); offset += 5; /* Data */ if ((data_length > 0) && (tvb_reported_length_remaining(tvb, offset) >= data_length)) { proto_tree_add_item(sapigs_tree, hf_sapigs_data, tvb, offset, data_length, ENC_NA); } } break; } case 30: /* ZIPPER */ case 31: /* IMGCONV */ case 33: /* XMLCHART */ case 16:{ /* ADM:GETDUMP */ proto_tree_add_item(sapigs_tree, hf_sapigs_eye_catcher, tvb, offset, 10, ENC_ASCII|ENC_NA); offset += 10; proto_tree_add_item(sapigs_tree, hf_sapigs_padd4, tvb, offset, 2, ENC_ASCII); offset += 2; proto_tree_add_item(sapigs_tree, hf_sapigs_codepage, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; /* Data offset */ ws_strtoi((gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 16, ENC_ASCII), NULL, &data_offset); proto_tree_add_item(sapigs_tree, hf_sapigs_offset_data, tvb, offset, 16, ENC_ASCII|ENC_NA); offset += 16; /* Data length */ ws_strtoi((gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 16, ENC_ASCII), NULL, &data_length); proto_tree_add_item(sapigs_tree, hf_sapigs_data_size, tvb, offset, 16, ENC_ASCII|ENC_NA); offset += 16; data_offset += offset; /* Definition tables */ is_table = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII); /* if the 4 next char is VERS, we are at the begining of one definition table */ while(strncmp("VERS", is_table, 4) == 0){ /* Build a tree for Tables */ sapigs_tables = proto_tree_add_item(sapigs_tree, hf_sapigs_tables, tvb, offset, 336, ENC_NA); sapigs_tables_tree = proto_item_add_subtree(sapigs_tables, ett_sapigs); proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_version, tvb, offset+8, 40, ENC_ASCII); offset += 48; proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_name, tvb, offset+8, 40, ENC_ASCII); offset += 48; proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_line_number, tvb, offset+8, 40, ENC_ASCII); offset += 48; proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_width, tvb, offset+8, 40, ENC_ASCII); offset += 48; proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_column_name, tvb, offset+8, 40, ENC_ASCII); offset += 48; proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_column_number, tvb, offset+8, 40, ENC_ASCII); offset += 48; proto_tree_add_item(sapigs_tables_tree, hf_sapigs_table_column_width, tvb, offset+8, 40, ENC_ASCII); offset += 48; is_table = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII); } /* Data */ if ((data_length > 0) && (tvb_reported_length_remaining(tvb, offset) >= data_length)) { proto_tree_add_item(sapigs_tree, hf_sapigs_data, tvb, data_offset, data_length, ENC_NA); } break; } case 34:{ /* CHART */ proto_tree_add_item(sapigs_tree, hf_sapigs_chart_config, tvb, offset, 32, ENC_ASCII|ENC_NA); offset += 32; proto_tree_add_item(sapigs_tree, hf_sapigs_data, tvb, offset, -1, ENC_NA); break; } } return tvb_reported_length(tvb); } void proto_register_sapigs(void) { static hf_register_info hf[] = { /* General Header fields */ { &hf_sapigs_function, { "Function", "sapigs.function", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_listener, { "Listener", "sapigs.listener", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_hostname, { "Hostname", "sapigs.hostname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_id, { "Id", "sapigs.id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_padd1, { "Padd1", "sapigs.padd1", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_flag1, { "Flag1", "sapigs.flag1", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_padd2, { "Padd2", "sapigs.padd2", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_flag2, { "Flag2", "sapigs.flag2", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_padd3, { "Padd3", "sapigs.padd3", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Data headers */ { &hf_sapigs_eye_catcher, { "Eye catcher", "sapigs.eye_catcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_padd4, { "Padd4", "sapigs.padd4", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_codepage, { "Codepage", "sapigs.codepage", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_offset_data, { "Offset to data", "sapigs.offset_data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_data_size, { "Data size", "sapigs.data_size", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Portwatcher fields */ { &hf_sapigs_portwatcher, { "Portwatcher Port", "sapigs.portwatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_portwatcher_version, { "Portwatcher version", "sapigs.portwatcher_version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_portwatcher_info, { "Portwatcher Info", "sapigs.portwatcher_info", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Interpreter information */ { &hf_sapigs_interpreter, { "Interpreter name", "sapigs.interpreter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_chart_config, { "Chart configuration", "sapigs.chart_config", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Table definition fields */ { &hf_sapigs_tables, { "Table definition", "sapigs.tables", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapigs_table_version, { "VERS", "sapigs.table_version", FT_STRING, BASE_NONE, NULL, 0x0, "Table version", HFILL }}, { &hf_sapigs_table_name, { "TBNM", "sapigs.table_name", FT_STRING, BASE_NONE, NULL, 0x0, "Table name", HFILL }}, { &hf_sapigs_table_line_number, { "TBLN", "sapigs.table_line_number", FT_STRING, BASE_NONE, NULL, 0x0, "Line count", HFILL }}, { &hf_sapigs_table_width, { "TBWD", "sapigs.table_width", FT_STRING, BASE_NONE, NULL, 0x0, "Table width", HFILL }}, { &hf_sapigs_table_column_name, { "TBCL", "sapigs.table_column_name", FT_STRING, BASE_NONE, NULL, 0x0, "Table column name", HFILL }}, { &hf_sapigs_table_column_number, { "CLNM", "sapigs.table_column_number", FT_STRING, BASE_NONE, NULL, 0x0, "Column count", HFILL }}, { &hf_sapigs_table_column_width, { "CLWD", "sapigs.table_column_width", FT_STRING, BASE_NONE, NULL, 0x0, "Column width", HFILL }}, /* Data */ { &hf_sapigs_data, { "Data", "sapigs.table_data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; /* Setup protocol subtre array */ static gint *ett[] = { &ett_sapigs }; module_t *sapigs_module; /* Register the protocol */ proto_sapigs = proto_register_protocol("SAP Internet Graphic Server", "SAPIGS", "sapigs"); register_dissector("sapigs", dissect_sapigs, proto_sapigs); proto_register_field_array(proto_sapigs, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register the preferences */ sapigs_module = prefs_register_protocol(proto_sapigs, proto_reg_handoff_sapigs); range_convert_str(wmem_epan_scope(), &global_sapigs_port_range, SAPIGS_PORT_RANGE, MAX_TCP_PORT); prefs_register_range_preference(sapigs_module, "tcp_ports", "SAP IGS Protocol TCP port numbers", "Port numbers used for SAP IGS Protocol (default "SAPIGS_PORT_RANGE ")", &global_sapigs_port_range, MAX_TCP_PORT); prefs_register_bool_preference(sapigs_module, "highlight_unknow_items", "Highlight unknow SAP IGS messages", "Wether the SAP IGS Protocol dissector should highlight unknown IGS messages", &global_sapigs_highlight_items); } /** * Helpers for dealing with the port range */ static void range_delete_callback (guint32 port, gpointer ptr _U_) { dissector_delete_uint("sapni.port", port, sapigs_handle); } static void range_add_callback (guint32 port, gpointer ptr _U_) { dissector_add_uint("sapni.port", port, sapigs_handle); } /** * Register Hand off for the SAP IGS Protocol */ void proto_reg_handoff_sapigs(void) { static range_t *sapigs_port_range; static gboolean initialized = FALSE; if (!initialized) { sapigs_handle = create_dissector_handle(dissect_sapigs, proto_sapigs); initialized = TRUE; } else { range_foreach(sapigs_port_range, range_delete_callback, NULL); wmem_free(wmem_epan_scope(), sapigs_port_range); } sapigs_port_range = range_copy(wmem_epan_scope(), global_sapigs_port_range); range_foreach(sapigs_port_range, range_add_callback, NULL); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sapms.c
/* packet-sapms.c * Routines for SAP MS (Message Server) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a simple dissector for the SAP MS protocol. * * Some details and example requests can be found in pysap's documentation: https://pysap.readthedocs.io/en/latest/protocols/SAPMS.html. */ #include <config.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <wsutil/wmem/wmem.h> /* Define default ports. The right range should be 36NN and 39NN, but as port numbers are proprietary and not * IANA assigned, we leave only the ones corresponding to the instance 00. */ #define SAPMS_PORT_RANGE "3600,3900" /* MS Domain values */ static const value_string sapms_domain_vals[] = { { 0x00, "ABAP" }, { 0x01, "J2EE" }, { 0x02, "JSTARTUP" }, /* NULL */ { 0, NULL } }; /* MS Flag values */ static const value_string sapms_flag_vals[] = { { 1, "MS_ONE_WAY" }, { 2, "MS_REQUEST" }, { 3, "MS_REPLY" }, { 4, "MS_ADMIN" }, /* NULL */ { 0, NULL } }; /* MS IFlag values */ static const value_string sapms_iflag_vals[] = { { 1, "MS_SEND_NAME" }, { 2, "MS_SEND_TYPE" }, { 3, "MS_LOGIN" }, { 4, "MS_LOGOUT" }, { 5, "MS_ADM_OPCODES" }, { 6, "MS_MOD_MSGTYPES" }, { 7, "MS_SEND_TYPE_ONCE" }, { 8, "MS_LOGIN_2" }, { 9, "MS_MOD_STATE" }, { 10, "MS_J2EE_LOGIN" }, { 12, "MS_J2EE_SEND_TO_CLUSTERID" }, { 13, "MS_J2EE_SEND_BROADCAST" }, { 14, "MS_SEND_TYPE_ACK" }, { 15, "MS_J2EE_LOGIN_2" }, { 16, "MS_SEND_SERVICE" }, { 17, "MS_J2EE_LOGIN_3" }, { 18, "MS_J2EE_LOGIN_4" }, /* NULL */ { 0, NULL } }; /* MS Error number values */ static const value_string sapms_errorno_vals[] = { { 0, "MSERECONNECTION" }, { 1, "MSENISELWRITE" }, { 2, "MSENISELREAD" }, { 3, "MSENIQUEUE" }, { 4, "MSENILAYER" }, { 71, "MSETESTSOFTSHUTDOWN" }, { 72, "MSENOTINIT" }, { 73, "MSEALREADYINIT" }, { 74, "MSEINVHDL" }, { 75, "MSEWRONGSERVER" }, { 76, "MSEMOREDATA" }, { 77, "MSESNDTYPEFAILED" }, { 78, "MSEDUPKEY" }, { 79, "MSESOFTSHUTDOWN" }, { 81, "MSENOMEM" }, { 82, "MSEHEADERINCOMPLETE" }, { 83, "MSETYPESNOTALLOWED" }, { 84, "MSEACCESSDENIED" }, { 85, "MSEWRITEINCOMPLETE" }, { 86, "MSEREADINCOMPLETE" }, { 87, "MSEADMIN" }, { 88, "MSESOCKTOOLARGE" }, { 89, "MSENOSLOTFREE" }, { 90, "MSESHUTDOWN" }, { 91, "MSEREPLYTOOLARGE" }, { 92, "MSEWRONGVERSION" }, { 93, "MSEMSGDESTROYED" }, { 94, "MSENOTUNIQUE" }, { 95, "MSEPARTNERUNKNOWN" }, { 96, "MSEPARTNERDIED" }, { 97, "MSEWRONGTYPE" }, { 98, "MSEWRONGNAME" }, { 99, "MSEWAKEUP" }, { 100, "MSENOTFOUND" }, { 101, "MSEINVAL" }, { 102, "MSENOMSG" }, { 103, "MSEINTERN" }, /* NULL */ { 0, NULL } }; /* MS Adm Message Types values */ static const value_string sapms_adm_msgtype_vals[] = { { 1, "ADM_REQUEST" }, { 2, "ADM_REPLY" }, /* NULL */ { 0, NULL } }; /* MS Adm Record Opcode values */ static const value_string sapms_adm_record_opcode_vals[] = { { 0x00, "AD_GENERAL" }, { 0x01, "AD_PROFILE" }, { 0x02, "AD_WPSTAT" }, { 0x03, "AD_QUEUE" }, { 0x04, "AD_STARTSTOP" }, { 0x05, "AD_WPCONF" }, { 0x06, "AD_USRLST" }, { 0x07, "AD_WPKILL" }, { 0x08, "AD_TIMEINFO" }, { 0x09, "AD_TM_RECONNECT" }, { 0x0a, "AD_ALRT_GET_STATE" }, { 0x0b, "AD_ALRT_OPERATION" }, { 0x0c, "AD_ALRT_SET_PARAM" }, { 0x0d, "AD_DB_RECONNECT" }, { 0x0e, "AD_ECHO" }, { 0x0f, "AD_MSGSERVER" }, { 0x10, "AD_WPCONF2" }, { 0x11, "AD_GENERAL2" }, { 0x12, "AD_SET_LIST_PARAM" }, { 0x13, "AD_DUMP_STATUS" }, { 0x14, "AD_RZL" }, { 0x15, "AD_RZL_STRG" }, { 0x16, "AD_COUNT_WPS" }, { 0x17, "AD_QUEUE2" }, { 0x19, "AD_EM" }, { 0x1a, "AD_ES" }, { 0x1b, "AD_SHUTDOWN_STATE" }, { 0x1c, "AD_SHUTDOWN_INFO" }, { 0x1d, "AD_SHUTDOWN_ERROR" }, { 0x1f, "AD_DISPLACE" }, { 0x20, "AD_GET_TIMETAB" }, { 0x21, "AD_SET_TIMETAB" }, { 0x28, "AD_MSBUF" }, { 0x29, "AD_ARFC_NOREQ" }, { 0x2a, "AD_ENQID_INFO" }, { 0x2b, "AD_DEL_USER" }, { 0x2c, "AD_SPO_ADM" }, { 0x2d, "AD_NTAB_SYNC" }, { 0x2e, "AD_SHARED_PARAMETER" }, { 0x2f, "AD_RESET_TRACE" }, { 0x30, "AD_RESET_USR02" }, { 0x31, "AD_WALL_CREATE" }, { 0x32, "AD_WALL_DELETE" }, { 0x33, "AD_WALL_MODIFY" }, { 0x34, "AD_SERVER_STATE" }, { 0x3c, "AD_SELFIDENT" }, { 0x3d, "AD_DP_TRACE_CHANGE" }, { 0x3e, "AD_DP_DUMP_NIHDL" }, { 0x3f, "AD_DP_CALL_DELAYED" }, { 0x40, "AD_GW_ADM" }, { 0x41, "AD_DP_WAKEUP_MODE" }, { 0x42, "AD_VMC_SYS_EVENT" }, { 0x43, "AD_SHARED_PARAM_ALL_WPS" }, { 0x44, "AD_SECSESSION_UPDATE" }, { 0x45, "AD_SECSESSION_TERMINATE" }, { 0x46, "AD_ASRF_REQUEST" }, { 0x47, "AD_GET_NILIST" }, { 0x48, "AD_LOAD_INFO" }, { 0x49, "AD_TEST" }, { 0x4a, "AD_HANDLE_ACL" }, { 0x4b, "AD_PROFILE2" }, { 0x4c, "AD_RSCP_ASYNC" }, { 0x4d, "AD_BATCH_INFO" }, { 0x4e, "AD_SOFT_CANCEL" }, { 0x55, "AD_SYNC_LOAD_FMT" }, { 0x56, "AD_GET_NILIST_PORT" }, /* NULL */ { 0x00, NULL } }; /* MS Adm AD_RZL_STRG Type values */ static const value_string sapms_adm_rzl_strg_type_vals[] = { { 10, "STRG_TYPE_READALL" }, { 11, "STRG_TYPE_READALL_I" }, { 12, "STRG_TYPE_READALL_C" }, { 13, "STRG_TYPE_READALL_LC" }, { 15, "STRG_TYPE_READALL_OFFSET_I" }, { 16, "STRG_TYPE_READALL_OFFSET_C" }, { 17, "STRG_TYPE_READALL_OFFSET_LC" }, { 20, "STRG_TYPE_READALL_OFFSET" }, { 21, "STRG_TYPE_READ_I" }, { 22, "STRG_TYPE_READ_C" }, { 23, "STRG_TYPE_READ_LC" }, { 31, "STRG_TYPE_WRITE_I" }, { 32, "STRG_TYPE_WRITE_C" }, { 33, "STRG_TYPE_WRITE_LC" }, { 41, "STRG_TYPE_DEL_I" }, { 42, "STRG_TYPE_DEL_C" }, { 43, "STRG_TYPE_DEL_LC" }, { 51, "STRG_TYPE_CREATE_I" }, { 52, "STRG_TYPE_CREATE_C" }, { 53, "STRG_TYPE_CREATE_LC" }, { 90, "STRG_TYPE_DUMP" }, /* NULL */ { 0, NULL } }; /* MS OP Code values */ static const value_string sapms_opcode_vals[] = { { 0, "MS_DP_ADM" }, { 1, "MS_SERVER_CHG" }, { 2, "MS_SERVER_ADD" }, { 3, "MS_SERVER_SUB" }, { 4, "MS_SERVER_MOD" }, { 5, "MS_SERVER_LST" }, { 6, "MS_CHANGE_IP" }, { 7, "MS_SET_SECURITY_KEY" }, { 8, "MS_GET_SECURITY_KEY" }, { 9, "MS_GET_SECURITY_KEY2" }, { 10, "MS_GET_HWID" }, { 11, "MS_INCRE_TRACE" }, { 12, "MS_DECRE_TRACE" }, { 13, "MS_RESET_TRACE" }, { 14, "MS_ACT_STATISTIC" }, { 15, "MS_DEACT_STATISTIC" }, { 16, "MS_RESET_STATISTIC" }, { 17, "MS_GET_STATISTIC" }, { 18, "MS_DUMP_NIBUFFER" }, { 19, "MS_RESET_NIBUFFER" }, { 20, "MS_OPEN_REQ_LST" }, { 21, "MS_SERVER_INFO" }, { 22, "MS_SERVER_LIST" }, { 23, "MS_SERVER_ENTRY" }, { 24, "MS_DOMAIN_INFO" }, { 25, "MS_DOMAIN_LIST" }, { 26, "MS_DOMAIN_ENTRY" }, { 27, "MS_MAP_URL_TO_ADDR" }, { 28, "MS_GET_CODEPAGE" }, { 29, "MS_SOFT_SHUTDOWN" }, { 30, "MS_DUMP_INFO" }, { 31, "MS_FILE_RELOAD" }, { 32, "MS_RESET_DOMAIN_CONN" }, { 33, "MS_NOOP" }, { 34, "MS_SET_TXT" }, { 35, "MS_GET_TXT" }, { 36, "MS_COUNTER_CREATE" }, { 37, "MS_COUNTER_DELETE" }, { 38, "MS_COUNTER_INCREMENT" }, { 39, "MS_COUNTER_DECREMENT" }, { 40, "MS_COUNTER_REGISTER" }, { 41, "MS_COUNTER_GET" }, { 42, "MS_COUNTER_LST" }, { 43, "MS_SET_LOGON" }, { 44, "MS_GET_LOGON" }, { 45, "MS_DEL_LOGON" }, { 46, "MS_SERVER_DISC" }, { 47, "MS_SERVER_SHUTDOWN" }, { 48, "MS_SERVER_SOFT_SHUTDOWN" }, { 49, "MS_J2EE_CLUSTERNODE_CHG" }, { 50, "MS_J2EE_CLUSTERNODE_ADD" }, { 51, "MS_J2EE_CLUSTERNODE_SUB" }, { 52, "MS_J2EE_CLUSTERNODE_MOD" }, { 53, "MS_J2EE_CLUSTERNODE_LST" }, { 54, "MS_J2EE_SERVICE_REG" }, { 55, "MS_J2EE_SERVICE_UNREG" }, { 56, "MS_J2EE_SERVICE_LST" }, { 57, "MS_J2EE_SERVICE_ADD" }, { 58, "MS_J2EE_SERVICE_SUB" }, { 59, "MS_J2EE_SERVICE_MOD" }, { 60, "MS_J2EE_MOD_STATE" }, { 61, "MS_J2EE_SERVICE_GET" }, { 62, "MS_J2EE_SERVICE_REG2" }, { 63, "MS_NITRACE_SETGET" }, { 64, "MS_SERVER_LONG_LIST" }, { 65, "MS_J2EE_DEBUG_ENABLE" }, { 66, "MS_J2EE_DEBUG_DISABLE" }, { 67, "MS_SET_PROPERTY" }, { 68, "MS_GET_PROPERTY" }, { 69, "MS_DEL_PROPERTY" }, { 70, "MS_IP_PORT_TO_NAME" }, { 71, "MS_CHECK_ACL" }, { 72, "MS_LICENSE_SRV" }, { 74, "MS_SERVER_TEST_SOFT_SHUTDOWN" }, { 75, "MS_J2EE_RECONNECT_P1" }, { 76, "MS_J2EE_RECONNECT_P2" }, /* NULL */ { 0, NULL }, }; /* MS OP Code Error values */ static const value_string sapms_opcode_error_vals[] = { { 0, "MSOP_OK" }, { 1, "MSOP_UNKNOWN_OPCODE" }, { 2, "MSOP_NOMEM" }, { 3, "MSOP_SECURITY_KEY_NOTSET" }, { 4, "MSOP_UNKNOWN_CLIENT" }, { 5, "MSOP_ACCESS_DENIED" }, { 6, "MSOP_REQUEST_REQUIRED" }, { 7, "MSOP_NAME_REQUIRED" }, { 8, "MSOP_GET_HWID_FAILED" }, { 9, "MSOP_SEND_FAILED" }, { 10, "MSOP_UNKNOWN_DOMAIN" }, { 11, "MSOP_UNKNOWN_SERVER" }, { 12, "MSOP_NO_DOMAIN_SERVER" }, { 13, "MSOP_INVALID_URL" }, { 14, "MSOP_UNKNOWN_DUMP_REQ" }, { 15, "MSOP_FILENOTFOUND" }, { 16, "MSOP_UNKNOWN_RELOAD_REQ" }, { 17, "MSOP_FILENOTDEFINED" }, { 18, "MSOP_CONVERT_FAILED" }, { 19, "MSOP_NOTSET" }, { 20, "MSOP_COUNTER_EXCEEDED" }, { 21, "MSOP_COUNTER_NOTFOUND" }, { 22, "MSOP_COUNTER_DELETED" }, { 23, "MSOP_COUNTER_EXISTS" }, { 24, "MSOP_EINVAL" }, { 25, "MSOP_NO_J2EE_CLUSTERNODE" }, { 26, "MSOP_UNKNOWN_PROPERTY" }, { 27, "MSOP_UNKNOWN_VERSION" }, { 28, "MSOP_ICTERROR" }, { 29, "MSOP_KERNEL_INCOMPATIBLE" }, { 30, "MSOP_NIACLCREATE_FAILED" }, { 31, "MSOP_NIACLSYNTAX_ERROR" }, /* NULL */ { 0, NULL }, }; /* MS Set/Get Property ID values */ static const value_string sapms_property_id_vals[] = { { 1, "MS_PROPERTY_TEXT" }, { 2, "MS_PROPERTY_VHOST" }, { 3, "MS_PROPERTY_IPADR" }, { 4, "MS_PROPERTY_PARAM" }, { 5, "MS_PROPERTY_SERVICE" }, { 6, "MS_PROPERTY_DELALT" }, { 7, "Release information" }, /* NULL */ { 0, NULL }, }; /* MS Dump Info Dump values */ static const value_string sapms_dump_command_vals[] = { { 1, "MS_DUMP_MSADM" }, { 2, "MS_DUMP_CON" }, { 3, "MS_DUMP_PARAMS" }, { 4, "MS_DUMP_ALL_CLIENTS" }, { 5, "MS_DUMP_ALL_SERVER" }, { 6, "MS_DUMP_ALL_DOMAIN" }, { 7, "MS_DUMP_DOMAIN_CONN" }, { 8, "MS_DUMP_RELEASE" }, { 9, "MS_DUMP_SIZEOF" }, { 10, "MS_DUMP_FIADM" }, { 11, "MS_DUMP_FICON" }, { 12, "MS_DUMP_COUNTER" }, { 13, "MS_DUMP_STATISTIC" }, { 14, "MS_DUMP_NIBUF" }, { 15, "MS_DUMP_URLMAP" }, { 16, "MS_DUMP_URLPREFIX" }, { 17, "MS_DUMP_URLHANDLER" }, { 18, "MS_DUMP_NOSERVER" }, { 19, "MS_DUMP_ACLINFO" }, { 20, "MS_DUMP_PERMISSION_TABLE" }, { 21, "MS_DUMP_J2EE_CLUSTER_STAT" }, { 22, "MS_DUMP_ACL_FILE_EXT" }, { 23, "MS_DUMP_ACL_FILE_INT" }, { 24, "MS_DUMP_ACL_FILE_ADMIN" }, { 25, "MS_DUMP_ACL_FILE_EXTBND" }, { 26, "MS_DUMP_ACL_FILE_HTTP" }, { 27, "MS_DUMP_ACL_FILE_HTTPS" }, /* NULL */ { 0, NULL }, }; /* MS Reload file values */ static const value_string sapms_file_reload_vals[] = { { 1, "MS_RELOAD_CLIENT_TAB" }, { 2, "MS_RELOAD_SERVER_TAB" }, { 3, "MS_RELOAD_DOMAIN_TAB" }, { 4, "MS_RELOAD_URLMAP" }, { 5, "MS_RELOAD_URLPREFIX" }, { 6, "MS_RELOAD_ACL_INFO" }, { 7, "MS_RELOAD_PERMISSION_TABLE" }, { 8, "MS_RELOAD_STOC" }, { 9, "MS_RELOAD_ACL_FILE_EXT" }, { 10, "MS_RELOAD_ACL_FILE_INT" }, { 11, "MS_RELOAD_ACL_FILE_ADMIN" }, { 12, "MS_RELOAD_ACL_FILE_EXTBND" }, { 13, "MS_RELOAD_ACL_FILE_HTTP" }, { 14, "MS_RELOAD_ACL_FILE_HTTPS" }, /* NULL */ { 0, NULL } }; /* MS Logon Type values */ static const value_string sapms_logon_type_vals[] = { { 0, "MS_LOGON_DIAG_LB" }, { 1, "MS_LOGON_DIAG_LBS" }, { 2, "MS_LOGON_DIAG" }, { 3, "MS_LOGON_DIAGS" }, { 4, "MS_LOGON_RFC" }, { 5, "MS_LOGON_RFCS" }, { 6, "MS_LOGON_HTTP" }, { 7, "MS_LOGON_HTTPS" }, { 8, "MS_LOGON_FTP" }, { 9, "MS_LOGON_SMTP" }, { 10, "MS_LOGON_NNTP" }, { 11, "MS_LOGON_DIAG_E" }, { 12, "MS_LOGON_DIAGS_E" }, { 13, "MS_LOGON_RFC_E" }, { 14, "MS_LOGON_RFCS_E" }, { 15, "MS_LOGON_HTTP_E" }, { 16, "MS_LOGON_HTTPS_E" }, { 17, "MS_LOGON_FTP_E" }, { 18, "MS_LOGON_SMTP_E" }, { 19, "MS_LOGON_NNTP_E" }, { 20, "MS_LOGON_J2EE" }, { 21, "MS_LOGON_J2EES" }, { 22, "MS_LOGON_J2EE_E" }, { 23, "MS_LOGON_J2EES_E" }, { 24, "MS_LOGON_P4" }, { 25, "MS_LOGON_P4S" }, { 26, "MS_LOGON_IIOP" }, { 27, "MS_LOGON_IIOPS" }, { 28, "MS_LOGON_SDM" }, { 29, "MS_LOGON_TELNET" }, { 30, "MS_LOGON_DEBUG" }, { 31, "MS_LOGON_DPROXY" }, { 32, "MS_LOGON_P4HTTP" }, { 33, "MS_LOGON_HTTPRI" }, { 34, "MS_LOGON_HTTPSRI" }, { 35, "MS_LOGON_J2EERI" }, { 36, "MS_LOGON_J2EESRI" }, { 37, "MS_LOGON_TRXNS" }, /* NULL */ { 0, NULL } }; /* MS Client Status values */ static const value_string sapms_server_lst_status_vals[] = { { 0, "MS_STATE_UNKNOWN" }, { 1, "ACTIVE" }, { 2, "INACTIVE" }, { 3, "MS_STATE_SHUTDOWN" }, { 4, "MS_STATE_STOP" }, { 5, "MS_STATE_STARTING" }, { 6, "MS_STATE_INIT" }, /* NULL */ { 0, NULL } }; /* Message Type values */ #define SAPMS_MSG_TYPE_DIA 0x01 #define SAPMS_MSG_TYPE_UPD 0x02 #define SAPMS_MSG_TYPE_ENQ 0x04 #define SAPMS_MSG_TYPE_BTC 0x08 #define SAPMS_MSG_TYPE_SPO 0x10 #define SAPMS_MSG_TYPE_UP2 0x20 #define SAPMS_MSG_TYPE_ATP 0x40 #define SAPMS_MSG_TYPE_ICM 0x80 static int proto_sapms = -1; static int hf_sapms_eyecatcher = -1; static int hf_sapms_version = -1; static int hf_sapms_errorno = -1; static int hf_sapms_toname = -1; static int hf_sapms_msgtypes = -1; static int hf_sapms_msgtypes_dia = -1; static int hf_sapms_msgtypes_upd = -1; static int hf_sapms_msgtypes_enq = -1; static int hf_sapms_msgtypes_btc = -1; static int hf_sapms_msgtypes_spo = -1; static int hf_sapms_msgtypes_up2 = -1; static int hf_sapms_msgtypes_atp = -1; static int hf_sapms_msgtypes_icm = -1; static int hf_sapms_domain = -1; static int hf_sapms_reserved = -1; static int hf_sapms_key = -1; static int hf_sapms_flag = -1; static int hf_sapms_iflag = -1; static int hf_sapms_fromname = -1; static int hf_sapms_diagport = -1; static int hf_sapms_dp_adm_dp_version = -1; static int hf_sapms_adm_eyecatcher = -1; static int hf_sapms_adm_version = -1; static int hf_sapms_adm_msgtype = -1; static int hf_sapms_adm_recsize = -1; static int hf_sapms_adm_recno = -1; static int hf_sapms_adm_record = -1; static int hf_sapms_adm_record_opcode = -1; static int hf_sapms_adm_record_serial_number = -1; static int hf_sapms_adm_record_executed = -1; static int hf_sapms_adm_record_errorno = -1; static int hf_sapms_adm_record_value = -1; static int hf_sapms_adm_parameter = -1; static int hf_sapms_adm_rzl_strg_type = -1; static int hf_sapms_adm_rzl_strg_name = -1; static int hf_sapms_adm_rzl_strg_value = -1; static int hf_sapms_adm_rzl_strg_value_integer = -1; static int hf_sapms_adm_rzl_strg_uptime = -1; static int hf_sapms_adm_rzl_strg_delay = -1; static int hf_sapms_adm_rzl_strg_users = -1; static int hf_sapms_adm_rzl_strg_quality = -1; static int hf_sapms_opcode = -1; static int hf_sapms_opcode_error = -1; static int hf_sapms_opcode_version = -1; static int hf_sapms_opcode_charset = -1; static int hf_sapms_opcode_value = -1; static int hf_sapms_property_client = -1; static int hf_sapms_property_id = -1; static int hf_sapms_property_value = -1; static int hf_sapms_property_vhost_logon = -1; static int hf_sapms_property_vhost_length = -1; static int hf_sapms_property_vhost_value = -1; static int hf_sapms_property_ip_address = -1; static int hf_sapms_property_ip_address6 = -1; static int hf_sapms_property_param_name_length = -1; static int hf_sapms_property_param_name_value = -1; static int hf_sapms_property_param_value_length = -1; static int hf_sapms_property_param_value_value = -1; static int hf_sapms_property_service_number = -1; static int hf_sapms_property_service_value = -1; static int hf_sapms_property_release = -1; static int hf_sapms_property_release_patchno = -1; static int hf_sapms_property_release_supplvl = -1; static int hf_sapms_property_release_platform = -1; static int hf_sapms_text_name = -1; static int hf_sapms_text_length = -1; static int hf_sapms_text_value = -1; static int hf_sapms_counter_uuid = -1; static int hf_sapms_counter_count = -1; static int hf_sapms_counter_no = -1; static int hf_sapms_change_ip_address = -1; static int hf_sapms_change_ip_address6 = -1; static int hf_sapms_security_name = -1; static int hf_sapms_security_key = -1; static int hf_sapms_security_port = -1; static int hf_sapms_security_address = -1; static int hf_sapms_security_address6 = -1; static int hf_sapms_file_reload = -1; static int hf_sapms_file_filler = -1; static int hf_sapms_logon_type = -1; static int hf_sapms_logon_port = -1; static int hf_sapms_logon_address = -1; static int hf_sapms_logon_name_length = -1; static int hf_sapms_logon_name = -1; static int hf_sapms_logon_prot_length = -1; static int hf_sapms_logon_prot = -1; static int hf_sapms_logon_host_length = -1; static int hf_sapms_logon_host = -1; static int hf_sapms_logon_misc_length = -1; static int hf_sapms_logon_misc = -1; static int hf_sapms_logon_address6_length = -1; static int hf_sapms_logon_address6 = -1; static int hf_sapms_logon_end = -1; static int hf_sapms_shutdown_reason_length = -1; static int hf_sapms_shutdown_reason = -1; static int hf_sapms_ip_to_name_address4 = -1; static int hf_sapms_ip_to_name_address6 = -1; static int hf_sapms_ip_to_name_port = -1; static int hf_sapms_ip_to_name_length = -1; static int hf_sapms_ip_to_name = -1; static int hf_sapms_check_acl_error_code = -1; static int hf_sapms_check_acl_acl = -1; static int hf_sapms_codepage = -1; static int hf_sapms_dump_dest = -1; static int hf_sapms_dump_filler = -1; static int hf_sapms_dump_index = -1; static int hf_sapms_dump_command = -1; static int hf_sapms_dump_name = -1; static int hf_sapms_server_lst_client = -1; static int hf_sapms_server_lst_name = -1; static int hf_sapms_server_lst_host = -1; static int hf_sapms_server_lst_service = -1; static int hf_sapms_server_lst_msgtypes = -1; static int hf_sapms_server_lst_msgtypes_dia = -1; static int hf_sapms_server_lst_msgtypes_upd = -1; static int hf_sapms_server_lst_msgtypes_enq = -1; static int hf_sapms_server_lst_msgtypes_btc = -1; static int hf_sapms_server_lst_msgtypes_spo = -1; static int hf_sapms_server_lst_msgtypes_up2 = -1; static int hf_sapms_server_lst_msgtypes_atp = -1; static int hf_sapms_server_lst_msgtypes_icm = -1; static int hf_sapms_server_lst_hostaddr = -1; static int hf_sapms_server_lst_hostaddrv4 = -1; static int hf_sapms_server_lst_servno = -1; static int hf_sapms_server_lst_status = -1; static int hf_sapms_server_lst_nitrc = -1; static int hf_sapms_server_lst_sys_service = -1; static gint ett_sapms = -1; /* Expert info */ static expert_field ei_sapms_adm_opcode_partial = EI_INIT; static expert_field ei_sapms_opcode_partial = EI_INIT; static expert_field ei_sapms_unknown_version = EI_INIT; static expert_field ei_sapms_client_invalid_offset = EI_INIT; static expert_field ei_sapms_client_invalid_length = EI_INIT; static expert_field ei_sapms_text_invalid_length = EI_INIT; static expert_field ei_sapms_ip_invalid_length = EI_INIT; /* Global port preference */ static range_t *global_sapms_port_range; /* Global highlight preference */ static gboolean global_sapms_highlight_items = TRUE; /* Protocol handle */ static dissector_handle_t sapms_handle; void proto_reg_handoff_sapms(void); void proto_register_sapms(void); static void dissect_sapms_adm_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 length){ proto_item *record = NULL, *value = NULL; proto_tree *record_tree = NULL, *value_tree = NULL; guint8 adm_opcode; while (length>=104){ record = proto_tree_add_item(tree, hf_sapms_adm_record, tvb, offset, 104, ENC_NA); record_tree = proto_item_add_subtree(record, ett_sapms); adm_opcode = tvb_get_guint8(tvb, offset); proto_tree_add_item(record_tree, hf_sapms_adm_record_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_append_text(record_tree, ", Adm Opcode=%s", val_to_str_const(adm_opcode, sapms_adm_record_opcode_vals, "Unknown")); offset+=1; length-=1; proto_tree_add_item(record_tree, hf_sapms_adm_record_serial_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; proto_tree_add_item(record_tree, hf_sapms_adm_record_executed, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; proto_tree_add_item(record_tree, hf_sapms_adm_record_errorno, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; /* Dissect the value in function of the opcode */ switch (adm_opcode){ case 0x01: /* AD_PROFILE */ case 0x2e:{ /* AD_SHARED_PARAMETER */ proto_tree_add_item(record_tree, hf_sapms_adm_parameter, tvb, offset, 100, ENC_ASCII|ENC_NA); offset+=100; length-=100; break; } case 0x15:{ /* AD_RZL_STRG */ guint8 strg_type = 0; strg_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(record_tree, hf_sapms_adm_rzl_strg_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; length-=1; offset+=3; /* Skip 3 bytes */ length-=3; proto_tree_add_item(record_tree, hf_sapms_adm_rzl_strg_name, tvb, offset, 20, ENC_ASCII|ENC_NA); offset+=20; length-=20; value = proto_tree_add_item(record_tree, hf_sapms_adm_rzl_strg_value, tvb, offset, 40, ENC_ASCII|ENC_NA); value_tree = proto_item_add_subtree(value, ett_sapms); switch (strg_type){ case 11: /* STRG_TYPE_READALL_I */ case 15: /* STRG_TYPE_READALL_OFFSET_I */ case 21: /* STRG_TYPE_READ_I */ case 31: /* STRG_TYPE_WRITE_I */ case 41: /* STRG_TYPE_DEL_I */ case 51:{ /* STRG_TYPE_CREATE_I */ proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_uptime, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_value_integer, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_delay, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_value_integer, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_users, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_quality, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_value_integer, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_value_integer, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_value_integer, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; proto_tree_add_item(value_tree, hf_sapms_adm_rzl_strg_value_integer, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; break; } default:{ offset+=40; length-=40; break; } } offset+=36; length-=36; /* Skip the last 36 bytes */ break; } default:{ proto_tree_add_item(record_tree, hf_sapms_adm_record_value, tvb, offset, 100, ENC_NA); offset+=100; length-=100; if (global_sapms_highlight_items){ expert_add_info_format(pinfo, record_tree, &ei_sapms_adm_opcode_partial, "The ADM opcode is dissected partially (0x%.2x)", adm_opcode); } break; } } } } static gint dissect_sapms_client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint8 opcode_version){ proto_item *client = NULL, *msg_types = NULL; proto_tree *client_tree = NULL, *msg_types_tree = NULL; struct e_in6_addr address_ipv6; guint32 address_ipv4 = 0; gint client_length = 0, client_length_remaining = 0; /* Chose the client length according to the version number */ if (opcode_version == 0x01){ /* This version was seen in the older releases (6.40) */ client_length = 67; } else if (opcode_version == 0x02){ /* This version was seen in the older releases (6.40) */ client_length = 115; } else if (opcode_version == 0x03){ client_length = 150; } else if (opcode_version == 0x04){ /* Version 4 was seen in releases >7.0 */ client_length = 160; } else { /* Default to version 4 */ client_length = 160; if (global_sapms_highlight_items){ expert_add_info_format(pinfo, tree, &ei_sapms_unknown_version, "This version has not been seen, dissection of this packet could be wrong for this version (0x%.2x)", opcode_version); } } client_length_remaining = tvb_reported_length_remaining(tvb, offset); if (client_length_remaining < 0){ expert_add_info(pinfo, tree, &ei_sapms_client_invalid_offset); return (0); } if (client_length_remaining < client_length){ expert_add_info_format(pinfo, tree, &ei_sapms_client_invalid_length, "Invalid client length (expected=%d, actual=%d)", client_length, client_length_remaining); return (client_length_remaining); } /* Add the client tree */ client = proto_tree_add_item(tree, hf_sapms_server_lst_client, tvb, offset, client_length, ENC_NA); client_tree = proto_item_add_subtree(client, ett_sapms); /* Client name field */ if (opcode_version==0x01){ proto_tree_add_item(client_tree, hf_sapms_server_lst_name, tvb, offset, 20, ENC_ASCII|ENC_NA); offset+=20; } else { proto_tree_add_item(client_tree, hf_sapms_server_lst_name, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; } /* Host field (version 1 is 20 bytes, 2 is 32 bytes and version 3/4 is 64 bytes) */ if (opcode_version==0x01){ proto_tree_add_item(client_tree, hf_sapms_server_lst_host, tvb, offset, 20, ENC_ASCII|ENC_NA); offset+=20; } else if (opcode_version==0x02){ proto_tree_add_item(client_tree, hf_sapms_server_lst_host, tvb, offset, 32, ENC_ASCII|ENC_NA); offset+=32; } else { proto_tree_add_item(client_tree, hf_sapms_server_lst_host, tvb, offset, 64, ENC_ASCII|ENC_NA); offset+=64; } /* Service field */ proto_tree_add_item(client_tree, hf_sapms_server_lst_service, tvb, offset, 20, ENC_ASCII|ENC_NA); offset+=20; /* Message type flags */ msg_types = proto_tree_add_item(client_tree, hf_sapms_server_lst_msgtypes, tvb, offset, 1, ENC_BIG_ENDIAN); msg_types_tree = proto_item_add_subtree(msg_types, ett_sapms); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_dia, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_upd, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_enq, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_btc, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_spo, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_up2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_atp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_server_lst_msgtypes_icm, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; /* Add the IPv6 address (only for version 3/4) */ if (opcode_version >= 0x03){ tvb_get_ipv6(tvb, offset, &address_ipv6); proto_tree_add_ipv6(client_tree, hf_sapms_server_lst_hostaddr, tvb, offset, 16, &address_ipv6); offset+=16; } /* Add the IPv4 address */ address_ipv4 = tvb_get_ipv4(tvb, offset); proto_tree_add_ipv4(client_tree, hf_sapms_server_lst_hostaddrv4, tvb, offset, 4, address_ipv4); offset+=4; /* Service Number field */ proto_tree_add_item(client_tree, hf_sapms_server_lst_servno, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* Other fields only on version 2/3/4 */ if (opcode_version >= 0x02){ proto_tree_add_item(client_tree, hf_sapms_server_lst_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(client_tree, hf_sapms_server_lst_nitrc, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; } /* Add the Sys Server field (only for v4) */ if (opcode_version == 0x04){ proto_tree_add_item(client_tree, hf_sapms_server_lst_sys_service, tvb, offset, 4, ENC_BIG_ENDIAN); } /* Return the client length according to the version */ return (client_length); } static void dissect_sapms_counter(tvbuff_t *tvb, proto_tree *tree, guint32 offset){ proto_tree_add_item(tree, hf_sapms_counter_uuid, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; proto_tree_add_item(tree, hf_sapms_counter_count, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(tree, hf_sapms_counter_no, tvb, offset, 4, ENC_BIG_ENDIAN); } static void dissect_sapms_property(tvbuff_t *tvb, proto_tree *tree, guint32 offset){ guint32 property_id = 0; proto_item *value = NULL; proto_tree *value_tree = NULL; proto_tree_add_item(tree, hf_sapms_property_client, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; property_id = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_property_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; /* Check if the property item has a value */ if (!tvb_offset_exists(tvb, offset)){ return; } value = proto_tree_add_item(tree, hf_sapms_property_value, tvb, offset, -1, ENC_NA); value_tree = proto_item_add_subtree(value, ett_sapms); switch (property_id){ case 0x02:{ /* MS_PROPERTY_VHOST */ guint16 vhost_length = 0; proto_tree_add_item(value_tree, hf_sapms_property_vhost_logon, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; offset += 12; /* Padding */ vhost_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(value_tree, hf_sapms_property_vhost_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; if (vhost_length > 0) { proto_tree_add_item(value_tree, hf_sapms_property_vhost_value, tvb, offset, vhost_length, ENC_ASCII|ENC_NA); } break; } case 0x03:{ /* MS_PROPERTY_IPADR */ proto_tree_add_item(value_tree, hf_sapms_property_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(value_tree, hf_sapms_property_ip_address6, tvb, offset, 16, ENC_NA); break; } case 0x04:{ /* MS_PROPERTY_PARAM */ guint32 param_length = 0; guint16 value_length = 0; param_length = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(value_tree, hf_sapms_property_param_name_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; if (param_length > 0){ proto_tree_add_item(value_tree, hf_sapms_property_param_name_value, tvb, offset, param_length, ENC_ASCII|ENC_NA); offset+=param_length; } offset += 100 - param_length; /* Padding */ offset += 2; /* Padding */ value_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(value_tree, hf_sapms_property_param_value_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; if (param_length > 0){ proto_tree_add_item(value_tree, hf_sapms_property_param_value_value, tvb, offset, value_length, ENC_ASCII|ENC_NA); } break; } case 0x05:{ /* MS_PROPERTY_SERVICE */ proto_tree_add_item(value_tree, hf_sapms_property_service_number, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(value_tree, hf_sapms_property_service_value, tvb, offset, 1, ENC_BIG_ENDIAN); break; } case 0x07:{ /* Release Information */ proto_tree_add_item(value_tree, hf_sapms_property_release, tvb, offset, 10, ENC_ASCII|ENC_NA); offset+=10; proto_tree_add_item(value_tree, hf_sapms_property_release_patchno, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(value_tree, hf_sapms_property_release_supplvl, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(value_tree, hf_sapms_property_release_platform, tvb, offset, 4, ENC_BIG_ENDIAN); break; } } } static void dissect_sapms_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint8 flag, guint8 opcode, guint8 opcode_version, guint32 length){ gint client_length = 0; switch (opcode){ case 0x00:{ /* MS_DP_ADM */ tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_sapms_dp_adm_dp_version, tvb, offset, 1, ENC_BIG_ENDIAN); break; } case 0x02: /* MS_SERVER_ADD */ case 0x03: /* MS_SERVER_SUB */ case 0x04:{ /* MS_SERVER_MOD */ dissect_sapms_client(tvb, pinfo, tree, offset, opcode_version); break; } case 0x05:{ /* MS_SERVER_LST */ if (flag == 0x03){ /* If it's a reply (flag=MS_REPLY) */ while (tvb_reported_length_remaining(tvb, offset) > 0){ client_length = dissect_sapms_client(tvb, pinfo, tree, offset, opcode_version); offset += client_length; } } break; } case 0x06:{ /* MS_CHANGE_IP */ proto_tree_add_item(tree, hf_sapms_change_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; if (opcode_version >= 0x02){ proto_tree_add_item(tree, hf_sapms_change_ip_address6, tvb, offset, 16, ENC_NA); } break; } case 0x07: /* MS_SET_SECURITY_KEY */ case 0x08:{ /* MS_GET_SECURITY_KEY */ proto_tree_add_item(tree, hf_sapms_security_name, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; proto_tree_add_item(tree, hf_sapms_security_key, tvb, offset, 256, ENC_ASCII|ENC_NA); break; } case 0x09:{ /* MS_GET_SECURITY_KEY2 */ guint32 address_ipv4; struct e_in6_addr address_ipv6; address_ipv4 = tvb_get_ipv4(tvb, offset); proto_tree_add_ipv4(tree, hf_sapms_security_address, tvb, offset, 4, address_ipv4); offset+=4; proto_tree_add_item(tree, hf_sapms_security_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(tree, hf_sapms_security_key, tvb, offset, 256, ENC_ASCII|ENC_NA); offset+=256; tvb_get_ipv6(tvb, offset, &address_ipv6); proto_tree_add_ipv6(tree, hf_sapms_security_address6, tvb, offset, 16, &address_ipv6); break; } case 0x0a:{ /* MS_GET_HWID */ proto_tree_add_none_format(tree, hf_sapms_opcode_value, tvb, offset, length, "Hardware ID: %s", tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII)); break; } case 0x11:{ /* MS_GET_STATISTIC */ /* XXX: Fill fields for statistics */ break; } case 0x1C:{ /* MS_GET_CODEPAGE */ if (flag == 0x03) { proto_tree_add_item(tree, hf_sapms_codepage, tvb, offset, 4, ENC_BIG_ENDIAN); } break; } case 0x1E:{ /* MS_DUMP_INFO */ if (flag == 0x02) { /* If it's a request (flag=MS_REQUEST) */ proto_tree_add_item(tree, hf_sapms_dump_dest, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(tree, hf_sapms_dump_filler, tvb, offset, 3, ENC_NA); offset+=3; proto_tree_add_item(tree, hf_sapms_dump_index, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(tree, hf_sapms_dump_command, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; if (length>=48) { proto_tree_add_item(tree, hf_sapms_dump_name, tvb, offset, 40, ENC_ASCII|ENC_NA); } } else if (flag == 0x03) { /* If it's a reply (flag=MS_REPLY) */ guint32 string_length = 0; length = tvb_strsize(tvb, offset); /* Add each string in a different item */ while (length>1) { string_length = tvb_find_line_end(tvb, offset, -1, NULL, FALSE); if (string_length>0) { proto_tree_add_none_format(tree, hf_sapms_opcode_value, tvb, offset, string_length, "%s", tvb_get_string_enc(pinfo->pool, tvb, offset, string_length, ENC_ASCII)); offset+=string_length; length-=string_length; } offset+=1; length-=1; } } break; } case 0x1f:{ /* MS_FILE_RELOAD */ proto_tree_add_item(tree, hf_sapms_file_reload, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(tree, hf_sapms_file_filler, tvb, offset, 3, ENC_NA); break; } case 0x22: /* MS_SET_TXT */ case 0x23:{ /* MS_GET_TXT */ guint32 text_length = 0; proto_tree_add_item(tree, hf_sapms_text_name, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; length-=40; text_length = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_text_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; /* Check length */ if (text_length != length ){ expert_add_info_format(pinfo, tree, &ei_sapms_text_invalid_length, "Invalid text length (expected=%d, actual=%d)", text_length, length); } proto_tree_add_item(tree, hf_sapms_text_value, tvb, offset, length, ENC_ASCII|ENC_NA); break; } case 0x24: /* MS_COUNTER_CREATE */ case 0x25: /* MS_COUNTER_DELETE */ case 0x26: /* MS_COUNTER_INCREMENT */ case 0x27: /* MS_COUNTER_DECREMENT */ case 0x28: /* MS_COUNTER_REGISTER */ case 0x29:{ /* MS_COUNTER_GET */ if (tvb_reported_length_remaining(tvb, offset) >= 48){ dissect_sapms_counter(tvb, tree, offset); } break; } case 0x2a:{ /* MS_COUNTER_LST */ while (tvb_reported_length_remaining(tvb, offset) >= 48){ dissect_sapms_counter(tvb, tree, offset); offset+=48; } break; } case 0x2b: /* MS_SET_LOGON */ case 0x2c: /* MS_GET_LOGON */ case 0x2d:{ /* MS_DEL_LOGON */ guint16 name_length = 0, prot_length = 0, host_length = 0, misc_length = 0, address6_length = 0; guint32 address_ipv4; struct e_in6_addr address_ipv6; proto_tree_add_item(tree, hf_sapms_logon_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; proto_tree_add_item(tree, hf_sapms_logon_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; address_ipv4 = tvb_get_ipv4(tvb, offset); proto_tree_add_ipv4(tree, hf_sapms_logon_address, tvb, offset, 4, address_ipv4); offset+=4; length-=4; name_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_logon_name_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; if (name_length > 0 && length >= name_length){ proto_tree_add_item(tree, hf_sapms_logon_name, tvb, offset, name_length, ENC_ASCII|ENC_NA); offset+=name_length; length-=name_length; } prot_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_logon_prot_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; if (prot_length > 0 && length >= prot_length){ proto_tree_add_item(tree, hf_sapms_logon_prot, tvb, offset, prot_length, ENC_ASCII|ENC_NA); offset+=prot_length; length-=prot_length; } host_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_logon_host_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; if (host_length > 0 && length >= host_length){ proto_tree_add_item(tree, hf_sapms_logon_host, tvb, offset, host_length, ENC_ASCII|ENC_NA); offset+=host_length; length-=host_length; } misc_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_logon_misc_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; if (misc_length > 0 && length >= misc_length){ proto_tree_add_item(tree, hf_sapms_logon_misc, tvb, offset, misc_length, ENC_ASCII|ENC_NA); offset+=misc_length; length-=misc_length; } address6_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_logon_address6_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; if ((address6_length == 16) && (length >= (address6_length + (guint32)4))){ tvb_get_ipv6(tvb, offset, &address_ipv6); proto_tree_add_ipv6(tree, hf_sapms_logon_address6, tvb, offset, 16, &address_ipv6); offset+=16; proto_tree_add_item(tree, hf_sapms_logon_end, tvb, offset, 4, ENC_BIG_ENDIAN); } else { /* Add expert info if wrong IPv6 address length */ expert_add_info_format(pinfo, tree, &ei_sapms_ip_invalid_length, "Invalid IPv6 address length (%d) or data", address6_length); } break; } case 0x2e: /* MS_SERVER_DISC */ case 0x2f: /* MS_SERVER_SHUTDOWN */ case 0x30: /* MS_SERVER_SOFT_SHUTDOWN */ case 0x4a:{ /* MS_SERVER_TEST_SOFT_SHUTDOWN */ guint16 reason_length = 0; client_length = dissect_sapms_client(tvb, pinfo, tree, offset, opcode_version); offset += client_length; length -= client_length; reason_length = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_shutdown_reason_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; if (reason_length > 0 && length > 0){ reason_length = length < reason_length? length : reason_length; proto_tree_add_item(tree, hf_sapms_shutdown_reason, tvb, offset, reason_length, ENC_ASCII|ENC_NA); } break; } case 0x43: /* MS_SET_PROPERTY */ case 0x44: /* MS_GET_PROPERTY */ case 0x45:{ /* MS_DEL_PROPERTY */ dissect_sapms_property(tvb, tree, offset); break; } case 0x46:{ /* MS_IP_PORT_TO_NAME */ guint32 name_length = 0; if (opcode_version == 0x01){ guint32 address_ipv4 = tvb_get_ipv4(tvb, offset); proto_tree_add_ipv4(tree, hf_sapms_ip_to_name_address4, tvb, offset, 4, address_ipv4); offset+=4; length-=4; } else if (opcode_version == 0x02){ struct e_in6_addr address_ipv6; tvb_get_ipv6(tvb, offset, &address_ipv6); proto_tree_add_ipv6(tree, hf_sapms_ip_to_name_address6, tvb, offset, 16, &address_ipv6); offset+=16; length-=16; } proto_tree_add_item(tree, hf_sapms_ip_to_name_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; name_length = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sapms_ip_to_name_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; length-=4; if (name_length > 0 && length >= name_length){ proto_tree_add_item(tree, hf_sapms_ip_to_name, tvb, offset, name_length, ENC_ASCII|ENC_NA); } break; } case 0x47:{ /* MS_CHECK_ACL */ guint32 string_length = 0; proto_tree_add_item(tree, hf_sapms_check_acl_error_code, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; length-=2; string_length = tvb_strnlen(tvb, offset, length) + 1; proto_tree_add_item(tree, hf_sapms_check_acl_acl, tvb, offset, string_length, ENC_ASCII|ENC_NA); offset+=string_length; length-=string_length; string_length = tvb_strnlen(tvb, offset, length) + 1; proto_tree_add_item(tree, hf_sapms_check_acl_acl, tvb, offset, string_length, ENC_ASCII|ENC_NA); break; } default:{ if (global_sapms_highlight_items){ expert_add_info_format(pinfo, tree, &ei_sapms_opcode_partial, "The opcode is dissected partially (0x%.2x)", opcode); } break; } } } static int dissect_sapms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint32 offset = 0; proto_item *ti = NULL, *oi = NULL, *msg_types = NULL; proto_tree *sapms_tree = NULL, *sapms_opcode_tree = NULL, *msg_types_tree = NULL; /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, "SAPMS"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); /* Add the main sapms subtree */ ti = proto_tree_add_item(tree, proto_sapms, tvb, 0, -1, ENC_NA); sapms_tree = proto_item_add_subtree(ti, ett_sapms); /* Check for the eye catcher string */ if (tvb_strneql(tvb, offset, "**MESSAGE**\00", 12) == 0){ gint remaining_length = 0; guint8 flag=0, iflag = 0, opcode = 0, opcode_version = 0; proto_tree_add_item(sapms_tree, hf_sapms_eyecatcher, tvb, offset, 12, ENC_ASCII|ENC_NA); offset+=12; proto_tree_add_item(sapms_tree, hf_sapms_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_errorno, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_toname, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; msg_types = proto_tree_add_item(sapms_tree, hf_sapms_msgtypes, tvb, offset, 1, ENC_BIG_ENDIAN); msg_types_tree = proto_item_add_subtree(msg_types, ett_sapms); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_dia, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_upd, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_enq, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_btc, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_spo, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_up2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_atp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(msg_types_tree, hf_sapms_msgtypes_icm, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_reserved, tvb, offset, 1, ENC_NA); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_domain, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_reserved, tvb, offset, 1, ENC_NA); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_key, tvb, offset, 8, ENC_NA); offset+=8; flag = tvb_get_guint8(tvb, offset); proto_tree_add_item(sapms_tree, hf_sapms_flag, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_item_append_text(sapms_tree, ", Flag=%s", val_to_str_const(flag, sapms_flag_vals, "Unknown")); iflag = tvb_get_guint8(tvb, offset); proto_tree_add_item(sapms_tree, hf_sapms_iflag, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_item_append_text(sapms_tree, ", IFlag=%s", val_to_str_const(iflag, sapms_iflag_vals, "Unknown")); col_append_fstr(pinfo->cinfo, COL_INFO, "Flag=%s,IFlag=%s", val_to_str_const(flag, sapms_flag_vals, "Unknown"), val_to_str_const(iflag, sapms_iflag_vals, "Unknown")); proto_tree_add_item(sapms_tree, hf_sapms_fromname, tvb, offset, 40, ENC_ASCII|ENC_NA); offset+=40; if (flag == 0x00 && iflag == 0x00){ /* For MS_REQUEST+MS_LOGIN_2 it's the diag port */ proto_tree_add_item(sapms_tree, hf_sapms_diagport, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; } else { offset+=2; /* Skip 2 bytes */ } if (!tvb_offset_exists(tvb, offset)){ return 0; } /* The remaining of the packet is dissected based on the flag */ switch (iflag){ /* MS_SEND_NAME or unknown (forwarded messages) */ case 0x00: /* MS_UNKNOWN */ case 0x01: /* MS_SEND_NAME */ case 0x02: /* MS_SEND_TYPE */ case 0x07:{ /* MS_SEND_TYPE_ONCE */ opcode = tvb_get_guint8(tvb, offset); proto_tree_add_item(sapms_tree, hf_sapms_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_opcode_error, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; opcode_version = tvb_get_guint8(tvb, offset); proto_tree_add_item(sapms_tree, hf_sapms_opcode_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_opcode_charset, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_item_append_text(sapms_tree, ", Opcode=%s", val_to_str_const(opcode, sapms_opcode_vals, "Unknown")); col_append_fstr(pinfo->cinfo, COL_INFO, ", Opcode=%s", val_to_str_const(opcode, sapms_opcode_vals, "Unknown")); /* Add the opcode value subtree */ remaining_length = tvb_reported_length_remaining(tvb, offset); if (remaining_length > 0){ oi = proto_tree_add_item(sapms_tree, hf_sapms_opcode_value, tvb, offset, remaining_length, ENC_NA); sapms_opcode_tree = proto_item_add_subtree(oi, ett_sapms); dissect_sapms_opcode(tvb, pinfo, sapms_opcode_tree, offset, flag, opcode, opcode_version, remaining_length); } break; } case 0x05:{ /* MS_ADM_OPCODES */ proto_tree_add_item(sapms_tree, hf_sapms_adm_eyecatcher, tvb, offset, 12, ENC_ASCII|ENC_NA); offset+=12; proto_tree_add_item(sapms_tree, hf_sapms_adm_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_adm_msgtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(sapms_tree, hf_sapms_adm_recsize, tvb, offset, 11, ENC_ASCII|ENC_NA); offset+=11; proto_tree_add_item(sapms_tree, hf_sapms_adm_recno, tvb, offset, 11, ENC_ASCII|ENC_NA); offset+=11; /* Add the records subtree */ remaining_length = tvb_reported_length_remaining(tvb, offset); if (remaining_length > 0){ dissect_sapms_adm_record(tvb, pinfo, sapms_tree, offset, remaining_length); } break; } } } return tvb_reported_length(tvb); } void proto_register_sapms(void) { static hf_register_info hf[] = { /* General Header fields */ { &hf_sapms_eyecatcher, { "Eye Catcher", "sapms.eyecatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_version, { "Version", "sapms.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_errorno, { "Error Number", "sapms.errorno", FT_UINT8, BASE_HEX, VALS(sapms_errorno_vals), 0x0, NULL, HFILL }}, { &hf_sapms_toname, { "To Name", "sapms.toname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_msgtypes, { "Message Type", "sapms.msgtype", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_msgtypes_dia, { "DIA", "sapms.msgtype.dia", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_DIA, NULL, HFILL }}, { &hf_sapms_msgtypes_upd, { "UPD", "sapms.msgtype.upd", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_UPD, NULL, HFILL }}, { &hf_sapms_msgtypes_enq, { "ENQ", "sapms.msgtype.enq", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_ENQ, NULL, HFILL }}, { &hf_sapms_msgtypes_btc, { "BTC", "sapms.msgtype.btc", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_BTC, NULL, HFILL }}, { &hf_sapms_msgtypes_spo, { "SPO", "sapms.msgtype.spo", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_SPO, NULL, HFILL }}, { &hf_sapms_msgtypes_up2, { "UP2", "sapms.msgtype.up2", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_UP2, NULL, HFILL }}, { &hf_sapms_msgtypes_atp, { "ATP", "sapms.msgtype.atp", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_ATP, NULL, HFILL }}, { &hf_sapms_msgtypes_icm, { "ICM", "sapms.msgtype.icm", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_ICM, NULL, HFILL }}, { &hf_sapms_domain, { "Domain", "sapms.domain", FT_UINT8, BASE_HEX, VALS(sapms_domain_vals), 0x0, NULL, HFILL }}, { &hf_sapms_reserved, { "Reserved", "sapms.reserved", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_key, { "Key", "sapms.key", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_flag, { "Flag", "sapms.flag", FT_UINT8, BASE_HEX, VALS(sapms_flag_vals), 0x0, NULL, HFILL }}, { &hf_sapms_iflag, { "IFlag", "sapms.iflag", FT_UINT8, BASE_HEX, VALS(sapms_iflag_vals), 0x0, NULL, HFILL }}, { &hf_sapms_fromname, { "From Name", "sapms.fromname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_diagport, { "Diag Port", "sapms.diag_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* MS_DP_ADM fiels */ { &hf_sapms_dp_adm_dp_version, { "Dispatcher Version", "sapms.dp_adm.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* ADM Message fields */ { &hf_sapms_adm_eyecatcher, { "Adm Eye Catcher", "sapms.adm.eyecatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_version, { "Adm Version", "sapms.adm.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_msgtype, { "Adm Message Type", "sapms.adm.msgtype", FT_UINT8, BASE_HEX, VALS(sapms_adm_msgtype_vals), 0x0, NULL, HFILL }}, { &hf_sapms_adm_recsize, { "Adm Record Size", "sapms.adm.recsize", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_recno, { "Adm Records Number", "sapms.adm.recno", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_record, { "Adm Record", "sapms.adm.records", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_record_opcode, { "Adm Record Opcode", "sapms.adm.record.opcode", FT_UINT8, BASE_HEX, VALS(sapms_adm_record_opcode_vals), 0x0, NULL, HFILL }}, { &hf_sapms_adm_record_serial_number, { "Adm Record Serial Number", "sapms.adm.record.serial_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_record_executed, { "Adm Record Executed", "sapms.adm.record.executed", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_record_errorno, { "Adm Record Error Number", "sapms.adm.record.errorno", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_record_value, { "Adm Record Value", "sapms.adm.record.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_parameter, { "Adm Profile Parameter", "sapms.adm.parameter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_type, { "Adm RZL String Type", "sapms.adm.rzl_strg.type", FT_UINT8, BASE_HEX, VALS(sapms_adm_rzl_strg_type_vals), 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_name, { "Adm RZL String Name", "sapms.adm.rzl_strg.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_value, { "Adm RZL String Value", "sapms.adm.rzl_strg.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_value_integer, { "Adm RZL String Integer Value", "sapms.adm.rzl_strg.integer", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_uptime, { "Adm RZL String Uptime", "sapms.adm.rzl_strg.uptime", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_delay, { "Adm RZL String Delay", "sapms.adm.rzl_strg.delay", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_users, { "Adm RZL String Users", "sapms.adm.rzl_strg.users", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_adm_rzl_strg_quality, { "Adm RZL String Quality", "sapms.adm.rzl_strg.quality", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* OPCODE fields */ { &hf_sapms_opcode, { "Opcode", "sapms.opcode", FT_UINT8, BASE_HEX, VALS(sapms_opcode_vals), 0x0, NULL, HFILL }}, { &hf_sapms_opcode_error, { "Opcode Error", "sapms.opcode.error", FT_UINT8, BASE_HEX, VALS(sapms_opcode_error_vals), 0x0, NULL, HFILL }}, { &hf_sapms_opcode_version, { "Opcode Version", "sapms.opcode.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_opcode_charset, { "Opcode Character Set", "sapms.opcode.charset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_opcode_value, { "Opcode Value", "sapms.opcode.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* MS_SET/GET/DEL_PROPERTY opcode fields */ { &hf_sapms_property_client, { "Property Client", "sapms.property.client", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_id, { "Property ID", "sapms.property.id", FT_UINT32, BASE_DEC, VALS(sapms_property_id_vals), 0x0, NULL, HFILL }}, { &hf_sapms_property_value, { "Property", "sapms.property.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_vhost_logon, { "Property VHost Logon", "sapms.property.vhost.logon", FT_UINT16, BASE_DEC, VALS(sapms_logon_type_vals), 0x0, NULL, HFILL }}, { &hf_sapms_property_vhost_length, { "Property VHost Length", "sapms.property.vhost.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_vhost_value, { "Property VHost Value", "sapms.property.vhost.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_ip_address, { "Property IP Address v4", "sapms.property.ipaddr4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_ip_address6, { "Property IP Address v6", "sapms.property.ipaddr6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_param_name_length, { "Property Parameter Name Length", "sapms.property.param.name_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_param_name_value, { "Property Parameter Name", "sapms.property.param.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_param_value_length, { "Property Parameter Value Length", "sapms.property.param.value_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_param_value_value, { "Property Parameter Value", "sapms.property.param.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_service_number, { "Property Service Number", "sapms.property.service.number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_service_value, { "Property Service Value", "sapms.property.service.value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_release, { "Property Release", "sapms.property.release", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_release_patchno, { "Property Patch Number", "sapms.property.patchno", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_release_supplvl, { "Property Support Level", "sapms.property.supplvl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_property_release_platform, { "Property Platform", "sapms.property.platform", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* MS_GET_CODEPAGE */ { &hf_sapms_codepage, { "Codepage", "sapms.codepage", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* MS_DUMP fields */ { &hf_sapms_dump_dest, { "Dump Dest", "sapms.dump.dest", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_dump_filler, { "Dump Filler", "sapms.dump.filler", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_dump_index, { "Dump Index", "sapms.dump.index", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_dump_command, { "Dump Command", "sapms.dump.command", FT_UINT16, BASE_HEX, VALS(sapms_dump_command_vals), 0x0, NULL, HFILL }}, { &hf_sapms_dump_name, { "Dump Name", "sapms.dump.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* MS_SERVER_LIST fields */ { &hf_sapms_server_lst_client, { "Client", "sapms.serverlst.client", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_name, { "Client Name", "sapms.serverlst.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_host, { "Host", "sapms.serverlst.host", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_service, { "Service", "sapms.serverlst.service", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes, { "Message Types", "sapms.serverlst.msgtypes", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_dia, { "DIA", "sapms.serverlst.msgtype.dia", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_DIA, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_upd, { "UPD", "sapms.serverlst.msgtype.upd", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_UPD, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_enq, { "ENQ", "sapms.serverlst.msgtype.enq", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_ENQ, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_btc, { "BTC", "sapms.serverlst.msgtype.btc", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_BTC, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_spo, { "SPO", "sapms.serverlst.msgtype.spo", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_SPO, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_up2, { "UP2", "sapms.serverlst.msgtype.up2", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_UP2, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_atp, { "ATP", "sapms.serverlst.msgtype.atp", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_ATP, NULL, HFILL }}, { &hf_sapms_server_lst_msgtypes_icm, { "ICM", "sapms.serverlst.msgtype.icm", FT_BOOLEAN, 8, NULL, SAPMS_MSG_TYPE_ICM, NULL, HFILL }}, { &hf_sapms_server_lst_hostaddr, { "Host Address v6", "sapms.serverlst.hostaddr", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_hostaddrv4, { "Host Address v4", "sapms.serverlst.hostaddr4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_servno, { "Service Number", "sapms.serverlst.servno", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_status, { "Status", "sapms.serverlst.status", FT_UINT8, BASE_HEX, VALS(sapms_server_lst_status_vals), 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_nitrc, { "NI Trace", "sapms.serverlst.nitrc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_server_lst_sys_service, { "Sys Service", "sapms.serverlst.sysservice", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* MS_SET_SECURITY_KEY, MS_GET_SECURITY_KEY and MS_GET_SECURITY_KEY2 fields */ { &hf_sapms_security_name, { "Security Name", "sapms.security.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_security_key, { "Security Key", "sapms.security.key", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_security_port, { "Security Port", "sapms.security.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_security_address, { "Security Address v4", "sapms.security.addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_security_address6, { "Security Address v6", "sapms.security.addr6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* MS_SET_TEXT, MS_GET_TEXT */ { &hf_sapms_text_name, { "Text Name", "sapms.text.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_text_length, { "Text Length", "sapms.text.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_text_value, { "Text Value", "sapms.text.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* COUNTER fields */ { &hf_sapms_counter_uuid, { "Counter UUID", "sapms.counter.uuid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_counter_count, { "Counter Count", "sapms.counter.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_counter_no, { "Counter Number", "sapms.counter.no", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* CHANGE_IP fields */ { &hf_sapms_change_ip_address, { "Change IP Address IPv4", "sapms.change.addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_change_ip_address6, { "Change IP Address IPv6", "sapms.change.addr6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* FILE RELOAD fields */ { &hf_sapms_file_reload, { "File Reload Name", "sapms.filereload.name", FT_UINT8, BASE_HEX, VALS(sapms_file_reload_vals), 0x0, NULL, HFILL }}, { &hf_sapms_file_filler, { "File Reload Filler", "sapms.filereload.filler", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* MS_GET_LOGON, MS_SET_LOGON and MS_DEL_LOGON fields */ { &hf_sapms_logon_type, { "Logon Type", "sapms.logon.type", FT_UINT16, BASE_HEX, VALS(sapms_logon_type_vals), 0x0, NULL, HFILL }}, { &hf_sapms_logon_port, { "Logon Port", "sapms.logon.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_address, { "Logon Address IPv4", "sapms.logon.addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_name_length, { "Logon Name Length", "sapms.logon.name_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_name, { "Logon Name", "sapms.logon.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_prot_length, { "Logon Protocol Length", "sapms.logon.prot_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_prot, { "Logon Protocol", "sapms.logon.prot", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_host_length, { "Logon Host Length", "sapms.logon.host_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_host, { "Logon Host", "sapms.logon.host", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_misc_length, { "Logon Misc Length", "sapms.logon.misc_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_misc, { "Logon Misc", "sapms.logon.misc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_address6_length, { "Logon Address IPv6 Length", "sapms.logon.addr6_length", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_address6, { "Logon Address IPv6", "sapms.logon.address6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_logon_end, { "Logon Address End", "sapms.logon.end", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_shutdown_reason_length, { "Shutdown Reason Length", "sapms.shutdown.reason_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_shutdown_reason, { "Shutdown Reason", "sapms.shutdown.reason", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* MS_IP_PORT_TO_NAME fields */ { &hf_sapms_ip_to_name_address4, { "IP to Name Address IPv4", "sapms.ip_to_name.addr4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_ip_to_name_address6, { "IP to Name Address IPv6", "sapms.ip_to_name.addr6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_ip_to_name_port, { "IP to Name Port", "sapms.ip_to_name.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_ip_to_name_length, { "IP to Name Length", "sapms.ip_to_name.name_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_ip_to_name, { "IP to Name", "sapms.ip_to_name.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* MS_CHECK_ACL fields */ { &hf_sapms_check_acl_error_code, { "Check ACL Error Code", "sapms.check_acl.error_code", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapms_check_acl_acl, { "Check ACL Entry", "sapms.check_acl.acl", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sapms }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_sapms_adm_opcode_partial, { "sapms.adm.record.opcode.unknown", PI_UNDECODED, PI_WARN, "The ADM opcode is dissected partially", EXPFILL }}, { &ei_sapms_opcode_partial, { "sapms.opcode.unknown", PI_UNDECODED, PI_WARN, "The opcode is dissected partially", EXPFILL }}, { &ei_sapms_unknown_version, { "sapms.serverlst.unknown", PI_UNDECODED, PI_WARN, "This version has not been seen, dissection of this packet could be wrong for this version", EXPFILL }}, { &ei_sapms_client_invalid_offset, { "sapms.serverlst.offset.invalid", PI_MALFORMED, PI_WARN, "Invalid offset", EXPFILL }}, { &ei_sapms_client_invalid_length, { "sapms.serverlst.length.invalid", PI_MALFORMED, PI_WARN, "Invalid client length", EXPFILL }}, { &ei_sapms_text_invalid_length, { "sapms.text.length.invalid", PI_MALFORMED, PI_WARN, "Invalid text length", EXPFILL }}, { &ei_sapms_ip_invalid_length, { "sapms.logon.address6.invalid", PI_MALFORMED, PI_WARN, "Invalid IPv6 address length or data", EXPFILL }}, }; module_t *sapms_module; expert_module_t* sapms_expert; /* Register the protocol */ proto_sapms = proto_register_protocol("SAP Message Server Protocol", "SAPMS", "sapms"); register_dissector("sapms", dissect_sapms, proto_sapms); proto_register_field_array(proto_sapms, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sapms_expert = expert_register_protocol(proto_sapms); expert_register_field_array(sapms_expert, ei, array_length(ei)); /* Register the preferences */ sapms_module = prefs_register_protocol(proto_sapms, proto_reg_handoff_sapms); range_convert_str(wmem_epan_scope(), &global_sapms_port_range, SAPMS_PORT_RANGE, MAX_TCP_PORT); prefs_register_range_preference(sapms_module, "tcp_ports", "SAP MS Protocol TCP port numbers", "Port numbers used for SAP MS Protocol (default " SAPMS_PORT_RANGE ")", &global_sapms_port_range, MAX_TCP_PORT); prefs_register_bool_preference(sapms_module, "highlight_unknown_items", "Highlight unknown SAP MS messages", "Whether the SAP MS Protocol dissector should highlight unknown MS messages (might be noise and generate a lot of expert warnings)", &global_sapms_highlight_items); } /** * Helpers for dealing with the port range */ static void range_delete_callback (guint32 port, gpointer ptr _U_) { dissector_delete_uint("sapni.port", port, sapms_handle); } static void range_add_callback (guint32 port, gpointer ptr _U_) { dissector_add_uint("sapni.port", port, sapms_handle); } /** * Register Hand off for the SAP MS Protocol */ void proto_reg_handoff_sapms(void) { static range_t *sapms_port_range; static gboolean initialized = FALSE; if (!initialized) { sapms_handle = create_dissector_handle(dissect_sapms, proto_sapms); initialized = TRUE; } else { range_foreach(sapms_port_range, range_delete_callback, NULL); wmem_free(wmem_epan_scope(), sapms_port_range); } sapms_port_range = range_copy(wmem_epan_scope(), global_sapms_port_range); range_foreach(sapms_port_range, range_add_callback, NULL); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sapni.c
/* packet-sapni.c * Routines for SAP NI (Network Interface) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a simple dissector for the SAP NI protocol, mainly responsible for reassembly and calling the right registered dissector * based on the port number. * * Some details and example requests can be found in pysap's documentation: https://pysap.readthedocs.io/en/latest/protocols/SAPNI.html. */ #include <config.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include "packet-tcp.h" #include <epan/next_tvb.h> #include <epan/conversation.h> #include <wsutil/wmem/wmem.h> #include "packet-sapni.h" /* * Define default ports. The right range should be 32NN and 4NNNN, but as port numbers are proprietary and not * IANA assigned, we leave only the ones corresponding to the instance 00. */ #define SAP_PROTOCOL_PORT_RANGE "3200,40000" /* * Length of the frame header */ #define SAP_PROTOCOL_HEADER_LEN 4 static int proto_sap_protocol = -1; static int hf_sap_protocol_length = -1; static int hf_sap_protocol_payload = -1; static int hf_sap_protocol_ping = -1; static int hf_sap_protocol_pong = -1; static gint ett_sap_protocol = -1; /* Expert info */ static expert_field ei_sap_invalid_length = EI_INIT; /* Global port preference */ static range_t *global_sap_protocol_port_range; /* Global reassemble preference */ static gboolean global_sap_protocol_desegment = TRUE; /* Protocol handle */ static dissector_handle_t sap_protocol_handle; static dissector_handle_t sap_router_handle; /* Sub-dissectors table */ static dissector_table_t sub_dissectors_table; static heur_dissector_list_t heur_subdissector_list; /* * */ void proto_reg_handoff_sap_protocol(void); void proto_register_sap_protocol(void); /* * Get the SAPNI pdu length */ static guint get_sap_protocol_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_, void *dissector_data _U_) { return ((guint)tvb_get_ntohl(tvb, 0) + 4); } /* * Dissect the payload of a packet using a registered SAP protocol. It uses * heuristics as a first try as some protocols uses the same TCP ports * (e.g. 3200/tcp for Enqueue Server and Diag). */ void dissect_sap_protocol_payload(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, guint16 sport, guint16 dport){ guint16 low_port = 0, high_port = 0; tvbuff_t *next_tvb = NULL; heur_dtbl_entry_t *hdtbl_entry = NULL; /* Set the new tvb for further dissection of the payload */ next_tvb = tvb_new_subset_remaining(tvb, offset); /* Determine if this packet is part of a conversation and call dissector * for the conversation if available. */ if (try_conversation_dissector(&pinfo->dst, &pinfo->src, CONVERSATION_TCP, dport, sport, next_tvb, pinfo, tree, NULL, 0)) { return; } /* Try with the heuristic dissectors first */ /* TODO: When the protocol is guessed via heuristic dissector (Enqueue * Server), the NI Protocol tree is missed. */ if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) { return; } /* Call the dissector in the subdissectors table according to the port number */ if (sport > dport) { low_port = dport; high_port = sport; } else { low_port = sport; high_port = dport; } if ((low_port != 0 && dissector_try_uint(sub_dissectors_table, low_port, next_tvb, pinfo, tree)) || (high_port != 0 && dissector_try_uint(sub_dissectors_table, high_port, next_tvb, pinfo, tree))){ return; } } /* * Dissect a SAPNI packet, adding the length field to the protocol tree and * calling the sub-dissector according to the port number. It also identifies * PING/PONG packets at the SAPNI layer. */ static int dissect_sap_protocol_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint32 length = 0; proto_item *ti = NULL, *sap_protocol_length = NULL; proto_tree *sap_protocol_tree = NULL; conversation_t *conversation = NULL; tvbuff_t *next_tvb = NULL; /* Add the protocol to the column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SAPNI"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); /* Get the length field */ length = tvb_get_ntohl(tvb, 0); /* Add the payload length to the info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "Length=%d ", length); /* Add the main SAP Protocol subtree */ ti = proto_tree_add_item(tree, proto_sap_protocol, tvb, 0, -1, ENC_NA); sap_protocol_tree = proto_item_add_subtree(ti, ett_sap_protocol); /* Add the length item */ proto_item_append_text(ti, ", Len: %u", length); sap_protocol_length = proto_tree_add_item(sap_protocol_tree, hf_sap_protocol_length, tvb, 0, 4, ENC_BIG_ENDIAN); /* Add expert info in case of no match between the given length and the actual one */ if (tvb_reported_length(tvb) != length + 4) { expert_add_info(pinfo, sap_protocol_length, &ei_sap_invalid_length); } /* Add the payload subtree */ if (length > 0){ proto_tree_add_item(sap_protocol_tree, hf_sap_protocol_payload, tvb, 4, -1, ENC_NA); } /* Check for NI_PING */ if ((length == 8)&&(tvb_strneql(tvb, 4, "NI_PING\00", 8) == 0)){ col_set_str(pinfo->cinfo, COL_INFO, "Ping message"); proto_item_append_text(ti, ", Ping message (keep-alive request)"); proto_tree_add_item(sap_protocol_tree, hf_sap_protocol_ping, tvb, 4, -1, ENC_NA); /* Chek for NI_PONG */ } else if ((length == 8)&&(tvb_strneql(tvb, 4, "NI_PONG\00", 8) == 0)){ col_set_str(pinfo->cinfo, COL_INFO, "Pong message"); proto_item_append_text(ti, ", Pong message"); /* We need to check if this is a keep-alive response, or it's part of * a SAP Router conversation and thus a route accepted message. */ conversation = find_conversation_pinfo(pinfo, 0); if (conversation == NULL){ col_append_str(pinfo->cinfo, COL_INFO, " (keep-alive response)"); proto_item_append_text(ti, " (keep-alive response)"); proto_tree_add_item(sap_protocol_tree, hf_sap_protocol_pong, tvb, 4, -1, ENC_NA); } else { col_append_str(pinfo->cinfo, COL_INFO, " (route accepted)"); proto_item_append_text(ti, " (route accepted)"); /* Call the SAP Router dissector */ if (sap_router_handle){ /* Create a new tvb buffer and call the dissector */ next_tvb = tvb_new_subset_remaining(tvb, 4); call_dissector_only(sap_router_handle, next_tvb, pinfo, tree, NULL); } } /* Dissect the payload */ } else if (length > 0){ dissect_sap_protocol_payload(tvb, 4, pinfo, tree, pinfo->srcport, pinfo->destport); } /* TODO: We need to return the *actual* length processed */ return (length); } /* * Performs the TCP reassembling and dissects the packet. */ static int dissect_sap_protocol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tcp_dissect_pdus(tvb, pinfo, tree, global_sap_protocol_desegment, SAP_PROTOCOL_HEADER_LEN, get_sap_protocol_pdu_len, dissect_sap_protocol_message, data); return tvb_reported_length(tvb); } void proto_register_sap_protocol(void) { static hf_register_info hf[] = { { &hf_sap_protocol_length, { "Length", "sapni.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sap_protocol_payload, { "Payload", "sapni.payload", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sap_protocol_ping, { "Ping", "sapni.ping", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sap_protocol_pong, { "Pong", "sapni.pong", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sap_protocol }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_sap_invalid_length, { "sapni.length.invalid", PI_MALFORMED, PI_WARN, "The reported length is incorrect", EXPFILL }}, }; module_t *sap_protocol_module; expert_module_t* sap_protocol_expert; /* Register the protocol */ proto_sap_protocol = proto_register_protocol("SAP NI Protocol", "SAPNI", "sapni"); proto_register_field_array(proto_sap_protocol, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sap_protocol_expert = expert_register_protocol(proto_sap_protocol); expert_register_field_array(sap_protocol_expert, ei, array_length(ei)); register_dissector("sapni", dissect_sap_protocol, proto_sap_protocol); /* Sub dissector code */ sub_dissectors_table = register_dissector_table("sapni.port", "SAP Protocol Port", proto_sap_protocol, FT_UINT16, BASE_DEC); heur_subdissector_list = register_heur_dissector_list("sapni", proto_sap_protocol); /* Register the preferences */ sap_protocol_module = prefs_register_protocol(proto_sap_protocol, proto_reg_handoff_sap_protocol); range_convert_str(wmem_epan_scope(), &global_sap_protocol_port_range, SAP_PROTOCOL_PORT_RANGE, MAX_TCP_PORT); prefs_register_range_preference(sap_protocol_module, "tcp_ports", "SAP NI Protocol TCP port numbers", "Port numbers used for SAP NI Protocol (default " SAP_PROTOCOL_PORT_RANGE ")", &global_sap_protocol_port_range, MAX_TCP_PORT); prefs_register_bool_preference(sap_protocol_module, "desegment", "Reassemble SAP NI Protocol messages spanning multiple TCP segments", "Whether the SAP NI Protocol dissector should reassemble messages spanning multiple TCP segments.", &global_sap_protocol_desegment); } /** * Helpers for dealing with the port range */ static void range_delete_callback (guint32 port, gpointer ptr _U_) { dissector_delete_uint("tcp.port", port, sap_protocol_handle); } static void range_add_callback (guint32 port, gpointer ptr _U_) { dissector_add_uint("tcp.port", port, sap_protocol_handle); } /** * Register Hand off for the SAP NI Protocol */ void proto_reg_handoff_sap_protocol(void) { static range_t *sap_protocol_port_range; static gboolean initialized = FALSE; if (!initialized) { sap_protocol_handle = find_dissector("sapni"); initialized = TRUE; } else { range_foreach(sap_protocol_port_range, range_delete_callback, NULL); wmem_free(wmem_epan_scope(), sap_protocol_port_range); } sap_protocol_port_range = range_copy(wmem_epan_scope(), global_sap_protocol_port_range); range_foreach(sap_protocol_port_range, range_add_callback, NULL); sap_router_handle = find_dissector("saprouter"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-sapni.h
/* packet-sapni.h * Routines for SAP NI (Network Interface) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SAPPROTOCOL_H__ #define __PACKET_SAPPROTOCOL_H__ #include <epan/packet.h> extern void dissect_sap_protocol_payload(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, guint16 sport, guint16 dport); #endif /* __PACKET_SAPPROTOCOL_H__ */
C
wireshark/epan/dissectors/packet-saprouter.c
/* packet-saprouter.c * Routines for SAP Router dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a dissector for the SAP Router protocol. * * Some details and example requests can be found in pysap's documentation: https://pysap.readthedocs.io/en/latest/protocols/SAPRouter.html. */ #include <config.h> #include <stdlib.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <wsutil/wmem/wmem.h> #include <epan/conversation.h> #include <epan/tap.h> #include <ui/tap-credentials.h> #include "packet-sapni.h" #include "packet-sapsnc.h" /* Define default ports */ #define SAPROUTER_PORT_RANGE "3298-3299" /* * Length of the frame header */ #define SAPROUTER_HEADER_LEN 8 /* * Offsets of header fields */ #define SAPROUTER_ROUTE_LENGTH_OFFSET 16 #define SAPROUTER_ROUTE_OFFSET_OFFSET 20 /* SAP Router Eye Catcher strings */ #define SAPROUTER_TYPE_NIPING_STRING "EYECATCHER" #define SAPROUTER_TYPE_ROUTE_STRING "NI_ROUTE" #define SAPROUTER_TYPE_ROUTE_ACCEPT "NI_PONG" #define SAPROUTER_TYPE_ERR_STRING "NI_RTERR" #define SAPROUTER_TYPE_ADMIN_STRING "ROUTER_ADM" /* SAP Router Talk Modes */ static const value_string saprouter_talk_mode_vals[] = { { 0, "NI_MSG_IO" }, { 1, "NI_RAW_IO" }, { 2, "NI_ROUT_IO" }, /* NULL */ { 0, NULL}, }; /* SAP Router Operation values */ static const value_string saprouter_opcode_vals[] = { { 0, "Error information" }, { 1, "Version Request" }, { 2, "Version Response" }, { 5, "Send Handle (5)" }, /* TODO: Check this opcodes */ { 6, "Send Handle (6)" }, /* TODO: Check this opcodes */ { 8, "Send Handle (8)" }, /* TODO: Check this opcodes */ { 70, "SNC request" }, /* TODO: Check this opcodes NiSncOpcode: NISNC_REQ */ { 71, "SNC handshake complete" }, /* TODO: Check this opcodes NiSncOpcode: NISNC_ACK */ /* NULL */ { 0, NULL} }; /* SAP Router Return Code values (as per SAP Note 63342 https://launchpad.support.sap.com/#/notes/63342) */ static const value_string saprouter_return_code_vals[] = { { -1, "NI-internal error (NIEINTERN)" }, { -2, "Host name unknown (NIEHOST_UNKNOWN)" }, { -3, "Service unknown (NIESERV_UNKNOWN)" }, { -4, "Service already used (NIESERV_USED)" }, { -5, "Time limit reached (NIETIMEOUT)" }, { -6, "Connection to partner broken (NIECONN_BROKEN)" }, { -7, "Data range too small (NIETOO_SMALL)" }, { -8, "Invalid parameters (NIEINVAL)" }, { -9, "Wake-Up (without data) (NIEWAKEUP)" }, {-10, "Connection setup failed (NIECONN_REFUSED)" }, {-11, "PING/PONG signal received (NIEPING)" }, {-12, "Connection to partner via NiRouter not yet set up (NIECONN_PENDING)" }, {-13, "Invalid version (NIEVERSION)" }, {-14, "Local hostname cannot be found (NIEMYHOSTNAME)" }, {-15, "No free port in range (NIENOFREEPORT)" }, {-16, "Local hostname invalid (NIEMYHOST_VERIFY)" }, {-17, "Error in the SNC shift in the saprouter ==> (NIESNC_FAILURE)" }, {-18, "Opcode received (NIEOPCODE)" }, {-19, "queue limit reached, next package not accepted (NIEQUE_FULL)" }, {-20, "Requested package too large (NIETOO_BIG)" }, {-90, "Host name unknown (NIEROUT_HOST_UNKNOWN)" }, {-91, "Service unknown (NIEROUT_SERV_UNKNOWN)" }, {-92, "Connection setup failed (NIEROUT_CONN_REFUSED)" }, {-93, "NI-internal errors (NIEROUT_INTERN)" }, {-94, "Connect from source to destination not allowed (NIEROUT_PERM_DENIED)" }, {-95, "Connection terminated (NIEROUT_CONN_BROKEN)" }, {-96, "Invalid client version (NIEROUT_VERSION)" }, {-97, "Connection cancelled by administrator (NIEROUT_CANCELED)" }, {-98, "saprouter shutdown (NIEROUT_SHUTDOWN)" }, {-99, "Information request refused (NIEROUT_INFO_DENIED)" }, {-100, "Max. number of clients reached (NIEROUT_OVERFLOW)" }, {-101, "Talkmode not allowed (NIEROUT_MODE_DENIED)" }, {-102, "Client not available (NIEROUT_NOCLIENT)" }, {-103, "Error in external library (NIEROUT_EXTERN)" }, {-104, "Error in the SNC shift (NIEROUT_SNC_FAILURE)" }, /* NULL */ { 0, NULL} }; /* SAP Router Admin Command values */ static const value_string saprouter_admin_command_vals[] = { { 2, "Information Request" }, { 3, "New Route Table Request" }, { 4, "Toggle Trace Request" }, { 5, "Stop Request" }, { 6, "Cancel Route Request" }, { 7, "Dump Buffers Request" }, { 8, "Flush Buffers Request" }, { 9, "Soft Shutdown Request" }, { 10, "Set Trace Peer" }, { 11, "Clear Trace Peer" }, { 12, "Trace Connection" }, { 13, "Trace Connection" }, { 14, "Hide Error Information Request" }, /* NULL */ { 0, NULL} }; static int credentials_tap = -1; static int proto_saprouter = -1; /* General fields */ static int hf_saprouter_type = -1; static int hf_saprouter_ni_version = -1; /* Niping messages */ static int hf_saprouter_niping_message = -1; /* Route information */ static int hf_saprouter_route_version = -1; static int hf_saprouter_entries = -1; static int hf_saprouter_talk_mode = -1; static int hf_saprouter_rest_nodes = -1; static int hf_saprouter_route_length = -1; static int hf_saprouter_route_offset = -1; static int hf_saprouter_route = -1; static int hf_saprouter_route_string = -1; static int hf_saprouter_route_requested_in = -1; static int hf_saprouter_route_accepted_in = -1; /* Route strings */ static int hf_saprouter_route_string_hostname = -1; static int hf_saprouter_route_string_service = -1; static int hf_saprouter_route_string_password = -1; /* Error Information/Control Messages */ static int hf_saprouter_opcode = -1; static int hf_saprouter_return_code = -1; static int hf_saprouter_unknown = -1; /* Error Information Messages */ static int hf_saprouter_error_length = -1; static int hf_saprouter_error_string = -1; static int hf_saprouter_error_eyecatcher = -1; static int hf_saprouter_error_counter = -1; static int hf_saprouter_error_error = -1; static int hf_saprouter_error_return_code= -1; static int hf_saprouter_error_component = -1; static int hf_saprouter_error_release = -1; static int hf_saprouter_error_version = -1; static int hf_saprouter_error_module = -1; static int hf_saprouter_error_line = -1; static int hf_saprouter_error_detail= -1; static int hf_saprouter_error_time = -1; static int hf_saprouter_error_system_call = -1; static int hf_saprouter_error_errorno = -1; static int hf_saprouter_error_errorno_text = -1; static int hf_saprouter_error_error_count = -1; static int hf_saprouter_error_location= -1; static int hf_saprouter_error_unknown= -1; /* TODO: Unknown fields */ /* Control Messages */ static int hf_saprouter_control_length = -1; static int hf_saprouter_control_string = -1; static int hf_saprouter_control_unknown = -1; /* Admin Messages */ static int hf_saprouter_admin_command = -1; static int hf_saprouter_admin_password = -1; static int hf_saprouter_admin_client_count_short = -1; static int hf_saprouter_admin_client_count_int = -1; static int hf_saprouter_admin_client_ids = -1; static int hf_saprouter_admin_client_id = -1; static int hf_saprouter_admin_address_mask = -1; static gint ett_saprouter = -1; /* Expert info */ static expert_field ei_saprouter_route_password_found = EI_INIT; static expert_field ei_saprouter_route_invalid_length = EI_INIT; static expert_field ei_saprouter_info_password_found = EI_INIT; static expert_field ei_saprouter_invalid_client_ids = EI_INIT; /* Global port preference */ static range_t *global_saprouter_port_range; /* Global SNC dissection preference */ static gboolean global_saprouter_snc_dissection = TRUE; /* Protocol handle */ static dissector_handle_t saprouter_handle; /* Session state information being tracked in a SAP Router conversation */ typedef struct saprouter_session_state { gboolean route_information; guint route_requested_in; gboolean route_accepted; guint route_accepted_in; gboolean route_snc_protected; gchar *src_hostname; /* Source hostname (first entry in the route string) */ guint32 src_port; /* Source port number */ gchar *src_password; /* Source password XXX: Check if possible */ gchar *dest_hostname; /* Destination hostname (last entry in the route string) */ guint32 dest_port; /* Destination port number */ gchar *dest_password; /* Destination password */ } saprouter_session_state; /* * */ void proto_reg_handoff_saprouter(void); void proto_register_saprouter(void); static guint32 dissect_serviceport(gchar *port){ guint32 portnumber = 0; if (g_ascii_isdigit(port[0])){ portnumber = (guint32)strtoul(port, NULL, 10); } else if ((strlen(port)>5) && g_str_has_prefix(port, "sapdp")){ portnumber = 3200 + (guint32)strtoul(port+5, NULL, 10); } else if ((strlen(port)>5) && g_str_has_prefix(port, "sapgw")){ portnumber = 3300 + (guint32)strtoul(port+5, NULL, 10); } else if ((strlen(port)>5) && g_str_has_prefix(port, "sapms")){ portnumber = 3600 + (guint32)strtoul(port+5, NULL, 10); } return (portnumber); } static void dissect_routestring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, saprouter_session_state *session_state){ int hop = 1; guint32 len, route_offset, int_port = 0; gchar *hostname = NULL, *port = NULL, *password = NULL; proto_item *route_hop = NULL, *route_password = NULL; proto_tree *route_hop_tree = NULL; while (tvb_offset_exists(tvb, offset)){ route_offset = offset; hostname = port = password = NULL; /* Create the subtree for this route hop */ route_hop = proto_tree_add_item(tree, hf_saprouter_route_string, tvb, offset, 0, ENC_NA); route_hop_tree = proto_item_add_subtree(route_hop, ett_saprouter); proto_item_append_text(route_hop, ", nro %d", hop); /* Dissect the hostname string */ len = tvb_strsize(tvb, offset); hostname = (gchar *)tvb_get_string_enc(wmem_file_scope(), tvb, offset, len - 1, ENC_ASCII); proto_tree_add_item(route_hop_tree, hf_saprouter_route_string_hostname, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; /* Dissect the port string */ len = tvb_strsize(tvb, offset); port = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len - 1, ENC_ASCII); proto_tree_add_item(route_hop_tree, hf_saprouter_route_string_service, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; /* Dissect the password string */ len = tvb_strsize(tvb, offset); password = (gchar *)tvb_get_string_enc(wmem_file_scope(), tvb, offset, len - 1, ENC_ASCII); route_password = proto_tree_add_item(route_hop_tree, hf_saprouter_route_string_password, tvb, offset, len, ENC_ASCII|ENC_NA); /* If a password was found, add a expert warning in the security category */ if (len > 1){ expert_add_info(pinfo, route_password, &ei_saprouter_route_password_found); /* Add the password to the credential tap */ tap_credential_t *auth = wmem_new0(pinfo->pool, tap_credential_t); auth->num = pinfo->num; auth->password_hf_id = hf_saprouter_route_string_password; auth->proto = "SAP Router Route String password"; auth->username = wmem_strdup(pinfo->pool, TAP_CREDENTIALS_PLACEHOLDER); tap_queue_packet(credentials_tap, pinfo, auth); } offset += len; /* Adjust the size of the route hop item now that we know the size */ proto_item_set_len(route_hop, offset - route_offset); /* Get the service port in numeric format */ int_port = dissect_serviceport(port); /* Add the first hostname/port as source in the conversation state*/ if ((hop==1) && !(pinfo->fd->visited)){ session_state->src_hostname = hostname; session_state->src_port = int_port; session_state->src_password = password; } hop++; } if (!(pinfo->fd->visited)) { /* Add the last hostname/port as destination */ if (hop!=1){ session_state->dest_hostname = hostname; session_state->dest_port = int_port; session_state->dest_password = password; } /* Save the status of the conversation state */ session_state->route_information = TRUE; session_state->route_accepted = FALSE; } } static void dissect_errorstring(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { guint32 len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_eyecatcher, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_counter, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_error, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_return_code, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_component, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_release, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_version, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_module, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_line, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_detail, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_time, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_system_call, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_errorno, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_errorno_text, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_error_count, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_location, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_unknown, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_unknown, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_unknown, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_unknown, tvb, offset, len, ENC_ASCII|ENC_NA); offset += len; len = tvb_strsize(tvb, offset); proto_tree_add_item(tree, hf_saprouter_error_eyecatcher, tvb, offset, len, ENC_ASCII|ENC_NA); } static tvbuff_t* dissect_saprouter_snc_frame(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint32 offset _U_){ /* Call the SNC dissector */ if (global_saprouter_snc_dissection == TRUE){ return dissect_sapsnc_frame(tvb, pinfo, tree, offset); } return NULL; } static int dissect_saprouter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { tvbuff_t *next_tvb = NULL; guint8 opcode; guint32 offset = 0, eyecatcher_length = 0; conversation_t *conversation = NULL; saprouter_session_state *session_state = NULL; proto_item *ti = NULL, *ri = NULL, *ei = NULL, *ci = NULL, *gi = NULL, *admin_password = NULL; proto_tree *saprouter_tree = NULL, *route_tree = NULL, *text_tree = NULL, *clients_tree = NULL; /* Search for a conversation */ conversation = find_or_create_conversation(pinfo); session_state = (saprouter_session_state *)conversation_get_proto_data(conversation, proto_saprouter); if (!session_state){ session_state = wmem_new(wmem_file_scope(), saprouter_session_state); if (session_state){ session_state->route_information = FALSE; session_state->route_requested_in = 0; session_state->route_accepted = FALSE; session_state->route_accepted_in = 0; session_state->route_snc_protected = FALSE; session_state->src_hostname = NULL; session_state->src_port = 0; session_state->src_password = NULL; session_state->dest_hostname = NULL; session_state->dest_port = 0; session_state->dest_password = NULL; conversation_add_proto_data(conversation, proto_saprouter, session_state); } else { /* Unable to establish a conversation, break dissection of the packet */ return 0; } } /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, "SAPROUTER"); /* Add the main SAP Router subtree */ ti = proto_tree_add_item(tree, proto_saprouter, tvb, offset, -1, ENC_NA); saprouter_tree = proto_item_add_subtree(ti, ett_saprouter); /* Get the 'eye catcher' length */ eyecatcher_length = tvb_strsize(tvb, offset); /* Niping message */ if (tvb_reported_length_remaining(tvb, offset) >= 10 && tvb_strneql(tvb, offset, SAPROUTER_TYPE_NIPING_STRING, 10) == 0) { col_set_str(pinfo->cinfo, COL_INFO, "Niping message"); proto_tree_add_item(saprouter_tree, hf_saprouter_type, tvb, offset, 10, ENC_ASCII|ENC_NA); offset += 10; proto_item_append_text(ti, ", Niping message"); if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(saprouter_tree, hf_saprouter_niping_message, tvb, offset, -1, ENC_NA); } } /* Admin Message Type */ else if (tvb_strneql(tvb, offset, SAPROUTER_TYPE_ADMIN_STRING, eyecatcher_length) == 0) { col_set_str(pinfo->cinfo, COL_INFO, "Admin message"); proto_tree_add_item(saprouter_tree, hf_saprouter_type, tvb, offset, eyecatcher_length, ENC_ASCII|ENC_NA); offset += eyecatcher_length; proto_item_append_text(ti, ", Admin message"); proto_tree_add_item(saprouter_tree, hf_saprouter_ni_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; opcode = tvb_get_guint8(tvb, offset); proto_tree_add_item(saprouter_tree, hf_saprouter_admin_command, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; switch (opcode){ case 2:{ /* Info request */ offset+=2; /* Skip 2 bytes */ /* Check if a password was supplied */ if (tvb_offset_exists(tvb, offset) && (tvb_strsize(tvb, offset) > 0)){ admin_password = proto_tree_add_item(saprouter_tree, hf_saprouter_admin_password, tvb, offset, tvb_strsize(tvb, offset), ENC_ASCII|ENC_NA); expert_add_info(pinfo, admin_password, &ei_saprouter_info_password_found); /* Add the password to the credential tap */ tap_credential_t *auth = wmem_new0(pinfo->pool, tap_credential_t); auth->num = pinfo->num; auth->password_hf_id = hf_saprouter_admin_password; auth->proto = "SAP Router Info Request password"; auth->username = wmem_strdup(pinfo->pool, TAP_CREDENTIALS_PLACEHOLDER); tap_queue_packet(credentials_tap, pinfo, auth); } break; } case 10: /* Set Peer Trace */ case 11:{ /* Clear Peer Trace */ proto_tree_add_item(saprouter_tree, hf_saprouter_admin_address_mask, tvb, offset, 32, ENC_ASCII|ENC_NA); break; } case 6: /* Cancel Route request */ case 12: /* Trace Connection */ case 13: /* Trace Connection */ { guint16 client_count = 0, client_count_actual = 0; /* Retrieve the client count first */ if (opcode == 6){ offset+=2; /* Skip 2 bytes for Cancel Route request*/ client_count = tvb_get_ntohs(tvb, offset); proto_tree_add_item(saprouter_tree, hf_saprouter_admin_client_count_short, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; } else { client_count = tvb_get_ntohl(tvb, offset); proto_tree_add_item(saprouter_tree, hf_saprouter_admin_client_count_int, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; } /* Parse the list of client IDs */ ci = proto_tree_add_item(saprouter_tree, hf_saprouter_admin_client_ids, tvb, offset, 4*client_count, ENC_NA); clients_tree = proto_item_add_subtree(ci, ett_saprouter); while (tvb_offset_exists(tvb, offset) && tvb_reported_length_remaining(tvb, offset)>=4){ proto_tree_add_item(clients_tree, hf_saprouter_admin_client_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; client_count_actual+=1; } /* Check if the actual count of IDs differes from the reported number */ if ((client_count_actual != client_count) || tvb_reported_length_remaining(tvb, offset)>0){ expert_add_info(pinfo, clients_tree, &ei_saprouter_invalid_client_ids); } break; } default: { /* Skip 2 bytes */ break; } } /* Route Message Type */ } else if (tvb_strneql(tvb, offset, SAPROUTER_TYPE_ROUTE_STRING, eyecatcher_length) == 0){ guint32 route_length = 0, route_offset = 0; col_set_str(pinfo->cinfo, COL_INFO, "Route message"); /* Get the route length/offset */ route_length = tvb_get_ntohl(tvb, offset + SAPROUTER_ROUTE_LENGTH_OFFSET); route_offset = offset + SAPROUTER_ROUTE_OFFSET_OFFSET + 4; proto_tree_add_item(saprouter_tree, hf_saprouter_type, tvb, 0, eyecatcher_length, ENC_ASCII|ENC_NA); offset += eyecatcher_length; proto_item_append_text(ti, ", Route message"); /* Add the fields */ proto_tree_add_item(saprouter_tree, hf_saprouter_route_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(saprouter_tree, hf_saprouter_ni_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(saprouter_tree, hf_saprouter_entries, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(saprouter_tree, hf_saprouter_talk_mode, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=3; /* There're two unused bytes there */ proto_tree_add_item(saprouter_tree, hf_saprouter_rest_nodes, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(saprouter_tree, hf_saprouter_route_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(saprouter_tree, hf_saprouter_route_offset, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; /* Add the route tree */ if ((guint32)tvb_reported_length_remaining(tvb, offset) != route_length){ expert_add_info_format(pinfo, saprouter_tree, &ei_saprouter_route_invalid_length, "Route string length is invalid (remaining=%d, route_length=%d)", tvb_reported_length_remaining(tvb, offset), route_length); route_length = (guint32)tvb_reported_length_remaining(tvb, offset); } ri = proto_tree_add_item(saprouter_tree, hf_saprouter_route, tvb, offset, route_length, ENC_NA); route_tree = proto_item_add_subtree(ri, ett_saprouter); /* Dissect the route string */ dissect_routestring(tvb, pinfo, route_tree, route_offset, session_state); /* If this is the first time we're seeing this packet, mark it as the one where the route was requested */ if (!pinfo->fd->visited) { session_state->route_requested_in = pinfo->num; } /* Add the route to the colinfo*/ if (session_state->src_hostname){ col_append_fstr(pinfo->cinfo, COL_INFO, ", Source: Hostname=%s Service Port=%d", session_state->src_hostname, session_state->src_port); if (strlen(session_state->src_password)>0) col_append_fstr(pinfo->cinfo, COL_INFO, " Password=%s", session_state->src_password); } if (session_state->dest_hostname){ col_append_fstr(pinfo->cinfo, COL_INFO, ", Destination: Hostname=%s Service Port=%d", session_state->dest_hostname, session_state->dest_port); if (strlen(session_state->dest_password)>0) col_append_fstr(pinfo->cinfo, COL_INFO, " Password=%s", session_state->dest_password); } if (session_state->route_accepted && session_state->route_accepted_in) { gi = proto_tree_add_uint(saprouter_tree, hf_saprouter_route_accepted_in, tvb, 0, 0, session_state->route_accepted_in); proto_item_set_generated(gi); } /* Error Information/Control Message Type */ } else if (tvb_strneql(tvb, offset, SAPROUTER_TYPE_ERR_STRING, eyecatcher_length) == 0){ /* Extract the opcode if possible to determine the type of message */ if (tvb_offset_exists(tvb, offset + 10)) { opcode = tvb_get_guint8(tvb, offset + 10); } else { opcode = 0; } col_set_str(pinfo->cinfo, COL_INFO, (opcode==0)? "Error information" : "Control message"); guint32 text_length = 0; proto_item_append_text(ti, (opcode==0)? ", Error information" : ", Control message"); /* Add the fields */ proto_tree_add_item(saprouter_tree, hf_saprouter_type, tvb, offset, eyecatcher_length, ENC_ASCII|ENC_NA); offset += eyecatcher_length; proto_tree_add_item(saprouter_tree, hf_saprouter_ni_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(saprouter_tree, hf_saprouter_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=2; /* There's a unused byte there */ proto_tree_add_item(saprouter_tree, hf_saprouter_return_code, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; text_length = tvb_get_ntohl(tvb, offset); /* Error Information Message */ if (opcode == 0){ proto_tree_add_item(saprouter_tree, hf_saprouter_error_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; if ((text_length > 0) && tvb_offset_exists(tvb, offset+text_length)){ /* Add the error string tree */ ei = proto_tree_add_item(saprouter_tree, hf_saprouter_error_string, tvb, offset, text_length, ENC_NA); text_tree = proto_item_add_subtree(ei, ett_saprouter); dissect_errorstring(tvb, text_tree, offset); offset += text_length; } /* Add an unknown int field */ proto_tree_add_item(saprouter_tree, hf_saprouter_unknown, tvb, offset, 4, ENC_BIG_ENDIAN); /* Control Message */ } else { /* Add the opcode name */ proto_item_append_text(ti, ", opcode=%s", val_to_str_const(opcode, saprouter_opcode_vals, "Unknown")); col_append_fstr(pinfo->cinfo, COL_INFO, ", opcode=%s", val_to_str_const(opcode, saprouter_opcode_vals, "Unknown")); proto_tree_add_item(saprouter_tree, hf_saprouter_control_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; if ((text_length >0) && tvb_offset_exists(tvb, offset+text_length)){ /* Add the control string tree */ proto_tree_add_item(saprouter_tree, hf_saprouter_control_string, tvb, offset, text_length, ENC_ASCII|ENC_NA); offset += text_length; } /* SNC request, mark the conversation as SNC protected and dissect the SNC frame */ if (opcode == 70 || opcode == 71){ session_state->route_snc_protected = TRUE; dissect_saprouter_snc_frame(tvb, pinfo, tree, offset); /* Other opcodes */ } else { proto_tree_add_item(saprouter_tree, hf_saprouter_control_unknown, tvb, offset, 4, ENC_ASCII|ENC_NA); } } /* Route Acceptance (NI_PONG) Message Type */ } else if (tvb_strneql(tvb, offset, SAPROUTER_TYPE_ROUTE_ACCEPT, eyecatcher_length) == 0){ /* Route information available */ if (session_state->route_information){ /* If this is the first time we're seen the packet, mark is as the one where the route was accepted */ if (!pinfo->fd->visited) { session_state->route_accepted = TRUE; session_state->route_accepted_in = pinfo->num; } col_append_fstr(pinfo->cinfo, COL_INFO, ", from %s:%d to %s:%d", session_state->src_hostname, session_state->src_port, session_state->dest_hostname, session_state->dest_port); proto_item_append_text(ti, ", from %s:%d to %s:%d", session_state->src_hostname, session_state->src_port, session_state->dest_hostname, session_state->dest_port); if (session_state->route_requested_in) { gi = proto_tree_add_uint(saprouter_tree, hf_saprouter_route_requested_in, tvb, 0, 0, session_state->route_requested_in); proto_item_set_generated(gi); } } /* Uknown Message Type */ } else { col_add_fstr(pinfo->cinfo, COL_INFO, "Routed message"); proto_item_append_text(ti, ", Routed message"); /* If the session is protected with SNC, first dissect the SNC frame * and save the content for further dissection. */ if (session_state->route_snc_protected) { col_append_fstr(pinfo->cinfo, COL_INFO, ", SNC protected"); proto_item_append_text(ti, ", SNC protected"); next_tvb = dissect_saprouter_snc_frame(tvb, pinfo, tree, offset); /* If the session is not protected dissect the entire payload */ } else { next_tvb = tvb; } /* If the session has information about the route requested */ if (session_state->route_information){ /* Route accepted */ if (session_state->route_accepted){ col_append_fstr(pinfo->cinfo, COL_INFO, ", from %s:%d to %s:%d ", session_state->src_hostname, session_state->src_port, session_state->dest_hostname, session_state->dest_port); proto_item_append_text(ti, ", from %s:%d to %s:%d ", session_state->src_hostname, session_state->src_port, session_state->dest_hostname, session_state->dest_port); if (session_state->route_requested_in) { gi = proto_tree_add_uint(saprouter_tree, hf_saprouter_route_requested_in, tvb, 0, 0, session_state->route_requested_in); proto_item_set_generated(gi); } if (session_state->route_accepted_in) { gi = proto_tree_add_uint(saprouter_tree, hf_saprouter_route_accepted_in, tvb, 0, 0, session_state->route_accepted_in); proto_item_set_generated(gi); } /* Route not accepted but some information available */ } else { col_append_fstr(pinfo->cinfo, COL_INFO, ", to unknown destination"); proto_item_append_text(ti, ", to unknown destination"); } /* Call the dissector in the NI protocol sub-dissectors table * according to the route destination port number. */ if (next_tvb) { dissect_sap_protocol_payload(next_tvb, offset, pinfo, tree, 0, session_state->dest_port); } } else { /* No route information available */ col_append_fstr(pinfo->cinfo, COL_INFO, ", to unknown destination"); proto_item_append_text(ti, ", to unknown destination"); } } return tvb_reported_length(tvb); } void proto_register_saprouter(void) { static hf_register_info hf[] = { { &hf_saprouter_type, { "Type", "saprouter.type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Niping message */ { &hf_saprouter_niping_message, { "Niping message", "saprouter.message", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* NI Route messages */ { &hf_saprouter_route_version, { "Route version", "saprouter.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_ni_version, { "NI version", "saprouter.niversion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_entries, { "Entries", "saprouter.entries", FT_UINT8, BASE_DEC, NULL, 0x0, "Total number of entries", HFILL }}, { &hf_saprouter_talk_mode, { "Talk Mode", "saprouter.talkmode", FT_UINT8, BASE_DEC, VALS(saprouter_talk_mode_vals), 0x0, NULL, HFILL }}, { &hf_saprouter_rest_nodes, { "Remaining Hops", "saprouter.restnodes", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_length, { "Route String Length", "saprouter.routelength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_offset, { "Route String Offset", "saprouter.routeoffset", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route, { "Route String", "saprouter.routestring", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_string, { "Route Hop", "saprouter.routestring", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_string_hostname, { "Hostname", "saprouter.routestring.hostname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_string_service, { "Service", "saprouter.routestring.service", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_string_password, { "Password", "saprouter.routestring.password", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_route_requested_in, { "Route Requested in", "saprouter.requested_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The route request for this packet is in this packet", HFILL }}, { &hf_saprouter_route_accepted_in, { "Route Accepted in", "saprouter.accepted_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The route for this packet was accepted in this packet", HFILL }}, /* NI error information / Control messages */ { &hf_saprouter_opcode, { "Operation Code", "saprouter.opcode", FT_UINT8, BASE_DEC, VALS(saprouter_opcode_vals), 0x0, NULL, HFILL }}, { &hf_saprouter_return_code, { "Return Code", "saprouter.returncode", FT_INT32, BASE_DEC, VALS(saprouter_return_code_vals), 0x0, NULL, HFILL }}, { &hf_saprouter_unknown, { "Unknown field", "saprouter.unknown", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* NI Error Information messages */ { &hf_saprouter_error_length, { "Error Information Text Length", "saprouter.errorlength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_string, { "Error Information Text", "saprouter.errortext", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_eyecatcher, { "Eyecatcher", "saprouter.errortext.eyecatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_counter, { "Counter", "saprouter.errortext.counter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_error, { "Error", "saprouter.errortext.error", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_return_code, { "Return code", "saprouter.errortext.returncode", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_component, { "Component", "saprouter.errortext.component", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_release, { "Release", "saprouter.errortext.release", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_version, { "Version", "saprouter.errortext.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_module, { "Module", "saprouter.errortext.module", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_line, { "Line", "saprouter.errortext.line", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_detail, { "Detail", "saprouter.errortext.detail", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_time, { "Time", "saprouter.errortext.time", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_system_call, { "System Call", "saprouter.errortext.system_call", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_errorno, { "Error Number", "saprouter.errortext.errorno", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_errorno_text, { "Error Number Text", "saprouter.errortext.errorno_text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_location, { "Location", "saprouter.errortext.location", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_error_count, { "Error Count", "saprouter.errortext.error_count", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_error_unknown, { "Unknown field", "saprouter.errortext.unknown", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Control messages */ { &hf_saprouter_control_length, { "Control Text Length", "saprouter.controllength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_control_string, { "Control Text", "saprouter.controltext", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_control_unknown, { "Control Unknown field", "saprouter.controlunknown", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Router Admin messages */ { &hf_saprouter_admin_command, { "Admin Command", "saprouter.command", FT_UINT8, BASE_DEC, VALS(saprouter_admin_command_vals), 0x0, NULL, HFILL }}, { &hf_saprouter_admin_password, { "Admin Command Info Password", "saprouter.password", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_admin_client_count_short, { "Admin Command Client Count", "saprouter.client_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_admin_client_count_int, { "Admin Command Client Count", "saprouter.client_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_admin_client_ids, { "Admin Command Client IDs", "saprouter.client_ids", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_admin_client_id, { "Admin Command Client ID", "saprouter.client_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_saprouter_admin_address_mask, { "Admin Command Address Mask", "saprouter.address_mask", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_saprouter }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_saprouter_route_password_found, { "saprouter.routestring.password.found", PI_SECURITY, PI_WARN, "Route password found", EXPFILL }}, { &ei_saprouter_info_password_found, { "saprouter.password.found", PI_SECURITY, PI_WARN, "Info password found", EXPFILL }}, { &ei_saprouter_route_invalid_length, { "saprouter.routestring.routelength.invalid", PI_MALFORMED, PI_WARN, "The route string length is invalid", EXPFILL }}, { &ei_saprouter_invalid_client_ids, { "saprouter.client_ids.invalid", PI_MALFORMED, PI_WARN, "Client IDs list is malformed", EXPFILL }}, }; module_t *saprouter_module; expert_module_t* saprouter_expert; /* Register the protocol */ proto_saprouter = proto_register_protocol("SAP Router Protocol", "SAPROUTER", "saprouter"); proto_register_field_array(proto_saprouter, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); saprouter_expert = expert_register_protocol(proto_saprouter); expert_register_field_array(saprouter_expert, ei, array_length(ei)); register_dissector("saprouter", dissect_saprouter, proto_saprouter); /* Register the preferences */ saprouter_module = prefs_register_protocol(proto_saprouter, proto_reg_handoff_saprouter); range_convert_str(wmem_epan_scope(), &global_saprouter_port_range, SAPROUTER_PORT_RANGE, MAX_TCP_PORT); prefs_register_range_preference(saprouter_module, "tcp_ports", "SAP Router Protocol TCP port numbers", "Port numbers used for SAP Router Protocol (default " SAPROUTER_PORT_RANGE ")", &global_saprouter_port_range, MAX_TCP_PORT); prefs_register_bool_preference(saprouter_module, "snc_dissection", "Dissect SAP SNC frames", "Whether the SAP Router Protocol dissector should call the SAP SNC dissector for SNC frames", &global_saprouter_snc_dissection); /* Register the tap*/ credentials_tap = register_tap("credentials"); } /** * Helpers for dealing with the port range */ static void range_delete_callback (guint32 port, gpointer ptr _U_) { dissector_delete_uint("sapni.port", port, saprouter_handle); } static void range_add_callback (guint32 port, gpointer ptr _U_) { dissector_add_uint("sapni.port", port, saprouter_handle); } /** * Register Hand off for the SAP Router Protocol */ void proto_reg_handoff_saprouter(void) { static gboolean initialized = FALSE; static range_t *saprouter_port_range; if (!initialized) { saprouter_handle = create_dissector_handle(dissect_saprouter, proto_saprouter); initialized = TRUE; } else { range_foreach(saprouter_port_range, range_delete_callback, NULL); wmem_free(wmem_epan_scope(), saprouter_port_range); } saprouter_port_range = range_copy(wmem_epan_scope(), global_saprouter_port_range); range_foreach(saprouter_port_range, range_add_callback, NULL); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sapsnc.c
/* packet-sapsnc.c * Routines for SAP SNC (Secure Network Connection) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This is a basic dissector for the SAP Secure Network Connection protocol. It dissects the basic * SNC frame fields, and if the QoP (quality of protection) is only set to wrap/seal but not encrypt, * it can be used to extract the content and further dissect it on an upper layer. * * Some details and example requests can be found in pysap's documentation: https://pysap.readthedocs.io/en/latest/protocols/SAPSNC.html. */ #include <config.h> #include <epan/packet.h> #include <epan/expert.h> #include "packet-sapsnc.h" /* SAP SNC Frame Type */ static const value_string sapsnc_frame_type_vals[] = { { 0x00, "REVERSE_REQ" }, { 0x01, "INIT_REQ" }, { 0x02, "INIT" }, { 0x03, "INIT_ACK" }, { 0x04, "ACCEPT" }, { 0x05, "ACCEPT_ACK" }, { 0x06, "ACCEPT_FAILED" }, { 0x07, "DATA_OPEN" }, { 0x08, "DATA_MIC/DATA_SIGNED" }, { 0x09, "DATA_WRAP/DATA_SEALED" }, { 0x0a, "SHUTDOWN" }, { 0x0b, "SHUTDOWN_MSG" }, { 0x0c, "REJECTED" }, { 0x0d, "ERROR" }, { 0x0e, "UNKNOWN" }, { 0, NULL } }; /* SNC Mech ID values */ static const value_string sapsnc_mech_id_vals[] = { { 0x00, "No security" }, { 0x01, "Generic GSS-API v2 Mechanism" }, { 0x02, "Kerberos 5/GSS-API v2" }, { 0x03, "Secude 5 GSS-API v2" }, { 0x04, "SAP's GSS-API v2 over NTLM(SSPI)" }, { 0x05, "SPKM1 GSS-API v2 library" }, { 0x06, "SPKM2 GSS-API v2 library" }, { 0x07, "reserved ID" }, { 0x08, "itsec" }, { 0x09, "SDTI Connect Agent" }, { 0x0a, "AccessMaster DCE" }, { 0, NULL } }; /* SNC Quality of protection values */ static const value_string sapsnc_qop_vals[] = { { 0x00, "INVALID" }, { 0x01, "OPEN" }, { 0x02, "INTEGRITY/SIGNED" }, { 0x03, "PRIVACY/SEALED" }, { 0x07, "MIN" }, { 0x08, "DEFAULT" }, { 0x09, "MAX" }, { 0, NULL } }; static int proto_sapsnc = -1; /* SNC Frame */ static int hf_sapsnc_frame = -1; static int hf_sapsnc_eye_catcher = -1; static int hf_sapsnc_frame_type = -1; static int hf_sapsnc_protocol_version = -1; static int hf_sapsnc_header_length = -1; static int hf_sapsnc_token_length = -1; static int hf_sapsnc_data_length = -1; static int hf_sapsnc_mech_id = -1; static int hf_sapsnc_flags = -1; static int hf_sapsnc_qop_min = -1; static int hf_sapsnc_qop_max = -1; static int hf_sapsnc_qop_use = -1; static int hf_sapsnc_ext_flags = -1; static int hf_sapsnc_ext_field_length = -1; static int hf_sapsnc_ext_field = -1; static int hf_sapsnc_token = -1; static int hf_sapsnc_data = -1; static gint ett_sapsnc = -1; /* Expert info */ static expert_field ei_sapsnc_invalid_header_length = EI_INIT; void proto_reg_handoff_sapsnc(void); void proto_register_sapsnc(void); /** * Dissect an SNC Frame. If data it's found for wrapped/signed frames, it * returns a new TVB buffer with the content. This function can be called * from any dissector that wants SNC frames to be decoded. */ tvbuff_t* dissect_sapsnc_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { tvbuff_t *next_tvb = NULL; guint8 frame_type; guint32 header_length, ext_field_length, token_length = 0, data_length = 0; proto_item *sapsnc_frame = NULL, *sapsnc_flags = NULL, *sapsnc_header_length = NULL; proto_tree *sapsnc_frame_tree = NULL, *sapsnc_flags_tree = NULL; /* Add the SNC Frame subtree */ sapsnc_frame = proto_tree_add_item(tree, hf_sapsnc_frame, tvb, offset, -1, ENC_NA); sapsnc_frame_tree = proto_item_add_subtree(sapsnc_frame, ett_sapsnc); /* Eye catcher */ proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_eye_catcher, tvb, offset, 8, ENC_ASCII|ENC_NA); offset+=8; /* Frame type */ frame_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; /* Protocol version */ proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_protocol_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; /* Header length */ sapsnc_header_length = proto_tree_add_item_ret_uint(sapsnc_frame_tree, hf_sapsnc_header_length, tvb, offset, 2, ENC_BIG_ENDIAN, &header_length); /* We subtracts the 10 bytes of the header already processed */ header_length -= 10; /* Check the header length, it should be at least 24 bytes */ if (header_length < 14){ expert_add_info_format(pinfo, sapsnc_header_length, &ei_sapsnc_invalid_header_length, "Invalid header length %u", header_length); header_length = 14; } else if ((guint32)tvb_reported_length_remaining(tvb, offset) < header_length) { expert_add_info_format(pinfo, sapsnc_header_length, &ei_sapsnc_invalid_header_length, "Invalid captured length %d (reported %u)", tvb_reported_length_remaining(tvb, offset), header_length); header_length = tvb_reported_length_remaining(tvb, offset); } offset+=2; header_length-=2; /* Token length */ proto_tree_add_item_ret_uint(sapsnc_frame_tree, hf_sapsnc_token_length, tvb, offset, 4, ENC_BIG_ENDIAN, &token_length); offset+=4; header_length-=4; /* Data length */ proto_tree_add_item_ret_uint(sapsnc_frame_tree, hf_sapsnc_data_length, tvb, offset, 4, ENC_BIG_ENDIAN, &data_length); offset+=4; header_length-=4; /* Mech ID */ proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_mech_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; header_length-=2; /* Build a tree for the flags */ sapsnc_flags = proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_flags, tvb, offset, 2, ENC_NA); sapsnc_flags_tree = proto_item_add_subtree(sapsnc_flags, ett_sapsnc); offset+=1; header_length-=1; /* Unknown flags (1 byte) */ /* Unknown flag (1 bit) */ proto_tree_add_bits_item(sapsnc_flags_tree, hf_sapsnc_qop_use, tvb, offset*8 + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_bits_item(sapsnc_flags_tree, hf_sapsnc_qop_max, tvb, offset*8 + 3, 2, ENC_BIG_ENDIAN); proto_tree_add_bits_item(sapsnc_flags_tree, hf_sapsnc_qop_min, tvb, offset*8 + 5, 2, ENC_BIG_ENDIAN); /* Unknown flag (1 bit) */ offset+=1; header_length-=1; /* If there's header remaining, we add the extra flags, length and fields */ if (header_length >= 6 && tvb_offset_exists(tvb, offset + 6)) { /* Get the extra flags */ proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_ext_flags, tvb, offset, 4, ENC_NA); offset+=4; /* Get the extra field length */ proto_tree_add_item_ret_uint(sapsnc_frame_tree, hf_sapsnc_ext_field_length, tvb, offset, 2, ENC_BIG_ENDIAN, &ext_field_length); offset+=2; /* If the extra field length is valid extract those */ if (ext_field_length > 0 && tvb_offset_exists(tvb, offset + ext_field_length)) { proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_ext_field, tvb, offset, ext_field_length, ENC_NA); offset+=ext_field_length; } } /* Token */ if (token_length > 0 && tvb_offset_exists(tvb, offset + token_length)) { proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_token, tvb, offset, token_length, ENC_NA); offset+=token_length; } /* Data */ if (data_length > 0 && tvb_offset_exists(tvb, offset + data_length)) { proto_tree_add_item(sapsnc_frame_tree, hf_sapsnc_data, tvb, offset, data_length, ENC_NA); /* If the frame contain data being wrapped or sealed, put it into a new tvb for further dissection of the upper layer */ if ((frame_type == 0x07) || (frame_type == 0x08)) { next_tvb = tvb_new_subset_remaining(tvb, offset); } } return next_tvb; } /** * Dissects SNC packets */ static int dissect_sapsnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* Add the protocol to the column */ col_add_str(pinfo->cinfo, COL_PROTOCOL, ", SAPSNC"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); /* Call the SNC frame dissection function */ dissect_sapsnc_frame(tvb, pinfo, tree, 0); return tvb_reported_length(tvb); } void proto_register_sapsnc(void) { static hf_register_info hf[] = { /* SNC Frame */ { &hf_sapsnc_frame, { "SNC Frame", "sapsnc.frame", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_eye_catcher, { "SNC Eye Catcher", "sapsnc.eyecatcher", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_frame_type, { "SNC Frame Type", "sapsnc.frame.type", FT_UINT8, BASE_HEX, VALS(sapsnc_frame_type_vals), 0x0, NULL, HFILL }}, { &hf_sapsnc_protocol_version, { "SNC Protocol Version", "sapsnc.frame.protocolversion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_header_length, { "SNC Header length", "sapsnc.frame.header_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_token_length, { "SNC Token length", "sapsnc.frame.tokenlength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_data_length, { "SNC Data length", "sapsnc.frame.datalength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_mech_id, { "SNC Mech ID", "sapsnc.frame.mech_id", FT_UINT16, BASE_HEX, VALS(sapsnc_mech_id_vals), 0x0, NULL, HFILL }}, { &hf_sapsnc_flags, { "SNC Flags", "sapsnc.frame.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_qop_min, { "SNC QOP Min", "sapsnc.frame.qop_min", FT_UINT8, BASE_HEX, VALS(sapsnc_qop_vals), 0x0, NULL, HFILL }}, { &hf_sapsnc_qop_max, { "SNC QOP Max", "sapsnc.frame.qop_max", FT_UINT8, BASE_HEX, VALS(sapsnc_qop_vals), 0x0, NULL, HFILL }}, { &hf_sapsnc_qop_use, { "SNC QOP Use", "sapsnc.frame.qop_use", FT_UINT8, BASE_HEX, VALS(sapsnc_qop_vals), 0x0, NULL, HFILL }}, { &hf_sapsnc_ext_flags, { "SNC Extensions Flags", "sapsnc.frame.ext_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_ext_field_length, { "SNC Extensions Field length", "sapsnc.frame.ext_field_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_ext_field, { "SNC Extensions Field", "sapsnc.frame.ext_field", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_token, { "SNC Token", "sapsnc.frame.token", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sapsnc_data, { "SNC Data", "sapsnc.frame.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sapsnc }; /* Register the expert info */ static ei_register_info ei[] = { { &ei_sapsnc_invalid_header_length, { "sapsnc.frame.header_length_invalid", PI_MALFORMED, PI_WARN, "Invalid header length", EXPFILL }}, }; expert_module_t* sapsnc_expert; /* Register the protocol */ proto_sapsnc = proto_register_protocol("SAP SNC Protocol", "SAPSNC", "sapsnc"); proto_register_field_array(proto_sapsnc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sapsnc_expert = expert_register_protocol(proto_sapsnc); expert_register_field_array(sapsnc_expert, ei, array_length(ei)); register_dissector("sapsnc", dissect_sapsnc, proto_sapsnc); } /** * Register Hand off for the SAP SNC Protocol */ void proto_reg_handoff_sapsnc(void) { static gboolean initialized = FALSE; if (!initialized) { create_dissector_handle(dissect_sapsnc, proto_sapsnc); initialized = TRUE; } } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-sapsnc.h
/* packet-sapsnc.h * Routines for SAP SNC (Secure Network Connectoin) dissection * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> * Code contributed by SecureAuth Corp. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SAPPSNC_H__ #define __PACKET_SAPPSNC_H__ #include <epan/packet.h> extern /** * Dissect an SNC Frame. If data it's found for wrapped/signed frames, it * returns a new TVB buffer with the content. This function can be called * from any dissector that wants SNC frames to be decoded. */ tvbuff_t* dissect_sapsnc_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset); #endif /* __PACKET_SAPPSNC_H__ */
C
wireshark/epan/dissectors/packet-sasp.c
/* packet-sasp.c * Routines for sasp packet dissection * Copyright 2010, Venkateshwaran Dorai<[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/to_str.h> #include "packet-tcp.h" /* forward reference */ void proto_register_sasp(void); void proto_reg_handoff_sasp(void); static dissector_handle_t sasp_handle; static void dissect_reg_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset); static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_sendwt(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_setmemstate_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_setmemstate_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_setlbstate_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_setlbstate_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_wt_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_wt_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, proto_tree **mdct_p); static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static guint32 dissect_grp_memdatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static guint32 dissect_grp_memstatedatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static guint32 dissect_memstatedatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset); static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset); /* Initialize the protocol and registered fields */ static int proto_sasp = -1; static int hf_sasp_type = -1; static int hf_sasp_length = -1; static int hf_sasp_vrsn = -1; static int hf_msg_len = -1; static int hf_msg_id = -1; static int hf_msg_type = -1; /*reg reply*/ static int hf_sasp_reg_rep_rcode = -1; static int hf_sasp_reg_rep_sz = -1; /*reg req*/ static int hf_sasp_reg_req_sz = -1; static int hf_reg_req_lbflag = -1; static int hf_sasp_gmd_cnt = -1; /*dereg req*/ static int hf_sasp_dereg_req_sz = -1; static int hf_dereg_req_lbflag = -1; /* static int hf_dereg_req_reason = -1; */ static int hf_dereg_req_reason_flag = -1; /*dereg reply*/ static int hf_sasp_dereg_rep_rcode = -1; static int hf_sasp_dereg_rep_sz = -1; /*send wt*/ static int hf_sasp_sendwt_gwedcnt = -1; static int hf_sasp_sendwt_sz = -1; /*setmemstate req*/ static int hf_sasp_setmemstate_req_sz = -1; static int hf_setmemstate_req_lbflag = -1; /*static int hf_sasp_setmemstate_req_data = -1;*/ static int hf_sasp_setmemstate_req_gmsd_cnt = -1; /*setmemstate reply*/ /* static int hf_sasp_setmemstate_rep = -1; */ static int hf_sasp_setmemstate_rep_rcode = -1; static int hf_sasp_setmemstate_rep_sz = -1; /*mem data comp */ static int hf_sasp_memdatacomp_type = -1; static int hf_sasp_memdatacomp_sz = -1; static int hf_sasp_memdatacomp_protocol = -1; static int hf_sasp_memdatacomp_port = -1; static int hf_sasp_memdatacomp_ip = -1; static int hf_sasp_memdatacomp_lab_len = -1; static int hf_sasp_memdatacomp_label = -1; /*grp data comp */ static int hf_sasp_grpdatacomp = -1; static int hf_sasp_grpdatacomp_sz = -1; static int hf_sasp_grpdatacomp_LB_uid_len = -1; static int hf_sasp_grpdatacomp_LB_uid = -1; static int hf_sasp_grpdatacomp_grp_name_len = -1; static int hf_sasp_grpdatacomp_grp_name = -1; /*grp mem data comp */ static int hf_sasp_grp_memdatacomp = -1; static int hf_sasp_grp_memdatacomp_sz = -1; static int hf_sasp_grp_memdatacomp_cnt = -1; /*weight req*/ static int hf_sasp_wt_req_sz = -1; static int hf_sasp_wt_req_gd_cnt = -1; /*weight rep*/ static int hf_sasp_wt_rep_sz = -1; static int hf_sasp_wt_rep_rcode = -1; static int hf_sasp_wt_rep_interval = -1; static int hf_sasp_wt_rep_gwed_cnt = -1; /*setlbstate req*/ static int hf_sasp_setlbstate_req_sz = -1; static int hf_sasp_setlbstate_req_LB_uid_len = -1; static int hf_sasp_setlbstate_req_LB_uid = -1; static int hf_sasp_setlbstate_req_LB_health = -1; /*static int hf_sasp_setlbstate_req_LB_flag = -1;*/ /* static int hf_lbstate_flag = -1; */ static int hf_sasp_pushflag = -1; static int hf_sasp_trustflag = -1; static int hf_sasp_nochangeflag = -1; /*setlbstate reply*/ /* static int hf_sasp_setlbstate_rep = -1; */ static int hf_sasp_setlbstate_rep_rcode = -1; static int hf_sasp_setlbstate_rep_sz = -1; /*grp mem state data*/ static int hf_sasp_grp_memstatedatacomp = -1; static int hf_sasp_grp_memstatedatacomp_sz = -1; static int hf_sasp_grp_memstatedatacomp_cnt = -1; /*mem state data comp*/ static int hf_sasp_memstatedatacomp_instance = -1; static int hf_sasp_memstatedatacomp_sz = -1; static int hf_sasp_memstatedatacomp_state = -1; static int hf_sasp_memstatedatacomp_quiesce_flag = -1; /*wt entry dat comp*/ static int hf_sasp_weight_entry_data_comp_type = -1; static int hf_sasp_weight_entry_data_comp_sz = -1; static int hf_sasp_weight_entry_data_comp_state = -1; /* static int hf_wtstate_flag = -1; */ static int hf_sasp_wed_contactsuccess_flag = -1; static int hf_sasp_wed_quiesce_flag = -1; static int hf_sasp_wed_registration_flag = -1; static int hf_sasp_wed_confident_flag = -1; static int hf_sasp_weight_entry_data_comp_weight = -1; /*grp wt entry data comp */ static int hf_sasp_grp_wt_entry_datacomp_type = -1; static int hf_sasp_grp_wt_entry_datacomp_sz = -1; static int hf_sasp_grp_wt_entry_datacomp_cnt = -1; /* Initialize the subtree pointers */ static gint ett_sasp_data = -1; static gint ett_sasp_header = -1; static gint ett_sasp_msg = -1; static gint ett_sasp_payload = -1; static gint ett_sasp_reg_req = -1; static gint ett_sasp_reg_rep = -1; static gint ett_sasp_reg_req_sz = -1; static gint ett_sasp_dereg_req_sz= -1; static gint ett_sasp_dereg_rep = -1; static gint ett_sasp_sendwt = -1; static gint ett_sasp_setmemstate_rep = -1; static gint ett_sasp_memdatacomp = -1; static gint ett_sasp_grpdatacomp = -1; static gint ett_sasp_grp_memdatacomp = -1; static gint ett_sasp_setlbstate_req = -1; static gint ett_sasp_setlbstate_rep = -1; static gint ett_sasp_getwt= -1; static gint ett_sasp_setmemstate_req = -1; static gint ett_setlbstate_req_lbflag = -1; static gint ett_sasp_grp_memstatedatacomp = -1; static gint ett_sasp_memstatedatacomp = -1; /*static gint ett_dereg_req_reason_flag = -1;*/ static gint ett_sasp_grp_wt_entry_datacomp = -1; static gint ett_sasp_weight_entry_data_comp = -1; static gint ett_wt_entry_data_flag = -1; static gint ett_sasp_wt_rep = -1; static expert_field ei_msg_type_invalid = EI_INIT; /* desegmentation of SASP over TCP */ static gboolean sasp_desegment = TRUE; static const value_string msg_table[] = { { 0x1010, "Registration Request" }, { 0x1015, "Registration Reply"}, { 0x1020, "DeRegistration Request"}, { 0x1025, "DeRegistration Reply"}, { 0x1030, "Get Weights Request"}, { 0x1035, "Get Weights Reply" }, { 0x1040, "Send Weights"}, { 0x1050, "Set LB State Request"}, { 0x1055, "Set LB State Reply"}, { 0x1060, "Set Member State Request"}, { 0x1065, "Set Member State Reply"}, { 0x3010, "Member Data Component"}, { 0x3011, "Group Data Component"}, { 0x3012, "Weight Entry Data Component"}, { 0x3013, "Member State Instance"}, { 0x4010, "Group of Member Data"}, { 0x4011, "Group of Weight Entry Data" }, { 0x4012, "Group of Member State Data" }, { 0, NULL } }; static value_string_ext msg_table_ext = VALUE_STRING_EXT_INIT(msg_table); static const value_string protocol_table[] = { { 0x06, "TCP" }, { 0x11, "UDP" }, { 0, NULL } }; static const value_string lbstate_healthtable[] = { { 0x00, "Least Healthy" }, { 0x7f, "Most Healthy" }, { 0, NULL } }; static const value_string reg_reply_response_code[] = { { 0x00, "Successful" }, { 0x10, "Message not understood" }, { 0x11, "GWM will not accept this message from the sender" }, { 0x40, "Member already registered" }, { 0x44, "Duplicate Member in Request" }, { 0x45, "Invalid Group (determined by the GWM)"}, { 0x50, "Invalid Group Name Size (size == 0)"}, { 0x51, "Invalid LB uid Size (size == 0 or > max)"}, { 0x61, "Member is registering itself, but LB hasn't yet contacted the GWM." " This registration will not be processed."}, { 0, NULL } }; static const value_string dereg_reply_response_code[] = { { 0x00, "Successful" }, { 0x10, "Message not understood" }, { 0x11, "GWM will not accept this message from the sender" }, { 0x41, "Application or System not registered" }, { 0x42, "Unknown Group Name" }, { 0x43, "Unknown LB uid" }, { 0x44, "Duplicate Member in Request"}, { 0x46, "Duplicate Group in Request (for remove all members/groups requests)"}, { 0x51, "Invalid LB uid Size (size == 0 or > max)"}, { 0x61, "Member is deregistering itself, but LB hasn't yet contacted the GWM." " This deregistration will not be processed."}, { 0, NULL } }; static const value_string get_weights_reply_response_code[] = { { 0x00, "Successful" }, { 0x10, "Message not understood" }, { 0x11, "GWM will not accept this message from the sender" }, { 0x42, "Unknown Group Name" }, { 0x43, "Unknown LB uid" }, { 0x46, "Duplicate Group in Request"}, { 0x51, "Invalid LB uid Size (size == 0 or > max)"}, { 0, NULL } }; static const value_string set_lb_state_reply_response_code[] = { { 0x00, "Successful" }, { 0x10, "Message not understood" }, { 0x11, "GWM will not accept this message from the sender" }, { 0x51, "Invalid LB uid Size (size == 0 or > max)"}, { 0, NULL } }; static const value_string set_mem_state_reply_response_code[] = { { 0x00, "Successful" }, { 0x10, "Message not understood" }, { 0x11, "GWM will not accept this message from the sender" }, { 0x41, "Application or System not registered" }, { 0x42, "Unknown Group Name" }, { 0x43, "Unknown LB uid" }, { 0x44, "Duplicate Member in Request"}, { 0x46, "Duplicate Group in Request (for remove all members/groups requests)"}, { 0x50, "Invalid Group Name Size (size == 0)"}, { 0x51, "Invalid LB uid Size (size == 0 or > max)"}, { 0, NULL } }; #define SASP_GLOBAL_PORT 3860 #define SASP_MIN_PACKET_LEN 13 #define SASP_DEREG_REQ_REASON_LEARNED 0x01 #define SASP_DEREG_REQ_NOREASON_FLAG 0x00 #define SASP_HDR_TYPE 0x2010 #define SASP_WED_CONTACT_SUCCESS_FLAG 0x01 #define SASP_WED_QUIESCE_FLAG 0x02 #define SASP_WED_REG_FLAG 0x04 #define SASP_WED_CONF_FLAG 0x08 #define SASP_PUSH_FLAG 0x01 #define SASP_TRUST_FLAG 0x02 #define SASP_NOCHANGE_FLAG 0x04 #define SASP_QUIESCE_FLAG 0x01 static guint get_sasp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* Get the length of the SASP packet. */ return tvb_get_ntohl(tvb, offset + 5); } /* Called from tcp_dissect_pdus with a complete SASP pdu */ static int dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_item *hti; proto_item *mti; proto_tree *sasp_tree; proto_tree *msg_tree; proto_tree *pay_load; guint16 msg_type; guint16 hdr_type; guint32 offset = 0; /*protocol is being displayed*/ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SASP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_sasp, tvb, offset, -1, ENC_NA); sasp_tree = proto_item_add_subtree(ti, ett_sasp_header); hdr_type = tvb_get_ntohs(tvb, offset); hti = proto_tree_add_uint_format_value(sasp_tree, hf_sasp_type, tvb, offset, 2, hdr_type, "%s", (hdr_type == SASP_HDR_TYPE) ? "SASP" : "[Invalid]"); if (hdr_type != SASP_HDR_TYPE) { expert_add_info_format(pinfo, hti, &ei_msg_type_invalid, "Invalid SASP Header Type [0x%04x]", hdr_type); /* XXX: The folowing should actually happen automatically ? */ col_set_str(pinfo->cinfo, COL_INFO, "[Malformed: Invalid SASP Header Type]"); return tvb_reported_length(tvb); } offset += 2; /*length*/ proto_tree_add_item(sasp_tree, hf_sasp_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*Header Version */ proto_tree_add_item(sasp_tree, hf_sasp_vrsn, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*Message*/ msg_tree = proto_item_add_subtree(ti, ett_sasp_msg); /*Message Len*/ proto_tree_add_item(msg_tree, hf_msg_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*Message Id*/ proto_tree_add_item(msg_tree, hf_msg_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*Message Type*/ msg_type = tvb_get_ntohs(tvb, offset); mti = proto_tree_add_item(msg_tree, hf_msg_type, tvb, offset, 2, ENC_BIG_ENDIAN); pay_load = proto_item_add_subtree(ti, ett_sasp_payload); offset += 2; switch(msg_type) { case 0x1010: /* Registration Request */ col_set_str(pinfo->cinfo, COL_INFO, "Registration Request"); dissect_reg_req(tvb, pay_load, offset); break; case 0x1015: /* Registration Reply */ col_set_str(pinfo->cinfo, COL_INFO, "Registration Reply"); dissect_reg_rep(tvb, pay_load, offset); break; case 0x1020: /* Deregistration Request */ col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Request"); dissect_dereg_req(tvb, pinfo, pay_load, offset); break; case 0x1025: /* Deregistration Reply */ col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Reply"); dissect_dereg_rep(tvb, pay_load, offset); break; case 0x1030: /* Get Weights Request */ col_set_str(pinfo->cinfo, COL_INFO, "Get Weights Request"); dissect_wt_req(tvb, pay_load, offset); break; case 0x1035: /* Get Weights Response */ col_set_str(pinfo->cinfo, COL_INFO, "Get Weights Response"); dissect_wt_rep(tvb, pay_load, offset); break; case 0x1040: /* Send Weights Request */ col_set_str(pinfo->cinfo, COL_INFO, "Send Weights Request"); dissect_sendwt(tvb, pay_load, offset); break; case 0x1050: /* Set LB State Request */ col_set_str(pinfo->cinfo, COL_INFO, "Set LB State Request"); dissect_setlbstate_req(tvb, pay_load, offset); break; case 0x1055: /* Set LB state Reply */ col_set_str(pinfo->cinfo, COL_INFO, "Set LB State Reply"); dissect_setlbstate_rep(tvb, pay_load, offset); break; case 0x1060: /* Set Member State Request*/ col_set_str(pinfo->cinfo, COL_INFO, "Set Member State Request"); dissect_setmemstate_req(tvb, pay_load, offset); break; case 0x1065: /* Set Member State Reply */ col_set_str(pinfo->cinfo, COL_INFO, "Set Member State Reply"); dissect_setmemstate_rep(tvb, pay_load, offset); break; default: /* Unknown SASP Message Type */ col_add_fstr(pinfo->cinfo, COL_INFO, "[Malformed: Unknown Message Type [0x%04x]", msg_type); expert_add_info_format(pinfo, mti, &ei_msg_type_invalid, "Unknown SASP Message Type: 0x%4x", msg_type); break; } return tvb_reported_length(tvb); } static int dissect_sasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, sasp_desegment, SASP_MIN_PACKET_LEN, get_sasp_pdu_len, dissect_sasp_pdu, data); return tvb_reported_length(tvb); } static void dissect_reg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *reg_req_data; guint16 gmd_cnt, i; reg_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_reg_req_sz, NULL, "Reg Request"); /* Reg Req Size */ proto_tree_add_item(reg_req_data, hf_sasp_reg_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Reg Req LB Flag */ proto_tree_add_item(reg_req_data, hf_reg_req_lbflag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; gmd_cnt = tvb_get_ntohs(tvb, offset); /* Group MEM Data Count */ proto_tree_add_item(reg_req_data, hf_sasp_gmd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<gmd_cnt; i++) offset = dissect_grp_memdatacomp(tvb, reg_req_data, offset); } static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *reg_rep_tree; reg_rep_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1 , ett_sasp_reg_rep, NULL, "Reg Reply"); /* Size */ proto_tree_add_item(reg_rep_tree, hf_sasp_reg_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Response Code */ proto_tree_add_item(reg_rep_tree, hf_sasp_reg_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pay_load, guint32 offset) { /*proto_item *dereg_req_reason_flag;*/ /*proto_tree *dereg_req_reason_flag_tree;*/ guint16 gmd_cnt, i; proto_tree *dereg_req_data; guint8 reason_flag; static gboolean first_flag = TRUE; wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_create(pinfo->pool); static const gchar *fstr[] = {"No Reason", "Learned & Purposeful" }; dereg_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_dereg_req_sz, NULL, "DeReg Request"); /* Size */ proto_tree_add_item(dereg_req_data, hf_sasp_dereg_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* LB Flag */ proto_tree_add_item(dereg_req_data, hf_dereg_req_lbflag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Reason */ wmem_strbuf_truncate(reasonflags_strbuf, 0); reason_flag = tvb_get_guint8(tvb, offset); if ((reason_flag & SASP_DEREG_REQ_REASON_LEARNED) == 0) wmem_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[0]); else wmem_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[1]); first_flag = FALSE; /*dereg_req_reason_flag =*/ proto_tree_add_uint_format(dereg_req_data, hf_dereg_req_reason_flag, tvb, offset, 1, reason_flag, "Reason: 0x%02x (%s)", reason_flag, wmem_strbuf_get_str(reasonflags_strbuf)); #if 0 /* XXX: ToDo?? Flags to be displayed under a subtree ? */ dereg_req_reason_flag_tree = proto_item_add_subtree(dereg_req_reason_flag, ett_dereg_req_reason_flag); #endif offset += 1; gmd_cnt = tvb_get_ntohs(tvb, offset); /* Group Mem Data Count */ proto_tree_add_item(dereg_req_data, hf_sasp_gmd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*Group Mem Data */ for (i=0; i<gmd_cnt; i++) offset = dissect_grp_memdatacomp(tvb, dereg_req_data, offset); } static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *dereg_rep_tree; dereg_rep_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_dereg_rep, NULL, "Dereg Reply"); /* Size */ proto_tree_add_item(dereg_rep_tree, hf_sasp_dereg_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Return Code */ proto_tree_add_item(dereg_rep_tree, hf_sasp_dereg_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_sendwt(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *sendwt_tree; guint16 gwed_cnt, i; sendwt_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_sendwt, NULL, "Send Weight"); /* Size */ proto_tree_add_item(sendwt_tree, hf_sasp_sendwt_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; gwed_cnt = tvb_get_ntohs(tvb, offset); /* Group Wt Entry Data Count */ proto_tree_add_item(sendwt_tree, hf_sasp_sendwt_gwedcnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<gwed_cnt; i++) offset = dissect_grp_wt_entry_datacomp(tvb, sendwt_tree, offset); } static void dissect_setmemstate_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *setmemstate_req_data; guint16 gmsd_cnt, i; setmemstate_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_setmemstate_req, NULL, "Set Mem State Request"); /* Size */ proto_tree_add_item(setmemstate_req_data, hf_sasp_setmemstate_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*LB Flag*/ proto_tree_add_item(setmemstate_req_data, hf_setmemstate_req_lbflag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*Group Data Count*/ gmsd_cnt = tvb_get_ntohs(tvb, offset); proto_tree_add_item(setmemstate_req_data, hf_sasp_setmemstate_req_gmsd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<gmsd_cnt; i++) offset = dissect_grp_memstatedatacomp(tvb, setmemstate_req_data, offset); } static void dissect_setmemstate_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *setmemstate_rep_tree; setmemstate_rep_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_setmemstate_rep, NULL, "Set Mem State Reply"); /* Size */ proto_tree_add_item(setmemstate_rep_tree, hf_sasp_setmemstate_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Response Code */ proto_tree_add_item(setmemstate_rep_tree, hf_sasp_setmemstate_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN); } static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset, proto_tree **mdct_p) { proto_item *memdatacomp; proto_tree *memdatacomp_tree; guint8 lab_len; const gchar *ip_str; ws_in6_addr ipv6_address; tvb_get_ipv6(tvb, offset+7, &ipv6_address); ip_str = tvb_ip6_to_str(wmem_packet_scope(), tvb, offset+7); lab_len = tvb_get_guint8(tvb, offset+23); memdatacomp = proto_tree_add_ipv6_format(pay_load, hf_sasp_memdatacomp_ip, tvb, offset, 24+lab_len, &ipv6_address, "Member Data Comp (%s)", ip_str); memdatacomp_tree = proto_item_add_subtree(memdatacomp, ett_sasp_memdatacomp); /* Message Type */ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Size */ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Protocol */ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_protocol, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Port */ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*Ip*/ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_ip, tvb, offset, 16, ENC_NA); offset += 16; /*Label Len*/ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_lab_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*Label*/ proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_label, tvb, offset, lab_len, ENC_ASCII); offset += lab_len; if (mdct_p != NULL) *mdct_p = memdatacomp_tree; return offset; } static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *grpdatacomp_tree; guint8 LB_uid_len; guint8 grp_name_len; grpdatacomp_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_grpdatacomp, NULL, "Group Data Component"); /*Type*/ proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*Size*/ proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; LB_uid_len = tvb_get_guint8(tvb, offset); /* LB UID Len*/ proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid, tvb, offset, LB_uid_len, ENC_ASCII); offset += (guint8)LB_uid_len; grp_name_len = tvb_get_guint8(tvb, offset); /*Group Name Len */ proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*Group Name*/ proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name, tvb, offset, grp_name_len, ENC_ASCII); offset += grp_name_len; return offset; } static guint32 dissect_grp_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *grp_memdatacomp_tree; guint16 mem_cnt; guint16 i; grp_memdatacomp_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_grp_memdatacomp, NULL, "Group Of Member Data"); /* Group MEM Data */ proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Group MEM Data Size*/ proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; mem_cnt = tvb_get_ntohs(tvb, offset); /* Group MEM Data Count*/ proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset = dissect_grpdatacomp(tvb, grp_memdatacomp_tree, offset); /* array of memdata */ for (i=0; i<mem_cnt; i++) offset = dissect_memdatacomp(tvb, grp_memdatacomp_tree, offset, NULL); return offset; } static void dissect_wt_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *get_wt_tree; guint16 gd_cnt, i; get_wt_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_getwt, NULL, "Get Wt Req"); /* Size */ proto_tree_add_item(get_wt_tree, hf_sasp_wt_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; gd_cnt = tvb_get_ntohs(tvb, offset); /* Group Data Count */ proto_tree_add_item(get_wt_tree, hf_sasp_wt_req_gd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<gd_cnt; i++) offset = dissect_grpdatacomp(tvb, get_wt_tree, offset); } static void dissect_wt_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *wt_rep_tree; guint16 gwed_cnt, i; wt_rep_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_wt_rep, NULL, "Get Weights Reply"); /* Size */ proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Response Code */ proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Interval */ proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_interval, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; gwed_cnt = tvb_get_ntohs(tvb, offset); /* Count of Group of Wt Entry Data */ proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_gwed_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for (i=0; i<gwed_cnt; i++) offset = dissect_grp_wt_entry_datacomp(tvb, wt_rep_tree, offset); } static void dissect_setlbstate_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { guint8 LB_uid_len; static int * const lbflags[] = { &hf_sasp_pushflag, &hf_sasp_trustflag, &hf_sasp_nochangeflag, NULL }; proto_tree *setlbstate_req_tree; setlbstate_req_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_setlbstate_req, NULL, "Set LB State Req"); /* Size*/ proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; LB_uid_len = tvb_get_guint8(tvb, offset); /* LB UID Len */ proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*LB UID*/ proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid, tvb, offset, LB_uid_len, ENC_ASCII); offset += (guint8)LB_uid_len; /*LB Health*/ proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_health, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask_text(setlbstate_req_tree, tvb, offset, 1, "LB Flags:", NULL, ett_setlbstate_req_lbflag, lbflags, ENC_BIG_ENDIAN, 0); } static void dissect_setlbstate_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *setlbstate_rep_tree; setlbstate_rep_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_setlbstate_rep, NULL, "Set LB State Rep"); /* Size */ proto_tree_add_item(setlbstate_rep_tree, hf_sasp_setlbstate_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Response Code */ proto_tree_add_item(setlbstate_rep_tree, hf_sasp_setlbstate_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN); } static guint32 dissect_grp_memstatedatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *grp_memstatedatacomp_tree; guint16 mem_cnt; guint16 i; grp_memstatedatacomp_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_grp_memstatedatacomp, NULL, "Group Mem State Comp"); /* Type */ proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Size */ proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; mem_cnt = tvb_get_ntohs(tvb, offset); /* Count */ proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Group Data TLV */ offset = dissect_grpdatacomp(tvb, grp_memstatedatacomp_tree, offset); /* Array of Mem State Data */ for (i=0; i<mem_cnt; i++) offset = dissect_memstatedatacomp(tvb, grp_memstatedatacomp_tree, offset); return offset; } static guint32 dissect_memstatedatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *memstatedatacomp_tree; proto_tree *memdatacomp_tree; offset = dissect_memdatacomp(tvb, pay_load, offset, &memdatacomp_tree); memstatedatacomp_tree = proto_tree_add_subtree(memdatacomp_tree, tvb, offset, -1, ett_sasp_memstatedatacomp, NULL, "Member State Data"); /* Type */ proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_instance, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Size */ proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* State */ proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_state, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Quiesce flag*/ proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_quiesce_flag, tvb, offset, 1, ENC_NA); offset += 1; return offset; } static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *weight_entry_data_comp_tree; static int * const wtflags[] = { &hf_sasp_wed_contactsuccess_flag, &hf_sasp_wed_quiesce_flag, &hf_sasp_wed_registration_flag, &hf_sasp_wed_confident_flag, NULL }; offset = dissect_memdatacomp(tvb, pay_load, offset, NULL); weight_entry_data_comp_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_weight_entry_data_comp, NULL, "Weight Entry Data"); /* Type */ proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Size */ proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_state, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask_text(weight_entry_data_comp_tree, tvb, offset, 1, "Flags:", NULL, ett_wt_entry_data_flag, wtflags, ENC_BIG_ENDIAN, 0); offset += 1; /* Weight */ proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_weight, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) { proto_tree *grp_wt_entry_datacomp_tree; guint16 wt_entry_cnt; guint16 i; grp_wt_entry_datacomp_tree = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_grp_wt_entry_datacomp, NULL, "Group of Wt Entry Data"); /* Type */ proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Size */ proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; wt_entry_cnt = tvb_get_ntohs(tvb, offset); /* Wt Entry Count*/ proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_cnt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Group Data */ offset = dissect_grpdatacomp(tvb, grp_wt_entry_datacomp_tree, offset); /* Member Data */ for (i=0; i<wt_entry_cnt; i++) offset = dissect_weight_entry_data_comp(tvb, grp_wt_entry_datacomp_tree, offset); return offset; } /* sasp protocol register */ void proto_register_sasp(void) { static hf_register_info hf[] = { /*SASP Header */ { &hf_sasp_type, { "Type", "sasp.msg.type", FT_UINT16, BASE_HEX, NULL, 0x0, "SASP Header", HFILL } }, { &hf_sasp_length, { "Length", "sasp.header.Len", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Header Length", HFILL } }, { &hf_sasp_vrsn, { "Version", "sasp.version", FT_UINT8, BASE_DEC, NULL, 0x0, "SASP Version", HFILL } }, { &hf_msg_len, { "Message Len", "sasp.msg.len", FT_UINT32, BASE_DEC, NULL, 0x0, "SASP Msg Len", HFILL } }, { &hf_msg_id, { "Message Id", "sasp.msg.id", FT_UINT32, BASE_DEC, NULL, 0x0, "SASP Msg Id", HFILL } }, /*Message Type*/ { &hf_msg_type, { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Msg Type", HFILL } }, /*Reg Request*/ { &hf_sasp_reg_req_sz, { "Reg Req-Size", "sasp.reg-req.size", FT_UINT32, BASE_DEC, NULL, 0x0, "SASP Reg Req Size", HFILL } }, { &hf_reg_req_lbflag, { "Reg Req-LB Flag", "sasp.reg-req.lbflag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "SASP Reg Req LB Flag", HFILL } }, { &hf_sasp_gmd_cnt, { "Grp Mem Data-Count", "sasp.grp-mem-data.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Mem Data Count", HFILL } }, /* Reg Reply */ { &hf_sasp_reg_rep_sz, { "Reg Reply-Size", "sasp.reg-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Reg Reply size", HFILL } }, { &hf_sasp_reg_rep_rcode, { "Reg Reply-Return Code", "sasp.reg-rep.retcode", FT_UINT8, BASE_HEX, VALS(reg_reply_response_code), 0x0, "SASP Reg Rep Return Code", HFILL } }, /* Dereg Req */ { &hf_sasp_dereg_req_sz, { "Dereg Req-Size", "sasp.dereg-req.size", FT_UINT32, BASE_DEC, NULL, 0x0, "SASP Dereg Req Size", HFILL } }, { &hf_dereg_req_lbflag, { "Dereg Req-LB Flag", "sasp.dereg-req.lbflag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "SASP Dereg Req LB Flag", HFILL } }, { &hf_dereg_req_reason_flag, { "Reason Flags", "sasp.flags.reason", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_dereg_req_reason, { "Dereg Req-Reason", "sasp.dereg-req.reason", FT_UINT8, BASE_HEX, NULL, 0x0, "SASP Dereg Req Reason", HFILL } }, #endif /* Dereg Rep */ { &hf_sasp_dereg_rep_sz, { "Dereg Rep-Size", "sasp.dereg-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Dereg Rep Size", HFILL } }, { &hf_sasp_dereg_rep_rcode, { "Dereg Rep-Return Code", "sasp.dereg-rep.retcode", FT_UINT8, BASE_HEX, VALS(dereg_reply_response_code), 0x0, "SASP Dereg Rep Return Code", HFILL } }, /* Send weight */ { &hf_sasp_sendwt_sz, { "Sendwt-Size", "sasp.sendwt.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Sendwt-Size", HFILL } }, { &hf_sasp_sendwt_gwedcnt, { "Sendwt-Grp Wt EntryData Count", "sasp.sendwt-grp-wtentrydata.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Sendwt Grp Wt Entry Data Count", HFILL } }, /*Set Mem State Req*/ { &hf_sasp_setmemstate_req_sz, { "Set Memstate Req-Size", "sasp.setmemstate-req.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Set Memstate Req Size", HFILL } }, { &hf_setmemstate_req_lbflag, { "Set Memstate Req-LB Flag", "sasp.setmemstate-req.lbflag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "SASP Set Memstate Req LB Flag", HFILL } }, { &hf_sasp_setmemstate_req_gmsd_cnt, { "Set Memstate Req-Gmsd Count", "sasp.group-memstate.count", FT_UINT16, BASE_DEC, NULL, 0x0, "Group Of Member State Data Count", HFILL } }, /* Set Mem State Reply */ #if 0 { &hf_sasp_setmemstate_rep, { "Set Memstate Reply", "sasp.setmemstate-rep", FT_UINT32, BASE_HEX, NULL, 0x0, "SASP Set Memstate Reply", HFILL } }, #endif { &hf_sasp_setmemstate_rep_sz, { "Set Memstate Rep-Size", "sasp.setmemstate-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Set Memstate Rep Size", HFILL } }, { &hf_sasp_setmemstate_rep_rcode, { "Set Memstate Rep-Return Code", "sasp.setmemstate-rep.retcode", FT_UINT8, BASE_HEX, VALS(set_mem_state_reply_response_code), 0x0, "SASP Set Memstate Rep Return Code", HFILL } }, /*Mem Data Component*/ { &hf_sasp_memdatacomp_type, { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Mem Data Comp", HFILL } }, { &hf_sasp_memdatacomp_sz, { "Mem Data Comp-Size", "sasp.memdatacomp.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Mem Data Comp Size", HFILL } }, { &hf_sasp_memdatacomp_protocol, { "Mem Data Comp-Protocol", "sasp.memdatacomp.protocol", FT_UINT8, BASE_HEX, VALS(protocol_table), 0x0, "SASP Mem Data Comp Protocol", HFILL } }, { &hf_sasp_memdatacomp_port, { "Mem Data Comp-Port", "sasp.memdatacomp.port", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Mem Data Comp Port", HFILL } }, { &hf_sasp_memdatacomp_ip, { "Mem Data Comp-Ip", "sasp.memdatacomp.ip", FT_IPv6, BASE_NONE, NULL, 0x0, "SASP Mem Data Comp Ip", HFILL } }, { &hf_sasp_memdatacomp_lab_len, { "Mem Data Comp-Label Len", "sasp.memdatacomp.label.len", FT_UINT8, BASE_DEC, NULL, 0x0, "SASP Mem Data Comp Label Length", HFILL } }, { &hf_sasp_memdatacomp_label, { "Mem Data Comp-Label", "sasp.memdatacomp.label", FT_STRING, BASE_NONE, NULL, 0x0, "SASP Mem Data Comp Label", HFILL } }, /*Get Weight Request*/ { &hf_sasp_wt_req_sz, { "Get Wt Req-Size", "sasp.getwt.req.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Get Wt Req Size", HFILL } }, { &hf_sasp_wt_req_gd_cnt, { "Get Wt Req-Grp Data Count", "sasp.getwt-req-grpdata.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Get Wt Grp Data Count", HFILL } }, /*Get Weight Reply*/ { &hf_sasp_wt_rep_sz, { "Get Wt Rep-Size", "sasp.getwt.rep.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Get Wt Rep Size", HFILL } }, { &hf_sasp_wt_rep_rcode, { "Get Wt Rep-Return Code", "sasp.getwt-rep.retcode", FT_UINT8, BASE_HEX, VALS(get_weights_reply_response_code), 0x0, "SASP Get Wt Rep Return Code", HFILL } }, { &hf_sasp_wt_rep_interval, { "Get Wt Rep-Interval", "sasp.getwt-rep.interval", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Get Wt Rep Interval", HFILL } }, { &hf_sasp_wt_rep_gwed_cnt, { "Get Wt Rep-Grp WtEntry Data Cnt", "sasp.getwt-rep-grpwtentrydata.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Get Wt Rep Grp Wt Entry Data Cnt", HFILL } }, /*Set LB State Rep */ #if 0 { &hf_sasp_setlbstate_rep, { "Set Lbstate Rep", "sasp.msg.type", FT_UINT32, BASE_HEX, NULL, 0x0, "SASP Set Lbstate Rep", HFILL } }, #endif { &hf_sasp_setlbstate_rep_sz, { "Set Lbstate Rep-Size", "sasp.setlbstate-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Set Lbstate Rep Size", HFILL } }, { &hf_sasp_setlbstate_rep_rcode, { "Set Lbstate Rep-Return Code", "sasp.setlbstate-rep.retcode", FT_UINT8, BASE_HEX, VALS(set_lb_state_reply_response_code), 0x0, "SASP Set Lbstate Rep Return Code", HFILL } }, /*grp data comp */ { &hf_sasp_grpdatacomp, { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Grp Data Comp", HFILL } }, { &hf_sasp_grpdatacomp_sz, { "Grp Data Comp-Size", "sasp.grpdatacomp.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Data Comp size", HFILL } }, { &hf_sasp_grpdatacomp_LB_uid_len, { "Grp Data Comp-Label UID Len", "sasp.grpdatacomp.label.uid.len", FT_UINT8, BASE_DEC, NULL, 0x0, "SASP Grp Data Comp Label Uid Len", HFILL } }, { &hf_sasp_grpdatacomp_LB_uid, { "Grp Data Comp-Label UID", "sasp.grpdatacomp.label.uid", FT_STRING, BASE_NONE, NULL, 0x0, "SASP Grp Data Comp Label Uid", HFILL } }, { &hf_sasp_grpdatacomp_grp_name_len, { "Grp Data Comp-Grp Name Len", "sasp.grpdatacomp.grpname.len", FT_UINT8, BASE_DEC, NULL, 0x0, "SASP Grp Data Comp Grp Name Len", HFILL } }, { &hf_sasp_grpdatacomp_grp_name, { "Grp Data Comp-Grp Name", "sasp.grpdatacomp.grpname", FT_STRING, BASE_NONE, NULL, 0x0, "SASP Grp Data Comp Grp Name", HFILL } }, /*grp mem data comp */ { &hf_sasp_grp_memdatacomp, { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Grp Mem Data Comp", HFILL } }, { &hf_sasp_grp_memdatacomp_sz, { "Grp Mem Data Comp-Size", "sasp.grp-memdatacomp.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Mem Data Comp Size", HFILL } }, { &hf_sasp_grp_memdatacomp_cnt, { "Grp Mem Data Comp-Count", "sasp.grp.memdatacomp.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Mem Data Comp Cnt", HFILL } }, /*set LB state req*/ { &hf_sasp_setlbstate_req_sz, { "Set LB State Req-Size", "sasp.setlbstate-req.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Set LB State Req Size", HFILL } }, { &hf_sasp_setlbstate_req_LB_uid_len, { "Set LB State Req-LB UID Len", "sasp.setlbstate-req.lbuid.len", FT_UINT8, BASE_DEC, NULL, 0x0, "SASP Set LB State Req LB Uid Len", HFILL } }, { &hf_sasp_setlbstate_req_LB_uid, { "Set LB State Req-LB UID", "sasp.setlbstate-req.lbuid", FT_STRING, BASE_NONE, NULL, 0x0, "SASP Set LB State Req LB UID", HFILL } }, { &hf_sasp_setlbstate_req_LB_health, { "Set LB State Req-LB Health", "sasp.setlbstate-req.lbhealth", FT_UINT8, BASE_HEX, VALS(lbstate_healthtable), 0x0, "SASP Set LB State Req LB Health", HFILL } }, #if 0 { &hf_lbstate_flag, { "Flags", "sasp.flags.lbstate", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif { &hf_sasp_pushflag, { "PUSH", "sasp.flags.push", FT_BOOLEAN, 8, NULL, SASP_PUSH_FLAG, "SASP Push Flag", HFILL } }, { &hf_sasp_trustflag, { "TRUST", "sasp.flags.trust", FT_BOOLEAN, 8, NULL, SASP_TRUST_FLAG, "SASP Trust Flag", HFILL } }, { &hf_sasp_nochangeflag, { "NOCHANGE", "sasp.flags.nochange", FT_BOOLEAN, 8, NULL, SASP_NOCHANGE_FLAG, "SASP Nochange Flag", HFILL } }, /*grp mem state data comp */ { &hf_sasp_grp_memstatedatacomp, { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Message Type", HFILL } }, { &hf_sasp_grp_memstatedatacomp_sz, { "Grp Mem State-Size", "sasp.grp.memstate.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Mem State Data Comp Size", HFILL } }, { &hf_sasp_grp_memstatedatacomp_cnt, { "Grp Mem State-Count", "sasp.grp.memstate.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Mem State Data Comp Count", HFILL } }, /*mem state instance */ { &hf_sasp_memstatedatacomp_instance, { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Message Type", HFILL } }, { &hf_sasp_memstatedatacomp_sz, { "Mem State-Size", "sasp.memstate.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Mem State Data Comp Size", HFILL } }, { &hf_sasp_memstatedatacomp_state, { "Mem State-State", "sasp.memstate.state", FT_UINT8, BASE_HEX, NULL, 0x0, "SASP Mem State Data Comp State", HFILL } }, { &hf_sasp_memstatedatacomp_quiesce_flag, { "Mem State-Quiesce Flag", "sasp.flags.quiesce", FT_BOOLEAN, 8, NULL, SASP_QUIESCE_FLAG, "SASP Quiesce Flag", HFILL } }, /*weight entry data comp*/ { &hf_sasp_weight_entry_data_comp_type, { "Wt Entry Data Comp", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Wt Entry Data Comp", HFILL } }, { &hf_sasp_weight_entry_data_comp_sz, { "Wt Entry Data Comp-Size", "sasp.wtentry.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Wt Entry Data Comp Size", HFILL } }, { &hf_sasp_weight_entry_data_comp_state, { "Wt Entry Data Comp-state", "sasp.wtentry.state", FT_UINT8, BASE_HEX, NULL, 0x0, "SASP Wt Entry Data Comp State", HFILL } }, #if 0 { &hf_wtstate_flag, { "Flags", "sasp.flags.wtstate", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif { &hf_sasp_wed_contactsuccess_flag, { "Contact Success", "sasp.flags.contactsuccess", FT_BOOLEAN, 8, NULL, SASP_WED_CONTACT_SUCCESS_FLAG, "SASP Contact Success Flag", HFILL } }, { &hf_sasp_wed_quiesce_flag, { "Quiesce", "sasp.flags.quiesce", FT_BOOLEAN, 8, NULL, SASP_WED_QUIESCE_FLAG, "SASP Quiesce Flag", HFILL } }, { &hf_sasp_wed_registration_flag, { "Registration", "sasp.flags.registration", FT_BOOLEAN, 8, NULL, SASP_WED_REG_FLAG, "SASP Registration Flag", HFILL } }, { &hf_sasp_wed_confident_flag, { "Confident", "sasp.flags.confident", FT_BOOLEAN, 8, NULL, SASP_WED_CONF_FLAG, "SASP Confident Flag", HFILL } }, { &hf_sasp_weight_entry_data_comp_weight, { "Wt Entry Data Comp-weight", "sasp.wtentrydatacomp.weight", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Wt Entry Data Comp weight", HFILL } }, /*grp wt entry data comp */ { &hf_sasp_grp_wt_entry_datacomp_type, { "Grp Wt Entry Data Comp", "sasp.msg.type", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Grp Wt Entry Data Comp", HFILL } }, { &hf_sasp_grp_wt_entry_datacomp_sz, { "Grp Wt Entry Data Comp Size", "sasp.grp-wtentrydata.size", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Wt Entry Data Comp Size", HFILL } }, { &hf_sasp_grp_wt_entry_datacomp_cnt, { "Grp Wt Entry Data Comp Cnt", "sasp.grp-wtentrydata.count", FT_UINT16, BASE_DEC, NULL, 0x0, "SASP Grp Wt Entry Data Comp Cnt", HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sasp_data, &ett_sasp_header, &ett_sasp_msg, &ett_sasp_payload, &ett_sasp_reg_req, &ett_sasp_reg_rep, &ett_sasp_reg_req_sz, &ett_sasp_dereg_req_sz, &ett_sasp_dereg_rep, &ett_sasp_sendwt, &ett_sasp_setmemstate_req, &ett_sasp_setmemstate_rep, &ett_sasp_memdatacomp, &ett_sasp_grpdatacomp, &ett_sasp_grp_memdatacomp, &ett_sasp_setlbstate_req, &ett_sasp_setlbstate_rep, &ett_sasp_getwt, &ett_setlbstate_req_lbflag, &ett_sasp_grp_memstatedatacomp, &ett_sasp_memstatedatacomp, /* &ett_dereg_req_reason_flag, */ &ett_sasp_grp_wt_entry_datacomp, &ett_sasp_weight_entry_data_comp, &ett_wt_entry_data_flag, &ett_sasp_wt_rep }; static ei_register_info ei[] = { { &ei_msg_type_invalid, { "sasp.msg.type.invalid", PI_PROTOCOL, PI_WARN, "Invalid Type", EXPFILL }} }; module_t *sasp_module; expert_module_t* expert_sasp; proto_sasp = proto_register_protocol("Server/Application State Protocol", "SASP", "sasp"); sasp_handle = register_dissector("sasp", dissect_sasp, proto_sasp); proto_register_field_array(proto_sasp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sasp = expert_register_protocol(proto_sasp); expert_register_field_array(expert_sasp, ei, array_length(ei)); sasp_module = prefs_register_protocol(proto_sasp, NULL); prefs_register_bool_preference(sasp_module, "desegment_sasp_messages", "Reassemble SASP messages spanning multiple TCP segments", "Whether the SASP dissector should reassemble messages" " spanning multiple TCP segments." " To use this option, you must also enable" " \"Allow subdissectors to reassemble TCP streams\"" " in the TCP protocol settings.", &sasp_desegment); } /* Handing off to TCP */ void proto_reg_handoff_sasp(void) { dissector_add_uint_with_preference("tcp.port", SASP_GLOBAL_PORT, sasp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sbas_l1.c
/* packet-sbas_l1.c * SBAS L1 protocol dissection. * * By Timo Warns <[email protected]> * Copyright 2023 Timo Warns * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/expert.h> #include <epan/packet.h> #include "packet-ubx.h" /* * Dissects navigation messages of the Satellite Based Augmentation System * (SBAS) sent on L1 frequency as defined by ICAO Annex 10, Vol I. */ // SBAS L1 preamble values #define SBAS_L1_PREAMBLE_1 0x53 #define SBAS_L1_PREAMBLE_2 0x9a #define SBAS_L1_PREAMBLE_3 0xc6 // UDREI_i mapping // see ICAO Annex 10, Vol I, Table B-29 static const value_string UDREI_EVALUATION[] = { {0, "0.0520 m^2"}, {1, "0.0924 m^2"}, {2, "0.1444 m^2"}, {3, "0.2830 m^2"}, {4, "0.4678 m^2"}, {5, "0.8313 m^2"}, {6, "1.2992 m^2"}, {7, "1.8709 m^2"}, {8, "2.5465 m^2"}, {9, "3.3260 m^2"}, {10, "5.1968 m^2"}, {11, "20.7870 m^2"}, {12, "230.9661 m^2"}, {13, "2078.695 m^2"}, {14, "Not Monitored"}, {15, "Do Not Use"}, {0, NULL} }; // Mapping for fast correction degradation factor // see ICAO Annex 10, Vol I, Table B-34 static const value_string DEGRADATION_FACTOR_INDICATOR[] = { {0, "0.0 mm/s^2"}, {1, "0.05 mm/s^2"}, {2, "0.09 mm/s^2"}, {3, "0.12 mm/s^2"}, {4, "0.15 mm/s^2"}, {5, "0.20 mm/s^2"}, {6, "0.30 mm/s^2"}, {7, "0.45 mm/s^2"}, {8, "0.60 mm/s^2"}, {9, "0.90 mm/s^2"}, {10, "1.50 mm/s^2"}, {11, "2.10 mm/s^2"}, {12, "2.70 mm/s^2"}, {13, "3.30 mm/s^2"}, {14, "4.60 mm/s^2"}, {15, "5.80 mm/s^2"}, {0, NULL} }; // table for SBAS L1 CRC24Q computation static const guint32 CRC24Q_TBL[] = { 0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17, 0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E, 0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E, 0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C, 0xFBB0A7, 0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205, 0x93AEFE, 0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C, 0x322FC7, 0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C, 0x56E077, 0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5, 0xF7614E, 0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E, 0x86DCC5, 0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107, 0x275DFC, 0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7, 0x43924C, 0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E, 0xE21375, 0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7, 0x8A0D2C, 0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE, 0x2B8C15, 0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E, 0x4F43A5, 0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67, 0xEEC29C, 0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448, 0xAC38B3, 0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571, 0x0DB98A, 0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1, 0x69763A, 0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8, 0xC8F703, 0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1, 0xA0E95A, 0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498, 0x016863, 0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28, 0x65A7D3, 0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11, 0xC426EA, 0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A, 0xB59B61, 0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3, 0x141A58, 0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913, 0x70D5E8, 0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A, 0xD154D1, 0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673, 0xB94A88, 0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A, 0x18CBB1, 0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA, 0x7C0401, 0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538 }; /* Initialize the protocol and registered fields */ static int proto_sbas_l1 = -1; // see ICAO Annex 10, Vol I, Appendix B, Section 3.5.3 static int hf_sbas_l1_preamble = -1; static int hf_sbas_l1_mt = -1; static int hf_sbas_l1_chksum = -1; // see ICAO Annex 10, Vol I, Table B-38 static int hf_sbas_l1_mt1 = -1; static int hf_sbas_l1_mt1_prn_mask_gps = -1; static int hf_sbas_l1_mt1_prn_mask_glonass = -1; static int hf_sbas_l1_mt1_prn_mask_spare_1 = -1; static int hf_sbas_l1_mt1_prn_mask_sbas = -1; static int hf_sbas_l1_mt1_prn_mask_spare_2 = -1; static int hf_sbas_l1_mt1_iodp = -1; // see ICAO Annex 10, Vol I, Table B-39 static int hf_sbas_l1_mt2 = -1; static int hf_sbas_l1_mt2_iodf_j = -1; static int hf_sbas_l1_mt2_iodp = -1; static int hf_sbas_l1_mt2_fc_1 = -1; static int hf_sbas_l1_mt2_fc_2 = -1; static int hf_sbas_l1_mt2_fc_3 = -1; static int hf_sbas_l1_mt2_fc_4 = -1; static int hf_sbas_l1_mt2_fc_5 = -1; static int hf_sbas_l1_mt2_fc_6 = -1; static int hf_sbas_l1_mt2_fc_7 = -1; static int hf_sbas_l1_mt2_fc_8 = -1; static int hf_sbas_l1_mt2_fc_9 = -1; static int hf_sbas_l1_mt2_fc_10 = -1; static int hf_sbas_l1_mt2_fc_11 = -1; static int hf_sbas_l1_mt2_fc_12 = -1; static int hf_sbas_l1_mt2_fc_13 = -1; static int hf_sbas_l1_mt2_udrei_1 = -1; static int hf_sbas_l1_mt2_udrei_2 = -1; static int hf_sbas_l1_mt2_udrei_3 = -1; static int hf_sbas_l1_mt2_udrei_4 = -1; static int hf_sbas_l1_mt2_udrei_5 = -1; static int hf_sbas_l1_mt2_udrei_6 = -1; static int hf_sbas_l1_mt2_udrei_7 = -1; static int hf_sbas_l1_mt2_udrei_8 = -1; static int hf_sbas_l1_mt2_udrei_9 = -1; static int hf_sbas_l1_mt2_udrei_10 = -1; static int hf_sbas_l1_mt2_udrei_11 = -1; static int hf_sbas_l1_mt2_udrei_12 = -1; static int hf_sbas_l1_mt2_udrei_13 = -1; // see ICAO Annex 10, Vol I, Table B-39 static int hf_sbas_l1_mt3 = -1; static int hf_sbas_l1_mt3_iodf_j = -1; static int hf_sbas_l1_mt3_iodp = -1; static int hf_sbas_l1_mt3_fc_14 = -1; static int hf_sbas_l1_mt3_fc_15 = -1; static int hf_sbas_l1_mt3_fc_16 = -1; static int hf_sbas_l1_mt3_fc_17 = -1; static int hf_sbas_l1_mt3_fc_18 = -1; static int hf_sbas_l1_mt3_fc_19 = -1; static int hf_sbas_l1_mt3_fc_20 = -1; static int hf_sbas_l1_mt3_fc_21 = -1; static int hf_sbas_l1_mt3_fc_22 = -1; static int hf_sbas_l1_mt3_fc_23 = -1; static int hf_sbas_l1_mt3_fc_24 = -1; static int hf_sbas_l1_mt3_fc_25 = -1; static int hf_sbas_l1_mt3_fc_26 = -1; static int hf_sbas_l1_mt3_udrei_14 = -1; static int hf_sbas_l1_mt3_udrei_15 = -1; static int hf_sbas_l1_mt3_udrei_16 = -1; static int hf_sbas_l1_mt3_udrei_17 = -1; static int hf_sbas_l1_mt3_udrei_18 = -1; static int hf_sbas_l1_mt3_udrei_19 = -1; static int hf_sbas_l1_mt3_udrei_20 = -1; static int hf_sbas_l1_mt3_udrei_21 = -1; static int hf_sbas_l1_mt3_udrei_22 = -1; static int hf_sbas_l1_mt3_udrei_23 = -1; static int hf_sbas_l1_mt3_udrei_24 = -1; static int hf_sbas_l1_mt3_udrei_25 = -1; static int hf_sbas_l1_mt3_udrei_26 = -1; // see ICAO Annex 10, Vol I, Table B-39 static int hf_sbas_l1_mt4 = -1; static int hf_sbas_l1_mt4_iodf_j = -1; static int hf_sbas_l1_mt4_iodp = -1; static int hf_sbas_l1_mt4_fc_27 = -1; static int hf_sbas_l1_mt4_fc_28 = -1; static int hf_sbas_l1_mt4_fc_29 = -1; static int hf_sbas_l1_mt4_fc_30 = -1; static int hf_sbas_l1_mt4_fc_31 = -1; static int hf_sbas_l1_mt4_fc_32 = -1; static int hf_sbas_l1_mt4_fc_33 = -1; static int hf_sbas_l1_mt4_fc_34 = -1; static int hf_sbas_l1_mt4_fc_35 = -1; static int hf_sbas_l1_mt4_fc_36 = -1; static int hf_sbas_l1_mt4_fc_37 = -1; static int hf_sbas_l1_mt4_fc_38 = -1; static int hf_sbas_l1_mt4_fc_39 = -1; static int hf_sbas_l1_mt4_udrei_27 = -1; static int hf_sbas_l1_mt4_udrei_28 = -1; static int hf_sbas_l1_mt4_udrei_29 = -1; static int hf_sbas_l1_mt4_udrei_30 = -1; static int hf_sbas_l1_mt4_udrei_31 = -1; static int hf_sbas_l1_mt4_udrei_32 = -1; static int hf_sbas_l1_mt4_udrei_33 = -1; static int hf_sbas_l1_mt4_udrei_34 = -1; static int hf_sbas_l1_mt4_udrei_35 = -1; static int hf_sbas_l1_mt4_udrei_36 = -1; static int hf_sbas_l1_mt4_udrei_37 = -1; static int hf_sbas_l1_mt4_udrei_38 = -1; static int hf_sbas_l1_mt4_udrei_39 = -1; // see ICAO Annex 10, Vol I, Table B-39 static int hf_sbas_l1_mt5 = -1; static int hf_sbas_l1_mt5_iodf_j = -1; static int hf_sbas_l1_mt5_iodp = -1; static int hf_sbas_l1_mt5_fc_40 = -1; static int hf_sbas_l1_mt5_fc_41 = -1; static int hf_sbas_l1_mt5_fc_42 = -1; static int hf_sbas_l1_mt5_fc_43 = -1; static int hf_sbas_l1_mt5_fc_44 = -1; static int hf_sbas_l1_mt5_fc_45 = -1; static int hf_sbas_l1_mt5_fc_46 = -1; static int hf_sbas_l1_mt5_fc_47 = -1; static int hf_sbas_l1_mt5_fc_48 = -1; static int hf_sbas_l1_mt5_fc_49 = -1; static int hf_sbas_l1_mt5_fc_50 = -1; static int hf_sbas_l1_mt5_fc_51 = -1; static int hf_sbas_l1_mt5_fc_52 = -1; static int hf_sbas_l1_mt5_udrei_40 = -1; static int hf_sbas_l1_mt5_udrei_41 = -1; static int hf_sbas_l1_mt5_udrei_42 = -1; static int hf_sbas_l1_mt5_udrei_43 = -1; static int hf_sbas_l1_mt5_udrei_44 = -1; static int hf_sbas_l1_mt5_udrei_45 = -1; static int hf_sbas_l1_mt5_udrei_46 = -1; static int hf_sbas_l1_mt5_udrei_47 = -1; static int hf_sbas_l1_mt5_udrei_48 = -1; static int hf_sbas_l1_mt5_udrei_49 = -1; static int hf_sbas_l1_mt5_udrei_50 = -1; static int hf_sbas_l1_mt5_udrei_51 = -1; static int hf_sbas_l1_mt5_udrei_52 = -1; // see ICAO Annex 10, Vol I, Table B-40 static int hf_sbas_l1_mt6 = -1; static int hf_sbas_l1_mt6_iodf_2 = -1; static int hf_sbas_l1_mt6_iodf_3 = -1; static int hf_sbas_l1_mt6_iodf_4 = -1; static int hf_sbas_l1_mt6_iodf_5 = -1; static int hf_sbas_l1_mt6_udrei_1 = -1; static int hf_sbas_l1_mt6_udrei_2 = -1; static int hf_sbas_l1_mt6_udrei_3 = -1; static int hf_sbas_l1_mt6_udrei_4 = -1; static int hf_sbas_l1_mt6_udrei_5 = -1; static int hf_sbas_l1_mt6_udrei_6 = -1; static int hf_sbas_l1_mt6_udrei_7 = -1; static int hf_sbas_l1_mt6_udrei_8 = -1; static int hf_sbas_l1_mt6_udrei_9 = -1; static int hf_sbas_l1_mt6_udrei_10 = -1; static int hf_sbas_l1_mt6_udrei_11 = -1; static int hf_sbas_l1_mt6_udrei_12 = -1; static int hf_sbas_l1_mt6_udrei_13 = -1; static int hf_sbas_l1_mt6_udrei_14 = -1; static int hf_sbas_l1_mt6_udrei_15 = -1; static int hf_sbas_l1_mt6_udrei_16 = -1; static int hf_sbas_l1_mt6_udrei_17 = -1; static int hf_sbas_l1_mt6_udrei_18 = -1; static int hf_sbas_l1_mt6_udrei_19 = -1; static int hf_sbas_l1_mt6_udrei_20 = -1; static int hf_sbas_l1_mt6_udrei_21 = -1; static int hf_sbas_l1_mt6_udrei_22 = -1; static int hf_sbas_l1_mt6_udrei_23 = -1; static int hf_sbas_l1_mt6_udrei_24 = -1; static int hf_sbas_l1_mt6_udrei_25 = -1; static int hf_sbas_l1_mt6_udrei_26 = -1; static int hf_sbas_l1_mt6_udrei_27 = -1; static int hf_sbas_l1_mt6_udrei_28 = -1; static int hf_sbas_l1_mt6_udrei_29 = -1; static int hf_sbas_l1_mt6_udrei_30 = -1; static int hf_sbas_l1_mt6_udrei_31 = -1; static int hf_sbas_l1_mt6_udrei_32 = -1; static int hf_sbas_l1_mt6_udrei_33 = -1; static int hf_sbas_l1_mt6_udrei_34 = -1; static int hf_sbas_l1_mt6_udrei_35 = -1; static int hf_sbas_l1_mt6_udrei_36 = -1; static int hf_sbas_l1_mt6_udrei_37 = -1; static int hf_sbas_l1_mt6_udrei_38 = -1; static int hf_sbas_l1_mt6_udrei_39 = -1; static int hf_sbas_l1_mt6_udrei_40 = -1; static int hf_sbas_l1_mt6_udrei_41 = -1; static int hf_sbas_l1_mt6_udrei_42 = -1; static int hf_sbas_l1_mt6_udrei_43 = -1; static int hf_sbas_l1_mt6_udrei_44 = -1; static int hf_sbas_l1_mt6_udrei_45 = -1; static int hf_sbas_l1_mt6_udrei_46 = -1; static int hf_sbas_l1_mt6_udrei_47 = -1; static int hf_sbas_l1_mt6_udrei_48 = -1; static int hf_sbas_l1_mt6_udrei_49 = -1; static int hf_sbas_l1_mt6_udrei_50 = -1; static int hf_sbas_l1_mt6_udrei_51 = -1; // see ICAO Annex 10, Vol I, Table B-41 static int hf_sbas_l1_mt7 = -1; static int hf_sbas_l1_mt7_t_lat = -1; static int hf_sbas_l1_mt7_iodp = -1; static int hf_sbas_l1_mt7_spare = -1; static int hf_sbas_l1_mt7_ai_1 = -1; static int hf_sbas_l1_mt7_ai_2 = -1; static int hf_sbas_l1_mt7_ai_3 = -1; static int hf_sbas_l1_mt7_ai_4 = -1; static int hf_sbas_l1_mt7_ai_5 = -1; static int hf_sbas_l1_mt7_ai_6 = -1; static int hf_sbas_l1_mt7_ai_7 = -1; static int hf_sbas_l1_mt7_ai_8 = -1; static int hf_sbas_l1_mt7_ai_9 = -1; static int hf_sbas_l1_mt7_ai_10 = -1; static int hf_sbas_l1_mt7_ai_11 = -1; static int hf_sbas_l1_mt7_ai_12 = -1; static int hf_sbas_l1_mt7_ai_13 = -1; static int hf_sbas_l1_mt7_ai_14 = -1; static int hf_sbas_l1_mt7_ai_15 = -1; static int hf_sbas_l1_mt7_ai_16 = -1; static int hf_sbas_l1_mt7_ai_17 = -1; static int hf_sbas_l1_mt7_ai_18 = -1; static int hf_sbas_l1_mt7_ai_19 = -1; static int hf_sbas_l1_mt7_ai_20 = -1; static int hf_sbas_l1_mt7_ai_21 = -1; static int hf_sbas_l1_mt7_ai_22 = -1; static int hf_sbas_l1_mt7_ai_23 = -1; static int hf_sbas_l1_mt7_ai_24 = -1; static int hf_sbas_l1_mt7_ai_25 = -1; static int hf_sbas_l1_mt7_ai_26 = -1; static int hf_sbas_l1_mt7_ai_27 = -1; static int hf_sbas_l1_mt7_ai_28 = -1; static int hf_sbas_l1_mt7_ai_29 = -1; static int hf_sbas_l1_mt7_ai_30 = -1; static int hf_sbas_l1_mt7_ai_31 = -1; static int hf_sbas_l1_mt7_ai_32 = -1; static int hf_sbas_l1_mt7_ai_33 = -1; static int hf_sbas_l1_mt7_ai_34 = -1; static int hf_sbas_l1_mt7_ai_35 = -1; static int hf_sbas_l1_mt7_ai_36 = -1; static int hf_sbas_l1_mt7_ai_37 = -1; static int hf_sbas_l1_mt7_ai_38 = -1; static int hf_sbas_l1_mt7_ai_39 = -1; static int hf_sbas_l1_mt7_ai_40 = -1; static int hf_sbas_l1_mt7_ai_41 = -1; static int hf_sbas_l1_mt7_ai_42 = -1; static int hf_sbas_l1_mt7_ai_43 = -1; static int hf_sbas_l1_mt7_ai_44 = -1; static int hf_sbas_l1_mt7_ai_45 = -1; static int hf_sbas_l1_mt7_ai_46 = -1; static int hf_sbas_l1_mt7_ai_47 = -1; static int hf_sbas_l1_mt7_ai_48 = -1; static int hf_sbas_l1_mt7_ai_49 = -1; static int hf_sbas_l1_mt7_ai_50 = -1; static int hf_sbas_l1_mt7_ai_51 = -1; // see ICAO Annex 10, Vol I, Table B-48 static int hf_sbas_l1_mt25 = -1; static int hf_sbas_l1_mt25_h1_velocity_code = -1; static int hf_sbas_l1_mt25_h1_v0_prn_mask_nr_1 = -1; static int hf_sbas_l1_mt25_h1_v0_iod_1 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_x_1 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_y_1 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_z_1 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_a_1_f0 = -1; static int hf_sbas_l1_mt25_h1_v0_prn_mask_nr_2 = -1; static int hf_sbas_l1_mt25_h1_v0_iod_2 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_x_2 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_y_2 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_z_2 = -1; static int hf_sbas_l1_mt25_h1_v0_delta_a_2_f0 = -1; static int hf_sbas_l1_mt25_h1_v0_iodp = -1; static int hf_sbas_l1_mt25_h1_v0_spare = -1; static int hf_sbas_l1_mt25_h2_velocity_code = -1; static int hf_sbas_l1_mt25_h2_v0_prn_mask_nr_1 = -1; static int hf_sbas_l1_mt25_h2_v0_iod_1 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_x_1 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_y_1 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_z_1 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_a_1_f0 = -1; static int hf_sbas_l1_mt25_h2_v0_prn_mask_nr_2 = -1; static int hf_sbas_l1_mt25_h2_v0_iod_2 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_x_2 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_y_2 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_z_2 = -1; static int hf_sbas_l1_mt25_h2_v0_delta_a_2_f0 = -1; static int hf_sbas_l1_mt25_h2_v0_iodp = -1; static int hf_sbas_l1_mt25_h2_v0_spare = -1; static dissector_table_t sbas_l1_mt_dissector_table; static expert_field ei_sbas_l1_preamble = EI_INIT; static expert_field ei_sbas_l1_mt0 = EI_INIT; static expert_field ei_sbas_l1_crc = EI_INIT; static int ett_sbas_l1 = -1; static int ett_sbas_l1_mt1 = -1; static int ett_sbas_l1_mt2 = -1; static int ett_sbas_l1_mt3 = -1; static int ett_sbas_l1_mt4 = -1; static int ett_sbas_l1_mt5 = -1; static int ett_sbas_l1_mt6 = -1; static int ett_sbas_l1_mt7 = -1; static int ett_sbas_l1_mt25 = -1; // compute the CRC24Q checksum for an SBAS L1 nav msg // see ICAO Annex 10, Vol I, Appendix B, Section 3.5.3.5 static guint32 sbas_crc24q(const guint8 *data) { guint32 crc = 0; // source byte and bit level index gint s8 = 0, s1 = 7; guint8 s,d = 0; // At byte level, nav msg needs to be right aligned. // So, pretend that 6 bits (with value zero) have been processed. guint8 d1 = 6; // process 226 bits nav msg (= 28 bytes + 2 bits) while ((s8 < 28) || (s8 == 28 && s1 > 5)) { // get next bit from nav msg s = (data[s8] >> s1) & 0x01; // include next bit d = (d << 1) ^ s; // 8 bits included? if (d1 == 7) { // do crc update crc=((crc<<8) & 0xffffff) ^ CRC24Q_TBL[(crc>>16) ^ d]; d1 = 0; } else { d1++; } // move to next byte if the last bit of current one was processed. if (s1 == 0) { s8++; s1 = 7; } else { s1--; } } return crc; } /* Format clock corrections */ static void fmt_clock_correction(gchar *label, gint32 c) { snprintf(label, ITEM_LABEL_LENGTH, "%d * 2^-31 s", c); } /* Format corrections with 0.125m resolution */ static void fmt_correction_125m(gchar *label, gint32 c) { c = c * 125; if (c >= 0) { snprintf(label, ITEM_LABEL_LENGTH, "%d.%03dm", c / 1000, c % 1000); } else { snprintf(label, ITEM_LABEL_LENGTH, "-%d.%03dm", -c / 1000, -c % 1000); } } /* Dissect SBAS L1 message */ static int dissect_sbas_l1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { tvbuff_t *next_tvb; guint32 preamble, mt, cmp_crc; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, proto_sbas_l1, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_tree = proto_item_add_subtree(ti, ett_sbas_l1); // preamble proto_item* pi_preamble = proto_tree_add_item_ret_uint( sbas_l1_tree, hf_sbas_l1_preamble, tvb, 0, 1, ENC_BIG_ENDIAN, &preamble); if (preamble != SBAS_L1_PREAMBLE_1 && preamble != SBAS_L1_PREAMBLE_2 && preamble != SBAS_L1_PREAMBLE_3) { expert_add_info_format(pinfo, pi_preamble, &ei_sbas_l1_preamble, "Erroneous preamble"); } // message type proto_item* pi_mt = proto_tree_add_item_ret_uint( sbas_l1_tree, hf_sbas_l1_mt, tvb, 1, 1, ENC_BIG_ENDIAN, &mt); if (mt == 0) { // flag "Do Not Use" MT0 messages expert_add_info(pinfo, pi_mt, &ei_sbas_l1_mt0); } // checksum cmp_crc = sbas_crc24q((guint8 *)tvb_memdup(pinfo->pool, tvb, 0, 29)); proto_tree_add_checksum(sbas_l1_tree, tvb, 28, hf_sbas_l1_chksum, -1, &ei_sbas_l1_crc, NULL, cmp_crc, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); // try to dissect MT data next_tvb = tvb_new_subset_length_caplen(tvb, 1, 28, 28); if (!dissector_try_uint(sbas_l1_mt_dissector_table, mt, next_tvb, pinfo, tree)) { call_data_dissector(next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 1 */ static int dissect_sbas_l1_mt1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT1"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt1, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt1_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt1); proto_tree_add_item(sbas_l1_mt1_tree, hf_sbas_l1_mt1_prn_mask_gps, tvb, 0, 6, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt1_tree, hf_sbas_l1_mt1_prn_mask_glonass, tvb, 5, 4, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt1_tree, hf_sbas_l1_mt1_prn_mask_spare_1, tvb, 8, 8, ENC_NA); proto_tree_add_item(sbas_l1_mt1_tree, hf_sbas_l1_mt1_prn_mask_sbas, tvb, 15, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt1_tree, hf_sbas_l1_mt1_prn_mask_spare_2, tvb, 18, 9, ENC_NA); proto_tree_add_item(sbas_l1_mt1_tree, hf_sbas_l1_mt1_iodp, tvb, 26, 1, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 2 */ static int dissect_sbas_l1_mt2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT2"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt2, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt2_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt2); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_iodf_j, tvb, 0, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_iodp, tvb, 1, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_1, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_2, tvb, 2, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_3, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_4, tvb, 5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_5, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_6, tvb, 8, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_7, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_8, tvb, 11, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_9, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_10, tvb, 14, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_11, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_12, tvb, 17, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_fc_13, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_1, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_2, tvb, 21, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_3, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_4, tvb, 22, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_5, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_6, tvb, 23, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_7, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_8, tvb, 24, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_9, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_10, tvb, 25, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_11, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_12, tvb, 26, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt2_tree, hf_sbas_l1_mt2_udrei_13, tvb, 26, 2, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 3 */ static int dissect_sbas_l1_mt3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT3"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt3, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt3_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt3); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_iodf_j, tvb, 0, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_iodp, tvb, 1, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_14, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_15, tvb, 2, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_16, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_17, tvb, 5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_18, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_19, tvb, 8, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_20, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_21, tvb, 11, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_22, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_23, tvb, 14, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_24, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_25, tvb, 17, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_fc_26, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_14, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_15, tvb, 21, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_16, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_17, tvb, 22, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_18, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_19, tvb, 23, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_20, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_21, tvb, 24, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_22, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_23, tvb, 25, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_24, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_25, tvb, 26, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt3_tree, hf_sbas_l1_mt3_udrei_26, tvb, 26, 2, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 4 */ static int dissect_sbas_l1_mt4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT4"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt4, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt4_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt4); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_iodf_j, tvb, 0, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_iodp, tvb, 1, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_27, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_28, tvb, 2, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_29, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_30, tvb, 5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_31, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_32, tvb, 8, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_33, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_34, tvb, 11, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_35, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_36, tvb, 14, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_37, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_38, tvb, 17, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_fc_39, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_27, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_28, tvb, 21, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_29, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_30, tvb, 22, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_31, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_32, tvb, 23, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_33, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_34, tvb, 24, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_35, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_36, tvb, 25, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_37, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_38, tvb, 26, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt4_tree, hf_sbas_l1_mt4_udrei_39, tvb, 26, 2, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 5 */ static int dissect_sbas_l1_mt5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT5"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt5, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt5_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt5); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_iodf_j, tvb, 0, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_iodp, tvb, 1, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_40, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_41, tvb, 2, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_42, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_43, tvb, 5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_44, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_45, tvb, 8, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_46, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_47, tvb, 11, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_48, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_49, tvb, 14, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_50, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_51, tvb, 17, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_fc_52, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_40, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_41, tvb, 21, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_42, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_43, tvb, 22, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_44, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_45, tvb, 23, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_46, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_47, tvb, 24, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_48, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_49, tvb, 25, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_50, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_51, tvb, 26, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt5_tree, hf_sbas_l1_mt5_udrei_52, tvb, 26, 2, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 6 */ static int dissect_sbas_l1_mt6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT6"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt6, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt6_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt6); // IODF_2 to IODF_5 proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_iodf_2, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_iodf_3, tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_iodf_4, tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_iodf_5, tvb, 1, 1, ENC_BIG_ENDIAN); // UDREI_i proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_1, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_2, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_3, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_4, tvb, 3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_5, tvb, 3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_6, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_7, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_8, tvb, 5, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_9, tvb, 5, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_10, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_11, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_12, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_13, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_14, tvb, 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_15, tvb, 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_16, tvb, 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_17, tvb, 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_18, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_19, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_20, tvb, 11, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_21, tvb, 11, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_22, tvb, 12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_23, tvb, 12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_24, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_25, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_26, tvb, 14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_27, tvb, 14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_28, tvb, 15, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_29, tvb, 15, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_30, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_31, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_32, tvb, 17, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_33, tvb, 17, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_34, tvb, 18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_35, tvb, 18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_36, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_37, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_38, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_39, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_40, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_41, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_42, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_43, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_44, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_45, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_46, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_47, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_48, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_49, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_50, tvb, 26, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt6_tree, hf_sbas_l1_mt6_udrei_51, tvb, 26, 2, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 7 */ static int dissect_sbas_l1_mt7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT7"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt7, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt7_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt7); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_t_lat, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_iodp, tvb, 1, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_spare, tvb, 1, 1, ENC_NA); // Degradation factor indicator ai_i proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_1, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_2, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_3, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_4, tvb, 3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_5, tvb, 3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_6, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_7, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_8, tvb, 5, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_9, tvb, 5, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_10, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_11, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_12, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_13, tvb, 7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_14, tvb, 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_15, tvb, 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_16, tvb, 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_17, tvb, 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_18, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_19, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_20, tvb, 11, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_21, tvb, 11, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_22, tvb, 12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_23, tvb, 12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_24, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_25, tvb, 13, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_26, tvb, 14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_27, tvb, 14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_28, tvb, 15, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_29, tvb, 15, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_30, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_31, tvb, 16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_32, tvb, 17, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_33, tvb, 17, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_34, tvb, 18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_35, tvb, 18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_36, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_37, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_38, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_39, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_40, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_41, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_42, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_43, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_44, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_45, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_46, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_47, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_48, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_49, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_50, tvb, 26, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt7_tree, hf_sbas_l1_mt7_ai_51, tvb, 26, 2, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* Dissect SBAS L1 MT 25 */ static int dissect_sbas_l1_mt25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint32 velocity_code; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBAS L1 MT25"); col_clear(pinfo->cinfo, COL_INFO); proto_item *ti = proto_tree_add_item(tree, hf_sbas_l1_mt25, tvb, 0, 32, ENC_NA); proto_tree *sbas_l1_mt25_tree = proto_item_add_subtree(ti, ett_sbas_l1_mt25); // first half message proto_tree_add_item_ret_uint(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_velocity_code, tvb, 0, 1, ENC_NA, &velocity_code); if (velocity_code == 0) { proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_prn_mask_nr_1, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_iod_1, tvb, 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_x_1, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_y_1, tvb, 3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_z_1, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_a_1_f0, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_prn_mask_nr_2, tvb, 7, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_iod_2, tvb, 8, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_x_2, tvb, 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_y_2, tvb, 10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_z_2, tvb, 11, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_delta_a_2_f0, tvb, 12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_iodp, tvb, 13, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h1_v0_spare, tvb, 13, 1, ENC_NA); } // TODO: add dissection for vel code = 1 // second half message proto_tree_add_item_ret_uint(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_velocity_code, tvb, 14, 1, ENC_NA, &velocity_code); if (velocity_code == 0) { proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_prn_mask_nr_1, tvb, 14, 1, ENC_NA); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_iod_1, tvb, 14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_x_1, tvb, 15, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_y_1, tvb, 17, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_z_1, tvb, 18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_a_1_f0, tvb, 19, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_prn_mask_nr_2, tvb, 20, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_iod_2, tvb, 21, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_x_2, tvb, 22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_y_2, tvb, 23, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_z_2, tvb, 24, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_delta_a_2_f0, tvb, 25, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_iodp, tvb, 26, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sbas_l1_mt25_tree, hf_sbas_l1_mt25_h2_v0_spare, tvb, 27, 1, ENC_NA); } // TODO: add dissection for vel code = 1 return tvb_captured_length(tvb); } void proto_register_sbas_l1(void) { static hf_register_info hf[] = { {&hf_sbas_l1_preamble, {"Preamble", "sbas_l1.preamble", FT_UINT8, BASE_HEX, NULL, 0xff, NULL, HFILL}}, {&hf_sbas_l1_mt, {"Message Type", "sbas_l1.mt" , FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL}}, {&hf_sbas_l1_chksum, {"Checksum", "sbas_l1.chksum" , FT_UINT32, BASE_HEX, NULL, 0x3fffffc0, NULL, HFILL}}, // MT1 {&hf_sbas_l1_mt1, {"MT1", "sbas_l1.mt1", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt1_prn_mask_gps, {"PRN Mask GPS", "sbas_l1.mt1.prn_mask_gps", FT_UINT64, BASE_HEX, NULL, 0x03ffffffffe0, NULL, HFILL}}, {&hf_sbas_l1_mt1_prn_mask_glonass, {"PRN Mask Glonass", "sbas_l1.mt1.prn_mask_glonass", FT_UINT32, BASE_HEX, NULL, 0x1fffffe0, NULL, HFILL}}, {&hf_sbas_l1_mt1_prn_mask_spare_1, {"PRN Mask spare", "sbas_l1.mt1.prn_mask_spare_1", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt1_prn_mask_sbas, {"PRN Mask SBAS", "sbas_l1.mt1.prn_mask_sbas", FT_UINT32, BASE_HEX, NULL, 0x07ffff, NULL, HFILL}}, {&hf_sbas_l1_mt1_prn_mask_spare_2, {"PRN Mask spare", "sbas_l1.mt1.prn_mask_spare_2", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt1_iodp, {"Issue of Data - PRN (IODP)", "sbas_l1.mt1.iodp", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}}, // MT2 {&hf_sbas_l1_mt2, {"MT2", "sbas_l1.mt2", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt2_iodf_j, {"Issue of Data - Fast Correction (IODF_j)", "sbas_l1.mt2.iodf_j", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}}, {&hf_sbas_l1_mt2_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt2.iodp", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_1, {"Fast Correction Satellite 1 (FC_1)", "sbas_l1.mt2.fc_1", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_2, {"Fast Correction Satellite 2 (FC_2)", "sbas_l1.mt2.fc_2", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_3, {"Fast Correction Satellite 3 (FC_3)", "sbas_l1.mt2.fc_3", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_4, {"Fast Correction Satellite 4 (FC_4)", "sbas_l1.mt2.fc_4", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_5, {"Fast Correction Satellite 5 (FC_5)", "sbas_l1.mt2.fc_5", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_6, {"Fast Correction Satellite 6 (FC_6)", "sbas_l1.mt2.fc_6", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_7, {"Fast Correction Satellite 7 (FC_7)", "sbas_l1.mt2.fc_7", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_8, {"Fast Correction Satellite 8 (FC_8)", "sbas_l1.mt2.fc_8", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_9, {"Fast Correction Satellite 9 (FC_9)", "sbas_l1.mt2.fc_9", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_10, {"Fast Correction Satellite 10 (FC_10)", "sbas_l1.mt2.fc_10", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_11, {"Fast Correction Satellite 11 (FC_11)", "sbas_l1.mt2.fc_11", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_12, {"Fast Correction Satellite 12 (FC_12)", "sbas_l1.mt2.fc_12", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt2_fc_13, {"Fast Correction Satellite 13 (FC_13)", "sbas_l1.mt2.fc_13", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_1, {"UDREI_1", "sbas_l1.mt2.udrei_1", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_2, {"UDREI_2", "sbas_l1.mt2.udrei_2", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_3, {"UDREI_3", "sbas_l1.mt2.udrei_3", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_4, {"UDREI_4", "sbas_l1.mt2.udrei_4", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_5, {"UDREI_5", "sbas_l1.mt2.udrei_5", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_6, {"UDREI_6", "sbas_l1.mt2.udrei_6", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_7, {"UDREI_7", "sbas_l1.mt2.udrei_7", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_8, {"UDREI_8", "sbas_l1.mt2.udrei_8", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_9, {"UDREI_9", "sbas_l1.mt2.udrei_9", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_10, {"UDREI_10", "sbas_l1.mt2.udrei_10", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_11, {"UDREI_11", "sbas_l1.mt2.udrei_11", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_12, {"UDREI_12", "sbas_l1.mt2.udrei_12", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt2_udrei_13, {"UDREI_13", "sbas_l1.mt2.udrei_13", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, // MT3 {&hf_sbas_l1_mt3, {"MT3", "sbas_l1.mt3", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt3_iodf_j, {"Issue of Data - Fast Correction (IODF_j)", "sbas_l1.mt3.iodf_j", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}}, {&hf_sbas_l1_mt3_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt3.iodp", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_14, {"Fast Correction Satellite 14 (FC_14)", "sbas_l1.mt3.fc_14", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_15, {"Fast Correction Satellite 15 (FC_15)", "sbas_l1.mt3.fc_15", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_16, {"Fast Correction Satellite 16 (FC_16)", "sbas_l1.mt3.fc_16", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_17, {"Fast Correction Satellite 17 (FC_17)", "sbas_l1.mt3.fc_17", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_18, {"Fast Correction Satellite 18 (FC_18)", "sbas_l1.mt3.fc_18", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_19, {"Fast Correction Satellite 19 (FC_19)", "sbas_l1.mt3.fc_19", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_20, {"Fast Correction Satellite 20 (FC_20)", "sbas_l1.mt3.fc_20", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_21, {"Fast Correction Satellite 21 (FC_21)", "sbas_l1.mt3.fc_21", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_22, {"Fast Correction Satellite 22 (FC_22)", "sbas_l1.mt3.fc_22", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_23, {"Fast Correction Satellite 23 (FC_23)", "sbas_l1.mt3.fc_23", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_24, {"Fast Correction Satellite 24 (FC_24)", "sbas_l1.mt3.fc_24", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_25, {"Fast Correction Satellite 25 (FC_25)", "sbas_l1.mt3.fc_25", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt3_fc_26, {"Fast Correction Satellite 26 (FC_26)", "sbas_l1.mt3.fc_26", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_14, {"UDREI_14", "sbas_l1.mt3.udrei_14", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_15, {"UDREI_15", "sbas_l1.mt3.udrei_15", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_16, {"UDREI_16", "sbas_l1.mt3.udrei_16", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_17, {"UDREI_17", "sbas_l1.mt3.udrei_17", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_18, {"UDREI_18", "sbas_l1.mt3.udrei_18", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_19, {"UDREI_19", "sbas_l1.mt3.udrei_19", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_20, {"UDREI_20", "sbas_l1.mt3.udrei_20", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_21, {"UDREI_21", "sbas_l1.mt3.udrei_21", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_22, {"UDREI_22", "sbas_l1.mt3.udrei_22", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_23, {"UDREI_23", "sbas_l1.mt3.udrei_23", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_24, {"UDREI_24", "sbas_l1.mt3.udrei_24", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_25, {"UDREI_25", "sbas_l1.mt3.udrei_25", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt3_udrei_26, {"UDREI_26", "sbas_l1.mt3.udrei_26", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, // MT4 {&hf_sbas_l1_mt4, {"MT4", "sbas_l1.mt4", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt4_iodf_j, {"Issue of Data - Fast Correction (IODF_j)", "sbas_l1.mt4.iodf_j", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}}, {&hf_sbas_l1_mt4_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt4.iodp", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_27, {"Fast Correction Satellite 27 (FC_27)", "sbas_l1.mt4.fc_27", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_28, {"Fast Correction Satellite 28 (FC_28)", "sbas_l1.mt4.fc_28", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_29, {"Fast Correction Satellite 29 (FC_29)", "sbas_l1.mt4.fc_29", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_30, {"Fast Correction Satellite 30 (FC_30)", "sbas_l1.mt4.fc_30", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_31, {"Fast Correction Satellite 31 (FC_31)", "sbas_l1.mt4.fc_31", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_32, {"Fast Correction Satellite 32 (FC_32)", "sbas_l1.mt4.fc_32", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_33, {"Fast Correction Satellite 33 (FC_33)", "sbas_l1.mt4.fc_33", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_34, {"Fast Correction Satellite 34 (FC_34)", "sbas_l1.mt4.fc_34", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_35, {"Fast Correction Satellite 35 (FC_35)", "sbas_l1.mt4.fc_35", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_36, {"Fast Correction Satellite 36 (FC_36)", "sbas_l1.mt4.fc_36", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_37, {"Fast Correction Satellite 37 (FC_37)", "sbas_l1.mt4.fc_37", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_38, {"Fast Correction Satellite 38 (FC_38)", "sbas_l1.mt4.fc_38", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt4_fc_39, {"Fast Correction Satellite 39 (FC_39)", "sbas_l1.mt4.fc_39", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_27, {"UDREI_27", "sbas_l1.mt4.udrei_27", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_28, {"UDREI_28", "sbas_l1.mt4.udrei_28", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_29, {"UDREI_29", "sbas_l1.mt4.udrei_29", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_30, {"UDREI_30", "sbas_l1.mt4.udrei_30", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_31, {"UDREI_31", "sbas_l1.mt4.udrei_31", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_32, {"UDREI_32", "sbas_l1.mt4.udrei_32", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_33, {"UDREI_33", "sbas_l1.mt4.udrei_33", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_34, {"UDREI_34", "sbas_l1.mt4.udrei_34", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_35, {"UDREI_35", "sbas_l1.mt4.udrei_35", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_36, {"UDREI_36", "sbas_l1.mt4.udrei_36", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_37, {"UDREI_37", "sbas_l1.mt4.udrei_37", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_38, {"UDREI_38", "sbas_l1.mt4.udrei_38", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt4_udrei_39, {"UDREI_39", "sbas_l1.mt4.udrei_39", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, // MT5 {&hf_sbas_l1_mt5, {"MT5", "sbas_l1.mt5", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt5_iodf_j, {"Issue of Data - Fast Correction (IODF_j)", "sbas_l1.mt5.iodf_j", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}}, {&hf_sbas_l1_mt5_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt5.iodp", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_40, {"Fast Correction Satellite 40 (FC_40)", "sbas_l1.mt5.fc_40", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_41, {"Fast Correction Satellite 41 (FC_41)", "sbas_l1.mt5.fc_41", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_42, {"Fast Correction Satellite 42 (FC_42)", "sbas_l1.mt5.fc_42", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_43, {"Fast Correction Satellite 43 (FC_43)", "sbas_l1.mt5.fc_43", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_44, {"Fast Correction Satellite 44 (FC_44)", "sbas_l1.mt5.fc_44", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_45, {"Fast Correction Satellite 45 (FC_45)", "sbas_l1.mt5.fc_45", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_46, {"Fast Correction Satellite 46 (FC_46)", "sbas_l1.mt5.fc_46", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_47, {"Fast Correction Satellite 47 (FC_47)", "sbas_l1.mt5.fc_47", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_48, {"Fast Correction Satellite 48 (FC_48)", "sbas_l1.mt5.fc_48", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_49, {"Fast Correction Satellite 49 (FC_49)", "sbas_l1.mt5.fc_49", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_50, {"Fast Correction Satellite 50 (FC_50)", "sbas_l1.mt5.fc_50", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_51, {"Fast Correction Satellite 51 (FC_51)", "sbas_l1.mt5.fc_51", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03ffc000, NULL, HFILL}}, {&hf_sbas_l1_mt5_fc_52, {"Fast Correction Satellite 52 (FC_52)", "sbas_l1.mt5.fc_52", FT_INT32, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3ffc0000, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_40, {"UDREI_40", "sbas_l1.mt5.udrei_40", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_41, {"UDREI_41", "sbas_l1.mt5.udrei_41", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_42, {"UDREI_42", "sbas_l1.mt5.udrei_42", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_43, {"UDREI_43", "sbas_l1.mt5.udrei_43", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_44, {"UDREI_44", "sbas_l1.mt5.udrei_44", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_45, {"UDREI_45", "sbas_l1.mt5.udrei_45", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_46, {"UDREI_46", "sbas_l1.mt5.udrei_46", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_47, {"UDREI_47", "sbas_l1.mt5.udrei_47", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_48, {"UDREI_48", "sbas_l1.mt5.udrei_48", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_49, {"UDREI_49", "sbas_l1.mt5.udrei_49", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_50, {"UDREI_50", "sbas_l1.mt5.udrei_50", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_51, {"UDREI_51", "sbas_l1.mt5.udrei_51", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt5_udrei_52, {"UDREI_52", "sbas_l1.mt5.udrei_52", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, // MT6 {&hf_sbas_l1_mt6, {"MT6", "sbas_l1.mt6", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt6_iodf_2, {"Issue of Data - Fast Correction (IODF_2)", "sbas_l1.mt6.iodf_2", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}}, {&hf_sbas_l1_mt6_iodf_3, {"Issue of Data - Fast Correction (IODF_3)", "sbas_l1.mt6.iodf_3", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL}}, {&hf_sbas_l1_mt6_iodf_4, {"Issue of Data - Fast Correction (IODF_4)", "sbas_l1.mt6.iodf_4", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL}}, {&hf_sbas_l1_mt6_iodf_5, {"Issue of Data - Fast Correction (IODF_5)", "sbas_l1.mt6.iodf_5", FT_UINT8, BASE_DEC, NULL, 0x0c, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_1, {"UDREI_1", "sbas_l1.mt6.udrei_1", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_2, {"UDREI_2", "sbas_l1.mt6.udrei_2", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_3, {"UDREI_3", "sbas_l1.mt6.udrei_3", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_4, {"UDREI_4", "sbas_l1.mt6.udrei_4", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_5, {"UDREI_5", "sbas_l1.mt6.udrei_5", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_6, {"UDREI_6", "sbas_l1.mt6.udrei_6", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_7, {"UDREI_7", "sbas_l1.mt6.udrei_7", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_8, {"UDREI_8", "sbas_l1.mt6.udrei_8", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_9, {"UDREI_9", "sbas_l1.mt6.udrei_9", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_10, {"UDREI_10", "sbas_l1.mt6.udrei_10", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_11, {"UDREI_11", "sbas_l1.mt6.udrei_11", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_12, {"UDREI_12", "sbas_l1.mt6.udrei_12", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_13, {"UDREI_13", "sbas_l1.mt6.udrei_13", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_14, {"UDREI_14", "sbas_l1.mt6.udrei_14", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_15, {"UDREI_15", "sbas_l1.mt6.udrei_15", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_16, {"UDREI_16", "sbas_l1.mt6.udrei_16", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_17, {"UDREI_17", "sbas_l1.mt6.udrei_17", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_18, {"UDREI_18", "sbas_l1.mt6.udrei_18", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_19, {"UDREI_19", "sbas_l1.mt6.udrei_19", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_20, {"UDREI_20", "sbas_l1.mt6.udrei_20", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_21, {"UDREI_21", "sbas_l1.mt6.udrei_21", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_22, {"UDREI_22", "sbas_l1.mt6.udrei_22", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_23, {"UDREI_23", "sbas_l1.mt6.udrei_23", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_24, {"UDREI_24", "sbas_l1.mt6.udrei_24", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_25, {"UDREI_25", "sbas_l1.mt6.udrei_25", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_26, {"UDREI_26", "sbas_l1.mt6.udrei_26", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_27, {"UDREI_27", "sbas_l1.mt6.udrei_27", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_28, {"UDREI_28", "sbas_l1.mt6.udrei_28", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_29, {"UDREI_29", "sbas_l1.mt6.udrei_29", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_30, {"UDREI_30", "sbas_l1.mt6.udrei_30", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_31, {"UDREI_31", "sbas_l1.mt6.udrei_31", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_32, {"UDREI_32", "sbas_l1.mt6.udrei_32", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_33, {"UDREI_33", "sbas_l1.mt6.udrei_33", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_34, {"UDREI_34", "sbas_l1.mt6.udrei_34", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_35, {"UDREI_35", "sbas_l1.mt6.udrei_35", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_36, {"UDREI_36", "sbas_l1.mt6.udrei_36", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_37, {"UDREI_37", "sbas_l1.mt6.udrei_37", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_38, {"UDREI_38", "sbas_l1.mt6.udrei_38", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_39, {"UDREI_39", "sbas_l1.mt6.udrei_39", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_40, {"UDREI_40", "sbas_l1.mt6.udrei_40", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_41, {"UDREI_41", "sbas_l1.mt6.udrei_41", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_42, {"UDREI_42", "sbas_l1.mt6.udrei_42", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_43, {"UDREI_43", "sbas_l1.mt6.udrei_43", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_44, {"UDREI_44", "sbas_l1.mt6.udrei_44", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_45, {"UDREI_45", "sbas_l1.mt6.udrei_45", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_46, {"UDREI_46", "sbas_l1.mt6.udrei_46", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_47, {"UDREI_47", "sbas_l1.mt6.udrei_47", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_48, {"UDREI_48", "sbas_l1.mt6.udrei_48", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_49, {"UDREI_49", "sbas_l1.mt6.udrei_49", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_50, {"UDREI_50", "sbas_l1.mt6.udrei_50", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt6_udrei_51, {"UDREI_51", "sbas_l1.mt6.udrei_51", FT_UINT16, BASE_DEC, VALS(UDREI_EVALUATION), 0x03c0, NULL, HFILL}}, // MT7 {&hf_sbas_l1_mt7, {"MT7", "sbas_l1.mt7", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt7_t_lat, {"System Latency (t_lat)", "sbas_l1.mt7.t_lat", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt7.iodp", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL}}, {&hf_sbas_l1_mt7_spare, {"Spare", "sbas_l1.mt7.spare", FT_UINT8, BASE_DEC, NULL, 0x0c, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_1, {"Degradation Factor Indicator ai_1", "sbas_l1.mt7.ai_1", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_2, {"Degradation Factor Indicator ai_2", "sbas_l1.mt7.ai_2", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_3, {"Degradation Factor Indicator ai_3", "sbas_l1.mt7.ai_3", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_4, {"Degradation Factor Indicator ai_4", "sbas_l1.mt7.ai_4", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_5, {"Degradation Factor Indicator ai_5", "sbas_l1.mt7.ai_5", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_6, {"Degradation Factor Indicator ai_6", "sbas_l1.mt7.ai_6", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_7, {"Degradation Factor Indicator ai_7", "sbas_l1.mt7.ai_7", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_8, {"Degradation Factor Indicator ai_8", "sbas_l1.mt7.ai_8", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_9, {"Degradation Factor Indicator ai_9", "sbas_l1.mt7.ai_9", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_10, {"Degradation Factor Indicator ai_10", "sbas_l1.mt7.ai_10", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_11, {"Degradation Factor Indicator ai_11", "sbas_l1.mt7.ai_11", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_12, {"Degradation Factor Indicator ai_12", "sbas_l1.mt7.ai_12", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_13, {"Degradation Factor Indicator ai_13", "sbas_l1.mt7.ai_13", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_14, {"Degradation Factor Indicator ai_14", "sbas_l1.mt7.ai_14", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_15, {"Degradation Factor Indicator ai_15", "sbas_l1.mt7.ai_15", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_16, {"Degradation Factor Indicator ai_16", "sbas_l1.mt7.ai_16", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_17, {"Degradation Factor Indicator ai_17", "sbas_l1.mt7.ai_17", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_18, {"Degradation Factor Indicator ai_18", "sbas_l1.mt7.ai_18", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_19, {"Degradation Factor Indicator ai_19", "sbas_l1.mt7.ai_19", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_20, {"Degradation Factor Indicator ai_20", "sbas_l1.mt7.ai_20", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_21, {"Degradation Factor Indicator ai_21", "sbas_l1.mt7.ai_21", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_22, {"Degradation Factor Indicator ai_22", "sbas_l1.mt7.ai_22", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_23, {"Degradation Factor Indicator ai_23", "sbas_l1.mt7.ai_23", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_24, {"Degradation Factor Indicator ai_24", "sbas_l1.mt7.ai_24", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_25, {"Degradation Factor Indicator ai_25", "sbas_l1.mt7.ai_25", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_26, {"Degradation Factor Indicator ai_26", "sbas_l1.mt7.ai_26", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_27, {"Degradation Factor Indicator ai_27", "sbas_l1.mt7.ai_27", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_28, {"Degradation Factor Indicator ai_28", "sbas_l1.mt7.ai_28", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_29, {"Degradation Factor Indicator ai_29", "sbas_l1.mt7.ai_29", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_30, {"Degradation Factor Indicator ai_30", "sbas_l1.mt7.ai_30", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_31, {"Degradation Factor Indicator ai_31", "sbas_l1.mt7.ai_31", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_32, {"Degradation Factor Indicator ai_32", "sbas_l1.mt7.ai_32", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_33, {"Degradation Factor Indicator ai_33", "sbas_l1.mt7.ai_33", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_34, {"Degradation Factor Indicator ai_34", "sbas_l1.mt7.ai_34", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_35, {"Degradation Factor Indicator ai_35", "sbas_l1.mt7.ai_35", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_36, {"Degradation Factor Indicator ai_36", "sbas_l1.mt7.ai_36", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_37, {"Degradation Factor Indicator ai_37", "sbas_l1.mt7.ai_37", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_38, {"Degradation Factor Indicator ai_38", "sbas_l1.mt7.ai_38", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_39, {"Degradation Factor Indicator ai_39", "sbas_l1.mt7.ai_39", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_40, {"Degradation Factor Indicator ai_40", "sbas_l1.mt7.ai_40", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_41, {"Degradation Factor Indicator ai_41", "sbas_l1.mt7.ai_41", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_42, {"Degradation Factor Indicator ai_42", "sbas_l1.mt7.ai_42", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_43, {"Degradation Factor Indicator ai_43", "sbas_l1.mt7.ai_43", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_44, {"Degradation Factor Indicator ai_44", "sbas_l1.mt7.ai_44", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_45, {"Degradation Factor Indicator ai_45", "sbas_l1.mt7.ai_45", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_46, {"Degradation Factor Indicator ai_46", "sbas_l1.mt7.ai_46", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_47, {"Degradation Factor Indicator ai_47", "sbas_l1.mt7.ai_47", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_48, {"Degradation Factor Indicator ai_48", "sbas_l1.mt7.ai_48", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_49, {"Degradation Factor Indicator ai_49", "sbas_l1.mt7.ai_49", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_50, {"Degradation Factor Indicator ai_50", "sbas_l1.mt7.ai_50", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x3c00, NULL, HFILL}}, {&hf_sbas_l1_mt7_ai_51, {"Degradation Factor Indicator ai_51", "sbas_l1.mt7.ai_51", FT_UINT16, BASE_DEC, VALS(DEGRADATION_FACTOR_INDICATOR), 0x03c0, NULL, HFILL}}, // MT25 {&hf_sbas_l1_mt25, {"MT25", "sbas_l1.mt25", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_velocity_code, {"Velocity Code", "sbas_l1.mt25.h1.velocity_code", FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_prn_mask_nr_1, {"PRN Mask Number", "sbas_l1.mt25.h1.v0.prn_mask_nr_1", FT_UINT16, BASE_DEC, NULL, 0x01f8, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_iod_1, {"Issue of Data (IOD_i)", "sbas_l1.mt25.h1.v0.iod_1", FT_UINT16, BASE_DEC, NULL, 0x07f8, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_x_1, {"dx_i", "sbas_l1.mt25.h1.v0.dx_1", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x07fc, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_y_1, {"dy_i", "sbas_l1.mt25.h1.v0.dy_1", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x03fe, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_z_1, {"dz_i", "sbas_l1.mt25.h1.v0.dz_1", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x01ff, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_a_1_f0, {"da_i_f0", "sbas_l1.mt25.h1.v0.da_1_f0", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_clock_correction), 0xffc0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_prn_mask_nr_2, {"PRN Mask Number", "sbas_l1.mt25.h1.v0.prn_mask_nr_2", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_iod_2, {"Issue of Data (IOD_i)", "sbas_l1.mt25.h1.v0.iod_2", FT_UINT8, BASE_DEC, NULL, 0xff, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_x_2, {"dx_i", "sbas_l1.mt25.h1.v0.dx_2", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0xff80, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_y_2, {"dy_i", "sbas_l1.mt25.h1.v0.dy_2", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x7fc0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_z_2, {"dz_i", "sbas_l1.mt25.h1.v0.dz_2", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3fe0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_delta_a_2_f0, {"da_i_f0", "sbas_l1.mt25.h1.v0.da_2_f0", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_clock_correction), 0x1ff8, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt25.h1.v0.iodp", FT_UINT8, BASE_DEC, NULL, 0x06, NULL, HFILL}}, {&hf_sbas_l1_mt25_h1_v0_spare, {"Spare", "sbas_l1.mt25.h1.v0.spare", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_velocity_code, {"Velocity Code", "sbas_l1.mt25.h2.velocity_code", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_prn_mask_nr_1, {"PRN Mask Number", "sbas_l1.mt25.h2.v0.prn_mask_nr_1", FT_UINT8, BASE_DEC, NULL, 0x7e, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_iod_1, {"Issue of Data (IOD_i)", "sbas_l1.mt25.h2.v0.iod_1", FT_UINT16, BASE_DEC, NULL, 0x01fe, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_x_1, {"dx_i", "sbas_l1.mt25.h2.v0.dx_1", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x01ff, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_y_1, {"dy_i", "sbas_l1.mt25.h2.v0.dy_1", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0xff80, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_z_1, {"dz_i", "sbas_l1.mt25.h2.v0.dz_1", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x7fc0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_a_1_f0, {"da_i_f0", "sbas_l1.mt25.h2.v0.da_1_f0", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_clock_correction), 0x3ff0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_prn_mask_nr_2, {"PRN Mask Number", "sbas_l1.mt25.h2.v0.prn_mask_nr_2", FT_UINT16, BASE_DEC, NULL, 0x0fc0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_iod_2, {"Issue of Data (IOD_i)", "sbas_l1.mt25.h2.v0.iod_2", FT_UINT16, BASE_DEC, NULL, 0x3fc0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_x_2, {"dx_i", "sbas_l1.mt25.h2.v0.dx_2", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x3fe0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_y_2, {"dy_i", "sbas_l1.mt25.h2.v0.dy_2", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x1ff0, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_z_2, {"dz_i", "sbas_l1.mt25.h2.v0.dz_2", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_correction_125m), 0x0ff8, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_delta_a_2_f0, {"da_i_f0", "sbas_l1.mt25.h2.v0.da_2_f0", FT_INT16, BASE_CUSTOM, CF_FUNC(&fmt_clock_correction), 0x07fe, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_iodp, {"Issue of Data PRN (IODP)", "sbas_l1.mt25.h2.v0.iodp", FT_UINT16, BASE_DEC, NULL, 0x0180, NULL, HFILL}}, {&hf_sbas_l1_mt25_h2_v0_spare, {"Spare", "sbas_l1.mt25.h2.v0.spare", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}}, }; expert_module_t *expert_sbas_l1; static ei_register_info ei[] = { {&ei_sbas_l1_preamble, {"sbas_l1.illegal_preamble", PI_PROTOCOL, PI_WARN, "Illegal preamble", EXPFILL}}, {&ei_sbas_l1_mt0, {"sbas_l1.mt0", PI_PROTOCOL, PI_WARN, "MT is 0", EXPFILL}}, {&ei_sbas_l1_crc, {"sbas_l1.crc", PI_CHECKSUM, PI_WARN, "CRC", EXPFILL}}, }; static gint *ett[] = { &ett_sbas_l1, &ett_sbas_l1_mt1, &ett_sbas_l1_mt2, &ett_sbas_l1_mt3, &ett_sbas_l1_mt4, &ett_sbas_l1_mt5, &ett_sbas_l1_mt6, &ett_sbas_l1_mt7, &ett_sbas_l1_mt25, }; proto_sbas_l1 = proto_register_protocol( "SBAS L1 Navigation Message", "SBAS L1", "sbas_l1"); proto_register_field_array(proto_sbas_l1, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sbas_l1 = expert_register_protocol(proto_sbas_l1); expert_register_field_array(expert_sbas_l1, ei, array_length(ei)); register_dissector("sbas_l1", dissect_sbas_l1, proto_sbas_l1); sbas_l1_mt_dissector_table = register_dissector_table("sbas_l1.mt", "SBAS L1 MT", proto_sbas_l1, FT_UINT8, BASE_DEC); } void proto_reg_handoff_sbas_l1(void) { dissector_add_uint("ubx.rxm.sfrbx.gnssid", GNSS_ID_SBAS, create_dissector_handle(dissect_sbas_l1, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 1, create_dissector_handle(dissect_sbas_l1_mt1, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 2, create_dissector_handle(dissect_sbas_l1_mt2, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 3, create_dissector_handle(dissect_sbas_l1_mt3, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 4, create_dissector_handle(dissect_sbas_l1_mt4, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 5, create_dissector_handle(dissect_sbas_l1_mt5, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 6, create_dissector_handle(dissect_sbas_l1_mt6, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 7, create_dissector_handle(dissect_sbas_l1_mt7, proto_sbas_l1)); dissector_add_uint("sbas_l1.mt", 25, create_dissector_handle(dissect_sbas_l1_mt25, proto_sbas_l1)); }
C
wireshark/epan/dissectors/packet-sbc-ap.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-sbc-ap.c */ /* asn2wrs.py -L -p sbc-ap -c ./sbc-ap.cnf -s ./packet-sbc-ap-template -D . -O ../.. SBC-AP-CommonDataTypes.asn SBC-AP-Constants.asn SBC-AP-Containers.asn SBC-AP-IEs.asn SBC-AP-PDU-Contents.asn SBC-AP-PDU-Descriptions.asn */ /* packet-sbc-ap.c * Routines for SBc Application Part (SBc-AP) packet dissection * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * Ref 3GPP TS 29.168 */ #include "config.h" #include <epan/packet.h> #include <epan/strutil.h> #include <epan/asn1.h> #include <epan/sctpppids.h> #include <epan/proto_data.h> #include "packet-ber.h" #include "packet-per.h" #include "packet-e212.h" #include "packet-gsm_map.h" #include "packet-s1ap.h" #include "packet-lte-rrc.h" #define PNAME "SBc Application Part" #define PSNAME "SBcAP" #define PFNAME "sbcap" void proto_register_sbc_ap(void); void proto_reg_handoff_sbc_ap(void); /* The registered port number for SBc-AP is 29168. * The registered payload protocol identifier for SBc-AP is 24. */ #define SBC_AP_PORT 29168 static dissector_handle_t sbc_ap_handle=NULL; #define maxNrOfErrors 256 #define maxnoofCellID 65535 #define maxnoofCellinEAI 65535 #define maxnoofCellinTAI 65535 #define maxNrOfTAIs 65535 #define maxnoofEmergencyAreaID 65535 #define maxnoofTAIforWarning 65535 #define maxProtocolExtensions 65535 #define maxProtocolIEs 65535 #define maxnoofeNBIds 256 #define maxnoofRestartedCells 256 #define maxnoofRestartTAIs 2048 #define maxnoofRestartEAIs 256 #define maxnoofFailedCells 256 #define maxnoof5GSTAIs 2048 #define maxnoofCellsingNB 16384 #define maxnoofCellsin5GS 16776960 #define maxnoofCellsin5GSTAI 65535 #define maxnoofRANNodes 65535 #define maxnoofRestart5GSTAIs 2048 #define maxnoofCellsforRestartNR 16384 typedef enum _ProcedureCode_enum { id_Write_Replace_Warning = 0, id_Stop_Warning = 1, id_Error_Indication = 2, id_Write_Replace_Warning_Indication = 3, id_Stop_Warning_Indication = 4, id_PWS_Restart_Indication = 5, id_PWS_Failure_Indication = 6 } ProcedureCode_enum; typedef enum _ProtocolIE_ID_enum { id_Broadcast_Message_Content = 0, id_Cause = 1, id_Criticality_Diagnostics = 2, id_Data_Coding_Scheme = 3, id_Failure_List = 4, id_Message_Identifier = 5, id_Number_of_Broadcasts_Completed_List = 6, id_Number_of_Broadcasts_Requested = 7, id_Radio_Resource_Loading_List = 8, id_Recovery_Indication = 9, id_Repetition_Period = 10, id_Serial_Number = 11, id_Service_Areas_List = 12, id_TypeOfError = 13, id_List_of_TAIs = 14, id_Warning_Area_List = 15, id_Warning_Message_Content = 16, id_Warning_Security_Information = 17, id_Warning_Type = 18, id_Omc_Id = 19, id_Concurrent_Warning_Message_Indicator = 20, id_Extended_Repetition_Period = 21, id_Unknown_Tracking_Area_List = 22, id_Broadcast_Scheduled_Area_List = 23, id_Send_Write_Replace_Warning_Indication = 24, id_Broadcast_Cancelled_Area_List = 25, id_Send_Stop_Warning_Indication = 26, id_Stop_All_Indicator = 27, id_Global_ENB_ID = 28, id_Broadcast_Empty_Area_List = 29, id_Restarted_Cell_List = 30, id_List_of_TAIs_Restart = 31, id_List_of_EAIs_Restart = 32, id_Failed_Cell_List = 33, id_List_of_5GS_TAIs = 34, id_Warning_Area_List_5GS = 35, id_Global_RAN_Node_ID = 36, id_Global_GNB_ID = 37, id_RAT_Selector_5GS = 38, id_Unknown_5GS_Tracking_Area_List = 39, id_Broadcast_Scheduled_Area_List_5GS = 40, id_Broadcast_Cancelled_Area_List_5GS = 41, id_Broadcast_Empty_Area_List_5GS = 42, id_Restarted_Cell_List_NR = 43, id_Failed_Cell_List_NR = 44, id_List_of_5GS_TAI_for_Restart = 45, id_Warning_Area_Coordinates = 46 } ProtocolIE_ID_enum; /* Initialize the protocol and registered fields */ static int proto_sbc_ap = -1; static int hf_sbc_ap_Serial_Number_gs = -1; static int hf_sbc_ap_Serial_Number_msg_code = -1; static int hf_sbc_ap_Serial_Number_upd_nb = -1; static int hf_sbc_ap_Warning_Type_value = -1; static int hf_sbc_ap_Warning_Type_emergency_user_alert = -1; static int hf_sbc_ap_Warning_Type_popup = -1; static int hf_sbc_ap_Warning_Message_Contents_nb_pages = -1; static int hf_sbc_ap_Warning_Message_Contents_decoded_page = -1; static int hf_sbc_ap_Broadcast_Scheduled_Area_List_PDU = -1; /* Broadcast_Scheduled_Area_List */ static int hf_sbc_ap_Broadcast_Scheduled_Area_List_5GS_PDU = -1; /* Broadcast_Scheduled_Area_List_5GS */ static int hf_sbc_ap_Broadcast_Cancelled_Area_List_PDU = -1; /* Broadcast_Cancelled_Area_List */ static int hf_sbc_ap_Broadcast_Cancelled_Area_List_5GS_PDU = -1; /* Broadcast_Cancelled_Area_List_5GS */ static int hf_sbc_ap_Broadcast_Empty_Area_List_PDU = -1; /* Broadcast_Empty_Area_List */ static int hf_sbc_ap_Broadcast_Empty_Area_List_5GS_PDU = -1; /* Broadcast_Empty_Area_List_5GS */ static int hf_sbc_ap_Cause_PDU = -1; /* Cause */ static int hf_sbc_ap_Concurrent_Warning_Message_Indicator_PDU = -1; /* Concurrent_Warning_Message_Indicator */ static int hf_sbc_ap_Criticality_Diagnostics_PDU = -1; /* Criticality_Diagnostics */ static int hf_sbc_ap_Data_Coding_Scheme_PDU = -1; /* Data_Coding_Scheme */ static int hf_sbc_ap_Extended_Repetition_Period_PDU = -1; /* Extended_Repetition_Period */ static int hf_sbc_ap_Failed_Cell_List_PDU = -1; /* Failed_Cell_List */ static int hf_sbc_ap_Failed_Cell_List_NR_PDU = -1; /* Failed_Cell_List_NR */ static int hf_sbc_ap_Global_ENB_ID_PDU = -1; /* Global_ENB_ID */ static int hf_sbc_ap_Global_RAN_Node_ID_PDU = -1; /* Global_RAN_Node_ID */ static int hf_sbc_ap_Global_GNB_ID_PDU = -1; /* Global_GNB_ID */ static int hf_sbc_ap_List_of_TAIs_PDU = -1; /* List_of_TAIs */ static int hf_sbc_ap_List_of_TAIs_Restart_PDU = -1; /* List_of_TAIs_Restart */ static int hf_sbc_ap_List_of_EAIs_Restart_PDU = -1; /* List_of_EAIs_Restart */ static int hf_sbc_ap_List_of_5GS_TAIs_PDU = -1; /* List_of_5GS_TAIs */ static int hf_sbc_ap_List_of_5GS_TAI_for_Restart_PDU = -1; /* List_of_5GS_TAI_for_Restart */ static int hf_sbc_ap_Message_Identifier_PDU = -1; /* Message_Identifier */ static int hf_sbc_ap_Number_of_Broadcasts_Requested_PDU = -1; /* Number_of_Broadcasts_Requested */ static int hf_sbc_ap_Omc_Id_PDU = -1; /* Omc_Id */ static int hf_sbc_ap_Repetition_Period_PDU = -1; /* Repetition_Period */ static int hf_sbc_ap_Restarted_Cell_List_PDU = -1; /* Restarted_Cell_List */ static int hf_sbc_ap_RAT_Selector_5GS_PDU = -1; /* RAT_Selector_5GS */ static int hf_sbc_ap_Restarted_Cell_List_NR_PDU = -1; /* Restarted_Cell_List_NR */ static int hf_sbc_ap_Send_Write_Replace_Warning_Indication_PDU = -1; /* Send_Write_Replace_Warning_Indication */ static int hf_sbc_ap_Send_Stop_Warning_Indication_PDU = -1; /* Send_Stop_Warning_Indication */ static int hf_sbc_ap_Serial_Number_PDU = -1; /* Serial_Number */ static int hf_sbc_ap_Stop_All_Indicator_PDU = -1; /* Stop_All_Indicator */ static int hf_sbc_ap_Unknown_5GS_Tracking_Area_List_PDU = -1; /* Unknown_5GS_Tracking_Area_List */ static int hf_sbc_ap_Warning_Area_List_PDU = -1; /* Warning_Area_List */ static int hf_sbc_ap_Warning_Message_Content_PDU = -1; /* Warning_Message_Content */ static int hf_sbc_ap_Warning_Area_Coordinates_PDU = -1; /* Warning_Area_Coordinates */ static int hf_sbc_ap_Warning_Security_Information_PDU = -1; /* Warning_Security_Information */ static int hf_sbc_ap_Warning_Type_PDU = -1; /* Warning_Type */ static int hf_sbc_ap_Warning_Area_List_5GS_PDU = -1; /* Warning_Area_List_5GS */ static int hf_sbc_ap_Write_Replace_Warning_Request_PDU = -1; /* Write_Replace_Warning_Request */ static int hf_sbc_ap_Write_Replace_Warning_Response_PDU = -1; /* Write_Replace_Warning_Response */ static int hf_sbc_ap_Stop_Warning_Request_PDU = -1; /* Stop_Warning_Request */ static int hf_sbc_ap_Stop_Warning_Response_PDU = -1; /* Stop_Warning_Response */ static int hf_sbc_ap_Write_Replace_Warning_Indication_PDU = -1; /* Write_Replace_Warning_Indication */ static int hf_sbc_ap_Stop_Warning_Indication_PDU = -1; /* Stop_Warning_Indication */ static int hf_sbc_ap_PWS_Restart_Indication_PDU = -1; /* PWS_Restart_Indication */ static int hf_sbc_ap_PWS_Failure_Indication_PDU = -1; /* PWS_Failure_Indication */ static int hf_sbc_ap_Error_Indication_PDU = -1; /* Error_Indication */ static int hf_sbc_ap_SBC_AP_PDU_PDU = -1; /* SBC_AP_PDU */ static int hf_sbc_ap_ProtocolIE_Container_item = -1; /* ProtocolIE_Field */ static int hf_sbc_ap_id = -1; /* ProtocolIE_ID */ static int hf_sbc_ap_criticality = -1; /* Criticality */ static int hf_sbc_ap_ie_field_value = -1; /* T_ie_field_value */ static int hf_sbc_ap_ProtocolExtensionContainer_item = -1; /* ProtocolExtensionField */ static int hf_sbc_ap_ext_id = -1; /* ProtocolExtensionID */ static int hf_sbc_ap_extensionValue = -1; /* T_extensionValue */ static int hf_sbc_ap_cellId_Broadcast_List = -1; /* CellId_Broadcast_List */ static int hf_sbc_ap_tAI_Broadcast_List = -1; /* TAI_Broadcast_List */ static int hf_sbc_ap_emergencyAreaID_Broadcast_List = -1; /* EmergencyAreaID_Broadcast_List */ static int hf_sbc_ap_iE_Extensions = -1; /* ProtocolExtensionContainer */ static int hf_sbc_ap_cellId_Broadcast_List_5GS = -1; /* CellId_Broadcast_List_5GS */ static int hf_sbc_ap_tAI_Broadcast_List_5GS = -1; /* TAI_Broadcast_List_5GS */ static int hf_sbc_ap_cellID_Cancelled_List = -1; /* CellID_Cancelled_List */ static int hf_sbc_ap_tAI_Cancelled_List = -1; /* TAI_Cancelled_List */ static int hf_sbc_ap_emergencyAreaID_Cancelled_List = -1; /* EmergencyAreaID_Cancelled_List */ static int hf_sbc_ap_cellID_Cancelled_List_5GS = -1; /* CellID_Cancelled_List_5GS */ static int hf_sbc_ap_tAI_Cancelled_List_5GS = -1; /* TAI_Cancelled_List_5GS */ static int hf_sbc_ap_Broadcast_Empty_Area_List_item = -1; /* Global_ENB_ID */ static int hf_sbc_ap_Broadcast_Empty_Area_List_5GS_item = -1; /* Global_RAN_Node_ID */ static int hf_sbc_ap_CancelledCellinEAI_item = -1; /* CancelledCellinEAI_Item */ static int hf_sbc_ap_eCGI = -1; /* EUTRAN_CGI */ static int hf_sbc_ap_numberOfBroadcasts = -1; /* NumberOfBroadcasts */ static int hf_sbc_ap_CancelledCellinTAI_item = -1; /* CancelledCellinTAI_Item */ static int hf_sbc_ap_CancelledCellinTAI_5GS_item = -1; /* CancelledCellinTAI_5GS_item */ static int hf_sbc_ap_nR_CGI = -1; /* NR_CGI */ static int hf_sbc_ap_CellId_Broadcast_List_item = -1; /* CellId_Broadcast_List_Item */ static int hf_sbc_ap_CellId_Broadcast_List_5GS_item = -1; /* CellId_Broadcast_List_5GS_item */ static int hf_sbc_ap_CellID_Cancelled_List_item = -1; /* CellID_Cancelled_Item */ static int hf_sbc_ap_CellID_Cancelled_List_5GS_item = -1; /* CellID_Cancelled_List_5GS_item */ static int hf_sbc_ap_procedureCode = -1; /* ProcedureCode */ static int hf_sbc_ap_triggeringMessage = -1; /* TriggeringMessage */ static int hf_sbc_ap_procedureCriticality = -1; /* Criticality */ static int hf_sbc_ap_iE_CriticalityDiagnostics = -1; /* CriticalityDiagnostics_IE_List */ static int hf_sbc_ap_CriticalityDiagnostics_IE_List_item = -1; /* CriticalityDiagnostics_IE_List_item */ static int hf_sbc_ap_iECriticality = -1; /* Criticality */ static int hf_sbc_ap_iE_ID = -1; /* ProtocolIE_ID */ static int hf_sbc_ap_typeOfError = -1; /* TypeOfError */ static int hf_sbc_ap_ECGIList_item = -1; /* EUTRAN_CGI */ static int hf_sbc_ap_Emergency_Area_ID_List_item = -1; /* Emergency_Area_ID */ static int hf_sbc_ap_EmergencyAreaID_Broadcast_List_item = -1; /* EmergencyAreaID_Broadcast_List_Item */ static int hf_sbc_ap_emergencyAreaID = -1; /* Emergency_Area_ID */ static int hf_sbc_ap_scheduledCellinEAI = -1; /* ScheduledCellinEAI */ static int hf_sbc_ap_EmergencyAreaID_Cancelled_List_item = -1; /* EmergencyAreaID_Cancelled_Item */ static int hf_sbc_ap_cancelledCellinEAI = -1; /* CancelledCellinEAI */ static int hf_sbc_ap_pLMNidentity = -1; /* PLMNidentity */ static int hf_sbc_ap_cell_ID = -1; /* CellIdentity */ static int hf_sbc_ap_macroENB_ID = -1; /* BIT_STRING_SIZE_20 */ static int hf_sbc_ap_homeENB_ID = -1; /* BIT_STRING_SIZE_28 */ static int hf_sbc_ap_short_macroENB_ID = -1; /* BIT_STRING_SIZE_18 */ static int hf_sbc_ap_long_macroENB_ID = -1; /* BIT_STRING_SIZE_21 */ static int hf_sbc_ap_Failed_Cell_List_item = -1; /* EUTRAN_CGI */ static int hf_sbc_ap_Failed_Cell_List_NR_item = -1; /* NR_CGI */ static int hf_sbc_ap_eNB_ID = -1; /* ENB_ID */ static int hf_sbc_ap_global_GNB_ID = -1; /* Global_GNB_ID */ static int hf_sbc_ap_global_NgENB_ID = -1; /* Global_NgENB_ID */ static int hf_sbc_ap_gNB_ID = -1; /* GNB_ID */ static int hf_sbc_ap_gNB_ID_01 = -1; /* BIT_STRING_SIZE_22_32 */ static int hf_sbc_ap_ngENB_ID = -1; /* ENB_ID */ static int hf_sbc_ap_List_of_TAIs_item = -1; /* List_of_TAIs_item */ static int hf_sbc_ap_tai = -1; /* TAI */ static int hf_sbc_ap_List_of_TAIs_Restart_item = -1; /* List_of_TAIs_Restart_item */ static int hf_sbc_ap_List_of_EAIs_Restart_item = -1; /* Emergency_Area_ID */ static int hf_sbc_ap_List_of_5GS_TAIs_item = -1; /* TAI_5GS */ static int hf_sbc_ap_List_of_5GS_TAI_for_Restart_item = -1; /* TAI_5GS */ static int hf_sbc_ap_NR_CGIList_item = -1; /* NR_CGI */ static int hf_sbc_ap_nRCellIdentity = -1; /* NRCellIdentity */ static int hf_sbc_ap_Restarted_Cell_List_item = -1; /* EUTRAN_CGI */ static int hf_sbc_ap_Restarted_Cell_List_NR_item = -1; /* NR_CGI */ static int hf_sbc_ap_ScheduledCellinEAI_item = -1; /* ScheduledCellinEAI_Item */ static int hf_sbc_ap_ScheduledCellinTAI_item = -1; /* ScheduledCellinTAI_Item */ static int hf_sbc_ap_ScheduledCellinTAI_5GS_item = -1; /* ScheduledCellinTAI_5GS_item */ static int hf_sbc_ap_TAI_Broadcast_List_item = -1; /* TAI_Broadcast_List_Item */ static int hf_sbc_ap_tAI = -1; /* TAI */ static int hf_sbc_ap_scheduledCellinTAI = -1; /* ScheduledCellinTAI */ static int hf_sbc_ap_TAI_Broadcast_List_5GS_item = -1; /* TAI_Broadcast_List_5GS_item */ static int hf_sbc_ap_tAI_5GS = -1; /* TAI_5GS */ static int hf_sbc_ap_scheduledCellinTAI_5GS = -1; /* ScheduledCellinTAI_5GS */ static int hf_sbc_ap_TAI_Cancelled_List_item = -1; /* TAI_Cancelled_List_Item */ static int hf_sbc_ap_cancelledCellinTAI = -1; /* CancelledCellinTAI */ static int hf_sbc_ap_TAI_Cancelled_List_5GS_item = -1; /* TAI_Cancelled_List_5GS_item */ static int hf_sbc_ap_cancelledCellinTAI_5GS = -1; /* CancelledCellinTAI_5GS */ static int hf_sbc_ap_TAI_List_for_Warning_item = -1; /* TAI */ static int hf_sbc_ap_tAC = -1; /* TAC */ static int hf_sbc_ap_tAC_5GS = -1; /* TAC_5GS */ static int hf_sbc_ap_Unknown_5GS_Tracking_Area_List_item = -1; /* TAI_5GS */ static int hf_sbc_ap_cell_ID_List = -1; /* ECGIList */ static int hf_sbc_ap_tracking_Area_List_for_Warning = -1; /* TAI_List_for_Warning */ static int hf_sbc_ap_emergency_Area_ID_List = -1; /* Emergency_Area_ID_List */ static int hf_sbc_ap_nR_CGIList = -1; /* NR_CGIList */ static int hf_sbc_ap_tAIList_5GS = -1; /* TAI_5GS */ static int hf_sbc_ap_emergencyAreaIDList = -1; /* Emergency_Area_ID_List */ static int hf_sbc_ap_protocolIEs = -1; /* ProtocolIE_Container */ static int hf_sbc_ap_protocolExtensions = -1; /* ProtocolExtensionContainer */ static int hf_sbc_ap_initiatingMessage = -1; /* InitiatingMessage */ static int hf_sbc_ap_successfulOutcome = -1; /* SuccessfulOutcome */ static int hf_sbc_ap_unsuccessfulOutcome = -1; /* UnsuccessfulOutcome */ static int hf_sbc_ap_initiatingMessagevalue = -1; /* InitiatingMessage_value */ static int hf_sbc_ap_successfulOutcome_value = -1; /* SuccessfulOutcome_value */ static int hf_sbc_ap_unsuccessfulOutcome_value = -1; /* UnsuccessfulOutcome_value */ /* Initialize the subtree pointers */ static int ett_sbc_ap = -1; static int ett_sbc_ap_Serial_Number = -1; static int ett_sbc_ap_Warning_Type = -1; static int ett_sbc_ap_Data_Coding_Scheme = -1; static int ett_sbc_ap_Warning_Message_Contents = -1; static gint ett_sbc_ap_ProtocolIE_Container = -1; static gint ett_sbc_ap_ProtocolIE_Field = -1; static gint ett_sbc_ap_ProtocolExtensionContainer = -1; static gint ett_sbc_ap_ProtocolExtensionField = -1; static gint ett_sbc_ap_Broadcast_Scheduled_Area_List = -1; static gint ett_sbc_ap_Broadcast_Scheduled_Area_List_5GS = -1; static gint ett_sbc_ap_Broadcast_Cancelled_Area_List = -1; static gint ett_sbc_ap_Broadcast_Cancelled_Area_List_5GS = -1; static gint ett_sbc_ap_Broadcast_Empty_Area_List = -1; static gint ett_sbc_ap_Broadcast_Empty_Area_List_5GS = -1; static gint ett_sbc_ap_CancelledCellinEAI = -1; static gint ett_sbc_ap_CancelledCellinEAI_Item = -1; static gint ett_sbc_ap_CancelledCellinTAI = -1; static gint ett_sbc_ap_CancelledCellinTAI_Item = -1; static gint ett_sbc_ap_CancelledCellinTAI_5GS = -1; static gint ett_sbc_ap_CancelledCellinTAI_5GS_item = -1; static gint ett_sbc_ap_CellId_Broadcast_List = -1; static gint ett_sbc_ap_CellId_Broadcast_List_Item = -1; static gint ett_sbc_ap_CellId_Broadcast_List_5GS = -1; static gint ett_sbc_ap_CellId_Broadcast_List_5GS_item = -1; static gint ett_sbc_ap_CellID_Cancelled_List = -1; static gint ett_sbc_ap_CellID_Cancelled_Item = -1; static gint ett_sbc_ap_CellID_Cancelled_List_5GS = -1; static gint ett_sbc_ap_CellID_Cancelled_List_5GS_item = -1; static gint ett_sbc_ap_Criticality_Diagnostics = -1; static gint ett_sbc_ap_CriticalityDiagnostics_IE_List = -1; static gint ett_sbc_ap_CriticalityDiagnostics_IE_List_item = -1; static gint ett_sbc_ap_ECGIList = -1; static gint ett_sbc_ap_Emergency_Area_ID_List = -1; static gint ett_sbc_ap_EmergencyAreaID_Broadcast_List = -1; static gint ett_sbc_ap_EmergencyAreaID_Broadcast_List_Item = -1; static gint ett_sbc_ap_EmergencyAreaID_Cancelled_List = -1; static gint ett_sbc_ap_EmergencyAreaID_Cancelled_Item = -1; static gint ett_sbc_ap_EUTRAN_CGI = -1; static gint ett_sbc_ap_ENB_ID = -1; static gint ett_sbc_ap_Failed_Cell_List = -1; static gint ett_sbc_ap_Failed_Cell_List_NR = -1; static gint ett_sbc_ap_Global_ENB_ID = -1; static gint ett_sbc_ap_Global_RAN_Node_ID = -1; static gint ett_sbc_ap_Global_GNB_ID = -1; static gint ett_sbc_ap_GNB_ID = -1; static gint ett_sbc_ap_Global_NgENB_ID = -1; static gint ett_sbc_ap_List_of_TAIs = -1; static gint ett_sbc_ap_List_of_TAIs_item = -1; static gint ett_sbc_ap_List_of_TAIs_Restart = -1; static gint ett_sbc_ap_List_of_TAIs_Restart_item = -1; static gint ett_sbc_ap_List_of_EAIs_Restart = -1; static gint ett_sbc_ap_List_of_5GS_TAIs = -1; static gint ett_sbc_ap_List_of_5GS_TAI_for_Restart = -1; static gint ett_sbc_ap_NR_CGIList = -1; static gint ett_sbc_ap_NR_CGI = -1; static gint ett_sbc_ap_Restarted_Cell_List = -1; static gint ett_sbc_ap_Restarted_Cell_List_NR = -1; static gint ett_sbc_ap_ScheduledCellinEAI = -1; static gint ett_sbc_ap_ScheduledCellinEAI_Item = -1; static gint ett_sbc_ap_ScheduledCellinTAI = -1; static gint ett_sbc_ap_ScheduledCellinTAI_Item = -1; static gint ett_sbc_ap_ScheduledCellinTAI_5GS = -1; static gint ett_sbc_ap_ScheduledCellinTAI_5GS_item = -1; static gint ett_sbc_ap_TAI_Broadcast_List = -1; static gint ett_sbc_ap_TAI_Broadcast_List_Item = -1; static gint ett_sbc_ap_TAI_Broadcast_List_5GS = -1; static gint ett_sbc_ap_TAI_Broadcast_List_5GS_item = -1; static gint ett_sbc_ap_TAI_Cancelled_List = -1; static gint ett_sbc_ap_TAI_Cancelled_List_Item = -1; static gint ett_sbc_ap_TAI_Cancelled_List_5GS = -1; static gint ett_sbc_ap_TAI_Cancelled_List_5GS_item = -1; static gint ett_sbc_ap_TAI_List_for_Warning = -1; static gint ett_sbc_ap_TAI = -1; static gint ett_sbc_ap_TAI_5GS = -1; static gint ett_sbc_ap_Unknown_5GS_Tracking_Area_List = -1; static gint ett_sbc_ap_Warning_Area_List = -1; static gint ett_sbc_ap_Warning_Area_List_5GS = -1; static gint ett_sbc_ap_Write_Replace_Warning_Request = -1; static gint ett_sbc_ap_Write_Replace_Warning_Response = -1; static gint ett_sbc_ap_Stop_Warning_Request = -1; static gint ett_sbc_ap_Stop_Warning_Response = -1; static gint ett_sbc_ap_Write_Replace_Warning_Indication = -1; static gint ett_sbc_ap_Stop_Warning_Indication = -1; static gint ett_sbc_ap_PWS_Restart_Indication = -1; static gint ett_sbc_ap_PWS_Failure_Indication = -1; static gint ett_sbc_ap_Error_Indication = -1; static gint ett_sbc_ap_SBC_AP_PDU = -1; static gint ett_sbc_ap_InitiatingMessage = -1; static gint ett_sbc_ap_SuccessfulOutcome = -1; static gint ett_sbc_ap_UnsuccessfulOutcome = -1; enum{ INITIATING_MESSAGE, SUCCESSFUL_OUTCOME, UNSUCCESSFUL_OUTCOME }; struct sbc_ap_private_data { guint8 data_coding_scheme; e212_number_type_t number_type; }; /* Global variables */ static guint32 ProcedureCode; static guint32 ProtocolIE_ID; static guint32 ProtocolExtensionID; static int global_sbc_ap_port = SBC_AP_PORT; /* Dissector tables */ static dissector_table_t sbc_ap_ies_dissector_table; static dissector_table_t sbc_ap_extension_dissector_table; static dissector_table_t sbc_ap_proc_imsg_dissector_table; static dissector_table_t sbc_ap_proc_sout_dissector_table; static dissector_table_t sbc_ap_proc_uout_dissector_table; static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *); static struct sbc_ap_private_data* sbc_ap_get_private_data(packet_info *pinfo) { struct sbc_ap_private_data *sbc_ap_data = (struct sbc_ap_private_data*)p_get_proto_data(pinfo->pool, pinfo, proto_sbc_ap, 0); if (!sbc_ap_data) { sbc_ap_data = wmem_new0(pinfo->pool, struct sbc_ap_private_data); p_add_proto_data(pinfo->pool, pinfo, proto_sbc_ap, 0, sbc_ap_data); } return sbc_ap_data; } static const value_string sbc_ap_Criticality_vals[] = { { 0, "reject" }, { 1, "ignore" }, { 2, "notify" }, { 0, NULL } }; static int dissect_sbc_ap_Criticality(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static const value_string sbc_ap_ProcedureCode_vals[] = { { id_Write_Replace_Warning, "id-Write-Replace-Warning" }, { id_Stop_Warning, "id-Stop-Warning" }, { id_Error_Indication, "id-Error-Indication" }, { id_Write_Replace_Warning_Indication, "id-Write-Replace-Warning-Indication" }, { id_Stop_Warning_Indication, "id-Stop-Warning-Indication" }, { id_PWS_Restart_Indication, "id-PWS-Restart-Indication" }, { id_PWS_Failure_Indication, "id-PWS-Failure-Indication" }, { 0, NULL } }; static int dissect_sbc_ap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, &ProcedureCode, FALSE); return offset; } static int dissect_sbc_ap_ProtocolExtensionID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &ProtocolExtensionID, FALSE); return offset; } static const value_string sbc_ap_ProtocolIE_ID_vals[] = { { id_Broadcast_Message_Content, "id-Broadcast-Message-Content" }, { id_Cause, "id-Cause" }, { id_Criticality_Diagnostics, "id-Criticality-Diagnostics" }, { id_Data_Coding_Scheme, "id-Data-Coding-Scheme" }, { id_Failure_List, "id-Failure-List" }, { id_Message_Identifier, "id-Message-Identifier" }, { id_Number_of_Broadcasts_Completed_List, "id-Number-of-Broadcasts-Completed-List" }, { id_Number_of_Broadcasts_Requested, "id-Number-of-Broadcasts-Requested" }, { id_Radio_Resource_Loading_List, "id-Radio-Resource-Loading-List" }, { id_Recovery_Indication, "id-Recovery-Indication" }, { id_Repetition_Period, "id-Repetition-Period" }, { id_Serial_Number, "id-Serial-Number" }, { id_Service_Areas_List, "id-Service-Areas-List" }, { id_TypeOfError, "id-TypeOfError" }, { id_List_of_TAIs, "id-List-of-TAIs" }, { id_Warning_Area_List, "id-Warning-Area-List" }, { id_Warning_Message_Content, "id-Warning-Message-Content" }, { id_Warning_Security_Information, "id-Warning-Security-Information" }, { id_Warning_Type, "id-Warning-Type" }, { id_Omc_Id, "id-Omc-Id" }, { id_Concurrent_Warning_Message_Indicator, "id-Concurrent-Warning-Message-Indicator" }, { id_Extended_Repetition_Period, "id-Extended-Repetition-Period" }, { id_Unknown_Tracking_Area_List, "id-Unknown-Tracking-Area-List" }, { id_Broadcast_Scheduled_Area_List, "id-Broadcast-Scheduled-Area-List" }, { id_Send_Write_Replace_Warning_Indication, "id-Send-Write-Replace-Warning-Indication" }, { id_Broadcast_Cancelled_Area_List, "id-Broadcast-Cancelled-Area-List" }, { id_Send_Stop_Warning_Indication, "id-Send-Stop-Warning-Indication" }, { id_Stop_All_Indicator, "id-Stop-All-Indicator" }, { id_Global_ENB_ID, "id-Global-ENB-ID" }, { id_Broadcast_Empty_Area_List, "id-Broadcast-Empty-Area-List" }, { id_Restarted_Cell_List, "id-Restarted-Cell-List" }, { id_List_of_TAIs_Restart, "id-List-of-TAIs-Restart" }, { id_List_of_EAIs_Restart, "id-List-of-EAIs-Restart" }, { id_Failed_Cell_List, "id-Failed-Cell-List" }, { id_List_of_5GS_TAIs, "id-List-of-5GS-TAIs" }, { id_Warning_Area_List_5GS, "id-Warning-Area-List-5GS" }, { id_Global_RAN_Node_ID, "id-Global-RAN-Node-ID" }, { id_Global_GNB_ID, "id-Global-GNB-ID" }, { id_RAT_Selector_5GS, "id-RAT-Selector-5GS" }, { id_Unknown_5GS_Tracking_Area_List, "id-Unknown-5GS-Tracking-Area-List" }, { id_Broadcast_Scheduled_Area_List_5GS, "id-Broadcast-Scheduled-Area-List-5GS" }, { id_Broadcast_Cancelled_Area_List_5GS, "id-Broadcast-Cancelled-Area-List-5GS" }, { id_Broadcast_Empty_Area_List_5GS, "id-Broadcast-Empty-Area-List-5GS" }, { id_Restarted_Cell_List_NR, "id-Restarted-Cell-List-NR" }, { id_Failed_Cell_List_NR, "id-Failed-Cell-List-NR" }, { id_List_of_5GS_TAI_for_Restart, "id-List-of-5GS-TAI-for-Restart" }, { id_Warning_Area_Coordinates, "id-Warning-Area-Coordinates" }, { 0, NULL } }; static int dissect_sbc_ap_ProtocolIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, &ProtocolIE_ID, FALSE); if (tree) { proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str(ProtocolIE_ID, VALS(sbc_ap_ProtocolIE_ID_vals), "unknown (%d)")); } return offset; } static const value_string sbc_ap_TriggeringMessage_vals[] = { { 0, "initiating-message" }, { 1, "successful-outcome" }, { 2, "unsuccessful-outcome" }, { 3, "outcome" }, { 0, NULL } }; static int dissect_sbc_ap_TriggeringMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, FALSE, 0, NULL); return offset; } static int dissect_sbc_ap_T_ie_field_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolIEFieldValue); return offset; } static const per_sequence_t ProtocolIE_Field_sequence[] = { { &hf_sbc_ap_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_ID }, { &hf_sbc_ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Criticality }, { &hf_sbc_ap_ie_field_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_T_ie_field_value }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_ProtocolIE_Field(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ProtocolIE_Field, ProtocolIE_Field_sequence); return offset; } static const per_sequence_t ProtocolIE_Container_sequence_of[1] = { { &hf_sbc_ap_ProtocolIE_Container_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Field }, }; static int dissect_sbc_ap_ProtocolIE_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ProtocolIE_Container, ProtocolIE_Container_sequence_of, 0, maxProtocolIEs, FALSE); return offset; } static int dissect_sbc_ap_T_extensionValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_ProtocolExtensionFieldExtensionValue); return offset; } static const per_sequence_t ProtocolExtensionField_sequence[] = { { &hf_sbc_ap_ext_id , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolExtensionID }, { &hf_sbc_ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Criticality }, { &hf_sbc_ap_extensionValue, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_T_extensionValue }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_ProtocolExtensionField(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ProtocolExtensionField, ProtocolExtensionField_sequence); return offset; } static const per_sequence_t ProtocolExtensionContainer_sequence_of[1] = { { &hf_sbc_ap_ProtocolExtensionContainer_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolExtensionField }, }; static int dissect_sbc_ap_ProtocolExtensionContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ProtocolExtensionContainer, ProtocolExtensionContainer_sequence_of, 1, maxProtocolExtensions, FALSE); return offset; } static int dissect_sbc_ap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb=NULL; struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); e212_number_type_t number_type = sbc_ap_data->number_type; sbc_ap_data->number_type = E212_NONE; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, &parameter_tvb); if(tvb_reported_length(tvb)==0) return offset; if (!parameter_tvb) return offset; dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, number_type, FALSE); return offset; } static int dissect_sbc_ap_CellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 28, 28, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t EUTRAN_CGI_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_cell_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CellIdentity }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_EUTRAN_CGI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); sbc_ap_data->number_type = E212_ECGI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_EUTRAN_CGI, EUTRAN_CGI_sequence); return offset; } static const per_sequence_t CellId_Broadcast_List_Item_sequence[] = { { &hf_sbc_ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CellId_Broadcast_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellId_Broadcast_List_Item, CellId_Broadcast_List_Item_sequence); return offset; } static const per_sequence_t CellId_Broadcast_List_sequence_of[1] = { { &hf_sbc_ap_CellId_Broadcast_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CellId_Broadcast_List_Item }, }; static int dissect_sbc_ap_CellId_Broadcast_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellId_Broadcast_List, CellId_Broadcast_List_sequence_of, 1, maxnoofCellID, FALSE); return offset; } static int dissect_sbc_ap_TAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t TAI_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_tAC , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAC }, { &hf_sbc_ap_iE_Extensions, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_TAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); sbc_ap_data->number_type = E212_TAI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI, TAI_sequence); return offset; } static const per_sequence_t ScheduledCellinTAI_Item_sequence[] = { { &hf_sbc_ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_ScheduledCellinTAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ScheduledCellinTAI_Item, ScheduledCellinTAI_Item_sequence); return offset; } static const per_sequence_t ScheduledCellinTAI_sequence_of[1] = { { &hf_sbc_ap_ScheduledCellinTAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ScheduledCellinTAI_Item }, }; static int dissect_sbc_ap_ScheduledCellinTAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ScheduledCellinTAI, ScheduledCellinTAI_sequence_of, 1, maxnoofCellinTAI, FALSE); return offset; } static const per_sequence_t TAI_Broadcast_List_Item_sequence[] = { { &hf_sbc_ap_tAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI }, { &hf_sbc_ap_scheduledCellinTAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ScheduledCellinTAI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_TAI_Broadcast_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Broadcast_List_Item, TAI_Broadcast_List_Item_sequence); return offset; } static const per_sequence_t TAI_Broadcast_List_sequence_of[1] = { { &hf_sbc_ap_TAI_Broadcast_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_Broadcast_List_Item }, }; static int dissect_sbc_ap_TAI_Broadcast_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Broadcast_List, TAI_Broadcast_List_sequence_of, 1, maxnoofTAIforWarning, FALSE); return offset; } static int dissect_sbc_ap_Emergency_Area_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, NULL); return offset; } static const per_sequence_t ScheduledCellinEAI_Item_sequence[] = { { &hf_sbc_ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_ScheduledCellinEAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ScheduledCellinEAI_Item, ScheduledCellinEAI_Item_sequence); return offset; } static const per_sequence_t ScheduledCellinEAI_sequence_of[1] = { { &hf_sbc_ap_ScheduledCellinEAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ScheduledCellinEAI_Item }, }; static int dissect_sbc_ap_ScheduledCellinEAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ScheduledCellinEAI, ScheduledCellinEAI_sequence_of, 1, maxnoofCellinEAI, FALSE); return offset; } static const per_sequence_t EmergencyAreaID_Broadcast_List_Item_sequence[] = { { &hf_sbc_ap_emergencyAreaID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Emergency_Area_ID }, { &hf_sbc_ap_scheduledCellinEAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ScheduledCellinEAI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_EmergencyAreaID_Broadcast_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_EmergencyAreaID_Broadcast_List_Item, EmergencyAreaID_Broadcast_List_Item_sequence); return offset; } static const per_sequence_t EmergencyAreaID_Broadcast_List_sequence_of[1] = { { &hf_sbc_ap_EmergencyAreaID_Broadcast_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EmergencyAreaID_Broadcast_List_Item }, }; static int dissect_sbc_ap_EmergencyAreaID_Broadcast_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_EmergencyAreaID_Broadcast_List, EmergencyAreaID_Broadcast_List_sequence_of, 1, maxnoofEmergencyAreaID, FALSE); return offset; } static const per_sequence_t Broadcast_Scheduled_Area_List_sequence[] = { { &hf_sbc_ap_cellId_Broadcast_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_CellId_Broadcast_List }, { &hf_sbc_ap_tAI_Broadcast_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_TAI_Broadcast_List }, { &hf_sbc_ap_emergencyAreaID_Broadcast_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_EmergencyAreaID_Broadcast_List }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Broadcast_Scheduled_Area_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Broadcast_Scheduled_Area_List, Broadcast_Scheduled_Area_List_sequence); return offset; } static int dissect_sbc_ap_NRCellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 36, 36, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t NR_CGI_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_nRCellIdentity, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NRCellIdentity }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_NR_CGI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); sbc_ap_data->number_type = E212_NRCGI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_NR_CGI, NR_CGI_sequence); return offset; } static const per_sequence_t CellId_Broadcast_List_5GS_item_sequence[] = { { &hf_sbc_ap_nR_CGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CellId_Broadcast_List_5GS_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellId_Broadcast_List_5GS_item, CellId_Broadcast_List_5GS_item_sequence); return offset; } static const per_sequence_t CellId_Broadcast_List_5GS_sequence_of[1] = { { &hf_sbc_ap_CellId_Broadcast_List_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CellId_Broadcast_List_5GS_item }, }; static int dissect_sbc_ap_CellId_Broadcast_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellId_Broadcast_List_5GS, CellId_Broadcast_List_5GS_sequence_of, 1, maxnoofCellsin5GS, FALSE); return offset; } static int dissect_sbc_ap_TAC_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 3, 3, FALSE, &parameter_tvb); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 3, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t TAI_5GS_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_tAC_5GS , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAC_5GS }, { &hf_sbc_ap_iE_Extensions, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_TAI_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); sbc_ap_data->number_type = E212_5GSTAI; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_5GS, TAI_5GS_sequence); return offset; } static const per_sequence_t ScheduledCellinTAI_5GS_item_sequence[] = { { &hf_sbc_ap_nR_CGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_ScheduledCellinTAI_5GS_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ScheduledCellinTAI_5GS_item, ScheduledCellinTAI_5GS_item_sequence); return offset; } static const per_sequence_t ScheduledCellinTAI_5GS_sequence_of[1] = { { &hf_sbc_ap_ScheduledCellinTAI_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ScheduledCellinTAI_5GS_item }, }; static int dissect_sbc_ap_ScheduledCellinTAI_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ScheduledCellinTAI_5GS, ScheduledCellinTAI_5GS_sequence_of, 1, maxnoofCellsin5GSTAI, FALSE); return offset; } static const per_sequence_t TAI_Broadcast_List_5GS_item_sequence[] = { { &hf_sbc_ap_tAI_5GS , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_5GS }, { &hf_sbc_ap_scheduledCellinTAI_5GS, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ScheduledCellinTAI_5GS }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_TAI_Broadcast_List_5GS_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Broadcast_List_5GS_item, TAI_Broadcast_List_5GS_item_sequence); return offset; } static const per_sequence_t TAI_Broadcast_List_5GS_sequence_of[1] = { { &hf_sbc_ap_TAI_Broadcast_List_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_Broadcast_List_5GS_item }, }; static int dissect_sbc_ap_TAI_Broadcast_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Broadcast_List_5GS, TAI_Broadcast_List_5GS_sequence_of, 1, maxnoof5GSTAIs, FALSE); return offset; } static const per_sequence_t Broadcast_Scheduled_Area_List_5GS_sequence[] = { { &hf_sbc_ap_cellId_Broadcast_List_5GS, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_CellId_Broadcast_List_5GS }, { &hf_sbc_ap_tAI_Broadcast_List_5GS, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_TAI_Broadcast_List_5GS }, { &hf_sbc_ap_emergencyAreaID_Broadcast_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_EmergencyAreaID_Broadcast_List }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Broadcast_Scheduled_Area_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Broadcast_Scheduled_Area_List_5GS, Broadcast_Scheduled_Area_List_5GS_sequence); return offset; } static int dissect_sbc_ap_NumberOfBroadcasts(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static const per_sequence_t CellID_Cancelled_Item_sequence[] = { { &hf_sbc_ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, { &hf_sbc_ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NumberOfBroadcasts }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CellID_Cancelled_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellID_Cancelled_Item, CellID_Cancelled_Item_sequence); return offset; } static const per_sequence_t CellID_Cancelled_List_sequence_of[1] = { { &hf_sbc_ap_CellID_Cancelled_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CellID_Cancelled_Item }, }; static int dissect_sbc_ap_CellID_Cancelled_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellID_Cancelled_List, CellID_Cancelled_List_sequence_of, 1, maxnoofCellID, FALSE); return offset; } static const per_sequence_t CancelledCellinTAI_Item_sequence[] = { { &hf_sbc_ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, { &hf_sbc_ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NumberOfBroadcasts }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CancelledCellinTAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CancelledCellinTAI_Item, CancelledCellinTAI_Item_sequence); return offset; } static const per_sequence_t CancelledCellinTAI_sequence_of[1] = { { &hf_sbc_ap_CancelledCellinTAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CancelledCellinTAI_Item }, }; static int dissect_sbc_ap_CancelledCellinTAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CancelledCellinTAI, CancelledCellinTAI_sequence_of, 1, maxnoofCellinTAI, FALSE); return offset; } static const per_sequence_t TAI_Cancelled_List_Item_sequence[] = { { &hf_sbc_ap_tAI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI }, { &hf_sbc_ap_cancelledCellinTAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CancelledCellinTAI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_TAI_Cancelled_List_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Cancelled_List_Item, TAI_Cancelled_List_Item_sequence); return offset; } static const per_sequence_t TAI_Cancelled_List_sequence_of[1] = { { &hf_sbc_ap_TAI_Cancelled_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_Cancelled_List_Item }, }; static int dissect_sbc_ap_TAI_Cancelled_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Cancelled_List, TAI_Cancelled_List_sequence_of, 1, maxnoofTAIforWarning, FALSE); return offset; } static const per_sequence_t CancelledCellinEAI_Item_sequence[] = { { &hf_sbc_ap_eCGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, { &hf_sbc_ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NumberOfBroadcasts }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CancelledCellinEAI_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CancelledCellinEAI_Item, CancelledCellinEAI_Item_sequence); return offset; } static const per_sequence_t CancelledCellinEAI_sequence_of[1] = { { &hf_sbc_ap_CancelledCellinEAI_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CancelledCellinEAI_Item }, }; static int dissect_sbc_ap_CancelledCellinEAI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CancelledCellinEAI, CancelledCellinEAI_sequence_of, 1, maxnoofCellinEAI, FALSE); return offset; } static const per_sequence_t EmergencyAreaID_Cancelled_Item_sequence[] = { { &hf_sbc_ap_emergencyAreaID, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Emergency_Area_ID }, { &hf_sbc_ap_cancelledCellinEAI, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CancelledCellinEAI }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_EmergencyAreaID_Cancelled_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_EmergencyAreaID_Cancelled_Item, EmergencyAreaID_Cancelled_Item_sequence); return offset; } static const per_sequence_t EmergencyAreaID_Cancelled_List_sequence_of[1] = { { &hf_sbc_ap_EmergencyAreaID_Cancelled_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EmergencyAreaID_Cancelled_Item }, }; static int dissect_sbc_ap_EmergencyAreaID_Cancelled_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_EmergencyAreaID_Cancelled_List, EmergencyAreaID_Cancelled_List_sequence_of, 1, maxnoofEmergencyAreaID, FALSE); return offset; } static const per_sequence_t Broadcast_Cancelled_Area_List_sequence[] = { { &hf_sbc_ap_cellID_Cancelled_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_CellID_Cancelled_List }, { &hf_sbc_ap_tAI_Cancelled_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_TAI_Cancelled_List }, { &hf_sbc_ap_emergencyAreaID_Cancelled_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_EmergencyAreaID_Cancelled_List }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Broadcast_Cancelled_Area_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Broadcast_Cancelled_Area_List, Broadcast_Cancelled_Area_List_sequence); return offset; } static const per_sequence_t CellID_Cancelled_List_5GS_item_sequence[] = { { &hf_sbc_ap_nR_CGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, { &hf_sbc_ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NumberOfBroadcasts }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CellID_Cancelled_List_5GS_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellID_Cancelled_List_5GS_item, CellID_Cancelled_List_5GS_item_sequence); return offset; } static const per_sequence_t CellID_Cancelled_List_5GS_sequence_of[1] = { { &hf_sbc_ap_CellID_Cancelled_List_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CellID_Cancelled_List_5GS_item }, }; static int dissect_sbc_ap_CellID_Cancelled_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CellID_Cancelled_List_5GS, CellID_Cancelled_List_5GS_sequence_of, 1, maxnoofCellsin5GS, FALSE); return offset; } static const per_sequence_t CancelledCellinTAI_5GS_item_sequence[] = { { &hf_sbc_ap_nR_CGI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, { &hf_sbc_ap_numberOfBroadcasts, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NumberOfBroadcasts }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CancelledCellinTAI_5GS_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CancelledCellinTAI_5GS_item, CancelledCellinTAI_5GS_item_sequence); return offset; } static const per_sequence_t CancelledCellinTAI_5GS_sequence_of[1] = { { &hf_sbc_ap_CancelledCellinTAI_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CancelledCellinTAI_5GS_item }, }; static int dissect_sbc_ap_CancelledCellinTAI_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CancelledCellinTAI_5GS, CancelledCellinTAI_5GS_sequence_of, 1, maxnoofCellsin5GSTAI, FALSE); return offset; } static const per_sequence_t TAI_Cancelled_List_5GS_item_sequence[] = { { &hf_sbc_ap_tAI_5GS , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_5GS }, { &hf_sbc_ap_cancelledCellinTAI_5GS, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CancelledCellinTAI_5GS }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_TAI_Cancelled_List_5GS_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Cancelled_List_5GS_item, TAI_Cancelled_List_5GS_item_sequence); return offset; } static const per_sequence_t TAI_Cancelled_List_5GS_sequence_of[1] = { { &hf_sbc_ap_TAI_Cancelled_List_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_Cancelled_List_5GS_item }, }; static int dissect_sbc_ap_TAI_Cancelled_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_Cancelled_List_5GS, TAI_Cancelled_List_5GS_sequence_of, 1, maxnoof5GSTAIs, FALSE); return offset; } static const per_sequence_t Broadcast_Cancelled_Area_List_5GS_sequence[] = { { &hf_sbc_ap_cellID_Cancelled_List_5GS, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_CellID_Cancelled_List_5GS }, { &hf_sbc_ap_tAI_Cancelled_List_5GS, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_TAI_Cancelled_List_5GS }, { &hf_sbc_ap_emergencyAreaID_Cancelled_List, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_EmergencyAreaID_Cancelled_List }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Broadcast_Cancelled_Area_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Broadcast_Cancelled_Area_List_5GS, Broadcast_Cancelled_Area_List_5GS_sequence); return offset; } static int dissect_sbc_ap_BIT_STRING_SIZE_20(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 20, 20, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_sbc_ap_BIT_STRING_SIZE_28(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 28, 28, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_sbc_ap_BIT_STRING_SIZE_18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 18, 18, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_sbc_ap_BIT_STRING_SIZE_21(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 21, 21, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string sbc_ap_ENB_ID_vals[] = { { 0, "macroENB-ID" }, { 1, "homeENB-ID" }, { 2, "short-macroENB-ID" }, { 3, "long-macroENB-ID" }, { 0, NULL } }; static const per_choice_t ENB_ID_choice[] = { { 0, &hf_sbc_ap_macroENB_ID , ASN1_EXTENSION_ROOT , dissect_sbc_ap_BIT_STRING_SIZE_20 }, { 1, &hf_sbc_ap_homeENB_ID , ASN1_EXTENSION_ROOT , dissect_sbc_ap_BIT_STRING_SIZE_28 }, { 2, &hf_sbc_ap_short_macroENB_ID, ASN1_NOT_EXTENSION_ROOT, dissect_sbc_ap_BIT_STRING_SIZE_18 }, { 3, &hf_sbc_ap_long_macroENB_ID, ASN1_NOT_EXTENSION_ROOT, dissect_sbc_ap_BIT_STRING_SIZE_21 }, { 0, NULL, 0, NULL } }; static int dissect_sbc_ap_ENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ENB_ID, ENB_ID_choice, NULL); return offset; } static const per_sequence_t Global_ENB_ID_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_eNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ENB_ID }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Global_ENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Global_ENB_ID, Global_ENB_ID_sequence); return offset; } static const per_sequence_t Broadcast_Empty_Area_List_sequence_of[1] = { { &hf_sbc_ap_Broadcast_Empty_Area_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Global_ENB_ID }, }; static int dissect_sbc_ap_Broadcast_Empty_Area_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Broadcast_Empty_Area_List, Broadcast_Empty_Area_List_sequence_of, 1, maxnoofeNBIds, FALSE); return offset; } static int dissect_sbc_ap_BIT_STRING_SIZE_22_32(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 22, 32, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string sbc_ap_GNB_ID_vals[] = { { 0, "gNB-ID" }, { 0, NULL } }; static const per_choice_t GNB_ID_choice[] = { { 0, &hf_sbc_ap_gNB_ID_01 , ASN1_EXTENSION_ROOT , dissect_sbc_ap_BIT_STRING_SIZE_22_32 }, { 0, NULL, 0, NULL } }; static int dissect_sbc_ap_GNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sbc_ap_GNB_ID, GNB_ID_choice, NULL); return offset; } static const per_sequence_t Global_GNB_ID_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_gNB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_GNB_ID }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Global_GNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Global_GNB_ID, Global_GNB_ID_sequence); return offset; } static const per_sequence_t Global_NgENB_ID_sequence[] = { { &hf_sbc_ap_pLMNidentity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_PLMNidentity }, { &hf_sbc_ap_ngENB_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ENB_ID }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Global_NgENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Global_NgENB_ID, Global_NgENB_ID_sequence); return offset; } static const value_string sbc_ap_Global_RAN_Node_ID_vals[] = { { 0, "global-GNB-ID" }, { 1, "global-NgENB-ID" }, { 0, NULL } }; static const per_choice_t Global_RAN_Node_ID_choice[] = { { 0, &hf_sbc_ap_global_GNB_ID, ASN1_EXTENSION_ROOT , dissect_sbc_ap_Global_GNB_ID }, { 1, &hf_sbc_ap_global_NgENB_ID, ASN1_EXTENSION_ROOT , dissect_sbc_ap_Global_NgENB_ID }, { 0, NULL, 0, NULL } }; static int dissect_sbc_ap_Global_RAN_Node_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Global_RAN_Node_ID, Global_RAN_Node_ID_choice, NULL); return offset; } static const per_sequence_t Broadcast_Empty_Area_List_5GS_sequence_of[1] = { { &hf_sbc_ap_Broadcast_Empty_Area_List_5GS_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Global_RAN_Node_ID }, }; static int dissect_sbc_ap_Broadcast_Empty_Area_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Broadcast_Empty_Area_List_5GS, Broadcast_Empty_Area_List_5GS_sequence_of, 1, maxnoofRANNodes, FALSE); return offset; } static const value_string sbc_ap_Cause_vals[] = { { 0, "message-accepted" }, { 1, "parameter-not-recognised" }, { 2, "parameter-value-invalid" }, { 3, "valid-message-not-identified" }, { 4, "tracking-area-not-valid" }, { 5, "unrecognised-message" }, { 6, "missing-mandatory-element" }, { 7, "mME-capacity-exceeded" }, { 8, "mME-memory-exceeded" }, { 9, "warning-broadcast-not-supported" }, { 10, "warning-broadcast-not-operational" }, { 11, "message-reference-already-used" }, { 12, "unspecifed-error" }, { 13, "transfer-syntax-error" }, { 14, "semantic-error" }, { 15, "message-not-compatible-with-receiver-state" }, { 16, "abstract-syntax-error-reject" }, { 17, "abstract-syntax-error-ignore-and-notify" }, { 18, "abstract-syntax-error-falsely-constructed-message" }, { 0, NULL } }; static int dissect_sbc_ap_Cause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static const value_string sbc_ap_Concurrent_Warning_Message_Indicator_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_sbc_ap_Concurrent_Warning_Message_Indicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static const value_string sbc_ap_TypeOfError_vals[] = { { 0, "not-understood" }, { 1, "missing" }, { 0, NULL } }; static int dissect_sbc_ap_TypeOfError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_item_sequence[] = { { &hf_sbc_ap_iECriticality, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Criticality }, { &hf_sbc_ap_iE_ID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_ID }, { &hf_sbc_ap_typeOfError , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TypeOfError }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_CriticalityDiagnostics_IE_List_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CriticalityDiagnostics_IE_List_item, CriticalityDiagnostics_IE_List_item_sequence); return offset; } static const per_sequence_t CriticalityDiagnostics_IE_List_sequence_of[1] = { { &hf_sbc_ap_CriticalityDiagnostics_IE_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_CriticalityDiagnostics_IE_List_item }, }; static int dissect_sbc_ap_CriticalityDiagnostics_IE_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_CriticalityDiagnostics_IE_List, CriticalityDiagnostics_IE_List_sequence_of, 1, maxNrOfErrors, FALSE); return offset; } static const per_sequence_t Criticality_Diagnostics_sequence[] = { { &hf_sbc_ap_procedureCode, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProcedureCode }, { &hf_sbc_ap_triggeringMessage, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_TriggeringMessage }, { &hf_sbc_ap_procedureCriticality, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_Criticality }, { &hf_sbc_ap_iE_CriticalityDiagnostics, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_CriticalityDiagnostics_IE_List }, { &hf_sbc_ap_iE_Extensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Criticality_Diagnostics(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Criticality_Diagnostics, Criticality_Diagnostics_sequence); return offset; } static int dissect_sbc_ap_Data_Coding_Scheme(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_sbc_ap_Data_Coding_Scheme); sbc_ap_data->data_coding_scheme = dissect_cbs_data_coding_scheme(parameter_tvb, actx->pinfo, subtree, 0); } return offset; } static const per_sequence_t ECGIList_sequence_of[1] = { { &hf_sbc_ap_ECGIList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, }; static int dissect_sbc_ap_ECGIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_ECGIList, ECGIList_sequence_of, 1, maxnoofCellID, FALSE); return offset; } static const per_sequence_t Emergency_Area_ID_List_sequence_of[1] = { { &hf_sbc_ap_Emergency_Area_ID_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Emergency_Area_ID }, }; static int dissect_sbc_ap_Emergency_Area_ID_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Emergency_Area_ID_List, Emergency_Area_ID_List_sequence_of, 1, maxnoofEmergencyAreaID, FALSE); return offset; } static int dissect_sbc_ap_Extended_Repetition_Period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 4096U, 131071U, NULL, FALSE); return offset; } static const per_sequence_t Failed_Cell_List_sequence_of[1] = { { &hf_sbc_ap_Failed_Cell_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, }; static int dissect_sbc_ap_Failed_Cell_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Failed_Cell_List, Failed_Cell_List_sequence_of, 1, maxnoofFailedCells, FALSE); return offset; } static const per_sequence_t Failed_Cell_List_NR_sequence_of[1] = { { &hf_sbc_ap_Failed_Cell_List_NR_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, }; static int dissect_sbc_ap_Failed_Cell_List_NR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Failed_Cell_List_NR, Failed_Cell_List_NR_sequence_of, 1, maxnoofCellsingNB, FALSE); return offset; } static const per_sequence_t List_of_TAIs_item_sequence[] = { { &hf_sbc_ap_tai , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_List_of_TAIs_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_TAIs_item, List_of_TAIs_item_sequence); return offset; } static const per_sequence_t List_of_TAIs_sequence_of[1] = { { &hf_sbc_ap_List_of_TAIs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_List_of_TAIs_item }, }; static int dissect_sbc_ap_List_of_TAIs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_TAIs, List_of_TAIs_sequence_of, 1, maxNrOfTAIs, FALSE); return offset; } static const per_sequence_t List_of_TAIs_Restart_item_sequence[] = { { &hf_sbc_ap_tai , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_List_of_TAIs_Restart_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_TAIs_Restart_item, List_of_TAIs_Restart_item_sequence); return offset; } static const per_sequence_t List_of_TAIs_Restart_sequence_of[1] = { { &hf_sbc_ap_List_of_TAIs_Restart_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_List_of_TAIs_Restart_item }, }; static int dissect_sbc_ap_List_of_TAIs_Restart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_TAIs_Restart, List_of_TAIs_Restart_sequence_of, 1, maxnoofRestartTAIs, FALSE); return offset; } static const per_sequence_t List_of_EAIs_Restart_sequence_of[1] = { { &hf_sbc_ap_List_of_EAIs_Restart_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Emergency_Area_ID }, }; static int dissect_sbc_ap_List_of_EAIs_Restart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_EAIs_Restart, List_of_EAIs_Restart_sequence_of, 1, maxnoofRestartEAIs, FALSE); return offset; } static const per_sequence_t List_of_5GS_TAIs_sequence_of[1] = { { &hf_sbc_ap_List_of_5GS_TAIs_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_5GS }, }; static int dissect_sbc_ap_List_of_5GS_TAIs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_5GS_TAIs, List_of_5GS_TAIs_sequence_of, 1, maxnoof5GSTAIs, FALSE); return offset; } static const per_sequence_t List_of_5GS_TAI_for_Restart_sequence_of[1] = { { &hf_sbc_ap_List_of_5GS_TAI_for_Restart_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_5GS }, }; static int dissect_sbc_ap_List_of_5GS_TAI_for_Restart(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_List_of_5GS_TAI_for_Restart, List_of_5GS_TAI_for_Restart_sequence_of, 1, maxnoofRestart5GSTAIs, FALSE); return offset; } static int dissect_sbc_ap_Message_Identifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 16, 16, FALSE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_sbc_ap_Number_of_Broadcasts_Requested(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static const per_sequence_t NR_CGIList_sequence_of[1] = { { &hf_sbc_ap_NR_CGIList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, }; static int dissect_sbc_ap_NR_CGIList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_NR_CGIList, NR_CGIList_sequence_of, 1, maxnoofCellsingNB, FALSE); return offset; } static int dissect_sbc_ap_Omc_Id(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 20, FALSE, NULL); return offset; } static int dissect_sbc_ap_Repetition_Period(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4096U, NULL, FALSE); return offset; } static const per_sequence_t Restarted_Cell_List_sequence_of[1] = { { &hf_sbc_ap_Restarted_Cell_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_EUTRAN_CGI }, }; static int dissect_sbc_ap_Restarted_Cell_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Restarted_Cell_List, Restarted_Cell_List_sequence_of, 1, maxnoofRestartedCells, FALSE); return offset; } static const value_string sbc_ap_RAT_Selector_5GS_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_sbc_ap_RAT_Selector_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t Restarted_Cell_List_NR_sequence_of[1] = { { &hf_sbc_ap_Restarted_Cell_List_NR_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_NR_CGI }, }; static int dissect_sbc_ap_Restarted_Cell_List_NR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Restarted_Cell_List_NR, Restarted_Cell_List_NR_sequence_of, 1, maxnoofCellsforRestartNR, FALSE); return offset; } static const value_string sbc_ap_Send_Write_Replace_Warning_Indication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_sbc_ap_Send_Write_Replace_Warning_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static const value_string sbc_ap_Send_Stop_Warning_Indication_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_sbc_ap_Send_Stop_Warning_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static int dissect_sbc_ap_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, &parameter_tvb, NULL); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_sbc_ap_Serial_Number); proto_tree_add_item(subtree, hf_sbc_ap_Serial_Number_gs, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_sbc_ap_Serial_Number_msg_code, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_sbc_ap_Serial_Number_upd_nb, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static const value_string sbc_ap_Stop_All_Indicator_vals[] = { { 0, "true" }, { 0, NULL } }; static int dissect_sbc_ap_Stop_All_Indicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t TAI_List_for_Warning_sequence_of[1] = { { &hf_sbc_ap_TAI_List_for_Warning_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI }, }; static int dissect_sbc_ap_TAI_List_for_Warning(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_TAI_List_for_Warning, TAI_List_for_Warning_sequence_of, 1, maxnoofTAIforWarning, FALSE); return offset; } static const per_sequence_t Unknown_5GS_Tracking_Area_List_sequence_of[1] = { { &hf_sbc_ap_Unknown_5GS_Tracking_Area_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_TAI_5GS }, }; static int dissect_sbc_ap_Unknown_5GS_Tracking_Area_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Unknown_5GS_Tracking_Area_List, Unknown_5GS_Tracking_Area_List_sequence_of, 1, maxnoof5GSTAIs, FALSE); return offset; } static const value_string sbc_ap_Warning_Area_List_vals[] = { { 0, "cell-ID-List" }, { 1, "tracking-Area-List-for-Warning" }, { 2, "emergency-Area-ID-List" }, { 0, NULL } }; static const per_choice_t Warning_Area_List_choice[] = { { 0, &hf_sbc_ap_cell_ID_List , ASN1_EXTENSION_ROOT , dissect_sbc_ap_ECGIList }, { 1, &hf_sbc_ap_tracking_Area_List_for_Warning, ASN1_EXTENSION_ROOT , dissect_sbc_ap_TAI_List_for_Warning }, { 2, &hf_sbc_ap_emergency_Area_ID_List, ASN1_EXTENSION_ROOT , dissect_sbc_ap_Emergency_Area_ID_List }, { 0, NULL, 0, NULL } }; static int dissect_sbc_ap_Warning_Area_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Warning_Area_List, Warning_Area_List_choice, NULL); return offset; } static int dissect_sbc_ap_Warning_Message_Content(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 9600, FALSE, &parameter_tvb); if (parameter_tvb) { struct sbc_ap_private_data *sbc_ap_data = sbc_ap_get_private_data(actx->pinfo); proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_sbc_ap_Warning_Message_Contents); dissect_s1ap_warningMessageContents(parameter_tvb, subtree, actx->pinfo, sbc_ap_data->data_coding_scheme, hf_sbc_ap_Warning_Message_Contents_nb_pages, hf_sbc_ap_Warning_Message_Contents_decoded_page); } return offset; } static int dissect_sbc_ap_Warning_Area_Coordinates(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 1024, FALSE, NULL); return offset; } static int dissect_sbc_ap_Warning_Security_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 50, 50, FALSE, NULL); return offset; } static int dissect_sbc_ap_Warning_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *parameter_tvb = NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 2, 2, FALSE, &parameter_tvb); if (parameter_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_sbc_ap_Warning_Type); proto_tree_add_item(subtree, hf_sbc_ap_Warning_Type_value, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_sbc_ap_Warning_Type_emergency_user_alert, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_sbc_ap_Warning_Type_popup, parameter_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static const value_string sbc_ap_Warning_Area_List_5GS_vals[] = { { 0, "cell-ID-List" }, { 1, "nR-CGIList" }, { 2, "tAIList-5GS" }, { 3, "emergencyAreaIDList" }, { 0, NULL } }; static const per_choice_t Warning_Area_List_5GS_choice[] = { { 0, &hf_sbc_ap_cell_ID_List , ASN1_EXTENSION_ROOT , dissect_sbc_ap_ECGIList }, { 1, &hf_sbc_ap_nR_CGIList , ASN1_EXTENSION_ROOT , dissect_sbc_ap_NR_CGIList }, { 2, &hf_sbc_ap_tAIList_5GS , ASN1_EXTENSION_ROOT , dissect_sbc_ap_TAI_5GS }, { 3, &hf_sbc_ap_emergencyAreaIDList, ASN1_EXTENSION_ROOT , dissect_sbc_ap_Emergency_Area_ID_List }, { 0, NULL, 0, NULL } }; static int dissect_sbc_ap_Warning_Area_List_5GS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Warning_Area_List_5GS, Warning_Area_List_5GS_choice, NULL); return offset; } static const per_sequence_t Write_Replace_Warning_Request_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Write_Replace_Warning_Request(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Write-Replace-Warning-Request"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Write_Replace_Warning_Request, Write_Replace_Warning_Request_sequence); return offset; } static const per_sequence_t Write_Replace_Warning_Response_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Write_Replace_Warning_Response(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Write-Replace-Warning-Response"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Write_Replace_Warning_Response, Write_Replace_Warning_Response_sequence); return offset; } static const per_sequence_t Stop_Warning_Request_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Stop_Warning_Request(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Stop-Warning-Request"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Stop_Warning_Request, Stop_Warning_Request_sequence); return offset; } static const per_sequence_t Stop_Warning_Response_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Stop_Warning_Response(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Stop-Warning-Response"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Stop_Warning_Response, Stop_Warning_Response_sequence); return offset; } static const per_sequence_t Write_Replace_Warning_Indication_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Write_Replace_Warning_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Write-Replace-Warning-Indication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Write_Replace_Warning_Indication, Write_Replace_Warning_Indication_sequence); return offset; } static const per_sequence_t Stop_Warning_Indication_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Stop_Warning_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Stop-Warning-Indication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Stop_Warning_Indication, Stop_Warning_Indication_sequence); return offset; } static const per_sequence_t PWS_Restart_Indication_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_PWS_Restart_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PWS-Restart-Indication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_PWS_Restart_Indication, PWS_Restart_Indication_sequence); return offset; } static const per_sequence_t PWS_Failure_Indication_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { &hf_sbc_ap_protocolExtensions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sbc_ap_ProtocolExtensionContainer }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_PWS_Failure_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "PWS-Failure-Indication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_PWS_Failure_Indication, PWS_Failure_Indication_sequence); return offset; } static const per_sequence_t Error_Indication_sequence[] = { { &hf_sbc_ap_protocolIEs , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProtocolIE_Container }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_Error_Indication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, "Error-Indication"); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_Error_Indication, Error_Indication_sequence); return offset; } static int dissect_sbc_ap_InitiatingMessage_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_InitiatingMessageValue); return offset; } static const per_sequence_t InitiatingMessage_sequence[] = { { &hf_sbc_ap_procedureCode, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProcedureCode }, { &hf_sbc_ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Criticality }, { &hf_sbc_ap_initiatingMessagevalue, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_InitiatingMessage_value }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_InitiatingMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_InitiatingMessage, InitiatingMessage_sequence); return offset; } static int dissect_sbc_ap_SuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_SuccessfulOutcomeValue); return offset; } static const per_sequence_t SuccessfulOutcome_sequence[] = { { &hf_sbc_ap_procedureCode, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProcedureCode }, { &hf_sbc_ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Criticality }, { &hf_sbc_ap_successfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_SuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_SuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_SuccessfulOutcome, SuccessfulOutcome_sequence); return offset; } static int dissect_sbc_ap_UnsuccessfulOutcome_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_open_type_pdu_new(tvb, offset, actx, tree, hf_index, dissect_UnsuccessfulOutcomeValue); return offset; } static const per_sequence_t UnsuccessfulOutcome_sequence[] = { { &hf_sbc_ap_procedureCode, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_ProcedureCode }, { &hf_sbc_ap_criticality , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_Criticality }, { &hf_sbc_ap_unsuccessfulOutcome_value, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_sbc_ap_UnsuccessfulOutcome_value }, { NULL, 0, 0, NULL } }; static int dissect_sbc_ap_UnsuccessfulOutcome(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_sbc_ap_UnsuccessfulOutcome, UnsuccessfulOutcome_sequence); return offset; } static const value_string sbc_ap_SBC_AP_PDU_vals[] = { { 0, "initiatingMessage" }, { 1, "successfulOutcome" }, { 2, "unsuccessfulOutcome" }, { 0, NULL } }; static const per_choice_t SBC_AP_PDU_choice[] = { { 0, &hf_sbc_ap_initiatingMessage, ASN1_EXTENSION_ROOT , dissect_sbc_ap_InitiatingMessage }, { 1, &hf_sbc_ap_successfulOutcome, ASN1_EXTENSION_ROOT , dissect_sbc_ap_SuccessfulOutcome }, { 2, &hf_sbc_ap_unsuccessfulOutcome, ASN1_EXTENSION_ROOT , dissect_sbc_ap_UnsuccessfulOutcome }, { 0, NULL, 0, NULL } }; static int dissect_sbc_ap_SBC_AP_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_sbc_ap_SBC_AP_PDU, SBC_AP_PDU_choice, NULL); return offset; } /*--- PDUs ---*/ static int dissect_Broadcast_Scheduled_Area_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Broadcast_Scheduled_Area_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Broadcast_Scheduled_Area_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Broadcast_Scheduled_Area_List_5GS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Broadcast_Scheduled_Area_List_5GS(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Broadcast_Scheduled_Area_List_5GS_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Broadcast_Cancelled_Area_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Broadcast_Cancelled_Area_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Broadcast_Cancelled_Area_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Broadcast_Cancelled_Area_List_5GS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Broadcast_Cancelled_Area_List_5GS(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Broadcast_Cancelled_Area_List_5GS_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Broadcast_Empty_Area_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Broadcast_Empty_Area_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Broadcast_Empty_Area_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Broadcast_Empty_Area_List_5GS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Broadcast_Empty_Area_List_5GS(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Broadcast_Empty_Area_List_5GS_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Cause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Cause(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Cause_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Concurrent_Warning_Message_Indicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Concurrent_Warning_Message_Indicator(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Concurrent_Warning_Message_Indicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Criticality_Diagnostics_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Criticality_Diagnostics(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Criticality_Diagnostics_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Data_Coding_Scheme_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Data_Coding_Scheme(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Data_Coding_Scheme_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Extended_Repetition_Period_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Extended_Repetition_Period(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Extended_Repetition_Period_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Failed_Cell_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Failed_Cell_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Failed_Cell_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Failed_Cell_List_NR_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Failed_Cell_List_NR(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Failed_Cell_List_NR_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Global_ENB_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Global_ENB_ID(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Global_ENB_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Global_RAN_Node_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Global_RAN_Node_ID(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Global_RAN_Node_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Global_GNB_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Global_GNB_ID(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Global_GNB_ID_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_List_of_TAIs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_List_of_TAIs(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_List_of_TAIs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_List_of_TAIs_Restart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_List_of_TAIs_Restart(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_List_of_TAIs_Restart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_List_of_EAIs_Restart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_List_of_EAIs_Restart(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_List_of_EAIs_Restart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_List_of_5GS_TAIs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_List_of_5GS_TAIs(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_List_of_5GS_TAIs_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_List_of_5GS_TAI_for_Restart_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_List_of_5GS_TAI_for_Restart(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_List_of_5GS_TAI_for_Restart_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Message_Identifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Message_Identifier(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Message_Identifier_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Number_of_Broadcasts_Requested_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Number_of_Broadcasts_Requested(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Number_of_Broadcasts_Requested_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Omc_Id_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Omc_Id(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Omc_Id_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Repetition_Period_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Repetition_Period(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Repetition_Period_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Restarted_Cell_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Restarted_Cell_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Restarted_Cell_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_RAT_Selector_5GS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_RAT_Selector_5GS(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_RAT_Selector_5GS_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Restarted_Cell_List_NR_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Restarted_Cell_List_NR(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Restarted_Cell_List_NR_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Send_Write_Replace_Warning_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Send_Write_Replace_Warning_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Send_Write_Replace_Warning_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Send_Stop_Warning_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Send_Stop_Warning_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Send_Stop_Warning_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Serial_Number_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Serial_Number(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Serial_Number_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Stop_All_Indicator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Stop_All_Indicator(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Stop_All_Indicator_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Unknown_5GS_Tracking_Area_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Unknown_5GS_Tracking_Area_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Unknown_5GS_Tracking_Area_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Area_List_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Warning_Area_List(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Warning_Area_List_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Message_Content_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Warning_Message_Content(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Warning_Message_Content_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Area_Coordinates_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Warning_Area_Coordinates(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Warning_Area_Coordinates_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Security_Information_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Warning_Security_Information(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Warning_Security_Information_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Type_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Warning_Type(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Warning_Type_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Warning_Area_List_5GS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Warning_Area_List_5GS(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Warning_Area_List_5GS_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Write_Replace_Warning_Request_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Write_Replace_Warning_Request(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Write_Replace_Warning_Request_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Write_Replace_Warning_Response_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Write_Replace_Warning_Response(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Write_Replace_Warning_Response_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Stop_Warning_Request_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Stop_Warning_Request(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Stop_Warning_Request_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Stop_Warning_Response_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Stop_Warning_Response(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Stop_Warning_Response_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Write_Replace_Warning_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Write_Replace_Warning_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Write_Replace_Warning_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Stop_Warning_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Stop_Warning_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Stop_Warning_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PWS_Restart_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_PWS_Restart_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_PWS_Restart_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_PWS_Failure_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_PWS_Failure_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_PWS_Failure_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_Error_Indication_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_Error_Indication(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_Error_Indication_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_SBC_AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_sbc_ap_SBC_AP_PDU(tvb, offset, &asn1_ctx, tree, hf_sbc_ap_SBC_AP_PDU_PDU); offset += 7; offset >>= 3; return offset; } static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } /* Currently not used static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } */ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissector_try_uint(sbc_ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0; } static int dissect_sbc_ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *sbc_ap_item = NULL; proto_tree *sbc_ap_tree = NULL; /* make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); col_clear(pinfo->cinfo, COL_INFO); /* create the sbc_ap protocol tree */ sbc_ap_item = proto_tree_add_item(tree, proto_sbc_ap, tvb, 0, -1, ENC_NA); sbc_ap_tree = proto_item_add_subtree(sbc_ap_item, ett_sbc_ap); dissect_SBC_AP_PDU_PDU(tvb, pinfo, sbc_ap_tree, NULL); return tvb_captured_length(tvb); } /*--- proto_register_sbc_ap -------------------------------------------*/ void proto_register_sbc_ap(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_sbc_ap_Serial_Number_gs, { "Geographical Scope", "sbc_ap.SerialNumber.gs", FT_UINT16, BASE_DEC, VALS(s1ap_serialNumber_gs_vals), 0xc000, NULL, HFILL }}, { &hf_sbc_ap_Serial_Number_msg_code, { "Message Code", "sbc_ap.SerialNumber.msg_code", FT_UINT16, BASE_DEC, NULL, 0x3ff0, NULL, HFILL }}, { &hf_sbc_ap_Serial_Number_upd_nb, { "Update Number", "sbc_ap.SerialNumber.upd_nb", FT_UINT16, BASE_DEC, NULL, 0x000f, NULL, HFILL }}, { &hf_sbc_ap_Warning_Type_value, { "Warning Type Value", "sbc-ap.WarningType.value", FT_UINT16, BASE_DEC, VALS(s1ap_warningType_vals), 0xfe00, NULL, HFILL }}, { &hf_sbc_ap_Warning_Type_emergency_user_alert, { "Emergency User Alert", "sbc-ap.WarningType.emergency_user_alert", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100, NULL, HFILL }}, { &hf_sbc_ap_Warning_Type_popup, { "Popup", "sbc-ap.WarningType.popup", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080, NULL, HFILL }}, { &hf_sbc_ap_Warning_Message_Contents_nb_pages, { "Number of Pages", "sbc-ap.WarningMessageContents.nb_pages", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Message_Contents_decoded_page, { "Decoded Page", "sbc-ap.WarningMessageContents.decoded_page", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Scheduled_Area_List_PDU, { "Broadcast-Scheduled-Area-List", "sbc-ap.Broadcast_Scheduled_Area_List_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Scheduled_Area_List_5GS_PDU, { "Broadcast-Scheduled-Area-List-5GS", "sbc-ap.Broadcast_Scheduled_Area_List_5GS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Cancelled_Area_List_PDU, { "Broadcast-Cancelled-Area-List", "sbc-ap.Broadcast_Cancelled_Area_List_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Cancelled_Area_List_5GS_PDU, { "Broadcast-Cancelled-Area-List-5GS", "sbc-ap.Broadcast_Cancelled_Area_List_5GS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Empty_Area_List_PDU, { "Broadcast-Empty-Area-List", "sbc-ap.Broadcast_Empty_Area_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Empty_Area_List_5GS_PDU, { "Broadcast-Empty-Area-List-5GS", "sbc-ap.Broadcast_Empty_Area_List_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Cause_PDU, { "Cause", "sbc-ap.Cause", FT_UINT32, BASE_DEC, VALS(sbc_ap_Cause_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Concurrent_Warning_Message_Indicator_PDU, { "Concurrent-Warning-Message-Indicator", "sbc-ap.Concurrent_Warning_Message_Indicator", FT_UINT32, BASE_DEC, VALS(sbc_ap_Concurrent_Warning_Message_Indicator_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Criticality_Diagnostics_PDU, { "Criticality-Diagnostics", "sbc-ap.Criticality_Diagnostics_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Data_Coding_Scheme_PDU, { "Data-Coding-Scheme", "sbc-ap.Data_Coding_Scheme", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Extended_Repetition_Period_PDU, { "Extended-Repetition-Period", "sbc-ap.Extended_Repetition_Period", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_sbc_ap_Failed_Cell_List_PDU, { "Failed-Cell-List", "sbc-ap.Failed_Cell_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Failed_Cell_List_NR_PDU, { "Failed-Cell-List-NR", "sbc-ap.Failed_Cell_List_NR", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Global_ENB_ID_PDU, { "Global-ENB-ID", "sbc-ap.Global_ENB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Global_RAN_Node_ID_PDU, { "Global-RAN-Node-ID", "sbc-ap.Global_RAN_Node_ID", FT_UINT32, BASE_DEC, VALS(sbc_ap_Global_RAN_Node_ID_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Global_GNB_ID_PDU, { "Global-GNB-ID", "sbc-ap.Global_GNB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_TAIs_PDU, { "List-of-TAIs", "sbc-ap.List_of_TAIs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_TAIs_Restart_PDU, { "List-of-TAIs-Restart", "sbc-ap.List_of_TAIs_Restart", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_EAIs_Restart_PDU, { "List-of-EAIs-Restart", "sbc-ap.List_of_EAIs_Restart", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_5GS_TAIs_PDU, { "List-of-5GS-TAIs", "sbc-ap.List_of_5GS_TAIs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_5GS_TAI_for_Restart_PDU, { "List-of-5GS-TAI-for-Restart", "sbc-ap.List_of_5GS_TAI_for_Restart", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Message_Identifier_PDU, { "Message-Identifier", "sbc-ap.Message_Identifier", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &lte_rrc_messageIdentifier_vals_ext, 0, NULL, HFILL }}, { &hf_sbc_ap_Number_of_Broadcasts_Requested_PDU, { "Number-of-Broadcasts-Requested", "sbc-ap.Number_of_Broadcasts_Requested", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Omc_Id_PDU, { "Omc-Id", "sbc-ap.Omc_Id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Repetition_Period_PDU, { "Repetition-Period", "sbc-ap.Repetition_Period", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }}, { &hf_sbc_ap_Restarted_Cell_List_PDU, { "Restarted-Cell-List", "sbc-ap.Restarted_Cell_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_RAT_Selector_5GS_PDU, { "RAT-Selector-5GS", "sbc-ap.RAT_Selector_5GS", FT_UINT32, BASE_DEC, VALS(sbc_ap_RAT_Selector_5GS_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Restarted_Cell_List_NR_PDU, { "Restarted-Cell-List-NR", "sbc-ap.Restarted_Cell_List_NR", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Send_Write_Replace_Warning_Indication_PDU, { "Send-Write-Replace-Warning-Indication", "sbc-ap.Send_Write_Replace_Warning_Indication", FT_UINT32, BASE_DEC, VALS(sbc_ap_Send_Write_Replace_Warning_Indication_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Send_Stop_Warning_Indication_PDU, { "Send-Stop-Warning-Indication", "sbc-ap.Send_Stop_Warning_Indication", FT_UINT32, BASE_DEC, VALS(sbc_ap_Send_Stop_Warning_Indication_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Serial_Number_PDU, { "Serial-Number", "sbc-ap.Serial_Number", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Stop_All_Indicator_PDU, { "Stop-All-Indicator", "sbc-ap.Stop_All_Indicator", FT_UINT32, BASE_DEC, VALS(sbc_ap_Stop_All_Indicator_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Unknown_5GS_Tracking_Area_List_PDU, { "Unknown-5GS-Tracking-Area-List", "sbc-ap.Unknown_5GS_Tracking_Area_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Area_List_PDU, { "Warning-Area-List", "sbc-ap.Warning_Area_List", FT_UINT32, BASE_DEC, VALS(sbc_ap_Warning_Area_List_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Message_Content_PDU, { "Warning-Message-Content", "sbc-ap.Warning_Message_Content", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Area_Coordinates_PDU, { "Warning-Area-Coordinates", "sbc-ap.Warning_Area_Coordinates", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Security_Information_PDU, { "Warning-Security-Information", "sbc-ap.Warning_Security_Information", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Type_PDU, { "Warning-Type", "sbc-ap.Warning_Type", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Warning_Area_List_5GS_PDU, { "Warning-Area-List-5GS", "sbc-ap.Warning_Area_List_5GS", FT_UINT32, BASE_DEC, VALS(sbc_ap_Warning_Area_List_5GS_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_Write_Replace_Warning_Request_PDU, { "Write-Replace-Warning-Request", "sbc-ap.Write_Replace_Warning_Request_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Write_Replace_Warning_Response_PDU, { "Write-Replace-Warning-Response", "sbc-ap.Write_Replace_Warning_Response_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Stop_Warning_Request_PDU, { "Stop-Warning-Request", "sbc-ap.Stop_Warning_Request_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Stop_Warning_Response_PDU, { "Stop-Warning-Response", "sbc-ap.Stop_Warning_Response_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Write_Replace_Warning_Indication_PDU, { "Write-Replace-Warning-Indication", "sbc-ap.Write_Replace_Warning_Indication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Stop_Warning_Indication_PDU, { "Stop-Warning-Indication", "sbc-ap.Stop_Warning_Indication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_PWS_Restart_Indication_PDU, { "PWS-Restart-Indication", "sbc-ap.PWS_Restart_Indication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_PWS_Failure_Indication_PDU, { "PWS-Failure-Indication", "sbc-ap.PWS_Failure_Indication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Error_Indication_PDU, { "Error-Indication", "sbc-ap.Error_Indication_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_SBC_AP_PDU_PDU, { "SBC-AP-PDU", "sbc-ap.SBC_AP_PDU", FT_UINT32, BASE_DEC, VALS(sbc_ap_SBC_AP_PDU_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_ProtocolIE_Container_item, { "ProtocolIE-Field", "sbc-ap.ProtocolIE_Field_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_id, { "id", "sbc-ap.id", FT_UINT32, BASE_DEC, VALS(sbc_ap_ProtocolIE_ID_vals), 0, "ProtocolIE_ID", HFILL }}, { &hf_sbc_ap_criticality, { "criticality", "sbc-ap.criticality", FT_UINT32, BASE_DEC, VALS(sbc_ap_Criticality_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_ie_field_value, { "value", "sbc-ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "T_ie_field_value", HFILL }}, { &hf_sbc_ap_ProtocolExtensionContainer_item, { "ProtocolExtensionField", "sbc-ap.ProtocolExtensionField_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_ext_id, { "id", "sbc-ap.id", FT_UINT8, BASE_DEC, VALS(sbc_ap_ProtocolIE_ID_vals), 0, "ProtocolExtensionID", HFILL }}, { &hf_sbc_ap_extensionValue, { "extensionValue", "sbc-ap.extensionValue_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cellId_Broadcast_List, { "cellId-Broadcast-List", "sbc-ap.cellId_Broadcast_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAI_Broadcast_List, { "tAI-Broadcast-List", "sbc-ap.tAI_Broadcast_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_emergencyAreaID_Broadcast_List, { "emergencyAreaID-Broadcast-List", "sbc-ap.emergencyAreaID_Broadcast_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_iE_Extensions, { "iE-Extensions", "sbc-ap.iE_Extensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_sbc_ap_cellId_Broadcast_List_5GS, { "cellId-Broadcast-List-5GS", "sbc-ap.cellId_Broadcast_List_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAI_Broadcast_List_5GS, { "tAI-Broadcast-List-5GS", "sbc-ap.tAI_Broadcast_List_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cellID_Cancelled_List, { "cellID-Cancelled-List", "sbc-ap.cellID_Cancelled_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAI_Cancelled_List, { "tAI-Cancelled-List", "sbc-ap.tAI_Cancelled_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_emergencyAreaID_Cancelled_List, { "emergencyAreaID-Cancelled-List", "sbc-ap.emergencyAreaID_Cancelled_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cellID_Cancelled_List_5GS, { "cellID-Cancelled-List-5GS", "sbc-ap.cellID_Cancelled_List_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAI_Cancelled_List_5GS, { "tAI-Cancelled-List-5GS", "sbc-ap.tAI_Cancelled_List_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Empty_Area_List_item, { "Global-ENB-ID", "sbc-ap.Global_ENB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Broadcast_Empty_Area_List_5GS_item, { "Global-RAN-Node-ID", "sbc-ap.Global_RAN_Node_ID", FT_UINT32, BASE_DEC, VALS(sbc_ap_Global_RAN_Node_ID_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_CancelledCellinEAI_item, { "CancelledCellinEAI-Item", "sbc-ap.CancelledCellinEAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_eCGI, { "eCGI", "sbc-ap.eCGI_element", FT_NONE, BASE_NONE, NULL, 0, "EUTRAN_CGI", HFILL }}, { &hf_sbc_ap_numberOfBroadcasts, { "numberOfBroadcasts", "sbc-ap.numberOfBroadcasts", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_CancelledCellinTAI_item, { "CancelledCellinTAI-Item", "sbc-ap.CancelledCellinTAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_CancelledCellinTAI_5GS_item, { "CancelledCellinTAI-5GS item", "sbc-ap.CancelledCellinTAI_5GS_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_nR_CGI, { "nR-CGI", "sbc-ap.nR_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_CellId_Broadcast_List_item, { "CellId-Broadcast-List-Item", "sbc-ap.CellId_Broadcast_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_CellId_Broadcast_List_5GS_item, { "CellId-Broadcast-List-5GS item", "sbc-ap.CellId_Broadcast_List_5GS_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_CellID_Cancelled_List_item, { "CellID-Cancelled-Item", "sbc-ap.CellID_Cancelled_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_CellID_Cancelled_List_5GS_item, { "CellID-Cancelled-List-5GS item", "sbc-ap.CellID_Cancelled_List_5GS_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_procedureCode, { "procedureCode", "sbc-ap.procedureCode", FT_UINT32, BASE_DEC, VALS(sbc_ap_ProcedureCode_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_triggeringMessage, { "triggeringMessage", "sbc-ap.triggeringMessage", FT_UINT32, BASE_DEC, VALS(sbc_ap_TriggeringMessage_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_procedureCriticality, { "procedureCriticality", "sbc-ap.procedureCriticality", FT_UINT32, BASE_DEC, VALS(sbc_ap_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_sbc_ap_iE_CriticalityDiagnostics, { "iE-CriticalityDiagnostics", "sbc-ap.iE_CriticalityDiagnostics", FT_UINT32, BASE_DEC, NULL, 0, "CriticalityDiagnostics_IE_List", HFILL }}, { &hf_sbc_ap_CriticalityDiagnostics_IE_List_item, { "CriticalityDiagnostics-IE-List item", "sbc-ap.CriticalityDiagnostics_IE_List_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_iECriticality, { "iECriticality", "sbc-ap.iECriticality", FT_UINT32, BASE_DEC, VALS(sbc_ap_Criticality_vals), 0, "Criticality", HFILL }}, { &hf_sbc_ap_iE_ID, { "iE-ID", "sbc-ap.iE_ID", FT_UINT32, BASE_DEC, VALS(sbc_ap_ProtocolIE_ID_vals), 0, "ProtocolIE_ID", HFILL }}, { &hf_sbc_ap_typeOfError, { "typeOfError", "sbc-ap.typeOfError", FT_UINT32, BASE_DEC, VALS(sbc_ap_TypeOfError_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_ECGIList_item, { "EUTRAN-CGI", "sbc-ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Emergency_Area_ID_List_item, { "Emergency-Area-ID", "sbc-ap.Emergency_Area_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_EmergencyAreaID_Broadcast_List_item, { "EmergencyAreaID-Broadcast-List-Item", "sbc-ap.EmergencyAreaID_Broadcast_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_emergencyAreaID, { "emergencyAreaID", "sbc-ap.emergencyAreaID", FT_BYTES, BASE_NONE, NULL, 0, "Emergency_Area_ID", HFILL }}, { &hf_sbc_ap_scheduledCellinEAI, { "scheduledCellinEAI", "sbc-ap.scheduledCellinEAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_EmergencyAreaID_Cancelled_List_item, { "EmergencyAreaID-Cancelled-Item", "sbc-ap.EmergencyAreaID_Cancelled_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cancelledCellinEAI, { "cancelledCellinEAI", "sbc-ap.cancelledCellinEAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_pLMNidentity, { "pLMNidentity", "sbc-ap.pLMNidentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cell_ID, { "cell-ID", "sbc-ap.cell_ID", FT_BYTES, BASE_NONE, NULL, 0, "CellIdentity", HFILL }}, { &hf_sbc_ap_macroENB_ID, { "macroENB-ID", "sbc-ap.macroENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_20", HFILL }}, { &hf_sbc_ap_homeENB_ID, { "homeENB-ID", "sbc-ap.homeENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_28", HFILL }}, { &hf_sbc_ap_short_macroENB_ID, { "short-macroENB-ID", "sbc-ap.short_macroENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_18", HFILL }}, { &hf_sbc_ap_long_macroENB_ID, { "long-macroENB-ID", "sbc-ap.long_macroENB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_21", HFILL }}, { &hf_sbc_ap_Failed_Cell_List_item, { "EUTRAN-CGI", "sbc-ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Failed_Cell_List_NR_item, { "NR-CGI", "sbc-ap.NR_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_eNB_ID, { "eNB-ID", "sbc-ap.eNB_ID", FT_UINT32, BASE_DEC, VALS(sbc_ap_ENB_ID_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_global_GNB_ID, { "global-GNB-ID", "sbc-ap.global_GNB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_global_NgENB_ID, { "global-NgENB-ID", "sbc-ap.global_NgENB_ID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_gNB_ID, { "gNB-ID", "sbc-ap.gNB_ID", FT_UINT32, BASE_DEC, VALS(sbc_ap_GNB_ID_vals), 0, NULL, HFILL }}, { &hf_sbc_ap_gNB_ID_01, { "gNB-ID", "sbc-ap.gNB_ID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_22_32", HFILL }}, { &hf_sbc_ap_ngENB_ID, { "ngENB-ID", "sbc-ap.ngENB_ID", FT_UINT32, BASE_DEC, VALS(sbc_ap_ENB_ID_vals), 0, "ENB_ID", HFILL }}, { &hf_sbc_ap_List_of_TAIs_item, { "List-of-TAIs item", "sbc-ap.List_of_TAIs_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tai, { "tai", "sbc-ap.tai_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_TAIs_Restart_item, { "List-of-TAIs-Restart item", "sbc-ap.List_of_TAIs_Restart_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_EAIs_Restart_item, { "Emergency-Area-ID", "sbc-ap.Emergency_Area_ID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_5GS_TAIs_item, { "TAI-5GS", "sbc-ap.TAI_5GS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_List_of_5GS_TAI_for_Restart_item, { "TAI-5GS", "sbc-ap.TAI_5GS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_NR_CGIList_item, { "NR-CGI", "sbc-ap.NR_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_nRCellIdentity, { "nRCellIdentity", "sbc-ap.nRCellIdentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Restarted_Cell_List_item, { "EUTRAN-CGI", "sbc-ap.EUTRAN_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Restarted_Cell_List_NR_item, { "NR-CGI", "sbc-ap.NR_CGI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_ScheduledCellinEAI_item, { "ScheduledCellinEAI-Item", "sbc-ap.ScheduledCellinEAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_ScheduledCellinTAI_item, { "ScheduledCellinTAI-Item", "sbc-ap.ScheduledCellinTAI_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_ScheduledCellinTAI_5GS_item, { "ScheduledCellinTAI-5GS item", "sbc-ap.ScheduledCellinTAI_5GS_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_TAI_Broadcast_List_item, { "TAI-Broadcast-List-Item", "sbc-ap.TAI_Broadcast_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAI, { "tAI", "sbc-ap.tAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_scheduledCellinTAI, { "scheduledCellinTAI", "sbc-ap.scheduledCellinTAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_TAI_Broadcast_List_5GS_item, { "TAI-Broadcast-List-5GS item", "sbc-ap.TAI_Broadcast_List_5GS_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAI_5GS, { "tAI-5GS", "sbc-ap.tAI_5GS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_scheduledCellinTAI_5GS, { "scheduledCellinTAI-5GS", "sbc-ap.scheduledCellinTAI_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_TAI_Cancelled_List_item, { "TAI-Cancelled-List-Item", "sbc-ap.TAI_Cancelled_List_Item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cancelledCellinTAI, { "cancelledCellinTAI", "sbc-ap.cancelledCellinTAI", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_TAI_Cancelled_List_5GS_item, { "TAI-Cancelled-List-5GS item", "sbc-ap.TAI_Cancelled_List_5GS_item_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cancelledCellinTAI_5GS, { "cancelledCellinTAI-5GS", "sbc-ap.cancelledCellinTAI_5GS", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_TAI_List_for_Warning_item, { "TAI", "sbc-ap.TAI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAC, { "tAC", "sbc-ap.tAC", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAC_5GS, { "tAC-5GS", "sbc-ap.tAC_5GS", FT_UINT24, BASE_DEC_HEX, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_Unknown_5GS_Tracking_Area_List_item, { "TAI-5GS", "sbc-ap.TAI_5GS_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_cell_ID_List, { "cell-ID-List", "sbc-ap.cell_ID_List", FT_UINT32, BASE_DEC, NULL, 0, "ECGIList", HFILL }}, { &hf_sbc_ap_tracking_Area_List_for_Warning, { "tracking-Area-List-for-Warning", "sbc-ap.tracking_Area_List_for_Warning", FT_UINT32, BASE_DEC, NULL, 0, "TAI_List_for_Warning", HFILL }}, { &hf_sbc_ap_emergency_Area_ID_List, { "emergency-Area-ID-List", "sbc-ap.emergency_Area_ID_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_nR_CGIList, { "nR-CGIList", "sbc-ap.nR_CGIList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_tAIList_5GS, { "tAIList-5GS", "sbc-ap.tAIList_5GS_element", FT_NONE, BASE_NONE, NULL, 0, "TAI_5GS", HFILL }}, { &hf_sbc_ap_emergencyAreaIDList, { "emergencyAreaIDList", "sbc-ap.emergencyAreaIDList", FT_UINT32, BASE_DEC, NULL, 0, "Emergency_Area_ID_List", HFILL }}, { &hf_sbc_ap_protocolIEs, { "protocolIEs", "sbc-ap.protocolIEs", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolIE_Container", HFILL }}, { &hf_sbc_ap_protocolExtensions, { "protocolExtensions", "sbc-ap.protocolExtensions", FT_UINT32, BASE_DEC, NULL, 0, "ProtocolExtensionContainer", HFILL }}, { &hf_sbc_ap_initiatingMessage, { "initiatingMessage", "sbc-ap.initiatingMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_successfulOutcome, { "successfulOutcome", "sbc-ap.successfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_unsuccessfulOutcome, { "unsuccessfulOutcome", "sbc-ap.unsuccessfulOutcome_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sbc_ap_initiatingMessagevalue, { "value", "sbc-ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "InitiatingMessage_value", HFILL }}, { &hf_sbc_ap_successfulOutcome_value, { "value", "sbc-ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "SuccessfulOutcome_value", HFILL }}, { &hf_sbc_ap_unsuccessfulOutcome_value, { "value", "sbc-ap.value_element", FT_NONE, BASE_NONE, NULL, 0, "UnsuccessfulOutcome_value", HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_sbc_ap, &ett_sbc_ap_Serial_Number, &ett_sbc_ap_Warning_Type, &ett_sbc_ap_Data_Coding_Scheme, &ett_sbc_ap_Warning_Message_Contents, &ett_sbc_ap_ProtocolIE_Container, &ett_sbc_ap_ProtocolIE_Field, &ett_sbc_ap_ProtocolExtensionContainer, &ett_sbc_ap_ProtocolExtensionField, &ett_sbc_ap_Broadcast_Scheduled_Area_List, &ett_sbc_ap_Broadcast_Scheduled_Area_List_5GS, &ett_sbc_ap_Broadcast_Cancelled_Area_List, &ett_sbc_ap_Broadcast_Cancelled_Area_List_5GS, &ett_sbc_ap_Broadcast_Empty_Area_List, &ett_sbc_ap_Broadcast_Empty_Area_List_5GS, &ett_sbc_ap_CancelledCellinEAI, &ett_sbc_ap_CancelledCellinEAI_Item, &ett_sbc_ap_CancelledCellinTAI, &ett_sbc_ap_CancelledCellinTAI_Item, &ett_sbc_ap_CancelledCellinTAI_5GS, &ett_sbc_ap_CancelledCellinTAI_5GS_item, &ett_sbc_ap_CellId_Broadcast_List, &ett_sbc_ap_CellId_Broadcast_List_Item, &ett_sbc_ap_CellId_Broadcast_List_5GS, &ett_sbc_ap_CellId_Broadcast_List_5GS_item, &ett_sbc_ap_CellID_Cancelled_List, &ett_sbc_ap_CellID_Cancelled_Item, &ett_sbc_ap_CellID_Cancelled_List_5GS, &ett_sbc_ap_CellID_Cancelled_List_5GS_item, &ett_sbc_ap_Criticality_Diagnostics, &ett_sbc_ap_CriticalityDiagnostics_IE_List, &ett_sbc_ap_CriticalityDiagnostics_IE_List_item, &ett_sbc_ap_ECGIList, &ett_sbc_ap_Emergency_Area_ID_List, &ett_sbc_ap_EmergencyAreaID_Broadcast_List, &ett_sbc_ap_EmergencyAreaID_Broadcast_List_Item, &ett_sbc_ap_EmergencyAreaID_Cancelled_List, &ett_sbc_ap_EmergencyAreaID_Cancelled_Item, &ett_sbc_ap_EUTRAN_CGI, &ett_sbc_ap_ENB_ID, &ett_sbc_ap_Failed_Cell_List, &ett_sbc_ap_Failed_Cell_List_NR, &ett_sbc_ap_Global_ENB_ID, &ett_sbc_ap_Global_RAN_Node_ID, &ett_sbc_ap_Global_GNB_ID, &ett_sbc_ap_GNB_ID, &ett_sbc_ap_Global_NgENB_ID, &ett_sbc_ap_List_of_TAIs, &ett_sbc_ap_List_of_TAIs_item, &ett_sbc_ap_List_of_TAIs_Restart, &ett_sbc_ap_List_of_TAIs_Restart_item, &ett_sbc_ap_List_of_EAIs_Restart, &ett_sbc_ap_List_of_5GS_TAIs, &ett_sbc_ap_List_of_5GS_TAI_for_Restart, &ett_sbc_ap_NR_CGIList, &ett_sbc_ap_NR_CGI, &ett_sbc_ap_Restarted_Cell_List, &ett_sbc_ap_Restarted_Cell_List_NR, &ett_sbc_ap_ScheduledCellinEAI, &ett_sbc_ap_ScheduledCellinEAI_Item, &ett_sbc_ap_ScheduledCellinTAI, &ett_sbc_ap_ScheduledCellinTAI_Item, &ett_sbc_ap_ScheduledCellinTAI_5GS, &ett_sbc_ap_ScheduledCellinTAI_5GS_item, &ett_sbc_ap_TAI_Broadcast_List, &ett_sbc_ap_TAI_Broadcast_List_Item, &ett_sbc_ap_TAI_Broadcast_List_5GS, &ett_sbc_ap_TAI_Broadcast_List_5GS_item, &ett_sbc_ap_TAI_Cancelled_List, &ett_sbc_ap_TAI_Cancelled_List_Item, &ett_sbc_ap_TAI_Cancelled_List_5GS, &ett_sbc_ap_TAI_Cancelled_List_5GS_item, &ett_sbc_ap_TAI_List_for_Warning, &ett_sbc_ap_TAI, &ett_sbc_ap_TAI_5GS, &ett_sbc_ap_Unknown_5GS_Tracking_Area_List, &ett_sbc_ap_Warning_Area_List, &ett_sbc_ap_Warning_Area_List_5GS, &ett_sbc_ap_Write_Replace_Warning_Request, &ett_sbc_ap_Write_Replace_Warning_Response, &ett_sbc_ap_Stop_Warning_Request, &ett_sbc_ap_Stop_Warning_Response, &ett_sbc_ap_Write_Replace_Warning_Indication, &ett_sbc_ap_Stop_Warning_Indication, &ett_sbc_ap_PWS_Restart_Indication, &ett_sbc_ap_PWS_Failure_Indication, &ett_sbc_ap_Error_Indication, &ett_sbc_ap_SBC_AP_PDU, &ett_sbc_ap_InitiatingMessage, &ett_sbc_ap_SuccessfulOutcome, &ett_sbc_ap_UnsuccessfulOutcome, }; /* Register protocol */ proto_sbc_ap = proto_register_protocol(PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array(proto_sbc_ap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register dissector */ sbc_ap_handle = register_dissector(PFNAME, dissect_sbc_ap, proto_sbc_ap); /* Register dissector tables */ sbc_ap_ies_dissector_table = register_dissector_table("sbc_ap.ies", "SBC-AP-PROTOCOL-IES", proto_sbc_ap, FT_UINT32, BASE_DEC); sbc_ap_extension_dissector_table = register_dissector_table("sbc_ap.extension", "SBC-AP-PROTOCOL-EXTENSION", proto_sbc_ap, FT_UINT32, BASE_DEC); sbc_ap_proc_imsg_dissector_table = register_dissector_table("sbc_ap.proc.imsg", "SBC-AP-ELEMENTARY-PROCEDURE InitiatingMessage", proto_sbc_ap, FT_UINT32, BASE_DEC); sbc_ap_proc_sout_dissector_table = register_dissector_table("sbc_ap.proc.sout", "SBC-AP-ELEMENTARY-PROCEDURE SuccessfulOutcome", proto_sbc_ap, FT_UINT32, BASE_DEC); sbc_ap_proc_uout_dissector_table = register_dissector_table("sbc_ap.proc.uout", "SBC-AP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_sbc_ap, FT_UINT32, BASE_DEC); } /*--- proto_reg_handoff_sbc_ap ---------------------------------------*/ void proto_reg_handoff_sbc_ap(void) { static gboolean inited = FALSE; static guint SctpPort; if( !inited ) { dissector_add_uint("sctp.ppi", SBC_AP_PAYLOAD_PROTOCOL_ID, sbc_ap_handle); inited = TRUE; dissector_add_uint("sbc_ap.ies", id_Cause, create_dissector_handle(dissect_Cause_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Criticality_Diagnostics, create_dissector_handle(dissect_Criticality_Diagnostics_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Data_Coding_Scheme, create_dissector_handle(dissect_Data_Coding_Scheme_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Message_Identifier, create_dissector_handle(dissect_Message_Identifier_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Number_of_Broadcasts_Requested, create_dissector_handle(dissect_Number_of_Broadcasts_Requested_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Repetition_Period, create_dissector_handle(dissect_Repetition_Period_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Serial_Number, create_dissector_handle(dissect_Serial_Number_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_List_of_TAIs, create_dissector_handle(dissect_List_of_TAIs_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Warning_Area_List, create_dissector_handle(dissect_Warning_Area_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Warning_Message_Content, create_dissector_handle(dissect_Warning_Message_Content_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Warning_Security_Information, create_dissector_handle(dissect_Warning_Security_Information_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Warning_Type, create_dissector_handle(dissect_Warning_Type_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Omc_Id, create_dissector_handle(dissect_Omc_Id_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Concurrent_Warning_Message_Indicator, create_dissector_handle(dissect_Concurrent_Warning_Message_Indicator_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Extended_Repetition_Period, create_dissector_handle(dissect_Extended_Repetition_Period_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Unknown_Tracking_Area_List, create_dissector_handle(dissect_List_of_TAIs_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Broadcast_Scheduled_Area_List, create_dissector_handle(dissect_Broadcast_Scheduled_Area_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Send_Write_Replace_Warning_Indication, create_dissector_handle(dissect_Send_Write_Replace_Warning_Indication_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Broadcast_Cancelled_Area_List, create_dissector_handle(dissect_Broadcast_Cancelled_Area_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Send_Stop_Warning_Indication, create_dissector_handle(dissect_Send_Stop_Warning_Indication_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Stop_All_Indicator, create_dissector_handle(dissect_Stop_All_Indicator_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Global_ENB_ID, create_dissector_handle(dissect_Global_ENB_ID_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Broadcast_Empty_Area_List, create_dissector_handle(dissect_Broadcast_Empty_Area_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Restarted_Cell_List, create_dissector_handle(dissect_Restarted_Cell_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_List_of_TAIs_Restart, create_dissector_handle(dissect_List_of_TAIs_Restart_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_List_of_EAIs_Restart, create_dissector_handle(dissect_List_of_EAIs_Restart_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Failed_Cell_List, create_dissector_handle(dissect_Failed_Cell_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_List_of_5GS_TAIs, create_dissector_handle(dissect_List_of_5GS_TAIs_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Warning_Area_List_5GS, create_dissector_handle(dissect_Warning_Area_List_5GS_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Global_RAN_Node_ID, create_dissector_handle(dissect_Global_RAN_Node_ID_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Global_GNB_ID, create_dissector_handle(dissect_Global_GNB_ID_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_RAT_Selector_5GS, create_dissector_handle(dissect_RAT_Selector_5GS_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Unknown_5GS_Tracking_Area_List, create_dissector_handle(dissect_Unknown_5GS_Tracking_Area_List_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Broadcast_Scheduled_Area_List_5GS, create_dissector_handle(dissect_Broadcast_Scheduled_Area_List_5GS_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Broadcast_Cancelled_Area_List_5GS, create_dissector_handle(dissect_Broadcast_Cancelled_Area_List_5GS_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Broadcast_Empty_Area_List_5GS, create_dissector_handle(dissect_Broadcast_Empty_Area_List_5GS_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Restarted_Cell_List_NR, create_dissector_handle(dissect_Restarted_Cell_List_NR_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_Failed_Cell_List_NR, create_dissector_handle(dissect_Failed_Cell_List_NR_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.extension", id_List_of_5GS_TAI_for_Restart, create_dissector_handle(dissect_List_of_5GS_TAI_for_Restart_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.ies", id_Warning_Area_Coordinates, create_dissector_handle(dissect_Warning_Area_Coordinates_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_Write_Replace_Warning, create_dissector_handle(dissect_Write_Replace_Warning_Request_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.sout", id_Write_Replace_Warning, create_dissector_handle(dissect_Write_Replace_Warning_Response_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_Stop_Warning, create_dissector_handle(dissect_Stop_Warning_Request_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.sout", id_Stop_Warning, create_dissector_handle(dissect_Stop_Warning_Response_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_Error_Indication, create_dissector_handle(dissect_Error_Indication_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_Write_Replace_Warning_Indication, create_dissector_handle(dissect_Write_Replace_Warning_Indication_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_Stop_Warning_Indication, create_dissector_handle(dissect_Stop_Warning_Indication_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_PWS_Restart_Indication, create_dissector_handle(dissect_PWS_Restart_Indication_PDU, proto_sbc_ap)); dissector_add_uint("sbc_ap.proc.imsg", id_PWS_Failure_Indication, create_dissector_handle(dissect_PWS_Failure_Indication_PDU, proto_sbc_ap)); } else { if (SctpPort != 0) { dissector_delete_uint("sctp.port", SctpPort, sbc_ap_handle); } } SctpPort = global_sbc_ap_port; if (SctpPort != 0) { dissector_add_uint("sctp.port", SctpPort, sbc_ap_handle); } } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sbc.c
/* packet-sbc.c * Routines for Bluetooth SBC dissection * * Copyright 2012, Michal Labedzki for Tieto Corporation * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include "packet-btavdtp.h" #define CHANNELS_MONO 0x00 #define CHANNELS_DUAL_CHANNEL 0x01 #define CHANNELS_JOINT_STEREO 0x03 #define FREQUENCY_16000 0x00 #define FREQUENCY_32000 0x01 #define FREQUENCY_44100 0x02 #define FREQUENCY_48000 0x03 void proto_register_sbc(void); static int proto_sbc = -1; static int hf_sbc_fragmented = -1; static int hf_sbc_starting_packet = -1; static int hf_sbc_last_packet = -1; static int hf_sbc_rfa = -1; static int hf_sbc_number_of_frames = -1; static int hf_sbc_syncword = -1; static int hf_sbc_sampling_frequency = -1; static int hf_sbc_blocks = -1; static int hf_sbc_channel_mode = -1; static int hf_sbc_allocation_method = -1; static int hf_sbc_subbands = -1; static int hf_sbc_bitpool = -1; static int hf_sbc_crc_check = -1; static int hf_sbc_expected_data_speed = -1; static int hf_sbc_frame_duration = -1; static int hf_sbc_cumulative_frame_duration = -1; static int hf_sbc_delta_time = -1; static int hf_sbc_delta_time_from_the_beginning = -1; static int hf_sbc_cumulative_duration = -1; static int hf_sbc_avrcp_song_position = -1; static int hf_sbc_diff = -1; static int hf_sbc_data = -1; static gint ett_sbc = -1; static gint ett_sbc_list = -1; static expert_field ei_sbc_syncword = EI_INIT; extern value_string_ext media_codec_audio_type_vals_ext; static const value_string sampling_frequency_vals[] = { { 0x00, "16 kHz"}, { 0x01, "32 kHz"}, { 0x02, "44.1 kHz"}, { 0x03, "48 kHz"}, { 0, NULL } }; static const value_string blocks_vals[] = { { 0x00, "4"}, { 0x01, "8"}, { 0x02, "12"}, { 0x03, "16"}, { 0, NULL } }; static const value_string channel_mode_vals[] = { { 0x00, "Mono"}, { 0x01, "Dual Channel"}, { 0x02, "Stereo"}, { 0x03, "Joint Stereo"}, { 0, NULL } }; static const value_string allocation_method_vals[] = { { 0x00, "Loudness"}, { 0x01, "SNR"}, { 0, NULL } }; static const value_string subbands_vals[] = { { 0x00, "4"}, { 0x01, "8"}, { 0, NULL } }; static gint dissect_sbc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *ti; proto_tree *sbc_tree; proto_item *pitem; proto_tree *rtree; gint offset = 0; guint8 number_of_frames; guint8 syncword; guint8 byte; guint8 blocks; guint8 channels; guint8 subbands; guint8 bitpool; guint frequency; guint8 sbc_blocks; gint sbc_channels; guint8 sbc_subbands; gint val; gint counter = 1; gint frame_length; gint expected_speed_data; gdouble frame_duration; gdouble cumulative_frame_duration = 0; bta2dp_codec_info_t *info; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SBC"); info = (bta2dp_codec_info_t *) data; ti = proto_tree_add_item(tree, proto_sbc, tvb, offset, -1, ENC_NA); sbc_tree = proto_item_add_subtree(ti, ett_sbc); proto_tree_add_item(sbc_tree, hf_sbc_fragmented, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbc_tree, hf_sbc_starting_packet, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbc_tree, hf_sbc_last_packet, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbc_tree, hf_sbc_rfa, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbc_tree, hf_sbc_number_of_frames, tvb, offset, 1, ENC_BIG_ENDIAN); number_of_frames = tvb_get_guint8(tvb, offset) & 0x0F; offset += 1; while (tvb_reported_length_remaining(tvb, offset) > 0) { byte = tvb_get_guint8(tvb, offset + 1); frequency = (byte & 0xC0) >> 6; blocks = (byte & 0x30) >> 4; channels = (byte & 0x0C)>> 2; subbands = byte & 0x01; bitpool = tvb_get_guint8(tvb, offset + 2); if (channels == CHANNELS_MONO) sbc_channels = 1; else sbc_channels = 2; switch (frequency) { case FREQUENCY_16000: frequency = 16000; break; case FREQUENCY_32000: frequency = 32000; break; case FREQUENCY_44100: frequency = 44100; break; case FREQUENCY_48000: frequency = 48000; break; default: frequency = 0; } sbc_subbands = 4 * (subbands + 1); sbc_blocks = 4 * (blocks + 1); frame_length = (4 * sbc_subbands * sbc_channels) / 8; if (sbc_channels == 1 || channels == CHANNELS_DUAL_CHANNEL) val = sbc_blocks * sbc_channels * bitpool; else val = (((channels == CHANNELS_JOINT_STEREO) ? 1 : 0) * sbc_subbands + sbc_blocks * bitpool); frame_length += val / 8; if (val % 8) frame_length += 1; expected_speed_data = (frame_length * frequency) / (sbc_subbands * sbc_blocks); rtree = proto_tree_add_subtree_format(sbc_tree, tvb, offset, 4 + frame_length, ett_sbc_list, NULL, "Frame: %3u/%3u", counter, number_of_frames); pitem = proto_tree_add_item(rtree, hf_sbc_syncword, tvb, offset, 1, ENC_BIG_ENDIAN); syncword = tvb_get_guint8(tvb, offset); if (syncword != 0x9C) { expert_add_info(pinfo, pitem, &ei_sbc_syncword); } offset += 1; proto_tree_add_item(rtree, hf_sbc_sampling_frequency, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rtree, hf_sbc_blocks, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rtree, hf_sbc_channel_mode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rtree, hf_sbc_allocation_method, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rtree, hf_sbc_subbands, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtree, hf_sbc_bitpool, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtree, hf_sbc_crc_check, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rtree, hf_sbc_data, tvb, offset, frame_length, ENC_NA); offset += frame_length; /* TODO: expert_info for invalid CRC */ pitem = proto_tree_add_uint(rtree, hf_sbc_expected_data_speed, tvb, offset, 0, expected_speed_data / 1024); proto_item_set_generated(pitem); frame_duration = (((double) frame_length / (double) expected_speed_data) * 1000.0); cumulative_frame_duration += frame_duration; pitem = proto_tree_add_double(rtree, hf_sbc_frame_duration, tvb, offset, 0, frame_duration); proto_item_set_generated(pitem); counter += 1; } pitem = proto_tree_add_double(sbc_tree, hf_sbc_cumulative_frame_duration, tvb, offset, 0, cumulative_frame_duration); proto_item_set_generated(pitem); if (info && info->configuration && info->configuration_length > 0) { /* TODO: display current codec configuration */ } if (info && info->previous_media_packet_info && info->current_media_packet_info) { nstime_t delta; nstime_delta(&delta, &pinfo->abs_ts, &info->previous_media_packet_info->abs_ts); pitem = proto_tree_add_double(sbc_tree, hf_sbc_delta_time, tvb, offset, 0, nstime_to_msec(&delta)); proto_item_set_generated(pitem); pitem = proto_tree_add_double(sbc_tree, hf_sbc_avrcp_song_position, tvb, offset, 0, info->previous_media_packet_info->avrcp_song_position); proto_item_set_generated(pitem); nstime_delta(&delta, &pinfo->abs_ts, &info->previous_media_packet_info->first_abs_ts); pitem = proto_tree_add_double(sbc_tree, hf_sbc_delta_time_from_the_beginning, tvb, offset, 0, nstime_to_msec(&delta)); proto_item_set_generated(pitem); if (!pinfo->fd->visited) { info->current_media_packet_info->cumulative_frame_duration += cumulative_frame_duration; info->current_media_packet_info->avrcp_song_position += cumulative_frame_duration; } pitem = proto_tree_add_double(sbc_tree, hf_sbc_cumulative_duration, tvb, offset, 0, info->previous_media_packet_info->cumulative_frame_duration); proto_item_set_generated(pitem); pitem = proto_tree_add_double(sbc_tree, hf_sbc_diff, tvb, offset, 0, info->previous_media_packet_info->cumulative_frame_duration - nstime_to_msec(&delta)); proto_item_set_generated(pitem); } /* TODO: more precise dissection: blocks, channels, subbands, padding */ col_append_fstr(pinfo->cinfo, COL_INFO, " Frames=%u", number_of_frames); return offset; } void proto_register_sbc(void) { module_t *module; expert_module_t* expert_sbc; static hf_register_info hf[] = { { &hf_sbc_fragmented, { "Fragmented", "sbc.fragmented", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_sbc_starting_packet, { "Starting Packet", "sbc.starting_packet", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_sbc_last_packet, { "Last Packet", "sbc.last_packet", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_sbc_rfa, { "RFA", "sbc.rfa", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_sbc_number_of_frames, { "Number of Frames", "sbc.number_of_frames", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_sbc_syncword, { "Sync Word", "sbc.syncword", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_sbc_sampling_frequency, { "Sampling Frequency", "sbc.sampling_frequency", FT_UINT8, BASE_HEX, VALS(sampling_frequency_vals), 0xC0, NULL, HFILL } }, { &hf_sbc_blocks, { "Blocks", "sbc.blocks", FT_UINT8, BASE_HEX, VALS(blocks_vals), 0x30, NULL, HFILL } }, { &hf_sbc_channel_mode, { "Channel Mode", "sbc.channel_mode", FT_UINT8, BASE_HEX, VALS(channel_mode_vals), 0x0C, NULL, HFILL } }, { &hf_sbc_allocation_method, { "Allocation Method", "sbc.allocation_method", FT_UINT8, BASE_HEX, VALS(allocation_method_vals), 0x02, NULL, HFILL } }, { &hf_sbc_subbands, { "Subbands", "sbc.subbands", FT_UINT8, BASE_HEX, VALS(subbands_vals), 0x01, NULL, HFILL } }, { &hf_sbc_bitpool, { "Bitpool", "sbc.bitpool", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_sbc_crc_check, { "CRC Check", "sbc.crc_check", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_sbc_expected_data_speed, { "Expected data speed", "sbc.expected_speed_data", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_kibps, 0x00, NULL, HFILL } }, { &hf_sbc_frame_duration, { "Frame Duration", "sbc.frame_duration", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_cumulative_frame_duration, { "Cumulative Frame Duration", "sbc.cumulative_frame_duration", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_delta_time, { "Delta time", "sbc.delta_time", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_delta_time_from_the_beginning, { "Delta time from the beginning", "sbc.delta_time_from_the_beginning", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_cumulative_duration, { "Cumulative Music Duration", "sbc.cumulative_music_duration", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_avrcp_song_position, { "AVRCP Song Position", "sbc.avrcp_song_position", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_diff, { "Diff", "sbc.diff", FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_milliseconds, 0x00, NULL, HFILL } }, { &hf_sbc_data, { "Frame Data", "sbc.data", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, }; static gint *ett[] = { &ett_sbc, &ett_sbc_list, }; static ei_register_info ei[] = { { &ei_sbc_syncword, { "sbc.syncword.unexpected", PI_PROTOCOL, PI_WARN, "Unexpected syncword", EXPFILL }}, }; proto_sbc = proto_register_protocol("Bluetooth SBC Codec", "SBC", "sbc"); proto_register_field_array(proto_sbc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sbc = expert_register_protocol(proto_sbc); expert_register_field_array(expert_sbc, ei, array_length(ei)); register_dissector("sbc", dissect_sbc, proto_sbc); module = prefs_register_protocol_subtree("Bluetooth", proto_sbc, NULL); prefs_register_static_text_preference(module, "a2dp.version", "Bluetooth Audio Codec SBC version based on A2DP 1.3", "Version of codec supported by this dissector."); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sbus.c
/* packet-sbus.c * Routines for Ether-S-Bus dissection * Copyright 2010, Christian Durrer <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/expert.h> void proto_register_sbus(void); void proto_reg_handoff_sbus(void); #define SBUS_UDP_PORT 5050 /* Not IANA registered */ /* Attribute values*/ #define SBUS_REQUEST 0x00 #define SBUS_RESPONSE 0x01 #define SBUS_ACKNAK 0x02 /*SBus command codes*/ #define SBUS_RD_COUNTER 0x00 #define SBUS_RD_DISPLAY_REGISTER 0x01 #define SBUS_RD_FLAG 0x02 #define SBUS_RD_INPUT 0x03 #define SBUS_RD_RTC 0x04 #define SBUS_RD_OUTPUT 0x05 #define SBUS_RD_REGISTER 0x06 #define SBUS_RD_TIMER 0x07 #define SBUS_WR_COUNTER 0x0A #define SBUS_WR_FLAG 0x0B #define SBUS_WR_RTC 0x0C #define SBUS_WR_OUTPUT 0x0D #define SBUS_WR_REGISTER 0x0E #define SBUS_WR_TIMER 0x0F #define SBUS_RDWR_MULTI_MEDIAS 0x13 #define SBUS_RD_PCD_STATUS_CPU0 0x14 #define SBUS_RD_PCD_STATUS_CPU1 0x15 #define SBUS_RD_PCD_STATUS_CPU2 0x16 #define SBUS_RD_PCD_STATUS_CPU3 0x17 #define SBUS_RD_PCD_STATUS_CPU4 0x18 #define SBUS_RD_PCD_STATUS_CPU5 0x19 #define SBUS_RD_PCD_STATUS_CPU6 0x1A #define SBUS_RD_PCD_STATUS_OWN 0x1B #define SBUS_RD_SBUS_STN_NBR 0x1D #define SBUS_RD_USER_MEMORY 0x1E #define SBUS_RD_PROGRAM_LINE 0x1F #define SBUS_RD_PROGRAM_VERSION 0x20 #define SBUS_RD_TEXT 0x21 #define SBUS_RD_ACTIVE_TRANSITION 0x22 #define SBUS_WR_USER_MEMORY 0x23 #define SBUS_WR_PROGRAM_LINE 0x24 #define SBUS_WR_TEXT 0x25 #define SBUS_RUN_PROCEDURE_CPU0 0x28 #define SBUS_RUN_PROCEDURE_CPU1 0x29 #define SBUS_RUN_PROCEDURE_CPU2 0x2A #define SBUS_RUN_PROCEDURE_CPU3 0x2B #define SBUS_RUN_PROCEDURE_CPU4 0x2C #define SBUS_RUN_PROCEDURE_CPU5 0x2D #define SBUS_RUN_PROCEDURE_CPU6 0x2E #define SBUS_RUN_PROCEDURE_OWN 0x2F #define SBUS_RUN_PROCEDURE_ALL 0x30 #define SBUS_RESTART_COLD_CPU1 0x32 #define SBUS_RESTART_COLD_CPU2 0x33 #define SBUS_RESTART_COLD_CPU3 0x34 #define SBUS_RESTART_COLD_CPU4 0x35 #define SBUS_RESTART_COLD_CPU5 0x36 #define SBUS_RESTART_COLD_CPU6 0x37 #define SBUS_RESTART_COLD_OWN 0x38 #define SBUS_RESTART_COLD_ALL 0x39 #define SBUS_STOP_PROCEDURE_CPU0 0x3C #define SBUS_STOP_PROCEDURE_CPU1 0x3D #define SBUS_STOP_PROCEDURE_CPU2 0x3E #define SBUS_STOP_PROCEDURE_CPU3 0x3F #define SBUS_STOP_PROCEDURE_CPU4 0x40 #define SBUS_STOP_PROCEDURE_CPU5 0x41 #define SBUS_STOP_PROCEDURE_CPU6 0x42 #define SBUS_STOP_PROCEDURE_OWN 0x43 #define SBUS_STOP_PROCEDURE_ALL 0x44 #define SBUS_RD_STATUSFLAG_ACCU 0x46 #define SBUS_RD_BYTE 0x47 #define SBUS_RD_HALT_FAILURE_REG 0x48 #define SBUS_RD_INDEX_REGISTER 0x49 #define SBUS_RD_INSTRUCTION_POINTER 0x4A #define SBUS_FIND_HISTORY 0x4B #define SBUS_WR_STATUSFLAG_ACCU 0x50 #define SBUS_WR_BYTE 0x51 #define SBUS_WR_INDEX_REGISTER 0x52 #define SBUS_WR_INSTRUCTION_POINTER 0x53 #define SBUS_CLEAR_ALL 0x5A #define SBUS_CLEAR_FLAGS 0x5B #define SBUS_CLEAR_OUTPUTS 0x5C #define SBUS_CLEAR_REGISTERS 0x5D #define SBUS_CLEAR_TIMERS 0x5E #define SBUS_RESTART_WARM_CPU1 0x64 #define SBUS_RESTART_WARM_CPU2 0x65 #define SBUS_RESTART_WARM_CPU3 0x66 #define SBUS_RESTART_WARM_CPU4 0x67 #define SBUS_RESTART_WARM_CPU5 0x68 #define SBUS_RESTART_WARM_CPU6 0x69 #define SBUS_RESTART_WARM_OWN 0x6A #define SBUS_RESTART_WARM_ALL 0x6B #define SBUS_CHANGE_BLOCK 0x6E #define SBUS_CLEAR_HISTORY_FAILURE 0x6F #define SBUS_DELETE_PROGRAM_LINE 0x70 #define SBUS_GO_CONDITIONAL 0x71 #define SBUS_INSERT_PROGRAM_LINE 0x72 #define SBUS_LOCAL_CYCLE 0x73 #define SBUS_ALL_CYCLES 0x74 #define SBUS_MAKE_TEXT 0x75 #define SBUS_EXECUTE_SINGLE_INSTR 0x76 #define SBUS_SINGLE_STEP 0x77 #define SBUS_XOB_17_INTERRUPT 0x82 #define SBUS_XOB_18_INTERRUPT 0x83 #define SBUS_XOB_19_INTERRUPT 0x84 #define SBUS_RD_HANGUP_TIMEOUT 0x91 #define SBUS_RD_DATA_BLOCK 0x96 #define SBUS_WR_DATA_BLOCK 0x97 #define SBUS_MAKE_DATA_BLOCK 0x98 #define SBUS_CLEAR_DATA_BLOCK 0x99 #define SBUS_CLEAR_TEXT 0x9A #define SBUS_RD_BLOCK_ADDRESSES 0x9B #define SBUS_RD_BLOCK_SIZES 0x9C #define SBUS_RD_CURRENT_BLOCK 0x9D #define SBUS_RD_CALL_STACK 0x9E #define SBUS_RD_DBX 0x9F #define SBUS_RD_USER_EEPROM_REGISTER 0xA1 #define SBUS_WR_USER_EEPROM_REGISTER 0xA3 #define SBUS_ERASE_FLASH 0xA5 #define SBUS_RESTART_COLD_FLAG 0xA6 #define SBUS_WR_SYSTEM_BUFFER 0xA7 #define SBUS_RD_SYSTEM_BUFFER 0xA8 #define SBUS_RD_WR_PCD_BLOCK 0xA9 #define SBUS_GET_DIAGNOSTIC 0xAA #define SBUS_RD_SYSTEM_INFORMATION 0xAB #define SBUS_CHANGE_BLOCKS_ON_RUN 0xAC #define SBUS_FLASHCARD_TELEGRAM 0xAD #define SBUS_DOWNLOAD_FIRMWARE 0xAE #define SBUS_WEB_SERVER_SERIAL_COMM 0xAF /* Bitfield in the arithmetic flags and accu*/ #define F_ACCU (1<<0) /* Accumulator of PCD */ #define F_ERROR (1<<1) /* Error flag of PCD */ #define F_NEGATIVE (1<<2) /* Negative arithmetic status flag */ #define F_ZERO (1<<3) /* Zero arithmetic status flag */ /* Bitfield in the system information*/ /*#define F_EMPTY (1<<0) always 0 */ #define F_MEMSIZE (1<<1) /* Memory size information */ #define F_TRACE (1<<2) /* Trace buffer feature */ #define F_INFO_B1 (1<<3) /* EEPROM information of slot B1 */ #define F_INFO_B2 (1<<4) /* EEPROM information of slot B2 */ #define F_PGU_BAUD (1<<5) /* PGU baudrate can be switched */ /* Read/write block command codes*/ #define SBUS_WR_START_OF_STREAM 0x00 #define SBUS_WR_BLOCK_DATA_STREAM 0x01 #define SBUS_WR_BLOCK_END_OF_STREAM 0x02 #define SBUS_WR_ABORT_BLOCK_STREAM 0x07 #define SBUS_WR_BLOCK_DATA_BYTES 0x08 #define SBUS_RD_BLOCK_START_OF_STREAM 0X10 #define SBUS_RD_BLOCK_DATA_STREAM 0x11 #define SBUS_RD_ABORT_BLOCK_STREAM 0x17 #define SBUS_RD_BLOCK_DATA_BYTES 0x18 #define SBUS_DELETE_BLOCK 0x20 #define SBUS_GET_BLOCK_SIZE 0x21 #define SBUS_GET_PROGRAM_BLOCK_LIST 0x22 /* Read/write block types*/ #define SBUS_RD_WR_CONFIGURATION_FILE 0x20 #define SBUS_RD_WR_PROGRAM_BLOCK_FILE 0x21 #define SBUS_RD_WR_UNKNOWN_BLOCK_TYPE 0x83 /* Read/write block error codes*/ #define SBUS_RD_WR_NAK 0x80 #define SBUS_RD_WR_NAK_INVALID_SIZE 0x8A /* Initialize the protocol and registered fields */ static int proto_sbus = -1; static int hf_sbus_length = -1; static int hf_sbus_version = -1; static int hf_sbus_protocol = -1; static int hf_sbus_sequence = -1; static int hf_sbus_attribut = -1; static int hf_sbus_dest = -1; static int hf_sbus_address = -1; static int hf_sbus_command = -1; static int hf_sbus_command_extension = -1; static int hf_sbus_rcount = -1; static int hf_sbus_multimedia_length = -1; static int hf_sbus_sub_length = -1; static int hf_sbus_wcount = -1; static int hf_sbus_wcount_calculated = -1; static int hf_sbus_fio_count = -1; static int hf_sbus_addr_rtc = -1; static int hf_sbus_addr_iof = -1; static int hf_sbus_addr_db = -1; static int hf_sbus_addr_base_element = -1; static int hf_sbus_addr_eeprom = -1; static int hf_sbus_addr_prog = -1; static int hf_sbus_addr_68k = -1; static int hf_sbus_block_type = -1; static int hf_sbus_block_nr = -1; static int hf_sbus_nbr_elements = -1; static int hf_sbus_display_register = -1; static int hf_sbus_data_rtc = -1; static int hf_sbus_data_byte = -1; static int hf_sbus_data_byte_hex = -1; static int hf_sbus_data_iof = -1; static int hf_sbus_cpu_type = -1; static int hf_sbus_fw_version = -1; static int hf_sbus_sysinfo_nr = -1; static int hf_sbus_sysinfo0_1 = -1; static int hf_sbus_sysinfo0_2 = -1; static int hf_sbus_sysinfo0_3 = -1; static int hf_sbus_sysinfo0_4 = -1; static int hf_sbus_sysinfo0_5 = -1; static int hf_sbus_acknackcode = -1; static int hf_sbus_cpu_status = -1; static int hf_sbus_week_day = -1; static int hf_sbus_date = -1; static int hf_sbus_time = -1; static int hf_sbus_crc = -1; static int hf_sbus_crc_status = -1; static int hf_sbus_flags_accu = -1; static int hf_sbus_flags_error = -1; static int hf_sbus_flags_negative = -1; static int hf_sbus_flags_zero = -1; /* Web server telegram */ static int hf_sbus_web_size = -1; static int hf_sbus_web_aid = -1; static int hf_sbus_web_seq = -1; /* Read/Write block telegram*/ static int hf_sbus_rdwr_block_length = -1; static int hf_sbus_rdwr_block_length_ext = -1; static int hf_sbus_rdwr_telegram_type = -1; static int hf_sbus_rdwr_telegram_sequence = -1; static int hf_sbus_rdwr_block_size = -1; static int hf_sbus_rdwr_block_addr = -1; static int hf_sbus_rdwr_file_name = -1; static int hf_sbus_rdwr_list_type = -1; static int hf_sbus_rdwr_acknakcode = -1; /* Request-Response tracking */ static int hf_sbus_response_in = -1; static int hf_sbus_response_to = -1; static int hf_sbus_response_time = -1; static int hf_sbus_timeout = -1; static int hf_sbus_request_in = -1; /* Initialize the subtree pointers */ static gint ett_sbus = -1; static gint ett_sbus_ether = -1; static gint ett_sbus_data = -1; static expert_field ei_sbus_retry = EI_INIT; static expert_field ei_sbus_telegram_not_acked = EI_INIT; static expert_field ei_sbus_crc_bad = EI_INIT; static expert_field ei_sbus_telegram_not_implemented = EI_INIT; static expert_field ei_sbus_no_request_telegram = EI_INIT; /* True/False strings*/ static const true_false_string tfs_sbus_flags= { "Is high", "Is low" }; static const true_false_string tfs_sbus_present= { "Is present", "Is not present" }; /* value to string definitions*/ /* telegram types*/ static const value_string sbus_att_vals[] = { {0, "Request"}, {1, "Response"}, {2, "ACK/NAK"}, {0, NULL} }; /* Block types (6 and 7 corrected C. Durrer, 20.02.2019)*/ static const value_string sbus_block_types[] = { {0x00, "COB"}, /* Cyclic organization block */ {0x01, "XOB"}, /* Exception organization block */ {0x02, "PB"}, /* Program block */ {0x03, "FB"}, /* Function block */ {0x04, "ST"}, /* Step of Graftec structure*/ {0x05, "TR"}, /* Transition of Graftec structure*/ {0x06, "TEXT"}, /* Text*/ {0x07, "DB"}, /* Data Block*/ {0x08, "SB"}, /* Sequential Block (Graftec)*/ {0x09, "DBX"}, /* Special Data Block*/ {0x10, "BACnet"}, /* BACnet configuration block */ {0x11, "CANopen"}, /* CANopen configuration */ {0x12, "LONIP"}, /* LONIP configuration */ {0x20, "Configuration file"}, /* LONIP configuration */ {0x21, "Program block file"}, /* LONIP configuration */ {0xFE, "All configuration blocks"}, /* all configuration blocks (delete blocks only) */ {0xFF, "All blocks"}, /* all blocks (incl. program blocks) (delete blocks only) */ {0, NULL} }; static value_string_ext sbus_block_types_ext = VALUE_STRING_EXT_INIT(sbus_block_types); /* ACK NAK values*/ static const value_string sbus_CPU_status[] = { {0x43, "C"}, {0x44, "D"}, {0x48, "Halt"}, {0x52, "Run"}, {0x53, "Stop"}, {0x58, "X, Exceptional Intermediate Status (MODEMS+)"}, {0, NULL} }; /* CPU status*/ static const value_string sbus_ack_nak_vals[] = { {0, "ACK (Acknowledged)"}, {1, "NAK, no reason specified"}, {2, "NAK, because of password"}, {3, "NAK, PGU port is in reduced protocol"}, {4, "NAK, PGU port is already used"}, {0, NULL} }; /* S-Bus commands*/ static const value_string sbus_command_vals[] = { {0x00, "Read counter(s)"}, {0x01, "Read display register"}, {0x02, "Read flag(s)"}, {0x03, "Read input(s)"}, {0x04, "Read real time clock"}, {0x05, "Read output(s)"}, {0x06, "Read register(s)"}, {0x07, "Read timer(s)"}, {0x0A, "Write counter(s)"}, {0x0B, "Write flag(s)"}, {0x0C, "Write real time clock"}, {0x0D, "Write output(s)"}, {0x0E, "Write register(s)"}, {0x0F, "Write timer(s)"}, {0x13, "Read write multi-medias"}, {0x14, "Read PCD status, CPU 0"}, {0x15, "Read PCD status, CPU 1"}, {0x16, "Read PCD status, CPU 2"}, {0x17, "Read PCD status, CPU 3"}, {0x18, "Read PCD status, CPU 4"}, {0x19, "Read PCD status, CPU 5"}, {0x1A, "Read PCD status, CPU 6"}, {0x1B, "Read PCD status (own)"}, {0x1D, "Read S-Bus station number"}, {0x1E, "Read user memory*"}, {0x1F, "Read program line*"}, {0x20, "Read firmware version"}, {0x21, "Read text*"}, {0x22, "Read active transition*"}, {0x23, "Write user memory*"}, {0x24, "Write program line*"}, {0x25, "Write text*"}, {0x28, "Run procedure*, CPU 0"}, {0x29, "Run procedure*, CPU 1"}, {0x2A, "Run procedure*, CPU 2"}, {0x2B, "Run procedure*, CPU 3"}, {0x2C, "Run procedure*, CPU 4"}, {0x2D, "Run procedure*, CPU 5"}, {0x2E, "Run procedure*, CPU 6"}, {0x2F, "Run procedure* (own CPU)"}, {0x30, "Run procedure* (All CPUs)"}, {0x32, "Restart cold CPU 1*"}, {0x33, "Restart cold CPU 2*"}, {0x34, "Restart cold CPU 3*"}, {0x35, "Restart cold CPU 4*"}, {0x36, "Restart cold CPU 5*"}, {0x37, "Restart cold CPU 6*"}, {0x38, "Restart cold own CPU*"}, {0x39, "Restart cold all CPUs*"}, {0x3C, "Stop procedure*, CPU 0"}, {0x3D, "Stop procedure*, CPU 1"}, {0x3E, "Stop procedure*, CPU 2"}, {0x3F, "Stop procedure*, CPU 3"}, {0x40, "Stop procedure*, CPU 4"}, {0x41, "Stop procedure*, CPU 5"}, {0x42, "Stop procedure*, CPU 6"}, {0x43, "Stop procedure*, (own CPU)"}, {0x44, "Stop procedure*, (All CPUs)"}, {0x46, "Read arithmetic status and ACCU*"}, {0x47, "Read byte"}, {0x48, "Read halt failure register*"}, {0x49, "Read index register*"}, {0x4A, "Read instruction pointer*"}, {0x4B, "Find history*"}, {0x50, "Write arithmetic status and ACCU*"}, {0x51, "Write byte*"}, {0x52, "Write index register"}, {0x53, "Write instruction pointer*"}, {0x5A, "Clear all (F, O, R, T)*"}, {0x5B, "Clear flags*"}, {0x5C, "Clear outputs*"}, {0x5D, "Clear registers*"}, {0x5E, "Clear timers*"}, {0x64, "Restart warm CPU 1*"}, {0x65, "Restart warm CPU 2*"}, {0x66, "Restart warm CPU 3*"}, {0x67, "Restart warm CPU 4*"}, {0x68, "Restart warm CPU 5*"}, {0x69, "Restart warm CPU 6*"}, {0x6A, "Restart warm (own CPU)*"}, {0x6B, "Restart warm (All CPUs)*"}, {0x6E, "Change block*"}, {0x6F, "Clear history failure*"}, {0x70, "Delete program line*"}, {0x71, "Go conditional*"}, {0x72, "Insert program line*"}, {0x73, "Local cycles*"}, {0x74, "All cycles*"}, {0x75, "Make text*"}, {0x76, "Execute single instruction*"}, {0x77, "Single step*"}, {0x82, "XOB 17 interrupt"}, {0x83, "XOB 18 interrupt"}, {0x84, "XOB 19 interrupt"}, {0x91, "Read hangup timeout"}, {0x96, "Read data block"}, {0x97, "Write data block"}, {0x98, "Make data block*"}, {0x99, "Clear data block*"}, {0x9A, "Clear text*"}, {0x9B, "Read block address"}, {0x9C, "Read block sizes"}, {0x9D, "Read current block*"}, {0x9E, "Read call stack*"}, {0x9F, "Read DBX"}, {0xA1, "Read user EEPROM register"}, {0xA3, "Write user EEPROM register"}, {0xA5, "Erase flash*"}, {0xA6, "Restart cold flag*"}, {0xA7, "Write system buffer"}, {0xA8, "Read system buffer"}, {0xA9, "Read/write block data*"}, {0xAA, "Get diagnostic*"}, {0xAB, "Read system information*"}, {0xAC, "Changes blocks on run*"}, {0xAD, "Flashcard telegram*"}, {0xAE, "Download FW*"}, {0xAF, "Web server serial communication*"}, {0, NULL} }; static value_string_ext sbus_command_vals_ext = VALUE_STRING_EXT_INIT(sbus_command_vals); static const value_string webserver_aid_vals[] = { {0x01, "Partial request"}, {0x02, "Request end"}, {0x07, "Get Data"}, {0x10, "Transfer OK"}, {0x11, "Partial answer"}, {0x12, "Last part of answer"}, {0x13, "Server not ready"}, {0, NULL} }; static const value_string rdwrblock_vals[] = { {0x00, "WR block start of stream"}, {0x01, "WR block data stream"}, {0x02, "WR block end of stream"}, {0x07, "Abort block WR stream"}, {0x08, "WR block data"}, {0x10, "RD block start of stream"}, {0x11, "RD block data stream"}, {0x17, "Abort block RD stream"}, {0x18, "RD block data"}, {0x20, "Delete block"}, {0x21, "Get block size"}, {0x22, "Get program block list"}, {0, NULL} }; static value_string_ext rdwrblock_vals_ext = VALUE_STRING_EXT_INIT(rdwrblock_vals); static const value_string rdwrblock_sts[] = { {0x00, "ACK (Acknowledged)"}, {0x01, "Data"}, {0x02, "Busy"}, {0x03, "End of stream"}, {0x04, "Data EOF reached"}, {0x80, "NAK"}, {0x81, "NAK, unknown Tlg_Type"}, {0x82, "NAK, not supported Tlg_Type"}, {0x83, "NAK, unknown Block Type"}, {0x84, "NAK, out of sequence"}, {0x85, "NAK, not supported Block number"}, {0x86, "NAK, Block Size invalid (to big)"}, {0x87, "NAK, Block Address invalid"}, {0x88, "NAK, CRC invalid"}, {0x89, "NAK, invalid status"}, {0x8A, "NAK, invalid command size (w-count)"}, {0xFF, "Abort (stream)"}, {0, NULL} }; static value_string_ext rdwrblock_sts_ext = VALUE_STRING_EXT_INIT(rdwrblock_sts); static const value_string rdwrblock_list_type_vals[] = { {0x40, "Start request of program block"}, {0x41, "Get next program block"}, {0xFF, "Abort get list"}, {0, NULL} }; static const guint crc_table[] = { 0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef, 0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de, 0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,0xc5ac,0xd58d, 0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,0x46b4,0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc, 0x48c4,0x58e5,0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,0x9969,0xa90a,0xb92b, 0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a, 0x6ca6,0x7c87,0x4ce4,0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,0x8d68,0x9d49, 0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,0xff9f,0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78, 0x9188,0x81a9,0xb1ca,0xa1eb,0xd10c,0xc12d,0xf14e,0xe16f,0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,0x6067, 0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,0x02b1,0x1290,0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256, 0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,0xe54f,0xd52c,0xc50d,0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405, 0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,0x26d3,0x36f2,0x0691,0x16b0,0x6657,0x7676,0x4615,0x5634, 0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,0xb98a,0xa9ab,0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3, 0xcb7d,0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,0x4a75,0x5a54,0x6a37,0x7a16,0x0af1,0x1ad0,0x2ab3,0x3a92, 0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,0x8dc9,0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1, 0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0 }; /* Conversion values passing structure*/ typedef struct { guint32 conversation; /*Conversation ID*/ guint16 sequence; /*Sequence number of request telegram*/ } sbus_request_key; typedef struct { guint8 cmd_code; /*multimedia command code*/ guint8 count; /*rcount of sub-request*/ } sbus_subrequest; typedef struct { guint8 cmd_code; /*command code from request*/ guint8 count; /*rcount value*/ guint8 sysinfo; /*system information number*/ guint8 block_tlg; /*telegram type of RD/WR block telegrams*/ guint8 retry_count; /*number of retries*/ guint32 req_frame; /*frame number of last request*/ guint32 resp_frame; /*frame number of response*/ nstime_t req_time; /*time of the last request*/ guint8 mm_request_count; /*multi-media subrequest count*/ wmem_list_t *sbus_subrequests; /*list containing sub requests of multi-media request*/ } sbus_request_val; /* The hash structure (for conversations)*/ static wmem_map_t *sbus_request_hash = NULL; static guint crc_calc (guint crc, guint val) { int indx; guint ncrc; indx = (((crc >> 8) ^ val) & 0xff); ncrc = crc_table[indx] ^ ((crc << 8) & 0xffff); return ncrc; } /* Hash functions*/ static gint sbus_equal(gconstpointer v, gconstpointer w) { const sbus_request_key *v1 = (const sbus_request_key *)v; const sbus_request_key *v2 = (const sbus_request_key *)w; if (v1->conversation == v2->conversation && v1->sequence == v2->sequence) { return 1; } return 0; } static guint sbus_hash(gconstpointer v) { const sbus_request_key *key = (const sbus_request_key *)v; guint val; val = key->conversation + key->sequence; return val; } /* check whether the packet looks like SBUS or not */ static gboolean is_sbus_pdu(tvbuff_t *tvb) { guint32 length; /* we need at least 8 bytes to determine whether this is sbus or not*/ if(tvb_captured_length(tvb)<8){ return FALSE; } /* the length must be >= 8 bytes to accommodate the header, it also must be <65536 to fit inside a udp packet */ length=tvb_get_ntohl(tvb, 0); if ( (length<8) || (length>65535) ) { return FALSE; } if (tvb_reported_length(tvb) != length) { return FALSE; } /* First four byte indicate the length which must be at least 12 bytes*/ if (tvb_get_ntohl(tvb, 0) < 12) { return (FALSE); } /* Fifth byte indicates protocol version which can be 0 or 1*/ if (tvb_get_guint8(tvb, 4) > 0x01) { return (FALSE); } /* Sixth byte indicates protocol type and must be 0*/ if ( tvb_get_guint8(tvb, 5) > 0x01 ) { return (FALSE); } /* Seventh and eigth byte indicates the packet sequence number and can be 0 to 65565 (--> check does not make sense)*/ /* Ninth byte the "attributes character" and must be either 0, 1 or 2 (request, response or ACK/NAK)*/ if (tvb_get_guint8(tvb, 8) > 0x02 ) { return (FALSE); } return TRUE; } /*add the tree structure for one request media type to the tree*/ static gint add_media_access_to_tree(gint sbus_cmd_code, tvbuff_t *tvb, proto_tree *tree, gint offset) { gint i, j; gint sbus_media_cnt; proto_tree *sub_tree; guint8 sbus_fio_cnt; guint32 sbus_binaries; guint32 sbus_binarymasked; guint32 sbus_show_bin; guint32 sbus_helper; switch (sbus_cmd_code) { /*Read Counter, Register or Timer*/ case SBUS_RD_COUNTER: case SBUS_RD_REGISTER: case SBUS_RD_TIMER: sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; proto_tree_add_uint(tree, hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; proto_tree_add_item(tree, hf_sbus_addr_rtc, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; /*Read Flag, Input or Output*/ case SBUS_RD_FLAG: case SBUS_RD_INPUT: case SBUS_RD_OUTPUT: sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; proto_tree_add_uint(tree, hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; proto_tree_add_item(tree, hf_sbus_addr_iof, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; /*Write Register Timer Counter*/ case SBUS_WR_COUNTER: case SBUS_WR_REGISTER: case SBUS_WR_TIMER: sbus_media_cnt = (tvb_get_guint8(tvb,offset)); sbus_media_cnt = ((sbus_media_cnt - 1)/4); proto_tree_add_uint(tree, hf_sbus_wcount_calculated, tvb, offset, 1, sbus_media_cnt); proto_tree_add_item(tree, hf_sbus_wcount, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_sbus_addr_rtc, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*Add subtree for Data*/ sub_tree = proto_tree_add_subtree(tree, tvb, offset, ((sbus_media_cnt) * 4), ett_sbus_data, NULL, "Data"); for (i=((sbus_media_cnt)); i>0; i--) { proto_tree_add_item(sub_tree, hf_sbus_data_rtc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } break; /* Write flags and outputs*/ case SBUS_WR_FLAG: case SBUS_WR_OUTPUT: sbus_media_cnt = (tvb_get_guint8(tvb,offset)); sbus_media_cnt = (sbus_media_cnt - 2); proto_tree_add_uint(tree, hf_sbus_wcount_calculated, tvb, offset, 1, sbus_media_cnt); proto_tree_add_item(tree, hf_sbus_wcount, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_sbus_addr_iof, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; sbus_fio_cnt = (tvb_get_guint8(tvb,offset)); sbus_fio_cnt = ((sbus_fio_cnt + 1)); proto_tree_add_uint(tree, hf_sbus_fio_count, tvb, offset, 1, sbus_fio_cnt); offset += 1; /*Add subtree for Data*/ sub_tree = proto_tree_add_subtree(tree, tvb, offset, sbus_media_cnt, ett_sbus_data, NULL, "Data"); for (i=sbus_media_cnt; i>0; i--) { sbus_helper = 1; sbus_show_bin = 0; sbus_binarymasked = 0x01; sbus_binaries = tvb_get_guint8(tvb, offset); for (j=0; j<8; j++) { if ((sbus_binarymasked & sbus_binaries) != 0) { sbus_show_bin = (sbus_show_bin + sbus_helper); } sbus_binarymasked = sbus_binarymasked<<1; sbus_helper = 10 * sbus_helper; } proto_tree_add_uint_format(sub_tree, hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin, "Binary data: %08u", sbus_show_bin); offset += 1; } break; case SBUS_RD_DATA_BLOCK: sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; proto_tree_add_uint(tree, hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; proto_tree_add_item(tree, hf_sbus_addr_db, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /*add base element address*/ proto_tree_add_item(tree, hf_sbus_addr_base_element, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; } return offset; } /*add the tree structure for one response media type to the tree*/ static gint add_media_response_to_tree(gint cmd_code, gint count, tvbuff_t *tvb, proto_tree *tree, gint offset) { gint i, j; proto_tree *sub_tree; guint32 sbus_binaries; guint32 sbus_binarymasked; guint32 sbus_show_bin; guint32 sbus_helper; switch (cmd_code) { /*Add subtree for Data*/ case SBUS_RD_COUNTER: case SBUS_RD_REGISTER: case SBUS_RD_TIMER: case SBUS_RD_USER_MEMORY: case SBUS_RD_PROGRAM_LINE: case SBUS_RD_USER_EEPROM_REGISTER: case SBUS_RD_DATA_BLOCK: sub_tree = proto_tree_add_subtree(tree, tvb, offset, (count * 4), ett_sbus_data, NULL, "Data"); for (i=count; i>0; i--) { proto_tree_add_item(sub_tree, hf_sbus_data_rtc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } break; /* Add binary data I, O, F*/ case SBUS_RD_FLAG: case SBUS_RD_INPUT: case SBUS_RD_OUTPUT: /*Add subtree for Data*/ sub_tree = proto_tree_add_subtree(tree, tvb, offset, (((count) + 7) / 8), ett_sbus_data, NULL, "Data"); for (i=(((count) + 7) / 8); i>0; i--) { sbus_helper = 1; sbus_show_bin = 0; sbus_binarymasked = 0x01; sbus_binaries = tvb_get_guint8(tvb, offset); for (j=0; j<8; j++){ if ((sbus_binarymasked & sbus_binaries) != 0) { sbus_show_bin = (sbus_show_bin + sbus_helper); } sbus_binarymasked = sbus_binarymasked<<1; sbus_helper = 10 * sbus_helper; } proto_tree_add_uint_format(sub_tree, hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin, "Binary data: %08u", sbus_show_bin); offset += 1; } break; } return offset; } static gint get_response_length(gint cmd_code, gint count) { gint length; length = 0; switch (cmd_code) { /*Get length of 32 bit data*/ case SBUS_RD_COUNTER: case SBUS_RD_REGISTER: case SBUS_RD_TIMER: case SBUS_RD_USER_MEMORY: case SBUS_RD_PROGRAM_LINE: case SBUS_RD_USER_EEPROM_REGISTER: case SBUS_RD_DATA_BLOCK: length = count * 4; break; /* Get length of binary data I, O, F*/ case SBUS_RD_FLAG: case SBUS_RD_INPUT: case SBUS_RD_OUTPUT: length = ((count) + 7) / 8; break; } return length; } static gint add_sbus_subrequest(tvbuff_t *tvb, wmem_list_t *request_list, gint offset) { /*append subrequest info to requests lists and return number of sub-requests*/ gint subrequest_count; gint internal_wcount; gint internal_subwcount; gint internal_offset; gint internal_last_offset; internal_offset = offset; subrequest_count = 0; internal_wcount = tvb_get_guint8(tvb,internal_offset); internal_last_offset = internal_wcount + offset + 1; /*check for new sub requests until this end offset*/ for(gint i=0; i < 64; i +=1){ /*max sub-requests number is 64*/ if (internal_last_offset > internal_offset) { sbus_subrequest *sub_req; sub_req = wmem_new(wmem_file_scope(), sbus_subrequest); internal_offset += 1; /*move to the next sub-request wcount*/ internal_subwcount = tvb_get_guint8(tvb,internal_offset); internal_offset += 1; sub_req->cmd_code = tvb_get_guint8(tvb,internal_offset); internal_offset += 1; sub_req->count = tvb_get_guint8(tvb,internal_offset) + 1; internal_offset += internal_subwcount -1; subrequest_count += 1; wmem_list_append(request_list, sub_req); } } return subrequest_count; } /*Dissect the telegram*/ static int dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti, *hi; proto_tree *sbus_tree, *ethsbus_tree, *sbusdata_tree, *sbus_multimedia_tree; gint i; /*for CRC calculation*/ gint offset; gint sbus_end_multimedia; gint sbus_eth_len; guint sbus_crc_calc; guint8 sbus_attribut; guint8 sbus_media_cnt; sbus_subrequest *mm_sub_req; wmem_list_frame_t *frame; guint8 sbus_multimedia_total; guint8 sbus_multimedia_cnt; guint8 sbus_multimedia_cmd; guint8 sbus_multimedia_att; guint8 sbus_multimedia_bytes; guint8 sbus_cmd_code; guint8 sbus_web_size; guint8 sbus_web_aid; guint8 sbus_web_seq; guint8 sbus_rdwr_type; guint8 sbus_rdwr_sequence; guint8 sbus_rdwr_block_tlg; guint8 sbus_rdwr_block_type; guint8 sbus_rdwr_ack_nak; guint8 sbus_quint8_helper0; guint16 sbus_ack_code; guint32 sbus_rdwr_length; guint32 sbus_helper; guint32 sbus_helper1; guint32 sbus_helper2; char *tmp_string; nstime_t ns; /*we use this for the response time*/ /* Set up conversations*/ conversation_t *conversation; sbus_request_key request_key, *new_request_key; sbus_request_val *request_val; /*sbus_multimedia_requests *multimedia_requests;*/ /* does this look like an sbus pdu? */ if(!is_sbus_pdu(tvb)){ return 0; } /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "S-Bus"); col_clear(pinfo->cinfo, COL_INFO); conversation = find_or_create_conversation(pinfo); request_key.conversation = conversation->conv_index; request_key.sequence = tvb_get_ntohs(tvb,6); request_val = (sbus_request_val *) wmem_map_lookup(sbus_request_hash, &request_key); /*Get type of telegram for finding retries *As we are storing the info in a hash table we need to update the info *also in case this is no retry*/ sbus_attribut = tvb_get_guint8(tvb,8); if (request_val && sbus_attribut == SBUS_REQUEST) { if (request_val->req_frame < pinfo->num){ /*a retry; req_frame smaller this frame*/ request_val->retry_count +=1; } else { /*we have a conversation but this is not a retry so we store the packet info*/ request_val->retry_count = 0; request_val->req_frame = pinfo->num; /*store actual frame nr.*/ request_val->req_time = pinfo->abs_ts; } } if (request_val && (sbus_attribut == SBUS_RESPONSE || sbus_attribut == SBUS_ACKNAK)) { /*a response*/ request_val->resp_frame = pinfo->num; /*so store this frame nr.*/ } /* Only allocate a new hash element when it's a request*/ sbus_attribut = tvb_get_guint8(tvb,8); if ( !request_val && sbus_attribut == 0 ) {/* request telegram */ new_request_key = wmem_new(wmem_file_scope(), sbus_request_key); *new_request_key = request_key; request_val = wmem_new(wmem_file_scope(), sbus_request_val); request_val->cmd_code=tvb_get_guint8(tvb,10); request_val->retry_count=0; request_val->req_frame = pinfo->num; /*store actual frame nr.*/ request_val->req_time = pinfo->abs_ts; request_val->resp_frame = 0; /*response frame is not known yet*/ request_val->mm_request_count = 0; /*init to 0 in case it is no multi media request*/ if (((request_val->cmd_code) == SBUS_RD_USER_EEPROM_REGISTER) || ((request_val->cmd_code) == SBUS_WR_USER_EEPROM_REGISTER)) { request_val->count=((tvb_get_guint8(tvb,12))+1); } else if ((request_val->cmd_code) == SBUS_RDWR_MULTI_MEDIAS) { request_val->count=tvb_get_guint8(tvb,11); /*length of all sub requests in bytes*/ /*create list for sub requests to be able to process response frame later on*/ request_val->sbus_subrequests = wmem_list_new(wmem_file_scope()); /*add the sub requests to the list*/ request_val->mm_request_count = add_sbus_subrequest(tvb, request_val->sbus_subrequests, 11); } else { request_val->count=((tvb_get_guint8(tvb,11))+1); } /*Enter system info or telegram type (for rd/wr block telegrams)*/ if ((request_val->cmd_code) == SBUS_RD_SYSTEM_INFORMATION) { request_val->sysinfo=(tvb_get_guint8(tvb,12)); request_val->block_tlg=0x0; } else if ((request_val->cmd_code) == SBUS_RD_WR_PCD_BLOCK) { request_val->sysinfo=0x0; request_val->block_tlg=(tvb_get_guint8(tvb,12)); } else { request_val->sysinfo = 0x0; request_val->block_tlg = 0x0; } wmem_map_insert(sbus_request_hash, new_request_key, request_val); } /* End of attaching data to hash table*/ offset = 0; switch (sbus_attribut){ case SBUS_REQUEST: sbus_cmd_code = tvb_get_guint8(tvb, 10); switch (sbus_cmd_code){ case SBUS_WEB_SERVER_SERIAL_COMM: /* Special treatment of web server request * as this is very helpful to see more information in the packetlist */ sbus_web_aid = tvb_get_guint8(tvb, 12); sbus_web_seq = tvb_get_guint8(tvb, 13); col_add_fstr(pinfo->cinfo, COL_INFO, "Web Server Request: %s (Seq No: %d)", val_to_str_const(sbus_web_aid, webserver_aid_vals, "Unknown Request!"), sbus_web_seq); break; case SBUS_RDWR_MULTI_MEDIAS: col_add_fstr( pinfo->cinfo, COL_INFO, "Request: Multi media telegram (%d sub requests)", request_val->mm_request_count); break; case SBUS_RD_WR_PCD_BLOCK: sbus_rdwr_type = tvb_get_guint8(tvb, 12); col_add_fstr( pinfo->cinfo, COL_INFO, "Request: %s", val_to_str_ext_const(sbus_rdwr_type, &rdwrblock_vals_ext, "This RD/WR block telegram is not implemented")); /* Add name of file to be written in case of start of file stream */ if (sbus_rdwr_type == SBUS_WR_START_OF_STREAM) { sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { sbus_quint8_helper0=0; for (i=19; i<43; i++) { /*max length is 24 chars*/ /*find zero-termination of string*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb , 19, sbus_quint8_helper0, ENC_ASCII); col_append_fstr(pinfo->cinfo, COL_INFO, ": (File: %s)", tmp_string); } } else if (sbus_rdwr_type == SBUS_RD_BLOCK_START_OF_STREAM) { sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { sbus_quint8_helper0=0; for (i=15; i<39; i++) { /*max length is 24 chars*/ /*find zero-termination of string*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb , 15, sbus_quint8_helper0, ENC_ASCII); col_append_fstr(pinfo->cinfo, COL_INFO, ": (File: %s)", tmp_string); } } break; default: /* All other requests */ col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", val_to_str_ext_const(sbus_cmd_code, &sbus_command_vals_ext, "Unknown Command!")); break; } /*mark retries*/ if (request_val->retry_count>0) { col_append_str(pinfo->cinfo, COL_INFO, " (Retry)"); } /*no retry number as it is not always correctly calculated*/ break; case SBUS_RESPONSE: /* Special treatment of web server request * as this is very helpful to see more information in the packetlist */ if (request_val && ((request_val->cmd_code) == SBUS_WEB_SERVER_SERIAL_COMM)) { sbus_web_size = tvb_get_guint8(tvb,9); sbus_web_aid = tvb_get_guint8(tvb,10); col_add_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_const(sbus_web_aid, webserver_aid_vals, "Unknown Request!")); if (sbus_web_size > 1) { sbus_web_seq = tvb_get_guint8(tvb,11); col_append_fstr(pinfo->cinfo, COL_INFO, " (Seq No: %d)", sbus_web_seq); } } else if (request_val && ((request_val->cmd_code) == SBUS_RDWR_MULTI_MEDIAS)) { /* Add some info for multi media response*/ col_append_fstr(pinfo->cinfo, COL_INFO, "Response: Multi media (%d responses)", request_val->mm_request_count); } else if (request_val && ((request_val->cmd_code) == SBUS_RD_WR_PCD_BLOCK)) { /* Treat the ACK/NAK telgrams in a special way*/ switch (request_val->block_tlg) { case SBUS_WR_START_OF_STREAM: case SBUS_WR_BLOCK_DATA_STREAM: case SBUS_WR_BLOCK_END_OF_STREAM: case SBUS_WR_ABORT_BLOCK_STREAM: case SBUS_WR_BLOCK_DATA_BYTES: case SBUS_DELETE_BLOCK: case SBUS_RD_ABORT_BLOCK_STREAM: sbus_rdwr_ack_nak = tvb_get_guint8(tvb, 10); col_add_fstr( pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_ext_const(sbus_rdwr_ack_nak, &rdwrblock_sts_ext, "Unknown response!")); break; default: sbus_rdwr_type = tvb_get_guint8(tvb, 9); col_add_fstr( pinfo->cinfo, COL_INFO, "Response: (%d byte)", sbus_rdwr_type); break; } } else { col_set_str(pinfo->cinfo, COL_INFO, "Response"); } break; case SBUS_ACKNAK: sbus_ack_code = tvb_get_ntohs(tvb,9); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(sbus_ack_code, sbus_ack_nak_vals, "Unknown NAK response code!")); break; default: col_set_str(pinfo->cinfo, COL_INFO, "Unknown attribute"); break; } /* create display subtree for the protocol */ if (tree) { ti = proto_tree_add_item(tree, proto_sbus, tvb, offset, -1, ENC_NA); sbus_tree = proto_item_add_subtree(ti, ett_sbus); /*Add subtree for Ether-S-Bus header*/ ethsbus_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, 8, ett_sbus_ether, NULL, "Ether-S-Bus header"); /* add an item to the subtree*/ sbus_eth_len = tvb_get_ntohl(tvb,offset); proto_tree_add_item(ethsbus_tree, hf_sbus_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(ethsbus_tree, hf_sbus_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ethsbus_tree, hf_sbus_protocol, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ethsbus_tree, hf_sbus_sequence, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Continue adding stuff to the main tree*/ sbus_attribut = tvb_get_guint8(tvb,offset); proto_tree_add_item(sbus_tree, hf_sbus_attribut, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (sbus_attribut == SBUS_REQUEST) { proto_tree_add_item(sbus_tree, hf_sbus_dest, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; sbus_cmd_code = tvb_get_guint8(tvb,offset); proto_tree_add_item(sbus_tree, hf_sbus_command, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (request_val && request_val->retry_count > 0) {/*this is a retry telegram*/ expert_add_info(pinfo, sbus_tree, &ei_sbus_retry); nstime_delta(&ns, &pinfo->abs_ts, &request_val->req_time); proto_tree_add_time(sbus_tree, hf_sbus_timeout, tvb, 0, 0, &ns); proto_tree_add_uint(sbus_tree, hf_sbus_request_in, tvb, 0, 0, request_val->req_frame); } if (request_val && request_val->resp_frame > pinfo->num){ proto_tree_add_uint(sbus_tree, hf_sbus_response_in, tvb, 0, 0, request_val->resp_frame); } switch (sbus_cmd_code) { /*Read Counter, Register or Timer*/ case SBUS_RD_COUNTER: case SBUS_RD_REGISTER: case SBUS_RD_TIMER: offset = add_media_access_to_tree(sbus_cmd_code, tvb, sbus_tree, offset); break; /*Read Flag, Input or Output*/ case SBUS_RD_FLAG: case SBUS_RD_INPUT: case SBUS_RD_OUTPUT: offset = add_media_access_to_tree(sbus_cmd_code, tvb, sbus_tree, offset); break; /*Write Register Timer Counter*/ case SBUS_WR_COUNTER: case SBUS_WR_REGISTER: case SBUS_WR_TIMER: offset = add_media_access_to_tree(sbus_cmd_code, tvb, sbus_tree, offset); break; /* Write flags and outputs*/ case SBUS_WR_FLAG: case SBUS_WR_OUTPUT: offset = add_media_access_to_tree(sbus_cmd_code, tvb, sbus_tree, offset); break; /* Request: Write Real time clock*/ case SBUS_WR_RTC: /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, 8, ett_sbus_data, NULL, "Clock data"); sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/ sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/ proto_tree_add_uint_format_value(sbusdata_tree, hf_sbus_week_day, tvb, offset, 2, tvb_get_ntohs(tvb, offset), "%x, Week day: %x", sbus_helper, sbus_helper1); offset += 2; sbus_helper = tvb_get_guint8(tvb, (offset)); /*year*/ sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*month*/ sbus_helper2 = tvb_get_guint8(tvb, (offset +2)); /*day*/ proto_tree_add_uint_format_value(sbusdata_tree, hf_sbus_date, tvb, offset, 3, tvb_get_ntoh24(tvb, offset), "%02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2); offset += 3; sbus_helper = tvb_get_guint8(tvb, (offset)); /*hours*/ sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*minutes*/ sbus_helper2 = tvb_get_guint8(tvb, (offset +2)); /*seconds*/ proto_tree_add_uint_format_value(sbusdata_tree, hf_sbus_time, tvb, offset, 3, tvb_get_ntoh24(tvb, offset), "%02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2); offset += 3; break; /* Read/write multi media; multiple requests are transmitted within one single telegram*/ case SBUS_RDWR_MULTI_MEDIAS: /*Add subtree for Sub-requests*/ sbus_multimedia_total = tvb_get_guint8(tvb,offset) + 1; proto_tree_add_uint(sbus_tree, hf_sbus_multimedia_length, tvb, offset, 1, sbus_multimedia_total); offset += 1; sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, sbus_multimedia_total, ett_sbus_data, NULL, "Sub requests"); sbus_end_multimedia = offset + sbus_multimedia_total; /*Add subtree for each Subrequest*/ for (i=0; i<64; i++) { /*max number of sub-requests is 64*/ if(offset >= sbus_end_multimedia){ break; } sbus_multimedia_cnt = tvb_get_guint8(tvb,offset) + 1; sbus_multimedia_tree = proto_tree_add_subtree_format(sbusdata_tree, tvb, offset, sbus_multimedia_cnt + 1, ett_sbus_data, NULL, "Request %d", i); proto_tree_add_item(sbus_multimedia_tree, hf_sbus_sub_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset +=1; sbus_cmd_code = tvb_get_guint8(tvb,offset); proto_tree_add_item(sbus_multimedia_tree, hf_sbus_command, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; offset = add_media_access_to_tree(sbus_cmd_code, tvb, sbus_multimedia_tree, offset); } break; /* Read user memory or program line*/ case SBUS_RD_USER_MEMORY: case SBUS_RD_PROGRAM_LINE: sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; proto_tree_add_uint(sbus_tree, hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_addr_prog, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; break; /*Write user memory*/ case SBUS_WR_USER_MEMORY: sbus_media_cnt = (tvb_get_guint8(tvb,offset)); sbus_media_cnt = ((sbus_media_cnt - 2)/4); proto_tree_add_uint(sbus_tree, hf_sbus_wcount_calculated, tvb, offset, 1, sbus_media_cnt); proto_tree_add_item(sbus_tree, hf_sbus_wcount, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_addr_68k, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, ((sbus_media_cnt) * 4), ett_sbus_data, NULL, "Program lines"); for (i=((sbus_media_cnt)); i>0; i--) { proto_tree_add_item(sbusdata_tree, hf_sbus_data_rtc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } break; /* Read byte*/ case SBUS_RD_BYTE: sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; proto_tree_add_uint(sbus_tree, hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_addr_68k, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; break; /* Write byte */ case SBUS_WR_BYTE: sbus_media_cnt = (tvb_get_guint8(tvb,offset)); sbus_media_cnt = (sbus_media_cnt - 2); proto_tree_add_uint(sbus_tree, hf_sbus_wcount_calculated, tvb, offset, 1, sbus_media_cnt); proto_tree_add_item(sbus_tree, hf_sbus_wcount, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_addr_68k, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, ((sbus_media_cnt) * 4), ett_sbus_data, NULL, "Data (bytes)"); for (i=sbus_media_cnt; i>0; i--) { proto_tree_add_item(sbusdata_tree, hf_sbus_data_byte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } break; /*Read EEPROM register*/ case SBUS_RD_USER_EEPROM_REGISTER: proto_tree_add_item(sbus_tree, hf_sbus_command_extension, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1; proto_tree_add_uint(sbus_tree, hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_addr_eeprom, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; /*Request for reading system info*/ /*Syinfo 05 is not implemented as no serial baud is possible*/ case SBUS_RD_SYSTEM_INFORMATION: proto_tree_add_item(sbus_tree, hf_sbus_sysinfo_nr, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_sysinfo_nr, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; /* WebServer Request */ case SBUS_WEB_SERVER_SERIAL_COMM: sbus_web_size = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_web_size, tvb, offset, 1, sbus_web_size); offset += 1; sbus_web_aid = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_web_aid, tvb, offset, 1, sbus_web_aid); offset += 1; sbus_web_seq = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_web_seq, tvb, offset, 1, sbus_web_seq); offset += 1; if (sbus_web_size > 1) { sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, (sbus_web_size - 1), ett_sbus_data, NULL, "Data (bytes)"); for (i=sbus_web_size -1 ; i>0; i--) { proto_tree_add_item(sbusdata_tree, hf_sbus_data_byte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } break; /* Read/write block request */ case SBUS_RD_WR_PCD_BLOCK: if (tvb_get_guint8(tvb,offset) == 0xff){ sbus_rdwr_length = ((tvb_get_ntohl(tvb,0))-15); proto_tree_add_uint(sbus_tree, hf_sbus_rdwr_block_length_ext, tvb, 0, 4, sbus_rdwr_length); offset += 1; } else { sbus_rdwr_length = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_rdwr_block_length, tvb, offset, 1, sbus_rdwr_length); offset += 1; } sbus_rdwr_type = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_rdwr_telegram_type, tvb, offset, 1, sbus_rdwr_type); offset += 1; switch(sbus_rdwr_type) { case SBUS_WR_START_OF_STREAM: sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); proto_tree_add_item(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Check for file or block download */ if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sbus_quint8_helper0=0; /*find zero-termination of string*/ for (i=19; i<43; i++) { /*max length string is 24 char*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb , 19, sbus_quint8_helper0, ENC_ASCII); proto_tree_add_string(sbus_tree, hf_sbus_rdwr_file_name, tvb, offset, sbus_quint8_helper0, tmp_string); offset += sbus_quint8_helper0; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-6-sbus_quint8_helper0); } else { /* block write telegram, no file write*/ proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-8); } break; case SBUS_WR_BLOCK_DATA_STREAM: sbus_rdwr_sequence = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, sbus_rdwr_sequence); offset += 1; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-1); break; case SBUS_WR_BLOCK_END_OF_STREAM: sbus_rdwr_sequence = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, sbus_rdwr_sequence); offset += 1; /*do not display a field for block data (skip it)*/ offset += (sbus_rdwr_length-5); /*do not display a field for block CRC (skip it)*/ offset += 4; break; case SBUS_WR_ABORT_BLOCK_STREAM: case SBUS_RD_ABORT_BLOCK_STREAM: break; case SBUS_WR_BLOCK_DATA_BYTES: sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Check for file or block download */ if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sbus_quint8_helper0=0; /*find zero-termination of string*/ for (i=19; i<43; i++) { /*max length string is 24 char*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb, 19, sbus_quint8_helper0, ENC_ASCII); proto_tree_add_string(sbus_tree, hf_sbus_rdwr_file_name, tvb, offset, sbus_quint8_helper0, tmp_string); offset += sbus_quint8_helper0; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-6-sbus_quint8_helper0); } else { /* block write telegram, no file write*/ proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-8); } break; case SBUS_RD_BLOCK_START_OF_STREAM: sbus_rdwr_block_type = tvb_get_guint8(tvb, 14); proto_tree_add_item(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Check for file or block download */ if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { sbus_quint8_helper0=0; /*find zero-termination of string*/ for (i=14; i<38; i++) { /*max length string is 24 char*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb, 14, sbus_quint8_helper0, ENC_ASCII); proto_tree_add_string(sbus_tree, hf_sbus_rdwr_file_name, tvb, offset, sbus_quint8_helper0, tmp_string); offset += sbus_quint8_helper0; } else { /* block write telegram, no file write*/ proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } break; case SBUS_RD_BLOCK_DATA_STREAM: proto_tree_add_item(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; case SBUS_RD_BLOCK_DATA_BYTES: sbus_rdwr_block_type = tvb_get_guint8(tvb, 13); proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Check for file or block read */ if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { /*reading from a file*/ proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sbus_quint8_helper0=0; /*find zero-termination of string*/ for (i=22; i<46; i++) { /*max length string is 24 char*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb, 22, sbus_quint8_helper0, ENC_ASCII); proto_tree_add_string(sbus_tree, hf_sbus_rdwr_file_name, tvb, offset, sbus_quint8_helper0, tmp_string); offset += sbus_quint8_helper0 + 1; } else { /* block read telegram, no file read*/ proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_addr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } break; case SBUS_DELETE_BLOCK: case SBUS_GET_BLOCK_SIZE: sbus_rdwr_block_type = tvb_get_guint8(tvb, 13); proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Check for file or block deletion */ if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) || (sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) { /*delete a file*/ sbus_quint8_helper0=0; /*find zero-termination of string*/ for (i=14; i<38; i++) { /*max length string is 24 char*/ if ((tvb_get_guint8(tvb, i)) == 0x00) { break; } sbus_quint8_helper0 += 1; } tmp_string = tvb_get_string_enc(pinfo->pool, tvb, 14, sbus_quint8_helper0, ENC_ASCII); proto_tree_add_string(sbus_tree, hf_sbus_rdwr_file_name, tvb, offset, sbus_quint8_helper0, tmp_string); offset += sbus_quint8_helper0 + 1; } else { /* delete a block*/ proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } break; case SBUS_GET_PROGRAM_BLOCK_LIST: proto_tree_add_item(sbus_tree, hf_sbus_rdwr_list_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; default: break; } break; case SBUS_RD_DATA_BLOCK: offset = add_media_access_to_tree(sbus_cmd_code, tvb, sbus_tree, offset); break; /*Inform that command was not dissected and add remaining length*/ default: if (sbus_eth_len > 13) { /*13 bytes is the minimal length of a request telegram...*/ sbus_helper = sbus_eth_len - (offset + 2); proto_tree_add_expert(sbus_tree, pinfo, &ei_sbus_telegram_not_implemented, tvb, offset, sbus_helper); offset = offset + sbus_helper; } break; } } /* Response dissection*/ if (sbus_attribut == SBUS_RESPONSE && request_val) { /*add response time*/ nstime_delta(&ns, &pinfo->abs_ts, &request_val->req_time); proto_tree_add_time(sbus_tree, hf_sbus_response_time, tvb, 0, 0, &ns); /*add reference to request telegram*/ proto_tree_add_uint(sbus_tree, hf_sbus_response_to, tvb, 0, 0, request_val->req_frame); switch (request_val->cmd_code) { /* Response: 32 bit values*/ case SBUS_RD_COUNTER: case SBUS_RD_REGISTER: case SBUS_RD_TIMER: case SBUS_RD_USER_MEMORY: case SBUS_RD_PROGRAM_LINE: case SBUS_RD_USER_EEPROM_REGISTER: case SBUS_RD_DATA_BLOCK: /*Add subtree for Data*/ offset = add_media_response_to_tree(request_val->cmd_code, request_val->count, tvb, sbus_tree, offset); break; /* Response: PCD Display register*/ case SBUS_RD_DISPLAY_REGISTER: proto_tree_add_item(sbus_tree, hf_sbus_display_register, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; /* Add binary data I, O, F*/ case SBUS_RD_FLAG: case SBUS_RD_INPUT: case SBUS_RD_OUTPUT: /*Add subtree for Data*/ offset = add_media_response_to_tree(request_val->cmd_code, request_val->count, tvb, sbus_tree, offset); break; /* Response: Real time clock value*/ case SBUS_RD_RTC: /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, 8, ett_sbus_data, NULL, "Clock data"); sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/ sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/ proto_tree_add_uint_format_value(sbusdata_tree, hf_sbus_week_day, tvb, offset, 2, tvb_get_ntohs(tvb, offset), "%x, Week day: %x", sbus_helper, sbus_helper1); offset += 2; sbus_helper = tvb_get_guint8(tvb, (offset)); /*year*/ sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*month*/ sbus_helper2 = tvb_get_guint8(tvb, (offset +2)); /*day*/ proto_tree_add_uint_format_value(sbusdata_tree, hf_sbus_date, tvb, offset, 3, tvb_get_ntoh24(tvb, offset), "%02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2); offset += 3; sbus_helper = tvb_get_guint8(tvb, (offset)); /*hours*/ sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*minutes*/ sbus_helper2 = tvb_get_guint8(tvb, (offset +2)); /*seconds*/ proto_tree_add_uint_format_value(sbusdata_tree, hf_sbus_time, tvb, offset, 3, tvb_get_ntoh24(tvb, offset), "%02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2); offset += 3; break; case SBUS_RDWR_MULTI_MEDIAS: /*Add subtree for Subrequests*/ sbus_multimedia_total = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_multimedia_length, tvb, offset, 1, sbus_multimedia_total); offset += 1; sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, sbus_multimedia_total, ett_sbus_data, NULL, "Sub responses"); sbus_end_multimedia = offset + sbus_multimedia_total; i = 0; /* Start at front of list and cycle through possible sub-requests, until all bytes or all requests are processed */ frame = wmem_list_head(request_val->sbus_subrequests); while (frame && (offset < sbus_end_multimedia)) { mm_sub_req = (sbus_subrequest *)wmem_list_frame_data(frame); sbus_multimedia_cmd = mm_sub_req->cmd_code; sbus_multimedia_cnt = mm_sub_req->count; /*get the attribute of the sub-response (1: response, 2: ACK/NACK)*/ sbus_multimedia_att = tvb_get_guint8(tvb,offset + 1) ; if (sbus_multimedia_att == SBUS_ACKNAK) { sbus_multimedia_tree = proto_tree_add_subtree_format(sbusdata_tree, tvb, offset, 4, ett_sbus_data, NULL, "Response %d", i); proto_tree_add_item(sbus_multimedia_tree, hf_sbus_sub_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset +=1; proto_tree_add_item(sbus_multimedia_tree, hf_sbus_attribut, tvb, offset, 1, ENC_BIG_ENDIAN); offset +=1; hi = proto_tree_add_item(sbus_multimedia_tree, hf_sbus_acknackcode, tvb, offset, 2, ENC_BIG_ENDIAN); if (tvb_get_guint8(tvb, (offset+1)) > 0) { expert_add_info(pinfo, hi, &ei_sbus_telegram_not_acked); } offset += 2; } else { /*response containing data*/ sbus_multimedia_bytes = get_response_length(sbus_multimedia_cmd, sbus_multimedia_cnt); sbus_multimedia_tree = proto_tree_add_subtree_format(sbusdata_tree, tvb, offset, sbus_multimedia_bytes + 2, ett_sbus_data, NULL, "Response %d", i); proto_tree_add_item(sbus_multimedia_tree, hf_sbus_sub_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset +=1; proto_tree_add_item(sbus_multimedia_tree, hf_sbus_attribut, tvb, offset, 1, ENC_BIG_ENDIAN); offset +=1; add_media_response_to_tree(sbus_multimedia_cmd, sbus_multimedia_cnt, tvb, sbus_multimedia_tree, offset); offset +=sbus_multimedia_bytes ; } /* After processing this sub request, proceed to the next */ frame = wmem_list_frame_next(frame); i++; } break; /* Response: CPU status, the command codes 14..1B are concerned*/ case SBUS_RD_PCD_STATUS_CPU0: case SBUS_RD_PCD_STATUS_CPU1: case SBUS_RD_PCD_STATUS_CPU2: case SBUS_RD_PCD_STATUS_CPU3: case SBUS_RD_PCD_STATUS_CPU4: case SBUS_RD_PCD_STATUS_CPU5: case SBUS_RD_PCD_STATUS_CPU6: case SBUS_RD_PCD_STATUS_OWN: proto_tree_add_item(sbus_tree, hf_sbus_cpu_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; /* Response: Station address*/ case SBUS_RD_SBUS_STN_NBR: proto_tree_add_item(sbus_tree, hf_sbus_address, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; /* Response: Firmware version */ case SBUS_RD_PROGRAM_VERSION: /*PCD type*/ proto_tree_add_item(sbus_tree, hf_sbus_cpu_type, tvb, offset, 5, ENC_ASCII); offset += 5; /*FW version*/ proto_tree_add_item(sbus_tree, hf_sbus_fw_version, tvb, offset, 3, ENC_ASCII); offset += 4; break; /* Response for Status Flags*/ case SBUS_RD_STATUSFLAG_ACCU: /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, 1, ett_sbus_data, NULL, "ACCU and arithmetic status"); proto_tree_add_item(sbusdata_tree, hf_sbus_flags_accu, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_flags_error, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_flags_negative, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_flags_zero, tvb, offset, 1, ENC_BIG_ENDIAN); offset +=1; break; /* Response for Read byte */ case SBUS_RD_BYTE: /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, (request_val->count), ett_sbus_data, NULL, "Data (bytes)"); for (i=(request_val->count); i>0; i--) { proto_tree_add_item(sbusdata_tree, hf_sbus_data_byte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } break; /* Response for Read Index register */ case SBUS_RD_INDEX_REGISTER: /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, 2, ett_sbus_data, NULL, "Data (hex bytes)"); for (i=0; i<2; i++) { /*2 bytes*/ proto_tree_add_item(sbusdata_tree, hf_sbus_data_byte_hex, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } break; /* Response: Instruction pointer*/ case SBUS_RD_INSTRUCTION_POINTER: proto_tree_add_item(sbus_tree, hf_sbus_addr_prog, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; break; /*Response for Find History*/ case SBUS_FIND_HISTORY: proto_tree_add_item(sbus_tree, hf_sbus_addr_68k, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(sbus_tree, hf_sbus_nbr_elements, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; /* Response: Read current block*/ case SBUS_RD_CURRENT_BLOCK: proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; /* Response: Read system information (without interpretation of module info)*/ case SBUS_RD_SYSTEM_INFORMATION: if (request_val->sysinfo == 0x00){ /*sysinfo 0*/ offset += 1; /* this byte is always 0x01*/ /*Add subtree for Data*/ sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, 1, ett_sbus_data, NULL, "System info"); proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_5, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } else { /*do not dissect all system info telegrams as there is no need*/ offset = (tvb_get_guint8(tvb,9) + 10); } break; /* Response: Webserver request */ case SBUS_WEB_SERVER_SERIAL_COMM: sbus_web_size = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_web_size, tvb, offset, 1, sbus_web_size); offset += 1; sbus_web_aid = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_web_aid, tvb, offset, 1, sbus_web_aid); offset += 1; if (sbus_web_size > 1) { sbus_web_seq = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_web_seq, tvb, offset, 1, sbus_web_seq); offset += 1; sbusdata_tree = proto_tree_add_subtree(sbus_tree, tvb, offset, (sbus_web_size - 2), ett_sbus_data, NULL, "Data (bytes)"); for (i=sbus_web_size - 2; i>0; i--) { proto_tree_add_item(sbusdata_tree, hf_sbus_data_byte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } break; /* Response: Read/Write block data */ case SBUS_RD_WR_PCD_BLOCK: sbus_rdwr_block_tlg = request_val->block_tlg; sbus_rdwr_length = tvb_get_guint8(tvb,offset); proto_tree_add_uint(sbus_tree, hf_sbus_rdwr_block_length, tvb, offset, 1, sbus_rdwr_length); offset += 1; hi = proto_tree_add_item(sbus_tree, hf_sbus_rdwr_acknakcode, tvb, offset, 1, ENC_BIG_ENDIAN); if ((tvb_get_guint8(tvb, offset) >= SBUS_RD_WR_NAK)&& (tvb_get_guint8(tvb, offset) <= SBUS_RD_WR_NAK_INVALID_SIZE)) { expert_add_info(pinfo, hi, &ei_sbus_telegram_not_acked); } offset += 1; switch(sbus_rdwr_block_tlg) { case SBUS_WR_START_OF_STREAM: case SBUS_WR_BLOCK_DATA_STREAM: case SBUS_WR_BLOCK_END_OF_STREAM: proto_tree_add_item(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; case SBUS_WR_ABORT_BLOCK_STREAM: case SBUS_RD_ABORT_BLOCK_STREAM: case SBUS_WR_BLOCK_DATA_BYTES: case SBUS_DELETE_BLOCK: break; case SBUS_RD_BLOCK_START_OF_STREAM: proto_tree_add_item(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-6); break; case SBUS_RD_BLOCK_DATA_STREAM: proto_tree_add_item(sbus_tree, hf_sbus_rdwr_telegram_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-2); break; case SBUS_RD_BLOCK_DATA_BYTES: /*do not display a field for block data (skip)*/ offset += (sbus_rdwr_length-1); break; case SBUS_GET_BLOCK_SIZE: sbus_rdwr_block_type = tvb_get_guint8(tvb, 10); /* Check for unknown block type */ if (sbus_rdwr_block_type == SBUS_RD_WR_UNKNOWN_BLOCK_TYPE) { /*unknown block, no more data follows*/ } else { /* add block size and CRC32 in case of known block*/ proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*Now the CRC32 follows, but I don't bother calculating it*/ offset += 4; } break; case SBUS_GET_PROGRAM_BLOCK_LIST: proto_tree_add_item(sbus_tree, hf_sbus_block_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(sbus_tree, hf_sbus_block_nr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sbus_tree, hf_sbus_rdwr_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /*do not display block_timestamp as no description is available*/ offset += (sbus_rdwr_length-8); break; default: break; } break; /*Inform that response was not dissected and add remaining length*/ default: sbus_helper = sbus_eth_len - (offset + 2); proto_tree_add_expert(sbus_tree, pinfo, &ei_sbus_telegram_not_implemented, tvb, offset, sbus_helper); offset = offset + sbus_helper; break; } } else if (sbus_attribut == SBUS_RESPONSE && (!request_val)) { /*calculate the offset in case the request telegram was not found or was broadcasted*/ sbus_eth_len = tvb_get_ntohl(tvb,0); sbus_helper = sbus_eth_len - 11; proto_tree_add_expert(sbus_tree, pinfo, &ei_sbus_no_request_telegram, tvb, offset, sbus_helper); offset = sbus_eth_len - 2; } if (sbus_attribut == SBUS_ACKNAK) { /*Add response time if possible*/ if (request_val) { nstime_delta(&ns, &pinfo->abs_ts, &request_val->req_time); proto_tree_add_time(sbus_tree, hf_sbus_response_time, tvb, 0, 0, &ns); /*add reference to request telegram*/ proto_tree_add_uint(sbus_tree, hf_sbus_response_to, tvb, 0, 0, request_val->req_frame); } hi = proto_tree_add_item(sbus_tree, hf_sbus_acknackcode, tvb, offset, 2, ENC_BIG_ENDIAN); if (tvb_get_guint8(tvb, (offset+1)) > 0) { expert_add_info(pinfo, hi, &ei_sbus_telegram_not_acked); } offset += 2; } /* Calclulate CRC */ sbus_crc_calc = 0; for (i = 0; i < sbus_eth_len - 2; i++) sbus_crc_calc = crc_calc (sbus_crc_calc, tvb_get_guint8(tvb, i)); proto_tree_add_checksum(sbus_tree, tvb, offset, hf_sbus_crc, hf_sbus_crc_status, &ei_sbus_crc_bad, pinfo, sbus_crc_calc, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); offset += 2; /*now at the end of the telegram*/ } return offset; /*End of dissect_sbus*/ } /* Register the protocol with Wireshark */ void proto_register_sbus(void) { /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_sbus_length, { "Length (bytes)", "sbus.len", FT_UINT32, BASE_DEC, NULL, 0, "SAIA Ether-S-Bus telegram length", HFILL } }, { &hf_sbus_version, { "Version", "sbus.vers", FT_UINT8, BASE_DEC, NULL, 0, "SAIA Ether-S-Bus version", HFILL } }, { &hf_sbus_protocol, { "Protocol type", "sbus.proto", FT_UINT8, BASE_DEC, NULL, 0, "SAIA Ether-S-Bus protocol type", HFILL } }, { &hf_sbus_sequence, { "Sequence", "sbus.seq", FT_UINT16, BASE_DEC, NULL, 0, "SAIA Ether-S-Bus sequence number", HFILL } }, { &hf_sbus_attribut, { "Telegram attribute", "sbus.att", FT_UINT8, BASE_HEX, VALS(sbus_att_vals), 0, "SAIA Ether-S-Bus telegram attribute, indicating type of telegram", HFILL } }, { &hf_sbus_dest, { "Destination", "sbus.destination", FT_UINT8, BASE_DEC, NULL, 0, "SAIA S-Bus destination address", HFILL } }, { &hf_sbus_address, { "S-Bus address", "sbus.address", FT_UINT8, BASE_DEC, NULL, 0, "SAIA S-Bus station address", HFILL } }, { &hf_sbus_command, { "Command", "sbus.cmd", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &sbus_command_vals_ext, 0, "SAIA S-Bus command", HFILL } }, { &hf_sbus_command_extension, { "Command extension", "sbus.cmd_extn", FT_UINT8, BASE_HEX, NULL, 0, "SAIA S-Bus command extension", HFILL } }, { &hf_sbus_rcount, { "R-count", "sbus.rcount", FT_UINT8, BASE_DEC, NULL, 0, "Number of elements expected in response", HFILL } }, { &hf_sbus_sub_length, { "Sub length", "sbus.sublength", FT_UINT8, BASE_DEC, NULL, 0, "Length of multi-media response or request in bytes, length and command code fields not included", HFILL } }, { &hf_sbus_multimedia_length, { "Multi-media length", "sbus.mmlength", FT_UINT8, BASE_DEC, NULL, 0, "Length of all multi-media request or responses in bytes", HFILL } }, { &hf_sbus_wcount, { "W-count (raw)", "sbus.wcount", FT_UINT8, BASE_DEC, NULL, 0, "Number of bytes to be written", HFILL } }, { &hf_sbus_wcount_calculated, { "W-count (32 bit values)", "sbus.wcount_calc", FT_UINT8, BASE_DEC, NULL, 0, "Number of elements to be written", HFILL } }, { &hf_sbus_fio_count, { "FIO Count (amount of bits)", "sbus.fio_count", FT_UINT8, BASE_DEC, NULL, 0, "Number of binary elements to be written", HFILL } }, { &hf_sbus_addr_rtc, { "Base address RTC", "sbus.addr_RTC", FT_UINT16, BASE_DEC, NULL, 0, "Base address of 32 bit elements to read", HFILL } }, { &hf_sbus_addr_iof, { "Base address IOF", "sbus.addr_IOF", FT_UINT16, BASE_DEC, NULL, 0, "Base address of binary elements to read", HFILL } }, { &hf_sbus_addr_db, { "DB address", "sbus.addr_db", FT_UINT16, BASE_DEC, NULL, 0, "Datablock address to read from", HFILL } }, { &hf_sbus_addr_base_element, { "Base DB element address", "sbus.db_base_element", FT_UINT16, BASE_DEC, NULL, 0, "Base Datablock element address of 32 bit values to read", HFILL } }, { &hf_sbus_addr_eeprom, { "Base address of EEPROM register", "sbus.addr_EEPROM", FT_UINT16, BASE_DEC, NULL, 0, "Base address of 32 bit EEPROM register to read or write", HFILL } }, { &hf_sbus_addr_prog, { "Base address of user memory or program lines", "sbus.addr_prog", FT_UINT24, BASE_DEC, NULL, 0, "Base address of the user memory or program lines (read or write)", HFILL } }, { &hf_sbus_addr_68k, { "Base address of bytes", "sbus.addr_68k", FT_UINT24, BASE_HEX, NULL, 0, "Base address of bytes to read or write (68k address)", HFILL } }, { &hf_sbus_block_type, { "Block type", "sbus.block_type", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &sbus_block_types_ext, 0, "Program block type", HFILL } }, { &hf_sbus_block_nr, { "Block/Element nr", "sbus.block_nr", FT_UINT16, BASE_DEC, NULL, 0, "Program block / DataBlock number", HFILL } }, { &hf_sbus_nbr_elements, { "Number of elements", "sbus.nbr_elements", FT_UINT16, BASE_DEC, NULL, 0, "Number of elements or characters", HFILL } }, { &hf_sbus_display_register, { "PCD Display register", "sbus.data_display_register", FT_UINT32, BASE_DEC, NULL, 0, "The PCD display register (32 bit value)", HFILL } }, { &hf_sbus_data_rtc, { "S-Bus 32-bit data", "sbus.data_rtc", FT_UINT32, BASE_DEC, NULL, 0, "One register/timer of counter (32 bit value)", HFILL } }, { &hf_sbus_data_byte, { "Data bytes", "sbus.data_byte", FT_UINT8, BASE_DEC, NULL, 0, "One byte from PCD", HFILL } }, { &hf_sbus_data_byte_hex, { "Data bytes (hex)", "sbus.data_byte_hex", FT_UINT8, BASE_HEX, NULL, 0, "One byte from PCD (hexadecimal)", HFILL } }, { &hf_sbus_data_iof, { "S-Bus binary data", "sbus.data_iof", FT_UINT32, BASE_DEC, NULL, 0, "8 binaries", HFILL } }, { &hf_sbus_cpu_type, { "PCD type", "sbus.pcd_type", FT_STRING, BASE_NONE, NULL, 0, "PCD type (short form)", HFILL } }, { &hf_sbus_fw_version, { "Firmware version", "sbus.fw_version", FT_STRING, BASE_NONE, NULL, 0, "Firmware version of the PCD or module", HFILL } }, { &hf_sbus_sysinfo_nr, { "System information number", "sbus.sysinfo", FT_UINT8, BASE_HEX, NULL, 0, "System information number (extension to command code)", HFILL } }, { &hf_sbus_sysinfo0_1, { "Mem size info", "sbus.sysinfo0.mem", FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_MEMSIZE, "Availability of memory size information", HFILL } }, { &hf_sbus_sysinfo0_2, { "Trace buffer", "sbus.sysinfo0.trace", FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_TRACE, "Availability of trace buffer feature", HFILL } }, { &hf_sbus_sysinfo0_3, { "Slot B1", "sbus.sysinfo0.b1", FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_INFO_B1, "Presence of EEPROM information on slot B1", HFILL } }, { &hf_sbus_sysinfo0_4, { "Slot B2", "sbus.sysinfo0.b2", FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_INFO_B2, "Presence of EEPROM information on slot B2", HFILL } }, { &hf_sbus_sysinfo0_5, { "PGU baud", "sbus.sysinfo0.pgubaud", FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_PGU_BAUD, "Availability of PGU baud switch feature", HFILL } }, #if 0 { &hf_sbus_sysinfo_length, { "System information length", "sbus.sysinfo_length", FT_UINT8, BASE_HEX, NULL, 0, "System information length in response", HFILL } }, #endif #if 0 { &hf_sbus_f_module_type, { "F-module type", "sbus.fmodule_type", FT_STRING, BASE_NONE, NULL, 0, "Module type mounted on B1/2 slot", HFILL } }, #endif #if 0 { &hf_sbus_harware_version, { "Hardware version", "sbus.hw_version", FT_STRING, BASE_NONE, NULL, 0, "Hardware version of the PCD or the module", HFILL } }, #endif #if 0 { &hf_sbus_hardware_modification, { "Hardware modification", "sbus.hw_modification", FT_UINT8, BASE_DEC, NULL, 0, "Hardware modification of the PCD or module", HFILL } }, #endif #if 0 { &hf_sbus_various, { "Various data", "sbus.various", FT_NONE, BASE_NONE, NULL, 0, "Various data contained in telegrams but nobody will search for it", HFILL } }, #endif { &hf_sbus_acknackcode, { "ACK/NAK code", "sbus.nakcode", FT_UINT16, BASE_HEX, VALS(sbus_ack_nak_vals), 0, "SAIA S-Bus ACK/NAK response", HFILL } }, { &hf_sbus_cpu_status, { "CPU status", "sbus.CPU_status", FT_UINT8, BASE_HEX, VALS(sbus_CPU_status), 0, "SAIA PCD CPU status", HFILL } }, { &hf_sbus_week_day, { "Calendar week", "sbus.rtc.week_day", FT_UINT16, BASE_HEX, NULL, 0, "Calendar week and week day number of the real time clock", HFILL } }, { &hf_sbus_date, { "RTC date (YYMMDD)", "sbus.rtc.date", FT_UINT24, BASE_HEX, NULL, 0, "Year, month and day of the real time clock", HFILL } }, { &hf_sbus_time, { "RTC time (HHMMSS)", "sbus.rtc.time", FT_UINT24, BASE_HEX, NULL, 0, "Time of the real time clock", HFILL } }, { &hf_sbus_web_size, { "Web server packet size", "sbus.web.size", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_sbus_web_aid, { "AID", "sbus.web.aid", FT_UINT8, BASE_HEX, NULL, 0, "Web server command/status code (AID)", HFILL } }, { &hf_sbus_web_seq, { "Sequence", "sbus.web.seq", FT_UINT8, BASE_HEX, NULL, 0, "Web server sequence nr (PACK_N)", HFILL } }, { &hf_sbus_rdwr_block_length, { "Read/write block telegram length", "sbus.block.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_sbus_rdwr_block_length_ext, { "Extended length (bytes)", "sbus.len_ext", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_sbus_rdwr_telegram_type, { "Read/write block telegram type", "sbus.block.tlgtype", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rdwrblock_vals_ext, 0, "Type of RD/WR block telegram", HFILL } }, { &hf_sbus_rdwr_telegram_sequence, { "Sequence", "sbus.block.seq", FT_UINT8, BASE_DEC, NULL, 0, "Sequence number of block data stream telegram", HFILL } }, { &hf_sbus_rdwr_block_size, { "Block size in bytes", "sbus.block.size", FT_UINT32, BASE_DEC, NULL, 0, "The size of the block in bytes", HFILL } }, { &hf_sbus_rdwr_block_addr, { "Address inside block", "sbus.block.addr", FT_UINT32, BASE_DEC, NULL, 0, "The address inside a block", HFILL } }, { &hf_sbus_rdwr_file_name, { "File name", "sbus.block.filename", FT_STRING, BASE_NONE, NULL, 0, "Name of file to in RD/WR block telegram", HFILL } }, { &hf_sbus_rdwr_list_type, { "Get program block list, command type", "sbus.block.getlisttype", FT_UINT8, BASE_HEX, VALS(rdwrblock_list_type_vals), 0, "Type of the Get Program Block list request", HFILL } }, { &hf_sbus_rdwr_acknakcode, { "ACK/NAK code", "sbus.block.nakcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rdwrblock_sts_ext, 0, "ACK/NAK response for block write requests", HFILL } }, { &hf_sbus_crc, { "Checksum", "sbus.crc", FT_UINT16, BASE_HEX, NULL, 0, "CRC 16", HFILL } }, { &hf_sbus_crc_status, { "Checksum Status", "sbus.crc.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL }}, { &hf_sbus_flags_accu, { "ACCU", "sbus.flags.accu", FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_ACCU, "PCD Accumulator", HFILL } }, { &hf_sbus_flags_error, { "Error flag", "sbus.flags.error", FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_ERROR, "PCD error flag", HFILL } }, { &hf_sbus_flags_negative, { "N-flag", "sbus.flags.nflag", FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_NEGATIVE, "Negative status flag", HFILL } }, { &hf_sbus_flags_zero, { "Z-flag", "sbus.flags.zflag", FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_ZERO, "Zero status flag", HFILL } }, { &hf_sbus_response_in, { "Response in frame nr.", "sbus.response_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The response to this Ether-S-Bus request is in this frame", HFILL } }, { &hf_sbus_response_to, { "Request in frame nr.", "sbus.response_to", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is a response to the Ether-S-Bus request in this frame", HFILL } }, { &hf_sbus_response_time, { "Response time", "sbus.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the request and the response", HFILL } }, { &hf_sbus_timeout, { "Time passed since first request", "sbus.timeout", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the first (identical) request and the repetition", HFILL } }, { &hf_sbus_request_in, { "First request in frame nr.", "sbus.request_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The first request of this repeated request is in this frame", HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sbus, &ett_sbus_ether, &ett_sbus_data }; static ei_register_info ei[] = { { &ei_sbus_retry, { "sbus.retry", PI_SEQUENCE, PI_NOTE, "Repeated telegram (due to timeout?)", EXPFILL }}, { &ei_sbus_telegram_not_acked, { "sbus.telegram_not_acked", PI_RESPONSE_CODE, PI_CHAT, "Telegram not acknowledged by PCD", EXPFILL }}, { &ei_sbus_crc_bad, { "sbus.crc_bad.expert", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }}, { &ei_sbus_telegram_not_implemented, { "sbus.telegram_not_implemented", PI_UNDECODED, PI_WARN, "This telegram isn't implemented in the dissector", EXPFILL }}, { &ei_sbus_no_request_telegram, { "sbus.no_request_telegram", PI_UNDECODED, PI_WARN, "Not dissected, could not find request telegram", EXPFILL }}, }; expert_module_t* expert_sbus; /* Register the protocol name and description */ proto_sbus = proto_register_protocol("SAIA S-Bus", "SBUS", "sbus"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sbus, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sbus = expert_register_protocol(proto_sbus); expert_register_field_array(expert_sbus, ei, array_length(ei)); sbus_request_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), sbus_hash, sbus_equal); } void proto_reg_handoff_sbus(void) { dissector_handle_t sbus_handle; sbus_handle = create_dissector_handle(dissect_sbus, proto_sbus); dissector_add_uint_with_preference("udp.port", SBUS_UDP_PORT, sbus_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 7 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=7 tabstop=8 expandtab: * :indentSize=7:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sccp.c
/* packet-sccp.c * Routines for Signalling Connection Control Part (SCCP) dissection * * It is hopefully compliant to: * ANSI T1.112.3-2001 * ITU-T Q.713 7/1996 * YDN 038-1997 (Chinese ITU variant) * JT-Q713 and NTT-Q713 (Japan) * * Note that Japan-specific GTT is incomplete; in particular, the specific * TTs that are defined in TTC and NTT are not decoded in detail. * * Copyright 2002, Jeff Morriss <jeff.morriss.ws [AT] gmail.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * Copied from packet-m2pa.c * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/reassemble.h> #include <epan/address_types.h> #include <epan/asn1.h> #include <epan/uat.h> #include <epan/expert.h> #include <epan/tap.h> #include <epan/to_str.h> #include <epan/decode_as.h> #include <epan/proto_data.h> #include <wiretap/wtap.h> #include <wsutil/str_util.h> #include "packet-mtp3.h" #include "packet-tcap.h" #include "packet-sccp.h" #include "packet-e164.h" #include "packet-e212.h" /* function prototypes */ void proto_register_sccp(void); void proto_reg_handoff_sccp(void); static Standard_Type decode_mtp3_standard; #define SCCP_MSG_TYPE_OFFSET 0 #define SCCP_MSG_TYPE_LENGTH 1 #define POINTER_LENGTH 1 #define POINTER_LENGTH_LONG 2 /* Same as below but with names typed out */ static const value_string sccp_message_type_values[] = { { SCCP_MSG_TYPE_CR, "Connection Request" }, { SCCP_MSG_TYPE_CC, "Connection Confirm" }, { SCCP_MSG_TYPE_CREF, "Connection Refused" }, { SCCP_MSG_TYPE_RLSD, "Released" }, { SCCP_MSG_TYPE_RLC, "Release Complete" }, { SCCP_MSG_TYPE_DT1, "Data Form 1" }, { SCCP_MSG_TYPE_DT2, "Data Form 2" }, { SCCP_MSG_TYPE_AK, "Data Acknowledgement" }, { SCCP_MSG_TYPE_UDT, "Unitdata" }, { SCCP_MSG_TYPE_UDTS, "Unitdata Service" }, { SCCP_MSG_TYPE_ED, "Expedited Data" }, { SCCP_MSG_TYPE_EA, "Expedited Data Acknowledgement" }, { SCCP_MSG_TYPE_RSR, "Reset Request" }, { SCCP_MSG_TYPE_RSC, "Reset Confirmation" }, { SCCP_MSG_TYPE_ERR, "Error" }, { SCCP_MSG_TYPE_IT, "Inactivity Timer" }, { SCCP_MSG_TYPE_XUDT, "Extended Unitdata" }, { SCCP_MSG_TYPE_XUDTS, "Extended Unitdata Service" }, { SCCP_MSG_TYPE_LUDT, "Long Unitdata" }, { SCCP_MSG_TYPE_LUDTS, "Long Unitdata Service" }, { 0, NULL } }; /* Same as above but in acronym form (for the Info column) */ const value_string sccp_message_type_acro_values[] = { { SCCP_MSG_TYPE_CR, "CR" }, { SCCP_MSG_TYPE_CC, "CC" }, { SCCP_MSG_TYPE_CREF, "CREF" }, { SCCP_MSG_TYPE_RLSD, "RLSD" }, { SCCP_MSG_TYPE_RLC, "RLC" }, { SCCP_MSG_TYPE_DT1, "DT1" }, { SCCP_MSG_TYPE_DT2, "DT2" }, { SCCP_MSG_TYPE_AK, "AK" }, { SCCP_MSG_TYPE_UDT, "UDT" }, { SCCP_MSG_TYPE_UDTS, "UDTS" }, { SCCP_MSG_TYPE_ED, "ED" }, { SCCP_MSG_TYPE_EA, "EA" }, { SCCP_MSG_TYPE_RSR, "RSR" }, { SCCP_MSG_TYPE_RSC, "RSC" }, { SCCP_MSG_TYPE_ERR, "ERR" }, { SCCP_MSG_TYPE_IT, "IT" }, { SCCP_MSG_TYPE_XUDT, "XUDT" }, { SCCP_MSG_TYPE_XUDTS, "XUDTS" }, { SCCP_MSG_TYPE_LUDT, "LUDT" }, { SCCP_MSG_TYPE_LUDTS, "LUDTS" }, { 0, NULL } }; #define PARAMETER_LENGTH_LENGTH 1 #define PARAMETER_LONG_DATA_LENGTH_LENGTH 2 #define PARAMETER_TYPE_LENGTH 1 #define PARAMETER_END_OF_OPTIONAL_PARAMETERS 0x00 #define PARAMETER_DESTINATION_LOCAL_REFERENCE 0x01 #define PARAMETER_SOURCE_LOCAL_REFERENCE 0x02 #define PARAMETER_CALLED_PARTY_ADDRESS 0x03 #define PARAMETER_CALLING_PARTY_ADDRESS 0x04 #define PARAMETER_CLASS 0x05 #define PARAMETER_SEGMENTING_REASSEMBLING 0x06 #define PARAMETER_RECEIVE_SEQUENCE_NUMBER 0x07 #define PARAMETER_SEQUENCING_SEGMENTING 0x08 #define PARAMETER_CREDIT 0x09 #define PARAMETER_RELEASE_CAUSE 0x0a #define PARAMETER_RETURN_CAUSE 0x0b #define PARAMETER_RESET_CAUSE 0x0c #define PARAMETER_ERROR_CAUSE 0x0d #define PARAMETER_REFUSAL_CAUSE 0x0e #define PARAMETER_DATA 0x0f #define PARAMETER_SEGMENTATION 0x10 #define PARAMETER_HOP_COUNTER 0x11 /* Importance is ITU only */ #define PARAMETER_IMPORTANCE 0x12 #define PARAMETER_LONG_DATA 0x13 /* ISNI is ANSI only */ #define PARAMETER_ISNI 0xfa static const value_string sccp_parameter_values[] = { { PARAMETER_END_OF_OPTIONAL_PARAMETERS, "End of Optional Parameters" }, { PARAMETER_DESTINATION_LOCAL_REFERENCE, "Destination Local Reference" }, { PARAMETER_SOURCE_LOCAL_REFERENCE, "Source Local Reference" }, { PARAMETER_CALLED_PARTY_ADDRESS, "Called Party Address" }, { PARAMETER_CALLING_PARTY_ADDRESS, "Calling Party Address" }, { PARAMETER_CLASS, "Protocol Class" }, { PARAMETER_SEGMENTING_REASSEMBLING, "Segmenting/Reassembling" }, { PARAMETER_RECEIVE_SEQUENCE_NUMBER, "Receive Sequence Number" }, { PARAMETER_SEQUENCING_SEGMENTING, "Sequencing/Segmenting" }, { PARAMETER_CREDIT, "Credit" }, { PARAMETER_RELEASE_CAUSE, "Release Cause" }, { PARAMETER_RETURN_CAUSE, "Return Cause" }, { PARAMETER_RESET_CAUSE, "Reset Cause" }, { PARAMETER_ERROR_CAUSE, "Error Cause" }, { PARAMETER_REFUSAL_CAUSE, "Refusal Cause" }, { PARAMETER_DATA, "Data" }, { PARAMETER_SEGMENTATION, "Segmentation" }, { PARAMETER_HOP_COUNTER, "Hop Counter" }, { PARAMETER_IMPORTANCE, "Importance (ITU)" }, { PARAMETER_LONG_DATA, "Long Data" }, { PARAMETER_ISNI, "Intermediate Signaling Network Identification (ANSI)" }, { 0, NULL } }; #define END_OF_OPTIONAL_PARAMETERS_LENGTH 1 #define DESTINATION_LOCAL_REFERENCE_LENGTH 3 #define SOURCE_LOCAL_REFERENCE_LENGTH 3 #define PROTOCOL_CLASS_LENGTH 1 #define RECEIVE_SEQUENCE_NUMBER_LENGTH 1 #define CREDIT_LENGTH 1 #define RELEASE_CAUSE_LENGTH 1 #define RETURN_CAUSE_LENGTH 1 #define RESET_CAUSE_LENGTH 1 #define ERROR_CAUSE_LENGTH 1 #define REFUSAL_CAUSE_LENGTH 1 #define HOP_COUNTER_LENGTH 1 #define IMPORTANCE_LENGTH 1 /* Parts of the Called and Calling Address parameters */ /* Address Indicator */ #define ADDRESS_INDICATOR_LENGTH 1 #define ITU_RESERVED_MASK 0x80 #define ANSI_NATIONAL_MASK 0x80 #define ROUTING_INDICATOR_MASK 0x40 #define GTI_MASK 0x3C #define GTI_SHIFT 2 #define ITU_SSN_INDICATOR_MASK 0x02 #define ITU_PC_INDICATOR_MASK 0x01 #define ANSI_PC_INDICATOR_MASK 0x02 #define ANSI_SSN_INDICATOR_MASK 0x01 static const value_string sccp_ansi_national_indicator_values[] = { { 0x0, "Address coded to International standard" }, { 0x1, "Address coded to National standard" }, { 0, NULL } }; #define ROUTE_ON_GT 0x0 #define ROUTE_ON_SSN 0x1 #define ROUTING_INDICATOR_SHIFT 6 static const value_string sccp_routing_indicator_values[] = { { ROUTE_ON_GT, "Route on GT" }, { ROUTE_ON_SSN, "Route on SSN" }, { 0, NULL } }; #define AI_GTI_NO_GT 0x0 #define ITU_AI_GTI_NAI 0x1 #define AI_GTI_TT 0x2 #define ITU_AI_GTI_TT_NP_ES 0x3 #define ITU_AI_GTI_TT_NP_ES_NAI 0x4 static const value_string sccp_itu_global_title_indicator_values[] = { { AI_GTI_NO_GT, "No Global Title" }, { ITU_AI_GTI_NAI, "Nature of Address Indicator only" }, { AI_GTI_TT, "Translation Type only" }, { ITU_AI_GTI_TT_NP_ES, "Translation Type, Numbering Plan, and Encoding Scheme included" }, { ITU_AI_GTI_TT_NP_ES_NAI, "Translation Type, Numbering Plan, Encoding Scheme, and Nature of Address Indicator included" }, { 0, NULL } }; /* #define AI_GTI_NO_GT 0x0 */ #define ANSI_AI_GTI_TT_NP_ES 0x1 /* #define AI_GTI_TT 0x2 */ static const value_string sccp_ansi_global_title_indicator_values[] = { { AI_GTI_NO_GT, "No Global Title" }, { ANSI_AI_GTI_TT_NP_ES, "Translation Type, Numbering Plan, and Encoding Scheme included" }, { AI_GTI_TT, "Translation Type only" }, { 0, NULL } }; static const value_string sccp_ai_pci_values[] = { { 0x1, "Point Code present" }, { 0x0, "Point Code not present" }, { 0, NULL } }; static const value_string sccp_ai_ssni_values[] = { { 0x1, "SSN present" }, { 0x0, "SSN not present" }, { 0, NULL } }; #define ADDRESS_SSN_LENGTH 1 #define INVALID_SSN 0xff /* Some values from 3GPP TS 23.003 */ /* Japan TTC and NTT define a lot of SSNs, some of which conflict with * these. They are not added for now. */ static const value_string sccp_ssn_values[] = { { 0x00, "SSN not known/not used" }, { 0x01, "SCCP management" }, { 0x02, "Reserved for ITU-T allocation" }, { 0x03, "ISDN User Part" }, { 0x04, "OMAP (Operation, Maintenance, and Administration Part)" }, { 0x05, "MAP (Mobile Application Part)" }, { 0x06, "HLR (Home Location Register)" }, { 0x07, "VLR (Visitor Location Register)" }, { 0x08, "MSC (Mobile Switching Center)" }, { 0x09, "EIC/EIR (Equipment Identifier Center/Equipment Identification Register)" }, { 0x0a, "AUC/AC (Authentication Center)" }, { 0x0b, "ISDN supplementary services (ITU only)" }, { 0x0c, "Reserved for international use (ITU only)" }, { 0x0d, "Broadband ISDN edge-to-edge applications (ITU only)" }, { 0x0e, "TC test responder (ITU only)" }, /* The following national network subsystem numbers have been allocated for use within and * between GSM/UMTS networks: */ { 0x8e, "RANAP" }, { 0x8f, "RNSAP" }, { 0x91, "GMLC(MAP)" }, { 0x92, "CAP" }, { 0x93, "gsmSCF (MAP) or IM-SSF (MAP) or Presence Network Agent" }, { 0x94, "SIWF (MAP)" }, { 0x95, "SGSN (MAP)" }, { 0x96, "GGSN (MAP)" }, /* The following national network subsystem numbers have been allocated for use within GSM/UMTS networks:*/ { 0xf8, "CSS (MAP)" }, { 0xf9, "PCAP" }, { 0xfa, "BSC (BSSAP-LE)" }, { 0xfb, "MSC (BSSAP-LE)" }, { 0xfc, "IOS or SMLC (BSSAP-LE)" }, { 0xfd, "BSS O&M (A interface)" }, { 0xfe, "BSSAP/BSAP" }, { 0, NULL } }; /* * * * * * * * * * * * * * * * * * Global Title: ITU GTI == 0001 * * * * * * * * * * * * * * * * * */ #define GT_NAI_MASK 0x7F #define GT_NAI_LENGTH 1 #define GT_NAI_UNKNOWN 0x00 #define GT_NAI_SUBSCRIBER_NUMBER 0x01 #define GT_NAI_RESERVED_NATIONAL 0x02 #define GT_NAI_NATIONAL_SIG_NUM 0x03 #define GT_NAI_INTERNATIONAL_NUM 0x04 static const value_string sccp_nai_values[] = { { GT_NAI_UNKNOWN, "NAI unknown" }, { GT_NAI_SUBSCRIBER_NUMBER, "Subscriber Number" }, { GT_NAI_RESERVED_NATIONAL, "Reserved for national use" }, { GT_NAI_NATIONAL_SIG_NUM, "National significant number" }, { GT_NAI_INTERNATIONAL_NUM, "International number" }, { 0, NULL } }; #define GT_OE_MASK 0x80 #define GT_OE_EVEN 0 #define GT_OE_ODD 1 static const value_string sccp_oe_values[] = { { GT_OE_EVEN, "Even number of address signals" }, { GT_OE_ODD, "Odd number of address signals" }, { 0, NULL } }; const value_string sccp_address_signal_values[] = { { 0, "0" }, { 1, "1" }, { 2, "2" }, { 3, "3" }, { 4, "4" }, { 5, "5" }, { 6, "6" }, { 7, "7" }, { 8, "8" }, { 9, "9" }, { 10, "(spare)" }, { 11, "11" }, { 12, "12" }, { 13, "(spare)" }, { 14, "(spare)" }, { 15, "ST" }, { 0, NULL } }; /* * * * * * * * * * * * * * * * * * * * * * Global Title: ITU and ANSI GTI == 0010 * * * * * * * * * * * * * * * * * * * * * */ #define GT_TT_LENGTH 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * Global Title: ITU GTI == 0011, ANSI GTI == 0001 * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define GT_NP_MASK 0xf0 #define GT_NP_SHIFT 4 #define GT_NP_ES_LENGTH 1 #define GT_NP_UNKNOWN 0x00 #define GT_NP_ISDN 0x01 #define GT_NP_GENERIC_RESERVED 0x02 #define GT_NP_DATA 0x03 #define GT_NP_TELEX 0x04 #define GT_NP_MARITIME_MOBILE 0x05 #define GT_NP_LAND_MOBILE 0x06 #define GT_NP_ISDN_MOBILE 0x07 #define GT_NP_PRIVATE_NETWORK 0x0e #define GT_NP_RESERVED 0x0f static const value_string sccp_np_values[] = { { GT_NP_UNKNOWN, "Unknown" }, { GT_NP_ISDN, "ISDN/telephony" }, { GT_NP_GENERIC_RESERVED, "Generic (ITU)/Reserved (ANSI)" }, { GT_NP_DATA, "Data" }, { GT_NP_TELEX, "Telex" }, { GT_NP_MARITIME_MOBILE, "Maritime mobile" }, { GT_NP_LAND_MOBILE, "Land mobile" }, { GT_NP_ISDN_MOBILE, "ISDN/mobile" }, { GT_NP_PRIVATE_NETWORK, "Private network or network-specific" }, { GT_NP_RESERVED, "Reserved" }, { 0, NULL } }; #define GT_ES_MASK 0x0f #define GT_ES_UNKNOWN 0x0 #define GT_ES_BCD_ODD 0x1 #define GT_ES_BCD_EVEN 0x2 #define GT_ES_NATIONAL 0x3 #define GT_ES_RESERVED 0xf static const value_string sccp_es_values[] = { { GT_ES_UNKNOWN, "Unknown" }, { GT_ES_BCD_ODD, "BCD, odd number of digits" }, { GT_ES_BCD_EVEN, "BCD, even number of digits" }, { GT_ES_NATIONAL, "National specific" }, { GT_ES_RESERVED, "Reserved (ITU)/Spare (ANSI)" }, { 0, NULL } }; /* Address signals above */ /* * * * * * * * * * * * * * * * * * Global Title: ITU GTI == 0100 * * * * * * * * * * * * * * * * * */ /* NP above */ /* ES above */ /* NAI above */ /* Address signals above */ #define CLASS_CLASS_MASK 0xf #define CLASS_SPARE_HANDLING_MASK 0xf0 #define CLASS_SPARE_HANDLING_SHIFT 4 static const value_string sccp_class_handling_values [] = { { 0x0, "No special options" }, { 0x8, "Return message on error" }, { 0, NULL } }; #define SEGMENTING_REASSEMBLING_LENGTH 1 #define SEGMENTING_REASSEMBLING_MASK 0x01 #define NO_MORE_DATA 0 #define MORE_DATA 1 /* This is also used by sequencing-segmenting parameter */ static const value_string sccp_segmenting_reassembling_values [] = { { NO_MORE_DATA, "No more data" }, { MORE_DATA, "More data" }, { 0, NULL } }; #define RECEIVE_SEQUENCE_NUMBER_LENGTH 1 #define RSN_MASK 0xfe #define SEQUENCING_SEGMENTING_LENGTH 2 #define SEQUENCING_SEGMENTING_SSN_LENGTH 1 #define SEQUENCING_SEGMENTING_RSN_LENGTH 1 #define SEND_SEQUENCE_NUMBER_MASK 0xfe #define RECEIVE_SEQUENCE_NUMBER_MASK 0xfe #define SEQUENCING_SEGMENTING_MORE_MASK 0x01 #define CREDIT_LENGTH 1 #define RELEASE_CAUSE_LENGTH 1 const value_string sccp_release_cause_values [] = { { 0x00, "End user originated" }, { 0x01, "End user congestion" }, { 0x02, "End user failure" }, { 0x03, "SCCP user originated" }, { 0x04, "Remote procedure error" }, { 0x05, "Inconsistent connection data" }, { 0x06, "Access failure" }, { 0x07, "Access congestion" }, { 0x08, "Subsystem failure" }, { 0x09, "Subsystem congestion" }, { 0x0a, "MTP failure" }, { 0x0b, "Network congestion" }, { 0x0c, "Expiration of reset timer" }, { 0x0d, "Expiration of receive inactivity timer" }, { 0x0e, "Reserved" }, { 0x0f, "Unqualified" }, { 0x10, "SCCP failure (ITU only)" }, { 0, NULL } }; #define RETURN_CAUSE_LENGTH 1 const value_string sccp_return_cause_values [] = { { 0x00, "No translation for an address of such nature" }, { 0x01, "No translation for this specific address" }, { 0x02, "Subsystem congestion" }, { 0x03, "Subsystem failure" }, { 0x04, "Unequipped failure" }, { 0x05, "MTP failure" }, { 0x06, "Network congestion" }, { 0x07, "Unqualified" }, { 0x08, "Error in message transport" }, { 0x09, "Error in local processing" }, { 0x0a, "Destination cannot perform reassembly" }, { 0x0b, "SCCP failure" }, { 0x0c, "Hop counter violation" }, { 0x0d, "Segmentation not supported" }, { 0x0e, "Segmentation failure" }, { 0xf7, "Message change failure (ANSI only)" }, { 0xf8, "Invalid INS routing request (ANSI only)" }, { 0xf9, "Invalid ISNI routing request (ANSI only)"}, { 0xfa, "Unauthorized message (ANSI only)" }, { 0xfb, "Message incompatibility (ANSI only)" }, { 0xfc, "Cannot perform ISNI constrained routing (ANSI only)" }, { 0xfd, "Redundant ISNI constrained routing (ANSI only)" }, { 0xfe, "Unable to perform ISNI identification (ANSI only)" }, { 0, NULL } }; #define RESET_CAUSE_LENGTH 1 const value_string sccp_reset_cause_values [] = { { 0x00, "End user originated" }, { 0x01, "SCCP user originated" }, { 0x02, "Message out of order - incorrect send sequence number" }, { 0x03, "Message out of order - incorrect receive sequence number" }, { 0x04, "Remote procedure error - message out of window" }, { 0x05, "Remote procedure error - incorrect send sequence number after (re)initialization" }, { 0x06, "Remote procedure error - general" }, { 0x07, "Remote end user operational" }, { 0x08, "Network operational" }, { 0x09, "Access operational" }, { 0x0a, "Network congestion" }, { 0x0b, "Reserved (ITU)/Not obtainable (ANSI)" }, { 0x0c, "Unqualified" }, { 0, NULL } }; #define ERROR_CAUSE_LENGTH 1 const value_string sccp_error_cause_values [] = { { 0x00, "Local Reference Number (LRN) mismatch - unassigned destination LRN" }, { 0x01, "Local Reference Number (LRN) mismatch - inconsistent source LRN" }, { 0x02, "Point code mismatch" }, { 0x03, "Service class mismatch" }, { 0x04, "Unqualified" }, { 0, NULL } }; #define REFUSAL_CAUSE_LENGTH 1 const value_string sccp_refusal_cause_values [] = { { 0x00, "End user originated" }, { 0x01, "End user congestion" }, { 0x02, "End user failure" }, { 0x03, "SCCP user originated" }, { 0x04, "Destination address unknown" }, { 0x05, "Destination inaccessible" }, { 0x06, "Network resource - QOS not available/non-transient" }, { 0x07, "Network resource - QOS not available/transient" }, { 0x08, "Access failure" }, { 0x09, "Access congestion" }, { 0x0a, "Subsystem failure" }, { 0x0b, "Subsystem congestion" }, { 0x0c, "Expiration of connection establishment timer" }, { 0x0d, "Incompatible user data" }, { 0x0e, "Reserved" }, { 0x0f, "Unqualified" }, { 0x10, "Hop counter violation" }, { 0x11, "SCCP failure (ITU only)" }, { 0x12, "No translation for an address of such nature" }, { 0x13, "Unequipped user" }, { 0, NULL } }; #define SEGMENTATION_LENGTH 4 #define SEGMENTATION_FIRST_SEGMENT_MASK 0x80 #define SEGMENTATION_CLASS_MASK 0x40 #define SEGMENTATION_SPARE_MASK 0x30 #define SEGMENTATION_REMAINING_MASK 0x0f static const value_string sccp_segmentation_first_segment_values [] = { { 1, "First segment" }, { 0, "Not first segment" }, { 0, NULL } }; static const value_string sccp_segmentation_class_values [] = { { 0, "Class 0 selected" }, { 1, "Class 1 selected" }, { 0, NULL } }; #define HOP_COUNTER_LENGTH 1 #define IMPORTANCE_LENGTH 1 #define IMPORTANCE_IMPORTANCE_MASK 0x7 #define ANSI_ISNI_ROUTING_CONTROL_LENGTH 1 #define ANSI_ISNI_MI_MASK 0x01 #define ANSI_ISNI_IRI_MASK 0x06 #define ANSI_ISNI_RES_MASK 0x08 #define ANSI_ISNI_TI_MASK 0x10 #define ANSI_ISNI_TI_SHIFT 4 #define ANSI_ISNI_COUNTER_MASK 0xe0 #define ANSI_ISNI_NETSPEC_MASK 0x03 static const value_string sccp_isni_mark_for_id_values [] = { { 0x0, "Do not identify networks" }, { 0x1, "Identify networks" }, { 0, NULL } }; static const value_string sccp_isni_iri_values [] = { { 0x0, "Neither constrained nor suggested ISNI routing" }, { 0x1, "Constrained ISNI routing" }, { 0x2, "Reserved for suggested ISNI routing" }, { 0x3, "Spare" }, { 0, NULL } }; #define ANSI_ISNI_TYPE_0 0x0 #define ANSI_ISNI_TYPE_1 0x1 static const value_string sccp_isni_ti_values [] = { { ANSI_ISNI_TYPE_0, "Type zero ISNI parameter format" }, { ANSI_ISNI_TYPE_1, "Type one ISNI parameter format" }, { 0, NULL } }; /* Laded from e212 hf*/ static int hf_assoc_imsi = -1; /* Initialize the protocol and registered fields */ static int proto_sccp = -1; static int hf_sccp_message_type = -1; static int hf_sccp_variable_pointer1 = -1; static int hf_sccp_variable_pointer2 = -1; static int hf_sccp_variable_pointer3 = -1; static int hf_sccp_optional_pointer = -1; static int hf_sccp_param_length = -1; static int hf_sccp_ssn = -1; static int hf_sccp_gt_digits = -1; /* Called Party address */ static int hf_sccp_called_ansi_national_indicator = -1; static int hf_sccp_called_itu_natl_use_bit = -1; static int hf_sccp_called_routing_indicator = -1; static int hf_sccp_called_itu_global_title_indicator = -1; static int hf_sccp_called_ansi_global_title_indicator = -1; static int hf_sccp_called_itu_ssn_indicator = -1; static int hf_sccp_called_itu_point_code_indicator = -1; static int hf_sccp_called_ansi_ssn_indicator = -1; static int hf_sccp_called_ansi_point_code_indicator = -1; static int hf_sccp_called_ssn = -1; static int hf_sccp_called_pc_member = -1; static int hf_sccp_called_pc_cluster = -1; static int hf_sccp_called_pc_network = -1; static int hf_sccp_called_ansi_pc = -1; static int hf_sccp_called_chinese_pc = -1; static int hf_sccp_called_itu_pc = -1; static int hf_sccp_called_japan_pc = -1; static int hf_sccp_called_gt_nai = -1; static int hf_sccp_called_gt_oe = -1; static int hf_sccp_called_gt_tt = -1; static int hf_sccp_called_gt_np = -1; static int hf_sccp_called_gt_es = -1; static int hf_sccp_called_gt_digits = -1; static int hf_sccp_called_gt_digits_length = -1; /* Calling party address */ static int hf_sccp_calling_ansi_national_indicator = -1; static int hf_sccp_calling_itu_natl_use_bit = -1; static int hf_sccp_calling_routing_indicator = -1; static int hf_sccp_calling_itu_global_title_indicator = -1; static int hf_sccp_calling_ansi_global_title_indicator = -1; static int hf_sccp_calling_itu_ssn_indicator = -1; static int hf_sccp_calling_itu_point_code_indicator = -1; static int hf_sccp_calling_ansi_ssn_indicator = -1; static int hf_sccp_calling_ansi_point_code_indicator = -1; static int hf_sccp_calling_ssn = -1; static int hf_sccp_calling_pc_member = -1; static int hf_sccp_calling_pc_cluster = -1; static int hf_sccp_calling_pc_network = -1; static int hf_sccp_calling_ansi_pc = -1; static int hf_sccp_calling_chinese_pc = -1; static int hf_sccp_calling_itu_pc = -1; static int hf_sccp_calling_japan_pc = -1; static int hf_sccp_calling_gt_nai = -1; static int hf_sccp_calling_gt_oe = -1; static int hf_sccp_calling_gt_tt = -1; static int hf_sccp_calling_gt_np = -1; static int hf_sccp_calling_gt_es = -1; static int hf_sccp_calling_gt_digits = -1; static int hf_sccp_calling_gt_digits_length = -1; /* Other parameter values */ static int hf_sccp_dlr = -1; static int hf_sccp_slr = -1; static int hf_sccp_lr = -1; static int hf_sccp_class = -1; static int hf_sccp_handling = -1; static int hf_sccp_more = -1; static int hf_sccp_rsn = -1; static int hf_sccp_sequencing_segmenting_ssn = -1; static int hf_sccp_sequencing_segmenting_rsn = -1; static int hf_sccp_sequencing_segmenting_more = -1; static int hf_sccp_credit = -1; static int hf_sccp_release_cause = -1; static int hf_sccp_return_cause = -1; static int hf_sccp_reset_cause = -1; static int hf_sccp_error_cause = -1; static int hf_sccp_refusal_cause = -1; static int hf_sccp_segmentation_first = -1; static int hf_sccp_segmentation_class = -1; static int hf_sccp_segmentation_remaining = -1; static int hf_sccp_segmentation_slr = -1; static int hf_sccp_hop_counter = -1; static int hf_sccp_importance = -1; static int hf_sccp_ansi_isni_mi = -1; static int hf_sccp_ansi_isni_iri = -1; static int hf_sccp_ansi_isni_ti = -1; static int hf_sccp_ansi_isni_netspec = -1; static int hf_sccp_ansi_isni_counter = -1; static int hf_sccp_ansi_isni_network = -1; static int hf_sccp_ansi_isni_cluster = -1; static int hf_sccp_xudt_msg_fragments = -1; static int hf_sccp_xudt_msg_fragment = -1; static int hf_sccp_xudt_msg_fragment_overlap = -1; static int hf_sccp_xudt_msg_fragment_overlap_conflicts = -1; static int hf_sccp_xudt_msg_fragment_multiple_tails = -1; static int hf_sccp_xudt_msg_fragment_too_long_fragment = -1; static int hf_sccp_xudt_msg_fragment_error = -1; static int hf_sccp_xudt_msg_fragment_count = -1; static int hf_sccp_xudt_msg_reassembled_in = -1; static int hf_sccp_xudt_msg_reassembled_length = -1; static int hf_sccp_assoc_msg = -1; static int hf_sccp_assoc_id = -1; static int hf_sccp_segmented_data = -1; static int hf_sccp_linked_dissector = -1; static int hf_sccp_end_optional_param = -1; static int hf_sccp_unknown_message = -1; static int hf_sccp_unknown_parameter = -1; /* Initialize the subtree pointers */ static gint ett_sccp = -1; static gint ett_sccp_called = -1; static gint ett_sccp_called_ai = -1; static gint ett_sccp_called_pc = -1; static gint ett_sccp_called_gt = -1; static gint ett_sccp_called_gt_digits = -1; static gint ett_sccp_calling = -1; static gint ett_sccp_calling_ai = -1; static gint ett_sccp_calling_pc = -1; static gint ett_sccp_calling_gt = -1; static gint ett_sccp_calling_gt_digits = -1; static gint ett_sccp_sequencing_segmenting = -1; static gint ett_sccp_segmentation = -1; static gint ett_sccp_ansi_isni_routing_control = -1; static gint ett_sccp_xudt_msg_fragment = -1; static gint ett_sccp_xudt_msg_fragments = -1; static gint ett_sccp_assoc = -1; static expert_field ei_sccp_wrong_length = EI_INIT; static expert_field ei_sccp_international_standard_address = EI_INIT; static expert_field ei_sccp_no_ssn_present = EI_INIT; static expert_field ei_sccp_ssn_zero = EI_INIT; static expert_field ei_sccp_class_unexpected = EI_INIT; static expert_field ei_sccp_handling_invalid = EI_INIT; static expert_field ei_sccp_gt_digits_missing = EI_INIT; static expert_field ei_sccp_externally_reassembled = EI_INIT; static gboolean sccp_reassemble = TRUE; static gboolean show_key_params = FALSE; static gboolean set_addresses = FALSE; static gboolean dt1_ignore_length = FALSE; static int ss7pc_address_type = -1; static int sccp_tap = -1; static const fragment_items sccp_xudt_msg_frag_items = { /* Fragment subtrees */ &ett_sccp_xudt_msg_fragment, &ett_sccp_xudt_msg_fragments, /* Fragment fields */ &hf_sccp_xudt_msg_fragments, &hf_sccp_xudt_msg_fragment, &hf_sccp_xudt_msg_fragment_overlap, &hf_sccp_xudt_msg_fragment_overlap_conflicts, &hf_sccp_xudt_msg_fragment_multiple_tails, &hf_sccp_xudt_msg_fragment_too_long_fragment, &hf_sccp_xudt_msg_fragment_error, &hf_sccp_xudt_msg_fragment_count, /* Reassembled in field */ &hf_sccp_xudt_msg_reassembled_in, /* Reassembled length field */ &hf_sccp_xudt_msg_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "SCCP XUDT Message fragments" }; static reassembly_table sccp_xudt_msg_reassembly_table; #define SCCP_USER_DATA 0 #define SCCP_USER_TCAP 1 #define SCCP_USER_RANAP 2 #define SCCP_USER_BSSAP 3 #define SCCP_USER_GSMMAP 4 #define SCCP_USER_CAMEL 5 #define SCCP_USER_INAP 6 #define SCCP_USER_BSAP 7 #define SCCP_USER_BSSAP_LE 8 #define SCCP_USER_BSSAP_PLUS 9 typedef struct _sccp_user_t { guint ni; range_t *called_pc; range_t *called_ssn; guint user; gboolean uses_tcap; dissector_handle_t *handlep; } sccp_user_t; static sccp_user_t *sccp_users; static guint num_sccp_users; static dissector_handle_t sccp_handle; static dissector_handle_t data_handle; static dissector_handle_t tcap_handle; static dissector_handle_t ranap_handle; static dissector_handle_t bssap_handle; static dissector_handle_t gsmmap_handle; static dissector_handle_t camel_handle; static dissector_handle_t inap_handle; static dissector_handle_t bsap_handle; static dissector_handle_t bssap_le_handle; static dissector_handle_t bssap_plus_handle; static dissector_handle_t default_handle; static const char *default_payload = NULL; static const value_string sccp_users_vals[] = { { SCCP_USER_DATA, "Data"}, { SCCP_USER_TCAP, "TCAP"}, { SCCP_USER_RANAP, "RANAP"}, { SCCP_USER_BSSAP, "BSSAP"}, { SCCP_USER_GSMMAP, "GSM MAP"}, { SCCP_USER_CAMEL, "CAMEL"}, { SCCP_USER_INAP, "INAP"}, { SCCP_USER_BSAP, "BSAP"}, { SCCP_USER_BSSAP_LE, "BSSAP-LE"}, { SCCP_USER_BSSAP_PLUS, "BSSAP+"}, { 0, NULL } }; /* * Here are the global variables associated with * the various user definable characteristics of the dissection */ static guint32 sccp_source_pc_global = 0; static gboolean sccp_show_length = FALSE; static gboolean trace_sccp = FALSE; static heur_dissector_list_t heur_subdissector_list; static dissector_table_t sccp_ssn_dissector_table; static wmem_tree_t *assocs = NULL; static sccp_assoc_info_t no_assoc = { 0,0,0,INVALID_SSN,INVALID_SSN,FALSE,FALSE,NULL,NULL,SCCP_PLOAD_NONE,NULL,NULL,NULL, NULL, 0 }; static guint32 next_assoc_id = 0; static const value_string assoc_protos[] = { { SCCP_PLOAD_BSSAP, "BSSAP" }, { SCCP_PLOAD_RANAP, "RANAP" }, { 0, NULL } }; /* * Fragment reassembly helpers. * * SCCP data can span multiple messages. As the same local reference number is * used throughout a connection, this identifier is not sufficient for * identifying reassembled PDUs with multiple fragments in the same frame. For * that reason, create a new identifier for each group of fragments based on the * more-data indicator (M-bit) and use that in place of the local reference * number. * * As an optimization, if fragments do not need reassembly (a single message * with the M-bit set), then no surrogate ID is needed nor stored since * reassembly is skipped. */ static guint32 sccp_reassembly_id_next; /* Maps a key to the current identifier as used in the reassembly API (first pass only). */ static wmem_tree_t *sccp_reassembly_ids; /* Maps (frame number, offset) to a reassembly API identifier. */ static wmem_map_t *sccp_reassembly_id_map; static guint32 sccp_reassembly_get_id_pass1(guint32 frame, guint32 offset, guint32 key, gboolean more_frags) { guint32 id = GPOINTER_TO_UINT(wmem_tree_lookup32(sccp_reassembly_ids, key)); if (!id) { if (!more_frags) { /* This is the last and only fragment, no need to reassembly anything. */ return 0; } /* This is a new fragment and "local reference", so create a new one. */ id = sccp_reassembly_id_next++; wmem_tree_insert32(sccp_reassembly_ids, key, GUINT_TO_POINTER(id)); } /* Save ID for second pass. */ guint64 *frame_offset = wmem_new(wmem_file_scope(), guint64); *frame_offset = ((guint64)offset << 32) | frame; wmem_map_insert(sccp_reassembly_id_map, frame_offset, GUINT_TO_POINTER(id)); return id; } static guint32 sccp_reassembly_get_id_pass2(guint32 frame, guint32 offset) { guint64 frame_offset = ((guint64)offset << 32) | frame; return GPOINTER_TO_UINT(wmem_map_lookup(sccp_reassembly_id_map, &frame_offset)); } /** * Returns the reassembly ID for the given frame at the given position or 0 if * reassembly is not necessary. */ static guint32 sccp_reassembly_get_id(packet_info *pinfo, guint32 offset, guint32 key, gboolean more_frags) { if (!PINFO_FD_VISITED(pinfo)) { return sccp_reassembly_get_id_pass1(pinfo->num, offset, key, more_frags); } else { return sccp_reassembly_get_id_pass2(pinfo->num, offset); } } static tvbuff_t * sccp_reassemble_fragments(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 length_offset, guint32 source_local_ref, gboolean more_frags) { gboolean save_fragmented; tvbuff_t *new_tvb; fragment_head *frag_msg = NULL; guint fragment_len; guint32 abs_offset, frags_id; fragment_len = tvb_get_guint8(tvb, length_offset); /* Assume that the absolute offset within the tvb uniquely identifies the * message in this frame. */ abs_offset = tvb_raw_offset(tvb) + length_offset; frags_id = sccp_reassembly_get_id(pinfo, abs_offset, source_local_ref, more_frags); if (frags_id) { /* * This fragment is part of multiple fragments, reassembly is required. */ save_fragmented = pinfo->fragmented; pinfo->fragmented = TRUE; frag_msg = fragment_add_seq_next(&sccp_xudt_msg_reassembly_table, tvb, length_offset + 1, pinfo, frags_id, /* ID for fragments belonging together */ NULL, fragment_len, /* fragment length - to the end */ more_frags); /* More fragments? */ if (!PINFO_FD_VISITED(pinfo) && frag_msg) { /* Reassembly has finished, ensure that the next fragment gets a new ID. */ wmem_tree_remove32(sccp_reassembly_ids, source_local_ref); } new_tvb = process_reassembled_data(tvb, length_offset + 1, pinfo, "Reassembled SCCP", frag_msg, &sccp_xudt_msg_frag_items, NULL, tree); if (frag_msg) { /* Reassembled */ col_append_str(pinfo->cinfo, COL_INFO, "(Message reassembled) "); } else { /* Not last packet of reassembled message */ col_append_str(pinfo->cinfo, COL_INFO, "(Message fragment) "); } pinfo->fragmented = save_fragmented; } else { /* * There is only a single fragment, reassembly is not required. */ new_tvb = tvb_new_subset_length(tvb, length_offset + 1, fragment_len); } return new_tvb; } #define is_connectionless(m) \ ( m == SCCP_MSG_TYPE_UDT || m == SCCP_MSG_TYPE_UDTS \ || m == SCCP_MSG_TYPE_XUDT|| m == SCCP_MSG_TYPE_XUDTS \ || m == SCCP_MSG_TYPE_LUDT|| m == SCCP_MSG_TYPE_LUDTS) #define RETURN_FALSE \ do { \ /*ws_warning("Frame %d not protocol %d @ line %d", frame_num, my_mtp3_standard, __LINE__);*/ \ return FALSE; \ } while (0) static void sccp_prompt(packet_info *pinfo _U_, gchar* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect SSN %d as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sccp, 0))); } static gpointer sccp_value(packet_info *pinfo) { return p_get_proto_data(pinfo->pool, pinfo, proto_sccp, 0); } static gboolean sccp_called_calling_looks_valid(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_mtp3_standard, gboolean is_co) { guint8 ai, ri, gti, ssni, pci; guint8 len_needed = 1; /* need at least the Address Indicator */ guint len = tvb_reported_length(tvb); ai = tvb_get_guint8(tvb, 0); if ((my_mtp3_standard == ANSI_STANDARD) && ((ai & ANSI_NATIONAL_MASK) == 0)) RETURN_FALSE; gti = (ai & GTI_MASK) >> GTI_SHIFT; if (my_mtp3_standard == ANSI_STANDARD) { if (gti > 2) RETURN_FALSE; } else { if (gti > 4) RETURN_FALSE; } ri = (ai & ROUTING_INDICATOR_MASK) >> ROUTING_INDICATOR_SHIFT; if (my_mtp3_standard == ANSI_STANDARD) { pci = ai & ANSI_PC_INDICATOR_MASK; ssni = ai & ANSI_SSN_INDICATOR_MASK; } else { ssni = ai & ITU_SSN_INDICATOR_MASK; pci = ai & ITU_PC_INDICATOR_MASK; } /* Route on SSN with no SSN? */ if ((ri == ROUTE_ON_SSN) && (ssni == 0)) RETURN_FALSE; /* Route on GT with no GT? */ if ((ri == ROUTE_ON_GT) && (gti == AI_GTI_NO_GT)) RETURN_FALSE; /* GT routed and connection-oriented (Class-2)? * Yes, that's theoretically possible, but it's not used. */ if ((ri == ROUTE_ON_GT) && is_co) RETURN_FALSE; if (ssni) len_needed += ADDRESS_SSN_LENGTH; if (pci) { if (my_mtp3_standard == ANSI_STANDARD || my_mtp3_standard == CHINESE_ITU_STANDARD) len_needed += ANSI_PC_LENGTH; else len_needed += ITU_PC_LENGTH; } if (gti) len_needed += 2; if (len_needed > len) RETURN_FALSE; return TRUE; } gboolean looks_like_valid_sccp(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_mtp3_standard) { guint offset; guint8 msgtype, msg_class, cause; guint called_ptr = 0; guint calling_ptr = 0; guint data_ptr = 0; guint opt_ptr = 0; guint8 pointer_length = POINTER_LENGTH; guint len = tvb_captured_length(tvb); /* Ensure we can do some basic checks without throwing an exception. * Accesses beyond this length need to check the length first because * we don't want to throw an exception in here... */ if (len < 5) RETURN_FALSE; msgtype = tvb_get_guint8(tvb, SCCP_MSG_TYPE_OFFSET); if (!try_val_to_str(msgtype, sccp_message_type_acro_values)) { RETURN_FALSE; } offset = SCCP_MSG_TYPE_LENGTH; switch (msgtype) { case SCCP_MSG_TYPE_UDT: case SCCP_MSG_TYPE_XUDT: case SCCP_MSG_TYPE_LUDT: case SCCP_MSG_TYPE_UDTS: case SCCP_MSG_TYPE_XUDTS: case SCCP_MSG_TYPE_LUDTS: { if (msgtype == SCCP_MSG_TYPE_XUDT || msgtype == SCCP_MSG_TYPE_XUDTS) { if (SCCP_MSG_TYPE_LENGTH + PROTOCOL_CLASS_LENGTH + /* or Cause for XUDTS */ HOP_COUNTER_LENGTH + POINTER_LENGTH + POINTER_LENGTH + POINTER_LENGTH + POINTER_LENGTH > len) RETURN_FALSE; } if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) { if (SCCP_MSG_TYPE_LENGTH + PROTOCOL_CLASS_LENGTH + /* or Cause for LUDTS */ HOP_COUNTER_LENGTH + POINTER_LENGTH_LONG + POINTER_LENGTH_LONG + POINTER_LENGTH_LONG + POINTER_LENGTH_LONG > len) RETURN_FALSE; pointer_length = POINTER_LENGTH_LONG; } if (msgtype == SCCP_MSG_TYPE_UDT || msgtype == SCCP_MSG_TYPE_XUDT || msgtype == SCCP_MSG_TYPE_LUDT) { msg_class = tvb_get_guint8(tvb, offset) & CLASS_CLASS_MASK; if (msg_class > 1) RETURN_FALSE; offset += PROTOCOL_CLASS_LENGTH; } if (msgtype == SCCP_MSG_TYPE_XUDT || msgtype == SCCP_MSG_TYPE_LUDT) offset += HOP_COUNTER_LENGTH; if (msgtype == SCCP_MSG_TYPE_UDTS || msgtype == SCCP_MSG_TYPE_XUDTS || msgtype == SCCP_MSG_TYPE_LUDTS) { cause = tvb_get_guint8(tvb, offset); if (!try_val_to_str(cause, sccp_return_cause_values)) RETURN_FALSE; offset += RETURN_CAUSE_LENGTH; } if (msgtype == SCCP_MSG_TYPE_XUDTS || msgtype == SCCP_MSG_TYPE_LUDTS) offset += HOP_COUNTER_LENGTH; if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) called_ptr = tvb_get_letohs(tvb, offset); else called_ptr = tvb_get_guint8(tvb, offset); if (called_ptr == 0) /* Mandatory variable parameters must be present */ RETURN_FALSE; called_ptr += offset; offset += pointer_length; if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) calling_ptr = tvb_get_letohs(tvb, offset); else calling_ptr = tvb_get_guint8(tvb, offset); if (calling_ptr == 0) /* Mandatory variable parameters must be present */ RETURN_FALSE; calling_ptr += offset; offset += pointer_length; if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) data_ptr = tvb_get_letohs(tvb, offset); else data_ptr = tvb_get_guint8(tvb, offset); if (data_ptr == 0) /* Mandatory variable parameters must be present */ RETURN_FALSE; data_ptr += offset; offset += pointer_length; if (msgtype == SCCP_MSG_TYPE_XUDT || msgtype == SCCP_MSG_TYPE_XUDTS) { opt_ptr = tvb_get_guint8(tvb, offset); offset += POINTER_LENGTH; } else if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) { opt_ptr = tvb_get_letohs(tvb, offset); offset += POINTER_LENGTH_LONG; } if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) { /* Long pointers count from the 2nd (MSB) octet of the pointer */ called_ptr += 1; calling_ptr += 1; data_ptr += 1; if (opt_ptr) opt_ptr += 1; } /* Check that the variable pointers are within bounds */ if (called_ptr > len || calling_ptr > len || data_ptr > len) RETURN_FALSE; /* Check that the lengths of the variable parameters are within bounds */ if (tvb_get_guint8(tvb, called_ptr)+called_ptr > len || tvb_get_guint8(tvb, calling_ptr)+calling_ptr > len) RETURN_FALSE; if (msgtype == SCCP_MSG_TYPE_LUDT || msgtype == SCCP_MSG_TYPE_LUDTS) { if (tvb_get_letohs(tvb, data_ptr)+data_ptr > len) RETURN_FALSE; } else { if (tvb_get_guint8(tvb, data_ptr)+data_ptr > len) RETURN_FALSE; } } break; case SCCP_MSG_TYPE_CR: { if (len < SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + PROTOCOL_CLASS_LENGTH + POINTER_LENGTH + POINTER_LENGTH) RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; /* Class is only the lower 4 bits, but the upper 4 bits are spare * in Class-2. Don't mask them off so the below comparison also * fails if any of those spare bits are set. */ msg_class = tvb_get_guint8(tvb, offset); if (msg_class != 2) RETURN_FALSE; offset += PROTOCOL_CLASS_LENGTH; data_ptr = tvb_get_guint8(tvb, offset); if (data_ptr == 0) RETURN_FALSE; offset += POINTER_LENGTH; opt_ptr = tvb_get_guint8(tvb, offset); if (opt_ptr == 0) RETURN_FALSE; offset += POINTER_LENGTH; } break; case SCCP_MSG_TYPE_CC: { if (len < SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + SOURCE_LOCAL_REFERENCE_LENGTH + PROTOCOL_CLASS_LENGTH + POINTER_LENGTH) RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; offset += SOURCE_LOCAL_REFERENCE_LENGTH; /* Class is only the lower 4 bits, but the upper 4 bits are spare * in Class-2. Don't mask them off so the below comparison also * fails if any of those spare bits are set. */ msg_class = tvb_get_guint8(tvb, offset); if (msg_class != 2) RETURN_FALSE; offset += PROTOCOL_CLASS_LENGTH; opt_ptr = tvb_get_guint8(tvb, offset); offset += POINTER_LENGTH; /* If the pointer isn't 0 (no optional parameters) or 1 (optional * parameter starts immediately after the pointer) then what would * be between the pointer and the parameter? */ if (opt_ptr > 1) RETURN_FALSE; /* If there are no optional parameters, are we at the end of the * message? */ if ((opt_ptr == 0) && (offset != len)) RETURN_FALSE; } break; case SCCP_MSG_TYPE_CREF: { if (len < SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + REFUSAL_CAUSE_LENGTH + POINTER_LENGTH) RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; cause = tvb_get_guint8(tvb, offset); if (!try_val_to_str(cause, sccp_refusal_cause_values)) RETURN_FALSE; offset += REFUSAL_CAUSE_LENGTH; opt_ptr = tvb_get_guint8(tvb, offset); offset += POINTER_LENGTH; /* If the pointer isn't 0 (no optional parameters) or 1 (optional * parameter starts immediately after the pointer) then what would * be between the pointer and the parameter? */ if (opt_ptr > 1) RETURN_FALSE; /* If there are no optional parameters, are we at the end of the * message? */ if ((opt_ptr == 0) && (offset != len)) RETURN_FALSE; } break; case SCCP_MSG_TYPE_RLSD: { if (len < SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + SOURCE_LOCAL_REFERENCE_LENGTH + RELEASE_CAUSE_LENGTH + POINTER_LENGTH) RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; offset += SOURCE_LOCAL_REFERENCE_LENGTH; cause = tvb_get_guint8(tvb, offset); if (!try_val_to_str(cause, sccp_release_cause_values)) RETURN_FALSE; offset += RELEASE_CAUSE_LENGTH; opt_ptr = tvb_get_guint8(tvb, offset); offset += POINTER_LENGTH; /* If the pointer isn't 0 (no optional parameters) or 1 (optional * parameter starts immediately after the pointer) then what would * be between the pointer and the parameter? */ if (opt_ptr > 1) RETURN_FALSE; /* If there are no optional parameters, are we at the end of the * message? */ if ((opt_ptr == 0) && (offset != len)) RETURN_FALSE; } break; case SCCP_MSG_TYPE_RLC: { if (len != SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + SOURCE_LOCAL_REFERENCE_LENGTH) RETURN_FALSE; } break; case SCCP_MSG_TYPE_ERR: { if (len != SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + ERROR_CAUSE_LENGTH) RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; cause = tvb_get_guint8(tvb, offset); if (!try_val_to_str(cause, sccp_error_cause_values)) RETURN_FALSE; } break; case SCCP_MSG_TYPE_DT1: { if (len < SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + SEGMENTING_REASSEMBLING_LENGTH + POINTER_LENGTH + PARAMETER_LENGTH_LENGTH + 1) /* At least 1 byte of payload */ RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; /* Are any of the spare bits in set? */ if (tvb_get_guint8(tvb, offset) & ~SEGMENTING_REASSEMBLING_MASK) RETURN_FALSE; offset += SEGMENTING_REASSEMBLING_LENGTH; data_ptr = tvb_get_guint8(tvb, offset) + offset; /* Verify the data pointer is within bounds */ if (data_ptr > len) RETURN_FALSE; offset += POINTER_LENGTH; /* Verify the data length uses the rest of the message */ if (tvb_get_guint8(tvb, data_ptr) + offset + 1U != len) RETURN_FALSE; } break; case SCCP_MSG_TYPE_IT: { if (len < SCCP_MSG_TYPE_LENGTH + DESTINATION_LOCAL_REFERENCE_LENGTH + SOURCE_LOCAL_REFERENCE_LENGTH + PROTOCOL_CLASS_LENGTH + SEQUENCING_SEGMENTING_LENGTH + CREDIT_LENGTH) RETURN_FALSE; offset += DESTINATION_LOCAL_REFERENCE_LENGTH; offset += SOURCE_LOCAL_REFERENCE_LENGTH; /* Class is only the lower 4 bits, but the upper 4 bits are spare * in Class-2. Don't mask them off so the below comparison also * fails if any of those spare bits are set. */ msg_class = tvb_get_guint8(tvb, offset); if (msg_class != 2) RETURN_FALSE; offset += PROTOCOL_CLASS_LENGTH; } break; case SCCP_MSG_TYPE_AK: case SCCP_MSG_TYPE_DT2: case SCCP_MSG_TYPE_EA: case SCCP_MSG_TYPE_ED: case SCCP_MSG_TYPE_RSC: case SCCP_MSG_TYPE_RSR: /* Class-3 is never actually used in the real world */ RETURN_FALSE; break; default: DISSECTOR_ASSERT_NOT_REACHED(); } if (called_ptr) { guint8 param_len = tvb_get_guint8(tvb, called_ptr); tvbuff_t *param_tvb; if (param_len == 0) RETURN_FALSE; param_tvb = tvb_new_subset_length(tvb, called_ptr+1, param_len); if (!sccp_called_calling_looks_valid(frame_num, param_tvb, my_mtp3_standard, !is_connectionless(msgtype))) RETURN_FALSE; } if (calling_ptr) { guint8 param_len = tvb_get_guint8(tvb, calling_ptr); tvbuff_t *param_tvb; if (param_len == 0) RETURN_FALSE; param_tvb = tvb_new_subset_length(tvb, calling_ptr+1, param_len); if (!sccp_called_calling_looks_valid(frame_num, param_tvb, my_mtp3_standard, !is_connectionless(msgtype))) RETURN_FALSE; } if (opt_ptr) { guint8 opt_param; opt_ptr += offset-pointer_length; /* (offset was already incremented) */ /* Check that the optional pointer is within bounds */ if (opt_ptr > len) RETURN_FALSE; opt_param = tvb_get_guint8(tvb, opt_ptr); /* Check if the (1st) optional parameter tag is valid */ if (!try_val_to_str(opt_param, sccp_parameter_values)) RETURN_FALSE; /* Check that the (1st) parameter length is within bounds */ if ((opt_param != PARAMETER_END_OF_OPTIONAL_PARAMETERS) && ((opt_ptr+1U) <= len) && ((tvb_get_guint8(tvb, opt_ptr+1U)+offset) > len)) RETURN_FALSE; /* If we're at the end of the parameters, are we also at the end of the * message? */ if ((opt_param == PARAMETER_END_OF_OPTIONAL_PARAMETERS) && ((opt_ptr+1U) != len)) RETURN_FALSE; } return TRUE; } static sccp_assoc_info_t * new_assoc(guint32 calling, guint32 called) { sccp_assoc_info_t *a = wmem_new0(wmem_file_scope(), sccp_assoc_info_t); a->id = next_assoc_id++; a->calling_dpc = calling; a->called_dpc = called; a->calling_ssn = INVALID_SSN; a->called_ssn = INVALID_SSN; a->msgs = NULL; a->curr_msg = NULL; a->payload = SCCP_PLOAD_NONE; a->calling_party = NULL; a->called_party = NULL; a->extra_info = NULL; a->imsi = NULL; return a; } sccp_assoc_info_t * get_sccp_assoc(packet_info *pinfo, guint offset, sccp_decode_context_t* value) { guint32 opck, dpck; address *opc = &(pinfo->src); address *dpc = &(pinfo->dst); guint framenum = pinfo->num; if (value->assoc) return value->assoc; opck = opc->type == ss7pc_address_type ? mtp3_pc_hash((const mtp3_addr_pc_t *)opc->data) : g_str_hash(address_to_str(pinfo->pool, opc)); dpck = dpc->type == ss7pc_address_type ? mtp3_pc_hash((const mtp3_addr_pc_t *)dpc->data) : g_str_hash(address_to_str(pinfo->pool, dpc)); switch (value->message_type) { case SCCP_MSG_TYPE_CR: { /* CR contains the opc,dpc,dlr key of backward messages swapped as dpc,opc,slr */ wmem_tree_key_t bw_key[4]; bw_key[0].length = 1; bw_key[0].key = &dpck; bw_key[1].length = 1; bw_key[1].key = &opck; bw_key[2].length = 1; bw_key[2].key = &value->slr; bw_key[3].length = 0; bw_key[3].key = NULL; if (! (value->assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) && ! PINFO_FD_VISITED(pinfo) ) { value->assoc = new_assoc(opck, dpck); wmem_tree_insert32_array(assocs, bw_key, value->assoc); value->assoc->has_bw_key = TRUE; } pinfo->p2p_dir = P2P_DIR_SENT; break; } case SCCP_MSG_TYPE_CC: { wmem_tree_key_t fw_key[4]; wmem_tree_key_t bw_key[4]; fw_key[0].length = 1; fw_key[0].key = &dpck; fw_key[1].length = 1; fw_key[1].key = &opck; fw_key[2].length = 1; fw_key[2].key = &value->slr; fw_key[3].length = 0; fw_key[3].key = NULL; bw_key[0].length = 1; bw_key[0].key = &opck; bw_key[1].length = 1; bw_key[1].key = &dpck; bw_key[2].length = 1; bw_key[2].key = &value->dlr; bw_key[3].length = 0; bw_key[3].key = NULL; if ( (value->assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) ) { goto got_assoc; } if ( (value->assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, fw_key) ) ) { goto got_assoc; } value->assoc = new_assoc(dpck, opck); got_assoc: pinfo->p2p_dir = P2P_DIR_RECV; if ( ! PINFO_FD_VISITED(pinfo) && ! value->assoc->has_bw_key ) { wmem_tree_insert32_array(assocs, bw_key, value->assoc); value->assoc->has_bw_key = TRUE; } if ( ! PINFO_FD_VISITED(pinfo) && ! value->assoc->has_fw_key ) { wmem_tree_insert32_array(assocs, fw_key, value->assoc); value->assoc->has_fw_key = TRUE; } break; } case SCCP_MSG_TYPE_IT: /* fall-through */ case SCCP_MSG_TYPE_RLC: { wmem_tree_key_t fw_key[4]; wmem_tree_key_t bw_key[4]; fw_key[0].length = 1; fw_key[0].key = &dpck; fw_key[1].length = 1; fw_key[1].key = &opck; fw_key[2].length = 1; fw_key[2].key = &value->slr; fw_key[3].length = 0; fw_key[3].key = NULL; bw_key[0].length = 1; bw_key[0].key = &opck; bw_key[1].length = 1; bw_key[1].key = &dpck; bw_key[2].length = 1; bw_key[2].key = &value->dlr; bw_key[3].length = 0; bw_key[3].key = NULL; if ( (value->assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) ) { goto got_assoc_rlc; } if ( (value->assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, fw_key) ) ) { goto got_assoc_rlc; } value->assoc = new_assoc(dpck, opck); got_assoc_rlc: pinfo->p2p_dir = P2P_DIR_SENT; if ( ! PINFO_FD_VISITED(pinfo) && ! value->assoc->has_bw_key ) { wmem_tree_insert32_array(assocs, bw_key, value->assoc); value->assoc->has_bw_key = TRUE; } if ( ! PINFO_FD_VISITED(pinfo) && ! value->assoc->has_fw_key ) { wmem_tree_insert32_array(assocs, fw_key, value->assoc); value->assoc->has_fw_key = TRUE; } break; } default: { wmem_tree_key_t key[4]; key[0].length = 1; key[0].key = &opck; key[1].length = 1; key[1].key = &dpck; key[2].length = 1; key[2].key = &value->dlr; key[3].length = 0; key[3].key = NULL; value->assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, key); if (value->assoc) { if (value->assoc->calling_dpc == dpck) { pinfo->p2p_dir = P2P_DIR_RECV; } else { pinfo->p2p_dir = P2P_DIR_SENT; } } break; } } if (value->assoc && trace_sccp) { if ( ! PINFO_FD_VISITED(pinfo)) { sccp_msg_info_t *msg = wmem_new0(wmem_file_scope(), sccp_msg_info_t); msg->framenum = framenum; msg->offset = offset; msg->data.co.next = NULL; msg->data.co.assoc = value->assoc; msg->data.co.label = NULL; msg->data.co.comment = NULL; msg->data.co.imsi = NULL; msg->type = value->message_type; if (value->assoc->msgs) { sccp_msg_info_t *m; for (m = value->assoc->msgs; m->data.co.next; m = m->data.co.next) ; m->data.co.next = msg; } else { value->assoc->msgs = msg; } value->assoc->curr_msg = msg; } else { sccp_msg_info_t *m; for (m = value->assoc->msgs; m; m = m->data.co.next) { if (m->data.co.imsi != NULL && value->assoc->imsi == NULL) { value->assoc->imsi = wmem_strdup(wmem_epan_scope(), m->data.co.imsi); } if ((m->framenum == framenum) && (m->offset == offset)) { value->assoc->curr_msg = m; break; } } } } return value->assoc ? value->assoc : &no_assoc; } static void dissect_sccp_unknown_message(tvbuff_t *message_tvb, proto_tree *sccp_tree) { guint32 message_length; message_length = tvb_captured_length(message_tvb); proto_tree_add_bytes_format(sccp_tree, hf_sccp_unknown_message, message_tvb, 0, message_length, NULL, "Unknown message (%u byte%s)", message_length, plurality(message_length, "", "s")); } static void dissect_sccp_unknown_param(tvbuff_t *tvb, proto_tree *tree, guint8 type, guint length) { proto_tree_add_bytes_format(tree, hf_sccp_unknown_parameter, tvb, 0, length, NULL, "Unknown parameter 0x%x (%u byte%s)", type, length, plurality(length, "", "s")); } static void dissect_sccp_dlr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, sccp_decode_context_t* sccp_info) { proto_item *lr_item; if (length != 3) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 3, got %u", length); return; } sccp_info->dlr = tvb_get_letoh24(tvb, 0); proto_tree_add_uint(tree, hf_sccp_dlr, tvb, 0, length, sccp_info->dlr); lr_item = proto_tree_add_uint(tree, hf_sccp_lr, tvb, 0, length, sccp_info->dlr); proto_item_set_generated(lr_item); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "DLR=%d ", sccp_info->dlr); } static void dissect_sccp_slr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, sccp_decode_context_t* sccp_info) { proto_item *lr_item; if (length != 3) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 3, got %u", length); return; } sccp_info->slr = tvb_get_letoh24(tvb, 0); proto_tree_add_uint(tree, hf_sccp_slr, tvb, 0, length, sccp_info->slr); lr_item = proto_tree_add_uint(tree, hf_sccp_lr, tvb, 0, length, sccp_info->slr); proto_item_set_generated(lr_item); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "SLR=%d ", sccp_info->slr); } static proto_tree * dissect_sccp_gt_address_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, gboolean even_length, gboolean called, sccp_decode_context_t* sccp_info) { guint offset = 0; guint8 odd_signal, even_signal; proto_item *digits_item; proto_tree *digits_tree; char *gt_digits; gt_digits = (char *)wmem_alloc0(pinfo->pool, GT_MAX_SIGNALS+1); while (offset < length) { odd_signal = tvb_get_guint8(tvb, offset) & GT_ODD_SIGNAL_MASK; even_signal = tvb_get_guint8(tvb, offset) & GT_EVEN_SIGNAL_MASK; even_signal >>= GT_EVEN_SIGNAL_SHIFT; (void) g_strlcat(gt_digits, val_to_str(odd_signal, sccp_address_signal_values, "Unknown: %d"), GT_MAX_SIGNALS+1); /* If the last signal is NOT filler */ if (offset != (length - 1) || even_length == TRUE) (void) g_strlcat(gt_digits, val_to_str(even_signal, sccp_address_signal_values, "Unknown: %d"), GT_MAX_SIGNALS+1); offset += GT_SIGNAL_LENGTH; } if (is_connectionless(sccp_info->message_type) && sccp_info->sccp_msg) { guint8 **gt_ptr = called ? &(sccp_info->sccp_msg->data.ud.called_gt) : &(sccp_info->sccp_msg->data.ud.calling_gt); *gt_ptr = (guint8 *)wmem_strdup(pinfo->pool, gt_digits); } digits_item = proto_tree_add_string(tree, called ? hf_sccp_called_gt_digits : hf_sccp_calling_gt_digits, tvb, 0, length, gt_digits); digits_tree = proto_item_add_subtree(digits_item, called ? ett_sccp_called_gt_digits : ett_sccp_calling_gt_digits); if (set_addresses) { if (called) { set_address(&pinfo->dst, AT_STRINGZ, 1+(int)strlen(gt_digits), gt_digits); } else { set_address(&pinfo->src, AT_STRINGZ, 1+(int)strlen(gt_digits), gt_digits); } } proto_tree_add_string(digits_tree, hf_sccp_gt_digits, tvb, 0, length, gt_digits); proto_tree_add_uint(digits_tree, called ? hf_sccp_called_gt_digits_length : hf_sccp_calling_gt_digits_length, tvb, 0, length, (guint32)strlen(gt_digits)); return digits_tree; } static void dissect_sccp_global_title(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, guint8 gti, gboolean called, sccp_decode_context_t* sccp_info) { proto_item *gt_item; proto_tree *gt_tree; proto_tree *digits_tree; tvbuff_t *signals_tvb; guint offset = 0; guint8 odd_even, nai = 0, np = 0, es; gboolean even = TRUE; /* Shift GTI to where we can work with it */ gti >>= GTI_SHIFT; gt_tree = proto_tree_add_subtree_format(tree, tvb, offset, length, called ? ett_sccp_called_gt : ett_sccp_calling_gt, &gt_item, "Global Title 0x%x (%u byte%s)", gti, length, plurality(length,"", "s")); /* Decode Transaction Type (if present) */ if ((gti == AI_GTI_TT) || ((decode_mtp3_standard != ANSI_STANDARD) && ((gti == ITU_AI_GTI_TT_NP_ES) || (gti == ITU_AI_GTI_TT_NP_ES_NAI))) || ((decode_mtp3_standard == ANSI_STANDARD) && (gti == ANSI_AI_GTI_TT_NP_ES))) { proto_tree_add_item(gt_tree, called ? hf_sccp_called_gt_tt : hf_sccp_calling_gt_tt, tvb, offset, GT_TT_LENGTH, ENC_NA); offset += GT_TT_LENGTH; } if (gti == AI_GTI_TT) { /* Protocol doesn't tell us, so we ASSUME even... */ even = TRUE; } /* Decode Numbering Plan and Encoding Scheme (if present) */ if (((decode_mtp3_standard != ANSI_STANDARD) && ((gti == ITU_AI_GTI_TT_NP_ES) || (gti == ITU_AI_GTI_TT_NP_ES_NAI))) || ((decode_mtp3_standard == ANSI_STANDARD) && (gti == ANSI_AI_GTI_TT_NP_ES))) { np = tvb_get_guint8(tvb, offset) & GT_NP_MASK; proto_tree_add_uint(gt_tree, called ? hf_sccp_called_gt_np : hf_sccp_calling_gt_np, tvb, offset, GT_NP_ES_LENGTH, np); es = tvb_get_guint8(tvb, offset) & GT_ES_MASK; proto_tree_add_uint(gt_tree, called ? hf_sccp_called_gt_es : hf_sccp_calling_gt_es, tvb, offset, GT_NP_ES_LENGTH, es); even = (es == GT_ES_BCD_EVEN) ? TRUE : FALSE; offset += GT_NP_ES_LENGTH; } /* Decode Nature of Address Indicator (if present) */ if ((decode_mtp3_standard != ANSI_STANDARD) && ((gti == ITU_AI_GTI_NAI) || (gti == ITU_AI_GTI_TT_NP_ES_NAI))) { /* Decode Odd/Even Indicator (if present) */ if (gti == ITU_AI_GTI_NAI) { odd_even = tvb_get_guint8(tvb, offset) & GT_OE_MASK; proto_tree_add_uint(gt_tree, called ? hf_sccp_called_gt_oe : hf_sccp_calling_gt_oe, tvb, offset, GT_NAI_LENGTH, odd_even); even = (odd_even == GT_OE_EVEN) ? TRUE : FALSE; } nai = tvb_get_guint8(tvb, offset) & GT_NAI_MASK; proto_tree_add_uint(gt_tree, called ? hf_sccp_called_gt_nai : hf_sccp_calling_gt_nai, tvb, offset, GT_NAI_LENGTH, nai); offset += GT_NAI_LENGTH; } if(length == 0){ expert_add_info(pinfo, gt_item, &ei_sccp_gt_digits_missing); return; } /* Decode address signal(s) */ if (length < offset) return; signals_tvb = tvb_new_subset_length(tvb, offset, (length - offset)); digits_tree = dissect_sccp_gt_address_information(signals_tvb, pinfo, gt_tree, (length - offset), even, called, sccp_info); /* Display the country code (if we can) */ switch (np >> GT_NP_SHIFT) { case GT_NP_ISDN: case GT_NP_ISDN_MOBILE: if (nai == GT_NAI_INTERNATIONAL_NUM) { dissect_e164_cc(signals_tvb, digits_tree, 0, E164_ENC_BCD); } break; case GT_NP_LAND_MOBILE: dissect_e212_mcc_mnc_in_address(signals_tvb, pinfo, digits_tree, 0); break; default: break; } } static int dissect_sccp_3byte_pc(tvbuff_t *tvb, proto_tree *call_tree, guint offset, gboolean called) { int hf_pc; if (decode_mtp3_standard == ANSI_STANDARD) { if (called) hf_pc = hf_sccp_called_ansi_pc; else hf_pc = hf_sccp_calling_ansi_pc; } else /* CHINESE_ITU_STANDARD */ { if (called) hf_pc = hf_sccp_called_chinese_pc; else hf_pc = hf_sccp_calling_chinese_pc; } /* create and fill the PC tree */ dissect_mtp3_3byte_pc(tvb, offset, call_tree, called ? ett_sccp_called_pc : ett_sccp_calling_pc, hf_pc, called ? hf_sccp_called_pc_network : hf_sccp_calling_pc_network, called ? hf_sccp_called_pc_cluster : hf_sccp_calling_pc_cluster, called ? hf_sccp_called_pc_member : hf_sccp_calling_pc_member, 0, 0); return(offset + ANSI_PC_LENGTH); } /* FUNCTION dissect_sccp_called_calling_param(): * Dissect the Calling or Called Party Address parameters. * * The boolean 'called' describes whether this function is decoding a * called (TRUE) or calling (FALSE) party address. There is simply too * much code in this function to have 2 copies of it (one for called, one * for calling). * * NOTE: this function is called even when (!tree) so that we can get * the SSN and subsequently call subdissectors (if and when there's a data * parameter). Realistically we should put if (!tree)'s around a lot of the * code, but I think that would make it unreadable--and the expense of not * doing so does not appear to be very high. */ static void dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint length, gboolean called, sccp_decode_context_t* sccp_info) { proto_item *call_ai_item, *item, *hidden_item, *expert_item; proto_tree *call_tree, *call_ai_tree; guint offset; guint8 national = 0xFFU, routing_ind, gti, pci, ssni, ssn; tvbuff_t *gt_tvb; dissector_handle_t ssn_dissector = NULL, tcap_ssn_dissector = NULL; const char *ssn_dissector_description = NULL; const char *tcap_ssn_dissector_description = NULL; call_tree = proto_tree_add_subtree_format(tree, tvb, 0, length, called ? ett_sccp_called : ett_sccp_calling, NULL, "%s Party address (%u byte%s)", called ? "Called" : "Calling", length, plurality(length, "", "s")); call_ai_tree = proto_tree_add_subtree(call_tree, tvb, 0, ADDRESS_INDICATOR_LENGTH, called ? ett_sccp_called_ai : ett_sccp_calling_ai, &call_ai_item, "Address Indicator"); if (decode_mtp3_standard == ANSI_STANDARD) { national = tvb_get_guint8(tvb, 0) & ANSI_NATIONAL_MASK; expert_item = proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_ansi_national_indicator : hf_sccp_calling_ansi_national_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, national); if (national == 0) expert_add_info(pinfo, expert_item, &ei_sccp_international_standard_address); } else { guint8 natl_use_bit = tvb_get_guint8(tvb, 0) & ITU_RESERVED_MASK; proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_itu_natl_use_bit : hf_sccp_calling_itu_natl_use_bit, tvb, 0, ADDRESS_INDICATOR_LENGTH, natl_use_bit); } routing_ind = tvb_get_guint8(tvb, 0) & ROUTING_INDICATOR_MASK; proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_routing_indicator : hf_sccp_calling_routing_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, routing_ind); /* Only shift off the other bits after adding the item */ routing_ind >>= ROUTING_INDICATOR_SHIFT; gti = tvb_get_guint8(tvb, 0) & GTI_MASK; if (decode_mtp3_standard == ITU_STANDARD || decode_mtp3_standard == CHINESE_ITU_STANDARD || decode_mtp3_standard == JAPAN_STANDARD || national == 0) { proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_itu_global_title_indicator : hf_sccp_calling_itu_global_title_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, gti); ssni = tvb_get_guint8(tvb, 0) & ITU_SSN_INDICATOR_MASK; expert_item = proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_itu_ssn_indicator : hf_sccp_calling_itu_ssn_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, ssni); if ((routing_ind == ROUTE_ON_SSN) && (ssni == 0)) { expert_add_info(pinfo, expert_item, &ei_sccp_no_ssn_present); } pci = tvb_get_guint8(tvb, 0) & ITU_PC_INDICATOR_MASK; proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_itu_point_code_indicator : hf_sccp_calling_itu_point_code_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, pci); offset = ADDRESS_INDICATOR_LENGTH; /* Dissect PC (if present) */ if (pci) { if (decode_mtp3_standard == ITU_STANDARD || national == 0) { if (length < offset + ITU_PC_LENGTH) { proto_tree_add_expert_format(call_tree, pinfo, &ei_sccp_wrong_length, tvb, 0, -1, "Wrong length indicated (%u) should be at least %u, PC is %u octets", length, offset + ITU_PC_LENGTH, ITU_PC_LENGTH); return; } proto_tree_add_item(call_tree, called ? hf_sccp_called_itu_pc : hf_sccp_calling_itu_pc, tvb, offset, ITU_PC_LENGTH, ENC_LITTLE_ENDIAN); offset += ITU_PC_LENGTH; } else if (decode_mtp3_standard == JAPAN_STANDARD) { if (length < offset + JAPAN_PC_LENGTH) { proto_tree_add_expert_format(call_tree, pinfo, &ei_sccp_wrong_length, tvb, 0, -1, "Wrong length indicated (%u) should be at least %u, PC is %u octets", length, offset + JAPAN_PC_LENGTH, JAPAN_PC_LENGTH); return; } proto_tree_add_item(call_tree, called ? hf_sccp_called_japan_pc : hf_sccp_calling_japan_pc, tvb, offset, JAPAN_PC_LENGTH, ENC_LITTLE_ENDIAN); offset += JAPAN_PC_LENGTH; } else /* CHINESE_ITU_STANDARD */ { if (length < offset + ANSI_PC_LENGTH) { proto_tree_add_expert_format(call_tree, pinfo, &ei_sccp_wrong_length, tvb, 0, -1, "Wrong length indicated (%u) should be at least %u, PC is %u octets", length, offset + ANSI_PC_LENGTH, ANSI_PC_LENGTH); return; } offset = dissect_sccp_3byte_pc(tvb, call_tree, offset, called); } } /* Dissect SSN (if present) */ if (ssni) { ssn = tvb_get_guint8(tvb, offset); if ((routing_ind == ROUTE_ON_SSN) && (ssn == 0)) { expert_add_info(pinfo, expert_item, &ei_sccp_ssn_zero); } if (called && sccp_info->assoc) sccp_info->assoc->called_ssn = ssn; else if (sccp_info->assoc) sccp_info->assoc->calling_ssn = ssn; if (is_connectionless(sccp_info->message_type) && sccp_info->sccp_msg) { guint *ssn_ptr = called ? &(sccp_info->sccp_msg->data.ud.called_ssn) : &(sccp_info->sccp_msg->data.ud.calling_ssn); *ssn_ptr = ssn; } proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn : hf_sccp_calling_ssn, tvb, offset, ADDRESS_SSN_LENGTH, ssn); hidden_item = proto_tree_add_uint(call_tree, hf_sccp_ssn, tvb, offset, ADDRESS_SSN_LENGTH, ssn); proto_item_set_hidden(hidden_item); offset += ADDRESS_SSN_LENGTH; /* Get the dissector handle of the dissector registered for this ssn * And print its name. */ ssn_dissector = dissector_get_uint_handle(sccp_ssn_dissector_table, ssn); if (ssn_dissector) { ssn_dissector_description = dissector_handle_get_description(ssn_dissector); if (ssn_dissector_description) { item = proto_tree_add_string_format(call_tree, hf_sccp_linked_dissector, tvb, offset - 1, ADDRESS_SSN_LENGTH, ssn_dissector_description, "Linked to %s", ssn_dissector_description); proto_item_set_generated(item); if (g_ascii_strncasecmp("TCAP", ssn_dissector_description, 4)== 0) { tcap_ssn_dissector = get_itu_tcap_subdissector(ssn); if (tcap_ssn_dissector) { tcap_ssn_dissector_description = dissector_handle_get_description(tcap_ssn_dissector); proto_item_append_text(item,", TCAP SSN linked to %s", tcap_ssn_dissector_description); } } } /* short name */ } /* ssn_dissector */ } /* ssni */ /* Dissect GT (if present) */ if (gti != AI_GTI_NO_GT) { if (length < offset) return; gt_tvb = tvb_new_subset_length(tvb, offset, (length - offset)); dissect_sccp_global_title(gt_tvb, pinfo, call_tree, (length - offset), gti, called, sccp_info); } } else if (decode_mtp3_standard == ANSI_STANDARD) { proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_ansi_global_title_indicator : hf_sccp_calling_ansi_global_title_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, gti); pci = tvb_get_guint8(tvb, 0) & ANSI_PC_INDICATOR_MASK; proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_ansi_point_code_indicator : hf_sccp_calling_ansi_point_code_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, pci); ssni = tvb_get_guint8(tvb, 0) & ANSI_SSN_INDICATOR_MASK; expert_item = proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_ansi_ssn_indicator : hf_sccp_calling_ansi_ssn_indicator, tvb, 0, ADDRESS_INDICATOR_LENGTH, ssni); if ((routing_ind == ROUTE_ON_SSN) && (ssni == 0)) { expert_add_info(pinfo, expert_item, &ei_sccp_no_ssn_present); } offset = ADDRESS_INDICATOR_LENGTH; /* Dissect SSN (if present) */ if (ssni) { ssn = tvb_get_guint8(tvb, offset); if ((routing_ind == ROUTE_ON_SSN) && (ssn == 0)) { expert_add_info(pinfo, expert_item, &ei_sccp_ssn_zero); } if (called && sccp_info->assoc) { sccp_info->assoc->called_ssn = ssn; } else if (sccp_info->assoc) { sccp_info->assoc->calling_ssn = ssn; } if (is_connectionless(sccp_info->message_type) && sccp_info->sccp_msg) { guint *ssn_ptr = called ? &(sccp_info->sccp_msg->data.ud.called_ssn) : &(sccp_info->sccp_msg->data.ud.calling_ssn); *ssn_ptr = ssn; } proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn : hf_sccp_calling_ssn, tvb, offset, ADDRESS_SSN_LENGTH, ssn); hidden_item = proto_tree_add_uint(call_tree, hf_sccp_ssn, tvb, offset, ADDRESS_SSN_LENGTH, ssn); proto_item_set_hidden(hidden_item); offset += ADDRESS_SSN_LENGTH; } /* Dissect PC (if present) */ if (pci) { offset = dissect_sccp_3byte_pc(tvb, call_tree, offset, called); } /* Dissect GT (if present) */ if (gti != AI_GTI_NO_GT) { if (length < offset) return; gt_tvb = tvb_new_subset_length(tvb, offset, (length - offset)); dissect_sccp_global_title(gt_tvb, pinfo, call_tree, (length - offset), gti, called, sccp_info); } } } static void dissect_sccp_called_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, sccp_decode_context_t* sccp_info) { dissect_sccp_called_calling_param(tvb, tree, pinfo, length, TRUE, sccp_info); } static void dissect_sccp_calling_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, sccp_decode_context_t* sccp_info) { dissect_sccp_called_calling_param(tvb, tree, pinfo, length, FALSE, sccp_info); } static void dissect_sccp_class_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length, sccp_decode_context_t* sccp_info) { guint8 msg_class; proto_item *pi; gboolean invalid_class = FALSE; if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } msg_class = tvb_get_guint8(tvb, 0) & CLASS_CLASS_MASK; pi = proto_tree_add_uint(tree, hf_sccp_class, tvb, 0, length, msg_class); switch (sccp_info->message_type) { case SCCP_MSG_TYPE_DT1: if (msg_class != 2) invalid_class = TRUE; break; case SCCP_MSG_TYPE_DT2: case SCCP_MSG_TYPE_AK: case SCCP_MSG_TYPE_ED: case SCCP_MSG_TYPE_EA: case SCCP_MSG_TYPE_RSR: case SCCP_MSG_TYPE_RSC: if (msg_class != 3) invalid_class = TRUE; break; case SCCP_MSG_TYPE_CR: case SCCP_MSG_TYPE_CC: case SCCP_MSG_TYPE_CREF: case SCCP_MSG_TYPE_RLSD: case SCCP_MSG_TYPE_RLC: case SCCP_MSG_TYPE_ERR: case SCCP_MSG_TYPE_IT: if ((msg_class != 2) && (msg_class != 3)) invalid_class = TRUE; break; case SCCP_MSG_TYPE_UDT: case SCCP_MSG_TYPE_UDTS: case SCCP_MSG_TYPE_XUDT: case SCCP_MSG_TYPE_XUDTS: case SCCP_MSG_TYPE_LUDT: case SCCP_MSG_TYPE_LUDTS: if ((msg_class != 0) && (msg_class != 1)) invalid_class = TRUE; break; } if (invalid_class) expert_add_info(pinfo, pi, &ei_sccp_class_unexpected); if (msg_class == 0 || msg_class == 1) { guint8 handling = tvb_get_guint8(tvb, 0) & CLASS_SPARE_HANDLING_MASK; pi = proto_tree_add_item(tree, hf_sccp_handling, tvb, 0, length, ENC_NA); handling >>= CLASS_SPARE_HANDLING_SHIFT; if (try_val_to_str(handling, sccp_class_handling_values) == NULL) { expert_add_info(pinfo, pi, &ei_sccp_handling_invalid); } } } static void dissect_sccp_segmenting_reassembling_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_more, tvb, 0, length, ENC_BIG_ENDIAN); } static void dissect_sccp_receive_sequence_number_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { guint8 rsn; if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } rsn = tvb_get_guint8(tvb, 0) >> 1; proto_tree_add_uint(tree, hf_sccp_rsn, tvb, 0, length, rsn); } static void dissect_sccp_sequencing_segmenting_param(tvbuff_t *tvb, proto_tree *tree, guint length) { guint8 rsn, ssn; proto_tree *param_tree; ssn = tvb_get_guint8(tvb, 0) >> 1; rsn = tvb_get_guint8(tvb, SEQUENCING_SEGMENTING_SSN_LENGTH) >> 1; param_tree = proto_tree_add_subtree(tree, tvb, 0, length, ett_sccp_sequencing_segmenting, NULL, val_to_str(PARAMETER_SEQUENCING_SEGMENTING, sccp_parameter_values, "Unknown: %d")); proto_tree_add_uint(param_tree, hf_sccp_sequencing_segmenting_ssn, tvb, 0, SEQUENCING_SEGMENTING_SSN_LENGTH, ssn); proto_tree_add_uint(param_tree, hf_sccp_sequencing_segmenting_rsn, tvb, SEQUENCING_SEGMENTING_SSN_LENGTH, SEQUENCING_SEGMENTING_RSN_LENGTH, rsn); proto_tree_add_item(param_tree, hf_sccp_sequencing_segmenting_more, tvb, SEQUENCING_SEGMENTING_SSN_LENGTH, SEQUENCING_SEGMENTING_RSN_LENGTH, ENC_NA); } static void dissect_sccp_credit_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_credit, tvb, 0, length, ENC_NA); } static void dissect_sccp_release_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_release_cause, tvb, 0, length, ENC_LITTLE_ENDIAN); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", tvb_get_guint8(tvb, 0)); } static void dissect_sccp_return_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_return_cause, tvb, 0, length, ENC_LITTLE_ENDIAN); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", tvb_get_guint8(tvb, 0)); } static void dissect_sccp_reset_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_reset_cause, tvb, 0, length, ENC_LITTLE_ENDIAN); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", tvb_get_guint8(tvb, 0)); } static void dissect_sccp_error_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_error_cause, tvb, 0, length, ENC_LITTLE_ENDIAN); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", tvb_get_guint8(tvb, 0)); } static void dissect_sccp_refusal_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_refusal_cause, tvb, 0, length, ENC_LITTLE_ENDIAN); if (show_key_params) col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", tvb_get_guint8(tvb, 0)); } /* This function is used for both data and long data (ITU only) parameters */ static void dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, sccp_assoc_info_t *assoc) { guint8 ssn = INVALID_SSN; guint8 other_ssn = INVALID_SSN; const mtp3_addr_pc_t *dpc = NULL; const mtp3_addr_pc_t *opc = NULL; heur_dtbl_entry_t *hdtbl_entry; struct _sccp_msg_info_t* sccp_info = NULL; if ((trace_sccp) && (assoc && assoc != &no_assoc)) { sccp_info = assoc->curr_msg; } if (assoc) { switch (pinfo->p2p_dir) { case P2P_DIR_SENT: ssn = assoc->calling_ssn; other_ssn = assoc->called_ssn; dpc = (const mtp3_addr_pc_t*)pinfo->dst.data; opc = (const mtp3_addr_pc_t*)pinfo->src.data; break; case P2P_DIR_RECV: ssn = assoc->called_ssn; other_ssn = assoc->calling_ssn; dpc = (const mtp3_addr_pc_t*)pinfo->src.data; opc = (const mtp3_addr_pc_t*)pinfo->dst.data; break; default: ssn = assoc->called_ssn; other_ssn = assoc->calling_ssn; dpc = (const mtp3_addr_pc_t*)pinfo->dst.data; opc = (const mtp3_addr_pc_t*)pinfo->src.data; break; } } if ((num_sccp_users) && (pinfo->src.type == ss7pc_address_type)) { guint i; dissector_handle_t handle = NULL; gboolean uses_tcap = FALSE; for (i=0; i < num_sccp_users; i++) { sccp_user_t *u = &(sccp_users[i]); if (!dpc || dpc->ni != u->ni) continue; if (value_is_in_range(u->called_ssn, ssn) && value_is_in_range(u->called_pc, dpc->pc) ) { handle = *(u->handlep); uses_tcap = u->uses_tcap; break; } else if (value_is_in_range(u->called_ssn, other_ssn) && opc && value_is_in_range(u->called_pc, opc->pc) ) { handle = *(u->handlep); uses_tcap = u->uses_tcap; break; } } if (handle) { if (uses_tcap) { call_tcap_dissector(handle, tvb, pinfo, tree); } else { call_dissector_with_data(handle, tvb, pinfo, tree, sccp_info); } return; } } /* Save SSN for Decode As */ p_add_proto_data(pinfo->pool, pinfo, proto_sccp, 0, GUINT_TO_POINTER((guint)ssn)); if ((ssn != INVALID_SSN) && dissector_try_uint_new(sccp_ssn_dissector_table, ssn, tvb, pinfo, tree, TRUE, sccp_info)) { return; } if ((other_ssn != INVALID_SSN) && dissector_try_uint_new(sccp_ssn_dissector_table, other_ssn, tvb, pinfo, tree, TRUE, sccp_info)) { return; } /* try heuristic subdissector list to see if there are any takers */ if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, sccp_info)) { return; } /* try user default subdissector */ if (default_handle) { call_dissector_with_data(default_handle, tvb, pinfo, tree, sccp_info); return; } /* No sub-dissection occurred, treat it as raw data */ call_dissector(data_handle, tvb, pinfo, tree); } static void dissect_sccp_segmentation_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { proto_tree *param_tree; param_tree = proto_tree_add_subtree(tree, tvb, 0, length, ett_sccp_segmentation, NULL, val_to_str(PARAMETER_SEGMENTATION, sccp_parameter_values, "Unknown: %d")); proto_tree_add_item(param_tree, hf_sccp_segmentation_first, tvb, 0, 1, ENC_NA); proto_tree_add_item(param_tree, hf_sccp_segmentation_class, tvb, 0, 1, ENC_NA); proto_tree_add_item(param_tree, hf_sccp_segmentation_remaining, tvb, 0, 1, ENC_NA); if (length-1 != 3) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length-1, "Wrong length indicated. Expected 3, got %u", length-1); return; } proto_tree_add_item(param_tree, hf_sccp_segmentation_slr, tvb, 1, length-1, ENC_LITTLE_ENDIAN); } static void dissect_sccp_hop_counter_param(tvbuff_t *tvb, proto_tree *tree, guint length) { guint8 hops; hops = tvb_get_guint8(tvb, 0); proto_tree_add_uint(tree, hf_sccp_hop_counter, tvb, 0, length, hops); } static void dissect_sccp_importance_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint length) { if (length != 1) { proto_tree_add_expert_format(tree, pinfo, &ei_sccp_wrong_length, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length); return; } proto_tree_add_item(tree, hf_sccp_importance, tvb, 0, length, ENC_NA); } static void dissect_sccp_isni_param(tvbuff_t *tvb, proto_tree *tree, guint length) { guint8 ti; guint offset = 0; proto_tree *param_tree; /* Create a subtree for ISNI Routing Control */ param_tree = proto_tree_add_subtree(tree, tvb, offset, ANSI_ISNI_ROUTING_CONTROL_LENGTH, ett_sccp_ansi_isni_routing_control, NULL, "ISNI Routing Control"); proto_tree_add_item(param_tree, hf_sccp_ansi_isni_mi, tvb, offset, ANSI_ISNI_ROUTING_CONTROL_LENGTH, ENC_NA); proto_tree_add_item(param_tree, hf_sccp_ansi_isni_iri, tvb, offset, ANSI_ISNI_ROUTING_CONTROL_LENGTH, ENC_NA); ti = tvb_get_guint8(tvb, offset) & ANSI_ISNI_TI_MASK; proto_tree_add_uint(param_tree, hf_sccp_ansi_isni_ti, tvb, offset, ANSI_ISNI_ROUTING_CONTROL_LENGTH, ti); proto_tree_add_item(param_tree, hf_sccp_ansi_isni_counter, tvb, offset, ANSI_ISNI_ROUTING_CONTROL_LENGTH, ENC_NA); offset += ANSI_ISNI_ROUTING_CONTROL_LENGTH; if ((ti >> ANSI_ISNI_TI_SHIFT) == ANSI_ISNI_TYPE_1) { proto_tree_add_uint(param_tree, hf_sccp_ansi_isni_netspec, tvb, offset, ANSI_ISNI_ROUTING_CONTROL_LENGTH, ti); offset += ANSI_ISNI_ROUTING_CONTROL_LENGTH; } while (offset < length) { proto_tree_add_item(tree, hf_sccp_ansi_isni_network, tvb, offset, ANSI_NCM_LENGTH, ENC_NA); offset++; proto_tree_add_item(tree, hf_sccp_ansi_isni_cluster, tvb, offset, ANSI_NCM_LENGTH, ENC_NA); offset++; } } /* FUNCTION dissect_sccp_parameter(): * Dissect a parameter given its type, offset into tvb, and length. */ static guint16 dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, proto_tree *tree, guint8 parameter_type, int offset, guint16 parameter_length, sccp_decode_context_t *sccp_info) { tvbuff_t *parameter_tvb; switch (parameter_type) { case PARAMETER_CALLED_PARTY_ADDRESS: case PARAMETER_CALLING_PARTY_ADDRESS: case PARAMETER_DATA: case PARAMETER_LONG_DATA: case PARAMETER_SOURCE_LOCAL_REFERENCE: case PARAMETER_DESTINATION_LOCAL_REFERENCE: case PARAMETER_RELEASE_CAUSE: case PARAMETER_RETURN_CAUSE: case PARAMETER_RESET_CAUSE: case PARAMETER_ERROR_CAUSE: case PARAMETER_REFUSAL_CAUSE: /* These parameters must be dissected even if !sccp_tree (so that * assoc information can be created). */ break; default: if (!sccp_tree) return(parameter_length); } parameter_tvb = tvb_new_subset_length(tvb, offset, parameter_length); switch (parameter_type) { case PARAMETER_END_OF_OPTIONAL_PARAMETERS: proto_tree_add_item(sccp_tree, hf_sccp_end_optional_param, tvb, offset, parameter_length, ENC_NA); break; case PARAMETER_DESTINATION_LOCAL_REFERENCE: dissect_sccp_dlr_param(parameter_tvb, pinfo, sccp_tree, parameter_length, sccp_info); break; case PARAMETER_SOURCE_LOCAL_REFERENCE: dissect_sccp_slr_param(parameter_tvb, pinfo, sccp_tree, parameter_length, sccp_info); break; case PARAMETER_CALLED_PARTY_ADDRESS: dissect_sccp_called_param(parameter_tvb, pinfo, sccp_tree, parameter_length, sccp_info); break; case PARAMETER_CALLING_PARTY_ADDRESS: dissect_sccp_calling_param(parameter_tvb, pinfo, sccp_tree, parameter_length, sccp_info); break; case PARAMETER_CLASS: dissect_sccp_class_param(parameter_tvb, pinfo, sccp_tree, parameter_length, sccp_info); break; case PARAMETER_SEGMENTING_REASSEMBLING: dissect_sccp_segmenting_reassembling_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_RECEIVE_SEQUENCE_NUMBER: dissect_sccp_receive_sequence_number_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_SEQUENCING_SEGMENTING: dissect_sccp_sequencing_segmenting_param(parameter_tvb, sccp_tree, parameter_length); break; case PARAMETER_CREDIT: dissect_sccp_credit_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_RELEASE_CAUSE: dissect_sccp_release_cause_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_RETURN_CAUSE: dissect_sccp_return_cause_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_RESET_CAUSE: dissect_sccp_reset_cause_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_ERROR_CAUSE: dissect_sccp_error_cause_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_REFUSAL_CAUSE: dissect_sccp_refusal_cause_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_DATA: dissect_sccp_data_param(parameter_tvb, pinfo, tree, sccp_info->assoc); /* TODO? Re-adjust length of SCCP item since it may be sub-dissected */ /* sccp_length = proto_item_get_len(sccp_item); * sccp_length -= parameter_length; * proto_item_set_len(sccp_item, sccp_length); * * except that proto_item_get_len() is *NOT* guaranteed to return * a correct value - if the item has been "faked", it will be wrong */ break; case PARAMETER_SEGMENTATION: dissect_sccp_segmentation_param(parameter_tvb, pinfo, sccp_tree, parameter_length); break; case PARAMETER_HOP_COUNTER: dissect_sccp_hop_counter_param(parameter_tvb, sccp_tree, parameter_length); break; case PARAMETER_IMPORTANCE: if (decode_mtp3_standard != ANSI_STANDARD) dissect_sccp_importance_param(parameter_tvb, pinfo, sccp_tree, parameter_length); else dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type, parameter_length); break; case PARAMETER_LONG_DATA: dissect_sccp_data_param(parameter_tvb, pinfo, tree, sccp_info->assoc); break; case PARAMETER_ISNI: if (decode_mtp3_standard != ANSI_STANDARD) dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type, parameter_length); else dissect_sccp_isni_param(parameter_tvb, sccp_tree, parameter_length); break; default: dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type, parameter_length); break; } return(parameter_length); } /* FUNCTION dissect_sccp_variable_parameter(): * Dissect a variable parameter given its type and offset into tvb. Length * of the parameter is gotten from tvb[0]. * Length returned is sum of (length + parameter). */ static guint16 dissect_sccp_variable_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, proto_tree *tree, guint8 parameter_type, int offset, sccp_decode_context_t* sccp_info) { gint remaining_length; guint16 parameter_length; guint8 length_length; proto_item *pi; if (parameter_type != PARAMETER_LONG_DATA) { parameter_length = tvb_get_guint8(tvb, offset); length_length = PARAMETER_LENGTH_LENGTH; } else { /* Long data parameter has 16 bit length */ parameter_length = tvb_get_letohs(tvb, offset); length_length = PARAMETER_LONG_DATA_LENGTH_LENGTH; } pi = proto_tree_add_uint_format(sccp_tree, hf_sccp_param_length, tvb, offset, length_length, parameter_length, "%s length: %d", val_to_str(parameter_type, sccp_parameter_values, "Unknown: %d"), parameter_length); remaining_length = tvb_reported_length_remaining(tvb, offset + length_length); if (parameter_type == PARAMETER_DATA && remaining_length > 255 && parameter_length == 255) { expert_add_info_format(pinfo, pi, &ei_sccp_externally_reassembled, "Possibly externally reassembled (remaining length %u > %u), check SCCP preferences", remaining_length, parameter_length); if (dt1_ignore_length) { parameter_length = remaining_length; } } else if (!sccp_show_length) { /* The user doesn't want to see it... */ /* Show the length anyway, though, if there was an error. */ proto_item_set_hidden(pi); } offset += length_length; dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, parameter_type, offset, parameter_length, sccp_info); return(parameter_length + length_length); } /* FUNCTION dissect_sccp_optional_parameters(): * Dissect all the optional parameters given the start of the optional * parameters into tvb. Parameter types and lengths are read from tvb. */ static void dissect_sccp_optional_parameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, proto_tree *tree, int offset, sccp_decode_context_t* sccp_info) { guint8 parameter_type; while ((parameter_type = tvb_get_guint8(tvb, offset)) != PARAMETER_END_OF_OPTIONAL_PARAMETERS) { offset += PARAMETER_TYPE_LENGTH; offset += dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, parameter_type, offset, sccp_info); } /* Process end of optional parameters */ dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, parameter_type, offset, END_OF_OPTIONAL_PARAMETERS_LENGTH, sccp_info); } static sccp_msg_info_t * new_ud_msg(packet_info *pinfo, guint32 msg_type _U_) { sccp_msg_info_t *m = wmem_new0(pinfo->pool, sccp_msg_info_t); m->framenum = pinfo->num; m->data.ud.calling_gt = NULL; m->data.ud.called_gt = NULL; return m; } static void build_assoc_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, sccp_decode_context_t *sccp_info, guint msg_offset) { if (trace_sccp && sccp_info->assoc && (sccp_info->assoc != &no_assoc)) { proto_item *pi = proto_tree_add_uint(sccp_tree, hf_sccp_assoc_id, tvb, 0, 0, sccp_info->assoc->id); proto_item_set_generated(pi); proto_tree *pt = proto_item_add_subtree(pi, ett_sccp_assoc); if(sccp_info->assoc->imsi){ proto_item *pi2 = proto_tree_add_string(sccp_tree, hf_assoc_imsi, tvb, 0, 0, sccp_info->assoc->imsi); proto_item_set_generated(pi2); } if (sccp_info->assoc->msgs) { sccp_msg_info_t *m; for(m = sccp_info->assoc->msgs; m ; m = m->data.co.next) { pi = proto_tree_add_uint(pt, hf_sccp_assoc_msg, tvb, 0, 0, m->framenum); if (sccp_info->assoc->payload != SCCP_PLOAD_NONE) proto_item_append_text(pi," %s", val_to_str(sccp_info->assoc->payload, assoc_protos, "Unknown: %d")); if (m->data.co.label) proto_item_append_text(pi," %s", m->data.co.label); if (m->data.co.imsi) proto_item_append_text(pi, " %s", m->data.co.imsi); if ((m->framenum == pinfo->num) && (m->offset == msg_offset) ) { tap_queue_packet(sccp_tap, pinfo, m); proto_item_append_text(pi," (current)"); } proto_item_set_generated(pi); } } } } static int dissect_xudt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, proto_tree *tree, int offset, sccp_decode_context_t *sccp_info, guint16 *optional_pointer_p, guint16 *orig_opt_ptr_p) { guint16 variable_pointer1 = 0, variable_pointer2 = 0, variable_pointer3 = 0; guint16 optional_pointer = 0, orig_opt_ptr = 0, optional_pointer1 = 0; guint8 optional_param_type = 0; tvbuff_t *new_tvb = NULL; guint32 source_local_ref = 0; guint msg_offset = tvb_offset_from_real_beginning(tvb); /* Macro for getting pointer to mandatory variable parameters */ #define VARIABLE_POINTER(var, hf_var, ptr_size) \ do { \ if (ptr_size == POINTER_LENGTH) \ var = tvb_get_guint8(tvb, offset); \ else \ var = tvb_get_letohs(tvb, offset); \ proto_tree_add_uint(sccp_tree, hf_var, tvb, \ offset, ptr_size, var); \ var += offset; \ if (ptr_size == POINTER_LENGTH_LONG) \ var += 1; \ offset += ptr_size; \ } while (0) /* Macro for getting pointer to optional parameters */ #define OPTIONAL_POINTER(ptr_size) \ do { \ if (ptr_size == POINTER_LENGTH) \ orig_opt_ptr = optional_pointer = tvb_get_guint8(tvb, offset); \ else \ orig_opt_ptr = optional_pointer = tvb_get_letohs(tvb, offset); \ proto_tree_add_uint(sccp_tree, hf_sccp_optional_pointer, tvb, \ offset, ptr_size, optional_pointer); \ optional_pointer += offset; \ if (ptr_size == POINTER_LENGTH_LONG) \ optional_pointer += 1; \ offset += ptr_size; \ } while (0) /* Optional parameters are Segmentation and Importance * NOTE 2 - Segmentation Should not be present in case of a single XUDT * message. */ VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH); VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH); OPTIONAL_POINTER(POINTER_LENGTH); sccp_info->assoc = get_sccp_assoc(pinfo, msg_offset, sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, sccp_info, msg_offset); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, variable_pointer1, sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLING_PARTY_ADDRESS, variable_pointer2, sccp_info); optional_pointer1 = optional_pointer; while((optional_param_type = tvb_get_guint8(tvb, optional_pointer1)) != PARAMETER_END_OF_OPTIONAL_PARAMETERS) { if (optional_param_type == PARAMETER_SEGMENTATION) break; optional_pointer1 += PARAMETER_TYPE_LENGTH; optional_pointer1 += tvb_get_guint8(tvb, optional_pointer1) + PARAMETER_LENGTH_LENGTH; } if (tvb_get_guint8(tvb, optional_pointer1) == PARAMETER_SEGMENTATION) { if (!sccp_reassemble) { proto_tree_add_item(sccp_tree, hf_sccp_segmented_data, tvb, variable_pointer3, tvb_get_guint8(tvb, variable_pointer3)+1, ENC_NA); } else { guint8 octet; gboolean more_frag = TRUE; /* Get the first octet of parameter Segmentation, Ch 3.17 in Q.713 * Bit 8 of octet 1 is used for First segment indication * Bit 7 of octet 1 is used to keep in the message in sequence * delivery option required by the SCCP user * Bits 6 and 5 in octet 1 are spare bits. * Bits 4-1 of octet 1 are used to indicate the number of * remaining segments. * The values 0000 to 1111 are possible; the value 0000 indicates * the last segment. */ octet = tvb_get_guint8(tvb, optional_pointer1+2); source_local_ref = tvb_get_letoh24(tvb, optional_pointer1+3); if ((octet & 0x0f) == 0) more_frag = FALSE; new_tvb = sccp_reassemble_fragments(tvb, pinfo, tree, variable_pointer3, source_local_ref, more_frag); if (new_tvb) dissect_sccp_data_param(new_tvb, pinfo, tree, sccp_info->assoc); } } else { dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DATA, variable_pointer3, sccp_info); } *optional_pointer_p = optional_pointer; *orig_opt_ptr_p = orig_opt_ptr; return offset; } static int dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, proto_tree *tree) { guint16 variable_pointer1 = 0, variable_pointer2 = 0, variable_pointer3 = 0; guint16 optional_pointer = 0, orig_opt_ptr = 0; int offset = 0; tvbuff_t *new_tvb = NULL; guint32 source_local_ref = 0; guint8 more; guint msg_offset = tvb_offset_from_real_beginning(tvb); sccp_decode_context_t sccp_info = {0, INVALID_LR, INVALID_LR, NULL, NULL}; /* Extract the message type; all other processing is based on this */ sccp_info.message_type = tvb_get_guint8(tvb, SCCP_MSG_TYPE_OFFSET); offset = SCCP_MSG_TYPE_LENGTH; /* Do not change col_add_fstr() to col_append_fstr() here: we _want_ * this call to overwrite whatever's currently in the INFO column (e.g., * "DATA" from the SCTP dissector). * * If there's something there that should not be overwritten, whoever * put that info there should call col_set_fence() to protect it. */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(sccp_info.message_type, sccp_message_type_acro_values, "Unknown: %d")); if (sccp_tree) { /* add the message type to the protocol tree */ proto_tree_add_uint(sccp_tree, hf_sccp_message_type, tvb, SCCP_MSG_TYPE_OFFSET, SCCP_MSG_TYPE_LENGTH, sccp_info.message_type); }; no_assoc.calling_dpc = 0; no_assoc.called_dpc = 0; no_assoc.calling_ssn = INVALID_SSN; no_assoc.called_ssn = INVALID_SSN; no_assoc.has_fw_key = FALSE; no_assoc.has_bw_key = FALSE; no_assoc.payload = SCCP_PLOAD_NONE; no_assoc.called_party = NULL; no_assoc.calling_party = NULL; no_assoc.extra_info = NULL; switch (sccp_info.message_type) { case SCCP_MSG_TYPE_CR: /* TTC and NTT (Japan) say that the connection-oriented messages are * deleted (not standardized), but they appear to be used anyway, so * we'll dissect it... */ offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); OPTIONAL_POINTER(POINTER_LENGTH); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, variable_pointer1, &sccp_info); break; case SCCP_MSG_TYPE_CC: /* TODO: connection has been established; theoretically we could keep * keep track of the SLR/DLR with the called/calling from the CR and * track the connection (e.g., on subsequent messages regarding this * SLR we could set the global vars "call*_ssn" so data could get * sub-dissected). */ offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH, &sccp_info); OPTIONAL_POINTER(POINTER_LENGTH); break; case SCCP_MSG_TYPE_CREF: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_REFUSAL_CAUSE, offset, REFUSAL_CAUSE_LENGTH, &sccp_info); OPTIONAL_POINTER(POINTER_LENGTH); break; case SCCP_MSG_TYPE_RLSD: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RELEASE_CAUSE, offset, RELEASE_CAUSE_LENGTH, &sccp_info); OPTIONAL_POINTER(POINTER_LENGTH); break; case SCCP_MSG_TYPE_RLC: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); break; case SCCP_MSG_TYPE_DT1: { gint remaining_length; source_local_ref = tvb_get_letoh24(tvb, offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); more = tvb_get_guint8(tvb, offset) & SEGMENTING_REASSEMBLING_MASK; offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SEGMENTING_REASSEMBLING, offset, SEGMENTING_REASSEMBLING_LENGTH, &sccp_info); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); /* Reassemble */ if (!sccp_reassemble) { proto_tree_add_item(sccp_tree, hf_sccp_segmented_data, tvb, variable_pointer1, tvb_get_guint8(tvb, variable_pointer1)+1, ENC_NA); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DATA, variable_pointer1, &sccp_info); } else { remaining_length = tvb_reported_length_remaining(tvb, variable_pointer1 + 1); if(dt1_ignore_length && remaining_length > 255) { new_tvb = tvb_new_subset_length(tvb, variable_pointer1 + 1, remaining_length); } else { new_tvb = sccp_reassemble_fragments(tvb, pinfo, tree, variable_pointer1, source_local_ref, more); } if (new_tvb) dissect_sccp_data_param(new_tvb, pinfo, tree, sccp_info.assoc); } /* End reassemble */ break; } case SCCP_MSG_TYPE_DT2: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SEQUENCING_SEGMENTING, offset, SEQUENCING_SEGMENTING_LENGTH, &sccp_info); break; case SCCP_MSG_TYPE_AK: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RECEIVE_SEQUENCE_NUMBER, offset, RECEIVE_SEQUENCE_NUMBER_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CREDIT, offset, CREDIT_LENGTH, &sccp_info); break; case SCCP_MSG_TYPE_UDT: sccp_info.sccp_msg = new_ud_msg(pinfo, sccp_info.message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH, &sccp_info); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH); VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, variable_pointer1, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLING_PARTY_ADDRESS, variable_pointer2, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DATA, variable_pointer3, &sccp_info); break; case SCCP_MSG_TYPE_UDTS: { gboolean save_in_error_pkt = pinfo->flags.in_error_pkt; pinfo->flags.in_error_pkt = TRUE; sccp_info.sccp_msg = new_ud_msg(pinfo, sccp_info.message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, RETURN_CAUSE_LENGTH, &sccp_info); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH); VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, variable_pointer1, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLING_PARTY_ADDRESS, variable_pointer2, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DATA, variable_pointer3, &sccp_info); pinfo->flags.in_error_pkt = save_in_error_pkt; break; } case SCCP_MSG_TYPE_ED: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DATA, variable_pointer1, &sccp_info); break; case SCCP_MSG_TYPE_EA: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); break; case SCCP_MSG_TYPE_RSR: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RESET_CAUSE, offset, RESET_CAUSE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); break; case SCCP_MSG_TYPE_RSC: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); break; case SCCP_MSG_TYPE_ERR: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_ERROR_CAUSE, offset, ERROR_CAUSE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); break; case SCCP_MSG_TYPE_IT: offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH, &sccp_info); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SEQUENCING_SEGMENTING, offset, SEQUENCING_SEGMENTING_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CREDIT, offset, CREDIT_LENGTH, &sccp_info); break; case SCCP_MSG_TYPE_XUDT: sccp_info.sccp_msg = new_ud_msg(pinfo, sccp_info.message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_HOP_COUNTER, offset, HOP_COUNTER_LENGTH, &sccp_info); offset = dissect_xudt_common(tvb, pinfo, sccp_tree, tree, offset, &sccp_info, &optional_pointer, &orig_opt_ptr); break; case SCCP_MSG_TYPE_XUDTS: { gboolean save_in_error_pkt = pinfo->flags.in_error_pkt; pinfo->flags.in_error_pkt = TRUE; sccp_info.sccp_msg = new_ud_msg(pinfo, sccp_info.message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, RETURN_CAUSE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_HOP_COUNTER, offset, HOP_COUNTER_LENGTH, &sccp_info); offset = dissect_xudt_common(tvb, pinfo, sccp_tree, tree, offset, &sccp_info, &optional_pointer, &orig_opt_ptr); pinfo->flags.in_error_pkt = save_in_error_pkt; break; } case SCCP_MSG_TYPE_LUDT: sccp_info.sccp_msg = new_ud_msg(pinfo, sccp_info.message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_HOP_COUNTER, offset, HOP_COUNTER_LENGTH, &sccp_info); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH_LONG); VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH_LONG); VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH_LONG); OPTIONAL_POINTER(POINTER_LENGTH_LONG); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, variable_pointer1, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLING_PARTY_ADDRESS, variable_pointer2, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_LONG_DATA, variable_pointer3, &sccp_info); break; case SCCP_MSG_TYPE_LUDTS: sccp_info.sccp_msg = new_ud_msg(pinfo, sccp_info.message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, RETURN_CAUSE_LENGTH, &sccp_info); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_HOP_COUNTER, offset, HOP_COUNTER_LENGTH, &sccp_info); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH_LONG); VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH_LONG); VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH_LONG); OPTIONAL_POINTER(POINTER_LENGTH_LONG); sccp_info.assoc = get_sccp_assoc(pinfo, msg_offset, &sccp_info); build_assoc_tree(tvb, pinfo, sccp_tree, &sccp_info, msg_offset); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, variable_pointer1, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLING_PARTY_ADDRESS, variable_pointer2, &sccp_info); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_LONG_DATA, variable_pointer3, &sccp_info); break; default: dissect_sccp_unknown_message(tvb, sccp_tree); } if (orig_opt_ptr) dissect_sccp_optional_parameters(tvb, pinfo, sccp_tree, tree, optional_pointer, &sccp_info); return offset; } static int dissect_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *sccp_item = NULL; proto_tree *sccp_tree = NULL; const mtp3_addr_pc_t *mtp3_addr_p; if ((pinfo->src.type == ss7pc_address_type) && ((mtp3_addr_p = (const mtp3_addr_pc_t *)pinfo->src.data)->type <= CHINESE_ITU_STANDARD)) { /* * Allow a protocol beneath to specify how the SCCP layer should be * dissected. * * It is possible to have multiple sets of SCCP traffic some of which is * ITU and some of which is ANSI. * An example is A-interface traffic having ANSI MTP3/ANSI SCCP/3GPP2 IOS * and at the same time ITU MTP3/ITU SCCP/ANSI TCAP/ANSI MAP. */ decode_mtp3_standard = mtp3_addr_p->type; } else { decode_mtp3_standard = (Standard_Type)mtp3_standard; } /* Make entry in the Protocol column on summary display */ switch (decode_mtp3_standard) { case ITU_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Int. ITU)"); break; case ANSI_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (ANSI)"); break; case CHINESE_ITU_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Chin. ITU)"); break; case JAPAN_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Japan)"); break; }; /* In the interest of speed, if "tree" is NULL, don't do any work not necessary to generate protocol tree items. */ if (tree) { /* create the sccp protocol tree */ sccp_item = proto_tree_add_item(tree, proto_sccp, tvb, 0, -1, ENC_NA); sccp_tree = proto_item_add_subtree(sccp_item, ett_sccp); } /* Set whether message is UPLINK, DOWNLINK, or of UNKNOWN direction */ if (pinfo->src.type == ss7pc_address_type) { /* * XXX - we assume that the "data" pointers of the source and destination * addresses are set to point to "mtp3_addr_pc_t" structures, so that * we can safely cast them. */ mtp3_addr_p = (const mtp3_addr_pc_t *)pinfo->src.data; if (sccp_source_pc_global == mtp3_addr_p->pc) { pinfo->p2p_dir = P2P_DIR_SENT; } else { /* assuming if src was SS7 PC then dst will be too */ mtp3_addr_p = (const mtp3_addr_pc_t *)pinfo->dst.data; if (sccp_source_pc_global == mtp3_addr_p->pc) { pinfo->p2p_dir = P2P_DIR_RECV; } else { pinfo->p2p_dir = P2P_DIR_UNKNOWN; } } } /* dissect the message */ dissect_sccp_message(tvb, pinfo, sccp_tree, tree); return tvb_captured_length(tvb); } /*** SccpUsers Table **/ static struct _sccp_ul { guint id; gboolean uses_tcap; dissector_handle_t *handlep; } user_list[] = { {SCCP_USER_DATA, FALSE, &data_handle}, {SCCP_USER_TCAP, FALSE, &tcap_handle}, {SCCP_USER_RANAP, FALSE, &ranap_handle}, {SCCP_USER_BSSAP, FALSE, &bssap_handle}, {SCCP_USER_GSMMAP, TRUE, &gsmmap_handle}, {SCCP_USER_CAMEL, TRUE, &camel_handle}, {SCCP_USER_INAP, TRUE, &inap_handle}, {SCCP_USER_BSAP, FALSE, &bsap_handle}, {SCCP_USER_BSSAP_LE, FALSE, &bssap_le_handle}, {SCCP_USER_BSSAP_PLUS, FALSE, &bssap_plus_handle}, {0, FALSE, NULL} }; static gboolean sccp_users_update_cb(void *r, char **err) { sccp_user_t *u = (sccp_user_t *)r; struct _sccp_ul *c; range_t *empty; empty = range_empty(NULL); if (ranges_are_equal(u->called_pc, empty)) { *err = g_strdup("Must specify a PC"); wmem_free(NULL, empty); return FALSE; } if (ranges_are_equal(u->called_ssn, empty)) { *err = g_strdup("Must specify an SSN"); wmem_free(NULL, empty); return FALSE; } wmem_free(NULL, empty); for (c=user_list; c->handlep; c++) { if (c->id == u->user) { u->uses_tcap = c->uses_tcap; u->handlep = c->handlep; return TRUE; } } u->uses_tcap = FALSE; u->handlep = &data_handle; return TRUE; } static void * sccp_users_copy_cb(void *n, const void *o, size_t siz _U_) { const sccp_user_t *u = (const sccp_user_t *)o; sccp_user_t *un = (sccp_user_t *)n; un->ni = u->ni; un->user = u->user; un->uses_tcap = u->uses_tcap; un->handlep = u->handlep; if (u->called_pc) un->called_pc = range_copy(NULL, u->called_pc); if (u->called_ssn) un->called_ssn = range_copy(NULL, u->called_ssn); return n; } static void sccp_users_free_cb(void *r) { sccp_user_t *u = (sccp_user_t *)r; if (u->called_pc) wmem_free(NULL, u->called_pc); if (u->called_ssn) wmem_free(NULL, u->called_ssn); } UAT_DEC_CB_DEF(sccp_users, ni, sccp_user_t) UAT_RANGE_CB_DEF(sccp_users, called_pc, sccp_user_t) UAT_RANGE_CB_DEF(sccp_users, called_ssn, sccp_user_t) UAT_VS_DEF(sccp_users, user, sccp_user_t, guint, SCCP_USER_DATA, "Data") /** End SccpUsersTable **/ static void init_sccp(void) { next_assoc_id = 1; sccp_reassembly_id_next = 1; } /* Register the protocol with Wireshark */ void proto_register_sccp(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_sccp_message_type, { "Message Type", "sccp.message_type", FT_UINT8, BASE_HEX, VALS(sccp_message_type_values), 0x0, NULL, HFILL} }, { &hf_sccp_variable_pointer1, { "Pointer to first Mandatory Variable parameter", "sccp.variable_pointer1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_variable_pointer2, { "Pointer to second Mandatory Variable parameter", "sccp.variable_pointer2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_variable_pointer3, { "Pointer to third Mandatory Variable parameter", "sccp.variable_pointer3", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_optional_pointer, { "Pointer to Optional parameter", "sccp.optional_pointer", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_param_length, { "Variable parameter length", "sccp.parameter_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_ssn, { "Called or Calling SubSystem Number", "sccp.ssn", FT_UINT8, BASE_DEC, VALS(sccp_ssn_values), 0x0, NULL, HFILL} }, { &hf_sccp_gt_digits, { "Called or Calling GT Digits", "sccp.digits", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_called_ansi_national_indicator, { "National Indicator", "sccp.called.ni", FT_UINT8, BASE_HEX, VALS(sccp_ansi_national_indicator_values), ANSI_NATIONAL_MASK, NULL, HFILL} }, { &hf_sccp_called_itu_natl_use_bit, { "Reserved for national use", "sccp.called.reserved", FT_UINT8, BASE_HEX, NULL, ITU_RESERVED_MASK, NULL, HFILL} }, { &hf_sccp_called_routing_indicator, { "Routing Indicator", "sccp.called.ri", FT_UINT8, BASE_HEX, VALS(sccp_routing_indicator_values), ROUTING_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_called_itu_global_title_indicator, { "Global Title Indicator", "sccp.called.gti", FT_UINT8, BASE_HEX, VALS(sccp_itu_global_title_indicator_values), GTI_MASK, NULL, HFILL} }, { &hf_sccp_called_ansi_global_title_indicator, { "Global Title Indicator", "sccp.called.gti", FT_UINT8, BASE_HEX, VALS(sccp_ansi_global_title_indicator_values), GTI_MASK, NULL, HFILL} }, { &hf_sccp_called_itu_ssn_indicator, { "SubSystem Number Indicator", "sccp.called.ssni", FT_UINT8, BASE_HEX, VALS(sccp_ai_ssni_values), ITU_SSN_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_called_itu_point_code_indicator, { "Point Code Indicator", "sccp.called.pci", FT_UINT8, BASE_HEX, VALS(sccp_ai_pci_values), ITU_PC_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_called_ansi_ssn_indicator, { "SubSystem Number Indicator", "sccp.called.ssni", FT_UINT8, BASE_HEX, VALS(sccp_ai_ssni_values), ANSI_SSN_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_called_ansi_point_code_indicator, { "Point Code Indicator", "sccp.called.pci", FT_UINT8, BASE_HEX, VALS(sccp_ai_pci_values), ANSI_PC_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_called_ssn, { "SubSystem Number", "sccp.called.ssn", FT_UINT8, BASE_DEC, VALS(sccp_ssn_values), 0x0, NULL, HFILL} }, { &hf_sccp_called_itu_pc, { "PC", "sccp.called.pc", FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK, NULL, HFILL} }, { &hf_sccp_called_ansi_pc, { "PC", "sccp.called.ansi_pc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_called_chinese_pc, { "PC", "sccp.called.chinese_pc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_called_japan_pc, { "PC", "sccp.called.pc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_called_pc_network, { "PC Network", "sccp.called.network", FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK, NULL, HFILL } }, { &hf_sccp_called_pc_cluster, { "PC Cluster", "sccp.called.cluster", FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK, NULL, HFILL } }, { &hf_sccp_called_pc_member, { "PC Member", "sccp.called.member", FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK, NULL, HFILL } }, { &hf_sccp_called_gt_nai, { "Nature of Address Indicator", "sccp.called.nai", FT_UINT8, BASE_HEX, VALS(sccp_nai_values), GT_NAI_MASK, NULL, HFILL } }, { &hf_sccp_called_gt_oe, { "Odd/Even Indicator", "sccp.called.oe", FT_UINT8, BASE_HEX, VALS(sccp_oe_values), GT_OE_MASK, NULL, HFILL } }, { &hf_sccp_called_gt_tt, { "Translation Type", "sccp.called.tt", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_called_gt_np, { "Numbering Plan", "sccp.called.np", FT_UINT8, BASE_HEX, VALS(sccp_np_values), GT_NP_MASK, NULL, HFILL } }, { &hf_sccp_called_gt_es, { "Encoding Scheme", "sccp.called.es", FT_UINT8, BASE_HEX, VALS(sccp_es_values), GT_ES_MASK, NULL, HFILL } }, { &hf_sccp_called_gt_digits, { "Called Party Digits", "sccp.called.digits", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_called_gt_digits_length, { "Number of Called Party Digits", "sccp.called.digits.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_calling_ansi_national_indicator, { "National Indicator", "sccp.calling.ni", FT_UINT8, BASE_HEX, VALS(sccp_ansi_national_indicator_values), ANSI_NATIONAL_MASK, NULL, HFILL} }, { &hf_sccp_calling_itu_natl_use_bit, { "Reserved for national use", "sccp.calling.reserved", FT_UINT8, BASE_HEX, NULL, ITU_RESERVED_MASK, NULL, HFILL} }, { &hf_sccp_calling_routing_indicator, { "Routing Indicator", "sccp.calling.ri", FT_UINT8, BASE_HEX, VALS(sccp_routing_indicator_values), ROUTING_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_calling_itu_global_title_indicator, { "Global Title Indicator", "sccp.calling.gti", FT_UINT8, BASE_HEX, VALS(sccp_itu_global_title_indicator_values), GTI_MASK, NULL, HFILL} }, { &hf_sccp_calling_ansi_global_title_indicator, { "Global Title Indicator", "sccp.calling.gti", FT_UINT8, BASE_HEX, VALS(sccp_ansi_global_title_indicator_values), GTI_MASK, NULL, HFILL} }, { &hf_sccp_calling_itu_ssn_indicator, { "SubSystem Number Indicator", "sccp.calling.ssni", FT_UINT8, BASE_HEX, VALS(sccp_ai_ssni_values), ITU_SSN_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_calling_itu_point_code_indicator, { "Point Code Indicator", "sccp.calling.pci", FT_UINT8, BASE_HEX, VALS(sccp_ai_pci_values), ITU_PC_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_calling_ansi_ssn_indicator, { "SubSystem Number Indicator", "sccp.calling.ssni", FT_UINT8, BASE_HEX, VALS(sccp_ai_ssni_values), ANSI_SSN_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_calling_ansi_point_code_indicator, { "Point Code Indicator", "sccp.calling.pci", FT_UINT8, BASE_HEX, VALS(sccp_ai_pci_values), ANSI_PC_INDICATOR_MASK, NULL, HFILL} }, { &hf_sccp_calling_ssn, { "SubSystem Number", "sccp.calling.ssn", FT_UINT8, BASE_DEC, VALS(sccp_ssn_values), 0x0, NULL, HFILL} }, { &hf_sccp_calling_itu_pc, { "PC", "sccp.calling.pc", FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK, NULL, HFILL} }, { &hf_sccp_calling_ansi_pc, { "PC", "sccp.calling.ansi_pc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_calling_chinese_pc, { "PC", "sccp.calling.chinese_pc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_calling_japan_pc, { "PC", "sccp.calling.pc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_calling_pc_network, { "PC Network", "sccp.calling.network", FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK, NULL, HFILL } }, { &hf_sccp_calling_pc_cluster, { "PC Cluster", "sccp.calling.cluster", FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK, NULL, HFILL } }, { &hf_sccp_calling_pc_member, { "PC Member", "sccp.calling.member", FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK, NULL, HFILL } }, { &hf_sccp_calling_gt_nai, { "Nature of Address Indicator", "sccp.calling.nai", FT_UINT8, BASE_HEX, VALS(sccp_nai_values), GT_NAI_MASK, NULL, HFILL } }, { &hf_sccp_calling_gt_oe, { "Odd/Even Indicator", "sccp.calling.oe", FT_UINT8, BASE_HEX, VALS(sccp_oe_values), GT_OE_MASK, NULL, HFILL } }, { &hf_sccp_calling_gt_tt, { "Translation Type", "sccp.calling.tt", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_calling_gt_np, { "Numbering Plan", "sccp.calling.np", FT_UINT8, BASE_HEX, VALS(sccp_np_values), GT_NP_MASK, NULL, HFILL } }, { &hf_sccp_calling_gt_es, { "Encoding Scheme", "sccp.calling.es", FT_UINT8, BASE_HEX, VALS(sccp_es_values), GT_ES_MASK, NULL, HFILL } }, { &hf_sccp_calling_gt_digits, { "Calling Party Digits", "sccp.calling.digits", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_calling_gt_digits_length, { "Number of Calling Party Digits", "sccp.calling.digits.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sccp_dlr, { "Destination Local Reference", "sccp.dlr", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_slr, { "Source Local Reference", "sccp.slr", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_lr, { "Local Reference", "sccp.lr", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_class, { "Class", "sccp.class", FT_UINT8, BASE_HEX, NULL, CLASS_CLASS_MASK, NULL, HFILL} }, { &hf_sccp_handling, { "Message handling", "sccp.handling", FT_UINT8, BASE_HEX, VALS(sccp_class_handling_values), CLASS_SPARE_HANDLING_MASK, NULL, HFILL} }, { &hf_sccp_more, { "More data", "sccp.more", FT_UINT8, BASE_HEX, VALS(sccp_segmenting_reassembling_values), SEGMENTING_REASSEMBLING_MASK, NULL, HFILL} }, { &hf_sccp_rsn, { "Receive Sequence Number", "sccp.rsn", FT_UINT8, BASE_HEX, NULL, RSN_MASK, NULL, HFILL} }, { &hf_sccp_sequencing_segmenting_ssn, { "Sequencing Segmenting: Send Sequence Number", "sccp.sequencing_segmenting.ssn", FT_UINT8, BASE_HEX, NULL, SEND_SEQUENCE_NUMBER_MASK, NULL, HFILL} }, { &hf_sccp_sequencing_segmenting_rsn, { "Sequencing Segmenting: Receive Sequence Number", "sccp.sequencing_segmenting.rsn", FT_UINT8, BASE_HEX, NULL, RECEIVE_SEQUENCE_NUMBER_MASK, NULL, HFILL} }, { &hf_sccp_sequencing_segmenting_more, { "Sequencing Segmenting: More", "sccp.sequencing_segmenting.more", FT_UINT8, BASE_HEX, VALS(sccp_segmenting_reassembling_values), SEQUENCING_SEGMENTING_MORE_MASK, NULL, HFILL} }, { &hf_sccp_credit, { "Credit", "sccp.credit", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_release_cause, { "Release Cause", "sccp.release_cause", FT_UINT8, BASE_HEX, VALS(sccp_release_cause_values), 0x0, NULL, HFILL} }, { &hf_sccp_return_cause, { "Return Cause", "sccp.return_cause", FT_UINT8, BASE_HEX, VALS(sccp_return_cause_values), 0x0, NULL, HFILL} }, { &hf_sccp_reset_cause, { "Reset Cause", "sccp.reset_cause", FT_UINT8, BASE_HEX, VALS(sccp_reset_cause_values), 0x0, NULL, HFILL} }, { &hf_sccp_error_cause, { "Error Cause", "sccp.error_cause", FT_UINT8, BASE_HEX, VALS(sccp_error_cause_values), 0x0, NULL, HFILL} }, { &hf_sccp_refusal_cause, { "Refusal Cause", "sccp.refusal_cause", FT_UINT8, BASE_HEX, VALS(sccp_refusal_cause_values), 0x0, NULL, HFILL} }, { &hf_sccp_segmentation_first, { "Segmentation: First", "sccp.segmentation.first", FT_UINT8, BASE_HEX, VALS(sccp_segmentation_first_segment_values), SEGMENTATION_FIRST_SEGMENT_MASK, NULL, HFILL} }, { &hf_sccp_segmentation_class, { "Segmentation: Class", "sccp.segmentation.class", FT_UINT8, BASE_HEX, VALS(sccp_segmentation_class_values), SEGMENTATION_CLASS_MASK, NULL, HFILL} }, { &hf_sccp_segmentation_remaining, { "Segmentation: Remaining", "sccp.segmentation.remaining", FT_UINT8, BASE_HEX, NULL, SEGMENTATION_REMAINING_MASK, NULL, HFILL} }, { &hf_sccp_segmentation_slr, { "Segmentation: Source Local Reference", "sccp.segmentation.slr", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_hop_counter, { "Hop Counter", "sccp.hops", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_importance, { "Importance", "sccp.importance", FT_UINT8, BASE_HEX, NULL, IMPORTANCE_IMPORTANCE_MASK, NULL, HFILL} }, /* ISNI is ANSI only */ { &hf_sccp_ansi_isni_mi, { "ISNI Mark for Identification Indicator", "sccp.isni.mi", FT_UINT8, BASE_HEX, VALS(sccp_isni_mark_for_id_values), ANSI_ISNI_MI_MASK, NULL, HFILL} }, { &hf_sccp_ansi_isni_iri, { "ISNI Routing Indicator", "sccp.isni.iri", FT_UINT8, BASE_HEX, VALS(sccp_isni_iri_values), ANSI_ISNI_IRI_MASK, NULL, HFILL} }, { &hf_sccp_ansi_isni_ti, { "ISNI Type Indicator", "sccp.isni.ti", FT_UINT8, BASE_HEX, VALS(sccp_isni_ti_values), ANSI_ISNI_TI_MASK, NULL, HFILL} }, { &hf_sccp_ansi_isni_netspec, { "ISNI Network Specific (Type 1)", "sccp.isni.netspec", FT_UINT8, BASE_HEX, NULL, ANSI_ISNI_NETSPEC_MASK, NULL, HFILL} }, { &hf_sccp_ansi_isni_counter, { "ISNI Counter", "sccp.isni.counter", FT_UINT8, BASE_DEC, NULL, ANSI_ISNI_COUNTER_MASK, NULL, HFILL} }, { &hf_sccp_ansi_isni_network, { "Network ID network", "sccp.isni.network", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sccp_ansi_isni_cluster, { "Network ID cluster", "sccp.isni.cluster", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} }, {&hf_sccp_xudt_msg_fragments, { "Message fragments", "sccp.msg.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment, { "Message fragment", "sccp.msg.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment_overlap, { "Message fragment overlap", "sccp.msg.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment_overlap_conflicts, { "Message fragment overlapping with conflicting data", "sccp.msg.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment_multiple_tails, { "Message has multiple tail fragments", "sccp.msg.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment_too_long_fragment, { "Message fragment too long", "sccp.msg.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment_error, { "Message defragmentation error", "sccp.msg.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_xudt_msg_fragment_count, { "Message fragment count", "sccp.msg.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_xudt_msg_reassembled_in, { "Reassembled in", "sccp.msg.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_xudt_msg_reassembled_length, { "Reassembled SCCP length", "sccp.msg.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_sccp_assoc_id, { "Association ID", "sccp.assoc.id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, {&hf_sccp_assoc_msg, { "Message in frame", "sccp.assoc.msg", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_segmented_data, { "Segmented Data", "sccp.segmented_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_linked_dissector, { "Linked dissector", "sccp.linked_dissector", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_end_optional_param, { "End of Optional", "sccp.end_optional_param", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_unknown_message, { "Unknown message", "sccp.unknown_message", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, {&hf_sccp_unknown_parameter, { "Unknown parameter", "sccp.unknown_parameter", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sccp, &ett_sccp_called, &ett_sccp_called_ai, &ett_sccp_called_pc, &ett_sccp_called_gt, &ett_sccp_called_gt_digits, &ett_sccp_calling, &ett_sccp_calling_ai, &ett_sccp_calling_pc, &ett_sccp_calling_gt, &ett_sccp_calling_gt_digits, &ett_sccp_sequencing_segmenting, &ett_sccp_segmentation, &ett_sccp_ansi_isni_routing_control, &ett_sccp_xudt_msg_fragment, &ett_sccp_xudt_msg_fragments, &ett_sccp_assoc }; static ei_register_info ei[] = { { &ei_sccp_wrong_length, { "sccp.wrong_length", PI_MALFORMED, PI_ERROR, "Wrong length indicated.", EXPFILL }}, { &ei_sccp_international_standard_address, { "sccp.international_standard_address", PI_MALFORMED, PI_WARN, "Address is coded to international standards. This doesn't normally happen in ANSI networks.", EXPFILL }}, { &ei_sccp_no_ssn_present, { "sccp.ssn.not_present", PI_PROTOCOL, PI_WARN, "Message is routed on SSN, but SSN is not present", EXPFILL }}, { &ei_sccp_ssn_zero, { "sccp.ssn.is_zero", PI_PROTOCOL, PI_WARN, "Message is routed on SSN, but SSN is zero (unspecified)", EXPFILL }}, { &ei_sccp_class_unexpected, { "sccp.class_unexpected", PI_MALFORMED, PI_ERROR, "Unexpected message class for this message type", EXPFILL }}, { &ei_sccp_handling_invalid, { "sccp.handling_invalid", PI_MALFORMED, PI_ERROR, "Invalid message handling", EXPFILL }}, { &ei_sccp_gt_digits_missing, { "sccp.gt_digits_missing", PI_MALFORMED, PI_ERROR, "Address digits missing", EXPFILL }}, { &ei_sccp_externally_reassembled, { "sccp.externally_reassembled", PI_ASSUMPTION, PI_NOTE, "Possibly externally reassembled (remaining length > 255 bytes), enable in SCCP preferences", EXPFILL }}, }; /* Decode As handling */ static build_valid_func sccp_da_build_value[1] = {sccp_value}; static decode_as_value_t sccp_da_values = {sccp_prompt, 1, sccp_da_build_value}; static decode_as_t sccp_da = {"sccp", "sccp.ssn", 1, 0, &sccp_da_values, NULL, NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; module_t *sccp_module; expert_module_t* expert_sccp; static uat_field_t users_flds[] = { UAT_FLD_DEC(sccp_users, ni, "Network Indicator", "Network Indicator"), UAT_FLD_RANGE(sccp_users, called_pc, "Called DPCs", 0xFFFFFF, "DPCs for which this protocol is to be used"), UAT_FLD_RANGE(sccp_users, called_ssn, "Called SSNs", 255, "Called SSNs for which this protocol is to be used"), UAT_FLD_VS(sccp_users, user, "User protocol", sccp_users_vals, "The User Protocol"), UAT_END_FIELDS }; uat_t *users_uat = uat_new("SCCP Users Table", sizeof(sccp_user_t), "sccp_users", TRUE, &sccp_users, &num_sccp_users, UAT_AFFECTS_DISSECTION, "ChSccpUsers", sccp_users_copy_cb, sccp_users_update_cb, sccp_users_free_cb, NULL, NULL, users_flds ); /* Register the protocol name and description */ proto_sccp = proto_register_protocol("Signalling Connection Control Part", "SCCP", "sccp"); sccp_handle = register_dissector("sccp", dissect_sccp, proto_sccp); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sccp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sccp = expert_register_protocol(proto_sccp); expert_register_field_array(expert_sccp, ei, array_length(ei)); sccp_ssn_dissector_table = register_dissector_table("sccp.ssn", "SCCP SSN", proto_sccp, FT_UINT8, BASE_DEC); heur_subdissector_list = register_heur_dissector_list("sccp", proto_sccp); sccp_module = prefs_register_protocol(proto_sccp, proto_reg_handoff_sccp); prefs_register_uint_preference(sccp_module, "source_pc", "Source PC (in hex)", "The source point code (usually MSC) (to determine whether message is uplink or downlink)", 16, &sccp_source_pc_global); prefs_register_bool_preference(sccp_module, "show_length", "Show length", "Show parameter length in the protocol tree", &sccp_show_length); prefs_register_bool_preference(sccp_module, "defragment_xudt", "Reassemble SCCP messages", "Whether SCCP messages should be reassembled", &sccp_reassemble); prefs_register_bool_preference(sccp_module, "trace_sccp", "Trace Associations", "Whether to keep information about messages and their associations", &trace_sccp); prefs_register_bool_preference(sccp_module, "show_more_info", "Show key parameters in Info Column", "Show SLR, DLR, and CAUSE Parameters in the Information Column of the Summary", &show_key_params); prefs_register_uat_preference(sccp_module, "users_table", "Users Table", "A table that enumerates user protocols to be used against specific PCs and SSNs", users_uat); prefs_register_bool_preference(sccp_module, "set_addresses", "Set source and destination GT addresses", "Set the source and destination addresses to the GT digits (if present)." " This may affect TCAP's ability to recognize which messages belong to which TCAP session.", &set_addresses); prefs_register_string_preference(sccp_module, "default_payload", "Default Payload", "The protocol which should be used to dissect the payload if nothing else has claimed it", &default_payload); prefs_register_bool_preference(sccp_module, "dt1_ignore_length", "Dissect data past 255 byte limit", "Use all bytes for data payload. Overcome 255 bytes limit of SCCP standard." " (Some tracing tools externally reassemble segmented data.)", &dt1_ignore_length); register_init_routine(&init_sccp); reassembly_table_register(&sccp_xudt_msg_reassembly_table, &addresses_reassembly_table_functions); assocs = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); sccp_reassembly_ids = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); sccp_reassembly_id_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal); sccp_tap = register_tap("sccp"); register_decode_as(&sccp_da); } void proto_reg_handoff_sccp(void) { static gboolean initialised = FALSE; if (!initialised) { dissector_add_uint("wtap_encap", WTAP_ENCAP_SCCP, sccp_handle); dissector_add_uint("mtp3.service_indicator", MTP_SI_SCCP, sccp_handle); dissector_add_string("tali.opcode", "sccp", sccp_handle); data_handle = find_dissector("data"); tcap_handle = find_dissector_add_dependency("tcap", proto_sccp); ranap_handle = find_dissector_add_dependency("ranap", proto_sccp); bssap_handle = find_dissector_add_dependency("bssap", proto_sccp); gsmmap_handle = find_dissector_add_dependency("gsm_map_sccp", proto_sccp); camel_handle = find_dissector_add_dependency("camel", proto_sccp); inap_handle = find_dissector_add_dependency("inap", proto_sccp); bsap_handle = find_dissector_add_dependency("bsap", proto_sccp); bssap_le_handle = find_dissector_add_dependency("bssap_le", proto_sccp); bssap_plus_handle = find_dissector_add_dependency("bssap_plus", proto_sccp); ss7pc_address_type = address_type_get_by_name("AT_SS7PC"); initialised = TRUE; hf_assoc_imsi = proto_registrar_get_id_byname("e212.assoc.imsi"); } default_handle = find_dissector(default_payload); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-sccp.h
/* packet-sccp.h * Definitions for Signalling Connection Control Part (SCCP) dissection * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCCP_H #define __PACKET_SCCP_H #include "ws_symbol_export.h" #define SCCP_MSG_TYPE_CR 0x01 #define SCCP_MSG_TYPE_CC 0x02 #define SCCP_MSG_TYPE_CREF 0x03 #define SCCP_MSG_TYPE_RLSD 0x04 #define SCCP_MSG_TYPE_RLC 0x05 #define SCCP_MSG_TYPE_DT1 0x06 #define SCCP_MSG_TYPE_DT2 0x07 #define SCCP_MSG_TYPE_AK 0x08 #define SCCP_MSG_TYPE_UDT 0x09 #define SCCP_MSG_TYPE_UDTS 0x0a #define SCCP_MSG_TYPE_ED 0x0b #define SCCP_MSG_TYPE_EA 0x0c #define SCCP_MSG_TYPE_RSR 0x0d #define SCCP_MSG_TYPE_RSC 0x0e #define SCCP_MSG_TYPE_ERR 0x0f #define SCCP_MSG_TYPE_IT 0x10 #define SCCP_MSG_TYPE_XUDT 0x11 #define SCCP_MSG_TYPE_XUDTS 0x12 #define SCCP_MSG_TYPE_LUDT 0x13 #define SCCP_MSG_TYPE_LUDTS 0x14 WS_DLL_PUBLIC const value_string sccp_message_type_acro_values[]; WS_DLL_PUBLIC const value_string sccp_release_cause_values[]; WS_DLL_PUBLIC const value_string sccp_return_cause_values[]; WS_DLL_PUBLIC const value_string sccp_reset_cause_values[]; WS_DLL_PUBLIC const value_string sccp_error_cause_values[]; WS_DLL_PUBLIC const value_string sccp_refusal_cause_values[]; /* from packet-sua.c */ WS_DLL_PUBLIC const value_string sua_co_class_type_acro_values[]; typedef enum _sccp_payload_t { SCCP_PLOAD_NONE, SCCP_PLOAD_BSSAP, SCCP_PLOAD_RANAP, SCCP_PLOAD_NUM_PLOADS } sccp_payload_t; typedef struct _sccp_msg_info_t { guint framenum; guint offset; guint type; union { struct { gchar* label; gchar* comment; gchar* imsi; struct _sccp_assoc_info_t* assoc; struct _sccp_msg_info_t* next; } co; struct { guint8* calling_gt; guint calling_ssn; guint8* called_gt; guint called_ssn; } ud; } data; } sccp_msg_info_t; typedef struct _sccp_assoc_info_t { guint32 id; guint32 calling_dpc; guint32 called_dpc; guint8 calling_ssn; guint8 called_ssn; gboolean has_fw_key; gboolean has_bw_key; sccp_msg_info_t* msgs; sccp_msg_info_t* curr_msg; sccp_payload_t payload; gchar* calling_party; gchar* called_party; gchar* extra_info; gchar* imsi; guint32 app_info; /* used only by dissectors of protocols above SCCP */ } sccp_assoc_info_t; typedef struct _sccp_decode_context_t { guint8 message_type; guint dlr; guint slr; sccp_assoc_info_t* assoc; sccp_msg_info_t* sccp_msg; } sccp_decode_context_t; extern sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, sccp_decode_context_t* value); extern gboolean looks_like_valid_sccp(guint32 frame_num, tvbuff_t *tvb, guint8 my_mtp3_standard); #define INVALID_LR 0xffffff /* a reserved value */ #define GT_SIGNAL_LENGTH 1 #define GT_ODD_SIGNAL_MASK 0x0f #define GT_EVEN_SIGNAL_MASK 0xf0 #define GT_EVEN_SIGNAL_SHIFT 4 #define GT_MAX_SIGNALS (32*7) /* it's a bit big, but it allows for adding a lot of "(spare)" and "Unknown" values (7 chars) if there are errors - e.g. ANSI vs ITU wrongly selected */ WS_DLL_PUBLIC const value_string sccp_address_signal_values[]; #endif
C
wireshark/epan/dissectors/packet-sccpmg.c
/* packet-sccpmg.c * Routines for Signalling Connection Control Part (SCCP) Management dissection * * It is hopefully compliant to: * ANSI T1.112.3-1996 * ITU-T Q.713 7/1996 * YDN 038-1997 (Chinese ITU variant) * JT-Q714 and NTT-Q714 (Japan) * * Note that NTT Annex E (SCCP Management Procedure (Global Title Status * Management)) is not implemented (yet) * * Copyright 2002, Jeff Morriss <jeff.morriss.ws [AT] gmail.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include "packet-mtp3.h" #define SCCPMG_SSN 1 #define SCCPMG_MESSAGE_TYPE_SSA 0x01 #define SCCPMG_MESSAGE_TYPE_SSP 0x02 #define SCCPMG_MESSAGE_TYPE_SST 0x03 #define SCCPMG_MESSAGE_TYPE_SOR 0x04 #define SCCPMG_MESSAGE_TYPE_SOG 0x05 /* SSC is ITU only */ #define SCCPMG_MESSAGE_TYPE_SSC 0x06 /* Below are ANSI only */ #define SCCPMG_MESSAGE_TYPE_SBR 0xfd #define SCCPMG_MESSAGE_TYPE_SNR 0xfe #define SCCPMG_MESSAGE_TYPE_SRT 0xff void proto_register_sccpmg(void); void proto_reg_handoff_sccpmg(void); /* Same as below but with names typed out */ static const value_string sccpmg_message_type_values[] = { { SCCPMG_MESSAGE_TYPE_SSA, "SubSystem Allowed" }, { SCCPMG_MESSAGE_TYPE_SSP, "SubSystem Prohibited" }, { SCCPMG_MESSAGE_TYPE_SST, "Subsystem Status Test" }, { SCCPMG_MESSAGE_TYPE_SOR, "Subsystem Out of service Request" }, { SCCPMG_MESSAGE_TYPE_SOG, "Subsystem Out of service Grant" }, { SCCPMG_MESSAGE_TYPE_SSC, "SubSystem Congested (ITU)" }, { SCCPMG_MESSAGE_TYPE_SBR, "Subsystem Backup Routing (ANSI)" }, { SCCPMG_MESSAGE_TYPE_SNR, "Subsystem Normal Routing (ANSI)" }, { SCCPMG_MESSAGE_TYPE_SRT, "Subsystem Routing status Test (ANSI)" }, { 0, NULL } }; /* Same as above but in acronym for (for the Info column) */ static const value_string sccpmg_message_type_acro_values[] = { { SCCPMG_MESSAGE_TYPE_SSA, "SSA" }, { SCCPMG_MESSAGE_TYPE_SSP, "SSP" }, { SCCPMG_MESSAGE_TYPE_SST, "SST" }, { SCCPMG_MESSAGE_TYPE_SOR, "SOR" }, { SCCPMG_MESSAGE_TYPE_SOG, "SOG" }, { SCCPMG_MESSAGE_TYPE_SSC, "SSC" }, { SCCPMG_MESSAGE_TYPE_SBR, "SBR" }, { SCCPMG_MESSAGE_TYPE_SNR, "SNR" }, { SCCPMG_MESSAGE_TYPE_SRT, "SRT" }, { 0, NULL } }; #define SCCPMG_MESSAGE_TYPE_OFFSET 0 #define SCCPMG_MESSAGE_TYPE_LENGTH 1 #define SCCPMG_AFFECTED_SSN_OFFSET SCCPMG_MESSAGE_TYPE_LENGTH #define SCCPMG_AFFECTED_SSN_LENGTH 1 #define SCCPMG_AFFECTED_PC_OFFSET (SCCPMG_AFFECTED_SSN_OFFSET + SCCPMG_AFFECTED_SSN_LENGTH) #define ITU_SCCPMG_AFFECTED_PC_LENGTH 2 #define ANSI_SCCPMG_AFFECTED_PC_LENGTH 3 #define ITU_SCCPMG_SMI_OFFSET (SCCPMG_AFFECTED_PC_OFFSET + ITU_SCCPMG_AFFECTED_PC_LENGTH) #define ANSI_SCCPMG_SMI_OFFSET (SCCPMG_AFFECTED_PC_OFFSET + ANSI_SCCPMG_AFFECTED_PC_LENGTH) #define SCCPMG_SMI_LENGTH 1 #define SCCPMG_SMI_MASK 0x3 #define ITU_SCCPMG_CONGESTION_OFFSET (ITU_SCCPMG_SMI_OFFSET + SCCPMG_SMI_LENGTH) #define ITU_SCCPMG_CONGESTION_LENGTH 1 #define ITU_SCCPMG_CONGESTION_MASK 0x0f #define CHINESE_ITU_SCCPMG_CONGESTION_OFFSET (ANSI_SCCPMG_SMI_OFFSET + SCCPMG_SMI_LENGTH) #define SCCPMG_SSN_LENGTH 1 /* Initialize the protocol and registered fields */ static int proto_sccpmg = -1; static int hf_sccpmg_message_type = -1; static int hf_sccpmg_affected_ssn = -1; static int hf_sccpmg_affected_itu_pc = -1; static int hf_sccpmg_affected_japan_pc = -1; static int hf_sccpmg_affected_ansi_pc = -1; static int hf_sccpmg_affected_chinese_pc = -1; static int hf_sccpmg_affected_pc_member = -1; static int hf_sccpmg_affected_pc_cluster = -1; static int hf_sccpmg_affected_pc_network = -1; static int hf_sccpmg_smi = -1; static int hf_sccpmg_congestion_level = -1; /* Initialize the subtree pointers */ static gint ett_sccpmg = -1; static gint ett_sccpmg_affected_pc = -1; static expert_field ei_sccpmg_unknown_msg = EI_INIT; static void dissect_sccpmg_affected_ssn(tvbuff_t *tvb, proto_tree *sccpmg_tree) { proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_ssn, tvb, SCCPMG_AFFECTED_SSN_OFFSET, SCCPMG_SSN_LENGTH, ENC_BIG_ENDIAN); } static void dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree) { guint8 offset = SCCPMG_AFFECTED_PC_OFFSET; if (mtp3_standard == ITU_STANDARD) { proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_itu_pc, tvb, offset, ITU_PC_LENGTH, ENC_LITTLE_ENDIAN); } else if (mtp3_standard == JAPAN_STANDARD) { proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_japan_pc, tvb, offset, JAPAN_PC_LENGTH, ENC_LITTLE_ENDIAN); } else /* ANSI_STANDARD and CHINESE_ITU_STANDARD */ { int *hf_affected_pc; if (mtp3_standard == ANSI_STANDARD) { hf_affected_pc = &hf_sccpmg_affected_ansi_pc; } else /* CHINESE_ITU_STANDARD */ { hf_affected_pc = &hf_sccpmg_affected_chinese_pc; } /* create and fill the PC tree */ dissect_mtp3_3byte_pc(tvb, offset, sccpmg_tree, ett_sccpmg_affected_pc, *hf_affected_pc, hf_sccpmg_affected_pc_network, hf_sccpmg_affected_pc_cluster, hf_sccpmg_affected_pc_member, 0, 0); } } static void dissect_sccpmg_smi(tvbuff_t *tvb, proto_tree *sccpmg_tree) { guint8 offset = 0; if (mtp3_standard == ITU_STANDARD || mtp3_standard == JAPAN_STANDARD) offset = ITU_SCCPMG_SMI_OFFSET; else /* ANSI_STANDARD and CHINESE_ITU_STANDARD */ offset = ANSI_SCCPMG_SMI_OFFSET; proto_tree_add_item(sccpmg_tree, hf_sccpmg_smi, tvb, offset, SCCPMG_SMI_LENGTH, ENC_BIG_ENDIAN); } static void dissect_sccpmg_congestion_level(tvbuff_t *tvb, proto_tree *sccpmg_tree) { guint8 offset = 0; if (mtp3_standard == CHINESE_ITU_STANDARD) offset = CHINESE_ITU_SCCPMG_CONGESTION_OFFSET; else /* ITU_STANDARD or JAPAN_STANDARD */ offset = ITU_SCCPMG_CONGESTION_OFFSET; proto_tree_add_item(sccpmg_tree, hf_sccpmg_congestion_level, tvb, offset, ITU_SCCPMG_CONGESTION_LENGTH, ENC_BIG_ENDIAN); } static void dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tree) { guint8 message_type; /* Extract the message type; all other processing is based on this */ message_type = tvb_get_guint8(tvb, SCCPMG_MESSAGE_TYPE_OFFSET); col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, sccpmg_message_type_acro_values, "Unknown")); if (sccpmg_tree) { /* add the message type to the protocol tree */ proto_tree_add_uint(sccpmg_tree, hf_sccpmg_message_type, tvb, SCCPMG_MESSAGE_TYPE_OFFSET, SCCPMG_MESSAGE_TYPE_LENGTH, message_type); } switch(message_type) { case SCCPMG_MESSAGE_TYPE_SBR: case SCCPMG_MESSAGE_TYPE_SNR: case SCCPMG_MESSAGE_TYPE_SRT: if (mtp3_standard != ANSI_STANDARD) { proto_tree_add_expert(sccpmg_tree, pinfo, &ei_sccpmg_unknown_msg, tvb, 0, -1); break; } /* else fallthrough */ case SCCPMG_MESSAGE_TYPE_SSA: case SCCPMG_MESSAGE_TYPE_SSP: case SCCPMG_MESSAGE_TYPE_SST: case SCCPMG_MESSAGE_TYPE_SOR: case SCCPMG_MESSAGE_TYPE_SOG: dissect_sccpmg_affected_ssn(tvb, sccpmg_tree); dissect_sccpmg_affected_pc(tvb, sccpmg_tree); dissect_sccpmg_smi(tvb, sccpmg_tree); break; case SCCPMG_MESSAGE_TYPE_SSC: if (mtp3_standard != ANSI_STANDARD) { dissect_sccpmg_affected_ssn(tvb, sccpmg_tree); dissect_sccpmg_affected_pc(tvb, sccpmg_tree); dissect_sccpmg_smi(tvb, sccpmg_tree); dissect_sccpmg_congestion_level(tvb, sccpmg_tree); } /* else fallthrough */ default: proto_tree_add_expert(sccpmg_tree, pinfo, &ei_sccpmg_unknown_msg, tvb, 0, -1); } } static int dissect_sccpmg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *sccpmg_item; proto_tree *sccpmg_tree = NULL; /* Make entry in the Protocol column on summary display */ switch(mtp3_standard) { case ITU_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (Int. ITU)"); break; case ANSI_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (ANSI)"); break; case CHINESE_ITU_STANDARD: col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (Chin. ITU)"); break; }; /* In the interest of speed, if "tree" is NULL, don't do any work not necessary to generate protocol tree items. */ if (tree) { /* create the sccpmg protocol tree */ sccpmg_item = proto_tree_add_item(tree, proto_sccpmg, tvb, 0, -1, ENC_NA); sccpmg_tree = proto_item_add_subtree(sccpmg_item, ett_sccpmg); } /* dissect the message */ dissect_sccpmg_message(tvb, pinfo, sccpmg_tree); return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ void proto_register_sccpmg(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_sccpmg_message_type, { "Message Type", "sccpmg.message_type", FT_UINT8, BASE_HEX, VALS(sccpmg_message_type_values), 0x0, NULL, HFILL}}, { &hf_sccpmg_affected_ssn, { "Affected SubSystem Number", "sccpmg.ssn", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sccpmg_affected_itu_pc, { "Affected Point Code", "sccpmg.pc", FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK, NULL, HFILL}}, { &hf_sccpmg_affected_japan_pc, { "Affected Point Code", "sccpmg.pc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sccpmg_affected_ansi_pc, { "Affected Point Code", "sccpmg.ansi_pc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_sccpmg_affected_chinese_pc, { "Affected Point Code", "sccpmg.chinese_pc", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_sccpmg_affected_pc_network, { "Affected PC Network", "sccpmg.network", FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK, NULL, HFILL}}, { &hf_sccpmg_affected_pc_cluster, { "Affected PC Cluster", "sccpmg.cluster", FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK, NULL, HFILL}}, { &hf_sccpmg_affected_pc_member, { "Affected PC Member", "sccpmg.member", FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK, NULL, HFILL}}, { &hf_sccpmg_smi, { "Subsystem Multiplicity Indicator", "sccpmg.smi", FT_UINT8, BASE_DEC, NULL, SCCPMG_SMI_MASK, NULL, HFILL}}, { &hf_sccpmg_congestion_level, { "SCCP Congestion Level (ITU)", "sccpmg.congestion", FT_UINT8, BASE_DEC, NULL, ITU_SCCPMG_CONGESTION_MASK, NULL, HFILL}} }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sccpmg, &ett_sccpmg_affected_pc }; static ei_register_info ei[] = { { &ei_sccpmg_unknown_msg, { "sccpmg.unknown_msg", PI_UNDECODED, PI_WARN, "Unknown message", EXPFILL }}, }; expert_module_t* expert_sccpmg; /* Register the protocol name and description */ proto_sccpmg = proto_register_protocol("Signalling Connection Control Part Management", "SCCPMG", "sccpmg"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sccpmg, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sccpmg = expert_register_protocol(proto_sccpmg); expert_register_field_array(expert_sccpmg, ei, array_length(ei)); } void proto_reg_handoff_sccpmg(void) { dissector_handle_t sccpmg_handle; sccpmg_handle = create_dissector_handle(dissect_sccpmg, proto_sccpmg); /* Register for SCCP SSN=1 messages */ dissector_add_uint("sccp.ssn", SCCPMG_SSN, sccpmg_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-scop.c
/* packet-scop.c * Owen Kirby <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include "packet-tcp.h" /* Default SCOP Port numbers. */ #define SCOP_DEFAULT_PORT_RANGE "17755-17756" void proto_register_scop(void); /* Structure to contain information from the SCoP packet. */ typedef struct { guint8 transport; guint8 version; guint16 length; gboolean encrypted; guint8 service; guint8 type; } scop_packet; /* Header definitions for use with the TCP transport layer. */ #define SCOP_HEADER_LENGTH 4 #define SCOP_LENGTH_OFFSET 2 /* SCoP Transport Types */ #define SCOP_TRANSPORT_UDP 1 #define SCOP_TRANSPORT_TCP 2 #define SCOP_TRANSPORT_UDP_CCM 129 #define SCOP_TRANSPORT_TCP_CCM 130 #define SCOP_TRANSPORT_TCP_SSL 131 /* Service Identifier Field */ #define SCOP_SERVICE_SCOP 0x00 #define SCOP_SERVICE_BRIDGE 0x01 #define SCOP_SERVICE_GATEWAY 0x02 /* SCoP Command Values */ #define SCOP_CMD_HELLO 0x00 #define SCOP_CMD_HELLO_RESP 0x01 #define SCOP_CMD_HELLO_ACK 0x02 #define SCOP_CMD_GOODBYE 0x04 #define SCOP_CMD_GOODBYE_RESP 0x05 #define SCOP_CMD_KEEPALIVE_PING 0x06 #define SCOP_CMD_KEEPALIVE_PONG 0x07 /* Bridge Command type values. */ #define SCOP_BRIDGE_CMD 0x00 #define SCOP_BRIDGE_MSG 0x01 /* Function declarations */ void proto_reg_handoff_scop(void); static void dissect_scop_zip (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static void dissect_scop_bridge (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static guint get_scop_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data); /* Initialize protocol and registered fields */ static int proto_scop = -1; static int hf_scop_transport = -1; static int hf_scop_version = -1; static int hf_scop_length = -1; static int hf_scop_service = -1; static int hf_scop_type = -1; static int hf_scop_status = -1; static gint ett_scop = -1; static const value_string scop_transports [] = { { SCOP_TRANSPORT_UDP, "UDP Mode 1" }, { SCOP_TRANSPORT_TCP, "TCP Mode 2" }, { SCOP_TRANSPORT_UDP_CCM, "UDP Mode 1 with CCM* Security" }, { SCOP_TRANSPORT_TCP_CCM, "TCP Mode 2 with CCM* Security" }, { SCOP_TRANSPORT_TCP_SSL, "TCP Mode 3 with SSL/TSL Tunnel" }, { 0, NULL } }; static const value_string scop_types [] = { { SCOP_CMD_HELLO, "Hello" }, { SCOP_CMD_HELLO_RESP, "Hello Response" }, { SCOP_CMD_HELLO_ACK, "Hello Acknowledgment" }, { SCOP_CMD_GOODBYE, "Goodbye" }, { SCOP_CMD_GOODBYE_RESP, "Goodbye Response" }, { SCOP_CMD_KEEPALIVE_PING, "Keep Alive Ping" }, { SCOP_CMD_KEEPALIVE_PONG, "Keep Alive Pong" }, { 0, NULL } }; static const value_string scop_services [] = { { SCOP_SERVICE_SCOP, "SCoP" }, { SCOP_SERVICE_BRIDGE, "Bridge" }, { SCOP_SERVICE_GATEWAY, "Gateway" }, { 0, NULL } }; /* Dissector handle */ static dissector_handle_t ieee802154_handle; static dissector_handle_t scop_udp_handle; static dissector_handle_t scop_tcp_handle; /*FUNCTION:------------------------------------------------------ * NAME * dissect_scop * DESCRIPTION * ZigBee SCoP packet dissection routine for Wireshark. * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * packet_info *pinfo - pointer to packet information fields * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * RETURNS * void *--------------------------------------------------------------- */ static int dissect_scop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { tvbuff_t *next_tvb; proto_item *proto_root; proto_tree *scop_tree; guint offset = 0; scop_packet packet; memset(&packet, 0, sizeof(packet)); /* Set the protocol name. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCoP"); /* Clear the info column. */ col_clear(pinfo->cinfo, COL_INFO); /* Create the protocol display tree. */ proto_root = proto_tree_add_protocol_format(tree, proto_scop, tvb, 0, tvb_captured_length(tvb), "ZigBee SCoP"); scop_tree = proto_item_add_subtree(proto_root, ett_scop); /* Extract the SCoP Transport type. */ packet.transport = tvb_get_guint8(tvb, offset); proto_tree_add_uint(scop_tree, hf_scop_transport, tvb, offset, 1, packet.transport); offset += 1; /* Extract the SCoP Version. */ packet.version = tvb_get_guint8(tvb, offset); proto_tree_add_uint(scop_tree, hf_scop_version, tvb, offset, 1, packet.version); offset += 1; /* Extract the SCoP Packet length. */ packet.length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(scop_tree, hf_scop_length, tvb, offset, 2, packet.length); offset += 2; if ( (packet.transport == SCOP_TRANSPORT_UDP_CCM) || (packet.transport == SCOP_TRANSPORT_TCP_CCM)) { /* Decryption Failed. */ return offset; } next_tvb = tvb; /* Extract the service type. */ packet.service = tvb_get_guint8(next_tvb, offset); proto_tree_add_uint(scop_tree, hf_scop_service, next_tvb, offset, 1, packet.service); offset += 1; /* Call the appropriate helper routine to dissect based on the service type. */ switch (packet.service) { case SCOP_SERVICE_SCOP: dissect_scop_zip(tvb_new_subset_remaining(next_tvb, offset), pinfo, scop_tree); break; case SCOP_SERVICE_BRIDGE: dissect_scop_bridge(tvb_new_subset_remaining(next_tvb, offset), pinfo, scop_tree); break; case SCOP_SERVICE_GATEWAY: /* Nothing yet defined for the gateway. Fall-Through. */ default: /* Unknown Service Type. */ call_data_dissector(tvb_new_subset_remaining(next_tvb, offset), pinfo, tree); break; } return tvb_captured_length(tvb); } /* dissect_scop() */ /*FUNCTION:------------------------------------------------------ * NAME * get_scop_length * DESCRIPTION * Returns the length of a SCoP packet. For use with the TCP * transport type. * PARAMETERS * packet_info *pinfo - pointer to packet information fields * tvbuff_t *tvb - pointer to buffer containing the packet. * int offset - beginning of packet. * RETURNS * guint - Length of SCoP packet *--------------------------------------------------------------- */ static guint get_scop_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* Byte 0: Protocol Type. * Byte 1: Protocol Version. * Bytes 2-3: Packet Length (network order). */ return tvb_get_ntohs(tvb, offset + SCOP_LENGTH_OFFSET); } /* get_scop_length */ /*FUNCTION:------------------------------------------------------ * NAME * dissect_scop_tcp * DESCRIPTION * ZigBee SCoP packet dissection routine for Wireshark. * for use with TCP ports. * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * packet_info *pinfo - pointer to packet information fields * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * RETURNS * void *--------------------------------------------------------------- */ static int dissect_scop_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, SCOP_HEADER_LENGTH, get_scop_length, dissect_scop, data); return tvb_captured_length(tvb); } /* dissect_scop_tcp */ /*FUNCTION:------------------------------------------------------ * NAME * dissect_scop_zip * DESCRIPTION * Intermediate dissector for the SCoP service type. * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * packet_info *pinfo - pointer to packet information fields * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * RETURNS * void *--------------------------------------------------------------- */ static void dissect_scop_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint offset = 0; guint8 type = tvb_get_guint8(tvb, offset); guint16 status; /* Display the Packet type*/ proto_tree_add_uint(tree, hf_scop_type, tvb, offset, 1, type); proto_item_append_text(tree, ", %s", val_to_str_const(type, scop_types, "Reserved Type")); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, scop_types, "Reserved Type")); offset += 2; if (type == SCOP_CMD_HELLO_RESP) { status = tvb_get_ntohs(tvb, 1); proto_tree_add_uint_format_value(tree, hf_scop_status, tvb, offset, 2, status, "%s", (status==0x0000)?"Success":"Failure"); offset += 2; } /* If there are any bytes left over, pass them to the data dissector. */ if (offset < tvb_reported_length(tvb)) { tvbuff_t *payload_tvb = tvb_new_subset_remaining(tvb, offset); proto_tree *root = proto_tree_get_root(tree); call_data_dissector(payload_tvb, pinfo, root); } } /* dissect_scop_zip() */ /*FUNCTION:------------------------------------------------------ * NAME * dissect_scop_bridge * DESCRIPTION * Intermediate dissector for the Bridge service type. * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * packet_info *pinfo - pointer to packet information fields * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * RETURNS * void *--------------------------------------------------------------- */ static void dissect_scop_bridge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { call_dissector(ieee802154_handle, tvb, pinfo, proto_tree_get_root(tree)); } /* dissect_scop_bridge() */ /*FUNCTION:------------------------------------------------------ * NAME * proto_register_scop * DESCRIPTION * SCoP protocol registration. * PARAMETERS * none * RETURNS * void *--------------------------------------------------------------- */ void proto_register_scop(void) { static hf_register_info hf[] = { { &hf_scop_transport, { "Transport Type", "scop.transport", FT_UINT8, BASE_DEC, VALS(scop_transports), 0x0, "The type of transport used.", HFILL }}, { &hf_scop_version, { "Version", "scop.version", FT_UINT8, BASE_DEC, NULL, 0x0, "The version of the sniffer.", HFILL }}, { &hf_scop_length, { "Length", "scop.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scop_service, { "Service Identifier", "scop.service", FT_UINT8, BASE_DEC, VALS(scop_services), 0x0, NULL, HFILL }}, { &hf_scop_type, { "Packet Type", "scop.type", FT_UINT8, BASE_DEC, VALS(scop_types), 0x0, "Service-specific packet type.", HFILL }}, { &hf_scop_status, { "Status", "scop.status", FT_UINT16, BASE_HEX, NULL, 0x0, "Status of the SCoP Command.", HFILL }} }; static gint *ett[] = { &ett_scop }; /* Register protocol name and description. */ proto_scop = proto_register_protocol("ZigBee SCoP", "SCoP", "scop"); /* Register header fields and subtrees. */ proto_register_field_array(proto_scop, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register dissector with Wireshark. */ scop_udp_handle = register_dissector("scop.udp", dissect_scop, proto_scop); scop_tcp_handle = register_dissector("scop.tcp", dissect_scop_tcp, proto_scop); } /* proto_register_scop() */ /*FUNCTION:------------------------------------------------------ * NAME * proto_reg_handoff_scop * DESCRIPTION * Registers the zigbee dissector with Wireshark. * Will be called every time 'apply' is pressed in the preferences menu. * PARAMETERS * none * RETURNS * void *--------------------------------------------------------------- */ void proto_reg_handoff_scop(void) { ieee802154_handle = find_dissector_add_dependency("wpan_nofcs", proto_scop); dissector_add_uint_range_with_preference("udp.port", SCOP_DEFAULT_PORT_RANGE, scop_udp_handle); dissector_add_uint_range_with_preference("tcp.port", SCOP_DEFAULT_PORT_RANGE, scop_tcp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-scriptingservice.c
/* packet-scriptingservice.c * Routines for the Scripting Service Protocol, a load distribution application * of the RSPLIB RSerPool implementation * https://www.uni-due.de/~be0001/rserpool/ * * Copyright 2006-2021 by Thomas Dreibholz <dreibh [AT] iem.uni-due.de> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/sctpppids.h> #include <epan/stat_tap_ui.h> void proto_register_ssprotocol(void); void proto_reg_handoff_ssprotocol(void); #define SSPROTOCOL_PAYLOAD_PROTOCOL_ID_LEGACY 0x29097604 /* Initialize the protocol and registered fields */ static int proto_ssprotocol = -1; static int tap_ssprotocol = -1; static int hf_message_type = -1; static int hf_message_flags = -1; static int hf_message_length = -1; static int hf_message_status = -1; static int hf_message_data = -1; static int hf_message_reason = -1; static int hf_message_info = -1; static int hf_message_hash = -1; static int hf_environment_u_bit = -1; static guint64 ssprotocol_total_msgs = 0; static guint64 ssprotocol_total_bytes = 0; /* Initialize the subtree pointers */ static gint ett_ssprotocol = -1; static gint ett_environment_flags = -1; /* Dissectors for messages. This is specific to ScriptingServiceProtocol */ #define MESSAGE_TYPE_LENGTH 1 #define MESSAGE_FLAGS_LENGTH 1 #define MESSAGE_LENGTH_LENGTH 2 #define MESSAGE_STATUS_LENGTH 4 #define MESSAGE_NOTRDY_REASON_LENGTH 4 #define MESSAGE_ENVIRON_HASH_LENGTH 20 #define MESSAGE_TYPE_OFFSET 0 #define MESSAGE_FLAGS_OFFSET (MESSAGE_TYPE_OFFSET + MESSAGE_TYPE_LENGTH) #define MESSAGE_LENGTH_OFFSET (MESSAGE_FLAGS_OFFSET + MESSAGE_FLAGS_LENGTH) #define MESSAGE_STATUS_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH) #define MESSAGE_DATA_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH) #define MESSAGE_RDY_INFO_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH) #define MESSAGE_NOTRDY_REASON_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH) #define MESSAGE_NOTRDY_INFO_OFFSET (MESSAGE_NOTRDY_REASON_OFFSET + MESSAGE_NOTRDY_REASON_LENGTH) #define MESSAGE_ENVIRON_HASH_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH) #define SS_NOTREADY_TYPE 0 #define SS_READY_TYPE 1 #define SS_UPLOAD_TYPE 2 #define SS_DOWNLOAD_TYPE 3 #define SS_KEEPALIVE_TYPE 4 #define SS_KEEPALIVE_ACK_TYPE 5 #define SS_STATUS_TYPE 6 #define SS_ENVIRONMENT_TYPE 7 static const value_string message_type_values[] = { { SS_NOTREADY_TYPE, "Not Ready" }, { SS_READY_TYPE, "Ready" }, { SS_UPLOAD_TYPE, "Upload" }, { SS_DOWNLOAD_TYPE, "Download" }, { SS_KEEPALIVE_TYPE, "Keep-Alive" }, { SS_KEEPALIVE_ACK_TYPE, "Keep-Alive Ack" }, { SS_STATUS_TYPE, "Status" }, { SS_ENVIRONMENT_TYPE, "Environment" }, { 0, NULL } }; static const value_string notrdy_reason_values[] = { { 0x00000001, "Fully Loaded" }, { 0x00000002, "Out of Resources" }, { 0, NULL } }; #define SSP_ENVIRONMENT_U_BIT 0x01 static const true_false_string environment_u_bit = { "Upload needed", "Upload not needed" }; typedef struct _tap_ssprotocol_rec_t { guint8 type; guint16 size; const char* type_string; } tap_ssprotocol_rec_t; static guint dissect_ssprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *ssprotocol_tree) { proto_item* flags_item; proto_tree* flags_tree; guint16 data_length; guint16 info_length; guint total_length; tap_ssprotocol_rec_t* tap_rec = wmem_new0(pinfo->pool, tap_ssprotocol_rec_t); tap_rec->type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET); tap_rec->size = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET); tap_rec->type_string = val_to_str_const(tap_rec->type, message_type_values, "Unknown SSP message type"); tap_queue_packet(tap_ssprotocol, pinfo, tap_rec); col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", tap_rec->type_string); proto_tree_add_item(ssprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN); flags_item = proto_tree_add_item(ssprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(ssprotocol_tree, hf_message_length, message_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN); total_length = MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH; switch (tap_rec->type) { case SS_KEEPALIVE_ACK_TYPE: case SS_STATUS_TYPE: info_length = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET) - MESSAGE_STATUS_OFFSET; if (info_length == MESSAGE_STATUS_LENGTH) { proto_tree_add_item(ssprotocol_tree, hf_message_status, message_tvb, MESSAGE_STATUS_OFFSET, MESSAGE_STATUS_LENGTH, ENC_BIG_ENDIAN); total_length += MESSAGE_STATUS_LENGTH; } break; case SS_UPLOAD_TYPE: case SS_DOWNLOAD_TYPE: data_length = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET) - MESSAGE_DATA_OFFSET; if (data_length > 0) { proto_tree_add_item(ssprotocol_tree, hf_message_data, message_tvb, MESSAGE_DATA_OFFSET, data_length, ENC_NA); total_length += data_length; } break; case SS_READY_TYPE: info_length = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET) - MESSAGE_RDY_INFO_OFFSET; if (info_length > 0) { proto_tree_add_item(ssprotocol_tree, hf_message_info, message_tvb, MESSAGE_RDY_INFO_OFFSET, info_length, ENC_ASCII); total_length += info_length; } break; case SS_NOTREADY_TYPE: info_length = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET) - MESSAGE_NOTRDY_INFO_OFFSET; if (info_length > 0) { proto_tree_add_item(ssprotocol_tree, hf_message_reason, message_tvb, MESSAGE_NOTRDY_REASON_OFFSET, MESSAGE_NOTRDY_REASON_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(ssprotocol_tree, hf_message_info, message_tvb, MESSAGE_NOTRDY_INFO_OFFSET, info_length, ENC_ASCII); total_length += info_length; } break; case SS_ENVIRONMENT_TYPE: flags_tree = proto_item_add_subtree(flags_item, ett_environment_flags); proto_tree_add_item(flags_tree, hf_environment_u_bit, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(ssprotocol_tree, hf_message_hash, message_tvb, MESSAGE_ENVIRON_HASH_OFFSET, MESSAGE_ENVIRON_HASH_LENGTH, ENC_NA); break; default: break; } return total_length; } static int dissect_ssprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ssprotocol_item; proto_tree *ssprotocol_tree; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSP"); /* create the ssprotocol protocol tree */ ssprotocol_item = proto_tree_add_item(tree, proto_ssprotocol, message_tvb, 0, -1, ENC_NA); ssprotocol_tree = proto_item_add_subtree(ssprotocol_item, ett_ssprotocol); /* dissect the message */ return dissect_ssprotocol_message(message_tvb, pinfo, ssprotocol_tree); } /* TAP STAT INFO */ typedef enum { MESSAGE_TYPE_COLUMN = 0, MESSAGES_COLUMN, MESSAGES_SHARE_COLUMN, BYTES_COLUMN, BYTES_SHARE_COLUMN, FIRST_SEEN_COLUMN, LAST_SEEN_COLUMN, INTERVAL_COLUMN, MESSAGE_RATE_COLUMN, BYTE_RATE_COLUMN } ssprotocol_stat_columns; static stat_tap_table_item ssprotocol_stat_fields[] = { { TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "ScriptingServiceProtocol Message Type", "%-25s" }, { TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Messages ", "%u" }, { TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Messages Share (%)" , "%1.3f %%" }, { TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Bytes (B)", "%u" }, { TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Bytes Share (%) ", "%1.3f %%" }, { TABLE_ITEM_FLOAT, TAP_ALIGN_LEFT, "First Seen (s)", "%1.6f" }, { TABLE_ITEM_FLOAT, TAP_ALIGN_LEFT, "Last Seen (s)", "%1.6f" }, { TABLE_ITEM_FLOAT, TAP_ALIGN_LEFT, "Interval (s)", "%1.6f" }, { TABLE_ITEM_FLOAT, TAP_ALIGN_LEFT, "Message Rate (Msg/s)", "%1.2f" }, { TABLE_ITEM_FLOAT, TAP_ALIGN_LEFT, "Byte Rate (B/s)", "%1.2f" } }; static void ssprotocol_stat_init(stat_tap_table_ui* new_stat) { const char *table_name = "ScriptingServiceProtocol Statistics"; int num_fields = sizeof(ssprotocol_stat_fields)/sizeof(stat_tap_table_item); stat_tap_table *table; int i = 0; stat_tap_table_item_type items[sizeof(ssprotocol_stat_fields)/sizeof(stat_tap_table_item)]; table = stat_tap_find_table(new_stat, table_name); if (table) { if (new_stat->stat_tap_reset_table_cb) { new_stat->stat_tap_reset_table_cb(table); } return; } table = stat_tap_init_table(table_name, num_fields, 0, NULL); stat_tap_add_table(new_stat, table); memset(items, 0x0, sizeof(items)); /* Add a row for each value type */ while (message_type_values[i].strptr) { items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING; items[MESSAGE_TYPE_COLUMN].value.string_value = message_type_values[i].strptr; items[MESSAGES_COLUMN].type = TABLE_ITEM_UINT; items[MESSAGES_COLUMN].value.uint_value = 0; items[MESSAGES_SHARE_COLUMN].type = TABLE_ITEM_NONE; items[MESSAGES_SHARE_COLUMN].value.float_value = -1.0; items[BYTES_COLUMN].type = TABLE_ITEM_UINT; items[BYTES_COLUMN].value.uint_value = 0; items[BYTES_SHARE_COLUMN].type = TABLE_ITEM_NONE; items[BYTES_SHARE_COLUMN].value.float_value = -1.0; items[FIRST_SEEN_COLUMN].type = TABLE_ITEM_NONE; items[FIRST_SEEN_COLUMN].value.float_value = DBL_MAX; items[LAST_SEEN_COLUMN].type = TABLE_ITEM_NONE; items[LAST_SEEN_COLUMN].value.float_value = DBL_MIN; items[INTERVAL_COLUMN].type = TABLE_ITEM_NONE; items[INTERVAL_COLUMN].value.float_value = -1.0; items[MESSAGE_RATE_COLUMN].type = TABLE_ITEM_NONE; items[MESSAGE_RATE_COLUMN].value.float_value = -1.0; items[BYTE_RATE_COLUMN].type = TABLE_ITEM_NONE; items[BYTE_RATE_COLUMN].value.float_value = -1.0; stat_tap_init_table_row(table, i, num_fields, items); i++; } } static tap_packet_status ssprotocol_stat_packet(void* tapdata, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* data, tap_flags_t flags _U_) { stat_data_t* stat_data = (stat_data_t*)tapdata; const tap_ssprotocol_rec_t* tap_rec = (const tap_ssprotocol_rec_t*)data; stat_tap_table* table; stat_tap_table_item_type* msg_data; gint idx; guint64 messages; guint64 bytes; int i = 0; double firstSeen = -1.0; double lastSeen = -1.0; idx = str_to_val_idx(tap_rec->type_string, message_type_values); if (idx < 0) return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0); /* Update packets counter */ ssprotocol_total_msgs++; msg_data = stat_tap_get_field_data(table, idx, MESSAGES_COLUMN); msg_data->value.uint_value++; messages = msg_data->value.uint_value; stat_tap_set_field_data(table, idx, MESSAGES_COLUMN, msg_data); /* Update bytes counter */ ssprotocol_total_bytes += tap_rec->size; msg_data = stat_tap_get_field_data(table, idx, BYTES_COLUMN); msg_data->value.uint_value += tap_rec->size; bytes = msg_data->value.uint_value; stat_tap_set_field_data(table, idx, BYTES_COLUMN, msg_data); /* Update messages and bytes share */ while (message_type_values[i].strptr) { msg_data = stat_tap_get_field_data(table, i, MESSAGES_COLUMN); const guint m = msg_data->value.uint_value; msg_data = stat_tap_get_field_data(table, i, BYTES_COLUMN); const guint b = msg_data->value.uint_value; msg_data = stat_tap_get_field_data(table, i, MESSAGES_SHARE_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = 100.0 * m / (double)ssprotocol_total_msgs; stat_tap_set_field_data(table, i, MESSAGES_SHARE_COLUMN, msg_data); msg_data = stat_tap_get_field_data(table, i, BYTES_SHARE_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = 100.0 * b / (double)ssprotocol_total_bytes; stat_tap_set_field_data(table, i, BYTES_SHARE_COLUMN, msg_data); i++; } /* Update first seen time */ if (pinfo->presence_flags & PINFO_HAS_TS) { msg_data = stat_tap_get_field_data(table, idx, FIRST_SEEN_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = MIN(msg_data->value.float_value, nstime_to_sec(&pinfo->rel_ts)); firstSeen = msg_data->value.float_value; stat_tap_set_field_data(table, idx, FIRST_SEEN_COLUMN, msg_data); } /* Update last seen time */ if (pinfo->presence_flags & PINFO_HAS_TS) { msg_data = stat_tap_get_field_data(table, idx, LAST_SEEN_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = MAX(msg_data->value.float_value, nstime_to_sec(&pinfo->rel_ts)); lastSeen = msg_data->value.float_value; stat_tap_set_field_data(table, idx, LAST_SEEN_COLUMN, msg_data); } if ((lastSeen - firstSeen) > 0.0) { /* Update interval */ msg_data = stat_tap_get_field_data(table, idx, INTERVAL_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = lastSeen - firstSeen; stat_tap_set_field_data(table, idx, INTERVAL_COLUMN, msg_data); /* Update message rate */ msg_data = stat_tap_get_field_data(table, idx, MESSAGE_RATE_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = messages / (lastSeen - firstSeen); stat_tap_set_field_data(table, idx, MESSAGE_RATE_COLUMN, msg_data); /* Update byte rate */ msg_data = stat_tap_get_field_data(table, idx, BYTE_RATE_COLUMN); msg_data->type = TABLE_ITEM_FLOAT; msg_data->value.float_value = bytes / (lastSeen - firstSeen); stat_tap_set_field_data(table, idx, BYTE_RATE_COLUMN, msg_data); } return TAP_PACKET_REDRAW; } static void ssprotocol_stat_reset(stat_tap_table* table) { guint element; stat_tap_table_item_type* item_data; for (element = 0; element < table->num_elements; element++) { item_data = stat_tap_get_field_data(table, element, MESSAGES_COLUMN); item_data->value.uint_value = 0; stat_tap_set_field_data(table, element, MESSAGES_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, MESSAGES_SHARE_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = -1.0; stat_tap_set_field_data(table, element, MESSAGES_SHARE_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, BYTES_COLUMN); item_data->value.uint_value = 0; stat_tap_set_field_data(table, element, BYTES_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, BYTES_SHARE_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = -1.0; stat_tap_set_field_data(table, element, BYTES_SHARE_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, FIRST_SEEN_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = DBL_MAX; stat_tap_set_field_data(table, element, FIRST_SEEN_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, LAST_SEEN_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = DBL_MIN; stat_tap_set_field_data(table, element, LAST_SEEN_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, INTERVAL_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = -1.0; stat_tap_set_field_data(table, element, INTERVAL_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, MESSAGE_RATE_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = -1.0; stat_tap_set_field_data(table, element, MESSAGE_RATE_COLUMN, item_data); item_data = stat_tap_get_field_data(table, element, BYTE_RATE_COLUMN); item_data->type = TABLE_ITEM_NONE; item_data->value.float_value = -1.0; stat_tap_set_field_data(table, element, BYTE_RATE_COLUMN, item_data); } ssprotocol_total_msgs = 0; ssprotocol_total_bytes = 0; } /* Register the protocol */ void proto_register_ssprotocol(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_message_type, { "Type", "ssp.message_type", FT_UINT8, BASE_DEC, VALS(message_type_values), 0x0, NULL, HFILL } }, { &hf_message_flags, { "Flags", "ssp.message_flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_message_length, { "Length", "ssp.message_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_message_status, { "Status", "ssp.message_status", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_message_reason, { "Reason", "ssp.message_reason", FT_UINT32, BASE_DEC, VALS(notrdy_reason_values), 0x0, NULL, HFILL } }, { &hf_message_info, { "Info", "ssp.message_info", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_message_data, { "Data", "ssp.message_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_message_hash, { "Hash", "ssp.message_hash", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_environment_u_bit, { "U-Bit", "ssp.environment_u_bit", FT_BOOLEAN, 8,TFS(&environment_u_bit), SSP_ENVIRONMENT_U_BIT, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_ssprotocol, &ett_environment_flags }; static tap_param ssprotocol_stat_params[] = { { PARAM_FILTER, "filter", "Filter", NULL, TRUE } }; static stat_tap_table_ui ssprotocol_stat_table = { REGISTER_STAT_GROUP_RSERPOOL, "ScriptingServiceProtocol Statistics", "ssprotocol", "ssprotocol,stat", ssprotocol_stat_init, ssprotocol_stat_packet, ssprotocol_stat_reset, NULL, NULL, sizeof(ssprotocol_stat_fields)/sizeof(stat_tap_table_item), ssprotocol_stat_fields, sizeof(ssprotocol_stat_params)/sizeof(tap_param), ssprotocol_stat_params, NULL, 0 }; /* Register the protocol name and description */ proto_ssprotocol = proto_register_protocol("Scripting Service Protocol", "SSP", "ssp"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_ssprotocol, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); tap_ssprotocol = register_tap("ssprotocol"); register_stat_tap_table_ui(&ssprotocol_stat_table); } void proto_reg_handoff_ssprotocol(void) { dissector_handle_t ssprotocol_handle; ssprotocol_handle = create_dissector_handle(dissect_ssprotocol, proto_ssprotocol); dissector_add_uint("sctp.ppi", SSPROTOCOL_PAYLOAD_PROTOCOL_ID_LEGACY, ssprotocol_handle); dissector_add_uint("sctp.ppi", SSP_PAYLOAD_PROTOCOL_ID, ssprotocol_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-scsi-mmc.c
/* packet-scsi-mmc.c * Ronnie Sahlberg 2006 * copied from packet-scsi.c * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/conversation.h> #include "packet-scsi.h" #include "packet-scsi-mmc.h" #include "packet-scsi-sbc.h" void proto_register_scsi_mmc(void); static int proto_scsi_mmc = -1; int hf_scsi_mmc_opcode = -1; static int hf_scsi_mmc_setstreaming_type = -1; static int hf_scsi_mmc_setstreaming_param_len = -1; static int hf_scsi_mmc_setstreaming_wrc = -1; static int hf_scsi_mmc_setstreaming_rdd = -1; static int hf_scsi_mmc_setstreaming_exact = -1; static int hf_scsi_mmc_setstreaming_ra = -1; static int hf_scsi_mmc_setstreaming_start_lba = -1; static int hf_scsi_mmc_setstreaming_end_lba = -1; static int hf_scsi_mmc_setstreaming_read_size = -1; static int hf_scsi_mmc_setstreaming_read_time = -1; static int hf_scsi_mmc_setstreaming_write_size = -1; static int hf_scsi_mmc_setstreaming_write_time = -1; static int hf_scsi_mmc_setcdspeed_rc = -1; static int hf_scsi_mmc_rbc_block = -1; static int hf_scsi_mmc_rbc_lob_blocks = -1; static int hf_scsi_mmc_rbc_alob_blocks = -1; static int hf_scsi_mmc_rbc_lob_bytes = -1; static int hf_scsi_mmc_rbc_alob_bytes = -1; static int hf_scsi_mmc_rti_address_type = -1; static int hf_scsi_mmc_rti_damage = -1; static int hf_scsi_mmc_rti_copy = -1; static int hf_scsi_mmc_rti_track_mode = -1; static int hf_scsi_mmc_rti_rt = -1; static int hf_scsi_mmc_rti_blank = -1; static int hf_scsi_mmc_rti_packet = -1; static int hf_scsi_mmc_rti_fp = -1; static int hf_scsi_mmc_rti_data_mode = -1; static int hf_scsi_mmc_rti_lra_v = -1; static int hf_scsi_mmc_rti_nwa_v = -1; static int hf_scsi_mmc_report_key_type_code = -1; static int hf_scsi_mmc_report_key_vendor_resets = -1; static int hf_scsi_mmc_report_key_user_changes = -1; static int hf_scsi_mmc_report_key_region_mask = -1; static int hf_scsi_mmc_report_key_rpc_scheme = -1; static int hf_scsi_mmc_key_class = -1; static int hf_scsi_mmc_key_format = -1; static int hf_scsi_mmc_disc_info_erasable = -1; static int hf_scsi_mmc_disc_info_state_of_last_session = -1; static int hf_scsi_mmc_disc_info_disk_status = -1; static int hf_scsi_mmc_disc_info_number_of_sessions = -1; static int hf_scsi_mmc_disc_info_first_track_in_last_session = -1; static int hf_scsi_mmc_disc_info_last_track_in_last_session = -1; static int hf_scsi_mmc_disc_info_did_v = -1; static int hf_scsi_mmc_disc_info_dbc_v = -1; static int hf_scsi_mmc_disc_info_uru = -1; static int hf_scsi_mmc_disc_info_dac_v = -1; static int hf_scsi_mmc_disc_info_dbit = -1; static int hf_scsi_mmc_disc_info_bgfs = -1; static int hf_scsi_mmc_disc_info_disc_type = -1; static int hf_scsi_mmc_disc_info_disc_identification = -1; static int hf_scsi_mmc_disc_info_last_session_lead_in_start_address = -1; static int hf_scsi_mmc_disc_info_last_possible_lead_out_start_address = -1; static int hf_scsi_mmc_disc_info_disc_bar_code = -1; static int hf_scsi_mmc_readtoc_time = -1; static int hf_scsi_mmc_readtoc_format = -1; static int hf_scsi_mmc_readtoc_first_session = -1; static int hf_scsi_mmc_readtoc_last_track = -1; static int hf_scsi_mmc_readtoc_last_session = -1; static int hf_scsi_mmc_q_subchannel_adr = -1; static int hf_scsi_mmc_q_subchannel_control = -1; static int hf_scsi_mmc_agid = -1; static int hf_scsi_mmc_track = -1; static int hf_scsi_mmc_track_size = -1; static int hf_scsi_mmc_track_start_address = -1; static int hf_scsi_mmc_track_start_time = -1; static int hf_scsi_mmc_lba = -1; static int hf_scsi_mmc_session = -1; static int hf_scsi_mmc_data_length = -1; static int hf_scsi_mmc_getconf_rt = -1; static int hf_scsi_mmc_getconf_starting_feature = -1; static int hf_scsi_mmc_getconf_current_profile = -1; static int hf_scsi_mmc_feature = -1; static int hf_scsi_mmc_feature_version = -1; static int hf_scsi_mmc_feature_persistent = -1; static int hf_scsi_mmc_feature_current = -1; static int hf_scsi_mmc_feature_additional_length = -1; static int hf_scsi_mmc_feature_lun_sn = -1; static int hf_scsi_mmc_feature_cdread_dap = -1; static int hf_scsi_mmc_feature_cdread_c2flag = -1; static int hf_scsi_mmc_feature_cdread_cdtext = -1; static int hf_scsi_mmc_feature_dvdrw_write = -1; static int hf_scsi_mmc_feature_dvdrw_quickstart = -1; static int hf_scsi_mmc_feature_dvdrw_closeonly = -1; static int hf_scsi_mmc_feature_dvdr_write = -1; static int hf_scsi_mmc_feature_tao_buf = -1; static int hf_scsi_mmc_feature_tao_rwraw = -1; static int hf_scsi_mmc_feature_tao_rwpack = -1; static int hf_scsi_mmc_feature_tao_testwrite = -1; static int hf_scsi_mmc_feature_tao_cdrw = -1; static int hf_scsi_mmc_feature_tao_rwsubcode = -1; static int hf_scsi_mmc_feature_dts = -1; static int hf_scsi_mmc_feature_sao_buf = -1; static int hf_scsi_mmc_feature_sao_sao = -1; static int hf_scsi_mmc_feature_sao_rawms = -1; static int hf_scsi_mmc_feature_sao_raw = -1; static int hf_scsi_mmc_feature_sao_testwrite = -1; static int hf_scsi_mmc_feature_sao_cdrw = -1; static int hf_scsi_mmc_feature_sao_rw = -1; static int hf_scsi_mmc_feature_sao_mcsl = -1; static int hf_scsi_mmc_feature_dvdr_buf = -1; static int hf_scsi_mmc_feature_dvdr_testwrite = -1; static int hf_scsi_mmc_feature_dvdr_dvdrw = -1; static int hf_scsi_mmc_feature_profile = -1; static int hf_scsi_mmc_feature_profile_current = -1; static int hf_scsi_mmc_feature_isw_buf = -1; static int hf_scsi_mmc_feature_isw_num_linksize = -1; static int hf_scsi_mmc_feature_isw_linksize = -1; static int hf_scsi_mmc_read_compatibility_lba = -1; static int hf_scsi_mmc_reservation_size = -1; static int hf_scsi_mmc_last_recorded_address = -1; static int hf_scsi_mmc_first_track = -1; static int hf_scsi_mmc_fixed_packet_size = -1; static int hf_scsi_mmc_closetrack_immed = -1; static int hf_scsi_mmc_closetrack_func = -1; static int hf_scsi_mmc_synccache_immed = -1; static int hf_scsi_mmc_synccache_reladr = -1; static int hf_scsi_mmc_num_blocks = -1; static int hf_scsi_mmc_next_writable_address = -1; static int hf_scsi_mmc_free_blocks = -1; static int hf_scsi_mmc_read_dvd_format = -1; static int hf_scsi_mmc_disc_book_type = -1; static int hf_scsi_mmc_disc_book_version = -1; static int hf_scsi_mmc_disc_size_size = -1; static int hf_scsi_mmc_disc_size_rate = -1; static int hf_scsi_mmc_disc_num_layers = -1; static int hf_scsi_mmc_disc_track_path = -1; static int hf_scsi_mmc_disc_structure_layer = -1; static int hf_scsi_mmc_disc_density_length = -1; static int hf_scsi_mmc_disc_density_pitch = -1; static int hf_scsi_mmc_disc_first_physical = -1; static int hf_scsi_mmc_disc_last_physical = -1; static int hf_scsi_mmc_disc_last_physical_layer0 = -1; static int hf_scsi_mmc_disc_extended_format_info = -1; static int hf_scsi_mmc_disc_application_code = -1; static int hf_scsi_mmc_adip_eib0 = -1; static int hf_scsi_mmc_adip_eib1 = -1; static int hf_scsi_mmc_adip_eib2 = -1; static int hf_scsi_mmc_adip_eib3 = -1; static int hf_scsi_mmc_adip_eib4 = -1; static int hf_scsi_mmc_adip_eib5 = -1; static int hf_scsi_mmc_adip_device_manuf_id = -1; static int hf_scsi_mmc_adip_media_type_id = -1; static int hf_scsi_mmc_adip_product_revision_number = -1; static int hf_scsi_mmc_adip_number_of_physical_info = -1; static int hf_scsi_mmc_gesn_polled = -1; static int hf_scsi_mmc_notification_flags = -1; static int hf_scsi_mmc_gesn_device_busy = -1; static int hf_scsi_mmc_gesn_multi_initiator = -1; static int hf_scsi_mmc_gesn_media = -1; static int hf_scsi_mmc_gesn_external_request = -1; static int hf_scsi_mmc_gesn_power_mgmt = -1; static int hf_scsi_mmc_gesn_operational_change = -1; static int hf_scsi_mmc_prevent_allow_flags = -1; static int hf_scsi_mmc_prevent_allow_persistent = -1; static int hf_scsi_mmc_prevent_allow_prevent = -1; static int hf_scsi_mmc_disk_flags = -1; static int hf_scsi_mmc_format_flags = -1; static int hf_scsi_mmc_track_flags = -1; static int hf_scsi_mmc_data_flags = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_scsi_mmc_getperformance_data_type = -1; static int hf_scsi_mmc_setcdspeed_logical_unit_read_speed = -1; static int hf_scsi_mmc_read_dvd_agid = -1; static int hf_scsi_mmc_read_dvd_layer_number = -1; static int hf_scsi_mmc_getperformance_starting_lba = -1; static int hf_scsi_mmc_getperformance_max_num_descriptors = -1; static int hf_scsi_mmc_getperformance_type = -1; static int hf_scsi_mmc_setcdspeed_logical_unit_write_speed = -1; static int hf_scsi_mmc_read_dvd_address = -1; static gint ett_scsi_mmc_profile = -1; static gint ett_scsi_notifications = -1; static gint ett_scsi_prevent_allow = -1; static gint ett_scsi_disk_flags = -1; static gint ett_scsi_format_flags = -1; static gint ett_scsi_track_flags = -1; static gint ett_scsi_data_flags = -1; /* Generated from convert_proto_tree_add_text.pl */ static expert_field ei_scsi_mmc_unknown_read_dvd_format = EI_INIT; static expert_field ei_scsi_mmc_unknown_setstreaming_type = EI_INIT; static expert_field ei_scsi_mmc_unknown_format_class = EI_INIT; static expert_field ei_scsi_mmc_unknown_read_toc_format = EI_INIT; static expert_field ei_scsi_mmc_unknown_feature_data = EI_INIT; static const true_false_string scsi_gesn_path = { "POLLED operation requested", "ASYNCHRONOUS operation requested" }; static const true_false_string scsi_track_path = { "Opposite Track Path", "Parallel Track Path" }; static const true_false_string scsi_adip_extended_format_info = { "Data zone contains extended format info for VPCS", "Data zone does NOT contain extended format info" }; static const value_string scsi_disk_application_code[] = { {0x0, "General Purpose Use"}, {0,NULL} }; static const value_string scsi_density_length[] = { {0x0, "0.133um"}, {0,NULL} }; static const value_string scsi_density_pitch[] = { {0x0, "0.74um"}, {0x1, "0.80um"}, {0x2, "0.615um"}, {0,NULL} }; static const value_string scsi_disc_structure[] = { {0x0, "Embossed layer"}, {0x2, "Write-once recording layer"}, {0x4, "Rewriteable recording layer"}, {0,NULL} }; static const value_string scsi_num_layers[] = { {0x0, "1 layer"}, {0x1, "2 layers"}, {0x2, "3 layers"}, {0x3, "4 layers"}, {0,NULL} }; static const value_string scsi_disc_size[] = { {0x0, "120mm"}, {0x1, "80mm"}, {0,NULL} }; static const value_string scsi_disc_rate[] = { {0x0, "2.52Mbps"}, {0x1, "5.04Mbps"}, {0x2, "10.08Mbps"}, {0xf, "No maximum transfer rate specified"}, {0,NULL} }; static const value_string scsi_disc_category_type[] = { {0x0, "DVD-ROM"}, {0x1, "DVD-RAM"}, {0x2, "DVD-R"}, {0x3, "DVD-RW"}, {0x9, "DVD+RW"}, {0xa, "DVD+R"}, {0,NULL} }; static const value_string scsi_read_dvd_formats[] = { {0x00, "Physical Information"}, {0x01, "Copyright Information"}, {0x02, "Disk Key obfuscated by a Bus Key"}, {0x03, "Burst Cutting Area information"}, {0x04, "Disk Manufacturing Information"}, {0x05, "copyright Management Information"}, {0x06, "Media Identifier protected by a Bus Key"}, {0x07, "Media Key block protected by a Bus Key"}, {0x08, "DDS information"}, {0x09, "DVD-RAM Medium status"}, {0x0a, "DVD-RAM Spare Area information"}, {0x0b, "DVD-RAM Recording Type information"}, {0x0c, "DVD-R/-RW RMD"}, {0x0d, "Specified RMD"}, {0x0e, "Pre-recorded information"}, {0x0f, "DVD-R/-RW Media Identifier"}, {0x10, "DVD-R/-RW Physical Format Information"}, {0x11, "ADIP information"}, {0x30, "Disc Control Block"}, {0x31, "Read MTA ECC Block"}, {0xc0, "Write Protection Status"}, {0xff, "READ/SEND DVD STRUCTURE capability"}, {0,NULL} }; static value_string_ext scsi_read_dvd_formats_ext = VALUE_STRING_EXT_INIT(scsi_read_dvd_formats); static const value_string scsi_data_mode_vals[] = { {0x01, "Mode 1 (ISO/IEC 10149)"}, {0x02, "Mode 2 (ISO/IEC 10149 or CD-ROM XA) DDCD"}, {0x0f, "Data Block Type unknown (no track descriptor block)"}, {0,NULL} }; static const value_string scsi_getconf_rt_val[] = { {0x00, "Return all features"}, {0x01, "Return all current features"}, {0x02, "Return all identified by Starting Feature"}, {0,NULL} }; static const value_string scsi_getconf_current_profile_val[] = { {0x0000, "Reserved"}, {0x0001, "Non-removable disk"}, {0x0002, "Removable disk"}, {0x0003, "MO Erasable"}, {0x0004, "Optical Write Once"}, {0x0005, "AS-MO"}, {0x0008, "CD-ROM"}, {0x0009, "CD-R"}, {0x000a, "CD-RW"}, {0x0010, "DVD-ROM"}, {0x0011, "DVD-R"}, {0x0012, "DVD-RAM"}, {0x0013, "DVD-RW Restricted Overwrite"}, {0x0014, "DVD-RW Sequential recording"}, {0x001a, "DVD+RW"}, {0x001b, "DVD+R"}, {0x0020, "DDCD-ROM"}, {0x0021, "DDCD-R"}, {0x0022, "DDCD-RW"}, {0xffff, "Logical unit not conforming to a standard profile"}, {0,NULL} }; static value_string_ext scsi_getconf_current_profile_val_ext = VALUE_STRING_EXT_INIT(scsi_getconf_current_profile_val); static const value_string scsi_feature_val[] = { {0x0000, "Profile List"}, {0x0001, "Core"}, {0x0002, "Morphing"}, {0x0003, "Removable Medium"}, {0x0004, "Write Protect"}, {0x0010, "Random Readable"}, {0x001d, "Multi-read"}, {0x001e, "CD Read"}, {0x001f, "DVD Read"}, {0x0020, "Random Writeable"}, {0x0021, "Incremental Streaming Writeable"}, {0x0022, "Sector Erasable"}, {0x0023, "Formattable"}, {0x0024, "Defect Management"}, {0x0025, "Write Once"}, {0x0026, "Restricted Overwrite"}, {0x0027, "CD-RW CAV Write"}, {0x0028, "MRW"}, {0x0029, "Enhanced Defect Reporting"}, {0x002a, "DVD+RW"}, {0x002b, "DVD+R"}, {0x002c, "Rigid Restricted Overwrite"}, {0x002d, "CD Track At Once"}, {0x002e, "CD Mastering"}, {0x002f, "DVD-R/-RW Write"}, {0x0030, "DDCD Read"}, {0x0031, "DDCD-R Write"}, {0x0032, "DDCD-RW Write"}, {0x0037, "CD-RW Media Write Support"}, {0x0100, "Power Management"}, {0x0101, "SMART"}, {0x0102, "Embedded Changer"}, {0x0103, "CD Audio analog play"}, {0x0104, "Microcode Upgrade"}, {0x0105, "Timeout"}, {0x0106, "DVD-CSS"}, {0x0107, "Real Time Streaming"}, {0x0108, "Logical Unit serial number"}, {0x010a, "Disc control Block"}, {0x010b, "DVD CPRM"}, {0x010c, "Firmware Information"}, {0,NULL} }; static value_string_ext scsi_feature_val_ext = VALUE_STRING_EXT_INIT(scsi_feature_val); static void dissect_mmc4_getconfiguration (tvbuff_t *tvb_a, packet_info *pinfo, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { gint32 len; guint old_offset; if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_mmc_getconf_rt, tvb_a, offset_a+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_getconf_starting_feature, tvb_a, offset_a+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_alloclen16, tvb_a, offset_a+6, 2, ENC_BIG_ENDIAN); /* we need the alloc_len in the response */ if(cdata){ cdata->itlq->alloc_len=tvb_get_ntohs(tvb_a, offset_a+6); } proto_tree_add_bitmask(tree, tvb_a, offset_a+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if(!isreq) { if(!cdata){ return; } TRY_SCSI_CDB_ALLOC_LEN(cdata->itlq->alloc_len); /* (defines/initializes try_tvb & try_offset) */ len=tvb_get_ntohl(try_tvb, try_offset+0); proto_tree_add_item (tree, hf_scsi_mmc_data_length, try_tvb, try_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_getconf_current_profile, try_tvb, try_offset+6, 2, ENC_BIG_ENDIAN); try_offset+=8; len-=4; while(len>0){ guint16 feature; guint8 additional_length; guint8 num_linksize; feature=tvb_get_ntohs(try_tvb, try_offset); proto_tree_add_item (tree, hf_scsi_mmc_feature, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); try_offset+=2; proto_tree_add_item (tree, hf_scsi_mmc_feature_version, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_persistent, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_current, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; additional_length=tvb_get_guint8(try_tvb, try_offset); proto_tree_add_item (tree, hf_scsi_mmc_feature_additional_length, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; old_offset=try_offset; switch(feature){ case 0x0000: /* profile list */ while(try_offset<(old_offset+additional_length)){ proto_item *it; proto_tree *tr; guint16 profile; guint8 cur_profile; tr=proto_tree_add_subtree(tree, try_tvb, try_offset, 4, ett_scsi_mmc_profile, &it, "Profile:"); profile=tvb_get_ntohs(try_tvb, try_offset); proto_tree_add_item (tr, hf_scsi_mmc_feature_profile, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(it, "%s", val_to_str_ext(profile, &scsi_getconf_current_profile_val_ext, "Unknown 0x%04x")); cur_profile=tvb_get_guint8(try_tvb, try_offset+2); proto_tree_add_item (tr, hf_scsi_mmc_feature_profile_current, try_tvb, try_offset+2, 1, ENC_BIG_ENDIAN); if(cur_profile&0x01){ proto_item_append_text(it, " [CURRENT PROFILE]"); } try_offset+=4; } break; case 0x001d: /* multi-read */ case 0x001f: /* dvd read feature */ /* no data for this one */ break; case 0x001e: /* cd read */ proto_tree_add_item (tree, hf_scsi_mmc_feature_cdread_dap, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_cdread_c2flag, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_cdread_cdtext, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); break; case 0x0021: /* incremental streaming writeable */ proto_tree_add_item (tree, hf_scsi_mmc_feature_dts, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); try_offset+=2; proto_tree_add_item (tree, hf_scsi_mmc_feature_isw_buf, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; num_linksize=tvb_get_guint8(try_tvb, try_offset); proto_tree_add_item (tree, hf_scsi_mmc_feature_isw_num_linksize, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; while(num_linksize--){ proto_tree_add_item (tree, hf_scsi_mmc_feature_isw_linksize, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; } break; case 0x002a: /* dvd-rw */ proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdrw_write, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdrw_quickstart, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdrw_closeonly, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); break; case 0x002b: /* dvd-r */ proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_write, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); break; case 0x002d: /* track at once */ proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_buf, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_rwraw, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_rwpack, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_testwrite, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_cdrw, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_rwsubcode, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_dts, try_tvb, try_offset+2, 2, ENC_BIG_ENDIAN); break; case 0x002e: /* session at once */ proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_buf, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_sao, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_rawms, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_raw, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_testwrite, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_cdrw, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_rw, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_mcsl, try_tvb, try_offset+1, 3, ENC_BIG_ENDIAN); break; case 0x002f: /* dvd-r/-rw*/ proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_buf, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_testwrite, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_dvdrw, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); break; case 0x0108: /* logical unit serial number */ proto_tree_add_item (tree, hf_scsi_mmc_feature_lun_sn, try_tvb, try_offset, additional_length, ENC_ASCII); break; default: proto_tree_add_expert(tree, pinfo, &ei_scsi_mmc_unknown_feature_data, try_tvb, try_offset, additional_length); break; } try_offset=old_offset+additional_length; len-=4+additional_length; } END_TRY_SCSI_CDB_ALLOC_LEN; } } static const value_string scsi_q_subchannel_adr_val[] = { {0x0, "Q-Subchannel mode info not supplied"}, {0x1, "Q-Subchannel encodes current position data"}, {0x2, "Q-Subchannel encodes media catalog number"}, {0x3, "Q-Subchannel encodes ISRC"}, {0,NULL} }; static const value_string scsi_q_subchannel_control_val[] = { {0x0, "2 Audio channels without pre-emphasis (digital copy prohibited)"}, {0x1, "2 Audio channels with pre-emphasis of 50/15us (digital copy prohibited)"}, {0x2, "2 Audio channels without pre-emphasis (digital copy permitted)"}, {0x3, "2 Audio channels with pre-emphasis of 50/15us (digital copy permitted)"}, {0x4, "Data track, recorded uninterrupted (digital copy prohibited)"}, {0x5, "Data track, recorded incremental (digital copy prohibited)"}, {0x6, "Data track, recorded uninterrupted (digital copy permitted)"}, {0x7, "Data track, recorded incremental (digital copy permitted)"}, {0x8, "audio channels without pre-emphasis (digital copy prohibited)"}, {0x9, "2 Audio channels with pre-emphasis of 50/15us (digital copy prohibited)"}, {0xa, "audio channels without pre-emphasis (digital copy permitted)"}, {0xb, "2 Audio channels with pre-emphasis of 50/15us (digital copy permitted)"}, {0,NULL} }; static value_string_ext scsi_q_subchannel_control_val_ext = VALUE_STRING_EXT_INIT(scsi_q_subchannel_control_val); static void dissect_mmc4_readtocpmaatip (tvbuff_t *tvb_a, packet_info *pinfo, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { guint8 format; gint16 len; if (isreq && iscdb) { format=tvb_get_guint8(tvb_a, offset_a+1)&0x0f; /* save format so we can decode the response */ cdata->itlq->flags=format; switch(format){ case 0x00: case 0x01: proto_tree_add_item (tree, hf_scsi_mmc_readtoc_time, tvb_a, offset_a, 1, ENC_BIG_ENDIAN); /* save time so we can pick it up in the response */ if(tvb_get_guint8(tvb_a, offset_a)&0x02){ cdata->itlq->flags|=0x0100; } break; } proto_tree_add_item (tree, hf_scsi_mmc_readtoc_format, tvb_a, offset_a+1, 1, ENC_BIG_ENDIAN); switch(format){ case 0x00: proto_tree_add_item (tree, hf_scsi_mmc_track, tvb_a, offset_a+5, 1, ENC_BIG_ENDIAN); /* save track so we can pick it up in the response */ cdata->itlq->flags|=0x0200; break; case 0x02: proto_tree_add_item (tree, hf_scsi_mmc_session, tvb_a, offset_a+5, 1, ENC_BIG_ENDIAN); /* save session so we can pick it up in the response */ cdata->itlq->flags|=0x0400; break; } proto_tree_add_item (tree, hf_scsi_alloclen16, tvb_a, offset_a + 6, 2, ENC_BIG_ENDIAN); cdata->itlq->alloc_len = tvb_get_ntohs(tvb_a, offset_a + 6); proto_tree_add_bitmask(tree, tvb_a, offset_a+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if(!isreq) { TRY_SCSI_CDB_ALLOC_LEN(cdata->itlq->alloc_len); /* (defines/initializes try_tvb & try_offset) */ len=tvb_get_ntohs(try_tvb, try_offset); proto_tree_add_item (tree, hf_scsi_mmc_data_length, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); if(cdata->itlq->flags&0x0200){ proto_tree_add_item (tree, hf_scsi_mmc_first_track, try_tvb, try_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_readtoc_last_track, try_tvb, try_offset+3, 1, ENC_BIG_ENDIAN); } if(cdata->itlq->flags&0x0400){ proto_tree_add_item (tree, hf_scsi_mmc_readtoc_first_session, try_tvb, try_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_readtoc_last_session, try_tvb, try_offset+3, 1, ENC_BIG_ENDIAN); } try_offset+=4; len-=2; switch(cdata->itlq->flags&0x000f){ case 0x0: while(len>0){ proto_tree_add_item (tree, hf_scsi_mmc_q_subchannel_adr, try_tvb, try_offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_q_subchannel_control, try_tvb, try_offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_track, try_tvb, try_offset+2, 1, ENC_BIG_ENDIAN); if(cdata->itlq->flags&0x0100){ proto_tree_add_item (tree, hf_scsi_mmc_track_start_time, try_tvb, try_offset+4, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_item (tree, hf_scsi_mmc_track_start_address, try_tvb, try_offset+4, 4, ENC_BIG_ENDIAN); } try_offset+=8; len-=8; } break; default: proto_tree_add_expert_format(tree, pinfo, &ei_scsi_mmc_unknown_read_toc_format, try_tvb, try_offset, len, "SCSI/MMC Unknown READ TOC Format:0x%04x", cdata->itlq->flags&0x000f); break; } END_TRY_SCSI_CDB_ALLOC_LEN; } } static const value_string scsi_disc_info_sols_val[] = { {0x00, "Empty Session"}, {0x01, "Incomplete Session"}, {0x02, "Reserved/Damaged Session"}, {0x03, "Complete Session"}, {0,NULL} }; static const value_string scsi_disc_info_disc_status_val[] = { {0x00, "Empty Disc"}, {0x01, "Incomplete Disc"}, {0x02, "Finalized Disc"}, {0x03, "Others"}, {0,NULL} }; static const value_string scsi_disc_info_bgfs_val[] = { {0x00, "Blank or not CD-RW/DVD-RW"}, {0x01, "Background Format started but is not running nor complete"}, {0x02, "Background Format in progress"}, {0x03, "Background Format has completed"}, {0,NULL} }; static const value_string scsi_disc_info_disc_type_val[] = { {0x00, "CD-DA or CD-ROM Disc"}, {0x10, "CD-I Disc"}, {0x20, "CD-ROM XA Disc or DDCD"}, {0xff, "Undefined"}, {0,NULL} }; static void dissect_mmc4_readdiscinformation (tvbuff_t *tvb_a, packet_info *pinfo _U_, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { if (iscdb) { proto_tree_add_item (tree, hf_scsi_alloclen16, tvb_a, offset_a + 6, 2, ENC_BIG_ENDIAN); if (cdata && cdata->itlq) { cdata->itlq->alloc_len = tvb_get_ntohs(tvb_a, offset_a + 6); } proto_tree_add_bitmask(tree, tvb_a, offset_a+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if (!isreq) { static int * const disk_fields[] = { &hf_scsi_mmc_disc_info_erasable, &hf_scsi_mmc_disc_info_state_of_last_session, &hf_scsi_mmc_disc_info_disk_status, NULL }; static int * const format_fields[] = { &hf_scsi_mmc_disc_info_did_v, &hf_scsi_mmc_disc_info_dbc_v, &hf_scsi_mmc_disc_info_uru, &hf_scsi_mmc_disc_info_dac_v, &hf_scsi_mmc_disc_info_dbit, &hf_scsi_mmc_disc_info_bgfs, NULL }; TRY_SCSI_CDB_ALLOC_LEN( (cdata && cdata->itlq) ? cdata->itlq->alloc_len : 0); /* (defines/initializes try_tvb & try_offset) */ proto_tree_add_item (tree, hf_scsi_mmc_data_length, try_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, try_tvb, try_offset + 2, hf_scsi_mmc_disk_flags, ett_scsi_disk_flags, disk_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_first_track, try_tvb, try_offset+3, 1, ENC_BIG_ENDIAN); /* number of session try_offset+4 and try_offset+9 */ proto_tree_add_uint (tree, hf_scsi_mmc_disc_info_number_of_sessions, try_tvb, 4, 1, (tvb_get_guint8(try_tvb, try_offset+9)<<8)|tvb_get_guint8(try_tvb, try_offset+4)); /* first track in last session try_offset+5 and try_offset+10 */ proto_tree_add_uint (tree, hf_scsi_mmc_disc_info_first_track_in_last_session, try_tvb, 5, 1, (tvb_get_guint8(try_tvb, try_offset+10)<<8)|tvb_get_guint8(try_tvb, try_offset+5)); /* last track in last session try_offset+6 and try_offset+11 */ proto_tree_add_uint (tree, hf_scsi_mmc_disc_info_last_track_in_last_session, try_tvb, 6, 1, (tvb_get_guint8(try_tvb, try_offset+11)<<8)|tvb_get_guint8(try_tvb, try_offset+6)); proto_tree_add_bitmask(tree, try_tvb, try_offset + 7, hf_scsi_mmc_format_flags, ett_scsi_format_flags, format_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disc_type, try_tvb, try_offset+8, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disc_identification, try_tvb, try_offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_info_last_session_lead_in_start_address, try_tvb, try_offset+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_info_last_possible_lead_out_start_address, try_tvb, try_offset+20, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disc_bar_code, try_tvb, try_offset+24, 8, ENC_BIG_ENDIAN); /* XXX should add OPC table decoding here ... */ END_TRY_SCSI_CDB_ALLOC_LEN; } } static void dissect_mmc4_readdiscstructure (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { if (tree && isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_mmc_read_dvd_address, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_read_dvd_layer_number, tvb, offset+5, 1, ENC_BIG_ENDIAN); cdata->itlq->flags=tvb_get_guint8 (tvb, offset+6); proto_tree_add_uint (tree, hf_scsi_mmc_read_dvd_format, tvb, offset+6, 1, cdata->itlq->flags); proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_read_dvd_agid, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if(tree && (!isreq)) { proto_item *ti; ti = proto_tree_add_uint (tree, hf_scsi_mmc_read_dvd_format, tvb, 0, 0, cdata->itlq->flags); proto_item_set_generated(ti); proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 4; switch(cdata->itlq->flags) { case 0x00: /* Physical Format information */ case 0x11: /* ADIP Information */ /* disc category */ proto_tree_add_item (tree, hf_scsi_mmc_disc_book_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_book_version, tvb, offset, 1, ENC_BIG_ENDIAN); /* disc size */ proto_tree_add_item (tree, hf_scsi_mmc_disc_size_size, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_size_rate, tvb, offset+1, 1, ENC_BIG_ENDIAN); /* number of layers */ proto_tree_add_item (tree, hf_scsi_mmc_disc_num_layers, tvb, offset+2, 1, ENC_BIG_ENDIAN); /* track path */ proto_tree_add_item (tree, hf_scsi_mmc_disc_track_path, tvb, offset+2, 1, ENC_BIG_ENDIAN); /* disc structure */ proto_tree_add_item (tree, hf_scsi_mmc_disc_structure_layer, tvb, offset+2, 1, ENC_BIG_ENDIAN); /* recording density */ proto_tree_add_item (tree, hf_scsi_mmc_disc_density_length, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_disc_density_pitch, tvb, offset+3, 1, ENC_BIG_ENDIAN); /* first physical sector of data zone */ proto_tree_add_item (tree, hf_scsi_mmc_disc_first_physical, tvb, offset+5, 3, ENC_BIG_ENDIAN); /* last physical sector of data zone */ proto_tree_add_item (tree, hf_scsi_mmc_disc_last_physical, tvb, offset+9, 3, ENC_BIG_ENDIAN); if (cdata->itlq->flags == 0x00) { /* last physical sector of layer 0 */ proto_tree_add_item (tree, hf_scsi_mmc_disc_last_physical_layer0, tvb, offset+13, 3, ENC_BIG_ENDIAN); } /* extended format info */ proto_tree_add_item (tree, hf_scsi_mmc_disc_extended_format_info, tvb, offset+16, 1, ENC_BIG_ENDIAN); /* disk application code */ proto_tree_add_item (tree, hf_scsi_mmc_disc_application_code, tvb, offset+17, 1, ENC_BIG_ENDIAN); /* extended information blocks */ proto_tree_add_item (tree, hf_scsi_mmc_adip_eib5, tvb, offset+18, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_adip_eib4, tvb, offset+18, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_adip_eib3, tvb, offset+18, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_adip_eib2, tvb, offset+18, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_adip_eib1, tvb, offset+18, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_adip_eib0, tvb, offset+18, 1, ENC_BIG_ENDIAN); /* disk manufacturer id */ proto_tree_add_item (tree, hf_scsi_mmc_adip_device_manuf_id, tvb, offset+19, 8, ENC_ASCII); /* media type id */ proto_tree_add_item (tree, hf_scsi_mmc_adip_media_type_id, tvb, offset+27, 3, ENC_ASCII); /* product revision number */ proto_tree_add_item (tree, hf_scsi_mmc_adip_product_revision_number, tvb, offset+30, 1, ENC_BIG_ENDIAN); /* number of bytes of physical info */ proto_tree_add_item (tree, hf_scsi_mmc_adip_number_of_physical_info, tvb, offset+31, 1, ENC_BIG_ENDIAN); break; default: proto_tree_add_expert_format(tree, pinfo, &ei_scsi_mmc_unknown_read_dvd_format, tvb, 0, 0, "SCSI/MMC Unknown Read DVD Format:0x%02x", cdata->itlq->flags); } } } static void dissect_mmc4_getperformance (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (tree && isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_mmc_getperformance_data_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_getperformance_starting_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_getperformance_max_num_descriptors, tvb, offset+7, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_getperformance_type, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_mmc4_synchronizecache (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_mmc_synccache_immed, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_synccache_reladr, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_num_blocks, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static const value_string scsi_key_class_val[] = { {0x00, "DVD CSS/CPPM or CPRM"}, {0x01, "ReWriteable Security Service - A"}, {0,NULL} }; static const value_string scsi_key_format_val[] = { {0x00, "AGID for CSS/CPPM"}, {0x01, "Challenge Key"}, {0x02, "Key 1"}, {0x04, "Title Key"}, {0x05, "Authentication Success Flag"}, {0x08, "RPC State"}, {0x11, "AGID for CPRM"}, {0x3f, "None"}, {0,NULL} }; static const value_string scsi_report_key_type_code_val[] = { {0x00, "NONE"}, {0x01, "SET"}, {0x02, "LAST CHANCE"}, {0x03, "PERM"}, {0,NULL} }; static const value_string scsi_report_key_rpc_scheme_val[] = { {0x00, "Unknown (RPC not enforced)"}, {0x01, "RPC Phase II"}, {0,NULL} }; static void dissect_mmc4_reportkey (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { guint8 agid, key_format, key_class; if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_mmc_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); key_class=tvb_get_guint8(tvb, offset+6); proto_tree_add_item (tree, hf_scsi_mmc_key_class, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+7, 2, ENC_BIG_ENDIAN); agid=tvb_get_guint8(tvb, offset+9)&0xc0; key_format=tvb_get_guint8(tvb, offset+9)&0x3f; switch(key_format){ case 0x01: case 0x02: case 0x04: case 0x3f: /* agid is only valid for some formats */ proto_tree_add_uint (tree, hf_scsi_mmc_agid, tvb, offset+9, 1, agid); break; } proto_tree_add_uint (tree, hf_scsi_mmc_key_format, tvb, offset+9, 1, key_format); /* save key_class/key_format so we can decode the response */ cdata->itlq->flags=(key_format<<8)|key_class; proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if(tree && (!isreq)) { switch(cdata->itlq->flags){ case 0x0800: /* format:RPC State class:00 */ proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_report_key_type_code, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_report_key_vendor_resets, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_report_key_user_changes, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_report_key_region_mask, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_report_key_rpc_scheme, tvb, offset+6, 1, ENC_BIG_ENDIAN); break; default: proto_tree_add_expert_format(tree, pinfo, &ei_scsi_mmc_unknown_format_class, tvb, 0, 0, "SCSI/MMC Unknown Format:0x%02x/Class:0x%02x combination", cdata->itlq->flags>>8,cdata->itlq->flags&0xff); break; } } } static const value_string scsi_rti_address_type_val[] = { {0x00, "Logical Block Address"}, {0x01, "Logical Track Number"}, {0x02, "Session Number"}, {0,NULL} }; static void dissect_mmc4_readtrackinformation (tvbuff_t *tvb_a, packet_info *pinfo _U_, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { guint8 addresstype; if (isreq && iscdb) { addresstype=tvb_get_guint8(tvb_a, offset_a)&0x03; proto_tree_add_item (tree, hf_scsi_mmc_rti_address_type, tvb_a, offset_a+0, 1, ENC_BIG_ENDIAN); switch(addresstype){ case 0x00: /* logical block address */ proto_tree_add_item (tree, hf_scsi_mmc_lba, tvb_a, offset_a+1, 4, ENC_BIG_ENDIAN); break; case 0x01: /* logical track number */ proto_tree_add_item (tree, hf_scsi_mmc_track, tvb_a, offset_a+1, 4, ENC_BIG_ENDIAN); break; case 0x02: /* logical session number */ proto_tree_add_item (tree, hf_scsi_mmc_session, tvb_a, offset_a+1, 4, ENC_BIG_ENDIAN); break; } proto_tree_add_item (tree, hf_scsi_alloclen16, tvb_a, offset_a + 6, 2, ENC_BIG_ENDIAN); if (cdata) { cdata->itlq->alloc_len = tvb_get_ntohs(tvb_a, offset_a + 6); } proto_tree_add_bitmask(tree, tvb_a, offset_a+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if (!isreq) { static int * const track_fields[] = { &hf_scsi_mmc_rti_damage, &hf_scsi_mmc_rti_copy, &hf_scsi_mmc_rti_track_mode, NULL }; static int * const data_fields[] = { &hf_scsi_mmc_rti_rt, &hf_scsi_mmc_rti_blank, &hf_scsi_mmc_rti_packet, &hf_scsi_mmc_rti_fp, &hf_scsi_mmc_rti_data_mode, NULL }; TRY_SCSI_CDB_ALLOC_LEN(cdata->itlq->alloc_len); /* (defines/initializes try_tvb & try_offset) */ proto_tree_add_item (tree, hf_scsi_mmc_data_length, try_tvb, 0, 2, ENC_BIG_ENDIAN); /* track try_offset+2 and try_offset+32, only use the high byte if we have it */ if (tvb_reported_length(try_tvb) < 33) { proto_tree_add_uint (tree, hf_scsi_mmc_track, try_tvb, 2, 1, tvb_get_guint8(try_tvb, try_offset + 2)); } else { proto_tree_add_uint (tree, hf_scsi_mmc_track, try_tvb, 2, 1, (tvb_get_guint8(try_tvb, try_offset + 32) << 8) | tvb_get_guint8(try_tvb, try_offset + 2)); } /* session try_offset+3 and try_offset+33 */ if (tvb_reported_length(try_tvb) < 34) { proto_tree_add_uint (tree, hf_scsi_mmc_session, try_tvb, 3, 1, tvb_get_guint8(try_tvb, try_offset + 3)); } else { proto_tree_add_uint (tree, hf_scsi_mmc_session, try_tvb, 3, 1, (tvb_get_guint8(try_tvb, try_offset + 33) << 8) | tvb_get_guint8(try_tvb, try_offset + 3)); } proto_tree_add_bitmask(tree, try_tvb, try_offset + 5, hf_scsi_mmc_track_flags, ett_scsi_track_flags, track_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, try_tvb, try_offset + 6, hf_scsi_mmc_data_flags, ett_scsi_data_flags, data_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_rti_lra_v, try_tvb, 7, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_rti_nwa_v, try_tvb, 7, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_track_start_address, try_tvb, try_offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_next_writable_address, try_tvb, try_offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_free_blocks, try_tvb, try_offset+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_fixed_packet_size, try_tvb, try_offset+20, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_track_size, try_tvb, try_offset+24, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_last_recorded_address, try_tvb, try_offset+28, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_read_compatibility_lba, try_tvb, try_offset+36, 4, ENC_BIG_ENDIAN); END_TRY_SCSI_CDB_ALLOC_LEN; } } static void dissect_mmc4_geteventstatusnotification (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (tree && isreq && iscdb) { static int * const notification_fields[] = { &hf_scsi_mmc_gesn_device_busy, &hf_scsi_mmc_gesn_multi_initiator, &hf_scsi_mmc_gesn_media, &hf_scsi_mmc_gesn_external_request, &hf_scsi_mmc_gesn_power_mgmt, &hf_scsi_mmc_gesn_operational_change, NULL }; proto_tree_add_item (tree, hf_scsi_mmc_gesn_polled, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset + 3, hf_scsi_mmc_notification_flags, ett_scsi_notifications, notification_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_mmc4_reservetrack (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_mmc_reservation_size, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static const value_string scsi_closetrack_func_val[] = { {0, "Stop background format"}, {1, "Close track"}, {2, "Close last incomplete session"}, {3, "Special case close session"}, {5, "Close last session and finalize disk, special case"}, {6, "Close last session and finalize disk"}, {0, NULL} }; static void dissect_mmc4_close_track (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (tree && isreq && iscdb) { /* immediate */ proto_tree_add_item (tree, hf_scsi_mmc_closetrack_immed, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* close function */ proto_tree_add_item (tree, hf_scsi_mmc_closetrack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* reserved */ offset++; /* track number */ proto_tree_add_item (tree, hf_scsi_mmc_track, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* reserved */ offset+=3; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_mmc4_readbuffercapacity (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { if (tree && isreq && iscdb) { cdata->itlq->flags=0; proto_tree_add_item (tree, hf_scsi_mmc_rbc_block, tvb, offset, 1, ENC_BIG_ENDIAN); if(tvb_get_guint8(tvb, offset)&0x01){ cdata->itlq->flags=1; } proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if(tree && (!isreq)) { proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, offset, 2, ENC_BIG_ENDIAN); if(cdata->itlq->flags){ proto_tree_add_item (tree, hf_scsi_mmc_rbc_lob_blocks, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_rbc_alob_blocks, tvb, offset+8, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_item (tree, hf_scsi_mmc_rbc_lob_bytes, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_rbc_alob_bytes, tvb, offset+8, 4, ENC_BIG_ENDIAN); } } } static const value_string scsi_setcdspeed_rc_val[] = { {0x00, "CLV and none-pure CAV"}, {0x01, "Pure CAV"}, {0x02, "Reserved"}, {0x03, "Reserved"}, {0,NULL} }; static void dissect_mmc4_setcdspeed (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_mmc_setcdspeed_rc, tvb, offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_setcdspeed_logical_unit_read_speed, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc_setcdspeed_logical_unit_write_speed, tvb, offset+3, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static const value_string scsi_setstreaming_type_val[] = { {0x00, "Performance Descriptor"}, {0x05, "DBI cache zone descriptor"}, {0,NULL} }; static void dissect_mmc4_setstreaming (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { guint8 type; if (tree && isreq && iscdb) { type=tvb_get_guint8(tvb, offset+7); cdata->itlq->flags=type; proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_type, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_param_len, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } if(tree && isreq && (!iscdb)) { switch(cdata->itlq->flags){ case 0x00: /* performance descriptor */ proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_wrc, tvb, offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_rdd, tvb, offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_exact, tvb, offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_ra, tvb, offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_start_lba, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_end_lba, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_read_size, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_read_time, tvb, offset+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_write_size, tvb, offset+20, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_write_time, tvb, offset+24, 4, ENC_BIG_ENDIAN); break; default: proto_tree_add_expert_format(tree, pinfo, &ei_scsi_mmc_unknown_setstreaming_type, tvb, 0, 0, "SCSI/MMC Unknown SetStreaming Type:0x%02x",cdata->itlq->flags); break; } } } static void dissect_mmc_preventallowmediaremoval(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (isreq && iscdb) { guint8 flags; static int * const prevent_allow_fields[] = { &hf_scsi_mmc_prevent_allow_persistent, &hf_scsi_mmc_prevent_allow_prevent, NULL }; proto_tree_add_bitmask(tree, tvb, offset + 3, hf_scsi_mmc_prevent_allow_flags, ett_scsi_prevent_allow, prevent_allow_fields, ENC_BIG_ENDIAN); flags = tvb_get_guint8(tvb, offset + 3); if (flags & 0x01) { col_append_str(pinfo->cinfo, COL_INFO, " PREVENT"); } else { col_append_str(pinfo->cinfo, COL_INFO, " ALLOW"); } if (flags & 0x02) { col_append_str(pinfo->cinfo, COL_INFO, " (PERSISTENT)"); } proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } /* MMC Commands */ #define SCSI_MMC4_READCAPACITY10 0x25 #define SCSI_MMC4_READ10 0x28 #define SCSI_MMC4_WRITE10 0x2a #define SCSI_MMC4_SYNCHRONIZECACHE 0x35 #define SCSI_MMC4_READTOCPMAATIP 0x43 #define SCSI_MMC4_GETCONFIGURATION 0x46 #define SCSI_MMC4_GETEVENTSTATUSNOTIFY 0x4a #define SCSI_MMC4_READDISCINFORMATION 0x51 #define SCSI_MMC4_READTRACKINFORMATION 0x52 #define SCSI_MMC4_RESERVETRACK 0x53 #define SCSI_MMC4_CLOSETRACK 0x5b #define SCSI_MMC4_READBUFFERCAPACITY 0x5c #define SCSI_MMC4_REPORTKEY 0xa4 #define SCSI_MMC4_READ12 0xa8 #define SCSI_MMC4_WRITE12 0xaa #define SCSI_MMC4_GETPERFORMANCE 0xac #define SCSI_MMC4_READDISCSTRUCTURE 0xad #define SCSI_MMC4_SETSTREAMING 0xb6 #define SCSI_MMC4_SETCDSPEED 0xbb static const value_string scsi_mmc_vals[] = { /* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"}, /* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"}, /* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"}, /* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"}, /* 0x1B */ {SCSI_SBC_STARTSTOPUNIT , "Start Stop Unit"}, /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"}, /* 0x25 */ {SCSI_MMC4_READCAPACITY10 , "Read Capacity(10)"}, /* 0x28 */ {SCSI_MMC4_READ10 , "Read(10)"}, /* 0x2a */ {SCSI_MMC4_WRITE10 , "Write(10)"}, /* 0x35 */ {SCSI_MMC4_SYNCHRONIZECACHE , "Synchronize Cache"}, /* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"}, /* 0x43 */ {SCSI_MMC4_READTOCPMAATIP , "Read TOC/PMA/ATIP"}, /* 0x46 */ {SCSI_MMC4_GETCONFIGURATION , "Get Configuration"}, /* 0x4a */ {SCSI_MMC4_GETEVENTSTATUSNOTIFY , "Get Event Status Notification"}, /* 0x51 */ {SCSI_MMC4_READDISCINFORMATION , "Read Disc Information"}, /* 0x52 */ {SCSI_MMC4_READTRACKINFORMATION , "Read Track Information"}, /* 0x53 */ {SCSI_MMC4_RESERVETRACK , "Reserve Track"}, /* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"}, /* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"}, /* 0x5b */ {SCSI_MMC4_CLOSETRACK , "Close Track"}, /* 0x5c */ {SCSI_MMC4_READBUFFERCAPACITY , "Read Buffer Capacity"}, /* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"}, /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"}, /* 0xa4 */ {SCSI_MMC4_REPORTKEY , "Report Key"}, /* 0xa8 */ {SCSI_MMC4_READ12 , "Read(12)"}, /* 0xaa */ {SCSI_MMC4_WRITE12 , "Write(12)"}, /* 0xac */ {SCSI_MMC4_GETPERFORMANCE , "Get Performance"}, /* 0xad */ {SCSI_MMC4_READDISCSTRUCTURE , "Read DISC Structure"}, /* 0xb6 */ {SCSI_MMC4_SETSTREAMING , "Set Streaming"}, /* 0xbb */ {SCSI_MMC4_SETCDSPEED , "Set CD Speed"}, {0, NULL}, }; value_string_ext scsi_mmc_vals_ext = VALUE_STRING_EXT_INIT(scsi_mmc_vals); static const value_string scsi_track_mode_vals[] = { {0x00 , "2 audio channels without pre-emphasis, digital copy prohibited"}, {0x01 , "2 audio channels with pre-emphasis of 50/15 us, digital copy prohibited"}, {0x02 , "2 audio channels without pre-emphasis, digital copy permitted"}, {0x03 , "2 audio channels with pre-emphasis of 50/15 us, digital copy permitted"}, {0x04 , "Data track, recorded uninterrupted, digital copy prohibited"}, {0x05 , "Data track, recorded incremental, digital copy prohibited"}, {0x06 , "Data track, recorded uninterrupted, digital copy permitted"}, {0x07 , "Data track, recorded incremental, digital copy permitted"}, {0x08 , "audio channels without pre-emphasis, digital copy prohibited"}, {0x09 , "audio channels with pre-emphasis of 50/15 us"}, {0x0a , "audio channels without pre-emphasis, digital copy permitted"}, {0x0b , "audio channels with pre-emphasis of 50/15 us, digital copy permitted"}, {0, NULL}, }; static value_string_ext scsi_track_mode_vals_ext = VALUE_STRING_EXT_INIT(scsi_track_mode_vals); scsi_cdb_table_t scsi_mmc_table[256] = { /*SPC 0x00*/{dissect_spc_testunitready}, /*MMC 0x01*/{NULL}, /*MMC 0x02*/{NULL}, /*SPC 0x03*/{dissect_spc_requestsense}, /*MMC 0x04*/{NULL}, /*MMC 0x05*/{NULL}, /*MMC 0x06*/{NULL}, /*MMC 0x07*/{NULL}, /*MMC 0x08*/{NULL}, /*MMC 0x09*/{NULL}, /*MMC 0x0a*/{NULL}, /*MMC 0x0b*/{NULL}, /*MMC 0x0c*/{NULL}, /*MMC 0x0d*/{NULL}, /*MMC 0x0e*/{NULL}, /*MMC 0x0f*/{NULL}, /*MMC 0x10*/{NULL}, /*MMC 0x11*/{NULL}, /*SPC 0x12*/{dissect_spc_inquiry}, /*MMC 0x13*/{NULL}, /*MMC 0x14*/{NULL}, /*MMC 0x15*/{NULL}, /*MMC 0x16*/{NULL}, /*MMC 0x17*/{NULL}, /*MMC 0x18*/{NULL}, /*MMC 0x19*/{NULL}, /*MMC 0x1a*/{NULL}, /*MMC 0x1b*/{dissect_sbc_startstopunit}, /*MMC 0x1c*/{NULL}, /*MMC 0x1d*/{NULL}, /*MMC 0x1e*/{dissect_mmc_preventallowmediaremoval}, /*MMC 0x1f*/{NULL}, /*MMC 0x20*/{NULL}, /*MMC 0x21*/{NULL}, /*MMC 0x22*/{NULL}, /*MMC 0x23*/{NULL}, /*MMC 0x24*/{NULL}, /*MMC 0x25*/{dissect_sbc_readcapacity10}, /*MMC 0x26*/{NULL}, /*MMC 0x27*/{NULL}, /*MMC 0x28*/{dissect_sbc_read10}, /*MMC 0x29*/{NULL}, /*MMC 0x2a*/{dissect_sbc_write10}, /*MMC 0x2b*/{NULL}, /*MMC 0x2c*/{NULL}, /*MMC 0x2d*/{NULL}, /*MMC 0x2e*/{NULL}, /*MMC 0x2f*/{NULL}, /*MMC 0x30*/{NULL}, /*MMC 0x31*/{NULL}, /*MMC 0x32*/{NULL}, /*MMC 0x33*/{NULL}, /*MMC 0x34*/{NULL}, /*MMC 0x35*/{dissect_mmc4_synchronizecache}, /*MMC 0x36*/{NULL}, /*MMC 0x37*/{NULL}, /*MMC 0x38*/{NULL}, /*MMC 0x39*/{NULL}, /*MMC 0x3a*/{NULL}, /*SPC 0x3b*/{dissect_spc_writebuffer}, /*MMC 0x3c*/{NULL}, /*MMC 0x3d*/{NULL}, /*MMC 0x3e*/{NULL}, /*MMC 0x3f*/{NULL}, /*MMC 0x40*/{NULL}, /*MMC 0x41*/{NULL}, /*MMC 0x42*/{NULL}, /*MMC 0x43*/{dissect_mmc4_readtocpmaatip}, /*MMC 0x44*/{NULL}, /*MMC 0x45*/{NULL}, /*MMC 0x46*/{dissect_mmc4_getconfiguration}, /*MMC 0x47*/{NULL}, /*MMC 0x48*/{NULL}, /*MMC 0x49*/{NULL}, /*MMC 0x4a*/{dissect_mmc4_geteventstatusnotification}, /*MMC 0x4b*/{NULL}, /*MMC 0x4c*/{NULL}, /*MMC 0x4d*/{NULL}, /*MMC 0x4e*/{NULL}, /*MMC 0x4f*/{NULL}, /*MMC 0x50*/{NULL}, /*MMC 0x51*/{dissect_mmc4_readdiscinformation}, /*MMC 0x52*/{dissect_mmc4_readtrackinformation}, /*MMC 0x53*/{dissect_mmc4_reservetrack}, /*MMC 0x54*/{NULL}, /*SPC 0x55*/{dissect_spc_modeselect10}, /*MMC 0x56*/{NULL}, /*MMC 0x57*/{NULL}, /*MMC 0x58*/{NULL}, /*MMC 0x59*/{NULL}, /*SPC 0x5a*/{dissect_spc_modesense10}, /*MMC 0x5b*/{dissect_mmc4_close_track}, /*MMC 0x5c*/{dissect_mmc4_readbuffercapacity}, /*MMC 0x5d*/{NULL}, /*MMC 0x5e*/{NULL}, /*MMC 0x5f*/{NULL}, /*MMC 0x60*/{NULL}, /*MMC 0x61*/{NULL}, /*MMC 0x62*/{NULL}, /*MMC 0x63*/{NULL}, /*MMC 0x64*/{NULL}, /*MMC 0x65*/{NULL}, /*MMC 0x66*/{NULL}, /*MMC 0x67*/{NULL}, /*MMC 0x68*/{NULL}, /*MMC 0x69*/{NULL}, /*MMC 0x6a*/{NULL}, /*MMC 0x6b*/{NULL}, /*MMC 0x6c*/{NULL}, /*MMC 0x6d*/{NULL}, /*MMC 0x6e*/{NULL}, /*MMC 0x6f*/{NULL}, /*MMC 0x70*/{NULL}, /*MMC 0x71*/{NULL}, /*MMC 0x72*/{NULL}, /*MMC 0x73*/{NULL}, /*MMC 0x74*/{NULL}, /*MMC 0x75*/{NULL}, /*MMC 0x76*/{NULL}, /*MMC 0x77*/{NULL}, /*MMC 0x78*/{NULL}, /*MMC 0x79*/{NULL}, /*MMC 0x7a*/{NULL}, /*MMC 0x7b*/{NULL}, /*MMC 0x7c*/{NULL}, /*MMC 0x7d*/{NULL}, /*MMC 0x7e*/{NULL}, /*MMC 0x7f*/{NULL}, /*MMC 0x80*/{NULL}, /*MMC 0x81*/{NULL}, /*MMC 0x82*/{NULL}, /*MMC 0x83*/{NULL}, /*MMC 0x84*/{NULL}, /*MMC 0x85*/{NULL}, /*MMC 0x86*/{NULL}, /*MMC 0x87*/{NULL}, /*MMC 0x88*/{NULL}, /*MMC 0x89*/{NULL}, /*MMC 0x8a*/{NULL}, /*MMC 0x8b*/{NULL}, /*MMC 0x8c*/{NULL}, /*MMC 0x8d*/{NULL}, /*MMC 0x8e*/{NULL}, /*MMC 0x8f*/{NULL}, /*MMC 0x90*/{NULL}, /*MMC 0x91*/{NULL}, /*MMC 0x92*/{NULL}, /*MMC 0x93*/{NULL}, /*MMC 0x94*/{NULL}, /*MMC 0x95*/{NULL}, /*MMC 0x96*/{NULL}, /*MMC 0x97*/{NULL}, /*MMC 0x98*/{NULL}, /*MMC 0x99*/{NULL}, /*MMC 0x9a*/{NULL}, /*MMC 0x9b*/{NULL}, /*MMC 0x9c*/{NULL}, /*MMC 0x9d*/{NULL}, /*MMC 0x9e*/{NULL}, /*MMC 0x9f*/{NULL}, /*SPC 0xa0*/{dissect_spc_reportluns}, /*MMC 0xa1*/{NULL}, /*MMC 0xa2*/{NULL}, /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in}, /*MMC 0xa4*/{dissect_mmc4_reportkey}, /*MMC 0xa5*/{NULL}, /*MMC 0xa6*/{NULL}, /*MMC 0xa7*/{NULL}, /*MMC 0xa8*/{dissect_sbc_read12}, /*MMC 0xa9*/{NULL}, /*MMC 0xaa*/{dissect_sbc_write12}, /*MMC 0xab*/{NULL}, /*MMC 0xac*/{dissect_mmc4_getperformance}, /*MMC 0xad*/{dissect_mmc4_readdiscstructure}, /*MMC 0xae*/{NULL}, /*MMC 0xaf*/{NULL}, /*MMC 0xb0*/{NULL}, /*MMC 0xb1*/{NULL}, /*MMC 0xb2*/{NULL}, /*MMC 0xb3*/{NULL}, /*MMC 0xb4*/{NULL}, /*MMC 0xb5*/{NULL}, /*MMC 0xb6*/{dissect_mmc4_setstreaming}, /*MMC 0xb7*/{NULL}, /*MMC 0xb8*/{NULL}, /*MMC 0xb9*/{NULL}, /*MMC 0xba*/{NULL}, /*MMC 0xbb*/{dissect_mmc4_setcdspeed}, /*MMC 0xbc*/{NULL}, /*MMC 0xbd*/{NULL}, /*MMC 0xbe*/{NULL}, /*MMC 0xbf*/{NULL}, /*MMC 0xc0*/{NULL}, /*MMC 0xc1*/{NULL}, /*MMC 0xc2*/{NULL}, /*MMC 0xc3*/{NULL}, /*MMC 0xc4*/{NULL}, /*MMC 0xc5*/{NULL}, /*MMC 0xc6*/{NULL}, /*MMC 0xc7*/{NULL}, /*MMC 0xc8*/{NULL}, /*MMC 0xc9*/{NULL}, /*MMC 0xca*/{NULL}, /*MMC 0xcb*/{NULL}, /*MMC 0xcc*/{NULL}, /*MMC 0xcd*/{NULL}, /*MMC 0xce*/{NULL}, /*MMC 0xcf*/{NULL}, /*MMC 0xd0*/{NULL}, /*MMC 0xd1*/{NULL}, /*MMC 0xd2*/{NULL}, /*MMC 0xd3*/{NULL}, /*MMC 0xd4*/{NULL}, /*MMC 0xd5*/{NULL}, /*MMC 0xd6*/{NULL}, /*MMC 0xd7*/{NULL}, /*MMC 0xd8*/{NULL}, /*MMC 0xd9*/{NULL}, /*MMC 0xda*/{NULL}, /*MMC 0xdb*/{NULL}, /*MMC 0xdc*/{NULL}, /*MMC 0xdd*/{NULL}, /*MMC 0xde*/{NULL}, /*MMC 0xdf*/{NULL}, /*MMC 0xe0*/{NULL}, /*MMC 0xe1*/{NULL}, /*MMC 0xe2*/{NULL}, /*MMC 0xe3*/{NULL}, /*MMC 0xe4*/{NULL}, /*MMC 0xe5*/{NULL}, /*MMC 0xe6*/{NULL}, /*MMC 0xe7*/{NULL}, /*MMC 0xe8*/{NULL}, /*MMC 0xe9*/{NULL}, /*MMC 0xea*/{NULL}, /*MMC 0xeb*/{NULL}, /*MMC 0xec*/{NULL}, /*MMC 0xed*/{NULL}, /*MMC 0xee*/{NULL}, /*MMC 0xef*/{NULL}, /*MMC 0xf0*/{NULL}, /*MMC 0xf1*/{NULL}, /*MMC 0xf2*/{NULL}, /*MMC 0xf3*/{NULL}, /*MMC 0xf4*/{NULL}, /*MMC 0xf5*/{NULL}, /*MMC 0xf6*/{NULL}, /*MMC 0xf7*/{NULL}, /*MMC 0xf8*/{NULL}, /*MMC 0xf9*/{NULL}, /*MMC 0xfa*/{NULL}, /*MMC 0xfb*/{NULL}, /*MMC 0xfc*/{NULL}, /*MMC 0xfd*/{NULL}, /*MMC 0xfe*/{NULL}, /*MMC 0xff*/{NULL} }; void proto_register_scsi_mmc(void) { static hf_register_info hf[] = { { &hf_scsi_mmc_opcode, {"MMC Opcode", "scsi_mmc.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_mmc_vals_ext, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_type, {"Type", "scsi_mmc.setstreaming.type", FT_UINT8, BASE_DEC, VALS(scsi_setstreaming_type_val), 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_param_len, {"Parameter Length", "scsi_mmc.setstreaming.param_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_wrc, {"WRC", "scsi_mmc.setstreaming.wrc", FT_UINT8, BASE_HEX, NULL, 0x18, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_rdd, {"RDD", "scsi_mmc.setstreaming.rdd", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_exact, {"Exact", "scsi_mmc.setstreaming.exact", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_ra, {"RA", "scsi_mmc.setstreaming.ra", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_start_lba, {"Start LBA", "scsi_mmc.setstreaming.start_lbs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_end_lba, {"End LBA", "scsi_mmc.setstreaming.end_lba", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_read_size, {"Read Size", "scsi_mmc.setstreaming.read_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_read_time, {"Read Time", "scsi_mmc.setstreaming.read_time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_write_size, {"Write Size", "scsi_mmc.setstreaming.write_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setstreaming_write_time, {"Write Time", "scsi_mmc.setstreaming.write_time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_setcdspeed_rc, {"Rotational Control", "scsi_mmc.setcdspeed.rc", FT_UINT8, BASE_HEX, VALS(scsi_setcdspeed_rc_val), 0x03, NULL, HFILL}}, { &hf_scsi_mmc_rbc_block, {"BLOCK", "scsi_mmc.rbc.block", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_rbc_lob_blocks, {"Buffer Len (blocks)", "scsi_mmc.rbc.lob_blocks", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_rbc_alob_blocks, {"Available Buffer Len (blocks)", "scsi_mmc.rbc.alob_blocks", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_rbc_lob_bytes, {"Buffer Len (bytes)", "scsi_mmc.rbc.lob_bytes", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_rbc_alob_bytes, {"Available Buffer Len (bytes)", "scsi_mmc.rbc.alob_bytes", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_rti_address_type, {"Address Type", "scsi_mmc.rti.address_type", FT_UINT8, BASE_HEX, VALS(scsi_rti_address_type_val), 0x03, NULL, HFILL}}, { &hf_scsi_mmc_rti_damage, {"Damage", "scsi_mmc.rti.damage", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_mmc_rti_copy, {"Copy", "scsi_mmc.rti.copy", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_rti_track_mode, {"Track Mode", "scsi_mmc.rti.track_mode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_track_mode_vals_ext, 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_rti_rt, {"RT", "scsi_mmc.rti.rt", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_mmc_rti_blank, {"Blank", "scsi_mmc.rti.blank", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_mmc_rti_packet, {"Packet/Inc", "scsi_mmc.rti.packet", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_mmc_rti_fp, {"FP", "scsi_mmc.rti.fp", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_rti_data_mode, {"Data Mode", "scsi_mmc.rti.data_mode", FT_UINT8, BASE_HEX, VALS(scsi_data_mode_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_rti_lra_v, {"LRA_V", "scsi_mmc.rti.lra_v", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_rti_nwa_v, {"NWA_V", "scsi_mmc.rti.nwa_v", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_report_key_type_code, {"Type Code", "scsi_mmc.report_key.type_code", FT_UINT8, BASE_HEX, VALS(scsi_report_key_type_code_val), 0xc0, NULL, HFILL}}, { &hf_scsi_mmc_report_key_vendor_resets, {"Vendor Resets", "scsi_mmc.report_key.vendor_resets", FT_UINT8, BASE_HEX, NULL, 0x38, NULL, HFILL}}, { &hf_scsi_mmc_report_key_user_changes, {"User Changes", "scsi_mmc.report_key.user_changes", FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}}, { &hf_scsi_mmc_report_key_region_mask, {"Region Mask", "scsi_mmc.report_key.region_mask", FT_UINT8, BASE_HEX, NULL, 0xff, NULL, HFILL}}, { &hf_scsi_mmc_report_key_rpc_scheme, {"RPC Scheme", "scsi_mmc.report_key.rpc_scheme", FT_UINT8, BASE_HEX, VALS(scsi_report_key_rpc_scheme_val), 0, NULL, HFILL}}, { &hf_scsi_mmc_key_class, {"Key Class", "scsi_mmc.key_class", FT_UINT8, BASE_HEX, VALS (scsi_key_class_val), 0x00, NULL, HFILL}}, { &hf_scsi_mmc_key_format, {"Key Format", "scsi_mmc.key_format", FT_UINT8, BASE_HEX, VALS (scsi_key_format_val), 0x3f, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_erasable, {"Erasable", "scsi_mmc.disc_info.erasable", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_state_of_last_session, {"State Of Last Session", "scsi_mmc.disc_info.state_of_last_session", FT_UINT8, BASE_HEX, VALS(scsi_disc_info_sols_val), 0x0c, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_disk_status, {"Disk Status", "scsi_mmc.disc_info.disk_status", FT_UINT8, BASE_HEX, VALS(scsi_disc_info_disc_status_val), 0x03, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_number_of_sessions, {"Number Of Sessions", "scsi_mmc.disc_info.number_of_sessions", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_first_track_in_last_session, {"First Track In Last Session", "scsi_mmc.disc_info.first_track_in_last_session", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_last_track_in_last_session, {"Last Track In Last Session", "scsi_mmc.disc_info.last_track_in_last_session", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_did_v, {"DID_V", "scsi_mmc.disc_info.did_v", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_dbc_v, {"DBC_V", "scsi_mmc.disc_info.dbc_v", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_uru, {"URU", "scsi_mmc.disc_info.uru", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_dac_v, {"DAC_V", "scsi_mmc.disc_info.dac_v", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_dbit, {"Dbit", "scsi_mmc.disc_info.dbit", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_bgfs, {"BG Format Status", "scsi_mmc.disc_info.bgfs", FT_UINT8, BASE_HEX, VALS(scsi_disc_info_bgfs_val), 0x03, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_disc_type, {"Disc Type", "scsi_mmc.disc_info.disc_type", FT_UINT8, BASE_HEX, VALS(scsi_disc_info_disc_type_val), 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_disc_identification, {"Disc Identification", "scsi_mmc.disc_info.disc_identification", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_last_session_lead_in_start_address, {"Last Session Lead-In Start Address", "scsi_mmc.disc_info.last_session_lead_in_start_address", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_last_possible_lead_out_start_address, {"Last Possible Lead-Out Start Address", "scsi_mmc.disc_info.last_possible_lead_out_start_address", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_info_disc_bar_code, {"Disc Bar Code", "scsi_mmc.disc_info.disc_bar_code", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_readtoc_time, {"Time", "scsi_mmc.readtoc.time", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_readtoc_format, {"Format", "scsi_mmc.readtoc.format", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_readtoc_first_session, {"First Session", "scsi_mmc.readtoc.first_session", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_readtoc_last_track, {"Last Track", "scsi_mmc.readtoc.last_track", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_readtoc_last_session, {"Last Session", "scsi_mmc.readtoc.last_session", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_q_subchannel_adr, {"Q Subchannel ADR", "scsi_mmc.q.subchannel.adr", FT_UINT8, BASE_HEX, VALS(scsi_q_subchannel_adr_val), 0xf0, NULL, HFILL}}, { &hf_scsi_mmc_q_subchannel_control, {"Q Subchannel Control", "scsi_mmc.q.subchannel.control", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_q_subchannel_control_val_ext, 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_agid, {"AGID", "scsi_mmc.agid", FT_UINT8, BASE_HEX, NULL, 0xc0, NULL, HFILL}}, { &hf_scsi_mmc_track, {"Track", "scsi_mmc.track", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_track_size, {"Track Size", "scsi_mmc.track_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_track_start_address, {"Track Start Address", "scsi_mmc.track_start_address", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_track_start_time, {"Track Start Time", "scsi_mmc.track_start_time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_lba, {"Logical Block Address", "scsi_mmc.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_session, {"Session", "scsi_mmc.session", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_data_length, {"Data Length", "scsi_mmc.data_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_getconf_rt, {"RT", "scsi_mmc.getconf.rt", FT_UINT8, BASE_HEX, VALS(scsi_getconf_rt_val), 0x03, NULL, HFILL}}, { &hf_scsi_mmc_getconf_current_profile, {"Current Profile", "scsi_mmc.getconf.current_profile", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &scsi_getconf_current_profile_val_ext, 0, NULL, HFILL}}, { &hf_scsi_mmc_getconf_starting_feature, {"Starting Feature", "scsi_mmc.getconf.starting_feature", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &scsi_feature_val_ext, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature, {"Feature", "scsi_mmc.feature", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &scsi_feature_val_ext, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature_version, {"Version", "scsi_mmc.feature.version", FT_UINT8, BASE_DEC, NULL, 0x3c, NULL, HFILL}}, { &hf_scsi_mmc_feature_persistent, {"Persistent", "scsi_mmc.feature.persistent", FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_feature_current, {"Current", "scsi_mmc.feature.current", FT_UINT8, BASE_HEX, NULL, 001, NULL, HFILL}}, { &hf_scsi_mmc_feature_additional_length, {"Additional Length", "scsi_mmc.feature.additional_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature_lun_sn, {"LUN Serial Number", "scsi_mmc.feature.lun_sn", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature_cdread_dap, {"DAP", "scsi_mmc.feature.cdread.dap", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_mmc_feature_cdread_c2flag, {"C2 Flag", "scsi_mmc.feature.cdread.c2flag", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_feature_cdread_cdtext, {"CD-Text", "scsi_mmc.feature.cdread.cdtext", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdrw_write, {"Write", "scsi_mmc.feature.dvdrw.write", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdrw_quickstart, {"Quick Start", "scsi_mmc.feature.dvdrw.quickstart", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdrw_closeonly, {"Close Only", "scsi_mmc.feature.dvdrw.closeonly", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdr_write, {"Write", "scsi_mmc.feature.dvdr.write", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_tao_buf, {"BUF", "scsi_mmc.feature.tao.buf", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_mmc_feature_tao_rwraw, {"R-W Raw", "scsi_mmc.feature.tao.rwraw", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_feature_tao_rwpack, {"R-W Pack", "scsi_mmc.feature.tao.rwpack", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_mmc_feature_tao_testwrite, {"Test Write", "scsi_mmc.feature.tao.testwrite", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_feature_tao_cdrw, {"CD-RW", "scsi_mmc.feature.tao.cdrw", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_feature_tao_rwsubcode, {"R-W Subcode", "scsi_mmc.feature.tao.rwsubcode", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_dts, {"Data Type Supported", "scsi_mmc.feature.dts", FT_UINT16, BASE_HEX, NULL, 0xffff, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_buf, {"BUF", "scsi_mmc.feature.sao.buf", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_sao, {"SAO", "scsi_mmc.feature.sao.sao", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_rawms, {"Raw MS", "scsi_mmc.feature.sao.rawms", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_raw, {"Raw", "scsi_mmc.feature.sao.raw", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_testwrite, {"Test Write", "scsi_mmc.feature.sao.testwrite", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_cdrw, {"CD-RW", "scsi_mmc.feature.sao.cdrw", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_rw, {"R-W", "scsi_mmc.feature.sao.rw", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_sao_mcsl, {"Maximum Cue Sheet Length", "scsi_mmc.feature.sao.mcsl", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdr_buf, {"BUF", "scsi_mmc.feature.dvdr.buf", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdr_testwrite, {"Test Write", "scsi_mmc.feature.dvdr.testwrite", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_feature_dvdr_dvdrw, {"DVD-RW", "scsi_mmc.feature.dvdr.dvdrw", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_feature_profile, {"Profile", "scsi_mmc.feature.profile", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &scsi_getconf_current_profile_val_ext, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature_profile_current, {"Current", "scsi_mmc.feature.profile.current", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_isw_buf, {"BUF", "scsi_mmc.feature.isw.buf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_feature_isw_num_linksize, {"Number of Link Sizes", "scsi_mmc.feature.isw.num_linksize", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_feature_isw_linksize, {"Link Size", "scsi_mmc.feature.isw.linksize", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_read_compatibility_lba, {"Read Compatibility LBA", "scsi_mmc.read_compatibility_lba", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_reservation_size, {"Reservation Size", "scsi_mmc.reservation_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_last_recorded_address, {"Last Recorded Address", "scsi_mmc.last_recorded_address", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_first_track, {"First Track", "scsi_mmc.first_track", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_fixed_packet_size, {"Fixed Packet Size", "scsi_mmc.fixed_packet_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_closetrack_immed, {"IMMED", "scsi_mmc.closetrack.immed", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_closetrack_func, {"Close Function", "scsi_mmc.closetrack.func", FT_UINT8, BASE_HEX, VALS(scsi_closetrack_func_val), 0x07, NULL, HFILL}}, { &hf_scsi_mmc_synccache_immed, {"IMMED", "scsi_mmc.synccache.immed", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_synccache_reladr, {"RelAdr", "scsi_mmc.synccache.reladr", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_num_blocks, {"Number of Blocks", "scsi_mmc.num_blocks", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_next_writable_address, {"Next Writable Address", "scsi_mmc.next_writable_address", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_free_blocks, {"Free Blocks", "scsi_mmc.free_blocks", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_read_dvd_format, { "Format Code", "scsi_mmc.read_dvd.format", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_read_dvd_formats_ext, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_disc_book_type, { "Type", "scsi_mmc.book.type", FT_UINT8, BASE_HEX, VALS(scsi_disc_category_type), 0xf0, NULL, HFILL}}, { &hf_scsi_mmc_disc_book_version, { "Version", "scsi_mmc.book.version", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_disc_size_size, { "Size", "scsi_mmc.disc.size", FT_UINT8, BASE_DEC_HEX, VALS(scsi_disc_size), 0xf0, NULL, HFILL}}, { &hf_scsi_mmc_disc_size_rate, { "Rate", "scsi_mmc.disc.rate", FT_UINT8, BASE_HEX, VALS(scsi_disc_rate), 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_disc_structure_layer, { "Structure", "scsi_mmc.disc.structure", FT_UINT8, BASE_HEX, VALS(scsi_disc_structure), 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_disc_density_length, { "Channel bith length", "scsi_mmc.density.channel_bit_length", FT_UINT8, BASE_HEX, VALS(scsi_density_length), 0xf0, NULL, HFILL}}, { &hf_scsi_mmc_disc_density_pitch, { "Average Track Pitch", "scsi_mmc.density.average_track_pitch", FT_UINT8, BASE_HEX, VALS(scsi_density_pitch), 0x0f, NULL, HFILL}}, { &hf_scsi_mmc_disc_first_physical, { "First physical sector of data zone", "scsi_mmc.first_physical", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_last_physical, { "Last physical sector of data zone", "scsi_mmc.last_physical", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_last_physical_layer0, { "Last physical sector of layer 0", "scsi_mmc.last_physical_layer0", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_disc_extended_format_info, { "Extended Format Info", "scsi_mmc.adip.extended_format_info", FT_BOOLEAN, 8, TFS(&scsi_adip_extended_format_info), 0x40, NULL, HFILL}}, { &hf_scsi_mmc_disc_application_code, { "Disk Application Code", "scsi_mmc.disk_application_code", FT_UINT8, BASE_HEX, VALS(scsi_disk_application_code), 0x0, NULL, HFILL}}, { &hf_scsi_mmc_adip_eib0, { "Extended Format Block 0", "scsi_mmc.adip.extended_format_block.0", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_adip_eib1, { "Extended Format Block 1", "scsi_mmc.adip.extended_format_block.1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_adip_eib2, { "Extended Format Block 2", "scsi_mmc.adip.extended_format_block.2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_adip_eib3, { "Extended Format Block 3", "scsi_mmc.adip.extended_format_block.3", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_mmc_adip_eib4, { "Extended Format Block 4", "scsi_mmc.adip.extended_format_block.4", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_adip_eib5, { "Extended Format Block 5", "scsi_mmc.adip.extended_format_block.5", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_mmc_adip_device_manuf_id, { "Device Manufacturer Id", "scsi_mmc.adip.device_manufacturer_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_adip_media_type_id, { "Media Type Id", "scsi_mmc.adip.media_type_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_adip_product_revision_number, { "Product Revision Number", "scsi_mmc.adip.product_revision_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_adip_number_of_physical_info, { "Number of bytes of physical info", "scsi_mmc.adip.number_of_physical_info", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_mmc_disc_num_layers, { "Number of Layers", "scsi_mmc.disk.num_layers", FT_UINT8, BASE_DEC, VALS(scsi_num_layers), 0x60, NULL, HFILL}}, { &hf_scsi_mmc_disc_track_path, { "Track Path", "scsi_mmc.disk.track_path", FT_BOOLEAN, 8, TFS(&scsi_track_path), 0x10, NULL, HFILL}}, { &hf_scsi_mmc_gesn_polled, { "Polled", "scsi_mmc.gesn.polled", FT_BOOLEAN, 8, TFS(&scsi_gesn_path), 0x01, NULL, HFILL}}, { &hf_scsi_mmc_notification_flags, {"Notification Class Request", "scsi_mmc.notification.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_gesn_device_busy, { "DEVICE BUSY", "scsi_mmc.gesn.device_busy", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_mmc_gesn_multi_initiator, { "MULTI_INITIATOR", "scsi_mmc.gesn.multi_initiator", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_mmc_gesn_media, { "MEDIA", "scsi_mmc.gesn.media", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_mmc_gesn_external_request, { "EXTERNAL_REQUEST", "scsi_mmc.gesn.external_request", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_mmc_gesn_power_mgmt, { "POWER_MANAGEMENT", "scsi_mmc.gesn.power_management", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_mmc_gesn_operational_change, { "OPERATIONAL_CHANGE", "scsi_mmc.gesn.operational_change", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_prevent_allow_flags, {"Prevent Allow Flags", "scsi_mmc.prevent_allow.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_prevent_allow_persistent, { "PERSISTENT", "scsi_mmc.prevent_allow.persistent", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_mmc_prevent_allow_prevent, { "PREVENT", "scsi_mmc.prevent_allow.prevent", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mmc_disk_flags, {"Disk Flags", "scsi_mmc.disk.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_format_flags, {"Format Flags", "scsi_mmc.format.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_track_flags, {"Track Flags", "scsi_mmc.track.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_mmc_data_flags, {"Data Flags", "scsi_mmc.data.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_scsi_mmc_read_dvd_address, { "Address", "scsi_mmc.read_dvd.address", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc_read_dvd_layer_number, { "Layer Number", "scsi_mmc.read_dvd.layer_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc_read_dvd_agid, { "AGID", "scsi_mmc.read_dvd.agid", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL }}, { &hf_scsi_mmc_getperformance_data_type, { "Data Type", "scsi_mmc.getperformance.data_type", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }}, { &hf_scsi_mmc_getperformance_starting_lba, { "Starting LBA", "scsi_mmc.getperformance.starting_lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc_getperformance_max_num_descriptors, { "Maximum Number of Descriptors", "scsi_mmc.getperformance.max_num_descriptors", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc_getperformance_type, { "Type", "scsi_mmc.getperformance.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc_setcdspeed_logical_unit_read_speed, { "Logical Unit Read Speed(bytes/sec)", "scsi_mmc.setcdspeed.logical_unit_read_speed", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc_setcdspeed_logical_unit_write_speed, { "Logical Unit Write Speed(bytes/sec)", "scsi_mmc.setcdspeed.logical_unit_write_speed", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_scsi_mmc_profile, &ett_scsi_notifications, &ett_scsi_prevent_allow, &ett_scsi_disk_flags, &ett_scsi_format_flags, &ett_scsi_track_flags, &ett_scsi_data_flags, }; static ei_register_info ei[] = { /* Generated from convert_proto_tree_add_text.pl */ { &ei_scsi_mmc_unknown_feature_data, { "scsi_mmc.unknown_feature_data", PI_PROTOCOL, PI_WARN, "SCSI/MMC Unknown Feature data", EXPFILL }}, { &ei_scsi_mmc_unknown_read_toc_format, { "scsi_mmc.unknown_read_toc_format", PI_PROTOCOL, PI_WARN, "SCSI/MMC Unknown READ TOC Format", EXPFILL }}, { &ei_scsi_mmc_unknown_read_dvd_format, { "scsi_mmc.unknown_read_dvd_format", PI_PROTOCOL, PI_WARN, "SCSI/MMC Unknown Read DVD Format", EXPFILL }}, { &ei_scsi_mmc_unknown_format_class, { "scsi_mmc.unknown_format_class", PI_PROTOCOL, PI_WARN, "SCSI/MMC Unknown Format/Class combination", EXPFILL }}, { &ei_scsi_mmc_unknown_setstreaming_type, { "scsi_mmc.unknown_setstreaming_type", PI_PROTOCOL, PI_WARN, "SCSI/MMC Unknown SetStreaming Type", EXPFILL }}, }; expert_module_t* expert_scsi_mmc; /* Register the protocol name and description */ proto_scsi_mmc = proto_register_protocol("SCSI_MMC", "SCSI_MMC", "scsi_mmc"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_scsi_mmc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_scsi_mmc = expert_register_protocol(proto_scsi_mmc); expert_register_field_array(expert_scsi_mmc, ei, array_length(ei)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-scsi-mmc.h
/* packet-scsi-mmc.h * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCSI_MMC_H_ #define __PACKET_SCSI_MMC_H_ extern int hf_scsi_mmc_opcode; extern scsi_cdb_table_t scsi_mmc_table[256]; WS_DLL_PUBLIC value_string_ext scsi_mmc_vals_ext; #endif
C
wireshark/epan/dissectors/packet-scsi-osd.c
/* packet-scsi-osd.c * Dissector for the SCSI OSD (object based storage) commandset * * Ronnie sahlberg 2006 * Joe Breher 2006 * Javier Godoy 2013 (OSD-2 dissector) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/expert.h> #include "packet-scsi.h" #include "packet-scsi-osd.h" void proto_register_scsi_osd(void); static int proto_scsi_osd = -1; int hf_scsi_osd_opcode = -1; static int hf_scsi_osd_add_cdblen = -1; static int hf_scsi_osd_svcaction = -1; static int hf_scsi_osd_option = -1; static int hf_scsi_osd_option_dpo = -1; static int hf_scsi_osd_option_fua = -1; static int hf_scsi_osd_getsetattrib = -1; static int hf_scsi_osd_timestamps_control = -1; static int hf_scsi_osd_formatted_capacity = -1; static int hf_scsi_osd_get_attributes_page = -1; static int hf_scsi_osd_get_attributes_allocation_length = -1; static int hf_scsi_osd_get_attributes_list_length = -1; static int hf_scsi_osd_get_attributes_list_offset = -1; static int hf_scsi_osd_retrieved_attributes_offset = -1; static int hf_scsi_osd_set_attributes_page = -1; static int hf_scsi_osd_set_attribute_length = -1; static int hf_scsi_osd_set_attribute_number = -1; static int hf_scsi_osd_set_attributes_offset = -1; static int hf_scsi_osd_set_attributes_list_length = -1; static int hf_scsi_osd_set_attributes_list_offset = -1; static int hf_scsi_osd_capability_format = -1; static int hf_scsi_osd_key_version = -1; static int hf_scsi_osd_icva = -1; static int hf_scsi_osd_security_method = -1; static int hf_scsi_osd_capability_expiration_time = -1; static int hf_scsi_osd_audit = -1; static int hf_scsi_osd_capability_discriminator = -1; static int hf_scsi_osd_object_created_time = -1; static int hf_scsi_osd_object_type = -1; static int hf_scsi_osd_permissions = -1; static int hf_scsi_osd_permissions_read = -1; static int hf_scsi_osd_permissions_write = -1; static int hf_scsi_osd_permissions_get_attr = -1; static int hf_scsi_osd_permissions_set_attr = -1; static int hf_scsi_osd_permissions_create = -1; static int hf_scsi_osd_permissions_remove = -1; static int hf_scsi_osd_permissions_obj_mgmt = -1; static int hf_scsi_osd_permissions_append = -1; static int hf_scsi_osd_permissions_dev_mgmt = -1; static int hf_scsi_osd_permissions_global = -1; static int hf_scsi_osd_permissions_pol_sec = -1; static int hf_scsi_osd_object_descriptor_type = -1; static int hf_scsi_osd_object_descriptor = -1; static int hf_scsi_osd_ricv = -1; static int hf_scsi_osd_request_nonce = -1; static int hf_scsi_osd_diicvo = -1; static int hf_scsi_osd_doicvo = -1; static int hf_scsi_osd_requested_partition_id = -1; static int hf_scsi_osd_sortorder = -1; static int hf_scsi_osd_partition_id = -1; static int hf_scsi_osd_list_identifier = -1; static int hf_scsi_osd_allocation_length = -1; static int hf_scsi_osd_length = -1; static int hf_scsi_osd_starting_byte_address = -1; static int hf_scsi_osd_initial_object_id = -1; static int hf_scsi_osd_additional_length = -1; static int hf_scsi_osd_continuation_object_id = -1; static int hf_scsi_osd_list_flags_lstchg = -1; static int hf_scsi_osd_list_flags_root = -1; static int hf_scsi_osd_list_collection_flags_coltn = -1; static int hf_scsi_osd_user_object_id = -1; static int hf_scsi_osd_requested_user_object_id = -1; static int hf_scsi_osd_number_of_user_objects = -1; static int hf_scsi_osd_key_to_set = -1; static int hf_scsi_osd_set_key_version = -1; static int hf_scsi_osd_key_identifier = -1; static int hf_scsi_osd_seed = -1; static int hf_scsi_osd_collection_fcr = -1; static int hf_scsi_osd_collection_object_id = -1; static int hf_scsi_osd_requested_collection_object_id = -1; static int hf_scsi_osd_partition_created_in = -1; static int hf_scsi_osd_partition_removed_in = -1; static int hf_scsi_osd_flush_scope = -1; static int hf_scsi_osd_flush_collection_scope = -1; static int hf_scsi_osd_flush_partition_scope = -1; static int hf_scsi_osd_flush_osd_scope = -1; static int hf_scsi_osd_attributes_list_type = -1; static int hf_scsi_osd_attributes_list_length = -1; static int hf_scsi_osd_attributes_page = -1; static int hf_scsi_osd_attribute_number = -1; static int hf_scsi_osd_attribute_length = -1; static int hf_scsi_osd_attrval_user_object_logical_length = -1; static int hf_scsi_osd_attrval_object_type = -1; static int hf_scsi_osd_attrval_partition_id = -1; static int hf_scsi_osd_attrval_object_id = -1; static int hf_scsi_osd2_query_type = -1; static int hf_scsi_osd2_query_entry_length = -1; static int hf_scsi_osd2_query_attributes_page = -1; static int hf_scsi_osd2_query_attribute_number = -1; static int hf_scsi_osd2_query_minimum_attribute_value_length = -1; static int hf_scsi_osd2_query_maximum_attribute_value_length = -1; /* Fields that are defined in OSD-2 are prefixed with hf_scsi_osd2_ */ static int hf_scsi_osd2_attributes_list_length = -1; static int hf_scsi_osd2_set_attribute_value = -1; static int hf_scsi_osd2_isolation = -1; static int hf_scsi_osd2_immed_tr = -1; static int hf_scsi_osd2_list_attr = -1; static int hf_scsi_osd2_object_descriptor_format = -1; static int hf_scsi_osd2_matches_collection_object_id = -1; static int hf_scsi_osd2_source_collection_object_id = -1; static int hf_scsi_osd2_cdb_continuation_length = -1; static int hf_scsi_osd2_cdb_continuation_format = -1; static int hf_scsi_osd2_continued_service_action = -1; static int hf_scsi_osd2_cdb_continuation_descriptor_type = -1; static int hf_scsi_osd2_cdb_continuation_descriptor_pad_length = -1; static int hf_scsi_osd2_cdb_continuation_descriptor_length = -1; static int hf_scsi_osd2_remove_scope = -1; static gint ett_osd_option = -1; static gint ett_osd_partition = -1; static gint ett_osd_attribute_parameters = -1; static gint ett_osd_capability = -1; static gint ett_osd_permission_bitmask = -1; static gint ett_osd_security_parameters = -1; static gint ett_osd_get_attributes = -1; static gint ett_osd_set_attributes = -1; static gint ett_osd_multi_object = -1; static gint ett_osd_attribute = -1; static gint ett_osd2_query_criteria_entry = -1; static expert_field ei_osd_attr_unknown = EI_INIT; static expert_field ei_osd2_invalid_offset = EI_INIT; static expert_field ei_osd2_invalid_object_descriptor_format = EI_INIT; static expert_field ei_osd_unknown_attributes_list_type = EI_INIT; static expert_field ei_osd2_cdb_continuation_format_unknown = EI_INIT; static expert_field ei_osd2_continued_service_action_mismatch = EI_INIT; static expert_field ei_osd2_cdb_continuation_descriptor_type_unknown = EI_INIT; static expert_field ei_osd2_cdb_continuation_descriptor_length_invalid = EI_INIT; static expert_field ei_osd2_cdb_continuation_length_invalid = EI_INIT; static expert_field ei_osd_attr_length_invalid = EI_INIT; static expert_field ei_osd2_query_values_equal= EI_INIT; #define PAGE_NUMBER_OBJECT 0x00000000 #define PAGE_NUMBER_PARTITION 0x30000000 #define PAGE_NUMBER_COLLECTION 0x60000000 #define PAGE_NUMBER_ROOT 0x90000000 /* There will be one such structure create for each conversation ontop of which * there is an OSD session */ typedef struct _scsi_osd_conv_info_t { wmem_tree_t *luns; } scsi_osd_conv_info_t; /* there will be one such structure created for each lun for each conversation * that is handled by the OSD dissector */ struct _scsi_osd_lun_info_t { wmem_tree_t *partitions; }; typedef void (*scsi_osd_dissector_t)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint32 payload_len, scsi_task_data_t *cdata, scsi_osd_conv_info_t *conv_info, scsi_osd_lun_info_t *lun_info ); /* One such structure is created per conversation/lun/partition to * keep track of when partitions are created/used/destroyed */ typedef struct _partition_info_t { int created_in; int removed_in; } partition_info_t; /* This is a set of extra data specific to OSD that we need to attach to every * task. */ typedef struct _scsi_osd_extra_data_t { guint16 svcaction; guint8 gsatype; union { struct { /* gsatype: attribute list */ guint32 get_list_length; guint32 get_list_offset; guint32 get_list_allocation_length; guint32 retrieved_list_offset; guint32 set_list_length; guint32 set_list_offset; } al; } u; guint32 continuation_length; gboolean osd2; } scsi_osd_extra_data_t; static proto_item* dissect_osd_user_object_id(tvbuff_t *tvb, int offset, proto_tree *tree) { /* user object id */ proto_item *item; item = proto_tree_add_item(tree, hf_scsi_osd_user_object_id, tvb, offset, 8, ENC_NA); return item; } /*dissects an attribute that is defined as a pair of hf_index, length*/ static void generic_attribute_dissector(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, scsi_osd_lun_info_t *lun_info _U_, const attribute_page_numbers_t *att) { proto_tree_add_item(tree, *att->hf_index, tvb, 0, att->expected_length, ENC_BIG_ENDIAN); } static proto_item * dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int hf_index, scsi_osd_lun_info_t *lun_info, gboolean is_created, gboolean is_removed); static void partition_id_attribute_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, scsi_osd_lun_info_t *lun_info, const attribute_page_numbers_t *att) { dissect_osd_partition_id(pinfo, tvb, 0, tree, *att->hf_index, lun_info, FALSE, FALSE); } static const attribute_page_numbers_t user_object_info_attributes[] = { {0x82, "User object logical length", generic_attribute_dissector, &hf_scsi_osd_attrval_user_object_logical_length, 8}, {0, NULL, NULL, NULL, 0} }; static const attribute_page_numbers_t current_command_attributes[] = { {0x02, "Object Type", generic_attribute_dissector, &hf_scsi_osd_attrval_object_type, 1}, {0x03, "Partition ID", partition_id_attribute_dissector, &hf_scsi_osd_attrval_partition_id, 8}, {0x04, "Collection Object ID or User Object ID", generic_attribute_dissector, &hf_scsi_osd_attrval_object_id, 8}, {0, NULL, NULL, NULL, 0} }; typedef struct _attribute_pages_t { guint32 page; const attribute_page_numbers_t *attributes; } attribute_pages_t; static const attribute_pages_t attribute_pages[] = { {PAGE_NUMBER_OBJECT+1, user_object_info_attributes}, {0xFFFFFFFE, current_command_attributes}, {0, NULL} }; static const value_string attributes_page_vals[] = { {PAGE_NUMBER_OBJECT+0, "User Object Directory"}, {PAGE_NUMBER_OBJECT+1, "User Object Information"}, {PAGE_NUMBER_OBJECT+2, "User Object Quotas"}, {PAGE_NUMBER_OBJECT+3, "User Object Timestamps"}, {PAGE_NUMBER_OBJECT+4, "User Object Collections"}, {PAGE_NUMBER_OBJECT+5, "User Object Policy/Security"}, {PAGE_NUMBER_PARTITION, "Partition Directory"}, {PAGE_NUMBER_PARTITION+1, "Partition Information"}, {PAGE_NUMBER_PARTITION+2, "Partition Quotas"}, {PAGE_NUMBER_PARTITION+3, "Partition Timestamps"}, {PAGE_NUMBER_PARTITION+5, "Partition Policy/Security"}, {PAGE_NUMBER_COLLECTION, "Collection Directory"}, {PAGE_NUMBER_COLLECTION+1, "Collection Information"}, {PAGE_NUMBER_COLLECTION+2, "Collection Quotas"}, {PAGE_NUMBER_COLLECTION+4, "Collection Command Tracking"}, {PAGE_NUMBER_COLLECTION+5, "Collection Policy/Security"}, {PAGE_NUMBER_ROOT, "Root Directory"}, {PAGE_NUMBER_ROOT+1, "Root Information"}, {PAGE_NUMBER_ROOT+2, "Root Quotas"}, {PAGE_NUMBER_ROOT+3, "Root Timestamps"}, {PAGE_NUMBER_ROOT+5, "Root Policy/Security"}, {0xFFFFFFFE, "Current Command"}, {0xFFFFFFFF, "All attribute pages"}, {0, NULL} }; value_string_ext attributes_page_vals_ext = VALUE_STRING_EXT_INIT(attributes_page_vals); static const value_string attributes_list_type_vals[] = { {0x01, "Retrieve attributes for this OSD object"}, {0x09, "Retrieve/Set attributes for this OSD object"}, {0x0f, "Retrieve attributes for a CREATE command"}, {0, NULL} }; static const value_string scsi_osd2_isolation_val[] = { {0x00, "Default"}, {0x01, "None"}, {0x02, "Strict"}, {0x04, "Range"}, {0x05, "Functional"}, {0x07, "Vendor specific"}, {0, NULL} }; static const value_string scsi_osd2_object_descriptor_format_val[] = { {0x01, "Partition ID"}, {0x02, "Partition ID followed by attribute parameters"}, {0x11, "Collection ID"}, {0x12, "Collection ID followed by attribute parameters"}, {0x21, "User Object ID"}, {0x22, "User Object ID followed by attribute parameters"}, {0, NULL} }; static const value_string scsi_osd2_remove_scope[] = { {0x00, "Fail if there are collections or user objects in the partition"}, {0x01, "Remove collections and user objects in the partition"}, {0, NULL} }; static const value_string scsi_osd2_cdb_continuation_format_val[] = { {0x01, "OSD2"}, {0, NULL} }; static const value_string scsi_osd2_cdb_continuation_descriptor_type_val[] = { {0x0000, "No more continuation descriptors"}, {0x0001, "Scatter/gather list"}, {0x0002, "Query list"}, {0x0100, "User object"}, {0x0101, "Copy user object source"}, {0xFFEE, "Extension capabilities"}, {0, NULL} }; static const value_string scsi_osd2_query_type_vals[] = { {0x00, "Match any query criteria"}, {0x01, "Match all query criteria"}, {0, NULL} }; /* OSD2/3 helper functions */ static void dissect_osd2_isolation(tvbuff_t *tvb, int offset, proto_tree *tree) { /* isolation */ proto_tree_add_item(tree, hf_scsi_osd2_isolation, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_osd2_list_attr(tvbuff_t *tvb, int offset, proto_tree *tree) { /* list_attr */ proto_tree_add_item(tree, hf_scsi_osd2_list_attr, tvb, offset, 1, ENC_BIG_ENDIAN); } /* used by dissect_osd_attributes_list, dissect_osd2_attribute_list_entry and dissect_scsi_descriptor_snsinfo from packet-scsi.c*/ const attribute_page_numbers_t * osd_lookup_attribute(guint32 page, guint32 number) { const attribute_pages_t *ap; const attribute_page_numbers_t *apn; /* find the proper attributes page */ apn = NULL; for (ap=attribute_pages;ap->attributes;ap++) { if (ap->page == page) { apn = ap->attributes; break; } } if (!apn) return NULL; /* find the specific attribute */ for (;apn->name;apn++) { if (apn->number == number) { break; } } if (!apn->name) return NULL; /* found it */ return apn; } /* OSD-1: 7.1.3.3, OSD2 7.1.4.3 list entry format */ static guint32 dissect_osd_attribute_list_entry(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, proto_item *item, guint32 offset, scsi_osd_lun_info_t *lun_info, gboolean osd2) { guint16 attribute_length; guint32 page, number; const attribute_page_numbers_t *apn; /* attributes page */ page = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_scsi_osd_attributes_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* attribute number */ number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_scsi_osd_attribute_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (osd2) { /*6 reserved bytes*/ offset += 6; } /* attribute length */ attribute_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_scsi_osd_attribute_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_item_append_text(item, " 0x%08x (%s)", page, val_to_str_ext_const(page, &attributes_page_vals_ext, "Unknown")); proto_item_append_text(item, " 0x%08x", number); apn= osd_lookup_attribute(page, number); if (!apn) { expert_add_info(pinfo, item, &ei_osd_attr_unknown); proto_item_append_text(item, " (Unknown)"); } else { proto_item_append_text(item, " (%s)", apn->name); /* attribute value */ if (attribute_length) { if (attribute_length != apn->expected_length) { proto_tree_add_expert_format(tree, pinfo, &ei_osd_attr_length_invalid, tvb, 0, attribute_length, "%s", apn->name); } else { tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, attribute_length); apn->dissector(next_tvb, pinfo, tree, lun_info, apn); } } } offset += attribute_length; if (osd2 && (attribute_length&7)) { /* 8-bit padding */ offset += 8-(attribute_length&7); } return offset; } /* OSD1: 7.1.3.1 OSD2: 7.1.4.1*/ static void dissect_osd_attributes_list(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, scsi_osd_lun_info_t *lun_info, gboolean osd2) { guint8 type; guint32 length; guint32 page, number; int start_offset = offset; proto_item *item, *list_type_item; const attribute_page_numbers_t *apn; /* list type */ type = tvb_get_guint8(tvb, offset)&0x0f; list_type_item = proto_tree_add_item(tree, hf_scsi_osd_attributes_list_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* OSD-1: a reserved byte */ /* OSD-2: 3 reserved bytes */ offset += (osd2?3:1); /* OSD-1: length (16 bit) OSD-2: length (32 bit) */ if (osd2) { length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_scsi_osd2_attributes_list_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else { length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_scsi_osd_attributes_list_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } /* if type is 1 length will be zero and we have to cycle over * all remaining bytes. 7.1.3.1 */ if (!osd2 && type == 1) { length = tvb_reported_length_remaining(tvb, offset); } length += (osd2?8:4); while ( (guint32)(offset-start_offset)<length ) { proto_item *ti; proto_tree *tt; guint32 attribute_entry_length; switch (type) { case 0x01: attribute_entry_length = 8; break; case 0x0f: attribute_entry_length = 18+tvb_get_ntohs(tvb, offset+16); break; case 0x09: if (osd2) { attribute_entry_length = 16+tvb_get_ntohs(tvb, offset+14); } else { attribute_entry_length = 10+tvb_get_ntohs(tvb, offset+8); } break; default: expert_add_info(pinfo, list_type_item, &ei_osd_unknown_attributes_list_type); return; } if ((guint32)(offset-start_offset)+attribute_entry_length>length) break; tt = proto_tree_add_subtree(tree, tvb, offset, attribute_entry_length, ett_osd_attribute, &ti, "Attribute:"); switch (type) { case 0x01: /* retrieving attributes 7.1.3.2 */ /* attributes page */ page = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tt, hf_scsi_osd_attributes_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* attribute number */ number = tvb_get_ntohl(tvb, offset); item = proto_tree_add_item(tt, hf_scsi_osd_attribute_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_item_append_text(ti, " 0x%08x (%s)", page, val_to_str_ext_const(page, &attributes_page_vals_ext, "Unknown")); proto_item_append_text(ti, " 0x%08x", number); /* find the proper attributes page */ apn = osd_lookup_attribute(page, number); if (!apn) { proto_item_append_text(ti, " (Unknown)"); proto_item_append_text(item, " (Unknown)"); } else { proto_item_append_text(ti, " (%s)", apn->name); proto_item_append_text(item, " (%s)", apn->name); } break; case 0x0f: /* create attributes 7.1.3.4 */ /* user object id */ dissect_osd_user_object_id(tvb, offset, tt); offset += 8; /* fallthrough */ case 0x09: /* retrieved/set attributes OSD-1: 7.1.3.3 OSD-2: 7.1.4.3*/ offset = dissect_osd_attribute_list_entry(pinfo, tvb, tt, ti, offset, lun_info, osd2); break; } } } /* OSD2 5.2.4 */ static void dissect_osd_option(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { proto_tree *tree; proto_item *it; guint8 option; option = tvb_get_guint8(tvb, offset); it = proto_tree_add_item(parent_tree, hf_scsi_osd_option, tvb, offset, 1, ENC_BIG_ENDIAN); tree = proto_item_add_subtree(it, ett_osd_option); proto_tree_add_item(tree, hf_scsi_osd_option_dpo, tvb, offset, 1, ENC_BIG_ENDIAN); if (option&0x10) { proto_item_append_text(tree, " DPO"); } proto_tree_add_item(tree, hf_scsi_osd_option_fua, tvb, offset, 1, ENC_BIG_ENDIAN); if (option&0x08) { proto_item_append_text(tree, " FUA"); } } static const value_string scsi_osd_getsetattrib_vals[] = { {1, "Set one attribute using CDB fields (OSD-2)"}, {2, "Get an attributes page and set an attribute value"}, {3, "Get and set attributes using a list"}, {0, NULL}, }; /* OSD2 5.2.2.1 */ static void dissect_osd_getsetattrib(tvbuff_t *tvb, int offset, proto_tree *tree, scsi_task_data_t *cdata) { if (cdata && cdata->itlq && cdata->itlq->extra_data) { scsi_osd_extra_data_t *extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; extra_data->gsatype = (tvb_get_guint8(tvb, offset)>>4)&0x03; } proto_tree_add_item(tree, hf_scsi_osd_getsetattrib, tvb, offset, 1, ENC_BIG_ENDIAN); } static const value_string scsi_osd_timestamps_control_vals[] = { {0x00, "Timestamps shall be updated"}, {0x7f, "Timestamps shall not be updated"}, {0, NULL}, }; /* OSD2 5.2.8 */ static void dissect_osd_timestamps_control(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_timestamps_control, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_osd_formatted_capacity(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_formatted_capacity, tvb, offset, 8, ENC_BIG_ENDIAN); } static void dissect_osd_offset(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int field, guint32 *raw_value_ptr, gboolean osd2) { /* dissects an OSD offset value, add proto item and updates *raw_value_ptr */ guint32 value = *raw_value_ptr; if (value != 0xFFFFFFFF) { if (!osd2) { /*OSD-1: the exponent is an unsigned value (4.12.5)*/ value = (value & 0x0fffffff) << ((value>>28) & 0x0f); value <<= 8; } else { /*OSD-2: the exponent is a signed value (4.15.5)*/ int exponent = (value>>28); guint32 mantissa = (value&0x0FFFFFFF); if (exponent&0x8) { exponent = -(((~exponent)&7)+1); if (exponent <=- 6 && mantissa != 0xFFFFFFF) { proto_item *item; item = proto_tree_add_uint(tree, field, tvb, offset, 4, value); expert_add_info(pinfo, item, &ei_osd2_invalid_offset); *raw_value_ptr = 0xFFFFFFFF; return; } } value = mantissa << (exponent+8); } } proto_tree_add_uint(tree, field, tvb, offset, 4, value); *raw_value_ptr = value; } static int dissect_osd_attribute_parameters(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *parent_tree, scsi_task_data_t *cdata) { guint8 gsatype = 0; proto_tree *tree; scsi_osd_extra_data_t *extra_data = NULL; gboolean osd2; tree = proto_tree_add_subtree(parent_tree, tvb, offset, 28, ett_osd_attribute_parameters, NULL, "Attribute Parameters"); if (cdata && cdata->itlq && cdata->itlq->extra_data) { extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; gsatype = extra_data->gsatype; osd2 = extra_data->osd2; } else { return offset; } switch (gsatype) { case 1: /* OSD-2 5.2.6.2 Set one attribute using CDB fields*/ if (osd2) { proto_tree_add_item(tree, hf_scsi_osd_set_attributes_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attribute_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attribute_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd2_set_attribute_value, tvb, offset, 18, ENC_NA); offset += 18; } break; case 2: /* 5.2.2.2 attribute page */ proto_tree_add_item(tree, hf_scsi_osd_get_attributes_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_get_attributes_allocation_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_retrieved_attributes_offset, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attributes_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attribute_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attribute_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attributes_offset, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 3: /* 5.2.2.3 attribute list */ proto_tree_add_item(tree, hf_scsi_osd_get_attributes_list_length, tvb, offset, 4, ENC_BIG_ENDIAN); extra_data->u.al.get_list_length = tvb_get_ntohl(tvb, offset); offset += 4; /* 4.12.5 */ extra_data->u.al.get_list_offset = tvb_get_ntohl(tvb, offset); dissect_osd_offset(pinfo, tvb, offset, tree, hf_scsi_osd_get_attributes_list_offset, &extra_data->u.al.get_list_offset, osd2); if (extra_data->u.al.get_list_offset == 0xFFFFFFFF) { extra_data->u.al.get_list_length = 0; } offset += 4; proto_tree_add_item(tree, hf_scsi_osd_get_attributes_allocation_length, tvb, offset, 4, ENC_BIG_ENDIAN); extra_data->u.al.get_list_allocation_length = tvb_get_ntohl(tvb, offset); offset += 4; /* 4.12.5 */ extra_data->u.al.retrieved_list_offset = tvb_get_ntohl(tvb, offset); dissect_osd_offset(pinfo, tvb, offset, tree, hf_scsi_osd_retrieved_attributes_offset, &extra_data->u.al.retrieved_list_offset, osd2); if (extra_data->u.al.retrieved_list_offset == 0xFFFFFFFF) { extra_data->u.al.get_list_allocation_length = 0; } offset += 4; proto_tree_add_item(tree, hf_scsi_osd_set_attributes_list_length, tvb, offset, 4, ENC_BIG_ENDIAN); extra_data->u.al.set_list_length = tvb_get_ntohl(tvb, offset); offset += 4; extra_data->u.al.set_list_offset = tvb_get_ntohl(tvb, offset); dissect_osd_offset(pinfo, tvb, offset, tree, hf_scsi_osd_set_attributes_list_offset, &extra_data->u.al.set_list_offset, osd2); if (extra_data->u.al.set_list_offset == 0xFFFFFFFF) { extra_data->u.al.set_list_length = 0; } offset += 4; /* 4 reserved bytes */ offset += 4; break; } return offset; } static void dissect_osd_attribute_data_out(packet_info *pinfo, tvbuff_t *tvb, int offset _U_, proto_tree *tree, scsi_task_data_t *cdata, scsi_osd_lun_info_t *lun_info) { guint8 gsatype = 0; proto_tree *subtree; scsi_osd_extra_data_t *extra_data = NULL; if (cdata && cdata->itlq && cdata->itlq->extra_data) { extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; gsatype = extra_data->gsatype; } else { return; } switch (gsatype) { case 2: /* 5.2.2.2 attribute page */ /*qqq*/ break; case 3: /* 5.2.2.3 attribute list */ if (extra_data->u.al.get_list_length) { subtree = proto_tree_add_subtree(tree, tvb, extra_data->u.al.get_list_offset, extra_data->u.al.get_list_length, ett_osd_get_attributes, NULL, "Get Attributes Segment"); dissect_osd_attributes_list(pinfo, tvb, extra_data->u.al.get_list_offset, subtree, lun_info, extra_data->osd2); } if (extra_data->u.al.set_list_length) { subtree = proto_tree_add_subtree(tree, tvb, extra_data->u.al.set_list_offset, extra_data->u.al.set_list_length, ett_osd_get_attributes, NULL, "Set Attributes Segment"); dissect_osd_attributes_list(pinfo, tvb, extra_data->u.al.set_list_offset, subtree, lun_info, extra_data->osd2); } break; } } static void dissect_osd_attribute_data_in(packet_info *pinfo, tvbuff_t *tvb, int offset _U_, proto_tree *tree, scsi_task_data_t *cdata, scsi_osd_lun_info_t *lun_info) { guint8 gsatype = 0; scsi_osd_extra_data_t *extra_data = NULL; if (cdata && cdata->itlq && cdata->itlq->extra_data) { extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; gsatype = extra_data->gsatype; } else { return; } switch (gsatype) { case 2: /* 5.2.2.2 attribute page */ /*qqq*/ break; case 3: /* 5.2.2.3 attribute list */ if (extra_data->u.al.get_list_allocation_length) { dissect_osd_attributes_list(pinfo, tvb, extra_data->u.al.retrieved_list_offset, tree, lun_info, extra_data->osd2); } break; } } static void dissect_osd2_cdb_continuation_length(packet_info *pinfo, tvbuff_t *tvb, guint32 offset, proto_tree *tree, scsi_task_data_t *cdata) { scsi_osd_extra_data_t *extra_data; guint32 continuation_length; proto_item *item; continuation_length = tvb_get_ntohl(tvb, offset); item = proto_tree_add_item(tree, hf_scsi_osd2_cdb_continuation_length, tvb, offset, 4, ENC_BIG_ENDIAN); if (cdata && cdata->itlq && cdata->itlq->extra_data) { extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; extra_data->continuation_length = continuation_length; } if (continuation_length>0 && continuation_length<40) { expert_add_info(pinfo, item, &ei_osd2_cdb_continuation_length_invalid); } } static void dissect_osd2_query_list_descriptor(packet_info *pinfo, tvbuff_t *tvb, guint32 offset, proto_tree *tree, guint32 length) { guint32 end = offset+length; /* query type */ proto_tree_add_item(tree, hf_scsi_osd2_query_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 3 reserved bytes */ offset += 3; /*query criteria entry*/ while (offset<end) { guint32 page, number; guint32 min_value_length, max_value_length; guint32 min_value_offset, max_value_offset; proto_item *item; const attribute_page_numbers_t *apn; /* 2 reserved bytes */ offset += 2; /* query entry length */ proto_tree_add_item(tree, hf_scsi_osd2_query_entry_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* query attributes page */ page = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_scsi_osd2_query_attributes_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* query attributes number */ number = tvb_get_ntohl(tvb, offset); item = proto_tree_add_item(tree, hf_scsi_osd2_query_attribute_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; apn = osd_lookup_attribute(page, number); if (!apn) { expert_add_info(pinfo, item, &ei_osd_attr_unknown); proto_item_append_text(item, " (Unknown)"); } else { proto_item_append_text(item, " (%s)", apn->name); } /* query minimum attribute value length */ proto_tree_add_item(tree, hf_scsi_osd2_query_minimum_attribute_value_length, tvb, offset, 2, ENC_BIG_ENDIAN); min_value_length = tvb_get_ntohs(tvb, offset); offset += 2; /* query minimum attribute value */ /* if (apn && min_value_length) { call_apn_dissector(tvb, pinfo, tree, lun_info, apn, offset, min_value_length); } */ max_value_offset = offset; offset += min_value_length; /* query maximum attribute value length */ item = proto_tree_add_item(tree, hf_scsi_osd2_query_maximum_attribute_value_length, tvb, offset, 2, ENC_BIG_ENDIAN); max_value_length = tvb_get_ntohs(tvb, offset); offset += 2; /* xxx query maximum attribute value */ /* if (apn && max_value_length) { call_apn_dissector(tvb, pinfo, tree, lun_info, apn, offset, max_value_length); } */ min_value_offset = offset; offset += max_value_length; /* test if min and max values are equal */ if (max_value_length == min_value_length) { unsigned int i; for (i=0; i<max_value_length; i++) { if (tvb_get_guint8(tvb, max_value_offset+i) != tvb_get_guint8(tvb, min_value_offset+i)) return; } expert_add_info(pinfo, item, &ei_osd2_query_values_equal); } } } static void dissect_osd2_cdb_continuation(packet_info *pinfo, tvbuff_t *tvb, guint32 offset, proto_tree *tree, scsi_task_data_t *cdata) { scsi_osd_extra_data_t *extra_data = NULL; proto_item *item; guint8 format; guint16 sa; if (cdata && cdata->itlq && cdata->itlq->extra_data) { extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; } if (!extra_data || extra_data->continuation_length<40) return; /* cdb continuation format */ item = proto_tree_add_item(tree, hf_scsi_osd2_cdb_continuation_format, tvb, offset, 1, ENC_BIG_ENDIAN); format = tvb_get_guint8(tvb, offset); if (format != 0x01) { expert_add_info(pinfo, item, &ei_osd2_cdb_continuation_format_unknown); return; } offset += 1; /* 1 reserved byte */ offset += 1; /* continued service action */ item = proto_tree_add_item(tree, hf_scsi_osd2_continued_service_action, tvb, offset, 2, ENC_BIG_ENDIAN); sa = tvb_get_ntohs(tvb, offset); if (sa != extra_data->svcaction) { expert_add_info(pinfo, item, &ei_osd2_continued_service_action_mismatch); } offset += 2; /*4 reserved bytes and continuation integrity check value (32 bytes, not dissected)*/ offset += 36; /* CDB continuation descriptors */ while (offset<extra_data->continuation_length) { guint16 type; guint32 length, padlen; proto_item *item_type, *item_length; /* descriptor type */ item_type= proto_tree_add_item(tree, hf_scsi_osd2_cdb_continuation_descriptor_type, tvb, offset, 2, ENC_BIG_ENDIAN); type = tvb_get_ntohs(tvb, offset); offset += 2; /* 1 reserved byte*/ offset += 1; /* descriptor pad length */ proto_tree_add_item(tree, hf_scsi_osd2_cdb_continuation_descriptor_pad_length, tvb, offset, 1, ENC_BIG_ENDIAN); padlen = tvb_get_guint8(tvb, offset)&7; offset += 1; /* descriptor length */ item_length = proto_tree_add_item(tree, hf_scsi_osd2_cdb_continuation_descriptor_length, tvb, offset, 4, ENC_BIG_ENDIAN); length = tvb_get_ntohl(tvb, offset); offset += 4; switch (type) { case 0x0000: break; case 0x0001: break; case 0x0002: dissect_osd2_query_list_descriptor(pinfo, tvb, offset, tree, length); case 0x0100: break; case 0x0101: break; case 0xFFEE: break; default: expert_add_info(pinfo, item_type, &ei_osd2_cdb_continuation_descriptor_type_unknown); } if ((length+padlen)%8) { expert_add_info(pinfo, item_length, &ei_osd2_cdb_continuation_descriptor_length_invalid); return; } /* check for overflow */ if (offset + length + padlen > offset) { offset += length+padlen; } } } static const value_string scsi_osd_capability_format_vals[] = { {0x00, "No Capability"}, {0x01, "SCSI OSD Capabilities"}, {0, NULL}, }; static const value_string scsi_osd_object_type_vals[] = { {0x01, "ROOT"}, {0x02, "PARTITION"}, {0x40, "COLLECTION"}, {0x80, "USER"}, {0, NULL}, }; static const value_string scsi_osd_object_descriptor_type_vals[] = { {0, "NONE: the object descriptor field shall be ignored"}, {1, "U/C: a single collection or user object"}, {2, "PAR: a single partition, including partition zero"}, {0, NULL}, }; /* OSD 4.9.2.2.1 */ static void dissect_osd_permissions(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { proto_tree *tree = NULL; proto_item *it = NULL; guint16 permissions; permissions = tvb_get_ntohs(tvb, offset); if (parent_tree) { it = proto_tree_add_item(parent_tree, hf_scsi_osd_permissions, tvb, offset, 2, ENC_BIG_ENDIAN); tree = proto_item_add_subtree(it, ett_osd_permission_bitmask); } proto_tree_add_item(tree, hf_scsi_osd_permissions_read, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x8000) { proto_item_append_text(tree, " READ"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_write, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x4000) { proto_item_append_text(tree, " WRITE"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_get_attr, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x2000) { proto_item_append_text(tree, " GET_ATTR"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_set_attr, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x1000) { proto_item_append_text(tree, " SET_ATTR"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_create, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0800) { proto_item_append_text(tree, " CREATE"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_remove, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0400) { proto_item_append_text(tree, " REMOVE"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_obj_mgmt, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0200) { proto_item_append_text(tree, " OBJ_MGMT"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_append, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0100) { proto_item_append_text(tree, " APPEND"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_dev_mgmt, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0080) { proto_item_append_text(tree, " DEV_MGMT"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_global, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0040) { proto_item_append_text(tree, " GLOBAL"); } proto_tree_add_item(tree, hf_scsi_osd_permissions_pol_sec, tvb, offset, 2, ENC_BIG_ENDIAN); if (permissions&0x0020) { proto_item_append_text(tree, " POL/SEC"); } } /* OSD-1 4.9.2.2 OSD-2 4.11.2.2 */ static void dissect_osd_capability(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { proto_tree *tree; guint8 format; tree = proto_tree_add_subtree(parent_tree, tvb, offset, 80, ett_osd_capability, NULL, "Capability"); /* capability format */ proto_tree_add_item(tree, hf_scsi_osd_capability_format, tvb, offset, 1, ENC_BIG_ENDIAN); format = tvb_get_guint8(tvb, offset)&0x0F; offset += 1; if (format != 1) return; /* key version and icva */ proto_tree_add_item(tree, hf_scsi_osd_key_version, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_osd_icva, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* security method */ proto_tree_add_item(tree, hf_scsi_osd_security_method, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* a reserved byte */ offset += 1; /* capability expiration time */ proto_tree_add_item(tree, hf_scsi_osd_capability_expiration_time, tvb, offset, 6, ENC_NA); offset += 6; /* audit */ proto_tree_add_item(tree, hf_scsi_osd_audit, tvb, offset, 20, ENC_NA); offset += 20; /* capability discriminator */ proto_tree_add_item(tree, hf_scsi_osd_capability_discriminator, tvb, offset, 12, ENC_NA); offset += 12; /* object created time */ proto_tree_add_item(tree, hf_scsi_osd_object_created_time, tvb, offset, 6, ENC_NA); offset += 6; /* object type */ proto_tree_add_item(tree, hf_scsi_osd_object_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* permission bitmask */ dissect_osd_permissions(tvb, offset, tree); offset += 5; /* a reserved byte */ offset += 1; /* object descriptor type */ proto_tree_add_item(tree, hf_scsi_osd_object_descriptor_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* object descriptor */ proto_tree_add_item(tree, hf_scsi_osd_object_descriptor, tvb, offset, 24, ENC_NA); /*offset += 24;*/ return; } /* 5.2.6 */ static int dissect_osd_security_parameters(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { proto_tree *tree; tree = proto_tree_add_subtree(parent_tree, tvb, offset, 40, ett_osd_security_parameters, NULL, "Security Parameters"); /* request integrity check value */ proto_tree_add_item(tree, hf_scsi_osd_ricv, tvb, offset, 20, ENC_NA); offset += 20; /* request nonce */ proto_tree_add_item(tree, hf_scsi_osd_request_nonce, tvb, offset, 12, ENC_NA); offset += 12; /* data in integrity check value offset */ proto_tree_add_item(tree, hf_scsi_osd_diicvo, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* data out integrity check value offset */ proto_tree_add_item(tree, hf_scsi_osd_doicvo, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } static void dissect_osd_format_osd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info _U_) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 23 reserved bytes */ offset += 23; /* formatted capacity */ dissect_osd_formatted_capacity(tvb, offset, tree); offset += 8; /* 8 reserved bytes */ offset += 8; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for format osd */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for format osd */ } } static proto_item* dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int hf_index, scsi_osd_lun_info_t *lun_info, gboolean is_created, gboolean is_removed) { proto_item *item = NULL; guint32 partition_id[2]; /* partition id */ item = proto_tree_add_item(tree, hf_index, tvb, offset, 8, ENC_BIG_ENDIAN); partition_id[0] = tvb_get_ntohl(tvb, offset); partition_id[1] = tvb_get_ntohl(tvb, offset+4); if (!partition_id[0] && !partition_id[1]) { proto_item_append_text(item, " (ROOT partition)"); } else { partition_info_t *part_info; wmem_tree_key_t pikey[2]; proto_tree *partition_tree = NULL; pikey[0].length = 2; pikey[0].key = partition_id; pikey[1].length = 0; part_info = (partition_info_t *)wmem_tree_lookup32_array(lun_info->partitions, &pikey[0]); if (!part_info) { part_info = wmem_new(wmem_file_scope(), partition_info_t); part_info->created_in = 0; part_info->removed_in = 0; pikey[0].length = 2; pikey[0].key = partition_id; pikey[1].length = 0; wmem_tree_insert32_array(lun_info->partitions, &pikey[0], part_info); } if (is_created) { part_info->created_in = pinfo->num; } if (is_removed) { part_info->removed_in = pinfo->num; } if (item) { partition_tree = proto_item_add_subtree(item, ett_osd_partition); } if (part_info->created_in) { proto_item *tmp_item; tmp_item = proto_tree_add_uint(partition_tree, hf_scsi_osd_partition_created_in, tvb, 0, 0, part_info->created_in); proto_item_set_generated(tmp_item); } if (part_info->removed_in) { proto_item *tmp_item; tmp_item = proto_tree_add_uint(partition_tree, hf_scsi_osd_partition_removed_in, tvb, 0, 0, part_info->removed_in); proto_item_set_generated(tmp_item); } } return item; } static void dissect_osd_create_partition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { gboolean osd2 = ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->svcaction&0x80; ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = osd2; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ if (osd2) dissect_osd2_isolation(tvb, offset, tree); dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* requested partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_requested_partition_id, lun_info, TRUE, FALSE); offset += 8; /* 24 reserved bytes */ offset += 24; if (osd2) { dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); } else { /* 4 reserved bytes */ } offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += osd2?104:80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += osd2?52:40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* CDB continuation */ dissect_osd2_cdb_continuation(pinfo, tvb, offset, tree, cdata); /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for create partition */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for create partition */ } } static const value_string scsi_osd_sort_order_vals[] = { {0x00, "Ascending numeric value"}, {0, NULL}, }; static int dissect_osd_sortorder(tvbuff_t *tvb, int offset, proto_tree *tree) { /* sort order */ proto_tree_add_item(tree, hf_scsi_osd_sortorder, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static int dissect_osd_list_identifier(tvbuff_t *tvb, int offset, proto_tree *tree) { /* list identifier */ proto_tree_add_item(tree, hf_scsi_osd_list_identifier, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } static void dissect_osd_allocation_length(tvbuff_t *tvb, int offset, proto_tree *tree, scsi_task_data_t *cdata) { /* allocation length */ proto_tree_add_item(tree, hf_scsi_osd_allocation_length, tvb, offset, 8, ENC_BIG_ENDIAN); if (cdata) { guint64 alloc_len = tvb_get_ntoh64(tvb, offset); if (alloc_len>G_GINT64_CONSTANT(0xFFFFFFFF)) { alloc_len = G_GINT64_CONSTANT(0xFFFFFFFF); } cdata->itlq->alloc_len = (guint32)alloc_len; } } static int dissect_osd_initial_object_id(tvbuff_t *tvb, int offset, proto_tree *tree) { /* initial object id */ proto_tree_add_item(tree, hf_scsi_osd_initial_object_id, tvb, offset, 8, ENC_NA); offset += 8; return offset; } static int dissect_osd_additional_length(tvbuff_t *tvb, int offset, proto_tree *tree) { /* additional length */ proto_tree_add_item(tree, hf_scsi_osd_additional_length, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; return offset; } static int dissect_osd_continuation_object_id(tvbuff_t *tvb, int offset, proto_tree *tree) { /* continuation object id */ proto_tree_add_item(tree, hf_scsi_osd_continuation_object_id, tvb, offset, 8, ENC_NA); offset += 8; return offset; } static const true_false_string list_lstchg_tfs = { "List has CHANGED since the first List command", "List has NOT changed since first command" }; static const true_false_string list_root_tfs = { "Objects are from root and are PARTITION IDs", "Objects are from the partition and are USER OBJECTs" }; static const true_false_string list_coltn_tfs = { "Objects are from the partition and are COLLECTION IDs", "Objects are from the collection and are USER OBJECTs" }; static proto_item* dissect_osd_collection_object_id(tvbuff_t *tvb, int offset, proto_tree *tree, const int hfindex) { /* collection object id */ proto_item *item; item = proto_tree_add_item(tree, hfindex, tvb, offset, 8, ENC_NA); return item; } static void dissect_osd_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { guint svcaction = ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->svcaction; gboolean list_collection = (svcaction == 0x8817) || (svcaction == 0x8897); gboolean osd2 = svcaction&0x80; ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = osd2; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /*byte 10*/ if (osd2) dissect_osd2_isolation(tvb, offset, tree); offset += 1; /* getset attributes byte / sort order */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); if (!list_collection) dissect_osd_sortorder(tvb, offset, tree); if (osd2) dissect_osd2_list_attr(tvb, offset, tree); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; if (list_collection) { /* collection id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_collection_object_id); } else { /* 8 reserved bytes */ } offset += 8; if (osd2) { /* allocation length */ dissect_osd_allocation_length(tvb, offset, tree, cdata); offset += 8; /* initial object id */ dissect_osd_initial_object_id(tvb, offset, tree); offset += 8; /* list identifier */ dissect_osd_list_identifier(tvb, offset, tree); offset += 4; } else { /* list identifier */ dissect_osd_list_identifier(tvb, offset, tree); offset += 4; /* allocation length */ dissect_osd_allocation_length(tvb, offset, tree, cdata); offset += 8; /* initial object id */ dissect_osd_initial_object_id(tvb, offset, tree); offset += 8; } /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += osd2?104:80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += osd2?52:40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for LIST or LIST COLLECTION */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { guint64 additional_length; guint64 allocation_length; guint64 remaining_length; gboolean is_root_or_coltn; guint8 format = 0; /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); allocation_length = cdata->itlq->alloc_len; remaining_length = tvb_captured_length_remaining(tvb, offset); if (remaining_length<allocation_length) allocation_length = remaining_length; if (allocation_length<24) return; /* dissection of the LIST or LIST COLLECTION DATA-IN */ /* additional length */ additional_length = tvb_get_ntoh64(tvb, offset); if (allocation_length<additional_length) additional_length = allocation_length; dissect_osd_additional_length(tvb, offset, tree); offset += 8; /* continuation object id */ dissect_osd_continuation_object_id(tvb, offset, tree); offset += 8; /* list identifier */ dissect_osd_list_identifier(tvb, offset, tree); offset += 4; /* 3 reserved bytes */ offset += 3; /* OSD: LSTCHG and ROOT flags OSD2: LSTCHG and OBJECT DESCRIPTOR FORMAT*/ proto_tree_add_item(tree, hf_scsi_osd_list_flags_lstchg, tvb, offset, 1, ENC_BIG_ENDIAN); if (osd2) { proto_item *item; item = proto_tree_add_item(tree, hf_scsi_osd2_object_descriptor_format, tvb, offset, 1, ENC_BIG_ENDIAN); format = tvb_get_guint8(tvb, offset)>>2; if (format == 0x01 || format == 0x02) { is_root_or_coltn = TRUE; if (list_collection) format = 0; } else if (format == 0x11 || format == 0x12) { is_root_or_coltn = TRUE; if (!list_collection) format = 0; } else if (format == 0x21 || format == 0x22) { is_root_or_coltn = FALSE; } else format = 0; if (!format) { expert_add_info(pinfo, item, &ei_osd2_invalid_object_descriptor_format); return; } } else { if (list_collection) { proto_tree_add_item(tree, hf_scsi_osd_list_collection_flags_coltn, tvb, offset, 1, ENC_BIG_ENDIAN); } else { proto_tree_add_item(tree, hf_scsi_osd_list_flags_root, tvb, offset, 1, ENC_BIG_ENDIAN); } is_root_or_coltn = tvb_get_guint8(tvb, offset)&0x01; } offset += 1; while (additional_length > (offset-8)) { proto_item *ti; /* list of 8-byte IDs; the type of ID is given by is_root_or_coltn and list_collection*/ if (is_root_or_coltn) { if (list_collection) { ti = dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_collection_object_id); } else { ti = dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); } } else { ti = dissect_osd_user_object_id(tvb, offset, tree); } offset += 8; /* for OSD-2 if format is 0x02, 0x12 or 0x22: sub-list of attributes*/ if (osd2 && (format&0x02)) { guint32 attr_list_end; proto_tree *subtree; if (offset+8>additional_length) break; subtree = proto_item_add_subtree(ti, ett_osd_multi_object); /*object type*/ proto_tree_add_item(subtree, hf_scsi_osd_object_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 5 reserved bytes */ offset += 5; /* attribute list length*/ attr_list_end = offset+2+tvb_get_ntohs(tvb, offset); offset += 2; if (attr_list_end>additional_length+8) break; while (offset+16<attr_list_end) { guint32 attribute_length = tvb_get_ntohs(tvb, offset+14); proto_item *att_item; proto_tree *att_tree = proto_tree_add_subtree(subtree, tvb, offset, 16+attribute_length, ett_osd_attribute, &att_item, "Attribute:"); offset = dissect_osd_attribute_list_entry(pinfo, tvb, att_tree, att_item, offset, lun_info, TRUE); } offset = attr_list_end; } } } } static int dissect_osd_requested_user_object_id(tvbuff_t *tvb, int offset, proto_tree *tree) { /* request user object id */ proto_tree_add_item(tree, hf_scsi_osd_requested_user_object_id, tvb, offset, 8, ENC_NA); offset += 8; return offset; } static int dissect_osd_number_of_user_objects(tvbuff_t *tvb, int offset, proto_tree *tree) { /* number_of_user_objects */ proto_tree_add_item(tree, hf_scsi_osd_number_of_user_objects, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } static void dissect_osd_create(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* requested user_object id */ dissect_osd_requested_user_object_id(tvb, offset, tree); offset += 8; /* 4 reserved bytes */ offset += 4; /* number of user objects */ dissect_osd_number_of_user_objects(tvb, offset, tree); offset += 2; /* 14 reserved bytes */ offset += 14; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for create */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for create */ } } static void dissect_osd_remove_partition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { gboolean osd2 = ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->svcaction&0x80; ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = osd2; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ if (osd2) dissect_osd2_isolation(tvb, offset, tree); dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); if (osd2) proto_tree_add_item(tree, hf_scsi_osd2_remove_scope, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, TRUE); offset += 8; /* 24 reserved bytes */ offset += 24; if (osd2) { dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); } else { /* 4 reserved bytes */ } offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += osd2?104:80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += osd2?52:40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* CDB continuation */ dissect_osd2_cdb_continuation(pinfo, tvb, offset, tree, cdata); /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for remove partition */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for remove partition */ } } static const value_string key_to_set_vals[] = { {1, "Root"}, {2, "Partition"}, {3, "Working"}, {0, NULL}, }; static void dissect_osd_key_to_set(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_key_to_set, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_osd_set_key_version(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_set_key_version, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_osd_key_identifier(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_key_identifier, tvb, offset, 7, ENC_NA); } static void dissect_osd_seed(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_seed, tvb, offset, 20, ENC_NA); } static void dissect_osd_set_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* a reserved byte */ offset += 1; /* getset attributes byte and key to set*/ dissect_osd_getsetattrib(tvb, offset, tree, cdata); dissect_osd_key_to_set(tvb, offset, tree); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* key version */ dissect_osd_set_key_version(tvb, offset, tree); offset += 1; /* key identifier */ dissect_osd_key_identifier(tvb, offset, tree); offset += 7; /* seed */ dissect_osd_seed(tvb, offset, tree); offset += 20; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for set key */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for set key */ } } static void dissect_osd_remove(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 20 reserved bytes */ offset += 20; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for remove */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for remove */ } } static void dissect_osd_collection_fcr(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_osd_collection_fcr, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_osd_remove_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { gboolean osd2 = ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->svcaction&0x80; ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = osd2; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); dissect_osd_collection_fcr(tvb, offset, tree); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* collection object id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_collection_object_id); offset += 8; /* 16 reserved bytes */ offset += 16; if (osd2) { dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); } else { /* 4 reserved bytes */ } offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += osd2?104:80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += osd2?52:40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* CDB continuation */ dissect_osd2_cdb_continuation(pinfo, tvb, offset, tree, cdata); /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for remove collection */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for remove collection */ } } static int dissect_osd_length(tvbuff_t *tvb, int offset, proto_tree *tree) { /* length */ proto_tree_add_item(tree, hf_scsi_osd_length, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; return offset; } static int dissect_osd_starting_byte_address(tvbuff_t *tvb, int offset, proto_tree *tree) { /* starting_byte_address */ proto_tree_add_item(tree, hf_scsi_osd_starting_byte_address, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; return offset; } static void dissect_osd_write(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte / sort order */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 4 reserved bytes */ offset += 4; /* length */ dissect_osd_length(tvb, offset, tree); offset += 8; /* starting byte address */ dissect_osd_starting_byte_address(tvb, offset, tree); offset += 8; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* xxx should dissect the data ? */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for WRITE */ } } static void dissect_osd_create_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); dissect_osd_collection_fcr(tvb, offset, tree); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* requested collection object id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_requested_collection_object_id); offset += 8; /* 20 reserved bytes */ offset += 20; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for create collection */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for create collection */ } } static const value_string flush_scope_vals[] = { {0, "User object data and attributes"}, {1, "User object attributes only"}, {0, NULL} }; static int dissect_osd_flush_scope(tvbuff_t *tvb, int offset, proto_tree *tree) { /* flush scope */ proto_tree_add_item(tree, hf_scsi_osd_flush_scope, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static void dissect_osd_flush(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_flush_scope(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 20 reserved bytes */ offset += 20; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for flush */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for flush */ } } static const value_string flush_collection_scope_vals[] = { {0, "List of user objects contained in the collection"}, {1, "Collection attributes only"}, {2, "List of user objects and collection attributes"}, {0, NULL} }; static int dissect_osd_flush_collection_scope(tvbuff_t *tvb, int offset, proto_tree *tree) { /* flush collection scope */ proto_tree_add_item(tree, hf_scsi_osd_flush_collection_scope, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static void dissect_osd_flush_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_flush_collection_scope(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); dissect_osd_collection_fcr(tvb, offset, tree); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* collection object id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_collection_object_id); offset += 8; /* 20 reserved bytes */ offset += 20; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for flush collection */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for flush collection */ } } static void dissect_osd_append(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 4 reserved bytes */ offset += 4; /* length */ dissect_osd_length(tvb, offset, tree); offset += 8; /* 8 reserved bytes */ offset += 8; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* xxx should dissect the data ? */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for append */ } } static void dissect_osd_create_and_write(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* requested user_object id */ dissect_osd_requested_user_object_id(tvb, offset, tree); offset += 8; /* 4 reserved bytes */ offset += 4; /* length */ dissect_osd_length(tvb, offset, tree); offset += 8; /* starting byte address */ dissect_osd_starting_byte_address(tvb, offset, tree); offset += 8; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* should we dissect the data? */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for create and write*/ } } static const value_string flush_osd_scope_vals[] = { {0, "List of partitions contained in the OSD logical unit"}, {1, "Root object attributes only"}, {2, "Everything"}, {0, NULL} }; static int dissect_osd_flush_osd_scope(tvbuff_t *tvb, int offset, proto_tree *tree) { /* flush osd scope */ proto_tree_add_item(tree, hf_scsi_osd_flush_osd_scope, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static void dissect_osd_flush_osd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info _U_) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_flush_osd_scope(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 39 reserved bytes */ offset += 39; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for flush osd */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for flush osd */ } } static const value_string flush_partition_scope_vals[] = { {0, "List of user objects and collections in the partition"}, {1, "Partition attributes only"}, {2, "Everything"}, {0, NULL} }; static int dissect_osd_flush_partition_scope(tvbuff_t *tvb, int offset, proto_tree *tree) { /* flush partition scope */ proto_tree_add_item(tree, hf_scsi_osd_flush_partition_scope, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static void dissect_osd_flush_partition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_flush_partition_scope(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* 28 reserved bytes */ offset += 28; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for flush partition */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for flush partition */ } } static void dissect_osd_get_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { gboolean osd2 = ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->svcaction&0x80; ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = osd2; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user_object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 16 reserved bytes */ offset += 16; if (osd2) { dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); } else { /* 4 reserved bytes */ } offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += osd2?104:80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += osd2?52:40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for get attributes */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for get attributes */ } } static void dissect_osd_read(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte / sort order */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 4 reserved bytes */ offset += 4; /* length */ dissect_osd_length(tvb, offset, tree); offset += 8; /* starting byte address */ dissect_osd_starting_byte_address(tvb, offset, tree); offset += 8; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for READ */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* xxx should dissect the data ? */ } } static void dissect_osd_set_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { gboolean osd2 = ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->svcaction&0x80; ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = osd2; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partiton id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user_object id */ dissect_osd_user_object_id(tvb, offset, tree); offset += 8; /* 16 reserved bytes */ offset += 16; if (osd2) { dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); } else { /* 4 reserved bytes */ } offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += osd2?104:80; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += osd2?52:40; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for set attributes */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for set attributes */ } } static void dissect_osd2_create_user_tracking_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = TRUE; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* options byte */ dissect_osd2_isolation(tvb, offset, tree); dissect_osd_option(tvb, offset, tree); offset += 1; /* getset attributes byte */ dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partition id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* user_object id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_requested_collection_object_id); offset += 8; /* 8 reserved bytes */ offset += 8; /* source collection id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd2_source_collection_object_id); offset += 8; /*cdb continuation length*/ dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 104; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 52; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* CDB continuation */ dissect_osd2_cdb_continuation(pinfo, tvb, offset, tree, cdata); /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for create user tracking collection */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); /* no data in for create user tracking collection */ } } static void dissect_osd2_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_, scsi_osd_conv_info_t *conv_info _U_, scsi_osd_lun_info_t *lun_info) { ((scsi_osd_extra_data_t *)cdata->itlq->extra_data)->osd2 = TRUE; /* dissecting the CDB dissection starts at byte 10 of the CDB */ if (isreq && iscdb) { /* isolation field */ dissect_osd2_isolation(tvb, offset, tree); offset += 1; /* immed_tr, getset attributes*/ proto_tree_add_item(tree, hf_scsi_osd2_immed_tr, tvb, offset, 1, ENC_BIG_ENDIAN); dissect_osd_getsetattrib(tvb, offset, tree, cdata); offset += 1; /* timestamps control */ dissect_osd_timestamps_control(tvb, offset, tree); offset += 1; /* 3 reserved bytes */ offset += 3; /* partition id */ dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE); offset += 8; /* collection_object id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd_collection_object_id); offset += 8; /* allocation_length */ dissect_osd_allocation_length(tvb, offset, tree, cdata); offset += 8; /* matches collection id */ dissect_osd_collection_object_id(tvb, offset, tree, hf_scsi_osd2_matches_collection_object_id); offset += 8; /*cdb continuation length*/ dissect_osd2_cdb_continuation_length(pinfo, tvb, offset, tree, cdata); offset += 4; /* attribute parameters */ dissect_osd_attribute_parameters(pinfo, tvb, offset, tree, cdata); offset += 28; /* capability */ dissect_osd_capability(tvb, offset, tree); offset += 104; /* security parameters */ dissect_osd_security_parameters(tvb, offset, tree); offset += 52; } /* dissecting the DATA OUT */ if (isreq && !iscdb) { /* CDB continuation */ dissect_osd2_cdb_continuation(pinfo, tvb, offset, tree, cdata); /* attribute data out */ dissect_osd_attribute_data_out(pinfo, tvb, offset, tree, cdata, lun_info); /* no data out for query */ } /* dissecting the DATA IN */ if (!isreq && !iscdb) { guint64 additional_length; guint64 allocation_length; guint64 remaining_length; guint8 format; proto_item *item; /* attribute data in */ dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info); allocation_length = cdata->itlq->alloc_len; remaining_length = tvb_captured_length_remaining(tvb, offset); if (remaining_length<allocation_length) allocation_length = remaining_length; if (allocation_length<12) return; /* dissection of the LIST or LIST COLLECTION DATA-IN */ /* additional length */ additional_length = tvb_get_ntoh64(tvb, offset); if ((guint32)(allocation_length-8)<additional_length) additional_length = (guint32)(allocation_length-8); dissect_osd_additional_length(tvb, offset, tree); offset += 8; /* 3 reserved bytes */ offset += 3; item = proto_tree_add_item(tree, hf_scsi_osd2_object_descriptor_format, tvb, offset, 1, ENC_BIG_ENDIAN); format = tvb_get_guint8(tvb, offset)>>2; offset += 1; if (format != 0x21) { expert_add_info(pinfo, item, &ei_osd2_invalid_object_descriptor_format); return; } while (additional_length > (offset-4)) { dissect_osd_user_object_id(tvb, offset, tree); offset += 8; } } } /* OSD Service Actions */ #define OSD_FORMAT_OSD 0x8801 #define OSD_CREATE 0x8802 #define OSD_LIST 0x8803 #define OSD_READ 0x8805 #define OSD_WRITE 0x8806 #define OSD_APPEND 0x8807 #define OSD_FLUSH 0x8808 #define OSD_REMOVE 0x880a #define OSD_CREATE_PARTITION 0x880b #define OSD_REMOVE_PARTITION 0x880c #define OSD_GET_ATTRIBUTES 0x880e #define OSD_SET_ATTRIBUTES 0x880f #define OSD_CREATE_AND_WRITE 0x8812 #define OSD_CREATE_COLLECTION 0x8815 #define OSD_REMOVE_COLLECTION 0x8816 #define OSD_LIST_COLLECTION 0x8817 #define OSD_SET_KEY 0x8818 #define OSD_FLUSH_COLLECTION 0x881a #define OSD_FLUSH_PARTITION 0x881b #define OSD_FLUSH_OSD 0x881c #define OSD_2_CREATE 0x8882 #define OSD_2_LIST 0x8883 #define OSD_2_READ 0x8885 #define OSD_2_WRITE 0x8886 #define OSD_2_APPEND 0x8887 #define OSD_2_CLEAR 0x8889 #define OSD_2_REMOVE 0x888a #define OSD_2_CREATE_PARTITION 0x888b #define OSD_2_REMOVE_PARTITION 0x888c #define OSD_2_GET_ATTRIBUTES 0x888e #define OSD_2_SET_ATTRIBUTES 0x888f #define OSD_2_CREATE_AND_WRITE 0x8892 #define OSD_2_COPY_USER_OBJECTS 0x8893 #define OSD_2_CREATE_USER_TRACKING_COLLECTION 0x8894 #define OSD_2_REMOVE_COLLECTION 0x8896 #define OSD_2_LIST_COLLECTION 0x8897 #define OSD_2_QUERY 0x88a0 #define OSD_2_REMOVE_MEMBER_OBJECTS 0x88a1 #define OSD_2_GET_MEMBER_ATTRIBUTES 0x88a2 #define OSD_2_SET_MEMBER_ATTRIBUTES 0x88a3 static const value_string scsi_osd_svcaction_vals[] = { {OSD_FORMAT_OSD, "Format OSD"}, {OSD_CREATE, "Create"}, {OSD_LIST, "List"}, {OSD_READ, "Read"}, {OSD_WRITE, "Write"}, {OSD_APPEND, "Append"}, {OSD_FLUSH, "Flush"}, {OSD_REMOVE, "Remove"}, {OSD_CREATE_PARTITION, "Create Partition"}, {OSD_REMOVE_PARTITION, "Remove Partition"}, {OSD_GET_ATTRIBUTES, "Get Attributes"}, {OSD_SET_ATTRIBUTES, "Set Attributes"}, {OSD_CREATE_AND_WRITE, "Create And Write"}, {OSD_CREATE_COLLECTION, "Create Collection"}, {OSD_REMOVE_COLLECTION, "Remove Collection"}, {OSD_LIST_COLLECTION, "List Collection"}, {OSD_SET_KEY, "Set Key"}, {OSD_FLUSH_COLLECTION, "Flush Collection"}, {OSD_FLUSH_PARTITION, "Flush Partition"}, {OSD_FLUSH_OSD, "Flush OSD"}, {OSD_2_CREATE, "Create (OSD-2)"}, {OSD_2_LIST, "List (OSD-2)"}, {OSD_2_READ, "Read (OSD-2)"}, {OSD_2_WRITE, "Write (OSD-2)"}, {OSD_2_APPEND, "Append (OSD-2)"}, {OSD_2_CLEAR, "Clear (OSD-2)"}, {OSD_2_REMOVE, "Remove (OSD-2)"}, {OSD_2_CREATE_PARTITION, "Create Partition (OSD-2)"}, {OSD_2_REMOVE_PARTITION, "Remove Partition (OSD-2)"}, {OSD_2_GET_ATTRIBUTES, "Get Attributes (OSD-2)"}, {OSD_2_SET_ATTRIBUTES, "Set Attributes (OSD-2)"}, {OSD_2_CREATE_AND_WRITE, "Create And Write (OSD-2)"}, {OSD_2_COPY_USER_OBJECTS, "Copy User Objects (OSD-2)"}, {OSD_2_CREATE_USER_TRACKING_COLLECTION, "Create User Tracking Collection (OSD-2)"}, {OSD_2_REMOVE_COLLECTION, "Remove Collection (OSD-2)"}, {OSD_2_LIST_COLLECTION, "List Collection (OSD-2)"}, {OSD_2_QUERY, "Query (OSD-2)"}, {OSD_2_REMOVE_MEMBER_OBJECTS, "Remove Member Objects (OSD-2)"}, {OSD_2_GET_MEMBER_ATTRIBUTES, "Get Member Attributes (OSD-2)"}, {OSD_2_SET_MEMBER_ATTRIBUTES, "Set Member Attributes (OSD-2)"}, {0, NULL}, }; static value_string_ext scsi_osd_svcaction_vals_ext = VALUE_STRING_EXT_INIT(scsi_osd_svcaction_vals); /* OSD Service Action dissectors */ typedef struct _scsi_osd_svcaction_t { guint16 svcaction; scsi_osd_dissector_t dissector; } scsi_osd_svcaction_t; static const scsi_osd_svcaction_t scsi_osd_svcaction[] = { {OSD_FORMAT_OSD, dissect_osd_format_osd}, {OSD_CREATE, dissect_osd_create}, {OSD_LIST, dissect_osd_list}, {OSD_READ, dissect_osd_read}, {OSD_WRITE, dissect_osd_write}, {OSD_APPEND, dissect_osd_append}, {OSD_FLUSH, dissect_osd_flush}, {OSD_REMOVE, dissect_osd_remove}, {OSD_CREATE_PARTITION, dissect_osd_create_partition}, {OSD_REMOVE_PARTITION, dissect_osd_remove_partition}, {OSD_GET_ATTRIBUTES, dissect_osd_get_attributes}, {OSD_SET_ATTRIBUTES, dissect_osd_set_attributes}, {OSD_CREATE_AND_WRITE, dissect_osd_create_and_write}, {OSD_CREATE_COLLECTION, dissect_osd_create_collection}, {OSD_REMOVE_COLLECTION, dissect_osd_remove_collection}, {OSD_LIST_COLLECTION, dissect_osd_list}, {OSD_SET_KEY, dissect_osd_set_key}, {OSD_FLUSH_COLLECTION, dissect_osd_flush_collection}, {OSD_FLUSH_PARTITION, dissect_osd_flush_partition}, {OSD_FLUSH_OSD, dissect_osd_flush_osd}, {OSD_2_LIST, dissect_osd_list}, {OSD_2_CREATE_PARTITION, dissect_osd_create_partition}, {OSD_2_CREATE_USER_TRACKING_COLLECTION, dissect_osd2_create_user_tracking_collection}, {OSD_2_REMOVE_PARTITION, dissect_osd_remove_partition}, {OSD_2_LIST_COLLECTION, dissect_osd_list}, {OSD_2_CREATE_USER_TRACKING_COLLECTION, dissect_osd2_create_user_tracking_collection}, {OSD_2_REMOVE_COLLECTION, dissect_osd_remove_collection}, {OSD_2_GET_ATTRIBUTES, dissect_osd_get_attributes}, {OSD_2_SET_ATTRIBUTES, dissect_osd_set_attributes}, {OSD_2_QUERY, dissect_osd2_query}, {0, NULL}, }; static scsi_osd_dissector_t find_svcaction_dissector(guint16 svcaction) { const scsi_osd_svcaction_t *sa = scsi_osd_svcaction; while (sa && sa->dissector) { if (sa->svcaction == svcaction) { return sa->dissector; } sa++; } return NULL; } static void dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata) { guint16 svcaction = 0; scsi_osd_dissector_t dissector; scsi_osd_conv_info_t *conv_info; scsi_osd_lun_info_t *lun_info; if (!tree) { return; } /* We must have an itl an itlq and a conversation */ if (!cdata || !cdata->itl || !cdata->itl->conversation || !cdata->itlq) { return; } /* make sure we have a conversation info for this */ conv_info = (scsi_osd_conv_info_t *)conversation_get_proto_data(cdata->itl->conversation, proto_scsi_osd); if (!conv_info) { conv_info = wmem_new(wmem_file_scope(), scsi_osd_conv_info_t); conv_info->luns = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(cdata->itl->conversation, proto_scsi_osd, conv_info); } /* make sure we have a lun_info structure for this */ lun_info = (scsi_osd_lun_info_t *)wmem_tree_lookup32(conv_info->luns, cdata->itlq->lun); if (!lun_info) { lun_info = wmem_new(wmem_file_scope(), scsi_osd_lun_info_t); lun_info->partitions = wmem_tree_new(wmem_file_scope()); wmem_tree_insert32(conv_info->luns, cdata->itlq->lun, (void *)lun_info); } /* dissecting the CDB */ if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_control, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 5 reserved bytes */ offset += 5; proto_tree_add_item (tree, hf_scsi_osd_add_cdblen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; svcaction = tvb_get_ntohs(tvb, offset); if (cdata && cdata->itlq) { /* We must store the service action for this itlq * so we can identify what the data contains */ if ((!pinfo->fd->visited) || (!cdata->itlq->extra_data)) { scsi_osd_extra_data_t *extra_data; extra_data = wmem_new0(wmem_file_scope(), scsi_osd_extra_data_t); extra_data->svcaction = svcaction; cdata->itlq->extra_data = extra_data; } } proto_tree_add_item (tree, hf_scsi_osd_svcaction, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(svcaction, &scsi_osd_svcaction_vals_ext, "Unknown OSD Service Action")); dissector = find_svcaction_dissector(svcaction); if (dissector) { (*dissector)(tvb, pinfo, tree, offset, isreq, iscdb, payload_len, cdata, conv_info, lun_info); } return; } /* If it was not a CDB, try to find the service action and pass it * off to the service action dissector */ if (cdata && cdata->itlq && cdata->itlq->extra_data) { scsi_osd_extra_data_t *extra_data = (scsi_osd_extra_data_t *)cdata->itlq->extra_data; svcaction = extra_data->svcaction; } col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(svcaction, &scsi_osd_svcaction_vals_ext, "Unknown OSD Service Action")); if (svcaction) { proto_item *it; it = proto_tree_add_uint_format_value(tree, hf_scsi_osd_svcaction, tvb, 0, 0, svcaction, "0x%04x", svcaction); proto_item_set_generated(it); } dissector = find_svcaction_dissector(svcaction); if (dissector) { (*dissector)(tvb, pinfo, tree, offset, isreq, iscdb, payload_len, cdata, conv_info, lun_info); } } /* OSD Commands */ static const value_string scsi_osd_vals[] = { /* 0x12 */ {SCSI_SPC_INQUIRY, "Inquiry"}, /* 0x4C */ {SCSI_SPC_LOGSELECT, "Log Select"}, /* 0x4D */ {SCSI_SPC_LOGSENSE, "Log Sense"}, /* 0x55 */ {SCSI_SPC_MODESELECT10, "Mode Select(10)"}, /* 0x5A */ {SCSI_SPC_MODESENSE10, "Mode Sense(10)"}, /* 0x5E */ {SCSI_SPC_PERSRESVIN, "Persistent Reserve In"}, /* 0x5F */ {SCSI_SPC_PERSRESVOUT, "Persistent Reserve Out"}, /* 0x7f */ {SCSI_OSD_OPCODE, "OSD Command" }, /* 0xA0 */ {SCSI_SPC_REPORTLUNS, "Report LUNs"}, /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN, "Mgmt Protocol In"}, {0, NULL}, }; value_string_ext scsi_osd_vals_ext = VALUE_STRING_EXT_INIT(scsi_osd_vals); scsi_cdb_table_t scsi_osd_table[256] = { /*OSD 0x00*/{NULL}, /*OSD 0x01*/{NULL}, /*OSD 0x02*/{NULL}, /*OSD 0x03*/{NULL}, /*OSD 0x04*/{NULL}, /*OSD 0x05*/{NULL}, /*OSD 0x06*/{NULL}, /*OSD 0x07*/{NULL}, /*OSD 0x08*/{NULL}, /*OSD 0x09*/{NULL}, /*OSD 0x0a*/{NULL}, /*OSD 0x0b*/{NULL}, /*OSD 0x0c*/{NULL}, /*OSD 0x0d*/{NULL}, /*OSD 0x0e*/{NULL}, /*OSD 0x0f*/{NULL}, /*OSD 0x10*/{NULL}, /*OSD 0x11*/{NULL}, /*OSD 0x12*/{dissect_spc_inquiry}, /*OSD 0x13*/{NULL}, /*OSD 0x14*/{NULL}, /*OSD 0x15*/{NULL}, /*OSD 0x16*/{NULL}, /*OSD 0x17*/{NULL}, /*OSD 0x18*/{NULL}, /*OSD 0x19*/{NULL}, /*OSD 0x1a*/{NULL}, /*OSD 0x1b*/{NULL}, /*OSD 0x1c*/{NULL}, /*OSD 0x1d*/{NULL}, /*OSD 0x1e*/{NULL}, /*OSD 0x1f*/{NULL}, /*OSD 0x20*/{NULL}, /*OSD 0x21*/{NULL}, /*OSD 0x22*/{NULL}, /*OSD 0x23*/{NULL}, /*OSD 0x24*/{NULL}, /*OSD 0x25*/{NULL}, /*OSD 0x26*/{NULL}, /*OSD 0x27*/{NULL}, /*OSD 0x28*/{NULL}, /*OSD 0x29*/{NULL}, /*OSD 0x2a*/{NULL}, /*OSD 0x2b*/{NULL}, /*OSD 0x2c*/{NULL}, /*OSD 0x2d*/{NULL}, /*OSD 0x2e*/{NULL}, /*OSD 0x2f*/{NULL}, /*OSD 0x30*/{NULL}, /*OSD 0x31*/{NULL}, /*OSD 0x32*/{NULL}, /*OSD 0x33*/{NULL}, /*OSD 0x34*/{NULL}, /*OSD 0x35*/{NULL}, /*OSD 0x36*/{NULL}, /*OSD 0x37*/{NULL}, /*OSD 0x38*/{NULL}, /*OSD 0x39*/{NULL}, /*OSD 0x3a*/{NULL}, /*OSD 0x3b*/{NULL}, /*OSD 0x3c*/{NULL}, /*OSD 0x3d*/{NULL}, /*OSD 0x3e*/{NULL}, /*OSD 0x3f*/{NULL}, /*OSD 0x40*/{NULL}, /*OSD 0x41*/{NULL}, /*OSD 0x42*/{NULL}, /*OSD 0x43*/{NULL}, /*OSD 0x44*/{NULL}, /*OSD 0x45*/{NULL}, /*OSD 0x46*/{NULL}, /*OSD 0x47*/{NULL}, /*OSD 0x48*/{NULL}, /*OSD 0x49*/{NULL}, /*OSD 0x4a*/{NULL}, /*OSD 0x4b*/{NULL}, /*OSD 0x4c*/{dissect_spc_logselect}, /*OSD 0x4d*/{dissect_spc_logsense}, /*OSD 0x4e*/{NULL}, /*OSD 0x4f*/{NULL}, /*OSD 0x50*/{NULL}, /*OSD 0x51*/{NULL}, /*OSD 0x52*/{NULL}, /*OSD 0x53*/{NULL}, /*OSD 0x54*/{NULL}, /*OSD 0x55*/{dissect_spc_modeselect10}, /*OSD 0x56*/{NULL}, /*OSD 0x57*/{NULL}, /*OSD 0x58*/{NULL}, /*OSD 0x59*/{NULL}, /*OSD 0x5a*/{dissect_spc_modesense10}, /*OSD 0x5b*/{NULL}, /*OSD 0x5c*/{NULL}, /*OSD 0x5d*/{NULL}, /*OSD 0x5e*/{dissect_spc_persistentreservein}, /*OSD 0x5f*/{dissect_spc_persistentreserveout}, /*OSD 0x60*/{NULL}, /*OSD 0x61*/{NULL}, /*OSD 0x62*/{NULL}, /*OSD 0x63*/{NULL}, /*OSD 0x64*/{NULL}, /*OSD 0x65*/{NULL}, /*OSD 0x66*/{NULL}, /*OSD 0x67*/{NULL}, /*OSD 0x68*/{NULL}, /*OSD 0x69*/{NULL}, /*OSD 0x6a*/{NULL}, /*OSD 0x6b*/{NULL}, /*OSD 0x6c*/{NULL}, /*OSD 0x6d*/{NULL}, /*OSD 0x6e*/{NULL}, /*OSD 0x6f*/{NULL}, /*OSD 0x70*/{NULL}, /*OSD 0x71*/{NULL}, /*OSD 0x72*/{NULL}, /*OSD 0x73*/{NULL}, /*OSD 0x74*/{NULL}, /*OSD 0x75*/{NULL}, /*OSD 0x76*/{NULL}, /*OSD 0x77*/{NULL}, /*OSD 0x78*/{NULL}, /*OSD 0x79*/{NULL}, /*OSD 0x7a*/{NULL}, /*OSD 0x7b*/{NULL}, /*OSD 0x7c*/{NULL}, /*OSD 0x7d*/{NULL}, /*OSD 0x7e*/{NULL}, /*OSD 0x7f*/{dissect_osd_opcode}, /*OSD 0x80*/{NULL}, /*OSD 0x81*/{NULL}, /*OSD 0x82*/{NULL}, /*OSD 0x83*/{NULL}, /*OSD 0x84*/{NULL}, /*OSD 0x85*/{NULL}, /*OSD 0x86*/{NULL}, /*OSD 0x87*/{NULL}, /*OSD 0x88*/{NULL}, /*OSD 0x89*/{NULL}, /*OSD 0x8a*/{NULL}, /*OSD 0x8b*/{NULL}, /*OSD 0x8c*/{NULL}, /*OSD 0x8d*/{NULL}, /*OSD 0x8e*/{NULL}, /*OSD 0x8f*/{NULL}, /*OSD 0x90*/{NULL}, /*OSD 0x91*/{NULL}, /*OSD 0x92*/{NULL}, /*OSD 0x93*/{NULL}, /*OSD 0x94*/{NULL}, /*OSD 0x95*/{NULL}, /*OSD 0x96*/{NULL}, /*OSD 0x97*/{NULL}, /*OSD 0x98*/{NULL}, /*OSD 0x99*/{NULL}, /*OSD 0x9a*/{NULL}, /*OSD 0x9b*/{NULL}, /*OSD 0x9c*/{NULL}, /*OSD 0x9d*/{NULL}, /*OSD 0x9e*/{NULL}, /*OSD 0x9f*/{NULL}, /*OSD 0xa0*/{dissect_spc_reportluns}, /*OSD 0xa1*/{NULL}, /*OSD 0xa2*/{NULL}, /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in}, /*OSD 0xa4*/{NULL}, /*OSD 0xa5*/{NULL}, /*OSD 0xa6*/{NULL}, /*OSD 0xa7*/{NULL}, /*OSD 0xa8*/{NULL}, /*OSD 0xa9*/{NULL}, /*OSD 0xaa*/{NULL}, /*OSD 0xab*/{NULL}, /*OSD 0xac*/{NULL}, /*OSD 0xad*/{NULL}, /*OSD 0xae*/{NULL}, /*OSD 0xaf*/{NULL}, /*OSD 0xb0*/{NULL}, /*OSD 0xb1*/{NULL}, /*OSD 0xb2*/{NULL}, /*OSD 0xb3*/{NULL}, /*OSD 0xb4*/{NULL}, /*OSD 0xb5*/{NULL}, /*OSD 0xb6*/{NULL}, /*OSD 0xb7*/{NULL}, /*OSD 0xb8*/{NULL}, /*OSD 0xb9*/{NULL}, /*OSD 0xba*/{NULL}, /*OSD 0xbb*/{NULL}, /*OSD 0xbc*/{NULL}, /*OSD 0xbd*/{NULL}, /*OSD 0xbe*/{NULL}, /*OSD 0xbf*/{NULL}, /*OSD 0xc0*/{NULL}, /*OSD 0xc1*/{NULL}, /*OSD 0xc2*/{NULL}, /*OSD 0xc3*/{NULL}, /*OSD 0xc4*/{NULL}, /*OSD 0xc5*/{NULL}, /*OSD 0xc6*/{NULL}, /*OSD 0xc7*/{NULL}, /*OSD 0xc8*/{NULL}, /*OSD 0xc9*/{NULL}, /*OSD 0xca*/{NULL}, /*OSD 0xcb*/{NULL}, /*OSD 0xcc*/{NULL}, /*OSD 0xcd*/{NULL}, /*OSD 0xce*/{NULL}, /*OSD 0xcf*/{NULL}, /*OSD 0xd0*/{NULL}, /*OSD 0xd1*/{NULL}, /*OSD 0xd2*/{NULL}, /*OSD 0xd3*/{NULL}, /*OSD 0xd4*/{NULL}, /*OSD 0xd5*/{NULL}, /*OSD 0xd6*/{NULL}, /*OSD 0xd7*/{NULL}, /*OSD 0xd8*/{NULL}, /*OSD 0xd9*/{NULL}, /*OSD 0xda*/{NULL}, /*OSD 0xdb*/{NULL}, /*OSD 0xdc*/{NULL}, /*OSD 0xdd*/{NULL}, /*OSD 0xde*/{NULL}, /*OSD 0xdf*/{NULL}, /*OSD 0xe0*/{NULL}, /*OSD 0xe1*/{NULL}, /*OSD 0xe2*/{NULL}, /*OSD 0xe3*/{NULL}, /*OSD 0xe4*/{NULL}, /*OSD 0xe5*/{NULL}, /*OSD 0xe6*/{NULL}, /*OSD 0xe7*/{NULL}, /*OSD 0xe8*/{NULL}, /*OSD 0xe9*/{NULL}, /*OSD 0xea*/{NULL}, /*OSD 0xeb*/{NULL}, /*OSD 0xec*/{NULL}, /*OSD 0xed*/{NULL}, /*OSD 0xee*/{NULL}, /*OSD 0xef*/{NULL}, /*OSD 0xf0*/{NULL}, /*OSD 0xf1*/{NULL}, /*OSD 0xf2*/{NULL}, /*OSD 0xf3*/{NULL}, /*OSD 0xf4*/{NULL}, /*OSD 0xf5*/{NULL}, /*OSD 0xf6*/{NULL}, /*OSD 0xf7*/{NULL}, /*OSD 0xf8*/{NULL}, /*OSD 0xf9*/{NULL}, /*OSD 0xfa*/{NULL}, /*OSD 0xfb*/{NULL}, /*OSD 0xfc*/{NULL}, /*OSD 0xfd*/{NULL}, /*OSD 0xfe*/{NULL}, /*OSD 0xff*/{NULL} }; void proto_register_scsi_osd(void) { expert_module_t *expert_scsi_osd; static hf_register_info hf[] = { { &hf_scsi_osd_opcode, {"OSD Opcode", "scsi_osd.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_osd_vals_ext, 0x0, NULL, HFILL}}, { &hf_scsi_osd_add_cdblen, {"Additional CDB Length", "scsi_osd.addcdblen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_svcaction, {"Service Action", "scsi_osd.svcaction", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &scsi_osd_svcaction_vals_ext, 0x0, NULL, HFILL}}, { &hf_scsi_osd_option, {"Options Byte", "scsi_osd.option", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_option_dpo, {"DPO", "scsi_osd.option.dpo", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL}}, { &hf_scsi_osd_option_fua, {"FUA", "scsi_osd.option.fua", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL}}, { &hf_scsi_osd_getsetattrib, {"GET/SET CDBFMT", "scsi_osd.getset", FT_UINT8, BASE_HEX, VALS(scsi_osd_getsetattrib_vals), 0x30, NULL, HFILL}}, { &hf_scsi_osd_timestamps_control, {"Timestamps Control", "scsi_osd.timestamps_control", FT_UINT8, BASE_HEX, VALS(scsi_osd_timestamps_control_vals), 0x0, NULL, HFILL}}, { &hf_scsi_osd_formatted_capacity, {"Formatted Capacity", "scsi_osd.formatted_capacity", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_get_attributes_page, {"Get Attributes Page", "scsi_osd.get_attributes_page", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_get_attributes_list_length, {"Get Attributes List Length", "scsi_osd.get_attributes_list_length", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_get_attributes_list_offset, {"Get Attributes List Offset", "scsi_osd.get_attributes_list_offset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_set_attributes_list_length, {"Set Attributes List Length", "scsi_osd.set_attributes_list_length", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_set_attributes_list_offset, {"Set Attributes List Offset", "scsi_osd.set_attributes_list_offset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_get_attributes_allocation_length, {"Get Attributes Allocation Length", "scsi_osd.get_attributes_allocation_length", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_retrieved_attributes_offset, {"Retrieved Attributes Offset", "scsi_osd.retrieved_attributes_offset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_set_attributes_page, {"Set Attributes Page", "scsi_osd.set_attributes_page", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_set_attribute_length, {"Set Attribute Length", "scsi_osd.set_attribute_length", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_set_attribute_number, {"Set Attribute Number", "scsi_osd.set_attribute_number", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_set_attributes_offset, {"Set Attributes Offset", "scsi_osd.set_attributes_offset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_osd_capability_format, {"Capability Format", "scsi_osd.capability_format", FT_UINT8, BASE_HEX, VALS(scsi_osd_capability_format_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_osd_key_version, {"Key Version", "scsi_osd.key_version", FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}}, { &hf_scsi_osd_icva, {"Integrity Check Value Algorithm", "scsi_osd.icva", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_osd_security_method, {"Security Method", "scsi_osd.security_method", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_osd_capability_expiration_time, {"Capability Expiration Time", "scsi_osd.capability_expiration_time", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_audit, {"Audit", "scsi_osd.audit", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_capability_discriminator, {"Capability Discriminator", "scsi_osd.capability_discriminator", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_object_created_time, {"Object Created Time", "scsi_osd.object_created_time", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_object_type, {"Object Type", "scsi_osd.object_type", FT_UINT8, BASE_HEX, VALS(scsi_osd_object_type_vals), 0, NULL, HFILL}}, { &hf_scsi_osd_permissions, {"Permissions", "scsi_osd.permissions", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_permissions_read, {"READ", "scsi_osd.permissions.read", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x8000, NULL, HFILL}}, { &hf_scsi_osd_permissions_write, {"WRITE", "scsi_osd.permissions.write", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x4000, NULL, HFILL}}, { &hf_scsi_osd_permissions_get_attr, {"GET_ATTR", "scsi_osd.permissions.get_attr", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x2000, NULL, HFILL}}, { &hf_scsi_osd_permissions_set_attr, {"SET_ATTR", "scsi_osd.permissions.set_attr", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x1000, NULL, HFILL}}, { &hf_scsi_osd_permissions_create, {"CREATE", "scsi_osd.permissions.create", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0800, NULL, HFILL}}, { &hf_scsi_osd_permissions_remove, {"REMOVE", "scsi_osd.permissions.remove", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0400, NULL, HFILL}}, { &hf_scsi_osd_permissions_obj_mgmt, {"OBJ_MGMT", "scsi_osd.permissions.obj_mgmt", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0200, NULL, HFILL}}, { &hf_scsi_osd_permissions_append, {"APPEND", "scsi_osd.permissions.append", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0100, NULL, HFILL}}, { &hf_scsi_osd_permissions_dev_mgmt, {"DEV_MGMT", "scsi_osd.permissions.dev_mgmt", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0080, NULL, HFILL}}, { &hf_scsi_osd_permissions_global, {"GLOBAL", "scsi_osd.permissions.global", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0040, NULL, HFILL}}, { &hf_scsi_osd_permissions_pol_sec, {"POL/SEC", "scsi_osd.permissions.pol_sec", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0020, NULL, HFILL}}, { &hf_scsi_osd_object_descriptor_type, {"Object Descriptor Type", "scsi_osd.object_descriptor_type", FT_UINT8, BASE_HEX, VALS(scsi_osd_object_descriptor_type_vals), 0xf0, NULL, HFILL}}, { &hf_scsi_osd_object_descriptor, {"Object Descriptor", "scsi_osd.object_descriptor", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_ricv, {"Request Integrity Check value", "scsi_osd.ricv", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_request_nonce, {"Request Nonce", "scsi_osd.request_nonce", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_diicvo, {"Data-In Integrity Check Value Offset", "scsi_osd.diicvo", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_doicvo, {"Data-Out Integrity Check Value Offset", "scsi_osd.doicvo", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_requested_partition_id, {"Requested Partition Id", "scsi_osd.requested_partition_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_sortorder, {"Sort Order", "scsi_osd.sort_order", FT_UINT8, BASE_DEC, VALS(scsi_osd_sort_order_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_osd_partition_id, {"Partition Id", "scsi_osd.partition_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_list_identifier, {"List Identifier", "scsi_osd.list_identifier", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_allocation_length, {"Allocation Length", "scsi_osd.allocation_length", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_length, {"Length", "scsi_osd.length", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_starting_byte_address, {"Starting Byte Address", "scsi_osd.starting_byte_address", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_initial_object_id, {"Initial Object Id", "scsi_osd.initial_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_additional_length, {"Additional Length", "scsi_osd.additional_length", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_continuation_object_id, {"Continuation Object Id", "scsi_osd.continuation_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_user_object_id, {"User Object Id", "scsi_osd.user_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_list_flags_lstchg, {"LSTCHG", "scsi_osd.list.lstchg", FT_BOOLEAN, 8, TFS(&list_lstchg_tfs), 0x02, NULL, HFILL}}, { &hf_scsi_osd_list_flags_root, {"ROOT", "scsi_osd.list.root", FT_BOOLEAN, 8, TFS(&list_root_tfs), 0x01, NULL, HFILL}}, { &hf_scsi_osd_list_collection_flags_coltn, {"COLTN", "scsi_osd.list_collection.coltn", FT_BOOLEAN, 8, TFS(&list_coltn_tfs), 0x01, NULL, HFILL}}, { &hf_scsi_osd_requested_user_object_id, {"Requested User Object Id", "scsi_osd.requested_user_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_number_of_user_objects, {"Number Of User Objects", "scsi_osd.number_of_user_objects", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_key_to_set, {"Key to Set", "scsi_osd.key_to_set", FT_UINT8, BASE_DEC, VALS(key_to_set_vals), 0x03, NULL, HFILL}}, { &hf_scsi_osd_set_key_version, {"Key Version", "scsi_osd.set_key_version", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_osd_key_identifier, {"Key Identifier", "scsi_osd.key_identifier", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_seed, {"Seed", "scsi_osd.seed", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_collection_fcr, {"FCR", "scsi_osd.collection.fcr", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL}}, { &hf_scsi_osd_collection_object_id, {"Collection Object Id", "scsi_osd.collection_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_requested_collection_object_id, {"Requested Collection Object Id", "scsi_osd.requested_collection_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_partition_created_in, { "Created In", "scsi_osd.partition.created_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The frame this partition was created", HFILL }}, { &hf_scsi_osd_partition_removed_in, { "Removed In", "scsi_osd.partition.removed_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The frame this partition was removed", HFILL }}, { &hf_scsi_osd_flush_scope, {"Flush Scope", "scsi_osd.flush.scope", FT_UINT8, BASE_DEC, VALS(flush_scope_vals), 0x03, NULL, HFILL}}, { &hf_scsi_osd_flush_collection_scope, {"Flush Collection Scope", "scsi_osd.flush_collection.scope", FT_UINT8, BASE_DEC, VALS(flush_collection_scope_vals), 0x03, NULL, HFILL}}, { &hf_scsi_osd_flush_partition_scope, {"Flush Partition Scope", "scsi_osd.flush_partition.scope", FT_UINT8, BASE_DEC, VALS(flush_partition_scope_vals), 0x03, NULL, HFILL}}, { &hf_scsi_osd_flush_osd_scope, {"Flush OSD Scope", "scsi_osd.flush_osd.scope", FT_UINT8, BASE_DEC, VALS(flush_osd_scope_vals), 0x03, NULL, HFILL}}, { &hf_scsi_osd_attributes_list_type, {"Attributes List Type", "scsi_osd.attributes_list.type", FT_UINT8, BASE_HEX, VALS(attributes_list_type_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_osd_attributes_list_length, {"Attributes List Length", "scsi_osd.attributes_list.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_attributes_page, {"Attributes Page", "scsi_osd.attributes.page", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &attributes_page_vals_ext, 0, NULL, HFILL}}, { &hf_scsi_osd_attribute_number, {"Attribute Number", "scsi_osd.attribute.number", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_attribute_length, {"Attribute Length", "scsi_osd.attribute.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_attributes_list_length, {"Attributes List Length", "scsi_osd2.attributes_list.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_attrval_user_object_logical_length, {"User Object Logical Length", "scsi_osd.user_object.logical_length", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_attrval_object_type, {"Object Type", "scsi_osd.attr.object_type", FT_UINT8, BASE_HEX, VALS(scsi_osd_object_type_vals), 0, NULL, HFILL}}, { &hf_scsi_osd_attrval_partition_id, {"Partition ID", "scsi_osd.attr.partition_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd_attrval_object_id, {"Object ID", "scsi_osd.attr.object_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_set_attribute_value, {"Set Attributes Value", "scsi_osd.set_attribute_value", FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL}}, { &hf_scsi_osd2_isolation, {"Isolation", "scsi_osd2.isolation", FT_UINT8, BASE_HEX, VALS(scsi_osd2_isolation_val), 0x0F, NULL, HFILL}}, { &hf_scsi_osd2_list_attr, {"LIST ATTR flag", "scsi_osd2.list_attr", FT_BOOLEAN, 8, 0, 0x40, NULL, HFILL}}, { &hf_scsi_osd2_object_descriptor_format, {"Object Descriptor Format", "scsi_osd2.object_descriptor_format", FT_UINT8, BASE_HEX, VALS(scsi_osd2_object_descriptor_format_val), 0xFC, NULL, HFILL}}, { &hf_scsi_osd2_immed_tr, {"Immed TR", "scsi_osd2.immed_tr", FT_UINT8, BASE_DEC, 0, 0x80, NULL, HFILL}}, { &hf_scsi_osd2_remove_scope, {"Remove scope", "scsi_osd2.remove_scope", FT_UINT8, BASE_HEX, VALS(scsi_osd2_remove_scope), 0x07, NULL, HFILL}}, { &hf_scsi_osd2_source_collection_object_id, {"Source Collection Object ID", "scsi_osd2.source_collection_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_matches_collection_object_id, {"Matches Collection Object ID", "scsi_osd2.matches_collection_object_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_cdb_continuation_length, {"CDB Continuation Length", "scsi_osd2.cdb_continuation.length", FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL}}, { &hf_scsi_osd2_cdb_continuation_format, {"CDB Continuation Format", "scsi_osd2.cdb_continuation.format", FT_UINT8, BASE_HEX, VALS(scsi_osd2_cdb_continuation_format_val), 0, NULL, HFILL}}, { &hf_scsi_osd2_continued_service_action, {"Continued Service Action", "scsi_osd2.cdb_continuation.sa", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_cdb_continuation_descriptor_type, {"Descriptor Type", "scsi_osd2.cdb_continuation.desc.type", FT_UINT16, BASE_HEX, VALS(scsi_osd2_cdb_continuation_descriptor_type_val), 0, NULL, HFILL}}, { &hf_scsi_osd2_cdb_continuation_descriptor_pad_length, {"Descriptor Pad Length", "scsi_osd2.cdb_continuation.desc.padlen", FT_UINT8, BASE_DEC, NULL, 0x7, NULL, HFILL}}, { &hf_scsi_osd2_cdb_continuation_descriptor_length, {"Descriptor Length", "scsi_osd2.cdb_continuation.desc.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_query_type, {"Query Type", "scsi_osd2.query.type", FT_UINT8, BASE_HEX, VALS(scsi_osd2_query_type_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_osd2_query_entry_length, {"Entry Length", "scsi_osd2.query.entry.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_query_attributes_page, {"Attributes Page", "scsi_osd2.query.entry.page", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &attributes_page_vals_ext, 0, NULL, HFILL}}, { &hf_scsi_osd2_query_attribute_number, {"Attribute Number", "scsi_osd2.query.entry.number", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_query_minimum_attribute_value_length, {"Minimum Attribute Value Length", "scsi_osd2.query.entry.min_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_osd2_query_maximum_attribute_value_length, {"Maximum Attribute Value Length", "scsi_osd2.query.entry.max_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_osd_option, &ett_osd_partition, &ett_osd_attribute_parameters, &ett_osd_capability, &ett_osd_permission_bitmask, &ett_osd_security_parameters, &ett_osd_get_attributes, &ett_osd_set_attributes, &ett_osd_multi_object, &ett_osd_attribute, &ett_osd2_query_criteria_entry, }; /* Setup expert info */ static ei_register_info ei[] = { { &ei_osd_attr_unknown, { "scsi_osd.attr_unknown", PI_UNDECODED, PI_NOTE, "Unknown attribute, cannot decode attribute value", EXPFILL }}, { &ei_osd2_invalid_offset, { "scsi_osd2.invalid_offset", PI_UNDECODED, PI_ERROR, "Invalid offset exponent", EXPFILL }}, { &ei_osd2_invalid_object_descriptor_format, { "scsi_osd2.object_descriptor_format.invalid", PI_UNDECODED, PI_ERROR, "Invalid list format", EXPFILL }}, { &ei_osd_unknown_attributes_list_type, { "scsi_osd.attributes_list.type.invalid", PI_UNDECODED, PI_ERROR, "Unknown attribute list type", EXPFILL }}, { &ei_osd2_cdb_continuation_format_unknown, { "scsi_osd2.cdb_continuation.format.unknown", PI_UNDECODED, PI_ERROR, "Unknown CDB Continuation Format", EXPFILL }}, { &ei_osd2_continued_service_action_mismatch, { "scsi_osd2.cdb_continuation.sa.mismatch", PI_PROTOCOL, PI_WARN, "CONTINUED SERVICE ACTION and SERVICE ACTION do not match", EXPFILL }}, { &ei_osd2_cdb_continuation_descriptor_type_unknown, { "scsi_osd2.cdb_continuation.desc.type.unknown", PI_UNDECODED, PI_WARN, "Unknown descriptor type", EXPFILL }}, { &ei_osd2_cdb_continuation_descriptor_length_invalid, { "scsi_osd2.cdb_continuation.desc.length.invalid", PI_PROTOCOL, PI_ERROR, "Invalid descriptor length (not a multiple of 8)", EXPFILL }}, { &ei_osd2_cdb_continuation_length_invalid, { "scsi_osd2.cdb_continuation.length.invalid", PI_PROTOCOL, PI_ERROR, "Invalid CDB continuation length", EXPFILL }}, { &ei_osd_attr_length_invalid, { "scsi_osd.attribute_length.invalid", PI_PROTOCOL, PI_ERROR, "Invalid Attribute Length", EXPFILL }}, { &ei_osd2_query_values_equal, { "scsi_osd2.query.entry.equal", PI_PROTOCOL, PI_NOTE, "The minimum and maximum values are equal", EXPFILL }}, }; /* Register the protocol name and description */ proto_scsi_osd = proto_register_protocol("SCSI_OSD", "SCSI_OSD", "scsi_osd"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_scsi_osd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register expert info */ expert_scsi_osd = expert_register_protocol(proto_scsi_osd); expert_register_field_array(expert_scsi_osd, ei, array_length(ei)); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-scsi-osd.h
/* packet-scsi-osd.h * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCSI_OSD_H_ #define __PACKET_SCSI_OSD_H_ #include "ws_symbol_export.h" #define SCSI_OSD_OPCODE 0x7f WS_DLL_PUBLIC value_string_ext attributes_page_vals_ext; typedef struct _scsi_osd_lun_info_t scsi_osd_lun_info_t; typedef struct _attribute_page_numbers_t attribute_page_numbers_t; typedef void (*attribute_dissector)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, scsi_osd_lun_info_t *lun_info, const attribute_page_numbers_t *att); struct _attribute_page_numbers_t { guint32 number; const char *name; attribute_dissector dissector; int* hf_index; guint expected_length; }; const attribute_page_numbers_t * osd_lookup_attribute(guint32 page, guint32 number); extern int hf_scsi_osd_opcode; extern scsi_cdb_table_t scsi_osd_table[256]; WS_DLL_PUBLIC value_string_ext scsi_osd_vals_ext; #endif
C
wireshark/epan/dissectors/packet-scsi-sbc.c
/* This dissector is based on the SBC2 specification. * TODO * parts of opcodes * 0x7f * 0xa3 * 0xa4 * 0x9e * are still missing. * Some DATA IN/OUT PDUs are missing as well. */ /* packet-scsi-sbc.c * Dissector for the SCSI SBC commandset * Extracted from packet-scsi.c * * Dinesh G Dutt ([email protected]) * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include "packet-scsi.h" #include "packet-scsi-sbc.h" void proto_register_scsi_sbc(void); static int proto_scsi_sbc = -1; int hf_scsi_sbc_opcode= -1; static int hf_scsi_sbc_service_action= -1; static int hf_scsi_sbc_formatunit_flags= -1; static int hf_scsi_sbc_defect_list_format= -1; static int hf_scsi_sbc_formatunit_vendor= -1; static int hf_scsi_sbc_formatunit_interleave= -1; static int hf_scsi_sbc_rdwr6_lba= -1; static int hf_scsi_sbc_rdwr6_xferlen= -1; static int hf_scsi_sbc_rdwr10_lba= -1; static int hf_scsi_sbc_rdwr10_xferlen= -1; static int hf_scsi_sbc_rdwr12_xferlen= -1; static int hf_scsi_sbc_rdwr16_lba= -1; static int hf_scsi_sbc_ssu_immed_flags= -1; static int hf_scsi_sbc_ssu_immed= -1; static int hf_scsi_sbc_ssu_pwr_flags= -1; static int hf_scsi_sbc_ssu_pwr_cond= -1; static int hf_scsi_sbc_ssu_loej= -1; static int hf_scsi_sbc_ssu_start= -1; static int hf_scsi_sbc_bytchk= -1; /* static int hf_scsi_sbc_verify_reladdr= -1; */ static int hf_scsi_sbc_verify_lba= -1; static int hf_scsi_sbc_verify_lba64= -1; static int hf_scsi_sbc_verify_vlen= -1; static int hf_scsi_sbc_verify_vlen32= -1; static int hf_scsi_sbc_wrverify_lba= -1; static int hf_scsi_sbc_wrverify_xferlen= -1; static int hf_scsi_sbc_wrverify_lba64= -1; static int hf_scsi_sbc_wrverify_xferlen32= -1; /* static int hf_scsi_sbc_readcapacity_flags= -1; */ static int hf_scsi_sbc_readdefdata_flags= -1; static int hf_scsi_sbc_reassignblks_flags= -1; static int hf_scsi_sbc_read_flags= -1; static int hf_scsi_sbc_alloclen32= -1; static int hf_scsi_sbc_alloclen16= -1; static int hf_scsi_sbc_lba64_address= -1; static int hf_scsi_sbc_fuflags_fmtpinfo= -1; static int hf_scsi_sbc_fuflags_rto_req= -1; static int hf_scsi_sbc_fuflags_longlist= -1; static int hf_scsi_sbc_fuflags_fmtdata= -1; static int hf_scsi_sbc_fuflags_cmplist= -1; static int hf_scsi_sbc_prefetch_flags= -1; static int hf_scsi_sbc_prefetch_immed= -1; static int hf_scsi_sbc_group= -1; static int hf_scsi_sbc_rdprotect= -1; static int hf_scsi_sbc_dpo= -1; static int hf_scsi_sbc_fua= -1; static int hf_scsi_sbc_fua_nv= -1; static int hf_scsi_sbc_blocksize= -1; static int hf_scsi_sbc_returned_lba= -1; static int hf_scsi_sbc_req_plist= -1; static int hf_scsi_sbc_req_glist= -1; static int hf_scsi_sbc_corrct_flags= -1; static int hf_scsi_sbc_corrct= -1; static int hf_scsi_sbc_reassignblocks_longlba= -1; static int hf_scsi_sbc_reassignblocks_longlist= -1; static int hf_scsi_sbc_synccache_flags= -1; static int hf_scsi_sbc_synccache_immed= -1; static int hf_scsi_sbc_synccache_sync_nv= -1; static int hf_scsi_sbc_vrprotect= -1; static int hf_scsi_sbc_verify_flags= -1; static int hf_scsi_sbc_wrprotect= -1; static int hf_scsi_sbc_wrverify_flags= -1; static int hf_scsi_sbc_writesame_flags= -1; static int hf_scsi_sbc_anchor= -1; static int hf_scsi_sbc_unmap= -1; static int hf_scsi_sbc_pbdata= -1; static int hf_scsi_sbc_lbdata= -1; static int hf_scsi_sbc_xdread_flags= -1; static int hf_scsi_sbc_xorpinfo= -1; static int hf_scsi_sbc_disable_write= -1; static int hf_scsi_sbc_xdwrite_flags= -1; static int hf_scsi_sbc_xdwriteread_flags= -1; static int hf_scsi_sbc_xpwrite_flags= -1; static int hf_scsi_sbc_unmap_flags= -1; static int hf_scsi_sbc_unmap_anchor= -1; static int hf_scsi_sbc_unmap_data_length= -1; static int hf_scsi_sbc_unmap_block_descriptor_data_length= -1; static int hf_scsi_sbc_unmap_lba= -1; static int hf_scsi_sbc_unmap_num_blocks= -1; static int hf_scsi_sbc_ptype= -1; static int hf_scsi_sbc_prot_en= -1; static int hf_scsi_sbc_p_i_exponent= -1; static int hf_scsi_sbc_lbppbe= -1; static int hf_scsi_sbc_lbpme= -1; static int hf_scsi_sbc_lbprz= -1; static int hf_scsi_sbc_lalba= -1; static int hf_scsi_sbc_get_lba_status_lba= -1; static int hf_scsi_sbc_get_lba_status_data_length= -1; static int hf_scsi_sbc_get_lba_status_num_blocks= -1; static int hf_scsi_sbc_get_lba_status_provisioning_status= -1; static int hf_scsi_sbc_sanitize_flags= -1; static int hf_scsi_sbc_sanitize_immed= -1; static int hf_scsi_sbc_sanitize_ause= -1; static int hf_scsi_sbc_sanitize_sa= -1; static int hf_scsi_sbc_sanitize_overwrite_flags= -1; static int hf_scsi_sbc_sanitize_invert= -1; static int hf_scsi_sbc_sanitize_test= -1; static int hf_scsi_sbc_sanitize_owcount= -1; static int hf_scsi_sbc_sanitize_pattern_length= -1; static int hf_scsi_sbc_sanitize_pattern= -1; static gint ett_scsi_format_unit= -1; static gint ett_scsi_prefetch= -1; static gint ett_scsi_rdwr= -1; static gint ett_scsi_xdread= -1; static gint ett_scsi_xdwrite= -1; static gint ett_scsi_xdwriteread= -1; static gint ett_scsi_xpwrite= -1; static gint ett_scsi_defectdata= -1; static gint ett_scsi_corrct= -1; static gint ett_scsi_reassign_blocks= -1; static gint ett_scsi_ssu_immed= -1; static gint ett_scsi_ssu_pwr= -1; static gint ett_scsi_synccache= -1; static gint ett_scsi_verify= -1; static gint ett_scsi_wrverify= -1; static gint ett_scsi_writesame= -1; static gint ett_scsi_unmap= -1; static gint ett_scsi_unmap_block_descriptor= -1; static gint ett_scsi_lba_status_descriptor= -1; static gint ett_scsi_sanitize= -1; static gint ett_scsi_sanitize_overwrite= -1; static const true_false_string dpo_tfs = { "Disable Page Out (don't cache this data)", "Disable page out is DISABLED (cache this data)" }; static const true_false_string fua_tfs = { "Read from the medium, not cache", "Read from cache if possible" }; static const true_false_string fua_nv_tfs = { "Read from volatile cache is NOT permitted", "Read from volatile or non-volatile cache permitted" }; #if 0 static const true_false_string pmi_tfs = { "PMI is SET", "Pmi is CLEAR" }; #endif static void dissect_sbc_formatunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const fuflags_fields[] = { &hf_scsi_sbc_fuflags_fmtpinfo, &hf_scsi_sbc_fuflags_rto_req, &hf_scsi_sbc_fuflags_longlist, &hf_scsi_sbc_fuflags_fmtdata, &hf_scsi_sbc_fuflags_cmplist, &hf_scsi_sbc_defect_list_format, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_formatunit_flags, ett_scsi_format_unit, fuflags_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_formatunit_vendor, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_formatunit_interleave, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } /* TODO : add dissection of DATA */ } static void dissect_sbc_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)", tvb_get_ntoh24 (tvb, offset), tvb_get_guint8 (tvb, offset+3)); } if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_lba, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_xferlen, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)", tvb_get_ntoh24 (tvb, offset), tvb_get_guint8 (tvb, offset+3)); } if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_lba, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_xferlen, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_prefetch10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const prefetch_fields[] = { &hf_scsi_sbc_prefetch_immed, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_prefetch_flags, ett_scsi_prefetch, prefetch_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_synchronizecache10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const sync_fields[] = { &hf_scsi_sbc_synccache_sync_nv, &hf_scsi_sbc_synccache_immed, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_synccache_flags, ett_scsi_synccache, sync_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_synchronizecache16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const sync_fields[] = { &hf_scsi_sbc_synccache_sync_nv, &hf_scsi_sbc_synccache_immed, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_synccache_flags, ett_scsi_synccache, sync_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_prefetch16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const prefetch_fields[] = { &hf_scsi_sbc_prefetch_immed, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_prefetch_flags, ett_scsi_prefetch, prefetch_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_sbc_read10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr10_fields[] = { &hf_scsi_sbc_rdprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_xdread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const xdread10_fields[] = { &hf_scsi_sbc_xorpinfo, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdread_flags, ett_scsi_xdread, xdread10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_xdwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const xdwrite10_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_disable_write, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdwrite_flags, ett_scsi_xdwrite, xdwrite10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_xdwriteread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const xdwriteread10_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_disable_write, &hf_scsi_sbc_fua_nv, &hf_scsi_sbc_xorpinfo, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdwriteread_flags, ett_scsi_xdwriteread, xdwriteread10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_xpwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const xpwrite10_fields[] = { &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, &hf_scsi_sbc_xorpinfo, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xpwrite_flags, ett_scsi_xpwrite, xpwrite10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_sbc_write10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr10_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_sbc_read12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr12_fields[] = { &hf_scsi_sbc_rdprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohl (tvb, offset+5)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr12_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+5, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_sbc_write12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr12_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohl (tvb, offset+5)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr12_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+5, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr16_fields[] = { &hf_scsi_sbc_rdprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr16_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_writeatomic16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr16_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohs (tvb, offset+11)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+11, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_orwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr16_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_comparenwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rdwr16_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_fua, &hf_scsi_sbc_fua_nv, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+12, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static const value_string scsi_ssu_pwrcnd_val[] = { {0x0, "No Change"}, {0x1, "Place Device In Active Condition"}, {0x2, "Place device into Idle condition"}, {0x3, "Place device into Standby condition"}, {0x4, "Reserved"}, {0x5, "Place device into Sleep condition"}, {0x6, "Reserved"}, {0x7, "Transfer control of power conditions to block device"}, {0x8, "Reserved"}, {0x9, "Reserved"}, {0xA, "Force Idle Condition Timer to zero"}, {0xB, "Force Standby Condition Timer to zero"}, {0, NULL}, }; static const value_string scsi_ptype_val[] = { {0x0, "Type 1 protection" }, {0x1, "Type 2 protection" }, {0x2, "Type 3 protection" }, {0, NULL}, }; static const value_string scsi_provisioning_type_val[] = { {0x0, "The LBA is MAPPED" }, {0x1, "The LBA is DEALLOCATED" }, {0x2, "The LBA is ANCHORED" }, {0, NULL}, }; void dissect_sbc_startstopunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq _U_, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const ssu_fields[] = { &hf_scsi_sbc_ssu_immed, NULL }; static int * const pwr_fields[] = { &hf_scsi_sbc_ssu_pwr_cond, &hf_scsi_sbc_ssu_loej, &hf_scsi_sbc_ssu_start, NULL }; if (!tree || !iscdb) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_ssu_immed_flags, ett_scsi_ssu_immed, ssu_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+3, hf_scsi_sbc_ssu_pwr_flags, ett_scsi_ssu_pwr, pwr_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_verify10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const verify10_fields[] = { &hf_scsi_sbc_vrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_bytchk, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags, ett_scsi_verify, verify10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_verify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_verify12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const verify12_fields[] = { &hf_scsi_sbc_vrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_bytchk, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohl (tvb, offset+5)); } if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags, ett_scsi_verify, verify12_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_verify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen32, tvb, offset+5, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const verify16_fields[] = { &hf_scsi_sbc_vrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_bytchk, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags, ett_scsi_verify, verify16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_verify_lba64, tvb, offset+1, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen32, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_wrverify10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const wrverify10_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_bytchk, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohs (tvb, offset+6)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags, ett_scsi_wrverify, wrverify10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_wrverify12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const wrverify12_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_bytchk, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)", tvb_get_ntohl (tvb, offset+1), tvb_get_ntohl (tvb, offset+5)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags, ett_scsi_wrverify, wrverify12_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen32, tvb, offset+5, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_wrverify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const wrverify16_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_dpo, &hf_scsi_sbc_bytchk, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags, ett_scsi_wrverify, wrverify16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba64, tvb, offset+1, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen32, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_sbc_readcapacity10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint32 len, block_len, tot_len; const char *un; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!iscdb) { len = tvb_get_ntohl (tvb, offset); block_len = tvb_get_ntohl (tvb, offset+4); tot_len=((len/1024)*block_len)/1024; /*MB*/ un="MB"; if(tot_len>20000){ tot_len/=1024; un="GB"; } proto_tree_add_uint_format (tree, hf_scsi_sbc_returned_lba, tvb, offset, 4, len, "LBA: %u (%u %s)", len, tot_len, un); proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+4, 4, ENC_BIG_ENDIAN); } } static void dissect_sbc_readdefectdata10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const defect_fields[] = { &hf_scsi_sbc_defect_list_format, &hf_scsi_sbc_req_plist, &hf_scsi_sbc_req_glist, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+1, hf_scsi_sbc_readdefdata_flags, ett_scsi_defectdata, defect_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } /* TODO : add dissection of DATA */ } static void dissect_sbc_readlong10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const corrct_fields[] = { &hf_scsi_sbc_corrct, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_corrct_flags, ett_scsi_corrct, corrct_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_writelong10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_writesame10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const writesame10_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_anchor, &hf_scsi_sbc_unmap, &hf_scsi_sbc_pbdata, &hf_scsi_sbc_lbdata, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_writesame_flags, ett_scsi_writesame, writesame10_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_writesame16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const writesame16_fields[] = { &hf_scsi_sbc_wrprotect, &hf_scsi_sbc_anchor, &hf_scsi_sbc_unmap, &hf_scsi_sbc_pbdata, &hf_scsi_sbc_lbdata, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_writesame_flags, ett_scsi_writesame, writesame16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA); proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_sbc_unmap (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const unmap_fields[] = { &hf_scsi_sbc_unmap_anchor, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_unmap_flags, ett_scsi_unmap, unmap_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (isreq) { proto_tree_add_item (tree, hf_scsi_sbc_unmap_data_length, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_unmap_block_descriptor_data_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); offset += 8; while (tvb_reported_length_remaining(tvb, offset) >=16) { proto_tree *tr; proto_item *it; gint64 lba; gint32 num_blocks; tr = proto_tree_add_subtree(tree, tvb, offset, 16, ett_scsi_unmap_block_descriptor, &it, "UNMAP Block Descriptor: LBA "); proto_tree_add_item (tr, hf_scsi_sbc_unmap_lba, tvb, offset, 8, ENC_BIG_ENDIAN); lba = tvb_get_ntoh64 (tvb, offset); proto_tree_add_item (tr, hf_scsi_sbc_unmap_num_blocks, tvb, offset+8, 4, ENC_BIG_ENDIAN); num_blocks = tvb_get_ntohl(tvb, offset+8); if (num_blocks > 1) { proto_item_append_text (it, "%" PRIu64 "-%" PRIu64 " ", lba, lba+num_blocks-1); } else { proto_item_append_text (it, "%" PRIu64 " ", lba); } offset += 16; } } } static const value_string sanitize_val[] = { {0x01, "OVERWRITE"}, {0x02, "BLOCK ERASE"}, {0x03, "CRYPTO ERASE"}, {0x1f, "EXIT FAILURE MODE"}, {0, NULL}, }; static void dissect_sbc_sanitize (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const sanitize_fields[] = { &hf_scsi_sbc_sanitize_immed, &hf_scsi_sbc_sanitize_ause, &hf_scsi_sbc_sanitize_sa, NULL }; static int * const sanitize_overwrite_fields[] = { &hf_scsi_sbc_sanitize_invert, &hf_scsi_sbc_sanitize_test, &hf_scsi_sbc_sanitize_owcount, NULL }; if (!tree) return; if (isreq && iscdb) { guint8 service_action; service_action = tvb_get_guint8 (tvb, offset) & 0x1F; col_append_str(pinfo->cinfo, COL_INFO, val_to_str(service_action, sanitize_val, "Unknown (0x%02x)")); proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_sanitize_flags, ett_scsi_sanitize, sanitize_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (isreq) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_sanitize_overwrite_flags, ett_scsi_sanitize_overwrite, sanitize_overwrite_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_sanitize_pattern_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_sanitize_pattern, tvb, offset+4, -1, ENC_NA); } } static void dissect_sbc_readdefectdata12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const defect_fields[] = { &hf_scsi_sbc_defect_list_format, &hf_scsi_sbc_req_plist, &hf_scsi_sbc_req_glist, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_readdefdata_flags, ett_scsi_defectdata, defect_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset+5, 4, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } /* TODO : add dissection of DATA */ } static void dissect_sbc_reassignblocks (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const reassign_fields[] = { &hf_scsi_sbc_reassignblocks_longlba, &hf_scsi_sbc_reassignblocks_longlist, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_reassignblks_flags, ett_scsi_reassign_blocks, reassign_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } /* TODO : add dissection of DATA */ } const value_string service_action_vals[] = { {SHORT_FORM_BLOCK_ID, "Short Form - Block ID"}, {SHORT_FORM_VENDOR_SPECIFIC, "Short Form - Vendor-Specific"}, {LONG_FORM, "Long Form"}, {EXTENDED_FORM, "Extended Form"}, {SERVICE_READ_CAPACITY16, "Read Capacity(16)"}, {SERVICE_READ_LONG16, "Read Long(16)"}, {SERVICE_GET_LBA_STATUS, "Get LBA Status"}, {SERVICE_REPORT_REFERRALS, "Report Referrals"}, {0, NULL} }; /* this is either readcapacity16 or readlong16 depending of what service action is set to. */ static void dissect_sbc_serviceactionin16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 service_action; guint32 block_len; guint64 len, tot_len; const char *un; proto_item *it = NULL; if (isreq && iscdb) { service_action = tvb_get_guint8 (tvb, offset) & 0x1F; if(cdata && cdata->itlq){ cdata->itlq->flags=service_action; } switch(service_action){ case SERVICE_READ_CAPACITY16: col_append_str(pinfo->cinfo, COL_INFO, " READCAPACITY16"); if (!tree) return; proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 9; proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 5; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); offset++; break; case SERVICE_READ_LONG16: col_append_str(pinfo->cinfo, COL_INFO, " READ_LONG16"); if (!tree) return; proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN); offset+=8; /* two reserved bytes */ offset+=2; proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* CORRCT bit */ offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); offset++; break; case SERVICE_GET_LBA_STATUS: col_append_str(pinfo->cinfo, COL_INFO, " GET_LBA_STATUS"); if (!tree) return; proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (tree, hf_scsi_sbc_get_lba_status_lba, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* reserved */ offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); offset++; break; case SERVICE_REPORT_REFERRALS: col_append_str(pinfo->cinfo, COL_INFO, " REPORT_REFERRALS"); if (!tree) return; proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN); offset +=4; /* reserved */ offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); offset++; break; default: col_append_str(pinfo->cinfo, COL_INFO, " RESERVED"); if (!tree) return; proto_tree_add_uint_format_value(tree, hf_scsi_sbc_service_action, tvb, offset, 1, service_action, "Reserved (0x%x)", service_action); break; }; } else if (!iscdb) { if (!tree) return; if(cdata && cdata->itlq){ switch(cdata->itlq->flags){ case SERVICE_READ_CAPACITY16: len = tvb_get_ntoh64 (tvb, offset); block_len = tvb_get_ntohl (tvb, offset+8); tot_len=((len/1024)*block_len)/1024; /*MB*/ un="MB"; if(tot_len>20000){ tot_len/=1024; un="GB"; } it = proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN); proto_item_append_text (it, " (%" PRIu64 " %s)", tot_len, un); proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_prot_en, tvb, offset+12, 1, ENC_BIG_ENDIAN); if (tvb_get_guint8(tvb, offset+12) & 0x01) { /* only decode the protection type if protection is enabled */ proto_tree_add_item (tree, hf_scsi_sbc_ptype, tvb, offset+12, 1, ENC_BIG_ENDIAN); } proto_tree_add_item (tree, hf_scsi_sbc_p_i_exponent, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_lbppbe, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_lbpme, tvb, offset+14, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_lbprz, tvb, offset+14, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_sbc_lalba, tvb, offset+14, 2, ENC_BIG_ENDIAN); break; case SERVICE_GET_LBA_STATUS: proto_tree_add_item (tree, hf_scsi_sbc_get_lba_status_data_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* reserved */ offset += 4; while (tvb_captured_length_remaining(tvb, offset) >= 16) { proto_tree *tr; guint64 lba; guint32 num_blocks; guint8 type; tr = proto_tree_add_subtree(tree, tvb, offset, 16, ett_scsi_lba_status_descriptor, &it, "LBA Status Descriptor: "); proto_tree_add_item (tr, hf_scsi_sbc_get_lba_status_lba, tvb, offset, 8, ENC_BIG_ENDIAN); lba = tvb_get_ntoh64(tvb, offset); offset += 8; proto_tree_add_item (tr, hf_scsi_sbc_get_lba_status_num_blocks, tvb, offset, 4, ENC_BIG_ENDIAN); num_blocks = tvb_get_ntohl(tvb, offset); offset += 4; proto_tree_add_item (tr, hf_scsi_sbc_get_lba_status_provisioning_status, tvb, offset, 1, ENC_BIG_ENDIAN); type = tvb_get_guint8(tvb, offset) & 0x07; offset++; /* reserved */ offset += 3; proto_item_append_text (it, "%" PRIu64 "-%" PRIu64 " %s", lba, lba + num_blocks - 1, val_to_str(type, scsi_provisioning_type_val, "Unknown (0x%02x)") ); } break; } } } } static void dissect_sbc_serviceactionout16(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 service_action; if (isreq && iscdb) { service_action = tvb_get_guint8 (tvb, offset) & 0x1F; if(cdata && cdata->itlq){ cdata->itlq->flags=service_action; } switch(service_action){ case SERVICE_WRITE_LONG16: col_append_str(pinfo->cinfo, COL_INFO, " WRITE_LONG16"); if (!tree) return; /* Read Long (16) & Write Long (16) share the same service action code, we're looking for Write Long (16) here We can't lookup from service_action_vals[] as we'll always get Read Long (16) instead */ proto_tree_add_uint_format_value(tree, hf_scsi_sbc_service_action, tvb, offset, 1, service_action, "Write Long (16) (0x%x)", service_action); offset++; proto_tree_add_item(tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN); offset+=8; /* two reserved bytes */ offset+=2; proto_tree_add_item(tree, hf_scsi_sbc_alloclen16, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* Reserved byte */ offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); offset++; break; default: col_append_str(pinfo->cinfo, COL_INFO, " RESERVED"); if (!tree) return; proto_tree_add_uint_format_value(tree, hf_scsi_sbc_service_action, tvb, offset, 1, service_action, "Reserved (0x%x)", service_action); break; }; } } /* SBC Commands */ static const value_string scsi_sbc_vals[] = { /* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"}, /* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"}, /* 0x04 */ {SCSI_SBC_FORMATUNIT , "Format Unit"}, /* 0x07 */ {SCSI_SBC_REASSIGNBLKS , "Reassign Blocks"}, /* 0x08 */ {SCSI_SBC_READ6 , "Read(6)"}, /* 0x0A */ {SCSI_SBC_WRITE6 , "Write(6)"}, /* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"}, /* 0x15 */ {SCSI_SPC_MODESELECT6 , "Mode Select(6)"}, /* 0x16 */ {SCSI_SPC_RESERVE6 , "Reserve(6)"}, /* obsolete in SBC2 and later */ /* 0x17 */ {SCSI_SPC_RELEASE6 , "Release(6)"}, /* obsolete in SBC2 and later */ /* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"}, /* 0x1B */ {SCSI_SBC_STARTSTOPUNIT , "Start Stop Unit"}, /* 0x1D */ {SCSI_SPC_SENDDIAG , "Send Diagnostic"}, /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"}, /* 0x25 */ {SCSI_SBC_READCAPACITY10 , "Read Capacity(10)"}, /* 0x28 */ {SCSI_SBC_READ10 , "Read(10)"}, /* 0x2A */ {SCSI_SBC_WRITE10 , "Write(10)"}, /* 0x2B */ {SCSI_SBC_SEEK10 , "Seek(10)"}, /* 0x2E */ {SCSI_SBC_WRITENVERIFY10 , "Write & Verify(10)"}, /* 0x2F */ {SCSI_SBC_VERIFY10 , "Verify(10)"}, /* 0x33 */ {SCSI_SBC_SETLIMITS10 , "Set Limits(10)"}, /* 0x34 */ {SCSI_SBC_PREFETCH10 , "Pre-Fetch(10)"}, /* 0x35 */ {SCSI_SBC_SYNCCACHE10 , "Synchronize Cache(10)"}, /* 0x36 */ {SCSI_SBC_LOCKUNLKCACHE10 , "Lock Unlock Cache(10)"}, /* 0x37 */ {SCSI_SBC_READDEFDATA10 , "Read Defect Data(10)"}, /* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"}, /* 0x3E */ {SCSI_SBC_READLONG , "Read Long(10)"}, /* 0x3F */ {SCSI_SBC_WRITELONG , "Write Long"}, /* 0x41 */ {SCSI_SBC_WRITESAME10 , "Write Same(10)"}, /* 0x42 */ {SCSI_SBC_UNMAP , "Unmap"}, /* 0x48 */ {SCSI_SBC_SANITIZE , "Sanitize"}, /* 0x4C */ {SCSI_SPC_LOGSELECT , "Log Select"}, /* 0x4D */ {SCSI_SPC_LOGSENSE , "Log Sense"}, /* 0x50 */ {SCSI_SBC_XDWRITE10 , "XdWrite(10)"}, /* 0x51 */ {SCSI_SBC_XPWRITE10 , "XpWrite(10)"}, /* 0x52 */ {SCSI_SBC_XDREAD10 , "XdRead(10)"}, /* 0x53 */ {SCSI_SBC_XDWRITEREAD10 , "XdWriteRead(10)"}, /* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"}, /* 0x56 */ {SCSI_SPC_RESERVE10 , "Reserve(10)"},/* obsolete in SBC2 and later */ /* 0x57 */ {SCSI_SPC_RELEASE10 , "Release(10)"},/* obsolete in SBC2 and later */ /* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"}, /* 0x5E */ {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"}, /* 0x5F */ {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"}, /* 0x7F */ {SCSI_SBC_REBUILD32 , "Rebuild(32)"}, #if 0 /* dups which would never have been found (in the previous unsorted version of this array) */ /* 0x7F */ {SCSI_SBC_REGENERATE32 , "Regenerate(32)"}, /* 0x7F */ {SCSI_SBC_XDREAD32 , "XdRead(32)"}, /* 0x7F */ {SCSI_SBC_XDWRITE32 , "XdWrite(32)"}, /* 0x7F */ {SCSI_SBC_XDWRITEEXTD32 , "XdWrite Extended(32)"}, /* 0x7F */ {SCSI_SBC_XDWRITEREAD32 , "XdWriteRead(32)"}, /* 0x7F */ {SCSI_SBC_XPWRITE32 , "XpWrite(32)"}, #endif /* 0x80 */ {SCSI_SBC_XDWRITEEXTD16 , "XdWrite Extended(16)"}, /* 0x81 */ {SCSI_SBC_REBUILD16 , "Rebuild(16)"}, /* 0x82 */ {SCSI_SBC_REGENERATE16 , "Regenerate(16)"}, /* 0x83 */ {SCSI_SPC_EXTCOPY , "Extended Copy"}, /* 0x84 */ {SCSI_SPC_RECVCOPY , "Receive Copy"}, /* 0x88 */ {SCSI_SBC_READ16 , "Read(16)"}, /* 0x89 */ {SCSI_SBC_COMPARENWRITE , "Compare & Write(16)"}, /* 0x8A */ {SCSI_SBC_WRITE16 , "Write(16)"}, /* 0x8B */ {SCSI_SBC_ORWRITE , "OrWrite(16)"}, /* 0x8E */ {SCSI_SBC_WRITENVERIFY16 , "Write & Verify(16)"}, /* 0x8F */ {SCSI_SBC_VERIFY16 , "Verify(16)"}, /* 0x90 */ {SCSI_SBC_PREFETCH16 , "Pre-Fetch(16)"}, /* 0x91 */ {SCSI_SBC_SYNCCACHE16 , "Synchronize Cache(16)"}, /* 0x92 */ {SCSI_SBC_LOCKUNLKCACHE16 , "Lock Unlock Cache(16)"}, /* 0x93 */ {SCSI_SBC_WRITESAME16 , "Write Same(16)"}, /* 0x9C */ {SCSI_SBC_WRITEATOMIC16 , "Write Atomic(16)"}, /* 0x9E */ {SCSI_SBC_SERVICEACTIONIN16 , "Service Action In(16)"}, /* 0x9F */ {SCSI_SBC_SERVICEACTIONOUT16, "Service Action Out(16)"}, /* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"}, /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"}, /* 0xA8 */ {SCSI_SBC_READ12 , "Read(12)"}, /* 0xAA */ {SCSI_SBC_WRITE12 , "Write(12)"}, /* 0xAE */ {SCSI_SBC_WRITENVERIFY12 , "Write & Verify(12)"}, /* 0xAF */ {SCSI_SBC_VERIFY12 , "Verify(12)"}, /* 0xB3 */ {SCSI_SBC_SETLIMITS12 , "Set Limits(12)"}, /* 0xB7 */ {SCSI_SBC_READDEFDATA12 , "Read Defect Data(12)"}, {0, NULL} }; value_string_ext scsi_sbc_vals_ext = VALUE_STRING_EXT_INIT(scsi_sbc_vals); scsi_cdb_table_t scsi_sbc_table[256] = { /*SPC 0x00*/{dissect_spc_testunitready}, /*SBC 0x01*/{NULL}, /*SBC 0x02*/{NULL}, /*SPC 0x03*/{dissect_spc_requestsense}, /*SBC 0x04*/{dissect_sbc_formatunit}, /*SBC 0x05*/{NULL}, /*SBC 0x06*/{NULL}, /*SBC 0x07*/{dissect_sbc_reassignblocks}, /*SBC 0x08*/{dissect_sbc_read6}, /*SBC 0x09*/{NULL}, /*SBC 0x0a*/{dissect_sbc_write6}, /*SBC 0x0b*/{NULL}, /*SBC 0x0c*/{NULL}, /*SBC 0x0d*/{NULL}, /*SBC 0x0e*/{NULL}, /*SBC 0x0f*/{NULL}, /*SBC 0x10*/{NULL}, /*SBC 0x11*/{NULL}, /*SPC 0x12*/{dissect_spc_inquiry}, /*SBC 0x13*/{NULL}, /*SBC 0x14*/{NULL}, /*SPC 0x15*/{dissect_spc_modeselect6}, /*SBC 0x16*/{dissect_spc_reserve6}, /* obsolete in SBC2 and later */ /*SBC 0x17*/{dissect_spc_release6}, /* obsolete in SBC2 and later */ /*SBC 0x18*/{NULL}, /*SBC 0x19*/{NULL}, /*SPC 0x1a*/{dissect_spc_modesense6}, /*SBC 0x1b*/{dissect_sbc_startstopunit}, /*SBC 0x1c*/{NULL}, /*SPC 0x1d*/{dissect_spc_senddiagnostic}, /*SBC 0x1e*/{dissect_spc_preventallowmediaremoval}, /*SBC 0x1f*/{NULL}, /*SBC 0x20*/{NULL}, /*SBC 0x21*/{NULL}, /*SBC 0x22*/{NULL}, /*SBC 0x23*/{NULL}, /*SBC 0x24*/{NULL}, /*SBC 0x25*/{dissect_sbc_readcapacity10}, /*SBC 0x26*/{NULL}, /*SBC 0x27*/{NULL}, /*SBC 0x28*/{dissect_sbc_read10}, /*SBC 0x29*/{NULL}, /*SBC 0x2a*/{dissect_sbc_write10}, /*SBC 0x2b*/{NULL}, /*SBC 0x2c*/{NULL}, /*SBC 0x2d*/{NULL}, /*SBC 0x2e*/{dissect_sbc_wrverify10}, /*SBC 0x2f*/{dissect_sbc_verify10}, /*SBC 0x30*/{NULL}, /*SBC 0x31*/{NULL}, /*SBC 0x32*/{NULL}, /*SBC 0x33*/{NULL}, /*SBC 0x34*/{dissect_sbc_prefetch10}, /*SBC 0x35*/{dissect_sbc_synchronizecache10}, /*SBC 0x36*/{NULL}, /*SBC 0x37*/{dissect_sbc_readdefectdata10}, /*SBC 0x38*/{NULL}, /*SBC 0x39*/{NULL}, /*SBC 0x3a*/{NULL}, /*SPC 0x3b*/{dissect_spc_writebuffer}, /*SBC 0x3c*/{NULL}, /*SBC 0x3d*/{NULL}, /*SBC 0x3e*/{dissect_sbc_readlong10}, /*SBC 0x3f*/{dissect_sbc_writelong10}, /*SBC 0x40*/{NULL}, /*SBC 0x41*/{dissect_sbc_writesame10}, /*SBC 0x42*/{dissect_sbc_unmap}, /*SBC 0x43*/{NULL}, /*SBC 0x44*/{NULL}, /*SBC 0x45*/{NULL}, /*SBC 0x46*/{NULL}, /*SBC 0x47*/{NULL}, /*SBC 0x48*/{dissect_sbc_sanitize}, /*SBC 0x49*/{NULL}, /*SBC 0x4a*/{NULL}, /*SBC 0x4b*/{NULL}, /*SPC 0x4c*/{dissect_spc_logselect}, /*SPC 0x4d*/{dissect_spc_logsense}, /*SBC 0x4e*/{NULL}, /*SBC 0x4f*/{NULL}, /*SBC 0x50*/{dissect_sbc_xdwrite10}, /*SBC 0x51*/{dissect_sbc_xpwrite10}, /*SBC 0x52*/{dissect_sbc_xdread10}, /*SBC 0x53*/{dissect_sbc_xdwriteread10}, /*SBC 0x54*/{NULL}, /*SPC 0x55*/{dissect_spc_modeselect10}, /*SPC 0x56*/{dissect_spc_reserve10},/* obsolete in SBC2 and later */ /*SPC 0x57*/{dissect_spc_release10},/* obsolete in SBC2 and later */ /*SBC 0x58*/{NULL}, /*SBC 0x59*/{NULL}, /*SPC 0x5a*/{dissect_spc_modesense10}, /*SBC 0x5b*/{NULL}, /*SBC 0x5c*/{NULL}, /*SBC 0x5d*/{NULL}, /*SPC 0x5e*/{dissect_spc_persistentreservein}, /*SPC 0x5f*/{dissect_spc_persistentreserveout}, /*SBC 0x60*/{NULL}, /*SBC 0x61*/{NULL}, /*SBC 0x62*/{NULL}, /*SBC 0x63*/{NULL}, /*SBC 0x64*/{NULL}, /*SBC 0x65*/{NULL}, /*SBC 0x66*/{NULL}, /*SBC 0x67*/{NULL}, /*SBC 0x68*/{NULL}, /*SBC 0x69*/{NULL}, /*SBC 0x6a*/{NULL}, /*SBC 0x6b*/{NULL}, /*SBC 0x6c*/{NULL}, /*SBC 0x6d*/{NULL}, /*SBC 0x6e*/{NULL}, /*SBC 0x6f*/{NULL}, /*SBC 0x70*/{NULL}, /*SBC 0x71*/{NULL}, /*SBC 0x72*/{NULL}, /*SBC 0x73*/{NULL}, /*SBC 0x74*/{NULL}, /*SBC 0x75*/{NULL}, /*SBC 0x76*/{NULL}, /*SBC 0x77*/{NULL}, /*SBC 0x78*/{NULL}, /*SBC 0x79*/{NULL}, /*SBC 0x7a*/{NULL}, /*SBC 0x7b*/{NULL}, /*SBC 0x7c*/{NULL}, /*SBC 0x7d*/{NULL}, /*SBC 0x7e*/{NULL}, /*SBC 0x7f*/{NULL}, /*SBC 0x80*/{NULL}, /*SBC 0x81*/{NULL}, /*SBC 0x82*/{NULL}, /*SPC 0x83*/{dissect_spc_extcopy}, /*SBC 0x84*/{dissect_spc_recvcopy}, /*SBC 0x85*/{NULL}, /*SBC 0x86*/{NULL}, /*SBC 0x87*/{NULL}, /*SBC 0x88*/{dissect_sbc_read16}, /*SBC 0x89*/{dissect_sbc_comparenwrite}, /*SBC 0x8a*/{dissect_sbc_write16}, /*SBC 0x8b*/{dissect_sbc_orwrite}, /*SBC 0x8c*/{NULL}, /*SBC 0x8d*/{NULL}, /*SBC 0x8e*/{dissect_sbc_wrverify16}, /*SBC 0x8f*/{dissect_sbc_verify16}, /*SBC 0x90*/{dissect_sbc_prefetch16}, /*SBC 0x91*/{dissect_sbc_synchronizecache16}, /*SBC 0x92*/{NULL}, /*SBC 0x93*/{dissect_sbc_writesame16}, /*SBC 0x94*/{NULL}, /*SBC 0x95*/{NULL}, /*SBC 0x96*/{NULL}, /*SBC 0x97*/{NULL}, /*SBC 0x98*/{NULL}, /*SBC 0x99*/{NULL}, /*SBC 0x9a*/{NULL}, /*SBC 0x9b*/{NULL}, /*SBC 0x9c*/{dissect_sbc_writeatomic16}, /*SBC 0x9d*/{NULL}, /*SBC 0x9e*/{dissect_sbc_serviceactionin16}, /*SBC 0x9f*/{dissect_sbc_serviceactionout16}, /*SPC 0xa0*/{dissect_spc_reportluns}, /*SBC 0xa1*/{NULL}, /*SBC 0xa2*/{NULL}, /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in}, /*SBC 0xa4*/{NULL}, /*SBC 0xa5*/{NULL}, /*SBC 0xa6*/{NULL}, /*SBC 0xa7*/{NULL}, /*SBC 0xa8*/{dissect_sbc_read12}, /*SBC 0xa9*/{NULL}, /*SBC 0xaa*/{dissect_sbc_write12}, /*SBC 0xab*/{NULL}, /*SBC 0xac*/{NULL}, /*SBC 0xad*/{NULL}, /*SBC 0xae*/{dissect_sbc_wrverify12}, /*SBC 0xaf*/{dissect_sbc_verify12}, /*SBC 0xb0*/{NULL}, /*SBC 0xb1*/{NULL}, /*SBC 0xb2*/{NULL}, /*SBC 0xb3*/{NULL}, /*SBC 0xb4*/{NULL}, /*SBC 0xb5*/{NULL}, /*SBC 0xb6*/{NULL}, /*SBC 0xb7*/{dissect_sbc_readdefectdata12}, /*SBC 0xb8*/{NULL}, /*SBC 0xb9*/{NULL}, /*SBC 0xba*/{NULL}, /*SBC 0xbb*/{NULL}, /*SBC 0xbc*/{NULL}, /*SBC 0xbd*/{NULL}, /*SBC 0xbe*/{NULL}, /*SBC 0xbf*/{NULL}, /*SBC 0xc0*/{NULL}, /*SBC 0xc1*/{NULL}, /*SBC 0xc2*/{NULL}, /*SBC 0xc3*/{NULL}, /*SBC 0xc4*/{NULL}, /*SBC 0xc5*/{NULL}, /*SBC 0xc6*/{NULL}, /*SBC 0xc7*/{NULL}, /*SBC 0xc8*/{NULL}, /*SBC 0xc9*/{NULL}, /*SBC 0xca*/{NULL}, /*SBC 0xcb*/{NULL}, /*SBC 0xcc*/{NULL}, /*SBC 0xcd*/{NULL}, /*SBC 0xce*/{NULL}, /*SBC 0xcf*/{NULL}, /*SBC 0xd0*/{NULL}, /*SBC 0xd1*/{NULL}, /*SBC 0xd2*/{NULL}, /*SBC 0xd3*/{NULL}, /*SBC 0xd4*/{NULL}, /*SBC 0xd5*/{NULL}, /*SBC 0xd6*/{NULL}, /*SBC 0xd7*/{NULL}, /*SBC 0xd8*/{NULL}, /*SBC 0xd9*/{NULL}, /*SBC 0xda*/{NULL}, /*SBC 0xdb*/{NULL}, /*SBC 0xdc*/{NULL}, /*SBC 0xdd*/{NULL}, /*SBC 0xde*/{NULL}, /*SBC 0xdf*/{NULL}, /*SBC 0xe0*/{NULL}, /*SBC 0xe1*/{NULL}, /*SBC 0xe2*/{NULL}, /*SBC 0xe3*/{NULL}, /*SBC 0xe4*/{NULL}, /*SBC 0xe5*/{NULL}, /*SBC 0xe6*/{NULL}, /*SBC 0xe7*/{NULL}, /*SBC 0xe8*/{NULL}, /*SBC 0xe9*/{NULL}, /*SBC 0xea*/{NULL}, /*SBC 0xeb*/{NULL}, /*SBC 0xec*/{NULL}, /*SBC 0xed*/{NULL}, /*SBC 0xee*/{NULL}, /*SBC 0xef*/{NULL}, /*SBC 0xf0*/{NULL}, /*SBC 0xf1*/{NULL}, /*SBC 0xf2*/{NULL}, /*SBC 0xf3*/{NULL}, /*SBC 0xf4*/{NULL}, /*SBC 0xf5*/{NULL}, /*SBC 0xf6*/{NULL}, /*SBC 0xf7*/{NULL}, /*SBC 0xf8*/{NULL}, /*SBC 0xf9*/{NULL}, /*SBC 0xfa*/{NULL}, /*SBC 0xfb*/{NULL}, /*SBC 0xfc*/{NULL}, /*SBC 0xfd*/{NULL}, /*SBC 0xfe*/{NULL}, /*SBC 0xff*/{NULL} }; void proto_register_scsi_sbc(void) { static hf_register_info hf[] = { { &hf_scsi_sbc_opcode, {"SBC Opcode", "scsi_sbc.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_sbc_vals_ext, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_service_action, {"Service Action", "scsi_sbc.sa", FT_UINT8, BASE_HEX, VALS(service_action_vals), 0x1F, "Unknown", HFILL}}, { &hf_scsi_sbc_formatunit_flags, {"Flags", "scsi_sbc.formatunit.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, // TODO: need multiple fields, as appears in different positions in fields lists! { &hf_scsi_sbc_defect_list_format, {"Defect List Format", "scsi_sbc.defect_list_format", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL}}, { &hf_scsi_sbc_formatunit_vendor, {"Vendor Unique", "scsi_sbc.formatunit.vendor", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_formatunit_interleave, {"Interleave", "scsi_sbc.formatunit.interleave", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_rdwr6_lba, {"Logical Block Address (LBA)", "scsi_sbc.rdwr6.lba", FT_UINT24, BASE_DEC, NULL, 0x0FFFFF, NULL, HFILL}}, { &hf_scsi_sbc_rdwr6_xferlen, {"Transfer Length", "scsi_sbc.rdwr6.xferlen", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_rdwr10_lba, {"Logical Block Address (LBA)", "scsi_sbc.rdwr10.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_rdwr10_xferlen, {"Transfer Length", "scsi_sbc.rdwr10.xferlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_rdwr12_xferlen, {"Transfer Length", "scsi_sbc.rdwr12.xferlen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_rdwr16_lba, {"Logical Block Address (LBA)", "scsi_sbc.rdwr16.lba", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_ssu_immed, {"Immediate", "scsi_sbc.ssu.immediate", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_ssu_pwr_cond, {"Power Conditions", "scsi_sbc.ssu.pwr", FT_UINT8, BASE_HEX, VALS (scsi_ssu_pwrcnd_val), 0xF0, NULL, HFILL}}, { &hf_scsi_sbc_ssu_loej, {"LOEJ", "scsi_sbc.ssu.loej", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL}}, { &hf_scsi_sbc_ssu_start, {"Start", "scsi_sbc.ssu.start", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL}}, { &hf_scsi_sbc_bytchk, {"BYTCHK", "scsi_sbc.bytchk", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, #if 0 { &hf_scsi_sbc_verify_reladdr, {"RELADDR", "scsi_sbc.verify.reladdr", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL}}, #endif { &hf_scsi_sbc_verify_lba, {"LBA", "scsi_sbc.verify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_verify_lba64, {"LBA", "scsi_sbc.verify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_verify_vlen, {"Verification Length", "scsi_sbc.verify.vlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_verify_vlen32, {"Verification Length", "scsi_sbc.verify.vlen32", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_wrverify_lba, {"LBA", "scsi_sbc.wrverify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_wrverify_xferlen, {"Transfer Length", "scsi_sbc.wrverify.xferlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_wrverify_lba64, {"LBA", "scsi_sbc.wrverify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_wrverify_xferlen32, {"Transfer Length", "scsi_sbc.wrverify.xferlen32", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, #if 0 { &hf_scsi_sbc_readcapacity_flags, {"Flags", "scsi_sbc.readcapacity.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, #endif { &hf_scsi_sbc_readdefdata_flags, {"Flags", "scsi_sbc.readdefdata.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_reassignblks_flags, {"Flags", "scsi_sbc.reassignblks.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_read_flags, {"Flags", "scsi_sbc.read.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_alloclen32, {"Allocation Length", "scsi_sbc.alloclen32", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_alloclen16, {"Allocation Length", "scsi_sbc.alloclen16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_lba64_address, {"Logical Block Address", "scsi_sbc.lba64_add", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_fuflags_fmtpinfo, {"FMTPINFO", "scsi_sbc.format_unit.fmtpinfo", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_sbc_fuflags_rto_req, {"RTO_REQ", "scsi_sbc.format_unit.rto_req", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_sbc_fuflags_longlist, {"LONGLIST", "scsi_sbc.format_unit.longlist", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_sbc_fuflags_fmtdata, {"FMTDATA", "scsi_sbc.format_unit.fmtdata", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_sbc_fuflags_cmplist, {"CMPLIST", "scsi_sbc.format_unit.cmplist", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_sbc_prefetch_flags, {"Flags", "scsi_sbc.prefetch.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_prefetch_immed, {"Immediate", "scsi_sbc.prefetch.immediate", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL}}, { &hf_scsi_sbc_group, {"Group", "scsi_sbc.group", FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL}}, { &hf_scsi_sbc_rdprotect, {"RDPROTECT", "scsi_sbc.rdprotect", FT_UINT8, BASE_HEX, NULL, 0xe0, NULL, HFILL}}, { &hf_scsi_sbc_dpo, {"DPO", "scsi_sbc.dpo", FT_BOOLEAN, 8, TFS(&dpo_tfs), 0x10, "DisablePageOut: Whether the device should cache the data or not", HFILL}}, { &hf_scsi_sbc_fua, {"FUA", "scsi_sbc.fua", FT_BOOLEAN, 8, TFS(&fua_tfs), 0x08, "ForceUnitAccess: Whether to allow reading from the cache or not", HFILL}}, { &hf_scsi_sbc_fua_nv, {"FUA_NV", "scsi_sbc.fua_nv", FT_BOOLEAN, 8, TFS(&fua_nv_tfs), 0x02, "ForceUnitAccess_NonVolatile: Whether to allow reading from non-volatile cache or not", HFILL}}, { &hf_scsi_sbc_blocksize, {"Block size in bytes", "scsi_sbc.blocksize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_returned_lba, {"Returned LBA", "scsi_sbc.returned_lba", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_req_plist, {"REQ_PLIST", "scsi_sbc.req_plist", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_sbc_req_glist, {"REQ_GLIST", "scsi_sbc.req_glist", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_sbc_corrct, {"CORRCT", "scsi_sbc.corrct", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_sbc_corrct_flags, {"Flags", "scsi_sbc.corrct_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_reassignblocks_longlba, {"LongLBA", "scsi_sbc.reassignblocks.longlba", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_sbc_reassignblocks_longlist, {"LongList", "scsi_sbc.reassignblocks.longlist", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_ssu_immed_flags, {"Immed flags", "scsi_sbc.ssu.immed_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_ssu_pwr_flags, {"Pwr flags", "scsi_sbc.ssu.pwr_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_synccache_flags, {"Flags", "scsi_sbc.synccache.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_synccache_immed, {"Immediate", "scsi_sbc.synccache.immediate", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_sbc_synccache_sync_nv, {"SYNC_NV", "scsi_sbc.synccache.sync_nv", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_sbc_vrprotect, {"VRPROTECT", "scsi_sbc.vrprotect", FT_UINT8, BASE_HEX, NULL, 0xe0, NULL, HFILL}}, { &hf_scsi_sbc_verify_flags, {"Flags", "scsi_sbc.verify_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_wrprotect, {"WRPROTECT", "scsi_sbc.wrprotect", FT_UINT8, BASE_HEX, NULL, 0xe0, NULL, HFILL}}, { &hf_scsi_sbc_wrverify_flags, {"Flags", "scsi_sbc.wrverify_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_writesame_flags, {"Flags", "scsi_sbc.writesame_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_anchor, {"ANCHOR", "scsi_sbc.anchor", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_sbc_unmap, {"UNMAP", "scsi_sbc.unmap", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_sbc_pbdata, {"PBDATA", "scsi_sbc.pbdata", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_sbc_lbdata, {"LBDATA", "scsi_sbc.lbdata", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_sbc_xdread_flags, {"Flags", "scsi_sbc.xdread.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_xorpinfo, {"XORPINFO", "scsi_sbc.xorpinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_disable_write, {"DISABLE_WRITE", "scsi_sbc.disable_write", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_sbc_xdwrite_flags, {"Flags", "scsi_sbc.xdwrite.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_xdwriteread_flags, {"Flags", "scsi_sbc.xdwriteread.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_xpwrite_flags, {"Flags", "scsi_sbc.xpwrite.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sbc_unmap_anchor, {"ANCHOR", "scsi_sbc.unmap.anchor", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_unmap_flags, {"Flags", "scsi_sbc.unmap_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_unmap_data_length, {"Data Length", "scsi_sbc.unmap.data_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_unmap_block_descriptor_data_length, {"Block Descriptor Data Length", "scsi_sbc.unmap.block_descriptor_data_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_unmap_lba, {"LBA", "scsi_sbc.unmap.lba", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_unmap_num_blocks, {"Num Blocks", "scsi_sbc.unmap.num_blocks", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_ptype, {"PTYPE", "scsi_sbc.ptype", FT_UINT8, BASE_DEC, VALS(scsi_ptype_val), 0x0e, NULL, HFILL}}, { &hf_scsi_sbc_prot_en, {"PROT_EN", "scsi_sbc.prot_en", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_p_i_exponent, {"P_I_EXPONENT", "scsi_sbc.p_i_exponent", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL}}, { &hf_scsi_sbc_lbppbe, {"LOGICAL_BLOCKS_PER_PHYSICAL_BLOCK_EXPONENT", "scsi_sbc.lbppbe", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_sbc_lbpme, {"LBPME (logical block provisioning management enabled) / TPE", "scsi_sbc.lbpme", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_sbc_lbprz, {"LBPRZ (logical block provisioning read zeros) / TPRZ", "scsi_sbc.lbprz", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_sbc_lalba, {"LOWEST_ALIGNED_LBA", "scsi_sbc.lalba", FT_UINT16, BASE_DEC, NULL, 0x3fff, NULL, HFILL}}, { &hf_scsi_sbc_get_lba_status_lba, {"LBA", "scsi_sbc.get_lba_status.start_lba", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_get_lba_status_data_length, {"Data Length", "scsi_sbc.get_lba_status.data_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_get_lba_status_num_blocks, {"Num Blocks", "scsi_sbc.get_lba_status.num_blocks", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_get_lba_status_provisioning_status, {"Provisioning Type", "scsi_sbc.get_lba_status.provisioning_type", FT_UINT8, BASE_DEC, VALS(scsi_provisioning_type_val), 0x07, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_sa, {"Service Action", "scsi_sbc.sanitize.sa", FT_UINT8, BASE_HEX, VALS(sanitize_val), 0x1f, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_ause, {"AUSE", "scsi_sbc.sanitize.ause", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_immed, {"IMMED", "scsi_sbc.sanitize.immed", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_flags, {"Flags", "scsi_sbc.sanitize_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_overwrite_flags, {"Flags", "scsi_sbc.sanitize_overwrite_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_invert, {"INVERT", "scsi_sbc.sanitize.invert", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_test, {"TEST", "scsi_sbc.sanitize.test", FT_UINT8, BASE_HEX, NULL, 0x60, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_owcount, {"Overwrite Count", "scsi_sbc.sanitize.overwrite_count", FT_UINT8, BASE_DEC_HEX, NULL, 0x1f, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_pattern_length, {"Initialization Pattern Length", "scsi_sbc.sanitize.pattern_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_sanitize_pattern, {"Initialization Pattern", "scsi_sbc.sanitize.pattern", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_scsi_format_unit, &ett_scsi_prefetch, &ett_scsi_rdwr, &ett_scsi_xdread, &ett_scsi_xdwrite, &ett_scsi_xdwriteread, &ett_scsi_xpwrite, &ett_scsi_defectdata, &ett_scsi_corrct, &ett_scsi_reassign_blocks, &ett_scsi_ssu_immed, &ett_scsi_ssu_pwr, &ett_scsi_synccache, &ett_scsi_verify, &ett_scsi_wrverify, &ett_scsi_writesame, &ett_scsi_unmap, &ett_scsi_unmap_block_descriptor, &ett_scsi_lba_status_descriptor, &ett_scsi_sanitize, &ett_scsi_sanitize_overwrite }; /* Register the protocol name and description */ proto_scsi_sbc = proto_register_protocol("SCSI_SBC", "SCSI_SBC", "scsi_sbc"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_scsi_sbc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-scsi-sbc.h
/* packet-scsi-sbc.h * Dissector for the SCSI SBC commandset * Extracted from packet-scsi.h * * Dinesh G Dutt ([email protected]) * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCSI_SBC_H_ #define __PACKET_SCSI_SBC_H_ #include "ws_symbol_export.h" /* SBC Commands */ #define SCSI_SBC_FORMATUNIT 0x04 #define SCSI_SBC_LOCKUNLKCACHE10 0x36 #define SCSI_SBC_LOCKUNLKCACHE16 0x92 #define SCSI_SBC_PREFETCH10 0x34 #define SCSI_SBC_PREFETCH16 0x90 #define SCSI_SBC_READ6 0x08 #define SCSI_SBC_READ10 0x28 #define SCSI_SBC_READ12 0xA8 #define SCSI_SBC_READ16 0x88 #define SCSI_SBC_READCAPACITY10 0x25 #define SCSI_SBC_SERVICEACTIONIN16 0x9E #define SCSI_SBC_SERVICEACTIONOUT16 0x9F #define SCSI_SBC_READDEFDATA10 0x37 #define SCSI_SBC_READDEFDATA12 0xB7 #define SCSI_SBC_READLONG 0x3E #define SCSI_SBC_REASSIGNBLKS 0x07 #define SCSI_SBC_REBUILD16 0x81 #define SCSI_SBC_REBUILD32 0x7F #define SCSI_SBC_REGENERATE16 0x82 #define SCSI_SBC_REGENERATE32 0x7F #define SCSI_SBC_SANITIZE 0x48 #define SCSI_SBC_SEEK10 0x2B #define SCSI_SBC_SETLIMITS10 0x33 #define SCSI_SBC_SETLIMITS12 0xB3 #define SCSI_SBC_STARTSTOPUNIT 0x1B #define SCSI_SBC_SYNCCACHE10 0x35 #define SCSI_SBC_SYNCCACHE16 0x91 #define SCSI_SBC_UNMAP 0x42 #define SCSI_SBC_VERIFY10 0x2F #define SCSI_SBC_VERIFY12 0xAF #define SCSI_SBC_VERIFY16 0x8F #define SCSI_SBC_WRITE6 0x0A #define SCSI_SBC_WRITE10 0x2A #define SCSI_SBC_WRITE12 0xAA #define SCSI_SBC_COMPARENWRITE 0x89 #define SCSI_SBC_WRITE16 0x8A #define SCSI_SBC_WRITEATOMIC16 0x9C #define SCSI_SBC_ORWRITE 0x8B #define SCSI_SBC_WRITENVERIFY10 0x2E #define SCSI_SBC_WRITENVERIFY12 0xAE #define SCSI_SBC_WRITENVERIFY16 0x8E #define SCSI_SBC_WRITELONG 0x3F #define SCSI_SBC_WRITESAME10 0x41 #define SCSI_SBC_WRITESAME16 0x93 #define SCSI_SBC_XDREAD10 0x52 #define SCSI_SBC_XDREAD32 0x7F #define SCSI_SBC_XDWRITE10 0x50 #define SCSI_SBC_XDWRITE32 0x7F #define SCSI_SBC_XDWRITEREAD10 0x53 #define SCSI_SBC_XDWRITEREAD32 0x7F #define SCSI_SBC_XDWRITEEXTD16 0x80 #define SCSI_SBC_XDWRITEEXTD32 0x7F #define SCSI_SBC_XPWRITE10 0x51 #define SCSI_SBC_XPWRITE32 0x7F void dissect_sbc_startstopunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq _U_, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_sbc_read12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_sbc_write12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_sbc_read10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_sbc_write10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_sbc_readcapacity10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); extern int hf_scsi_sbc_opcode; extern scsi_cdb_table_t scsi_sbc_table[256]; WS_DLL_PUBLIC value_string_ext scsi_sbc_vals_ext; #endif
C
wireshark/epan/dissectors/packet-scsi-smc.c
/* based on the SMC 3 standard */ /* packet-scsi-smc.c * Dissector for the SCSI SMC commandset * Extracted from packet-scsi.c * * Dinesh G Dutt ([email protected]) * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include "packet-scsi.h" #include "packet-scsi-smc.h" void proto_register_scsi_smc(void); static int proto_scsi_smc = -1; int hf_scsi_smc_opcode = -1; static int hf_scsi_smc_mta = -1; static int hf_scsi_smc_sa = -1; static int hf_scsi_smc_da = -1; static int hf_scsi_smc_fda = -1; static int hf_scsi_smc_sda = -1; static int hf_scsi_smc_medium_flags = -1; static int hf_scsi_smc_inv1 = -1; static int hf_scsi_smc_inv2 = -1; static int hf_scsi_smc_range_flags = -1; static int hf_scsi_smc_fast = -1; static int hf_scsi_smc_range = -1; /* static int hf_scsi_smc_sea = -1; */ static int hf_scsi_smc_num_elements = -1; static int hf_scsi_smc_invert = -1; static int hf_scsi_smc_ea = -1; static int hf_scsi_smc_action_code = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_scsi_smc_allocation_length = -1; static int hf_scsi_smc_first_element_address_reported = -1; static int hf_scsi_smc_voltag = -1; static int hf_scsi_smc_element_descriptor_length = -1; static int hf_scsi_smc_byte_count_of_descriptor_data_available = -1; static int hf_scsi_smc_pvoltag = -1; static int hf_scsi_smc_code_set = -1; static int hf_scsi_smc_starting_element_address = -1; static int hf_scsi_smc_curdata = -1; static int hf_scsi_smc_element_type_code = -1; static int hf_scsi_smc_element_type_code_0F = -1; static int hf_scsi_smc_identifier = -1; static int hf_scsi_smc_vendor_specific_data = -1; static int hf_scsi_smc_source_storage_element_address = -1; static int hf_scsi_smc_number_of_elements_available = -1; static int hf_scsi_smc_identifier_type = -1; static int hf_scsi_smc_number_of_elements = -1; static int hf_scsi_smc_identifier_length = -1; static int hf_scsi_smc_scsi_bus_address = -1; static int hf_scsi_smc_byte_count_of_report_available = -1; static int hf_scsi_smc_cmc = -1; static int hf_scsi_smc_svalid = -1; static int hf_scsi_smc_avoltag = -1; static int hf_scsi_smc_access = -1; static int hf_scsi_smc_additional_sense_code_qualifier = -1; static int hf_scsi_smc_lu_valid = -1; static int hf_scsi_smc_dvcid = -1; static int hf_scsi_smc_except = -1; static int hf_scsi_smc_id_valid = -1; static int hf_scsi_smc_not_bus = -1; static int hf_scsi_smc_exenab = -1; static int hf_scsi_smc_lun = -1; static int hf_scsi_smc_inenab = -1; static int hf_scsi_smc_full = -1; static int hf_scsi_smc_impexp = -1; static int hf_scsi_smc_primary_vol_tag_id = -1; static int hf_scsi_smc_primary_vol_seq_num = -1; static int hf_scsi_smc_alternate_vol_tag_id = -1; static int hf_scsi_smc_alternate_vol_seq_num = -1; static gint ett_scsi_exchange_medium = -1; static gint ett_scsi_range = -1; static gint ett_scsi_move = -1; static void dissect_smc_exchangemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const exchg_fields[] = { &hf_scsi_smc_inv1, &hf_scsi_smc_inv2, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+3, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_fda, tvb, offset+5, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_sda, tvb, offset+7, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+9, hf_scsi_smc_medium_flags, ett_scsi_exchange_medium, exchg_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_smc_position_to_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const pte_fields[] = { &hf_scsi_smc_invert, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_da, tvb, offset+3, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+7, hf_scsi_smc_medium_flags, ett_scsi_exchange_medium, pte_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_smc_initialize_element_status (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_smc_initialize_element_status_with_range (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const range_fields[] = { &hf_scsi_smc_fast, &hf_scsi_smc_range, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_smc_range_flags, ett_scsi_range, range_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_num_elements, tvb, offset+5, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_smc_openclose_importexport_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_smc_ea, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_action_code, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_smc_movemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const move_fields[] = { &hf_scsi_smc_invert, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+3, 2, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_smc_da, tvb, offset+5, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+9, hf_scsi_smc_range_flags, ett_scsi_move, move_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } #define MT_ELEM 0x1 #define ST_ELEM 0x2 #define I_E_ELEM 0x3 #define DT_ELEM 0x4 static const value_string element_type_code_vals[] = { {0x0, "All element types"}, {MT_ELEM, "Medium transport element"}, {ST_ELEM, "Storage element"}, {I_E_ELEM, "Import/export element"}, {DT_ELEM, "Data transfer element"}, {0, NULL} }; static const value_string action_code_vals[] = { {0, "OPEN Import/Export Element"}, {1, "CLOSE Import/Export Element"}, {0, NULL} }; #define PVOLTAG 0x80 #define AVOLTAG 0x40 #define EXCEPT 0x04 #define ID_VALID 0x20 #define LU_VALID 0x10 #define SVALID 0x80 static void dissect_scsi_smc_volume_tag (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, int hf_vol_id, int hf_vol_seq_num) { guint8 *volid; int length; for (length = 32; length > 0; length--) { if (tvb_get_guint8(tvb, offset + length - 1) != ' ') break; } volid = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII); proto_tree_add_string(tree, hf_vol_id, tvb, offset, 32, volid); proto_tree_add_item(tree, hf_vol_seq_num, tvb, offset+34, 2, ENC_BIG_ENDIAN); } static void dissect_scsi_smc_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint elem_bytecnt, guint8 elem_type, guint8 voltag_flags) { guint8 flags; guint8 ident_len; proto_tree_add_item(tree, hf_scsi_smc_ea, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; elem_bytecnt -= 2; if (elem_bytecnt < 1) return; flags = tvb_get_guint8 (tvb, offset); switch (elem_type) { case MT_ELEM: proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA); break; case ST_ELEM: case DT_ELEM: proto_tree_add_item(tree, hf_scsi_smc_access, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA); break; case I_E_ELEM: proto_tree_add_item(tree, hf_scsi_smc_cmc, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_inenab, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_exenab, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_impexp, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_access, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA); break; } offset += 1; elem_bytecnt -= 1; if (elem_bytecnt < 1) return; offset += 1; /* reserved */ elem_bytecnt -= 1; if (elem_bytecnt < 2) return; if (flags & EXCEPT) { proto_tree_add_item(tree, hf_scsi_smc_additional_sense_code_qualifier, tvb, offset, 2, ENC_BIG_ENDIAN); } offset += 2; elem_bytecnt -= 2; if (elem_bytecnt < 3) return; switch (elem_type) { case DT_ELEM: flags = tvb_get_guint8 (tvb, offset); if (flags & LU_VALID) { proto_tree_add_item(tree, hf_scsi_smc_lun, tvb, offset, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(tree, hf_scsi_smc_not_bus, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_id_valid, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_lu_valid, tvb, offset, 1, ENC_NA); offset += 1; if (flags & ID_VALID) { proto_tree_add_item(tree, hf_scsi_smc_scsi_bus_address, tvb, offset, 1, ENC_BIG_ENDIAN); } offset += 1; offset += 1; /* reserved */ break; default: offset += 3; /* reserved */ break; } elem_bytecnt -= 3; if (elem_bytecnt < 3) return; flags = tvb_get_guint8 (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_svalid, tvb, offset, 1, ENC_NA); if (flags & SVALID) { proto_tree_add_item(tree, hf_scsi_smc_invert, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_scsi_smc_source_storage_element_address, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else { offset += 3; } elem_bytecnt -= 3; if (voltag_flags & PVOLTAG) { if (elem_bytecnt < 36) return; dissect_scsi_smc_volume_tag (tvb, pinfo, tree, offset, hf_scsi_smc_primary_vol_tag_id, hf_scsi_smc_primary_vol_seq_num); offset += 36; elem_bytecnt -= 36; } if (voltag_flags & AVOLTAG) { if (elem_bytecnt < 36) return; dissect_scsi_smc_volume_tag (tvb, pinfo, tree, offset, hf_scsi_smc_alternate_vol_tag_id, hf_scsi_smc_alternate_vol_seq_num); offset += 36; elem_bytecnt -= 36; } if (elem_bytecnt < 1) return; proto_tree_add_item(tree, hf_scsi_smc_code_set, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; elem_bytecnt -= 1; if (elem_bytecnt < 1) return; proto_tree_add_item(tree, hf_scsi_smc_identifier_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; elem_bytecnt -= 1; if (elem_bytecnt < 1) return; offset += 1; /* reserved */ elem_bytecnt -= 1; if (elem_bytecnt < 1) return; ident_len = tvb_get_guint8 (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_identifier_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; elem_bytecnt -= 1; if (ident_len != 0) { if (elem_bytecnt < ident_len) return; proto_tree_add_item(tree, hf_scsi_smc_identifier, tvb, offset, ident_len, ENC_NA); offset += ident_len; elem_bytecnt -= ident_len; } if (elem_bytecnt != 0) { proto_tree_add_item(tree, hf_scsi_smc_vendor_specific_data, tvb, offset, elem_bytecnt, ENC_NA); } } static void dissect_scsi_smc_elements (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint desc_bytecnt, guint8 elem_type, guint8 voltag_flags, guint16 elem_desc_len) { guint elem_bytecnt; while (desc_bytecnt != 0) { elem_bytecnt = elem_desc_len; if (elem_bytecnt > desc_bytecnt) elem_bytecnt = desc_bytecnt; if (elem_bytecnt < 2) break; dissect_scsi_smc_element (tvb, pinfo, tree, offset, elem_bytecnt, elem_type, voltag_flags); offset += elem_bytecnt; desc_bytecnt -= elem_bytecnt; } } void dissect_smc_readelementstatus (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint bytecnt, desc_bytecnt; guint8 elem_type; guint8 voltag_flags; guint16 elem_desc_len; if (!tree) return; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_smc_voltag, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_element_type_code_0F, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_smc_starting_element_address, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_smc_number_of_elements, tvb, offset+3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_smc_curdata, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_dvcid, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_allocation_length, tvb, offset+6, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { proto_tree_add_item(tree, hf_scsi_smc_first_element_address_reported, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_scsi_smc_number_of_elements_available, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset += 1; /* reserved */ bytecnt = tvb_get_ntoh24 (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_byte_count_of_report_available, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; while (bytecnt != 0) { elem_type = tvb_get_guint8 (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_element_type_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; bytecnt -= 1; if (bytecnt < 1) break; voltag_flags = tvb_get_guint8 (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_pvoltag, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_avoltag, tvb, offset, 1, ENC_NA); offset += 1; bytecnt -= 1; if (bytecnt < 2) break; elem_desc_len = tvb_get_ntohs (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_element_descriptor_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; bytecnt -= 2; if (bytecnt < 1) break; offset += 1; /* reserved */ bytecnt -= 1; if (bytecnt < 3) break; desc_bytecnt = tvb_get_ntoh24 (tvb, offset); proto_tree_add_item(tree, hf_scsi_smc_byte_count_of_descriptor_data_available, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; bytecnt -= 3; if (desc_bytecnt > bytecnt) desc_bytecnt = bytecnt; dissect_scsi_smc_elements (tvb, pinfo, tree, offset, desc_bytecnt, elem_type, voltag_flags, elem_desc_len); offset += desc_bytecnt; bytecnt -= desc_bytecnt; } } } /* SMC Commands */ static const value_string scsi_smc_vals[] = { /* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"}, /* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"}, /* 0x07 */ {SCSI_SMC_INITIALIZE_ELEMENT_STATUS , "Initialize Element Status"}, /* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"}, /* 0x15 */ {SCSI_SPC_MODESELECT6 , "Mode Select(6)"}, /* 0x16 */ {SCSI_SPC_RESERVE6 , "Reserve(6)"}, /* 0x17 */ {SCSI_SPC_RELEASE6 , "Release(6)"}, /* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"}, /* 0x1B */ {SCSI_SMC_OPENCLOSE_ELEMENT , "Open/Close Import/Export Element"}, /* 0x1C */ {SCSI_SPC_RCVDIAGRESULTS , "Receive Diagnostics Results"}, /* 0x1D */ {SCSI_SPC_SENDDIAG , "Send Diagnostic"}, /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"}, /* 0x2B */ {SCSI_SMC_POSITION_TO_ELEMENT , "Position To Element"}, /* 0x37 */ {SCSI_SMC_INITIALIZE_ELEMENT_STATUS_RANGE , "Initialize Element Status With Range"}, /* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"}, /* 0x3C */ {SCSI_SPC_READBUFFER , "Read Buffer"}, /* 0x40 */ {SCSI_SMC_EXCHANGE_MEDIUM , "Exchange Medium"}, /* 0x44 */ {SCSI_SMC_REPORT_VOLUME_TYPES_SUPPORTED , "Report Volume Types Supported"}, /* 0x4C */ {SCSI_SPC_LOGSELECT , "Log Select"}, /* 0x4D */ {SCSI_SPC_LOGSENSE , "Log Sense"}, /* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"}, /* 0x56 */ {SCSI_SPC_RESERVE10 , "Reserve(10)"}, /* 0x57 */ {SCSI_SPC_RELEASE10 , "Release(10)"}, /* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"}, /* 0x5E */ {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"}, /* 0x5F */ {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"}, /* 0x86 */ {SCSI_SPC_ACCESS_CONTROL_IN , "Access Control In"}, /* 0x87 */ {SCSI_SPC_ACCESS_CONTROL_OUT , "Access Control Out"}, /* 0x8C */ {SCSI_SMC_READ_ATTRIBUTE , "Read Attribute"}, /* 0x8D */ {SCSI_SMC_WRITE_ATTRIBUTE , "Write Attribute"}, /* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"}, /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"}, /* 0xA5 */ {SCSI_SMC_MOVE_MEDIUM , "Move Medium"}, /* 0xA7 */ {SCSI_SMC_MOVE_MEDIUM_ATTACHED , "Move Medium Attached"}, /* 0xB4 */ {SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED , "Read Element Status Attached"}, /* 0xB5 */ {SCSI_SMC_REQUEST_VOLUME_ELEMENT_ADDRESS , "Request Volume Element Address"}, /* 0xB6 */ {SCSI_SMC_SEND_VOLUME_TAG , "Send Volume Tag"}, /* 0xB8 */ {SCSI_SMC_READ_ELEMENT_STATUS , "Read Element Status"}, {0, NULL}, }; value_string_ext scsi_smc_vals_ext = VALUE_STRING_EXT_INIT(scsi_smc_vals); scsi_cdb_table_t scsi_smc_table[256] = { /*SPC 0x00*/{dissect_spc_testunitready}, /*SMC 0x01*/{NULL}, /*SMC 0x02*/{NULL}, /*SPC 0x03*/{dissect_spc_requestsense}, /*SMC 0x04*/{NULL}, /*SMC 0x05*/{NULL}, /*SMC 0x06*/{NULL}, /*SMC 0x07*/{dissect_smc_initialize_element_status}, /*SMC 0x08*/{NULL}, /*SMC 0x09*/{NULL}, /*SMC 0x0a*/{NULL}, /*SMC 0x0b*/{NULL}, /*SMC 0x0c*/{NULL}, /*SMC 0x0d*/{NULL}, /*SMC 0x0e*/{NULL}, /*SMC 0x0f*/{NULL}, /*SMC 0x10*/{NULL}, /*SMC 0x11*/{NULL}, /*SPC 0x12*/{dissect_spc_inquiry}, /*SMC 0x13*/{NULL}, /*SMC 0x14*/{NULL}, /*SPC 0x15*/{dissect_spc_modeselect6}, /*SPC 0x16*/{dissect_spc_reserve6}, /*SPC 0x17*/{dissect_spc_release6}, /*SMC 0x18*/{NULL}, /*SMC 0x19*/{NULL}, /*SPC 0x1a*/{dissect_spc_modesense6}, /*SMC 0x1b*/{dissect_smc_openclose_importexport_element}, /*SMC 0x1c*/{NULL}, /*SPC 0x1d*/{dissect_spc_senddiagnostic}, /*SMC 0x1e*/{dissect_spc_preventallowmediaremoval}, /*SMC 0x1f*/{NULL}, /*SMC 0x20*/{NULL}, /*SMC 0x21*/{NULL}, /*SMC 0x22*/{NULL}, /*SMC 0x23*/{NULL}, /*SMC 0x24*/{NULL}, /*SMC 0x25*/{NULL}, /*SMC 0x26*/{NULL}, /*SMC 0x27*/{NULL}, /*SMC 0x28*/{NULL}, /*SMC 0x29*/{NULL}, /*SMC 0x2a*/{NULL}, /*SMC 0x2b*/{dissect_smc_position_to_element}, /*SMC 0x2c*/{NULL}, /*SMC 0x2d*/{NULL}, /*SMC 0x2e*/{NULL}, /*SMC 0x2f*/{NULL}, /*SMC 0x30*/{NULL}, /*SMC 0x31*/{NULL}, /*SMC 0x32*/{NULL}, /*SMC 0x33*/{NULL}, /*SMC 0x34*/{NULL}, /*SMC 0x35*/{NULL}, /*SMC 0x36*/{NULL}, /*SMC 0x37*/{dissect_smc_initialize_element_status_with_range}, /*SMC 0x38*/{NULL}, /*SMC 0x39*/{NULL}, /*SMC 0x3a*/{NULL}, /*SPC 0x3b*/{dissect_spc_writebuffer}, /*SMC 0x3c*/{NULL}, /*SMC 0x3d*/{NULL}, /*SMC 0x3e*/{NULL}, /*SMC 0x3f*/{NULL}, /*SMC 0x40*/{NULL}, /*SMC 0x41*/{NULL}, /*SMC 0x42*/{NULL}, /*SMC 0x43*/{NULL}, /*SMC 0x44*/{NULL}, /*SMC 0x45*/{NULL}, /*SMC 0x46*/{NULL}, /*SMC 0x47*/{NULL}, /*SMC 0x48*/{NULL}, /*SMC 0x49*/{NULL}, /*SMC 0x4a*/{NULL}, /*SMC 0x4b*/{NULL}, /*SPC 0x4c*/{dissect_spc_logselect}, /*SPC 0x4d*/{dissect_spc_logsense}, /*SMC 0x4e*/{NULL}, /*SMC 0x4f*/{NULL}, /*SMC 0x50*/{NULL}, /*SMC 0x51*/{NULL}, /*SMC 0x52*/{NULL}, /*SMC 0x53*/{NULL}, /*SMC 0x54*/{NULL}, /*SPC 0x55*/{dissect_spc_modeselect10}, /*SPC 0x56*/{dissect_spc_reserve10}, /*SPC 0x57*/{dissect_spc_release10}, /*SMC 0x58*/{NULL}, /*SMC 0x59*/{NULL}, /*SPC 0x5a*/{dissect_spc_modesense10}, /*SMC 0x5b*/{NULL}, /*SMC 0x5c*/{NULL}, /*SMC 0x5d*/{NULL}, /*SPC 0x5e*/{dissect_spc_persistentreservein}, /*SPC 0x5f*/{dissect_spc_persistentreserveout}, /*SMC 0x60*/{NULL}, /*SMC 0x61*/{NULL}, /*SMC 0x62*/{NULL}, /*SMC 0x63*/{NULL}, /*SMC 0x64*/{NULL}, /*SMC 0x65*/{NULL}, /*SMC 0x66*/{NULL}, /*SMC 0x67*/{NULL}, /*SMC 0x68*/{NULL}, /*SMC 0x69*/{NULL}, /*SMC 0x6a*/{NULL}, /*SMC 0x6b*/{NULL}, /*SMC 0x6c*/{NULL}, /*SMC 0x6d*/{NULL}, /*SMC 0x6e*/{NULL}, /*SMC 0x6f*/{NULL}, /*SMC 0x70*/{NULL}, /*SMC 0x71*/{NULL}, /*SMC 0x72*/{NULL}, /*SMC 0x73*/{NULL}, /*SMC 0x74*/{NULL}, /*SMC 0x75*/{NULL}, /*SMC 0x76*/{NULL}, /*SMC 0x77*/{NULL}, /*SMC 0x78*/{NULL}, /*SMC 0x79*/{NULL}, /*SMC 0x7a*/{NULL}, /*SMC 0x7b*/{NULL}, /*SMC 0x7c*/{NULL}, /*SMC 0x7d*/{NULL}, /*SMC 0x7e*/{NULL}, /*SMC 0x7f*/{NULL}, /*SMC 0x80*/{NULL}, /*SMC 0x81*/{NULL}, /*SMC 0x82*/{NULL}, /*SMC 0x83*/{NULL}, /*SMC 0x84*/{NULL}, /*SMC 0x85*/{NULL}, /*SMC 0x86*/{NULL}, /*SMC 0x87*/{NULL}, /*SMC 0x88*/{NULL}, /*SMC 0x89*/{NULL}, /*SMC 0x8a*/{NULL}, /*SMC 0x8b*/{NULL}, /*SMC 0x8c*/{NULL}, /*SMC 0x8d*/{NULL}, /*SMC 0x8e*/{NULL}, /*SMC 0x8f*/{NULL}, /*SMC 0x90*/{NULL}, /*SMC 0x91*/{NULL}, /*SMC 0x92*/{NULL}, /*SMC 0x93*/{NULL}, /*SMC 0x94*/{NULL}, /*SMC 0x95*/{NULL}, /*SMC 0x96*/{NULL}, /*SMC 0x97*/{NULL}, /*SMC 0x98*/{NULL}, /*SMC 0x99*/{NULL}, /*SMC 0x9a*/{NULL}, /*SMC 0x9b*/{NULL}, /*SMC 0x9c*/{NULL}, /*SMC 0x9d*/{NULL}, /*SMC 0x9e*/{NULL}, /*SMC 0x9f*/{NULL}, /*SPC 0xa0*/{dissect_spc_reportluns}, /*SMC 0xa1*/{NULL}, /*SMC 0xa2*/{NULL}, /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in}, /*SMC 0xa4*/{NULL}, /*SMC 0xa5*/{dissect_smc_movemedium}, /*SMC 0xa6*/{dissect_smc_exchangemedium}, /*SMC 0xa7*/{dissect_smc_movemedium}, /*SMC 0xa8*/{NULL}, /*SMC 0xa9*/{NULL}, /*SMC 0xaa*/{NULL}, /*SMC 0xab*/{NULL}, /*SMC 0xac*/{NULL}, /*SMC 0xad*/{NULL}, /*SMC 0xae*/{NULL}, /*SMC 0xaf*/{NULL}, /*SMC 0xb0*/{NULL}, /*SMC 0xb1*/{NULL}, /*SMC 0xb2*/{NULL}, /*SMC 0xb3*/{NULL}, /*SMC 0xb4*/{dissect_smc_readelementstatus}, /*SMC 0xb5*/{NULL}, /*SMC 0xb6*/{NULL}, /*SMC 0xb7*/{NULL}, /*SMC 0xb8*/{dissect_smc_readelementstatus}, /*SMC 0xb9*/{NULL}, /*SMC 0xba*/{NULL}, /*SMC 0xbb*/{NULL}, /*SMC 0xbc*/{NULL}, /*SMC 0xbd*/{NULL}, /*SMC 0xbe*/{NULL}, /*SMC 0xbf*/{NULL}, /*SMC 0xc0*/{NULL}, /*SMC 0xc1*/{NULL}, /*SMC 0xc2*/{NULL}, /*SMC 0xc3*/{NULL}, /*SMC 0xc4*/{NULL}, /*SMC 0xc5*/{NULL}, /*SMC 0xc6*/{NULL}, /*SMC 0xc7*/{NULL}, /*SMC 0xc8*/{NULL}, /*SMC 0xc9*/{NULL}, /*SMC 0xca*/{NULL}, /*SMC 0xcb*/{NULL}, /*SMC 0xcc*/{NULL}, /*SMC 0xcd*/{NULL}, /*SMC 0xce*/{NULL}, /*SMC 0xcf*/{NULL}, /*SMC 0xd0*/{NULL}, /*SMC 0xd1*/{NULL}, /*SMC 0xd2*/{NULL}, /*SMC 0xd3*/{NULL}, /*SMC 0xd4*/{NULL}, /*SMC 0xd5*/{NULL}, /*SMC 0xd6*/{NULL}, /*SMC 0xd7*/{NULL}, /*SMC 0xd8*/{NULL}, /*SMC 0xd9*/{NULL}, /*SMC 0xda*/{NULL}, /*SMC 0xdb*/{NULL}, /*SMC 0xdc*/{NULL}, /*SMC 0xdd*/{NULL}, /*SMC 0xde*/{NULL}, /*SMC 0xdf*/{NULL}, /*SMC 0xe0*/{NULL}, /*SMC 0xe1*/{NULL}, /*SMC 0xe2*/{NULL}, /*SMC 0xe3*/{NULL}, /*SMC 0xe4*/{NULL}, /*SMC 0xe5*/{NULL}, /*SMC 0xe6*/{NULL}, /*SMC 0xe7*/{NULL}, /*SMC 0xe8*/{NULL}, /*SMC 0xe9*/{NULL}, /*SMC 0xea*/{NULL}, /*SMC 0xeb*/{NULL}, /*SMC 0xec*/{NULL}, /*SMC 0xed*/{NULL}, /*SMC 0xee*/{NULL}, /*SMC 0xef*/{NULL}, /*SMC 0xf0*/{NULL}, /*SMC 0xf1*/{NULL}, /*SMC 0xf2*/{NULL}, /*SMC 0xf3*/{NULL}, /*SMC 0xf4*/{NULL}, /*SMC 0xf5*/{NULL}, /*SMC 0xf6*/{NULL}, /*SMC 0xf7*/{NULL}, /*SMC 0xf8*/{NULL}, /*SMC 0xf9*/{NULL}, /*SMC 0xfa*/{NULL}, /*SMC 0xfb*/{NULL}, /*SMC 0xfc*/{NULL}, /*SMC 0xfd*/{NULL}, /*SMC 0xfe*/{NULL}, /*SMC 0xff*/{NULL} }; void proto_register_scsi_smc(void) { static hf_register_info hf[] = { { &hf_scsi_smc_opcode, {"SMC Opcode", "scsi_smc.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_smc_vals_ext, 0x0, NULL, HFILL} }, { &hf_scsi_smc_mta, {"Medium Transport Address", "scsi_smc.mta", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_sa, {"Source Address", "scsi_smc.sa", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_da, {"Destination Address", "scsi_smc.da", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_fda, {"First Destination Address", "scsi_smc.fda", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_sda, {"Second Destination Address", "scsi_smc.sda", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_medium_flags, {"Flags", "scsi_smc.medium_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_inv1, {"INV1", "scsi_smc.inv1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL} }, { &hf_scsi_smc_inv2, {"INV2", "scsi_smc.inv2", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL} }, { &hf_scsi_smc_range_flags, {"Flags", "scsi_smc.range_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_fast, {"FAST", "scsi_smc.fast", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL} }, { &hf_scsi_smc_range, {"RANGE", "scsi_smc.range", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL} }, #if 0 { &hf_scsi_smc_sea, {"Starting Element Address", "scsi_smc.sea", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, #endif { &hf_scsi_smc_num_elements, {"Number of Elements", "scsi_smc.num_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_invert, {"INVERT", "scsi_smc.invert", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL} }, { &hf_scsi_smc_ea, {"Element Address", "scsi_smc.ea", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_scsi_smc_action_code, {"Action Code", "scsi_smc.action_code", FT_UINT8, BASE_HEX, VALS(action_code_vals), 0x1f, NULL, HFILL} }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_scsi_smc_scsi_bus_address, { "SCSI Bus Address", "scsi_smc.scsi_bus_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_source_storage_element_address, { "Source Storage Element Address", "scsi_smc.source_storage_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_code_set, { "Code Set", "scsi_smc.code_set", FT_UINT8, BASE_DEC, VALS(scsi_devid_codeset_val), 0x0F, NULL, HFILL } }, { &hf_scsi_smc_identifier_type, { "Identifier Type", "scsi_smc.identifier_type", FT_UINT8, BASE_DEC, VALS(scsi_devid_idtype_val), 0x0F, NULL, HFILL } }, { &hf_scsi_smc_identifier_length, { "Identifier Length", "scsi_smc.identifier_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_identifier, { "Identifier", "scsi_smc.identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_vendor_specific_data, { "Vendor-specific Data", "scsi_smc.vendor_specific_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_voltag, { "VOLTAG", "scsi_smc.voltag", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_scsi_smc_starting_element_address, { "Starting Element Address", "scsi_smc.starting_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_number_of_elements, { "Number of Elements", "scsi_smc.number_of_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_curdata, { "CURDATA", "scsi_smc.curdata", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_scsi_smc_allocation_length, { "Allocation Length", "scsi_smc.allocation_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_first_element_address_reported, { "First Element Address Reported", "scsi_smc.first_element_address_reported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_number_of_elements_available, { "Number of Elements Available", "scsi_smc.number_of_elements_available", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_byte_count_of_report_available, { "Byte Count of Report Available", "scsi_smc.byte_count_of_report_available", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_element_type_code, { "Element Type Code", "scsi_smc.element_type_code", FT_UINT8, BASE_DEC, VALS(element_type_code_vals), 0x0, NULL, HFILL } }, { &hf_scsi_smc_element_type_code_0F, { "Element Type Code", "scsi_smc.element_type_code", FT_UINT8, BASE_DEC, VALS(element_type_code_vals), 0x0F, NULL, HFILL } }, { &hf_scsi_smc_pvoltag, { "PVOLTAG", "scsi_smc.pvoltag", FT_BOOLEAN, 8, NULL, PVOLTAG, NULL, HFILL } }, { &hf_scsi_smc_element_descriptor_length, { "Element Descriptor Length", "scsi_smc.element_descriptor_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_byte_count_of_descriptor_data_available, { "Byte Count Of Descriptor Data Available", "scsi_smc.byte_count_of_descriptor_data_available", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_except, { "EXCEPT", "scsi_smc.except", FT_BOOLEAN, 8, NULL, EXCEPT, NULL, HFILL } }, { &hf_scsi_smc_access, { "ACCESS", "scsi_smc.access", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_scsi_smc_cmc, { "cmc", "scsi_smc.cmc", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_scsi_smc_additional_sense_code_qualifier, { "Additional Sense Code+Qualifier", "scsi_smc.additional_sense_code_qualifier", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &scsi_asc_val_ext, 0x0, NULL, HFILL } }, { &hf_scsi_smc_not_bus, { "NOT BUS", "scsi_smc.not_bus", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_scsi_smc_id_valid, { "ID VALID", "scsi_smc.id_valid", FT_BOOLEAN, 8, NULL, ID_VALID, NULL, HFILL } }, { &hf_scsi_smc_lu_valid, { "LU VALID", "scsi_smc.lu_valid", FT_BOOLEAN, 8, NULL, LU_VALID, NULL, HFILL } }, { &hf_scsi_smc_svalid, { "SVALID", "scsi_smc.svalid", FT_BOOLEAN, 8, NULL, SVALID, NULL, HFILL } }, { &hf_scsi_smc_dvcid, { "DVCID", "scsi_smc.dvcid", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_scsi_smc_avoltag, { "AVOLTAG", "scsi_smc.pvoltag", FT_BOOLEAN, 8, NULL, AVOLTAG, NULL, HFILL } }, { &hf_scsi_smc_full, { "FULL", "scsi_smc.full", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_scsi_smc_exenab, { "EXENAB", "scsi_smc.exenab", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_scsi_smc_inenab, { "INENAB", "scsi_smc.inenab", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_scsi_smc_impexp, { "IMPEXP", "scsi_smc.impexp", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_scsi_smc_lun, { "LUN", "scsi_smc.lun", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL } }, { &hf_scsi_smc_primary_vol_tag_id, { "Primary Volume Identification", "scsi_smc.primary_vol_tag_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_alternate_vol_tag_id, { "Alternate Volume Identification", "scsi_smc.alternate_vol_tag_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_primary_vol_seq_num, { "Primary Volume Sequence Number", "scsi_smc.primary_vol_seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scsi_smc_alternate_vol_seq_num, { "Alternate Volume Sequence Number", "scsi_smc.alternate_vol_seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_scsi_exchange_medium, &ett_scsi_range, &ett_scsi_move }; /* Register the protocol name and description */ proto_scsi_smc = proto_register_protocol("SCSI_SMC", "SCSI_SMC", "scsi_smc"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_scsi_smc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-scsi-smc.h
/* packet-scsi-smc.h * Dissector for the SCSI SMC commandset * Extracted from packet-scsi.h * * Dinesh G Dutt ([email protected]) * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCSI_SMC_H_ #define __PACKET_SCSI_SMC_H_ #include "ws_symbol_export.h" /* SMC Commands */ #define SCSI_SMC_EXCHANGE_MEDIUM 0x40 #define SCSI_SMC_INITIALIZE_ELEMENT_STATUS 0x07 #define SCSI_SMC_INITIALIZE_ELEMENT_STATUS_RANGE 0x37 #define SCSI_SMC_MOVE_MEDIUM 0xA5 #define SCSI_SMC_MOVE_MEDIUM_ATTACHED 0xA7 #define SCSI_SMC_OPENCLOSE_ELEMENT 0x1B #define SCSI_SMC_POSITION_TO_ELEMENT 0x2B #define SCSI_SMC_READ_ATTRIBUTE 0x8C #define SCSI_SMC_READ_ELEMENT_STATUS 0xB8 #define SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED 0xB4 #define SCSI_SMC_REPORT_VOLUME_TYPES_SUPPORTED 0x44 #define SCSI_SMC_REQUEST_VOLUME_ELEMENT_ADDRESS 0xB5 #define SCSI_SMC_SEND_VOLUME_TAG 0xB6 #define SCSI_SMC_WRITE_ATTRIBUTE 0x8D void dissect_smc_movemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_smc_readelementstatus (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); extern int hf_scsi_smc_opcode; extern scsi_cdb_table_t scsi_smc_table[256]; WS_DLL_PUBLIC value_string_ext scsi_smc_vals_ext; #endif
C
wireshark/epan/dissectors/packet-scsi-ssc.c
/* based on SSC3 spec */ /* TODO: * dissect READPOSITION data * dissect REPORTDENSITYSUPPORT data */ /* packet-scsi-ssc.c * Dissector for the SCSI SSC commandset * Extracted from packet-scsi.c * * Dinesh G Dutt ([email protected]) * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <wsutil/str_util.h> #include "packet-scsi.h" #include "packet-scsi-ssc.h" #include "packet-scsi-smc.h" void proto_register_scsi_ssc(void); static int proto_scsi_ssc = -1; int hf_scsi_ssc_opcode = -1; static int hf_scsi_ssc_rdwr6_xferlen = -1; static int hf_scsi_ssc_ver16_verlen = -1; static int hf_scsi_ssc_locate10_loid = -1; static int hf_scsi_ssc_locate16_loid = -1; static int hf_scsi_ssc_space6_code = -1; static int hf_scsi_ssc_space6_count = -1; static int hf_scsi_ssc_space16_count = -1; static int hf_scsi_ssc_erase_flags = -1; static int hf_scsi_ssc_fcs = -1; static int hf_scsi_ssc_lcs = -1; static int hf_scsi_ssc_erase_immed = -1; static int hf_scsi_ssc_long = -1; static int hf_scsi_ssc_partition = -1; static int hf_scsi_ssc_lbi = -1; static int hf_scsi_ssc_verify = -1; static int hf_scsi_ssc_immed = -1; static int hf_scsi_ssc_formatmedium_flags = -1; static int hf_scsi_ssc_format = -1; static int hf_scsi_ssc_rdwr10_xferlen = -1; static int hf_scsi_ssc_loadunload_immed_flags = -1; static int hf_scsi_ssc_loadunload_flags = -1; static int hf_scsi_ssc_hold = -1; static int hf_scsi_ssc_eot = -1; static int hf_scsi_ssc_reten = -1; static int hf_scsi_ssc_load = -1; static int hf_scsi_ssc_locate_flags = -1; static int hf_scsi_ssc_bt = -1; static int hf_scsi_ssc_cp = -1; static int hf_scsi_ssc_dest_type = -1; static int hf_scsi_ssc_bam_flags = -1; static int hf_scsi_ssc_bam = -1; static int hf_scsi_ssc_read6_flags = -1; static int hf_scsi_ssc_sili = -1; static int hf_scsi_ssc_fixed = -1; static int hf_scsi_ssc_bytord = -1; static int hf_scsi_ssc_bytcmp = -1; static int hf_scsi_ssc_verify16_immed = -1; static int hf_scsi_ssc_medium_type = -1; static int hf_scsi_ssc_media = -1; static int hf_scsi_ssc_capacity_prop_value = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_scsi_ssc_readposition_block_number = -1; static int hf_scsi_ssc_readposition_file_number = -1; static int hf_scsi_ssc_readposition_parameter_len = -1; static int hf_scsi_ssc_readblocklimits_max_block_length_limit = -1; static int hf_scsi_ssc_readposition_set_number = -1; static int hf_scsi_ssc_readblocklimits_granularity = -1; static int hf_scsi_ssc_readposition_flags = -1; static int hf_scsi_ssc_readposition_bop = -1; static int hf_scsi_ssc_readposition_eop = -1; static int hf_scsi_ssc_readposition_mpu = -1; static int hf_scsi_ssc_readposition_bcu = -1; static int hf_scsi_ssc_readposition_bycu = -1; static int hf_scsi_ssc_readposition_bpu = -1; static int hf_scsi_ssc_readposition_perr = -1; static int hf_scsi_ssc_readposition_additional_length = -1; static int hf_scsi_ssc_readposition_num_blocks_buffer = -1; static int hf_scsi_ssc_readposition_last_block_location = -1; static int hf_scsi_ssc_erase6_immed = -1; static int hf_scsi_ssc_erase6_long = -1; static int hf_scsi_ssc_readblocklimits_min_block_length_limit = -1; static int hf_scsi_ssc_readposition_service_action = -1; static int hf_scsi_ssc_readposition_num_bytes_buffer = -1; static int hf_scsi_ssc_readposition_first_block_location = -1; static int hf_scsi_ssc_space16_parameter_len = -1; static int hf_scsi_ssc_readposition_partition_number = -1; static gint ett_scsi_erase = -1; static gint ett_scsi_formatmedium = -1; static gint ett_scsi_loadunload_immed = -1; static gint ett_scsi_loadunload = -1; static gint ett_scsi_locate = -1; static gint ett_scsi_bam = -1; static gint ett_scsi_read6 = -1; static gint ett_scsi_ssc_readposition_flags = -1; static void dissect_ssc_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const read6_fields[] = { &hf_scsi_ssc_sili, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, read6_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_recoverbuffereddata (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const recover_fields[] = { &hf_scsi_ssc_sili, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, recover_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_reportdensitysupport (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rd_fields[] = { &hf_scsi_ssc_medium_type, &hf_scsi_ssc_media, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if(!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, rd_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else { /* XXX decode the data */ } } static void dissect_ssc_readreverse6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rr6_fields[] = { &hf_scsi_ssc_bytord, &hf_scsi_ssc_sili, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, rr6_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const read6_fields[] = { &hf_scsi_ssc_sili, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, read6_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate16_loid, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+11, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const write16_fields[] = { &hf_scsi_ssc_fcs, &hf_scsi_ssc_lcs, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, write16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate16_loid, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+11, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_writefilemarks16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const wf16_fields[] = { &hf_scsi_ssc_fcs, &hf_scsi_ssc_lcs, &hf_scsi_ssc_immed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, wf16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate16_loid, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+11, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const verify16_fields[] = { &hf_scsi_ssc_verify16_immed, &hf_scsi_ssc_bytcmp, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, verify16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate16_loid, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_ver16_verlen, tvb, offset+11, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_verify6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const verify6_fields[] = { &hf_scsi_ssc_verify16_immed, &hf_scsi_ssc_bytcmp, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, verify6_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_ver16_verlen, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_readreverse16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rr16_fields[] = { &hf_scsi_ssc_bytord, &hf_scsi_ssc_sili, &hf_scsi_ssc_fixed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, rr16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate16_loid, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+11, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const write6_fields[] = { &hf_scsi_ssc_immed, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, write6_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_writefilemarks6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const wf6_fields[] = { &hf_scsi_ssc_immed, NULL }; if (isreq) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)", tvb_get_ntoh24 (tvb, offset+1)); } if (tree && isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, wf6_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_loadunload (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const loadunload_immed_fields[] = { &hf_scsi_ssc_immed, NULL }; static int * const loadunload_fields[] = { &hf_scsi_ssc_hold, &hf_scsi_ssc_eot, &hf_scsi_ssc_reten, &hf_scsi_ssc_load, NULL }; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)", tvb_get_guint8 (tvb, offset) & 0x01); } if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_loadunload_immed_flags, ett_scsi_loadunload_immed, loadunload_immed_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+3, hf_scsi_ssc_loadunload_flags, ett_scsi_loadunload, loadunload_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_readblocklimits (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 granularity; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!iscdb) { granularity = tvb_get_guint8 (tvb, offset); proto_tree_add_uint(tree, hf_scsi_ssc_readblocklimits_granularity, tvb, offset, 1, 1 << granularity); proto_tree_add_item(tree, hf_scsi_ssc_readblocklimits_max_block_length_limit, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc_readblocklimits_min_block_length_limit, tvb, offset+4, 2, ENC_BIG_ENDIAN); } } static void dissect_ssc_rewind (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const rewind_fields[] = { &hf_scsi_ssc_immed, NULL }; if (!tree) return; if (isreq && iscdb) { col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)", tvb_get_guint8 (tvb, offset) & 0x01); proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, rewind_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_setcapacity (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const sc_fields[] = { &hf_scsi_ssc_immed, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, sc_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_capacity_prop_value, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_locate10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const locate_fields[] = { &hf_scsi_ssc_bt, &hf_scsi_ssc_cp, &hf_scsi_ssc_immed, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_locate_flags, ett_scsi_locate, locate_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate10_loid, tvb, offset+2, 4, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_locate16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const locate_fields[] = { &hf_scsi_ssc_dest_type, &hf_scsi_ssc_cp, &hf_scsi_ssc_immed, NULL }; static int * const bam_fields[] = { &hf_scsi_ssc_bam, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_locate_flags, ett_scsi_locate, locate_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+1, hf_scsi_ssc_bam_flags, ett_scsi_bam, bam_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_locate16_loid, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_erase6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (isreq && iscdb) { if (!tree) return; proto_tree_add_item(tree, hf_scsi_ssc_erase6_immed, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc_erase6_long, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_erase16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const erase16_fields[] = { &hf_scsi_ssc_fcs, &hf_scsi_ssc_lcs, &hf_scsi_ssc_erase_immed, &hf_scsi_ssc_long, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_erase_flags, ett_scsi_erase, erase16_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_lbi, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_space6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_ssc_space6_code, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_space6_count, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_ssc_space16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_ssc_space6_code, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_space16_count, tvb, offset+3, 8, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc_space16_parameter_len, tvb, offset+11, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static const value_string space6_code_vals[] = { {0, "Logical Blocks"}, {1, "Filemarks"}, {2, "Sequential Filemarks"}, {3, "End-Of-Data"}, {0, NULL} }; static const value_string format_vals[] = { {0x0, "Use default format"}, {0x1, "Partition medium"}, {0x2, "Default format then partition"}, {0, NULL} }; static const value_string dest_type_vals[] = { {0, "Logical Object Identifier"}, {1, "Logical File Identifier"}, {0, NULL} }; static void dissect_ssc_formatmedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const formatmedium_fields[] = { &hf_scsi_ssc_verify, &hf_scsi_ssc_immed, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_formatmedium_flags, ett_scsi_formatmedium, formatmedium_fields, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_format, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, hf_scsi_ssc_rdwr10_xferlen, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } #define BCU 0x20 #define BYCU 0x10 #define MPU 0x08 #define BPU 0x04 static void dissect_ssc_readposition (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { gint service_action; guint8 flags; if (!tree) return; if (isreq && iscdb) { service_action = tvb_get_guint8 (tvb, offset) & 0x1F; proto_tree_add_item(tree, hf_scsi_ssc_readposition_service_action, tvb, offset, 1, ENC_BIG_ENDIAN); /* Remember the service action so we can decode the reply */ if (cdata != NULL) { cdata->itlq->flags = service_action; } proto_tree_add_item(tree, hf_scsi_ssc_readposition_parameter_len, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { if (cdata) service_action = cdata->itlq->flags; else service_action = -1; /* unknown */ switch (service_action) { case SHORT_FORM_BLOCK_ID: case SHORT_FORM_VENDOR_SPECIFIC: { static int * const block_id_flags[] = { &hf_scsi_ssc_readposition_bop, &hf_scsi_ssc_readposition_eop, &hf_scsi_ssc_readposition_bcu, &hf_scsi_ssc_readposition_bycu, &hf_scsi_ssc_readposition_bpu, &hf_scsi_ssc_readposition_perr, NULL }; flags = tvb_get_guint8 (tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_readposition_flags, ett_scsi_ssc_readposition_flags, block_id_flags, ENC_NA); offset += 1; proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; offset += 2; /* reserved */ if (!(flags & BPU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_first_block_location, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_ssc_readposition_last_block_location, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else offset += 8; offset += 1; /* reserved */ if (!(flags & BCU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_num_blocks_buffer, tvb, offset, 3, ENC_BIG_ENDIAN); } offset += 3; if (!(flags & BYCU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_num_bytes_buffer, tvb, offset, 4, ENC_BIG_ENDIAN); } /*offset += 4;*/ } break; case LONG_FORM: { static int * const long_form_flags[] = { &hf_scsi_ssc_readposition_bop, &hf_scsi_ssc_readposition_eop, &hf_scsi_ssc_readposition_mpu, &hf_scsi_ssc_readposition_bcu, NULL }; flags = tvb_get_guint8 (tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_readposition_flags, ett_scsi_ssc_readposition_flags, long_form_flags, ENC_NA); offset += 1; offset += 3; /* reserved */ if (!(flags & BPU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_partition_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_ssc_readposition_block_number, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; } else offset += 12; if (!(flags & MPU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_file_number, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_scsi_ssc_readposition_set_number, tvb, offset, 8, ENC_BIG_ENDIAN); /*offset += 8;*/ } else { /*offset += 16;*/ } } break; case EXTENDED_FORM: { static int * const extended_form_flags[] = { &hf_scsi_ssc_readposition_bop, &hf_scsi_ssc_readposition_eop, &hf_scsi_ssc_readposition_bcu, &hf_scsi_ssc_readposition_bycu, &hf_scsi_ssc_readposition_mpu, &hf_scsi_ssc_readposition_bpu, &hf_scsi_ssc_readposition_perr, NULL }; flags = tvb_get_guint8 (tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_readposition_flags, ett_scsi_ssc_readposition_flags, extended_form_flags, ENC_NA); offset += 1; proto_tree_add_item (tree, hf_scsi_ssc_partition, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_scsi_ssc_readposition_additional_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset += 1; /* reserved */ if (!(flags & BCU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_num_blocks_buffer, tvb, offset, 3, ENC_BIG_ENDIAN); } offset += 3; if (!(flags & BPU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_first_block_location, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_scsi_ssc_readposition_last_block_location, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; } else offset += 16; offset += 1; /* reserved */ if (!(flags & BYCU)) { proto_tree_add_item(tree, hf_scsi_ssc_readposition_num_bytes_buffer, tvb, offset, 8, ENC_BIG_ENDIAN); } /*offset += 8;*/ } break; default: break; } } } /* SSC Commands */ static const value_string scsi_ssc_vals[] = { /* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"}, /* 0x01 */ {SCSI_SSC_REWIND , "Rewind"}, /* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"}, /* 0x04 */ {SCSI_SSC_FORMAT_MEDIUM , "Format Medium"}, /* 0x05 */ {SCSI_SSC_READ_BLOCK_LIMITS , "Read Block Limits"}, /* 0x08 */ {SCSI_SSC_READ6 , "Read(6)"}, /* 0x0A */ {SCSI_SSC_WRITE6 , "Write(6)"}, /* 0x0B */ {SCSI_SSC_SET_CAPACITY , "Set Capacity"}, /* 0x0F */ {SCSI_SSC_READ_REVERSE_6 , "Read Reverse(6)"}, /* 0x10 */ {SCSI_SSC_WRITE_FILEMARKS_6 , "Write Filemarks(6)"}, /* 0x11 */ {SCSI_SSC_SPACE_6 , "Space(6)"}, /* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"}, /* 0x13 */ {SCSI_SSC_VERIFY_6 , "Verify(6)"}, /* 0x14 */ {SCSI_SSC_RECOVER_BUFFERED_DATA , "Recover Buffered Data"}, /* 0x15 */ {SCSI_SPC_MODESELECT6 , "Mode Select(6)"}, /* 0x16 */ {SCSI_SPC_RESERVE6 , "Reserve(6)"}, /* 0x17 */ {SCSI_SPC_RELEASE6 , "Release(6)"}, /* 0x19 */ {SCSI_SSC_ERASE_6 , "Erase(6)"}, /* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"}, /* 0x1B */ {SCSI_SSC_LOAD_UNLOAD , "Load Unload"}, /* 0x1D */ {SCSI_SPC_SENDDIAG , "Send Diagnostic"}, /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"}, /* 0x2B */ {SCSI_SSC_LOCATE_10 , "Locate(10)"}, /* 0x34 */ {SCSI_SSC_READ_POSITION , "Read Position"}, /* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"}, /* 0x44 */ {SCSI_SSC_REPORT_DENSITY_SUPPORT , "Report Density Support"}, /* 0x4C */ {SCSI_SPC_LOGSELECT , "Log Select"}, /* 0x4D */ {SCSI_SPC_LOGSENSE , "Log Sense"}, /* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"}, /* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"}, /* 0x5E */ {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"}, /* 0x5F */ {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"}, /* 0x80 */ {SCSI_SSC_WRITE_FILEMARKS_16 , "Write Filemarks(16)"}, /* 0x81 */ {SCSI_SSC_READ_REVERSE_16 , "Read Reverse(16)"}, /* 0x83 */ {SCSI_SPC_EXTCOPY , "Extended Copy"}, /* 0x88 */ {SCSI_SSC_READ_16 , "Read(16)"}, /* 0x8A */ {SCSI_SSC_WRITE_16 , "Write(16)"}, /* 0x8F */ {SCSI_SSC_VERIFY_16 , "Verify(16)"}, /* 0x91 */ {SCSI_SSC_SPACE_16 , "Space(16)"}, /* 0x92 */ {SCSI_SSC_LOCATE_16 , "Locate(16)"}, /* 0x93 */ {SCSI_SSC_ERASE_16 , "Erase(16)"}, /* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"}, /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"}, /* 0xA5 */ {SCSI_SMC_MOVE_MEDIUM , "Move Medium"}, /* 0xA7 */ {SCSI_SMC_MOVE_MEDIUM_ATTACHED , "Move Medium Attached"}, /* 0xB4 */ {SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED , "Read Element Status Attached"}, /* 0xB8 */ {SCSI_SMC_READ_ELEMENT_STATUS , "Read Element Status"}, {0, NULL} }; value_string_ext scsi_ssc_vals_ext = VALUE_STRING_EXT_INIT(scsi_ssc_vals); scsi_cdb_table_t scsi_ssc_table[256] = { /*SPC 0x00*/{dissect_spc_testunitready}, /*SSC 0x01*/{dissect_ssc_rewind}, /*SSC 0x02*/{NULL}, /*SPC 0x03*/{dissect_spc_requestsense}, /*SSC 0x04*/{dissect_ssc_formatmedium}, /*SSC 0x05*/{dissect_ssc_readblocklimits}, /*SSC 0x06*/{NULL}, /*SSC 0x07*/{NULL}, /*SSC 0x08*/{dissect_ssc_read6}, /*SSC 0x09*/{NULL}, /*SSC 0x0a*/{dissect_ssc_write6}, /*SSC 0x0b*/{dissect_ssc_setcapacity}, /*SSC 0x0c*/{NULL}, /*SSC 0x0d*/{NULL}, /*SSC 0x0e*/{NULL}, /*SSC 0x0f*/{dissect_ssc_readreverse6}, /*SSC 0x10*/{dissect_ssc_writefilemarks6}, /*SSC 0x11*/{dissect_ssc_space6}, /*SPC 0x12*/{dissect_spc_inquiry}, /*SSC 0x13*/{dissect_ssc_verify6}, /*SSC 0x14*/{dissect_ssc_recoverbuffereddata}, /*SPC 0x15*/{dissect_spc_modeselect6}, /*SSC 0x16*/{dissect_spc_reserve6}, /*SSC 0x17*/{dissect_spc_release6}, /*SSC 0x18*/{NULL}, /*SSC 0x19*/{dissect_ssc_erase6}, /*SPC 0x1a*/{dissect_spc_modesense6}, /*SSC 0x1b*/{dissect_ssc_loadunload}, /*SSC 0x1c*/{NULL}, /*SPC 0x1d*/{dissect_spc_senddiagnostic}, /*SSC 0x1e*/{dissect_spc_preventallowmediaremoval}, /*SSC 0x1f*/{NULL}, /*SSC 0x20*/{NULL}, /*SSC 0x21*/{NULL}, /*SSC 0x22*/{NULL}, /*SSC 0x23*/{NULL}, /*SSC 0x24*/{NULL}, /*SSC 0x25*/{NULL}, /*SSC 0x26*/{NULL}, /*SSC 0x27*/{NULL}, /*SSC 0x28*/{NULL}, /*SSC 0x29*/{NULL}, /*SSC 0x2a*/{NULL}, /*SSC 0x2b*/{dissect_ssc_locate10}, /*SSC 0x2c*/{NULL}, /*SSC 0x2d*/{NULL}, /*SSC 0x2e*/{NULL}, /*SSC 0x2f*/{NULL}, /*SSC 0x30*/{NULL}, /*SSC 0x31*/{NULL}, /*SSC 0x32*/{NULL}, /*SSC 0x33*/{NULL}, /*SSC 0x34*/{dissect_ssc_readposition}, /*SSC 0x35*/{NULL}, /*SSC 0x36*/{NULL}, /*SSC 0x37*/{NULL}, /*SSC 0x38*/{NULL}, /*SSC 0x39*/{NULL}, /*SSC 0x3a*/{NULL}, /*SPC 0x3b*/{dissect_spc_writebuffer}, /*SSC 0x3c*/{NULL}, /*SSC 0x3d*/{NULL}, /*SSC 0x3e*/{NULL}, /*SSC 0x3f*/{NULL}, /*SSC 0x40*/{NULL}, /*SSC 0x41*/{NULL}, /*SSC 0x42*/{NULL}, /*SSC 0x43*/{NULL}, /*SSC 0x44*/{dissect_ssc_reportdensitysupport}, /*SSC 0x45*/{NULL}, /*SSC 0x46*/{NULL}, /*SSC 0x47*/{NULL}, /*SSC 0x48*/{NULL}, /*SSC 0x49*/{NULL}, /*SSC 0x4a*/{NULL}, /*SSC 0x4b*/{NULL}, /*SPC 0x4c*/{dissect_spc_logselect}, /*SPC 0x4d*/{dissect_spc_logsense}, /*SSC 0x4e*/{NULL}, /*SSC 0x4f*/{NULL}, /*SSC 0x50*/{NULL}, /*SSC 0x51*/{NULL}, /*SSC 0x52*/{NULL}, /*SSC 0x53*/{NULL}, /*SSC 0x54*/{NULL}, /*SPC 0x55*/{dissect_spc_modeselect10}, /*SSC 0x56*/{NULL}, /*SSC 0x57*/{NULL}, /*SSC 0x58*/{NULL}, /*SSC 0x59*/{NULL}, /*SPC 0x5a*/{dissect_spc_modesense10}, /*SSC 0x5b*/{NULL}, /*SSC 0x5c*/{NULL}, /*SSC 0x5d*/{NULL}, /*SPC 0x5e*/{dissect_spc_persistentreservein}, /*SPC 0x5f*/{dissect_spc_persistentreserveout}, /*SSC 0x60*/{NULL}, /*SSC 0x61*/{NULL}, /*SSC 0x62*/{NULL}, /*SSC 0x63*/{NULL}, /*SSC 0x64*/{NULL}, /*SSC 0x65*/{NULL}, /*SSC 0x66*/{NULL}, /*SSC 0x67*/{NULL}, /*SSC 0x68*/{NULL}, /*SSC 0x69*/{NULL}, /*SSC 0x6a*/{NULL}, /*SSC 0x6b*/{NULL}, /*SSC 0x6c*/{NULL}, /*SSC 0x6d*/{NULL}, /*SSC 0x6e*/{NULL}, /*SSC 0x6f*/{NULL}, /*SSC 0x70*/{NULL}, /*SSC 0x71*/{NULL}, /*SSC 0x72*/{NULL}, /*SSC 0x73*/{NULL}, /*SSC 0x74*/{NULL}, /*SSC 0x75*/{NULL}, /*SSC 0x76*/{NULL}, /*SSC 0x77*/{NULL}, /*SSC 0x78*/{NULL}, /*SSC 0x79*/{NULL}, /*SSC 0x7a*/{NULL}, /*SSC 0x7b*/{NULL}, /*SSC 0x7c*/{NULL}, /*SSC 0x7d*/{NULL}, /*SSC 0x7e*/{NULL}, /*SSC 0x7f*/{NULL}, /*SSC 0x80*/{dissect_ssc_writefilemarks16}, /*SSC 0x81*/{dissect_ssc_readreverse16}, /*SSC 0x82*/{NULL}, /*SPC 0x83*/{dissect_spc_extcopy}, /*SSC 0x84*/{NULL}, /*SSC 0x85*/{NULL}, /*SSC 0x86*/{NULL}, /*SSC 0x87*/{NULL}, /*SSC 0x88*/{dissect_ssc_read16}, /*SSC 0x89*/{NULL}, /*SSC 0x8a*/{dissect_ssc_write16}, /*SSC 0x8b*/{NULL}, /*SSC 0x8c*/{NULL}, /*SSC 0x8d*/{NULL}, /*SSC 0x8e*/{NULL}, /*SSC 0x8f*/{dissect_ssc_verify16}, /*SSC 0x90*/{NULL}, /*SSC 0x91*/{dissect_ssc_space16}, /*SSC 0x92*/{dissect_ssc_locate16}, /*SSC 0x93*/{dissect_ssc_erase16}, /*SSC 0x94*/{NULL}, /*SSC 0x95*/{NULL}, /*SSC 0x96*/{NULL}, /*SSC 0x97*/{NULL}, /*SSC 0x98*/{NULL}, /*SSC 0x99*/{NULL}, /*SSC 0x9a*/{NULL}, /*SSC 0x9b*/{NULL}, /*SSC 0x9c*/{NULL}, /*SSC 0x9d*/{NULL}, /*SSC 0x9e*/{NULL}, /*SSC 0x9f*/{NULL}, /*SPC 0xa0*/{dissect_spc_reportluns}, /*SSC 0xa1*/{NULL}, /*SSC 0xa2*/{NULL}, /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in}, /*SSC 0xa4*/{NULL}, /*SSC 0xa5*/{dissect_smc_movemedium}, /*SSC 0xa6*/{NULL}, /*SSC 0xa7*/{dissect_smc_movemedium}, /*SSC 0xa8*/{NULL}, /*SSC 0xa9*/{NULL}, /*SSC 0xaa*/{NULL}, /*SSC 0xab*/{NULL}, /*SSC 0xac*/{NULL}, /*SSC 0xad*/{NULL}, /*SSC 0xae*/{NULL}, /*SSC 0xaf*/{NULL}, /*SSC 0xb0*/{NULL}, /*SSC 0xb1*/{NULL}, /*SSC 0xb2*/{NULL}, /*SSC 0xb3*/{NULL}, /*SSC 0xb4*/{dissect_smc_readelementstatus}, /*SSC 0xb5*/{NULL}, /*SSC 0xb6*/{NULL}, /*SSC 0xb7*/{NULL}, /*SSC 0xb8*/{dissect_smc_readelementstatus}, /*SSC 0xb9*/{NULL}, /*SSC 0xba*/{NULL}, /*SSC 0xbb*/{NULL}, /*SSC 0xbc*/{NULL}, /*SSC 0xbd*/{NULL}, /*SSC 0xbe*/{NULL}, /*SSC 0xbf*/{NULL}, /*SSC 0xc0*/{NULL}, /*SSC 0xc1*/{NULL}, /*SSC 0xc2*/{NULL}, /*SSC 0xc3*/{NULL}, /*SSC 0xc4*/{NULL}, /*SSC 0xc5*/{NULL}, /*SSC 0xc6*/{NULL}, /*SSC 0xc7*/{NULL}, /*SSC 0xc8*/{NULL}, /*SSC 0xc9*/{NULL}, /*SSC 0xca*/{NULL}, /*SSC 0xcb*/{NULL}, /*SSC 0xcc*/{NULL}, /*SSC 0xcd*/{NULL}, /*SSC 0xce*/{NULL}, /*SSC 0xcf*/{NULL}, /*SSC 0xd0*/{NULL}, /*SSC 0xd1*/{NULL}, /*SSC 0xd2*/{NULL}, /*SSC 0xd3*/{NULL}, /*SSC 0xd4*/{NULL}, /*SSC 0xd5*/{NULL}, /*SSC 0xd6*/{NULL}, /*SSC 0xd7*/{NULL}, /*SSC 0xd8*/{NULL}, /*SSC 0xd9*/{NULL}, /*SSC 0xda*/{NULL}, /*SSC 0xdb*/{NULL}, /*SSC 0xdc*/{NULL}, /*SSC 0xdd*/{NULL}, /*SSC 0xde*/{NULL}, /*SSC 0xdf*/{NULL}, /*SSC 0xe0*/{NULL}, /*SSC 0xe1*/{NULL}, /*SSC 0xe2*/{NULL}, /*SSC 0xe3*/{NULL}, /*SSC 0xe4*/{NULL}, /*SSC 0xe5*/{NULL}, /*SSC 0xe6*/{NULL}, /*SSC 0xe7*/{NULL}, /*SSC 0xe8*/{NULL}, /*SSC 0xe9*/{NULL}, /*SSC 0xea*/{NULL}, /*SSC 0xeb*/{NULL}, /*SSC 0xec*/{NULL}, /*SSC 0xed*/{NULL}, /*SSC 0xee*/{NULL}, /*SSC 0xef*/{NULL}, /*SSC 0xf0*/{NULL}, /*SSC 0xf1*/{NULL}, /*SSC 0xf2*/{NULL}, /*SSC 0xf3*/{NULL}, /*SSC 0xf4*/{NULL}, /*SSC 0xf5*/{NULL}, /*SSC 0xf6*/{NULL}, /*SSC 0xf7*/{NULL}, /*SSC 0xf8*/{NULL}, /*SSC 0xf9*/{NULL}, /*SSC 0xfa*/{NULL}, /*SSC 0xfb*/{NULL}, /*SSC 0xfc*/{NULL}, /*SSC 0xfd*/{NULL}, /*SSC 0xfe*/{NULL}, /*SSC 0xff*/{NULL} }; void proto_register_scsi_ssc(void) { static hf_register_info hf[] = { { &hf_scsi_ssc_opcode, {"SSC Opcode", "scsi_ssc.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_ssc_vals_ext, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_rdwr6_xferlen, {"Transfer Length", "scsi_ssc.rdwr6.xferlen", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_ver16_verlen, {"Verification Length", "scsi_ssc.verify16.verify_len", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_locate10_loid, {"Logical Object Identifier", "scsi_ssc.locate10.loid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_locate16_loid, {"Logical Identifier", "scsi_ssc.locate16.loid", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_space6_count, {"Count", "scsi_ssc.space6.count", FT_INT24, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_space6_code, {"Code", "scsi_ssc.space6.code", FT_UINT8, BASE_HEX, VALS(space6_code_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_ssc_space16_count, {"Count", "scsi_ssc.space16.count", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_rdwr10_xferlen, {"Transfer Length", "scsi_ssc.rdwr10.xferlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_erase_flags, {"Flags", "scsi_ssc.erase_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_fcs, {"FCS", "scsi_ssc.fcs", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_ssc_lcs, {"LCS", "scsi_ssc.lcs", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_ssc_erase_immed, {"IMMED", "scsi_ssc.erase_immed", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_long, {"LONG", "scsi_ssc.long", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_ssc_partition, {"Partition", "scsi_ssc.partition", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_lbi, {"Logical Block Identifier", "scsi_ssc.lbi", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_verify, {"VERIFY", "scsi_ssc.verify", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_immed, {"IMMED", "scsi_ssc.immed", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_ssc_formatmedium_flags, {"Flags", "scsi_ssc.formatmedium_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_format, {"Format", "scsi_ssc.format", FT_UINT8, BASE_HEX, VALS(format_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_ssc_loadunload_immed_flags, {"Immed", "scsi_ssc.loadunload_immed_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_loadunload_flags, {"Flags", "scsi_ssc.loadunload_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_hold, {"HOLD", "scsi_ssc.hold", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, { &hf_scsi_ssc_eot, {"EOT", "scsi_ssc.eot", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_ssc_reten, {"RETEN", "scsi_ssc.reten", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_load, {"LOAD", "scsi_ssc.load", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_ssc_locate_flags, {"Flags", "scsi_ssc.locate_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_bt, {"BT", "scsi_ssc.bt", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_ssc_cp, {"CP", "scsi_ssc.cp", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_dest_type, {"Dest Type", "scsi_ssc.dest_type", FT_UINT8, BASE_HEX, VALS(dest_type_vals), 0x18, NULL, HFILL}}, { &hf_scsi_ssc_bam_flags, {"Flags", "scsi_ssc.bam_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_bam, {"BAM", "scsi_ssc.bam", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_ssc_read6_flags, {"Flags", "scsi_ssc.read6_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ssc_sili, {"SILI", "scsi_ssc.sili", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_fixed, {"FIXED", "scsi_ssc.fixed", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_ssc_bytord, {"BYTORD", "scsi_ssc.bytord", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_ssc_bytcmp, {"BYTCMP", "scsi_ssc.bytcmp", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_verify16_immed, {"IMMED", "scsi_ssc.verify16_immed", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_ssc_medium_type, {"Medium Type", "scsi_ssc.medium_type", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_ssc_media, {"Media", "scsi_ssc.media", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_ssc_capacity_prop_value, {"Capacity Proportion Value", "scsi_ssc.cpv", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_scsi_ssc_readblocklimits_granularity, { "Granularity", "scsi_ssc.readblocklimits.granularity", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readblocklimits_max_block_length_limit, { "Maximum Block Length Limit", "scsi_ssc.readblocklimits.max_block_length_limit", FT_UINT24, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readblocklimits_min_block_length_limit, { "Minimum Block Length Limit", "scsi_ssc.readblocklimits.min_block_length_limit", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_erase6_immed, { "IMMED", "scsi_ssc.erase6.immed", FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_ssc_erase6_long, { "LONG", "scsi_ssc.erase6.long", FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_ssc_space16_parameter_len, { "Parameter Len", "scsi_ssc.space16.parameter_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_service_action, { "Service Action", "scsi_ssc.readposition.service_action", FT_UINT8, BASE_DEC, VALS(service_action_vals), 0x1F, NULL, HFILL }}, { &hf_scsi_ssc_readposition_parameter_len, { "Parameter Len", "scsi_ssc.readposition.parameter_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_flags, { "Flags", "scsi_ssc.readposition.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_bop, { "BOP", "scsi_ssc.readposition.bop", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_ssc_readposition_eop, { "EOP", "scsi_ssc.readposition.eop", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_ssc_readposition_mpu, { "EOP", "scsi_ssc.readposition.mpu", FT_UINT8, BASE_DEC, NULL, MPU, NULL, HFILL }}, { &hf_scsi_ssc_readposition_bcu, { "BCU", "scsi_ssc.readposition.bcu", FT_UINT8, BASE_DEC, NULL, BCU, NULL, HFILL }}, { &hf_scsi_ssc_readposition_bycu, { "BYCU", "scsi_ssc.readposition.bycu", FT_UINT8, BASE_DEC, NULL, BYCU, NULL, HFILL }}, { &hf_scsi_ssc_readposition_bpu, { "BPU", "scsi_ssc.readposition.bpu", FT_UINT8, BASE_DEC, NULL, BPU, NULL, HFILL }}, { &hf_scsi_ssc_readposition_perr, { "PERR", "scsi_ssc.readposition.perr", FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_ssc_readposition_first_block_location, { "First Block Location", "scsi_ssc.readposition.first_block_location", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_last_block_location, { "Last Block Location", "scsi_ssc.readposition.last_block_location", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_num_blocks_buffer, { "Number of Blocks in Buffer", "scsi_ssc.readposition.num_blocks_buffer", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_num_bytes_buffer, { "Number of Bytes in Buffer", "scsi_ssc.readposition.num_bytes_buffer", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_partition_number, { "Partition Number", "scsi_ssc.readposition.partition_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_block_number, { "Block Number", "scsi_ssc.readposition.block_number", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_file_number, { "File Number", "scsi_ssc.readposition.file_number", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_set_number, { "Set Number", "scsi_ssc.readposition.set_number", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc_readposition_additional_length, { "Additional Length", "scsi_ssc.readposition.additional_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_scsi_erase, &ett_scsi_formatmedium, &ett_scsi_loadunload_immed, &ett_scsi_loadunload, &ett_scsi_locate, &ett_scsi_bam, &ett_scsi_read6, &ett_scsi_ssc_readposition_flags }; /* Register the protocol name and description */ proto_scsi_ssc = proto_register_protocol("SCSI_SSC", "SCSI_SSC", "scsi_ssc"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_scsi_ssc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-scsi-ssc.h
/* packet-scsi-ssc.h * Dissector for the SCSI SSC commandset * Extracted from packet-scsi.h * * Dinesh G Dutt ([email protected]) * Ronnie sahlberg 2006 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCSI_SSC_H_ #define __PACKET_SCSI_SSC_H_ #include "ws_symbol_export.h" /* SSC Commands */ #define SCSI_SSC_REWIND 0x01 #define SCSI_SSC_FORMAT_MEDIUM 0x04 #define SCSI_SSC_READ_BLOCK_LIMITS 0x05 #define SCSI_SSC_READ6 0x08 #define SCSI_SSC_WRITE6 0x0A #define SCSI_SSC_SET_CAPACITY 0x0B #define SCSI_SSC_READ_REVERSE_6 0x0F #define SCSI_SSC_WRITE_FILEMARKS_6 0x10 #define SCSI_SSC_SPACE_6 0x11 #define SCSI_SSC_VERIFY_6 0x13 #define SCSI_SSC_RECOVER_BUFFERED_DATA 0x14 #define SCSI_SSC_ERASE_6 0x19 #define SCSI_SSC_LOAD_UNLOAD 0x1B #define SCSI_SSC_LOCATE_10 0x2B #define SCSI_SSC_READ_POSITION 0x34 #define SCSI_SSC_REPORT_DENSITY_SUPPORT 0x44 #define SCSI_SSC_WRITE_FILEMARKS_16 0x80 #define SCSI_SSC_READ_REVERSE_16 0x81 #define SCSI_SSC_READ_16 0x88 #define SCSI_SSC_WRITE_16 0x8A #define SCSI_SSC_VERIFY_16 0x8F #define SCSI_SSC_SPACE_16 0x91 #define SCSI_SSC_LOCATE_16 0x92 #define SCSI_SSC_ERASE_16 0x93 extern int hf_scsi_ssc_opcode; extern scsi_cdb_table_t scsi_ssc_table[256]; WS_DLL_PUBLIC value_string_ext scsi_ssc_vals_ext; #endif
C
wireshark/epan/dissectors/packet-scsi.c
/* TODO make the contracts require that all functions be called with valid * pointers for itl and itlq and remove all tests for itl/itlq being NULL */ /* TODO audit value parameter for proto_tree_add_boolean() calls */ /* packet-scsi.c * Routines for decoding SCSI CDBs and responsess * Author: Dinesh G Dutt ([email protected]) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Some Notes on using the SCSI Decoder: * * The SCSI decoder has been built right now so that it is invoked directly by the * SCSI transport layers as compared to the standard mechanism of being invoked * via a dissector chain. There are multiple reasons for this: * - The SCSI CDB is typically embedded inside the transport along with other * header fields that have nothing to do with SCSI. So, it is required to be * done this way. * - Originally, Wireshark couldn't do filtering on protocol trees that were not * on the top level. * * There are four main routines that are provided: * o dissect_scsi_cdb - invoked on receiving a SCSI Command * void dissect_scsi_cdb(tvbuff_t *, packet_info *, proto_tree *, * guint, itlq_nexus_t *, itl_nexus_t *); * o dissect_scsi_payload - invoked to decode SCSI responses * void dissect_scsi_payload(tvbuff_t *, packet_info *, proto_tree *, guint, * gboolean, itlq_nexusu_t *, itl_nexus_t *, * guint32 relative_offset); * The final parameter is the length of the response field that is negotiated * as part of the SCSI transport layer. If this is not tracked by the * transport, it can be set to 0. * o dissect_scsi_rsp - invoked to dissect the scsi status code in a response * SCSI task. * void dissect_scsi_rsp(tvbuff_t *, packet_info *, proto_tree *, * itlq_nexus_t *, itl_nexus_t *, guint8); * o dissect_scsi_snsinfo - invoked to decode the sense data provided in case of * an error. * void dissect_scsi_snsinfo(tvbuff_t *, packet_info *, proto_tree *, guint, * guint, itlq_nexus_t *, itl_nexus_t *); * * In addition to this, the other requirement made from the transport is to * provide ITL and ITLQ structures that are persistent. * * The ITL structure uniquely identifies a Initiator/Target/Lun combination * and is among other things used to keep track of the device type for a * specific LUN. * * The ITLQ structure uniquely identifies a specific scsi task and is used to * keep track of OPCODEs between CDB/DATA/Responses and resp[onse times. * * This decoder attempts to track the type of SCSI device based on the response * to the Inquiry command. If the trace does not contain an Inquiry command, * the decoding of the commands is done as per a user preference. Currently, * only SBC (disks) and SSC (tapes) are the alternatives offered. The basic * SCSI command set (SPC-2/3) is decoded for all SCSI devices. If there is a * mixture of devices in the trace, some with Inquiry response and some * without, the user preference is used only for those devices whose type the * decoder has not been able to determine. * */ #include "config.h" #include <stdio.h> /* for sscanf() */ #include <epan/packet.h> #include <epan/to_str.h> #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/tap.h> #include <epan/reassemble.h> #include <epan/expert.h> #include "packet-scsi.h" #include "packet-scsi-osd.h" #include "packet-scsi-mmc.h" #include "packet-scsi-sbc.h" #include "packet-scsi-ssc.h" #include "packet-scsi-smc.h" void proto_register_scsi(void); static int proto_scsi = -1; static int hf_scsi_inq_control_vendor_specific = -1; static int hf_scsi_inq_control_reserved = -1; static int hf_scsi_inq_control_naca = -1; static int hf_scsi_inq_control_obs1 = -1; static int hf_scsi_inq_control_obs2 = -1; static int hf_scsi_inq_control = -1; static int hf_scsi_control_vendor_specific = -1; static int hf_scsi_control_reserved = -1; static int hf_scsi_control_naca = -1; static int hf_scsi_control_obs1 = -1; static int hf_scsi_control_obs2 = -1; int hf_scsi_control = -1; int hf_scsi_alloclen16 = -1; static int hf_scsi_alloclen32 = -1; static int hf_scsi_time = -1; static int hf_scsi_request_frame = -1; static int hf_scsi_response_frame = -1; static int hf_scsi_status = -1; static int hf_scsi_spcopcode = -1; static int hf_scsi_inquiry_flags = -1; static int hf_scsi_inquiry_evpd_page = -1; static int hf_scsi_inquiry_cmdt_page = -1; static int hf_scsi_alloclen = -1; static int hf_scsi_paramlen = -1; static int hf_scsi_paramlen16 = -1; static int hf_scsi_modesel_flags = -1; static int hf_scsi_modesns_pc = -1; static int hf_scsi_modepage_ps = -1; static int hf_scsi_modepage_spf = -1; static int hf_scsi_modepage_plen = -1; static int hf_scsi_modepage_tcmos = -1; static int hf_scsi_modepage_scsip = -1; static int hf_scsi_modepage_ialuae = -1; static int hf_scsi_modepage_icp = -1; static int hf_scsi_modepage_msdl = -1; static int hf_scsi_spc_pagecode = -1; static int hf_scsi_spc_subpagecode = -1; static int hf_scsi_sbcpagecode = -1; static int hf_scsi_sscpagecode = -1; static int hf_scsi_smcpagecode = -1; static int hf_scsi_mmcpagecode = -1; static int hf_scsi_modesns_flags = -1; static int hf_scsi_persresvin_svcaction = -1; static int hf_scsi_persresvout_svcaction = -1; static int hf_scsi_persresv_scope = -1; static int hf_scsi_persresv_type = -1; static int hf_scsi_persresvout_reskey = -1; static int hf_scsi_persresvout_sareskey = -1; static int hf_scsi_persresvout_obsolete = -1; static int hf_scsi_persresvout_control = -1; static int hf_scsi_persresvout_rel_tpi = -1; static int hf_scsi_persresvout_transportid_len = -1; static int hf_scsi_persresvout_transportid = -1; static int hf_scsi_persresv_control_rsvd = -1; static int hf_scsi_persresv_control_rsvd1 = -1; static int hf_scsi_persresv_control_rsvd2 = -1; static int hf_scsi_persresv_control_spec_i_pt = -1; static int hf_scsi_persresv_control_all_tg_pt = -1; static int hf_scsi_persresv_control_aptpl = -1; static int hf_scsi_persresv_control_unreg = -1; static int hf_scsi_release_flags = -1; static int hf_scsi_release_thirdpartyid = -1; static int hf_scsi_select_report = -1; static int hf_scsi_inq_add_len = -1; static int hf_scsi_inq_peripheral = -1; static int hf_scsi_inq_qualifier = -1; static int hf_scsi_inq_vendor_id = -1; static int hf_scsi_inq_product_id = -1; static int hf_scsi_inq_product_rev = -1; static int hf_scsi_inq_vendor_specific = -1; static int hf_scsi_inq_version_desc = -1; static int hf_scsi_inq_devtype = -1; static int hf_scsi_inq_rmb = -1; static int hf_scsi_inq_version = -1; static int hf_scsi_lun_address_mode = -1; static int hf_scsi_lun = -1; static int hf_scsi_lun_extended = -1; static int hf_scsi_extended_add_method_len = -1; static int hf_scsi_extended_add_method = -1; static int hf_scsi_bus = -1; static int hf_scsi_target = -1; static int hf_scsi_modesns_errrep = -1; static int hf_scsi_modesns_tst = -1; static int hf_scsi_modesns_qmod = -1; static int hf_scsi_modesns_qerr = -1; static int hf_scsi_modesns_rac = -1; static int hf_scsi_modesns_tas = -1; static int hf_scsi_protocol = -1; static int hf_scsi_sns_errtype = -1; static int hf_scsi_snskey = -1; static int hf_scsi_snsinfo = -1; static int hf_scsi_addlsnslen = -1; static int hf_scsi_asc = -1; static int hf_scsi_ascascq = -1; static int hf_scsi_ascq = -1; static int hf_scsi_fru = -1; static int hf_scsi_sksv = -1; static int hf_scsi_sks_info = -1; static int hf_scsi_sks_fp_cd = -1; static int hf_scsi_sks_fp_bpv = -1; static int hf_scsi_sks_fp_bit = -1; static int hf_scsi_sks_fp_field = -1; static int hf_scsi_sns_desc_type = -1; static int hf_scsi_sns_desc_length = -1; static int hf_scsi_sns_osd_object_not_initiated = -1; static int hf_scsi_sns_osd_object_completed = -1; static int hf_scsi_sns_osd_object_validation = -1; static int hf_scsi_sns_osd_object_cmd_cap_v = -1; static int hf_scsi_sns_osd_object_command = -1; static int hf_scsi_sns_osd_object_imp_st_att = -1; static int hf_scsi_sns_osd_object_sa_cap_v = -1; static int hf_scsi_sns_osd_object_set_att = -1; static int hf_scsi_sns_osd_object_ga_cap_v = -1; static int hf_scsi_sns_osd_object_get_att = -1; static int hf_scsi_sns_osd_partition_id = -1; static int hf_scsi_sns_osd_object_id = -1; static int hf_scsi_sns_osd_attr_page = -1; static int hf_scsi_sns_osd_attr_number = -1; static int hf_scsi_inq_reladrflags = -1; static int hf_scsi_inq_reladr = -1; static int hf_scsi_inq_linked = -1; static int hf_scsi_inq_trandis = -1; static int hf_scsi_inq_cmdque = -1; static int hf_scsi_inq_bqueflags = -1; static int hf_scsi_inq_bque = -1; static int hf_scsi_inq_encserv = -1; static int hf_scsi_inq_multip = -1; static int hf_scsi_inq_mchngr = -1; static int hf_scsi_inq_ackreqq = -1; static int hf_scsi_inq_sccsflags = -1; static int hf_scsi_inq_sccs = -1; static int hf_scsi_inq_acc = -1; static int hf_scsi_inq_tpc = -1; static int hf_scsi_inq_protect = -1; static int hf_scsi_inq_tpgs = -1; static int hf_scsi_inq_acaflags = -1; static int hf_scsi_inq_rmbflags = -1; static int hf_scsi_inq_normaca = -1; static int hf_scsi_inq_hisup = -1; static int hf_scsi_inq_aerc = -1; static int hf_scsi_inq_trmtsk = -1; static int hf_scsi_inq_rdf = -1; static int hf_scsi_persresv_key = -1; static int hf_scsi_persresv_scopeaddr = -1; static int hf_scsi_add_cdblen = -1; static int hf_scsi_svcaction = -1; static int hf_scsi_wb_mode = -1; static int hf_scsi_wb_bufferid = -1; static int hf_scsi_wb_bufoffset = -1; static int hf_scsi_paramlen24 = -1; static int hf_scsi_senddiag_st_code = -1; static int hf_scsi_senddiag_pf = -1; static int hf_scsi_senddiag_st = -1; static int hf_scsi_senddiag_devoff = -1; static int hf_scsi_senddiag_unitoff = -1; static int hf_scsi_fragments = -1; static int hf_scsi_fragment = -1; static int hf_scsi_fragment_overlap = -1; static int hf_scsi_fragment_overlap_conflict = -1; static int hf_scsi_fragment_multiple_tails = -1; static int hf_scsi_fragment_too_long_fragment = -1; static int hf_scsi_fragment_error = -1; static int hf_scsi_fragment_count = -1; static int hf_scsi_reassembled_in = -1; static int hf_scsi_reassembled_length = -1; static int hf_scsi_log_ppc_flags = -1; static int hf_scsi_log_pc_flags = -1; static int hf_scsi_log_parameter_ptr = -1; static int hf_scsi_log_ppc = -1; static int hf_scsi_log_pcr = -1; static int hf_scsi_log_sp = -1; static int hf_scsi_log_pagecode = -1; static int hf_scsi_log_pc = -1; static int hf_scsi_log_page_length = -1; static int hf_scsi_log_parameter_code = -1; static int hf_scsi_log_param_len = -1; static int hf_scsi_log_param_flags = -1; static int hf_scsi_log_param_data = -1; static int hf_scsi_log_pf_du = -1; static int hf_scsi_log_pf_ds = -1; static int hf_scsi_log_pf_tsd = -1; static int hf_scsi_log_pf_etc = -1; static int hf_scsi_log_pf_tmc = -1; static int hf_scsi_log_pf_lbin = -1; static int hf_scsi_log_pf_lp = -1; static int hf_scsi_log_ta_rw = -1; static int hf_scsi_log_ta_ww = -1; static int hf_scsi_log_ta_he = -1; static int hf_scsi_log_ta_media = -1; static int hf_scsi_log_ta_rf = -1; static int hf_scsi_log_ta_wf = -1; static int hf_scsi_log_ta_ml = -1; static int hf_scsi_log_ta_ndg = -1; static int hf_scsi_log_ta_wp = -1; static int hf_scsi_log_ta_nr = -1; static int hf_scsi_log_ta_cm = -1; static int hf_scsi_log_ta_uf = -1; static int hf_scsi_log_ta_rmcf = -1; static int hf_scsi_log_ta_umcf = -1; static int hf_scsi_log_ta_mcicf = -1; static int hf_scsi_log_ta_fe = -1; static int hf_scsi_log_ta_rof = -1; static int hf_scsi_log_ta_tdcol = -1; static int hf_scsi_log_ta_nml = -1; static int hf_scsi_log_ta_cn = -1; static int hf_scsi_log_ta_cp = -1; static int hf_scsi_log_ta_ecm = -1; static int hf_scsi_log_ta_ict = -1; static int hf_scsi_log_ta_rr = -1; static int hf_scsi_log_ta_dpie = -1; static int hf_scsi_log_ta_cff = -1; static int hf_scsi_log_ta_psf = -1; static int hf_scsi_log_ta_pc = -1; static int hf_scsi_log_ta_dm = -1; static int hf_scsi_log_ta_hwa = -1; static int hf_scsi_log_ta_hwb = -1; static int hf_scsi_log_ta_if = -1; static int hf_scsi_log_ta_em = -1; static int hf_scsi_log_ta_dwf = -1; static int hf_scsi_log_ta_drhu = -1; static int hf_scsi_log_ta_drtm = -1; static int hf_scsi_log_ta_drvo = -1; static int hf_scsi_log_ta_pefa = -1; static int hf_scsi_log_ta_dire = -1; static int hf_scsi_log_ta_lost = -1; static int hf_scsi_log_ta_tduau = -1; static int hf_scsi_log_ta_tsawf = -1; static int hf_scsi_log_ta_tsarf = -1; static int hf_scsi_log_ta_nsod = -1; static int hf_scsi_log_ta_lofa = -1; static int hf_scsi_log_ta_uuf = -1; static int hf_scsi_log_ta_aif = -1; static int hf_scsi_log_ta_fwf = -1; static int hf_scsi_log_ta_wmicf = -1; static int hf_scsi_log_ta_wmoa = -1; static int hf_scsi_sbc_threshold_exponent = -1; static int hf_scsi_sbc_lbpu = -1; static int hf_scsi_sbc_lbpws = -1; static int hf_scsi_sbc_lbpws10 = -1; static int hf_scsi_sbc_lbprz = -1; static int hf_scsi_sbc_anc_sup = -1; static int hf_scsi_sbc_dp = -1; static int hf_scsi_sbc_ptype = -1; static int hf_scsi_block_limits_wsnz = -1; static int hf_scsi_block_limits_mcawl = -1; static int hf_scsi_block_limits_otlg = -1; static int hf_scsi_block_limits_mtl = -1; static int hf_scsi_block_limits_otl = -1; static int hf_scsi_block_limits_mpl = -1; static int hf_scsi_block_limits_mulc = -1; static int hf_scsi_block_limits_mubdc = -1; static int hf_scsi_block_limits_oug = -1; static int hf_scsi_block_limits_ugavalid = -1; static int hf_scsi_block_limits_uga = -1; static int hf_scsi_block_limits_mwsl = -1; static int hf_scsi_block_limits_matl = -1; static int hf_scsi_block_limits_aa = -1; static int hf_scsi_block_limits_atlg = -1; static int hf_scsi_prevent_allow_flags = -1; static int hf_scsi_prevent_allow_prevent = -1; static int hf_scsi_mpi_service_action = -1; static int hf_scsi_report_opcodes_rctd = -1; static int hf_scsi_report_opcodes_options = -1; static int hf_scsi_report_opcodes_requested_o = -1; static int hf_scsi_report_opcodes_requested_sa = -1; static int hf_scsi_report_opcodes_cdl = -1; static int hf_scsi_report_opcodes_sa = -1; static int hf_scsi_report_opcodes_ctdp = -1; static int hf_scsi_report_opcodes_ctdp_one = -1; static int hf_scsi_report_opcodes_servactv = -1; static int hf_scsi_report_opcodes_cdb_length = -1; static int hf_scsi_report_opcodes_support = -1; static int hf_scsi_report_opcodes_cdb_usage_data = -1; static int hf_scsi_report_opcodes_tdl = -1; static int hf_scsi_report_opcodes_npt = -1; static int hf_scsi_report_opcodes_rct = -1; static int hf_scsi_inquiry_bdc_mrr = -1; static int hf_scsi_inquiry_bdc_pt = -1; static int hf_scsi_inquiry_bdc_wabereq = -1; static int hf_scsi_inquiry_bdc_wacereq = -1; static int hf_scsi_inquiry_bdc_nff = -1; static int hf_scsi_inquiry_bdc_fuab = -1; static int hf_scsi_inquiry_bdc_vbuls = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_scsi_smc_modepage_first_storage_element_address = -1; static int hf_scsi_smc_modepage_first_medium_transport_element_address = -1; static int hf_scsi_ssc2_modepage_dde = -1; static int hf_scsi_inq_cmddt_version = -1; static int hf_scsi_mmc5_modepage_number_of_volume_levels_supported = -1; static int hf_scsi_ssc2_modepage_dce = -1; static int hf_scsi_modesel_block_descriptor_length16 = -1; static int hf_scsi_mmc5_modepage_audio_pause_length = -1; static int hf_scsi_spc_modepage_idle_condition_timer = -1; static int hf_scsi_blockdescs_block_length24 = -1; static int hf_scsi_spc_modepage_report_count = -1; static int hf_scsi_spc_modepage_ready_aer_holdoff_period = -1; static int hf_scsi_sbc_modepage_non_cache_segment_size = -1; static int hf_scsi_blockdescs_no_of_blocks64 = -1; static int hf_scsi_spc_modepage_gltsd = -1; static int hf_scsi_smc_modepage_st_ne_dt = -1; static int hf_scsi_modesel_dev_sbc_medium_type = -1; static int hf_scsi_inq_evpd_devid_identifier_type = -1; static int hf_scsi_inq_evpd_identifier_number = -1; static int hf_scsi_sbc_modepage_write_retry_count = -1; static int hf_scsi_spc_modepage_buffer_empty_ratio = -1; static int hf_scsi_ssc2_modepage_partition_size = -1; static int hf_scsi_mmc5_modepage_initiator_application_code = -1; static int hf_scsi_sbc_modepage_demand_read_retention_priority = -1; static int hf_scsi_smc_modepage_dt_dt = -1; static int hf_scsi_sbc_modepage_ssec = -1; static int hf_scsi_smc_modepage_number_of_medium_transport_elements = -1; static int hf_scsi_mmc5_modepage_copy_management_revision_support = -1; static int hf_scsi_ssc2_modepage_maximum_additional_partitions = -1; static int hf_scsi_blockdescs_density_code = -1; static int hf_scsi_ssc2_modepage_write_object_buffer_full_ratio = -1; static int hf_scsi_spc_modepage_rr_tov = -1; static int hf_scsi_inq_cmddt_support = -1; static int hf_scsi_mmc5_modepage_packet_size = -1; static int hf_scsi_ssc2_modepage_fdp = -1; static int hf_scsi_spc_modepage_autoload_mode = -1; static int hf_scsi_mmc5_modepage_rw_in_lead_in = -1; static int hf_scsi_spc_modepage_perf = -1; static int hf_scsi_inq_evpd_devid_association = -1; static int hf_scsi_smc_modepage_stordt = -1; static int hf_scsi_smc_modepage_ie_dt = -1; static int hf_scsi_spc_modepage_disable_queuing = -1; static int hf_scsi_sbc_modepage_maximum_pre_fetch_ceiling = -1; static int hf_scsi_persresvin_generation_number = -1; static int hf_scsi_ssc2_modepage_read_object_buffer_empty_ratio = -1; static int hf_scsi_spc_modepage_extended_self_test_completion_time = -1; static int hf_scsi_smc_modepage_number_of_import_export_elements = -1; static int hf_scsi_smc_modepage_number_of_storage_elements = -1; static int hf_scsi_sbc_modepage_landing_zone_cyl = -1; static int hf_scsi_smc_modepage_mt_ne_dt = -1; static int hf_scsi_mmc5_modepage_loading_mechanism_type = -1; static int hf_scsi_smc_modepage_mt_dt = -1; static int hf_scsi_smc_modepage_first_import_export_element_address = -1; static int hf_scsi_mmc5_modepage_link_size = -1; static int hf_scsi_ssc2_modepage_decompression_algorithm = -1; static int hf_scsi_reportluns_lun_list_length = -1; static int hf_scsi_spc_modepage_idle = -1; static int hf_scsi_spc_modepage_emdp = -1; static int hf_scsi_inq_evpd_devid_code_set = -1; static int hf_scsi_modesel_longlba = -1; static int hf_scsi_mmc5_modepage_bufe = -1; static int hf_scsi_ssc2_modepage_select_data_compression_algorithm = -1; static int hf_scsi_mmc5_modepage_rotation_control_selected = -1; static int hf_scsi_mmc5_modepage_sub_header_byte = -1; static int hf_scsi_spc_modepage_rr_tov_units = -1; static int hf_scsi_mmc5_modepage_vendor_specific = -1; static int hf_scsi_modesel_block_descriptor_length8 = -1; static int hf_scsi_smc_modepage_ie_ne_dt = -1; static int hf_scsi_modesel_device_specific_parameter = -1; static int hf_scsi_spc_modepage_connect_time_limit = -1; static int hf_scsi_sbc_modepage_medium_rotation_rate = -1; static int hf_scsi_inq_evpd_devid_identifier_length = -1; static int hf_scsi_blockdescs_no_of_blocks32 = -1; static int hf_scsi_inq_evpd_devid_identifier_str = -1; static int hf_scsi_sns_valid = -1; static int hf_scsi_mmc5_modepage_dvd_ram_read = -1; static int hf_scsi_ssc2_modepage_gap_size = -1; static int hf_scsi_smc_modepage_first_data_transfer_element_address = -1; static int hf_scsi_mmc5_modepage_wrparam_multi_session = -1; static int hf_scsi_mmc5_modepage_num_write_speed_performance = -1; static int hf_scsi_mmc5_modepage_buf = -1; static int hf_scsi_mmc5_modepage_lba_space = -1; static int hf_scsi_mmc5_modepage_data_block_type = -1; static int hf_scsi_ssc2_modepage_additional_partitions_defined = -1; static int hf_scsi_spc_modepage_dtfd = -1; static int hf_scsi_spc_modepage_disconnect_time_limit = -1; static int hf_scsi_sbc_modepage_read_retry_count = -1; static int hf_scsi_mmc5_modepage_length = -1; static int hf_scsi_sns_filemark = -1; static int hf_scsi_sbc_modepage_alternate_tracks_per_zone = -1; static int hf_scsi_ssc2_modepage_eod_defined = -1; static int hf_scsi_mmc5_modepage_media_catalog_number = -1; static int hf_scsi_mmc5_modepage_current_write_speed_selected = -1; static int hf_scsi_inq_evpd_devid_identifier_bytes = -1; static int hf_scsi_spc_modepage_interval_timer = -1; static int hf_scsi_ssc2_modepage_oir = -1; static int hf_scsi_sbc_modepage_correction_span = -1; static int hf_scsi_mmc5_modepage_session_format = -1; static int hf_scsi_sbc_modepage_minimum_pre_fetch = -1; static int hf_scsi_spc_modepage_maximum_burst_size = -1; static int hf_scsi_ssc2_modepage_partition_units = -1; static int hf_scsi_sbc_modepage_cache_segment_size = -1; static int hf_scsi_blockdescs_block_length32 = -1; static int hf_scsi_sbc_modepage_number_of_cylinders = -1; static int hf_scsi_sbc_modepage_alternate_tracks_per_lu = -1; static int hf_scsi_inq_evpd_page_length = -1; static int hf_scsi_sbc_modepage_starting_cyl_pre_compensation = -1; static int hf_scsi_sbc_modepage_head_offset_count = -1; static int hf_scsi_sbc_modepage_ic = -1; static int hf_scsi_modesel_mode_data_length16 = -1; static int hf_scsi_sbc_modepage_maximum_pre_fetch = -1; static int hf_scsi_smc_modepage_number_of_data_transfer_elements = -1; static int hf_scsi_ssc2_modepage_object_buffer_size_at_early_warning = -1; static int hf_scsi_mmc5_modepage_buffer_size_supported = -1; static int hf_scsi_persresvin_additional_length = -1; static int hf_scsi_ssc2_modepage_obr = -1; static int hf_scsi_spc_modepage_swp = -1; static int hf_scsi_inq_evpd_supported_page = -1; static int hf_scsi_sbc_modepage_awre = -1; static int hf_scsi_smc_modepage_dt_ne_dt = -1; static int hf_scsi_mmc5_modepage_read_bar_code = -1; static int hf_scsi_ssc2_modepage_media_format_recognition = -1; static int hf_scsi_sns_command_specific_information = -1; static int hf_scsi_ssc2_modepage_write_delay_time = -1; static int hf_scsi_sbc_modepage_track_skew_factor = -1; static int hf_scsi_spc_modepage_standby_condition_timer = -1; static int hf_scsi_sbc_modepage_interleave = -1; static int hf_scsi_sbc_modepage_alternate_sectors_per_zone = -1; static int hf_scsi_sbc_modepage_rotational_offset = -1; static int hf_scsi_spc_modepage_buffer_full_ratio = -1; static int hf_scsi_sbc_modepage_number_of_heads = -1; static int hf_scsi_sbc_modepage_sectors_per_track = -1; static int hf_scsi_sbc_modepage_recovery_time_limit = -1; static int hf_scsi_sbc_modepage_tracks_per_zone = -1; static int hf_scsi_spc_modepage_first_burst_size = -1; static int hf_scsi_inq_evpd_product_serial_number = -1; static int hf_scsi_sbc_modepage_cylinder_skew_factor = -1; static int hf_scsi_sbc_modepage_data_bytes_per_physical_sector = -1; static int hf_scsi_ssc2_modepage_compression_algorithm = -1; static int hf_scsi_ssc2_modepage_caf = -1; static int hf_scsi_sbc_modepage_starting_cyl_reduced_write_current = -1; static int hf_scsi_inq_cmddt_cdb_size = -1; static int hf_scsi_mmc5_modepage_international_standard_recording_code = -1; static int hf_scsi_spc_modepage_bus_inactivity_limit = -1; static int hf_scsi_sbc_modepage_disable_pre_fetch_xfer_len = -1; static int hf_scsi_spc_modepage_busy_timeout_period = -1; static int hf_scsi_sbc_modepage_fsw = -1; static int hf_scsi_ssc2_modepage_active_partition = -1; static int hf_scsi_modesel_mode_data_length8 = -1; static int hf_scsi_smc_modepage_st_dt = -1; static int hf_scsi_sbc_modepage_number_of_cache_segments = -1; static int hf_scsi_blockdescs_no_of_blocks24 = -1; static int hf_scsi_sbc_modepage_data_strobe_offset_count = -1; static int hf_scsi_modesel_medium_type = -1; static int hf_scsi_sbc_modepage_device_step_rate = -1; static int hf_scsi_mmc5_modepage_dvd_ram_write = -1; static int hf_scsi_mmc5_modepage_track_mode = -1; static int hf_scsi_smc_modepage_mt_ne_mt = -1; static int hf_scsi_smc_modepage_dt_mt = -1; static int hf_scsi_mmc5_modepage_eject = -1; static int hf_scsi_mmc5_modepage_mode_2_form2 = -1; static int hf_scsi_sbc_modepage_dra = -1; static int hf_scsi_mmc5_modepage_dvd_rom_write = -1; static int hf_scsi_sbc_modepage_eer = -1; static int hf_scsi_mmc5_modepage_cd_da_cmds_supported = -1; static int hf_scsi_smc_modepage_ie_ne_mt = -1; static int hf_scsi_mmc5_modepage_rw_deinterleaved_corrected = -1; static int hf_scsi_sbc_modepage_vendor_specific = -1; static int hf_scsi_spc_modepage_report_log_exception_condition = -1; static int hf_scsi_mmc5_modepage_c2_pointers_supported = -1; static int hf_scsi_mmc5_modepage_ls_v = -1; static int hf_scsi_sbc_modepage_tb = -1; static int hf_scsi_sbc_modepage_write_retention_priority = -1; static int hf_scsi_smc_modepage_mt_ne_ie = -1; static int hf_scsi_ssc2_modepage_prmwp = -1; static int hf_scsi_sbc_modepage_surf = -1; static int hf_scsi_sns_ili = -1; static int hf_scsi_smc_modepage_mt_ie = -1; static int hf_scsi_sbc_modepage_rcd = -1; static int hf_scsi_mmc5_modepage_composite = -1; static int hf_scsi_sbc_modepage_wce = -1; static int hf_scsi_mmc5_modepage_method_2 = -1; static int hf_scsi_ssc2_modepage_clear = -1; static int hf_scsi_sbc_modepage_lbcss = -1; static int hf_scsi_mmc5_modepage_cd_r_read = -1; static int hf_scsi_spc_modepage_test = -1; static int hf_scsi_ssc2_modepage_rsmk = -1; static int hf_scsi_spc_modepage_rha = -1; static int hf_scsi_mmc5_modepage_lsbf = -1; static int hf_scsi_mmc5_modepage_cd_rw_write = -1; static int hf_scsi_mmc5_modepage_wrparam_test_write = -1; static int hf_scsi_ssc2_modepage_eeg = -1; static int hf_scsi_mmc5_modepage_digital_port2 = -1; static int hf_scsi_mmc5_modepage_copy = -1; static int hf_scsi_sbc_modepage_abpf = -1; static int hf_scsi_spc_modepage_alwi = -1; static int hf_scsi_mmc5_modepage_bckf = -1; static int hf_scsi_ssc2_modepage_dsp = -1; static int hf_scsi_mmc5_modepage_mode_2_form1 = -1; static int hf_scsi_smc_modepage_stormt = -1; static int hf_scsi_mmc5_modepage_mmcap_test_write = -1; static int hf_scsi_smc_modepage_st_mt = -1; static int hf_scsi_ssc2_modepage_sew = -1; static int hf_scsi_ssc2_modepage_psum = -1; static int hf_scsi_mmc5_modepage_dvd_r_read = -1; static int hf_scsi_ssc2_modepage_asocwp = -1; static int hf_scsi_smc_modepage_st_ie = -1; static int hf_scsi_mmc5_modepage_cd_rw_read = -1; static int hf_scsi_spc_modepage_standby = -1; static int hf_scsi_spc_modepage_ewasc = -1; static int hf_scsi_sbc_modepage_arre = -1; static int hf_scsi_smc_modepage_st_st = -1; static int hf_scsi_ssc2_modepage_swp = -1; static int hf_scsi_smc_modepage_storie = -1; static int hf_scsi_mmc5_modepage_fp = -1; static int hf_scsi_ssc2_modepage_red = -1; static int hf_scsi_ssc2_modepage_active_format = -1; static int hf_scsi_mmc5_modepage_mmcap_multi_session = -1; static int hf_scsi_mmc5_modepage_lock_state = -1; static int hf_scsi_mmc5_modepage_side_change_capable = -1; static int hf_scsi_mmc5_modepage_dvd_rom_read = -1; static int hf_scsi_sns_eom = -1; static int hf_scsi_sbc_modepage_rc = -1; static int hf_scsi_mmc5_modepage_lock = -1; static int hf_scsi_sbc_modepage_per = -1; static int hf_scsi_ssc2_modepage_socf = -1; static int hf_scsi_sbc_modepage_mf = -1; static int hf_scsi_smc_modepage_ie_st = -1; static int hf_scsi_mmc5_modepage_digital_port1 = -1; static int hf_scsi_sbc_modepage_hsec = -1; static int hf_scsi_sbc_modepage_cap = -1; static int hf_scsi_smc_modepage_st_ne_ie = -1; static int hf_scsi_spc_modepage_logerr = -1; static int hf_scsi_sbc_modepage_rmb = -1; static int hf_scsi_mmc5_modepage_prevent_jumper = -1; static int hf_scsi_smc_modepage_ie_mt = -1; static int hf_scsi_mmc5_modepage_changer_supports_disc_present = -1; static int hf_scsi_mmc5_modepage_cd_r_write = -1; static int hf_scsi_ssc2_modepage_addp = -1; static int hf_scsi_mmc5_modepage_dvd_r_write = -1; static int hf_scsi_spc_modepage_dexcpt = -1; static int hf_scsi_spc_modepage_ebf = -1; static int hf_scsi_mmc5_modepage_write_type = -1; static int hf_scsi_spc_modepage_fab = -1; static int hf_scsi_smc_modepage_ie_ne_st = -1; static int hf_scsi_ssc2_modepage_baml = -1; static int hf_scsi_smc_modepage_storst = -1; static int hf_scsi_sbc_modepage_dte = -1; static int hf_scsi_mmc5_modepage_separate_volume_levels = -1; static int hf_scsi_mmc5_modepage_isrc = -1; static int hf_scsi_smc_modepage_dt_ne_mt = -1; static int hf_scsi_mmc5_modepage_audio_play = -1; static int hf_scsi_mmc5_modepage_separate_channel_mute = -1; static int hf_scsi_ssc2_modepage_rew = -1; static int hf_scsi_sbc_modepage_dcr = -1; static int hf_scsi_smc_modepage_dt_ie = -1; static int hf_scsi_ssc2_modepage_avc = -1; static int hf_scsi_sbc_modepage_size = -1; static int hf_scsi_mmc5_modepage_rw_supported = -1; static int hf_scsi_spc_modepage_dtipe = -1; static int hf_scsi_mmc5_modepage_sw_slot_selection = -1; static int hf_scsi_ssc2_modepage_pofm = -1; static int hf_scsi_spc_modepage_dlm = -1; static int hf_scsi_spc_modepage_plpb = -1; static int hf_scsi_smc_modepage_st_ne_st = -1; static int hf_scsi_smc_modepage_dt_ne_st = -1; static int hf_scsi_smc_modepage_st_ne_mt = -1; static int hf_scsi_ssc2_modepage_robo = -1; static int hf_scsi_spc_modepage_faa = -1; static int hf_scsi_spc_modepage_ddis = -1; static int hf_scsi_mmc5_modepage_cd_da_stream_is_accurate = -1; static int hf_scsi_ssc2_modepage_bam = -1; static int hf_scsi_spc_modepage_fac = -1; static int hf_scsi_smc_modepage_mt_st = -1; static int hf_scsi_smc_modepage_ie_ie = -1; static int hf_scsi_smc_modepage_dt_ne_ie = -1; static int hf_scsi_ssc2_modepage_lois = -1; static int hf_scsi_spc_modepage_dtoli = -1; static int hf_scsi_sbc_modepage_disc = -1; static int hf_scsi_smc_modepage_ie_ne_ie = -1; static int hf_scsi_smc_modepage_mt_ne_st = -1; static int hf_scsi_ssc2_modepage_dcc = -1; static int hf_scsi_mmc5_modepage_rck = -1; static int hf_scsi_smc_modepage_mt_mt = -1; static int hf_scsi_smc_modepage_dt_st = -1; static int hf_scsi_ssc2_modepage_rewind_on_reset = -1; static int hf_scsi_mmc5_modepage_upc = -1; static int hf_scsi_ssc2_modepage_idp = -1; static int hf_scsi_ssc2_modepage_perswp = -1; static int hf_scsi_spc_xcopy_service = -1; static int hf_scsi_spc_recv_copy_service = -1; static int hf_scsi_spc_xcopy_param_list_len = -1; static int hf_scsi_spc_xcopy_param_list_format = -1; static int hf_scsi_spc_xcopy_cscd_desc_list_len = -1; static int hf_scsi_spc_xcopy_head_cscd_desc_list_len = -1; static int hf_scsi_spc_xcopy_head_cscd_desc_type_code = -1; static int hf_scsi_spc_xcopy_cscd_desc_type_code = -1; static int hf_scsi_spc_xcopy_inline_data_len = -1; static int hf_scsi_spc_xcopy_seg_desc_list_len = -1; static int hf_scsi_spc_xcopy_list_id = -1; static int hf_scsi_spc_xcopy_rel_init_port_id = -1; static int hf_scsi_spc_xcopy_per_dev_type_byte = -1; static int hf_scsi_spc_xcopy_per_dev_type = -1; static int hf_scsi_spc_xcopy_lu_type = -1; static int hf_scsi_spc_xcopy_disk_block_len = -1; static int hf_scsi_spc_xcopy_cscd_desc_code_set = -1; static int hf_scsi_spc_xcopy_cscd_desc_assoc = -1; static int hf_scsi_spc_xcopy_cscd_desc_des_type = -1; static int hf_scsi_spc_xcopy_cscd_desc_des_len = -1; static int hf_scsi_spc_xcopy_seg_desc_type = -1; static int hf_scsi_spc_xcopy_seg_desc_dc = -1; static int hf_scsi_spc_xcopy_seg_desc_cat = -1; static int hf_scsi_spc_xcopy_seg_des_src_desc_id = -1; static int hf_scsi_spc_xcopy_seg_des_dest_desc_id = -1; static int hf_scsi_spc_xcopy_num_of_blocks = -1; static int hf_scsi_spc_xcopy_param_list_id_usage = -1; static int hf_scsi_spc_xcopy_param_str = -1; static int hf_scsi_spc_xcopy_param_priority = -1; static int hf_scsi_spc_xcopy_param_byte = -1; static int hf_scsi_spc_xcopy_source_lba = -1; static int hf_scsi_spc_xcopy_dest_lba = -1; static int hf_scsi_recv_copy_max_cscd_desc_count = -1; static int hf_scsi_recv_copy_max_seg_desc_count = -1; static int hf_scsi_recv_copy_max_desc_list_len = -1; static int hf_scsi_recv_copy_max_seg_len = -1; static int hf_scsi_recv_copy_max_inline_data_len = -1; static int hf_scsi_recv_copy_held_data_limit = -1; static int hf_scsi_recv_copy_max_stream_dev_trans_size = -1; static int hf_scsi_recv_copy_snlid = -1; static int hf_scsi_recv_copy_avail_data = -1; static int hf_scsi_recv_copy_total_con_copies = -1; static int hf_scsi_recv_copy_max_con_copies = -1; static int hf_scsi_recv_copy_data_seg_gran = -1; static int hf_scsi_recv_copy_inline_data_gran = -1; static int hf_scsi_recv_copy_held_data_gran = -1; static int hf_scsi_recv_copy_implemented_desc_list_len = -1; static int hf_scsi_segment_descriptor_length = -1; static int hf_scsi_designator = -1; static int hf_scsi_inline_data = -1; static int hf_scsi_reserved_8 = -1; static int hf_scsi_reserved_16 = -1; static int hf_scsi_reserved_24 = -1; static int hf_scsi_reserved_32 = -1; static int hf_scsi_reserved_64 = -1; static int hf_scsi_naa_type = -1; static int hf_scsi_naa_locally_assigned = -1; static int hf_scsi_naa_ieee_company_id = -1; static int hf_scsi_naa_vendor_specific = -1; static int hf_scsi_naa_vendor_specific_extension = -1; static gint ett_scsi = -1; static gint ett_scsi_page = -1; gint ett_scsi_control = -1; static gint ett_scsi_inq_control = -1; static gint ett_scsi_inq_peripheral = -1; static gint ett_scsi_inq_acaflags = -1; static gint ett_scsi_inq_rmbflags = -1; static gint ett_scsi_inq_sccsflags = -1; static gint ett_scsi_inq_bqueflags = -1; static gint ett_scsi_inq_reladrflags = -1; static gint ett_scsi_log = -1; static gint ett_scsi_log_ppc = -1; static gint ett_scsi_log_pc = -1; static gint ett_scsi_log_param = -1; static gint ett_scsi_fragments = -1; static gint ett_scsi_fragment = -1; static gint ett_persresv_control = -1; static gint ett_scsi_lun = -1; static gint ett_scsi_lun_unit = -1; static gint ett_scsi_prevent_allow = -1; static gint ett_command_descriptor = -1; static gint ett_timeout_descriptor = -1; static gint ett_sense_descriptor = -1; static gint ett_sense_osd_not_initiated = -1; static gint ett_sense_osd_completed = -1; static gint ett_xcopy_per_dev_type = -1; static gint ett_xcopy_param_byte = -1; static gint ett_scsi_xcopy_cscds = -1; static gint ett_scsi_xcopy_cscd = -1; static gint ett_scsi_xcopy_dev_params = -1; static gint ett_scsi_xcopy_segs = -1; static gint ett_scsi_xcopy_seg = -1; static gint ett_scsi_xcopy_seg_param = -1; static gint ett_scsi_cscd_desc = -1; static gint ett_scsi_naa = -1; static gint ett_scsi_designation_descriptor = -1; /* Generated from convert_proto_tree_add_text.pl */ static expert_field ei_scsi_unknown_scsi_exchange = EI_INIT; static expert_field ei_scsi_product_data_goes_past_end_of_page = EI_INIT; static expert_field ei_scsi_unknown_page = EI_INIT; static expert_field ei_scsi_no_dissection_for_service_action = EI_INIT; static expert_field ei_scsi_unknown_serv_action = EI_INIT; static int scsi_tap = -1; /* Defragment of SCSI DATA IN/OUT */ static gboolean scsi_defragment = FALSE; static reassembly_table scsi_reassembly_table; /* * Required by all commands */ int * const cdb_control_fields[6] = { &hf_scsi_control_vendor_specific, &hf_scsi_control_reserved, &hf_scsi_control_naca, &hf_scsi_control_obs1, &hf_scsi_control_obs2, NULL }; static const fragment_items scsi_frag_items = { &ett_scsi_fragment, &ett_scsi_fragments, &hf_scsi_fragments, &hf_scsi_fragment, &hf_scsi_fragment_overlap, &hf_scsi_fragment_overlap_conflict, &hf_scsi_fragment_multiple_tails, &hf_scsi_fragment_too_long_fragment, &hf_scsi_fragment_error, &hf_scsi_fragment_count, &hf_scsi_reassembled_in, &hf_scsi_reassembled_length, /* Reassembled data field */ NULL, "fragments" }; typedef guint32 scsi_cmnd_type; typedef guint32 scsi_device_type; /* Valid SCSI Command Types */ #define SCSI_CMND_SPC 1 #define SCSI_CMND_SBC 2 #define SCSI_CMND_SSC 3 #define SCSI_CMND_SMC 4 #define SCSI_CMND_MMC 5 /* SPC and SPC-2 Commands */ static const value_string scsi_spc_vals[] = { /* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"}, /* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"}, /* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"}, /* 0x15 */ {SCSI_SPC_MODESELECT6 , "Mode Select(6)"}, /* 0x16 */ {SCSI_SPC_RESERVE6 , "Reserve(6)"}, /* 0x17 */ {SCSI_SPC_RELEASE6 , "Release(6)"}, /* 0x18 */ {SCSI_SPC_COPY , "Copy"}, /* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"}, /* 0x1C */ {SCSI_SPC_RCVDIAGRESULTS , "Receive Diagnostics Results"}, /* 0x1D */ {SCSI_SPC_SENDDIAG , "Send Diagnostic"}, /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"}, /* 0x39 */ {SCSI_SPC_COMPARE , "Compare"}, /* 0x3A */ {SCSI_SPC_COPY_AND_VERIFY , "Copy And Verify"}, /* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"}, /* 0x3C */ {SCSI_SPC_READBUFFER , "Read Buffer"}, /* 0x40 */ {SCSI_SPC_CHANGE_DEFINITION , "Change Definition"}, /* 0x4C */ {SCSI_SPC_LOGSELECT , "Log Select"}, /* 0x4D */ {SCSI_SPC_LOGSENSE , "Log Sense"}, /* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"}, /* 0x56 */ {SCSI_SPC_RESERVE10 , "Reserve(10)"}, /* 0x57 */ {SCSI_SPC_RELEASE10 , "Release(10)"}, /* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"}, /* 0x5E */ {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"}, /* 0x5F */ {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"}, /* 0x7F */ {SCSI_SPC_VARLENCDB , "Variable Length CDB"}, /* 0x83 */ {SCSI_SPC_EXTCOPY , "Extended Copy"}, /* 0x84 */ {SCSI_SPC_RECVCOPY , "Receive Copy"}, /* 0x86 */ {SCSI_SPC_ACCESS_CONTROL_IN , "Access Control In"}, /* 0x87 */ {SCSI_SPC_ACCESS_CONTROL_OUT , "Access Control Out"}, /* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"}, /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"}, {0, NULL}, }; static value_string_ext scsi_spc_vals_ext = VALUE_STRING_EXT_INIT(scsi_spc_vals); static const value_string scsi_lun_address_mode_vals[] = { { 0, "Peripheral Device Addressing Method" }, { 1, "Flat Space Addressing Method" }, { 2, "Logical Unit Addressing Method" }, { 3, "Extended Logical Unit Addressing" }, { 0, NULL } }; static const value_string provisioning_vals[] = { {0, "No provisioning"}, {1, "Resource provisioned"}, {2, "Thin provisioned"}, {0, NULL}, }; static const value_string log_flags_tmc_vals[] = { {0, "Every update of the cumulative value"}, {1, "Cumulative value equal to threshold value"}, {2, "Cumulative value not equal to threshold value"}, {3, "Cumulative value greater than threshold value"}, {0, NULL}, }; static const value_string scsi_select_report_val[] = { {0, "Select All LUNs" }, {1, "Select Well-Known LUNs" }, {2, "Select All LUNs accessible to this I_T nexus" }, {0, NULL}, }; #define SCSI_EVPD_SUPPPG 0x00 #define SCSI_EVPD_DEVSERNUM 0x80 #define SCSI_EVPD_OPER 0x81 #define SCSI_EVPD_ASCIIOPER 0x82 #define SCSI_EVPD_DEVID 0x83 #define SCSI_EVPD_BLKLIMITS 0xb0 #define SCSI_EVPD_BLKDEVCHAR 0xb1 #define SCSI_EVPD_LBP 0xb2 static const value_string scsi_evpd_pagecode_val[] = { {SCSI_EVPD_SUPPPG, "Supported Vital Product Data Pages"}, {0x01, "ASCII Information Page"}, {0x02, "ASCII Information Page"}, {0x03, "ASCII Information Page"}, {0x04, "ASCII Information Page"}, {0x05, "ASCII Information Page"}, {0x06, "ASCII Information Page"}, {0x07, "ASCII Information Page"}, /* XXX - 0x01 through 0x7F are all ASCII information pages */ {SCSI_EVPD_DEVSERNUM, "Unit Serial Number Page"}, {SCSI_EVPD_OPER, "Implemented Operating Definition Page"}, {SCSI_EVPD_ASCIIOPER, "ASCII Implemented Operating Definition Page"}, {SCSI_EVPD_DEVID, "Device Identification Page"}, {SCSI_EVPD_BLKLIMITS, "Block Limits Page"}, {SCSI_EVPD_BLKDEVCHAR,"Block Device Characteristics"}, {SCSI_EVPD_LBP, "Logical Block Provisioning Page"}, {0, NULL}, }; static const value_string mrr_val[] = { {0x0, "Media rotation speed not reported"}, {0x1, "Non-rotating media"}, /* 0x2 - 0x400 - reserved */ {5400, "5,400 RPM"}, {7200, "7,200 RPM"}, {10000, "10,000 RPM"}, {15000, "15,000 RPM"}, {0, NULL}, }; static const value_string scsi_log_pc_val[] = { {0, "Threshold Values"}, {1, "Cumulative Values"}, {2, "Default Threshold Values"}, {3, "Default Cumulative Values"}, {0, NULL}, }; #define NAA_TYPE_IEEE_EXTENDED 2 #define NAA_TYPE_LOCALLY_ASSIGNED 3 #define NAA_TYPE_IEEE_REGISTERED 5 #define NAA_TYPE_IEEE_REGISTERED_EXTENDED 6 static const value_string scsi_naa_designator_type_val[] = { {2, "IEEE Extended" }, {3, "Locally Assigned" }, {5, "IEEE Registered" }, {6, "IEEE Registered Extended" }, {0, NULL}, }; static const unit_name_string units_100_milliseconds = { "100ms", NULL }; #define SCSI_NUM_PROCEDURES 256 typedef struct scsistat_tap_data { guint8 cmdset; const char *prog; value_string_ext *cdbnames_ext; const char *hf_name; } scsistat_tap_data_t; static void scsistat_init(struct register_srt* srt, GArray* srt_array) { scsistat_tap_data_t* tap_data = (scsistat_tap_data_t*)get_srt_table_param_data(srt); srt_stat_table *scsi_srt_table; guint32 i; DISSECTOR_ASSERT(tap_data); scsi_srt_table = init_srt_table(tap_data->prog, NULL, srt_array, SCSI_NUM_PROCEDURES, NULL, tap_data->hf_name, tap_data); for (i = 0; i < SCSI_NUM_PROCEDURES; i++) { init_srt_table_row(scsi_srt_table, i, val_to_str_ext(i, tap_data->cdbnames_ext, "Unknown-0x%02x")); } } static tap_packet_status scsistat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv, tap_flags_t flags _U_) { guint i = 0; srt_stat_table *scsi_srt_table; srt_data_t *data = (srt_data_t *)pss; const scsi_task_data_t *ri = (const scsi_task_data_t *)prv; scsistat_tap_data_t* tap_data; scsi_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); tap_data = (scsistat_tap_data_t*)scsi_srt_table->table_specific_data; /* we are only interested in response packets */ if (ri->type != SCSI_PDU_TYPE_RSP) { return TAP_PACKET_DONT_REDRAW; } /* we are only interested in a specific commandset */ if ( (!ri->itl) || ((ri->itl->cmdset&SCSI_CMDSET_MASK) != tap_data->cmdset) ) { return TAP_PACKET_DONT_REDRAW; } /* check that the opcode looks sane */ if ( (!ri->itlq) || (ri->itlq->scsi_opcode > 255) ) { return TAP_PACKET_DONT_REDRAW; } add_srt_table_data(scsi_srt_table, ri->itlq->scsi_opcode, &ri->itlq->fc_time, pinfo); return TAP_PACKET_REDRAW; } guint scsistat_param(register_srt_t* srt, const char* opt_arg, char** err) { int pos = 0; int program; scsistat_tap_data_t* tap_data; if (sscanf(opt_arg, ",%d%n", &program, &pos) == 1) { tap_data = g_new0(scsistat_tap_data_t, 1); tap_data->cmdset = (guint8)program; switch(program){ case SCSI_DEV_SBC: tap_data->prog = "SBC (disk)"; tap_data->cdbnames_ext = &scsi_sbc_vals_ext; tap_data->hf_name = "scsi_sbc.opcode"; break; case SCSI_DEV_SSC: tap_data->prog = "SSC (tape)"; tap_data->cdbnames_ext = &scsi_ssc_vals_ext; tap_data->hf_name = "scsi_ssc.opcode"; break; case SCSI_DEV_CDROM: tap_data->prog = "MMC (cd/dvd)"; tap_data->cdbnames_ext = &scsi_mmc_vals_ext; tap_data->hf_name = "scsi_mmc.opcode"; break; case SCSI_DEV_SMC: tap_data->prog = "SMC (tape robot)"; tap_data->cdbnames_ext = &scsi_smc_vals_ext; tap_data->hf_name = "scsi_smc.opcode"; break; case SCSI_DEV_OSD: tap_data->prog = "OSD (object based)"; tap_data->cdbnames_ext = &scsi_osd_vals_ext; tap_data->hf_name = "scsi_osd.opcode"; break; } set_srt_table_param_data(srt, tap_data); } else { *err = g_strdup("<cmdset>[,<filter>]"); } return pos; } /* TapeAlert page : read warning flag */ static void log_parameter_2e_0001(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_rw, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : write warning flag */ static void log_parameter_2e_0002(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_ww, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : hard error flag */ static void log_parameter_2e_0003(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_he, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : media flag */ static void log_parameter_2e_0004(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_media, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : read failure flag */ static void log_parameter_2e_0005(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_rf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : write failure flag */ static void log_parameter_2e_0006(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_wf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : media life flag */ static void log_parameter_2e_0007(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_ml, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : not data grade flag */ static void log_parameter_2e_0008(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_ndg, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : write protect flag */ static void log_parameter_2e_0009(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_wp, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : no removal flag */ static void log_parameter_2e_000a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_nr, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : cleaning media flag */ static void log_parameter_2e_000b(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_cm, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : unsupported format flag */ static void log_parameter_2e_000c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_uf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : removable mechanical cartridge failure flag */ static void log_parameter_2e_000d(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_rmcf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : unrecoverable mechanical cartridge failure flag */ static void log_parameter_2e_000e(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_umcf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : memory chip in cartridge failure flag */ static void log_parameter_2e_000f(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_mcicf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : forced eject flag */ static void log_parameter_2e_0010(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_fe, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : read only format flag */ static void log_parameter_2e_0011(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_rof, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : tape directory corrupted on load flag */ static void log_parameter_2e_0012(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_tdcol, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : nearing media life flag */ static void log_parameter_2e_0013(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_nml, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : clean now flag */ static void log_parameter_2e_0014(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_cn, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : clean periodic flag */ static void log_parameter_2e_0015(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_cp, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : expired cleaning media flag */ static void log_parameter_2e_0016(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_ecm, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : invalid cleaning tape flag */ static void log_parameter_2e_0017(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_ict, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : retention requested flag */ static void log_parameter_2e_0018(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_rr, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : dual port interface error flag */ static void log_parameter_2e_0019(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_dpie, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : cooling fan failure flag */ static void log_parameter_2e_001a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_cff, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : power supply failure flag */ static void log_parameter_2e_001b(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_psf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : power consumption flag */ static void log_parameter_2e_001c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_pc, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : drive maintenance flag */ static void log_parameter_2e_001d(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_dm, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : hardware a flag */ static void log_parameter_2e_001e(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_hwa, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : hardware b flag */ static void log_parameter_2e_001f(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_hwb, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : interface flag */ static void log_parameter_2e_0020(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_if, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : eject media flag */ static void log_parameter_2e_0021(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_em, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : download failed flag */ static void log_parameter_2e_0022(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_dwf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : drive humidity flag */ static void log_parameter_2e_0023(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_drhu, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : drive temperature flag */ static void log_parameter_2e_0024(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_drtm, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : drive voltage flag */ static void log_parameter_2e_0025(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_drvo, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : periodic failure flag */ static void log_parameter_2e_0026(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_pefa, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : diagnostics required flag */ static void log_parameter_2e_0027(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_dire, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : lost statistics flag */ static void log_parameter_2e_0032(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_lost, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : tape directory invalid at unload flag */ static void log_parameter_2e_0033(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_tduau, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : tape system area write failure flag */ static void log_parameter_2e_0034(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_tsawf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : tape system area read failure flag */ static void log_parameter_2e_0035(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_tsarf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : no start of data flag */ static void log_parameter_2e_0036(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_nsod, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : loading failure flag */ static void log_parameter_2e_0037(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_lofa, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : unrecoverable unload failure flag */ static void log_parameter_2e_0038(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_uuf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : automatic interface failure flag */ static void log_parameter_2e_0039(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_aif, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : firmware failure flag */ static void log_parameter_2e_003a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_fwf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : worm medium integrity check failed flag */ static void log_parameter_2e_003b(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_wmicf, tvb, 0, 1, ENC_BIG_ENDIAN); } /* TapeAlert page : worm medium overwrite attempted flag */ static void log_parameter_2e_003c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_scsi_log_ta_wmoa, tvb, 0, 1, ENC_BIG_ENDIAN); } typedef void (*log_parameter_dissector)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); typedef struct _log_page_parameters_t { guint32 number; const char *name; log_parameter_dissector dissector; } log_page_parameters_t; static const log_page_parameters_t tape_alert_log_parameters[] = { {0x0001, "Read Warning", log_parameter_2e_0001}, {0x0002, "write warning", log_parameter_2e_0002}, {0x0003, "hard error", log_parameter_2e_0003}, {0x0004, "media", log_parameter_2e_0004}, {0x0005, "read failure", log_parameter_2e_0005}, {0x0006, "write failure", log_parameter_2e_0006}, {0x0007, "media life", log_parameter_2e_0007}, {0x0008, "not data grade", log_parameter_2e_0008}, {0x0009, "write protect", log_parameter_2e_0009}, {0x000a, "no removal", log_parameter_2e_000a}, {0x000b, "cleaning media", log_parameter_2e_000b}, {0x000c, "unsupported format", log_parameter_2e_000c}, {0x000d, "removable mechanical cartridge failure", log_parameter_2e_000d}, {0x000e, "unrecoverable mechanical cartridge failure", log_parameter_2e_000e}, {0x000f, "memory chip in cartridge failure", log_parameter_2e_000f}, {0x0010, "forced eject", log_parameter_2e_0010}, {0x0011, "read only format", log_parameter_2e_0011}, {0x0012, "tape directory corrupted on load", log_parameter_2e_0012}, {0x0013, "nearing media life", log_parameter_2e_0013}, {0x0014, "clean now", log_parameter_2e_0014}, {0x0015, "clean periodic", log_parameter_2e_0015}, {0x0016, "expired cleaning media", log_parameter_2e_0016}, {0x0017, "invalid cleaning tape", log_parameter_2e_0017}, {0x0018, "retention requested", log_parameter_2e_0018}, {0x0019, "dual port interface error", log_parameter_2e_0019}, {0x001a, "cooling fan failure", log_parameter_2e_001a}, {0x001b, "power supply failure", log_parameter_2e_001b}, {0x001c, "power consumption", log_parameter_2e_001c}, {0x001d, "drive maintenance", log_parameter_2e_001d}, {0x001e, "hardware a", log_parameter_2e_001e}, {0x001f, "hardware b", log_parameter_2e_001f}, {0x0020, "interface", log_parameter_2e_0020}, {0x0021, "eject media", log_parameter_2e_0021}, {0x0022, "download failed", log_parameter_2e_0022}, {0x0023, "drive humidity", log_parameter_2e_0023}, {0x0024, "drive temperature", log_parameter_2e_0024}, {0x0025, "drive voltage", log_parameter_2e_0025}, {0x0026, "periodic failure", log_parameter_2e_0026}, {0x0027, "diagnostics required", log_parameter_2e_0027}, {0x0032, "lost statistics", log_parameter_2e_0032}, {0x0033, "tape directory invalid at unload", log_parameter_2e_0033}, {0x0034, "tape system area write failure", log_parameter_2e_0034}, {0x0035, "tape system area read failure", log_parameter_2e_0035}, {0x0036, "no start of data", log_parameter_2e_0036}, {0x0037, "loading failure", log_parameter_2e_0037}, {0x0038, "unrecoverable unload failure", log_parameter_2e_0038}, {0x0039, "automatic interface failure", log_parameter_2e_0039}, {0x003a, "firmware failure", log_parameter_2e_003a}, {0x003b, "worm medium integrity check failed", log_parameter_2e_003b}, {0x003c, "worm medium overwrite attempted", log_parameter_2e_003c}, {0, NULL, NULL} }; typedef struct _log_pages_t { guint32 page; const log_page_parameters_t *parameters; } log_pages_t; #define LOG_PAGE_TAPE_ALERT 0x2e static const value_string scsi_log_page_val[] = { {0x00, "Supported Log Pages"}, {0x01, "Buffer Overrun/Underrun Page"}, {0x02, "Error Counter (write) Page"}, {0x03, "Error Counter (read) Page"}, {0x04, "Error Counter (read reverse) Page"}, {0x05, "Error Counter (verify) Page"}, {0x06, "Non-medium Error Page"}, {0x07, "Last n Error Events Page"}, {0x08, "Format Status Log Page"}, {0x0B, "Last n Deferred Errors or Async Events Page"}, {0x0C, "Sequential-Access Device Log Page"}, {0x0D, "Temperature Page"}, {0x0E, "Start-Stop Cycle Counter Page"}, {0x0F, "Application Client Page"}, {0x10, "Self-test Results Page"}, {0x11, "DTD Status Log Page"}, {LOG_PAGE_TAPE_ALERT, "Tape-Alert Log Page (SSC)"}, {0x2f, "Informational Exceptions Log Page"}, {0, NULL}, }; static const log_pages_t log_pages[] = { {LOG_PAGE_TAPE_ALERT, tape_alert_log_parameters}, {0, NULL} }; static const value_string scsi_modesns_pc_val[] = { {0, "Current Values"}, {1, "Changeable Values"}, {2, "Default Values"}, {3, "Saved Values"}, {0, NULL}, }; #define SCSI_SPC_MODEPAGE_CTL 0x0A #define SCSI_SPC_MODEPAGE_DISCON 0x02 #define SCSI_SCSI2_MODEPAGE_PERDEV 0x09 /* Obsolete in SPC-2; generic in SCSI-2 */ #define SCSI_SPC_MODEPAGE_INFOEXCP 0x1C #define SCSI_SPC_MODEPAGE_PWR 0x1A #define SCSI_SPC_MODEPAGE_LUN 0x18 #define SCSI_SPC_MODEPAGE_PORT 0x19 #define SCSI_SPC_MODEPAGE_VEND 0x00 static const value_string scsi_spc_modepage_val[] = { {SCSI_SPC_MODEPAGE_CTL, "Control"}, {SCSI_SPC_MODEPAGE_DISCON, "Disconnect-Reconnect"}, {SCSI_SCSI2_MODEPAGE_PERDEV, "Peripheral Device"}, {SCSI_SPC_MODEPAGE_INFOEXCP, "Informational Exceptions Control"}, {SCSI_SPC_MODEPAGE_PWR, "Power Condition"}, {SCSI_SPC_MODEPAGE_LUN, "Protocol Specific LUN"}, {SCSI_SPC_MODEPAGE_PORT, "Protocol-Specific Port"}, {SCSI_SPC_MODEPAGE_VEND, "Vendor Specific Page"}, {0x3F, "Return All Mode Pages"}, {0, NULL}, }; #define SCSI_SBC_MODEPAGE_RDWRERR 0x01 #define SCSI_SBC_MODEPAGE_FMTDEV 0x03 #define SCSI_SBC_MODEPAGE_DISKGEOM 0x04 #define SCSI_SBC_MODEPAGE_FLEXDISK 0x05 #define SCSI_SBC_MODEPAGE_VERERR 0x07 #define SCSI_SBC_MODEPAGE_CACHE 0x08 #define SCSI_SBC_MODEPAGE_MEDTYPE 0x0B #define SCSI_SBC_MODEPAGE_NOTPART 0x0C #define SCSI_SBC_MODEPAGE_XORCTL 0x10 static const value_string scsi_sbc_modepage_val[] = { {SCSI_SBC_MODEPAGE_RDWRERR, "Read/Write Error Recovery"}, {SCSI_SBC_MODEPAGE_FMTDEV, "Format Device"}, {SCSI_SBC_MODEPAGE_DISKGEOM, "Rigid Disk Geometry"}, {SCSI_SBC_MODEPAGE_FLEXDISK, "Flexible Disk"}, {SCSI_SBC_MODEPAGE_VERERR, "Verify Error Recovery"}, {SCSI_SBC_MODEPAGE_CACHE, "Caching"}, {SCSI_SBC_MODEPAGE_MEDTYPE, "Medium Types Supported"}, {SCSI_SBC_MODEPAGE_NOTPART, "Notch & Partition"}, {SCSI_SBC_MODEPAGE_XORCTL, "XOR Control"}, {0x3F, "Return All Mode Pages"}, {0, NULL}, }; #define SCSI_SSC2_MODEPAGE_DATACOMP 0x0F /* data compression */ #define SCSI_SSC2_MODEPAGE_DEVCONF 0x10 /* device configuration */ #define SCSI_SSC2_MODEPAGE_MEDPAR1 0x11 /* medium partition (1) */ #define SCSI_SSC2_MODEPAGE_MEDPAR2 0x12 /* medium partition (2) */ #define SCSI_SSC2_MODEPAGE_MEDPAR3 0x13 /* medium partition (3) */ #define SCSI_SSC2_MODEPAGE_MEDPAR4 0x14 /* medium partition (4) */ static const value_string scsi_ssc2_modepage_val[] = { {SCSI_SSC2_MODEPAGE_DATACOMP, "Data Compression"}, {SCSI_SSC2_MODEPAGE_DEVCONF, "Device Configuration"}, {SCSI_SSC2_MODEPAGE_MEDPAR1, "Medium Partition (1)"}, {SCSI_SSC2_MODEPAGE_MEDPAR2, "Medium Partition (2)"}, {SCSI_SSC2_MODEPAGE_MEDPAR3, "Medium Partition (3)"}, {SCSI_SSC2_MODEPAGE_MEDPAR4, "Medium Partition (4)"}, {0x3F, "Return All Mode Pages"}, {0, NULL}, }; #define SCSI_SMC_MODEPAGE_EAA 0x1D /* element address assignment */ #define SCSI_SMC_MODEPAGE_TRANGEOM 0x1E /* transport geometry parameters */ #define SCSI_SMC_MODEPAGE_DEVCAP 0x1F /* device capabilities */ static const value_string scsi_smc_modepage_val[] = { {SCSI_SMC_MODEPAGE_EAA, "Element Address Assignment"}, {SCSI_SMC_MODEPAGE_TRANGEOM, "Transport Geometry Parameters"}, {SCSI_SMC_MODEPAGE_DEVCAP, "Device Capabilities"}, {0x3F, "Return All Mode Pages"}, {0, NULL}, }; #define SCSI_MMC5_MODEPAGE_MRW 0x03 /* MRW */ #define SCSI_MMC5_MODEPAGE_WRPARAM 0x05 /* Write Parameters */ #define SCSI_MMC3_MODEPAGE_MMCAP 0x2A /* device capabilities */ static const value_string scsi_mmc5_modepage_val[] = { {SCSI_MMC5_MODEPAGE_MRW, "MRW"}, {SCSI_MMC5_MODEPAGE_WRPARAM, "Write Parameters"}, {SCSI_MMC3_MODEPAGE_MMCAP, "MM Capabilities and Mechanical Status"}, {0x3F, "Return All Mode Pages"}, {0, NULL}, }; #define SCSI_SPC_RESVIN_SVCA_RDKEYS 0 #define SCSI_SPC_RESVIN_SVCA_RDRESV 1 #define SCSI_SPC_RESVIN_SVCA_RPTCAP 2 #define SCSI_SPC_RESVIN_SVCA_FULL 3 static const value_string scsi_persresvin_svcaction_val[] = { {SCSI_SPC_RESVIN_SVCA_RDKEYS, "Read Keys"}, {SCSI_SPC_RESVIN_SVCA_RDRESV, "Read Reservation"}, {SCSI_SPC_RESVIN_SVCA_RPTCAP, "Report Capabilities"}, {SCSI_SPC_RESVIN_SVCA_FULL, "Read Full Status"}, {0, NULL}, }; #define SCSI_PR_REGISTER 0 #define SCSI_PR_RESERVE 1 #define SCSI_PR_RELEASE 2 #define SCSI_PR_CLEAR 3 #define SCSI_PR_PREEMPT 4 #define SCSI_PR_PREEM_ABORT 5 #define SCSI_PR_REG_IGNORE 6 #define SCSI_PR_REG_MOVE 7 #define SCSI_PR_REPLACE_LOST 8 static const value_string scsi_persresvout_svcaction_val[] = { {SCSI_PR_REGISTER, "Register"}, {SCSI_PR_RESERVE, "Reserve"}, {SCSI_PR_RELEASE, "Release"}, {SCSI_PR_CLEAR, "Clear"}, {SCSI_PR_PREEMPT, "Preempt"}, {SCSI_PR_PREEM_ABORT, "Preempt & Abort"}, {SCSI_PR_REG_IGNORE, "Register & Ignore Existing Key"}, {SCSI_PR_REG_MOVE, "Register & Move"}, {SCSI_PR_REPLACE_LOST, "Replace Lost Reservation"}, {0, NULL}, }; static const value_string scsi_persresv_scope_val[] = { {0, "LU Scope"}, {1, "Obsolete"}, {2, "Element Scope"}, {0, NULL}, }; static const value_string scsi_persresv_type_val[] = { {1, "Write Excl"}, {3, "Excl Access"}, {5, "Write Excl, Registrants Only"}, {6, "Excl Access, Registrants Only"}, {7, "Write Excl, All Registrants"}, {8, "Excl Access, All Registrants"}, {0, NULL}, }; static const value_string scsi_qualifier_val[] = { {0x0, "Device type is connected to logical unit"}, {0x1, "Device type is supported by server but is not connected to logical unit"}, {0x3, "Device type is not supported by server"}, { 0, NULL } }; static const value_string scsi_devtype_val[] = { {SCSI_DEV_SBC , "Direct Access Device"}, {SCSI_DEV_SSC , "Sequential Access Device"}, {SCSI_DEV_PRNT , "Printer"}, {SCSI_DEV_PROC , "Processor"}, {SCSI_DEV_WORM , "WORM"}, {SCSI_DEV_CDROM , "CD-ROM"}, {SCSI_DEV_SCAN , "Scanner"}, {SCSI_DEV_OPTMEM, "Optical Memory"}, {SCSI_DEV_SMC , "Medium Changer"}, {SCSI_DEV_COMM , "Communication"}, {SCSI_DEV_RAID , "Storage Array"}, {SCSI_DEV_SES , "Enclosure Services"}, {SCSI_DEV_RBC , "Simplified Block Device"}, {SCSI_DEV_OCRW , "Optical Card Reader/Writer"}, {SCSI_DEV_OSD , "Object-based Storage Device"}, {SCSI_DEV_ADC , "Automation/Drive Interface"}, {0x1E , "Well known logical unit"}, {SCSI_DEV_NOLUN , "Unknown or no device type"}, {0, NULL}, }; static const enum_val_t scsi_devtype_options[] = { {"block", "Block Device", SCSI_DEV_SBC}, {"sequential", "Sequential Device", SCSI_DEV_SSC}, {"objectbased", "Object Based Storage Device", SCSI_DEV_OSD}, {"mediumchanger", "Medium Changer Device", SCSI_DEV_SMC}, {"cdrom", "Multimedia Device", SCSI_DEV_CDROM}, {NULL, NULL, -1}, }; static const value_string scsi_inquiry_vers_val[] = { {0x00, "No Compliance to any Standard"}, {0x02, "Compliance to ANSI X3.131:1994"}, {0x03, "Compliance to ANSI X3.301:1997"}, {0x04, "Compliance to SPC-2"}, {0x05, "Compliance to SPC-3"}, {0x06, "Compliance to SPC-4"}, {0x80, "Compliance to ISO/IEC 9316:1995"}, {0x82, "Compliance to ISO/IEC 9316:1995 and to ANSI X3.131:1994"}, {0x83, "Compliance to ISO/IEC 9316:1995 and to ANSI X3.301:1997"}, {0x84, "Compliance to ISO/IEC 9316:1995 and SPC-2"}, {0, NULL}, }; static const value_string scsi_modesense_medtype_sbc_val[] = { {0x00, "Default"}, {0x01, "Flexible disk, single-sided; unspecified medium"}, {0x02, "Flexible disk, double-sided; unspecified medium"}, {0x05, "Flexible disk, single-sided, single density; 200mm/8in diameter"}, {0x06, "Flexible disk, double-sided, single density; 200mm/8in diameter"}, {0x09, "Flexible disk, single-sided, double density; 200mm/8in diameter"}, {0x0A, "Flexible disk, double-sided, double density; 200mm/8in diameter"}, {0x0D, "Flexible disk, single-sided, single density; 130mm/5.25in diameter"}, {0x12, "Flexible disk, double-sided, single density; 130mm/5.25in diameter"}, {0x16, "Flexible disk, single-sided, double density; 130mm/5.25in diameter"}, {0x1A, "Flexible disk, double-sided, double density; 130mm/5.25in diameter"}, {0x1E, "Flexible disk, double-sided; 90mm/3.5in diameter"}, {0x40, "Direct-access magnetic tape, 12 tracks"}, {0x44, "Direct-access magnetic tape, 24 tracks"}, {0, NULL}, }; static const value_string scsi_verdesc_val[] = { {0x0000, "Version Descriptor Not Supported or No Standard Identified"}, {0x0020, "SAM (no version claimed)"}, {0x003B, "SAM T10/0994-D revision 18"}, {0x003C, "SAM ANSI INCITS 270-1996"}, {0x0040, "SAM-2 (no version claimed)"}, {0x0054, "SAM-2 T10/1157-D revision 23"}, {0x0055, "SAM-2 T10/1157-D revision 24"}, {0x005C, "SAM-2 ANSI INCITS 366-2003"}, {0x005E, "SAM-2 ISO/IEC 14776-412"}, {0x0060, "SAM-3 (no version claimed)"}, {0x0062, "SAM-3 T10/1561-D revision 7"}, {0x0075, "SAM-3 T10/1561-D revision 13"}, {0x0076, "SAM-3 T10/1561-D revision 14"}, {0x0077, "SAM-3 ANSI INCITS 402-2005"}, {0x0080, "SAM-4 (no version claimed)"}, {0x0087, "SAM-4 T10/1683-D revision 13"}, {0x008B, "SAM-4 T10/1683-D revision 14"}, {0x0090, "SAM-4 ANSI INCITS 447-2008"}, {0x0092, "SAM-4 ISO/IEC 14776-414"}, {0x00A0, "SAM-5 (no version claimed)"}, {0x00A2, "SAM-5 T10/2104-D revision 4"}, {0x0120, "SPC (no version claimed)"}, {0x013B, "SPC T10/0995-D revision 11a"}, {0x013C, "SPC ANSI INCITS 301-1997"}, {0x0140, "MMC (no version claimed)"}, {0x015B, "MMC T10/1048-D revision 10a"}, {0x015C, "MMC ANSI INCITS 304-1997"}, {0x0160, "SCC (no version claimed)"}, {0x017B, "SCC T10/1047-D revision 06c"}, {0x017C, "SCC ANSI INCITS 276-1997"}, {0x0180, "SBC (no version claimed)"}, {0x019B, "SBC T10/0996-D revision 08c"}, {0x019C, "SBC ANSI INCITS 306-1998"}, {0x01A0, "SMC (no version claimed)"}, {0x01BB, "SMC T10/0999-D revision 10a"}, {0x01BC, "SMC ANSI INCITS 314-1998"}, {0x01BE, "SMC ISO/IEC 14776-351"}, {0x01C0, "SES (no version claimed)"}, {0x01DB, "SES T10/1212-D revision 08b"}, {0x01DC, "SES ANSI INCITS 305-1998"}, {0x01DD, "SES T10/1212 revision 08b w/ Amendment ANSI INCITS.305/AM1-2000"}, {0x01DE, "SES ANSI INCITS 305-1998 w/ Amendment ANSI INCITS.305/AM1-2000"}, {0x01E0, "SCC-2 (no version claimed)"}, {0x01FB, "SCC-2 T10/1125-D revision 4"}, {0x01FC, "SCC-2 ANSI INCITS 318-1998"}, {0x0200, "SSC (no version claimed)"}, {0x0201, "SSC T10/0997-D revision 17"}, {0x0207, "SSC T10/0997-D revision 22"}, {0x021C, "SSC ANSI INCITS 335-2000"}, {0x0220, "RBC (no version claimed)"}, {0x0238, "RBC T10/1240-D revision 10a"}, {0x023C, "RBC ANSI INCITS 330-2000"}, {0x0240, "MMC-2 (no version claimed)"}, {0x0255, "MMC-2 T10/1228-D revision 11"}, {0x025B, "MMC-2 T10/1228-D revision 11a"}, {0x025C, "MMC-2 ANSI INCITS 333-2000"}, {0x0260, "SPC-2 (no version claimed)"}, {0x0267, "SPC-2 T10/1236-D revision 12"}, {0x0269, "SPC-2 T10/1236-D revision 18"}, {0x0275, "SPC-2 T10/1236-D revision 19"}, {0x0276, "SPC-2 T10/1236-D revision 20"}, {0x0277, "SPC-2 ANSI INCITS 351-2001"}, {0x0278, "SPC-2 ISO/IEC 14776-452"}, {0x0280, "OCRW (no version claimed)"}, {0x029E, "OCRW ISO/IEC 14776-381"}, {0x02A0, "MMC-3 (no version claimed)"}, {0x02B5, "MMC-3 T10/1363-D revision 9"}, {0x02B6, "MMC-3 T10/1363-D revision 10g"}, {0x02B8, "MMC-3 ANSI INCITS 360-2002"}, {0x02E0, "SMC-2 (no version claimed)"}, {0x02F5, "SMC-2 T10/1383-D revision 5"}, {0x02FC, "SMC-2 T10/1383-D revision 6"}, {0x02FD, "SMC-2 T10/1383-D revision 7"}, {0x02FE, "SMC-2 ANSI INCITS 382-2004"}, {0x0300, "SPC-3 (no version claimed)"}, {0x0301, "SPC-3 T10/1416-D revision 7"}, {0x0307, "SPC-3 T10/1416-D revision 21"}, {0x030F, "SPC-3 T10/1416-D revision 22"}, {0x0312, "SPC-3 T10/1416-D revision 23"}, {0x0314, "SPC-3 ANSI INCITS 408-2005"}, {0x0316, "SPC-3 ISO/IEC 14776-453"}, {0x0320, "SBC-2 (no version claimed)"}, {0x0322, "SBC-2 T10/1417-D revision 5a"}, {0x0324, "SBC-2 T10/1417-D revision 15"}, {0x033B, "SBC-2 T10/1417-D revision 16"}, {0x033D, "SBC-2 ANSI INCITS 405-2005"}, {0x033E, "SBC-2 ISO/IEC 14776-322"}, {0x0340, "OSD (no version claimed)"}, {0x0341, "OSD T10/1355-D revision 0"}, {0x0342, "OSD T10/1355-D revision 7a"}, {0x0343, "OSD T10/1355-D revision 8"}, {0x0344, "OSD T10/1355-D revision 9"}, {0x0355, "OSD T10/1355-D revision 10"}, {0x0356, "OSD ANSI INCITS 400-2004"}, {0x0360, "SSC-2 (no version claimed)"}, {0x0374, "SSC-2 T10/1434-D revision 7"}, {0x0375, "SSC-2 T10/1434-D revision 9"}, {0x037D, "SSC-2 ANSI INCITS 380-2003"}, {0x0380, "BCC (no version claimed)"}, {0x03A0, "MMC-4 (no version claimed)"}, {0x03B0, "MMC-4 T10/1545-D revision 5"}, {0x03B1, "MMC-4 T10/1545-D revision 5a"}, {0x03BD, "MMC-4 T10/1545-D revision 3"}, {0x03BE, "MMC-4 T10/1545-D revision 3d"}, {0x03BF, "MMC-4 ANSI INCITS 401-2005"}, {0x03C0, "ADC (no version claimed)"}, {0x03D5, "ADC T10/1558-D revision 6"}, {0x03D6, "ADC T10/1558-D revision 7"}, {0x03D7, "ADC ANSI INCITS 403-2005"}, {0x03E0, "SES-2 (no version claimed)"}, {0x03E1, "SES-2 T10/1559-D revision 16"}, {0x03E7, "SES-2 T10/1559-D revision 19"}, {0x03EB, "SES-2 T10/1559-D revision 20"}, {0x03F0, "SES-2 ANSI INCITS 448-2008"}, {0x03F2, "SES-2 ISO/IEC 14776-372"}, {0x0400, "SSC-3 (no version claimed)"}, {0x0403, "SSC-3 T10/1611-D revision 04a"}, {0x0407, "SSC-3 T10/1611-D revision 5"}, {0x0409, "SSC-3 ANSI INCITS 467-2011"}, {0x0420, "MMC-5 (no version claimed)"}, {0x042F, "MMC-5 T10/1675-D revision 3"}, {0x0431, "MMC-5 T10/1675-D revision 03b"}, {0x0432, "MMC-5 T10/1675-D revision 4"}, {0x0434, "MMC-5 ANSI INCITS 430-2007"}, {0x0440, "OSD-2 (no version claimed)"}, {0x0444, "OSD-2 T10/1729-D revision 4"}, {0x0446, "OSD-2 T10/1729-D revision 5"}, {0x0448, "OSD-2 ANSI INCITS 458-2011"}, {0x0460, "SPC-4 (no version claimed)"}, {0x0461, "SPC-4 T10/BSR INCITS 513 revision 16"}, {0x0462, "SPC-4 T10/BSR INCITS 513 revision 18"}, {0x0463, "SPC-4 T10/BSR INCITS 513 revision 23"}, {0x0466, "SPC-4 T10/BSR INCITS 513 revision 36"}, {0x0480, "SMC-3 (no version claimed)"}, {0x0482, "SMC-3 T10/1730-D revision 15"}, {0x0484, "SMC-3 T10/1730-D revision 16"}, {0x0486, "SMC-3 ANSI INCITS 484-2012"}, {0x04A0, "ADC-2 (no version claimed)"}, {0x04A7, "ADC-2 T10/1741-D revision 7"}, {0x04AA, "ADC-2 T10/1741-D revision 8"}, {0x04AC, "ADC-2 ANSI INCITS 441-2008"}, {0x04C0, "SBC-3 (no version claimed)"}, {0x04C3, "SBC-3 T10/BSR INCITS 514 revision 35"}, {0x04E0, "MMC-6 (no version claimed)"}, {0x04E3, "MMC-6 T10/1836-D revision 02b"}, {0x04E5, "MMC-6 T10/1836-D revision 02g"}, {0x04E6, "MMC-6 ANSI INCITS 468-2010"}, {0x04E7, "MMC-6 ANSI INCITS 468-2010 + MMC-6/AM1 ANSI"}, {0x0500, "ADC-3 (no version claimed)"}, {0x0502, "ADC-3 T10/1895-D revision 4"}, {0x0504, "ADC-3 T10/1895-D revision 5"}, {0x0506, "ADC-3 T10/1895-D revision 05a"}, {0x050A, "ADC-3 ANSI INCITS 497-2012"}, {0x0520, "SSC-4 (no version claimed)"}, {0x0523, "SSC-4 T10/BSR INCITS 516 revision 2"}, {0x0560, "OSD-3 (no version claimed)"}, {0x0580, "SES-3 (no version claimed)"}, {0x05A0, "SSC-5 (no version claimed)"}, {0x05C0, "SPC-5 (no version claimed)"}, {0x05E0, "SFSC (no version claimed)"}, {0x0600, "SBC-4 (no version claimed)"}, {0x0820, "SSA-TL2 (no version claimed)"}, {0x083B, "SSA-TL2 T10.1/1147-D revision 05b"}, {0x083C, "SSA-TL2 ANSI INCITS 308-1998"}, {0x0840, "SSA-TL1 (no version claimed)"}, {0x085B, "SSA-TL1 T10.1/0989-D revision 10b"}, {0x085C, "SSA-TL1 ANSI INCITS 295-1996"}, {0x0860, "SSA-S3P (no version claimed)"}, {0x087B, "SSA-S3P T10.1/1051-D revision 05b"}, {0x087C, "SSA-S3P ANSI INCITS 309-1998"}, {0x0880, "SSA-S2P (no version claimed)"}, {0x089B, "SSA-S2P T10.1/1121-D revision 07b"}, {0x089C, "SSA-S2P ANSI INCITS 294-1996"}, {0x08A0, "SIP (no version claimed)"}, {0x08BB, "SIP T10/0856-D revision 10"}, {0x08BC, "SIP ANSI INCITS 292-1997"}, {0x08C0, "FCP (no version claimed)"}, {0x08DB, "FCP T10/0993-D revision 12"}, {0x08DC, "FCP ANSI INCITS 269-1996"}, {0x08E0, "SBP-2 (no version claimed)"}, {0x08FB, "SBP-2 T10/1155-D revision 4"}, {0x08FC, "SBP-2 ANSI INCITS 325-1998"}, {0x0900, "FCP-2 (no version claimed)"}, {0x0901, "FCP-2 T10/1144-D revision 4"}, {0x0915, "FCP-2 T10/1144-D revision 7"}, {0x0916, "FCP-2 T10/1144-D revision 7a"}, {0x0917, "FCP-2 ANSI INCITS 350-2003"}, {0x0918, "FCP-2 T10/1144-D revision 8"}, {0x0920, "SST (no version claimed)"}, {0x0935, "SST T10/1380-D revision 8b"}, {0x0940, "SRP (no version claimed)"}, {0x0954, "SRP T10/1415-D revision 10"}, {0x0955, "SRP T10/1415-D revision 16a"}, {0x095C, "SRP ANSI INCITS 365-2002"}, {0x0960, "iSCSI (no version claimed)"}, {0x0980, "SBP-3 (no version claimed)"}, {0x0982, "SBP-3 T10/1467-D revision 1f"}, {0x0994, "SBP-3 T10/1467-D revision 3"}, {0x099A, "SBP-3 T10/1467-D revision 4"}, {0x099B, "SBP-3 T10/1467-D revision 5"}, {0x099C, "SBP-3 ANSI INCITS 375-2004"}, {0x09C0, "ADP (no version claimed)"}, {0x09E0, "ADT (no version claimed)"}, {0x09F9, "ADT T10/1557-D revision 11"}, {0x09FA, "ADT T10/1557-D revision 14"}, {0x09FD, "ADT ANSI INCITS 406-2005"}, {0x0A00, "FCP-3 (no version claimed)"}, {0x0A07, "FCP-3 T10/1560-D revision 3f"}, {0x0A0F, "FCP-3 T10/1560-D revision 4"}, {0x0A11, "FCP-3 ANSI INCITS 416-2006"}, {0x0A1C, "FCP-3 ISO/IEC 14776-223"}, {0x0A20, "ADT-2 (no version claimed)"}, {0x0A22, "ADT-2 T10/1742-D revision 6"}, {0x0A27, "ADT-2 T10/1742-D revision 8"}, {0x0A28, "ADT-2 T10/1742-D revision 9"}, {0x0A2B, "ADT-2 ANSI INCITS 472-2011"}, {0x0A40, "FCP-4 (no version claimed)"}, {0x0A42, "FCP-4 T10/1828-D revision 1"}, {0x0A44, "FCP-4 T10/1828-D revision 2"}, {0x0A45, "FCP-4 T10/1828-D revision 02b"}, {0x0A46, "FCP-4 ANSI INCITS 481-2012"}, {0x0AA0, "SPI (no version claimed)"}, {0x0AB9, "SPI T10/0855-D revision 15a"}, {0x0ABA, "SPI ANSI INCITS 253-1995"}, {0x0ABB, "SPI T10/0855-D revision 15a with SPI Amnd revision 3a"}, {0x0ABC, "SPI ANSI INCITS 253-1995 with SPI Amnd ANSI INCITS 253/AM1-1998"}, {0x0AC0, "Fast-20 (no version claimed)"}, {0x0ADB, "Fast-20 T10/1071 revision 6"}, {0x0ADC, "Fast-20 ANSI INCITS 277-1996"}, {0x0AE0, "SPI-2 (no version claimed)"}, {0x0AFB, "SPI-2 T10/1142-D revision 20b"}, {0x0AFC, "SPI-2 ANSI INCITS 302-1999"}, {0x0B00, "SPI-3 (no version claimed)"}, {0x0B18, "SPI-3 T10/1302-D revision 10"}, {0x0B19, "SPI-3 T10/1302-D revision 13a"}, {0x0B1A, "SPI-3 T10/1302-D revision 14"}, {0x0B1C, "SPI-3 ANSI INCITS 336-2000"}, {0x0B20, "EPI (no version claimed)"}, {0x0B3B, "EPI T10/1134 revision 16"}, {0x0B3C, "EPI ANSI INCITS TR-23 1999"}, {0x0B40, "SPI-4 (no version claimed)"}, {0x0B54, "SPI-4 T10/1365-D revision 7"}, {0x0B55, "SPI-4 T10/1365-D revision 9"}, {0x0B56, "SPI-4 ANSI INCITS 362-2002"}, {0x0B59, "SPI-4 T10/1365-D revision 10"}, {0x0B60, "SPI-5 (no version claimed)"}, {0x0B79, "SPI-5 T10/1525-D revision 3"}, {0x0B7A, "SPI-5 T10/1525-D revision 5"}, {0x0B7B, "SPI-5 T10/1525-D revision 6"}, {0x0B7C, "SPI-5 ANSI INCITS 367-2003"}, {0x0BE0, "SAS (no version claimed)"}, {0x0BE1, "SAS T10/1562-D revision 1"}, {0x0BF5, "SAS T10/1562-D revision 3"}, {0x0BFA, "SAS T10/1562-D revision 4"}, {0x0BFB, "SAS T10/1562-D revision 4"}, {0x0BFC, "SAS T10/1562-D revision 5"}, {0x0BFD, "SAS ANSI INCITS 376-2003"}, {0x0C00, "SAS-1.1 (no version claimed)"}, {0x0C07, "SAS-1.1 T10/1601-D revision 9"}, {0x0C0F, "SAS-1.1 T10/1601-D revision 10"}, {0x0C11, "SAS-1.1 ANSI INCITS 417-2006"}, {0x0C12, "SAS-1.1 ISO/IEC 14776-151"}, {0x0C20, "SAS-2 (no version claimed)"}, {0x0C23, "SAS-2 T10/1760-D revision 14"}, {0x0C27, "SAS-2 T10/1760-D revision 15"}, {0x0C28, "SAS-2 T10/1760-D revision 16"}, {0x0C2A, "SAS-2 ANSI INCITS 457-2010"}, {0x0C40, "SAS-2.1 (no version claimed)"}, {0x0C48, "SAS-2.1 T10/2125-D revision 4"}, {0x0C4A, "SAS-2.1 T10/2125-D revision 6"}, {0x0C4B, "SAS-2.1 T10/2125-D revision 7"}, {0x0C4E, "SAS-2.1 ANSI INCITS 478-2011"}, {0x0C60, "SAS-3 (no version claimed)"}, {0x0C63, "SAS-3 T10/BSR INCITS 519 revision 05a"}, {0x0D20, "FC-PH (no version claimed)"}, {0x0D3B, "FC-PH ANSI INCITS 230-1994"}, {0x0D3C, "FC-PH ANSI INCITS 230-1994 with Amnd 1 ANSI INCITS 230/AM1-1996"}, {0x0D40, "FC-AL (no version claimed)"}, {0x0D5C, "FC-AL ANSI INCITS 272-1996"}, {0x0D60, "FC-AL-2 (no version claimed)"}, {0x0D61, "FC-AL-2 T11/1133-D revision 7.0"}, {0x0D63, "FC-AL-2 ANSI INCITS 332-1999 with AM1-2003 & AM2-2006"}, {0x0D64, "FC-AL-2 ANSI INCITS 332-1999 with Amnd 2 AM2-2006"}, {0x0D65, "FC-AL-2 ISO/IEC 14165-122 with AM1 & AM2"}, {0x0D7C, "FC-AL-2 ANSI INCITS 332-1999"}, {0x0D7D, "FC-AL-2 ANSI INCITS 332-1999 with Amnd 1 AM1-2003"}, {0x0D80, "FC-PH-3 (no version claimed)"}, {0x0D9C, "FC-PH-3 ANSI INCITS 303-1998"}, {0x0DA0, "FC-FS (no version claimed)"}, {0x0DB7, "FC-FS T11/1331-D revision 1.2"}, {0x0DB8, "FC-FS T11/1331-D revision 1.7"}, {0x0DBC, "FC-FS ANSI INCITS 373-2003"}, {0x0DBD, "FC-FS ISO/IEC 14165-251"}, {0x0DC0, "FC-PI (no version claimed)"}, {0x0DDC, "FC-PI ANSI INCITS 352-2002"}, {0x0DE0, "FC-PI-2 (no version claimed)"}, {0x0DE2, "FC-PI-2 T11/1506-D revision 5.0"}, {0x0DE4, "FC-PI-2 ANSI INCITS 404-2006"}, {0x0E00, "FC-FS-2 (no version claimed)"}, {0x0E02, "FC-FS-2 ANSI INCITS 242-2007"}, {0x0E03, "FC-FS-2 ANSI INCITS 242-2007 with AM1 ANSI INCITS 242/AM1-2007"}, {0x0E20, "FC-LS (no version claimed)"}, {0x0E21, "FC-LS T11/1620-D revision 1.62"}, {0x0E29, "FC-LS ANSI INCITS 433-2007"}, {0x0E40, "FC-SP (no version claimed)"}, {0x0E42, "FC-SP T11/1570-D revision 1.6"}, {0x0E45, "FC-SP ANSI INCITS 426-2007"}, {0x0E60, "FC-PI-3 (no version claimed)"}, {0x0E62, "FC-PI-3 T11/1625-D revision 2.0"}, {0x0E68, "FC-PI-3 T11/1625-D revision 2.1"}, {0x0E6A, "FC-PI-3 T11/1625-D revision 4.0"}, {0x0E6E, "FC-PI-3 ANSI INCITS 460-2011"}, {0x0E80, "FC-PI-4 (no version claimed)"}, {0x0E82, "FC-PI-4 T11/1647-D revision 8.0"}, {0x0E88, "FC-PI-4 ANSI INCITS 450-2009"}, {0x0EA0, "FC 10GFC (no version claimed)"}, {0x0EA2, "FC 10GFC ANSI INCITS 364-2003"}, {0x0EA3, "FC 10GFC ISO/IEC 14165-116"}, {0x0EA5, "FC 10GFC ISO/IEC 14165-116 with AM1"}, {0x0EA6, "FC 10GFC ANSI INCITS 364-2003 with AM1 ANSI INCITS 364/AM1-2007"}, {0x0EC0, "FC-SP-2 (no version claimed)"}, {0x0EE0, "FC-FS-3 (no version claimed)"}, {0x0EE2, "FC-FS-3 T11/1861-D revision 0.9"}, {0x0EE7, "FC-FS-3 T11/1861-D revision 1.0"}, {0x0EE9, "FC-FS-3 T11/1861-D revision 1.10"}, {0x0EEB, "FC-FS-3 ANSI INCITS 470-2011"}, {0x0F00, "FC-LS-2 (no version claimed)"}, {0x0F03, "FC-LS-2 T11/2103-D revision 2.11"}, {0x0F05, "FC-LS-2 T11/2103-D revision 2.21"}, {0x0F07, "FC-LS-2 ANSI INCITS 477-2011"}, {0x0F20, "FC-PI-5 (no version claimed)"}, {0x0F27, "FC-PI-5 T11/2118-D revision 2.00"}, {0x0F28, "FC-PI-5 T11/2118-D revision 3.00"}, {0x0F2A, "FC-PI-5 T11/2118-D revision 6.00"}, {0x0F2B, "FC-PI-5 T11/2118-D revision 6.10"}, {0x0F2E, "FC-PI-5 ANSI INCITS 479-2011"}, {0x0F40, "FC-PI-6 (no version claimed)"}, {0x0F60, "FC-FS-4 (no version claimed)"}, {0x0F80, "FC-LS-3 (no version claimed)"}, {0x12A0, "FC-SCM (no version claimed)"}, {0x12A3, "FC-SCM T11/1824DT revision 1.0"}, {0x12A5, "FC-SCM T11/1824DT revision 1.1"}, {0x12A7, "FC-SCM T11/1824DT revision 1.4"}, {0x12AA, "FC-SCM INCITS TR-47 2012"}, {0x12C0, "FC-DA-2 (no version claimed)"}, {0x12C3, "FC-DA-2 T11/1870DT revision 1.04"}, {0x12C5, "FC-DA-2 T11/1870DT revision 1.06"}, {0x12C9, "FC-DA-2 INCITS TR-49 2012"}, {0x12E0, "FC-DA (no version claimed)"}, {0x12E2, "FC-DA T11/1513-DT revision 3.1"}, {0x12E8, "FC-DA ANSI INCITS TR-36 2004"}, {0x12E9, "FC-DA ISO/IEC 14165-341"}, {0x1300, "FC-Tape (no version claimed)"}, {0x1301, "FC-Tape T11/1315 revision 1.16"}, {0x131B, "FC-Tape T11/1315 revision 1.17"}, {0x131C, "FC-Tape ANSI INCITS TR-24 1999"}, {0x1320, "FC-FLA (no version claimed)"}, {0x133B, "FC-FLA T11/1235 revision 7"}, {0x133C, "FC-FLA ANSI INCITS TR-20 1998"}, {0x1340, "FC-PLDA (no version claimed)"}, {0x135B, "FC-PLDA T11/1162 revision 2.1"}, {0x135C, "FC-PLDA ANSI INCITS TR-19 1998"}, {0x1360, "SSA-PH2 (no version claimed)"}, {0x137B, "SSA-PH2 T10.1/1145-D revision 09c"}, {0x137C, "SSA-PH2 ANSI INCITS 293-1996"}, {0x1380, "SSA-PH3 (no version claimed)"}, {0x139B, "SSA-PH3 T10.1/1146-D revision 05b"}, {0x139C, "SSA-PH3 ANSI INCITS 307-1998"}, {0x14A0, "IEEE 1394 (no version claimed)"}, {0x14BD, "ANSI IEEE 1394-1995"}, {0x14C0, "IEEE 1394a (no version claimed)"}, {0x14E0, "IEEE 1394b (no version claimed)"}, {0x15E0, "ATA/ATAPI-6 (no version claimed)"}, {0x15FD, "ATA/ATAPI-6 ANSI INCITS 361-2002"}, {0x1600, "ATA/ATAPI-7 (no version claimed)"}, {0x1602, "ATA/ATAPI-7 T13/1532-D revision 3"}, {0x161C, "ATA/ATAPI-7 ANSI INCITS 397-2005"}, {0x161E, "ATA/ATAPI-7 ISO/IEC 24739"}, {0x1620, "ATA/ATAPI-8 ATA8-AAM (no version claimed)"}, {0x1621, "ATA/ATAPI-8 ATA8-APT Parallel Transport (no version claimed)"}, {0x1622, "ATA/ATAPI-8 ATA8-AST Serial Transport (no version claimed)"}, {0x1623, "ATA/ATAPI-8 ATA8-ACS ATA/ATAPI Command Set (no version claimed)"}, {0x1628, "ATA/ATAPI-8 ATA8-AAM ANSI INCITS 451-2008"}, {0x162A, "ATA/ATAPI-8 ATA8-ACS ANSI INCITS 452-2009 w/Amendment 1"}, {0x1728, "Universal Serial Bus Specification, Revision 1.1"}, {0x1729, "Universal Serial Bus Specification, Revision 2.0"}, {0x1730, "USB Mass Storage Class Bulk-Only Transport, Revision 1.0"}, {0x1740, "UAS (no version claimed)"}, {0x1743, "UAS T10/2095-D revision 2"}, {0x1747, "UAS T10/2095-D revision 4"}, {0x1748, "UAS ANSI INCITS 471-2010"}, {0x1761, "ACS-2 (no version claimed)"}, {0x1762, "ACS-2 ANSI INCITS 482-2013"}, {0x1765, "ACS-3 (no version claimed)"}, {0x1780, "UAS-2 (no version claimed)"}, {0x1EA0, "SAT (no version claimed)"}, {0x1EA7, "SAT T10/1711-D revision 8"}, {0x1EAB, "SAT T10/1711-D revision 9"}, {0x1EAD, "SAT ANSI INCITS 431-2007"}, {0x1EC0, "SAT-2 (no version claimed)"}, {0x1EC4, "SAT-2 T10/1826-D revision 6"}, {0x1EC8, "SAT-2 T10/1826-D revision 9"}, {0x1ECA, "SAT-2 ANSI INCITS 465-2010"}, {0x1EE0, "SAT-3 (no version claimed)"}, {0x1EE2, "SAT-3 T10/BSR INCITS 517 revision 4"}, {0x1F00, "SAT-4 (no version claimed)"}, {0x20A0, "SPL (no version claimed)"}, {0x20A3, "SPL T10/2124-D revision 6a"}, {0x20A5, "SPL T10/2124-D revision 7"}, {0x20A7, "SPL ANSI INCITS 476-2011"}, {0x20A8, "SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012"}, {0x20C0, "SPL-2 (no version claimed)"}, {0x20C2, "SPL-2 T10/BSR INCITS 505 revision 4"}, {0x20C4, "SPL-2 T10/BSR INCITS 505 revision 5"}, {0x20E0, "SPL-3 (no version claimed)"}, {0x21E0, "SOP (no version claimed)"}, {0x21E4, "SOP T10/BSR INCITS 489 revision 4"}, {0x2200, "PQI (no version claimed)"}, {0x2204, "PQI T10/BSR INCITS 490 revision 6"}, {0x2220, "SOP-2 (no version claimed)"}, {0x2240, "PQI-2 (no version claimed)"}, {0xFFC0, "IEEE 1667 (no version claimed)"}, {0xFFC1, "IEEE 1667-2006"}, {0xFFC2, "IEEE 1667-2009"}, {0, NULL}, }; static value_string_ext scsi_verdesc_val_ext = VALUE_STRING_EXT_INIT(scsi_verdesc_val); /* Command Support Data "Support" field definitions */ static const value_string scsi_cmdt_supp_val[] = { {0, "Data not currently available"}, {1, "SCSI Command not supported"}, {2, "Reserved"}, {3, "SCSI Command supported in conformance with a SCSI standard"}, {4, "Vendor Specific"}, {5, "SCSI Command supported in a vendor specific manner"}, {6, "Vendor Specific"}, {7, "Reserved"}, {0, NULL}, }; #define CODESET_BINARY 1 #define CODESET_ASCII 2 #define CODESET_UTF8 3 const value_string scsi_devid_codeset_val[] = { {0, "Reserved"}, {CODESET_BINARY, "Identifier field contains binary values"}, {CODESET_ASCII, "Identifier field contains ASCII graphic codes"}, {CODESET_UTF8, "Identifier field contains UTF-8 codes"}, {0, NULL}, }; static const value_string scsi_devid_assoc_val[] = { {0, "Identifier is associated with addressed logical/physical device"}, {1, "Identifier is associated with the port that received the request"}, {2, "Identifier is associated with the SCSI target devices that contains the logical/physical device"}, {0, NULL}, }; #define DEVID_TYPE_VEND_ID_VEND_SPEC_ID 1 #define DEVID_TYPE_NAA 3 const value_string scsi_devid_idtype_val[] = { {0, "Vendor-specific ID (non-globally unique)"}, {DEVID_TYPE_VEND_ID_VEND_SPEC_ID, "Vendor-ID + vendor-specific ID (globally unique)"}, {2, "EUI-64 ID"}, {DEVID_TYPE_NAA, "NAA"}, {4, "4-byte Binary Number/Reserved"}, {0, NULL}, }; static const value_string scsi_modesns_mrie_val[] = { {0, "No Reporting of Informational Exception Condition"}, {1, "Asynchronous Error Reporting"}, {2, "Generate Unit Attention"}, {3, "Conditionally Generate Recovered Error"}, {4, "Unconditionally Generate Recovered Error"}, {5, "Generate No Sense"}, {6, "Only Report Informational Exception Condition on Request"}, {0, NULL}, }; static const value_string scsi_modesns_tst_val[] = { {0, "Task Set Per LU For All Initiators"}, {1, "Task Set Per Initiator Per LU"}, {0, NULL}, }; static const value_string scsi_modesns_qmod_val[] = { {0, "Restricted reordering"}, {1, "Unrestricted reordering"}, {0, NULL}, }; static const true_false_string scsi_modesns_qerr_val = { "All blocked tasks shall be aborted on CHECK CONDITION", "Blocked tasks shall resume after ACA/CA is cleared", }; static const true_false_string scsi_spec_i_pt_tfs = { "Specify Initiator Ports is set", "Specify Initiator Ports is not set" }; static const true_false_string scsi_all_tg_pt_tfs = { "All Target Ports is set", "All Target Ports is not set" }; static const true_false_string scsi_aptpl_tfs = { "Active Persist Through Power Loss is set", "Active Persist Through Power Loss is not set" }; static const true_false_string scsi_naca_tfs = { "Normal ACA is set", "Normal ACA is not set" }; static const true_false_string normaca_tfs = { "NormACA is SUPPORTED", "Normaca is NOT supported", }; static const true_false_string sccs_tfs = { "SCC is SUPPORTED", "Scc is NOT supported", }; static const true_false_string acc_tfs = { "Access Control Coordinator is SUPPORTED", "Access control coordinator NOT supported", }; static const true_false_string bque_tfs = { "BQUE is SUPPORTED", "Bque is NOT supported", }; static const true_false_string encserv_tfs = { "Enclosed Services is SUPPORTED", "Enclosed services is NOT supported", }; static const true_false_string reladr_tfs = { "Relative Addressing mode is SUPPORTED", "Relative addressing mode is NOT supported", }; #if 0 static const true_false_string sync_tfs = { "Synchronous data transfer is SUPPORTED", "Synchronous data transfer is NOT supported", }; #endif static const true_false_string linked_tfs = { "Linked Commands are SUPPORTED", "Linked commands are NOT supported", }; static const true_false_string cmdque_tfs = { "Command queuing is SUPPORTED", "Command queuing is NOT supported", }; static const true_false_string multip_tfs = { "This is a MULTIPORT device", "This is NOT a multiport device", }; static const true_false_string mchngr_tfs = { "This device is attached to a MEDIUMCHANGER", "This is a normal device", }; static const true_false_string tpc_tfs = { "Third Party Copy is SUPPORTED", "Third party copy is NOT supported", }; static const true_false_string protect_tfs = { "Protection Information is SUPPORTED", "Protection information NOT supported", }; static const true_false_string hisup_tfs = { "Hierarchical Addressing Mode is SUPPORTED", "Hierarchical addressing mode is NOT supported", }; static const true_false_string aerc_tfs = { "Async Event Reporting Capability is SUPPORTED", "Async event reporting capability is NOT supported", }; static const true_false_string trmtsk_tfs = { "Terminate Task management functions are SUPPORTED", "Terminate task management functions are NOT supported", }; static const true_false_string scsi_removable_val = { "This is a REMOVABLE device", "This device is NOT removable", }; static const true_false_string scsi_modesns_tas_val = { "Terminated tasks aborted without informing initiators", "Tasks aborted by another initiator terminated with TASK ABORTED", }; static const true_false_string scsi_modesns_rac_val = { "Report a CHECK CONDITION Instead of Long Busy Condition", "Long Busy Conditions Maybe Reported", }; /* SCSI Transport Protocols */ #define SCSI_PROTO_FCP 0 #define SCSI_PROTO_iSCSI 5 static const value_string scsi_proto_val[] = { {0, "FCP"}, {5, "iSCSI"}, {0, NULL}, }; static const value_string scsi_fcp_rrtov_val[] = { {0, "No Timer Specified"}, {1, "0.001 secs"}, {3, "0.1 secs"}, {5, "10 secs"}, {0, NULL}, }; static const value_string scsi_sensekey_val[] = { {0x0, "No Sense"}, {0x1, "Recovered Error"}, {0x2, "Not Ready"}, {0x3, "Medium Error"}, {0x4, "Hardware Error"}, {0x5, "Illegal Request"}, {0x6, "Unit Attention"}, {0x7, "Data Protection"}, {0x8, "Blank Check"}, {0x9, "Vendor Specific"}, {0xA, "Copy Aborted"}, {0xB, "Command Aborted"}, {0xC, "Obsolete Error Code"}, {0xD, "Overflow Command"}, {0xE, "Miscompare"}, {0xF, "Reserved"}, {0, NULL}, }; static const value_string scsi_sense_desc_type_val[] = { {0x00, "Information"}, {0x01, "Command specific information"}, {0x02, "Sense key specific"}, {0x03, "Field replaceable unit"}, {0x04, "Stream commands"}, {0x05, "Block commands"}, {0x06, "OSD object identification"}, {0x07, "OSD response integrity check value"}, {0x08, "OSD attribute identification"}, {0x09, "ATA Status"}, {0x0A, "Another progress indication"}, {0x0B, "User data segment referral"}, {0x0C, "Forwarded sense data"}, {0, NULL}, }; static const value_string scsi_sense_sks_fp_cd_val[] = { {0, "illegal parameter in the Data-Out buffer"}, {1, "illegal parameter in the CDB"}, {0, NULL}, }; static const value_string scsi_sns_errtype_val[] = { {0x70, "Current Error"}, {0x71, "Deferred Error"}, {0x72, "Current Error"}, {0x73, "Deferred Error"}, {0x7F, "Vendor Specific"}, {0, NULL}, }; /* All can be found @ http://www.t10.org/lists/asc-alph.txt or http://www.t10.org/lists/asc-num.txt */ static const value_string scsi_asc_val[] = { {0x0000, "No Additional Sense Information"}, {0x0001, "Filemark Detected"}, {0x0002, "End Of Partition/Medium Detected"}, {0x0003, "Setmark Detected"}, {0x0004, "Beginning Of Partition Detected"}, {0x0005, "End Of Data Detected"}, {0x0006, "I/O Process Terminated"}, {0x0016, "Operation In Progress"}, {0x0017, "Cleaning Requested"}, {0x0018, "Erase Operation In Progress"}, {0x0019, "Locate Operation In Progress"}, {0x001A, "Rewind Operation In Progress"}, {0x001B, "Set Capacity Operation In Progress"}, {0x001C, "Verify operation in progress"}, {0x0100, "No Index/Sector Signal"}, {0x0200, "No Seek Complete"}, {0x0300, "Peripheral Device Write Fault"}, {0x0400, "Logical Unit Not Ready, Cause Not Reportable"}, {0x0401, "Logical Unit Is In Process Of Becoming Ready"}, {0x0402, "Logical Unit Not Ready, Initializing Cmd. Required"}, {0x0403, "Logical Unit Not Ready, Manual Intervention Required"}, {0x0404, "Logical Unit Not Ready, Format In Progress"}, {0x0405, "Logical Unit Not Ready, Rebuild In Progress"}, {0x0406, "Logical Unit Not Ready, Recalculation In Progress"}, {0x0407, "Logical Unit Not Ready, Operation In Progress"}, {0x0409, "Logical Unit Not Ready, Self-Test In Progress"}, {0x0500, "Logical Unit Does Not Respond To Selection"}, {0x0600, "No Reference Position Found"}, {0x0700, "Multiple Peripheral Devices Selected"}, {0x0800, "Logical Unit Communication Failure"}, {0x0801, "Logical Unit Communication Time-Out"}, {0x0802, "Logical Unit Communication Parity Error"}, {0x0803, "Logical Unit Communication Crc Error (Ultra-Dma/32)"}, {0x0804, "Unreachable Copy Target"}, {0x0900, "Track Following Error"}, {0x0904, "Head Select Fault"}, {0x0A00, "Error Log Overflow"}, {0x0B00, "Warning"}, {0x0B01, "Warning - Specified Temperature Exceeded"}, {0x0B02, "Warning - Enclosure Degraded"}, {0x0C02, "Write Error - Auto Reallocation Failed"}, {0x0C03, "Write Error - Recommend Reassignment"}, {0x0C04, "Compression Check Miscompare Error"}, {0x0C05, "Data Expansion Occurred During Compression"}, {0x0C06, "Block Not Compressible"}, {0x0D00, "Error Detected By Third Party Temporary Initiator"}, {0x0D01, "Third Party Device Failure"}, {0x0D02, "Copy Target Device Not Reachable"}, {0x0D03, "Incorrect Copy Target Device Type"}, {0x0D04, "Copy Target Device Data Underrun"}, {0x0D05, "Copy Target Device Data Overrun"}, {0x1000, "Id Crc Or Ecc Error"}, {0x1100, "Unrecovered Read Error"}, {0x1101, "Read Retries Exhausted"}, {0x1102, "Error Too Long To Correct"}, {0x1103, "Multiple Read Errors"}, {0x1104, "Unrecovered Read Error - Auto Reallocate Failed"}, {0x110A, "Miscorrected Error"}, {0x110B, "Unrecovered Read Error - Recommend Reassignment"}, {0x110C, "Unrecovered Read Error - Recommend Rewrite The Data"}, {0x110D, "De-Compression Crc Error"}, {0x110E, "Cannot Decompress Using Declared Algorithm"}, {0x1200, "Address Mark Not Found For Id Field"}, {0x1300, "Address Mark Not Found For Data Field"}, {0x1400, "Recorded Entity Not Found"}, {0x1401, "Record Not Found"}, {0x1405, "Record Not Found - Recommend Reassignment"}, {0x1406, "Record Not Found - Data Auto-Reallocated"}, {0x1500, "Random Positioning Error"}, {0x1501, "Mechanical Positioning Error"}, {0x1502, "Positioning Error Detected By Read Of Medium"}, {0x1600, "Data Synchronization Mark Error"}, {0x1601, "Data Sync Error - Data Rewritten"}, {0x1602, "Data Sync Error - Recommend Rewrite"}, {0x1603, "Data Sync Error - Data Auto-Reallocated"}, {0x1604, "Data Sync Error - Recommend Reassignment"}, {0x1700, "Recovered Data With No Error Correction Applied"}, {0x1701, "Recovered Data With Retries"}, {0x1702, "Recovered Data With Positive Head Offset"}, {0x1703, "Recovered Data With Negative Head Offset"}, {0x1705, "Recovered Data Using Previous Sector Id"}, {0x1706, "Recovered Data Without Ecc - Data Auto-Reallocated"}, {0x1707, "Recovered Data Without Ecc - Recommend Reassignment"}, {0x1708, "Recovered Data Without Ecc - Recommend Rewrite"}, {0x1709, "Recovered Data Without Ecc - Data Rewritten"}, {0x1800, "Recovered Data With Error Correction Applied"}, {0x1801, "Recovered Data With Error Corr. & Retries Applied"}, {0x1802, "Recovered Data - Data Auto-Reallocated"}, {0x1805, "Recovered Data - Recommend Reassignment"}, {0x1806, "Recovered Data - Recommend Rewrite"}, {0x1807, "Recovered Data With Ecc - Data Rewritten"}, {0x1900, "List Error"}, {0x1901, "List Not Available"}, {0x1902, "List Error In Primary List"}, {0x1903, "List Error In Grown List"}, {0x1A00, "Parameter List Length Error"}, {0x1B00, "Synchronous Data Transfer Error"}, {0x1C00, "Defect List Not Found"}, {0x1C01, "Primary Defect List Not Found"}, {0x1C02, "Grown Defect List Not Found"}, {0x1D00, "Miscompare During Verify Operation"}, {0x1E00, "Recovered Id With Ecc Correction"}, {0x1F00, "Defect List Transfer"}, {0x2000, "Invalid Command Operation Code"}, {0x2100, "Logical Block Address Out Of Range"}, {0x2101, "Invalid Element Address"}, {0x2400, "Invalid Field In Cdb"}, {0x2401, "Cdb Decryption Error"}, {0x2500, "Logical Unit Not Supported"}, {0x2600, "Invalid Field In Parameter List"}, {0x2601, "Parameter Not Supported"}, {0x2602, "Parameter Value Invalid"}, {0x2603, "Threshold Parameters Not Supported"}, {0x2604, "Invalid Release Of Persistent Reservation"}, {0x2605, "Data Decryption Error"}, {0x2606, "Too Many Target Descriptors"}, {0x2607, "Unsupported Target Descriptor Type Code"}, {0x2608, "Too Many Segment Descriptors"}, {0x2609, "Unsupported Segment Descriptor Type Code"}, {0x260A, "Unexpected Inexact Segment"}, {0x260B, "Inline Data Length Exceeded"}, {0x260C, "Invalid Operation For Copy Source Or Destination"}, {0x260D, "Copy Segment Granularity Violation"}, {0x2700, "Write Protected"}, {0x2701, "Hardware Write Protected"}, {0x2702, "Logical Unit Software Write Protected"}, {0x2800, "Not Ready To Ready Change, Medium May Have Changed"}, {0x2801, "Import Or Export Element Accessed"}, {0x2900, "Power On, Reset, Or Bus Device Reset Occurred"}, {0x2901, "Power On Occurred"}, {0x2902, "Scsi Bus Reset Occurred"}, {0x2903, "Bus Device Reset Function Occurred"}, {0x2904, "Device Internal Reset"}, {0x2905, "Transceiver Mode Changed To Single-Ended"}, {0x2906, "Transceiver Mode Changed To Lvd"}, {0x2A00, "Parameters Changed"}, {0x2A01, "Mode Parameters Changed"}, {0x2A02, "Log Parameters Changed"}, {0x2A03, "Reservations Preempted"}, {0x2A04, "Reservations Released"}, {0x2A05, "Registrations Preempted"}, {0x2B00, "Copy Cannot Execute Since Host Cannot Disconnect"}, {0x2C00, "Command Sequence Error"}, {0x2C0A, "Partition or Collection Contains User Objects"}, {0x2F00, "Commands Cleared By Another Initiator"}, {0x3000, "Incompatible Medium Installed"}, {0x3001, "Cannot Read Medium - Unknown Format"}, {0x3002, "Cannot Read Medium - Incompatible Format"}, {0x3003, "Cleaning Cartridge Installed"}, {0x3004, "Cannot Write Medium - Unknown Format"}, {0x3005, "Cannot Write Medium - Incompatible Format"}, {0x3006, "Cannot Format Medium - Incompatible Medium"}, {0x3007, "Cleaning Failure"}, {0x3100, "Medium Format Corrupted"}, {0x3101, "Format Command Failed"}, {0x3200, "No Defect Spare Location Available"}, {0x3201, "Defect List Update Failure"}, {0x3400, "Enclosure Failure"}, {0x3500, "Enclosure Services Failure"}, {0x3501, "Unsupported Enclosure Function"}, {0x3502, "Enclosure Services Unavailable"}, {0x3503, "Enclosure Services Transfer Failure"}, {0x3504, "Enclosure Services Transfer Refused"}, {0x3700, "Rounded Parameter"}, {0x3807, "Thin Provisioning Soft Threshold Reached"}, {0x3900, "Saving Parameters Not Supported"}, {0x3A00, "Medium Not Present"}, {0x3A01, "Medium Not Present - Tray Closed"}, {0x3A02, "Medium Not Present - Tray Open"}, {0x3A03, "Medium Not Present - Loadable"}, {0x3A04, "Medium Not Present - Medium Auxiliary Memory Accessible"}, {0x3B0D, "Medium Destination Element Full"}, {0x3B0E, "Medium Source Element Empty"}, {0x3B11, "Medium Magazine Not Accessible"}, {0x3B12, "Medium Magazine Removed"}, {0x3B13, "Medium Magazine Inserted"}, {0x3B14, "Medium Magazine Locked"}, {0x3B15, "Medium Magazine Unlocked"}, {0x3D00, "Invalid Bits In Identify Message"}, {0x3E00, "Logical Unit Has Not Self-Configured Yet"}, {0x3E01, "Logical Unit Failure"}, {0x3E02, "Timeout On Logical Unit"}, {0x3E03, "Logical Unit Failed Self-Test"}, {0x3E04, "Logical Unit Unable To Update Self-Test Log"}, {0x3F00, "Target Operating Conditions Have Changed"}, {0x3F01, "Microcode Has Been Changed"}, {0x3F02, "Changed Operating Definition"}, {0x3F03, "Inquiry Data Has Changed"}, {0x3F04, "Component Device Attached"}, {0x3F05, "Device Identifier Changed"}, {0x3F06, "Redundancy Group Created Or Modified"}, {0x3F07, "Redundancy Group Deleted"}, {0x3F08, "Spare Created Or Modified"}, {0x3F09, "Spare Deleted"}, {0x3F0A, "Volume Set Created Or Modified"}, {0x3F0B, "Volume Set Deleted"}, {0x3F0C, "Volume Set Deassigned"}, {0x3F0D, "Volume Set Reassigned"}, {0x3F0E, "Reported Luns Data Has Changed"}, {0x3F0F, "Echo Buffer Overwritten"}, {0x3F10, "Medium Loadable"}, {0x3F11, "Medium Auxiliary Memory Accessible"}, {0x4200, "Self-Test Failure (Should Use 40 Nn)"}, {0x4300, "Message Error"}, {0x4400, "Internal Target Failure"}, {0x4500, "Select Or Reselect Failure"}, {0x4600, "Unsuccessful Soft Reset"}, {0x4700, "Scsi Parity Error"}, {0x4701, "Data Phase Crc Error Detected"}, {0x4702, "Scsi Parity Error Detected During St Data Phase"}, {0x4703, "Information Unit Crc Error Detected"}, {0x4704, "Asynchronous Information Protection Error Detected"}, {0x4800, "Initiator Detected Error Message Received"}, {0x4900, "Invalid Message Error"}, {0x4A00, "Command Phase Error"}, {0x4B00, "Data Phase Error"}, {0x4C00, "Logical Unit Failed Self-Configuration"}, {0x4D00, "Tagged Overlapped Commands (Nn = Queue Tag)"}, {0x4E00, "Overlapped Commands Attempted"}, {0x5300, "Media Load Or Eject Failed"}, {0x5302, "Medium Removal Prevented"}, {0x5501, "System Buffer Full"}, {0x5502, "Insufficient Reservation Resources"}, {0x5503, "Insufficient Resources"}, {0x5504, "Insufficient Registration Resources"}, {0x5A00, "Operator Request Or State Change Input"}, {0x5A01, "Operator Medium Removal Request"}, {0x5A02, "Operator Selected Write Protect"}, {0x5A03, "Operator Selected Write Permit"}, {0x5B00, "Log Exception"}, {0x5B01, "Threshold Condition Met"}, {0x5B02, "Log Counter At Maximum"}, {0x5B03, "Log List Codes Exhausted"}, {0x5C00, "Change"}, {0x5C02, "Synchronized"}, {0x5D00, "Failure Prediction Threshold Exceeded"}, {0x5D10, "Failure General Hard Drive Failure"}, {0x5D11, "Failure Drive Error Rate Too High"}, {0x5D12, "Failure Data Error Rate Too High"}, {0x5D13, "Failure Seek Error Rate Too High"}, {0x5D14, "Failure Too Many Block Reassigns"}, {0x5D15, "Failure Access Times Too High"}, {0x5D16, "Failure Start Unit Times Too High"}, {0x5D17, "Failure Channel Parametrics"}, {0x5D18, "Failure Controller Detected"}, {0x5D19, "Failure Throughput Performance"}, {0x5D1A, "Failure Seek Time Performance"}, {0x5D1B, "Failure Spin-Up Retry Count"}, {0x5D1C, "Failure Drive Calibration Retry"}, {0x5D20, "Failure General Hard Drive Failure"}, {0x5D21, "Failure Drive Error Rate Too High"}, {0x5D22, "Failure Data Error Rate Too High"}, {0x5D23, "Failure Seek Error Rate Too High"}, {0x5D24, "Failure Too Many Block Reassigns"}, {0x5D25, "Failure Access Times Too High"}, {0x5D26, "Failure Start Unit Times Too High"}, {0x5D27, "Failure Channel Parametrics"}, {0x5D28, "Failure Controller Detected"}, {0x5D29, "Failure Throughput Performance"}, {0x5D2A, "Failure Seek Time Performance"}, {0x5D2B, "Failure Spin-Up Retry Count"}, {0x5D2C, "Failure Drive Calibration Retry"}, {0x5D30, "Impending Failure General Hard Drive"}, {0x5D31, "Impending Failure Drive Error Rate Too High"}, {0x5D32, "Impending Failure Data Error Rate Too High"}, {0x5D33, "Impending Failure Seek Error Rate Too High"}, {0x5D34, "Impending Failure Too Many Block Reassigns"}, {0x5D35, "Impending Failure Access Times Too High"}, {0x5D36, "Impending Failure Start Unit Times Too High"}, {0x5D37, "Impending Failure Channel Parametrics"}, {0x5D38, "Impending Failure Controller Detected"}, {0x5D39, "Impending Failure Throughput Performance"}, {0x5D3A, "Impending Failure Seek Time Performance"}, {0x5D3B, "Impending Failure Spin-Up Retry Count"}, {0x5D3C, "Impending Failure Drive Calibration Retry"}, {0x5D40, "Failure General Hard Drive Failure"}, {0x5D41, "Failure Drive Error Rate Too High"}, {0x5D42, "Failure Data Error Rate Too High"}, {0x5D43, "Failure Seek Error Rate Too High"}, {0x5D44, "Failure Too Many Block Reassigns"}, {0x5D45, "Failure Access Times Too High"}, {0x5D46, "Failure Start Unit Times Too High"}, {0x5D47, "Failure Channel Parametrics"}, {0x5D48, "Failure Controller Detected"}, {0x5D49, "Failure Throughput Performance"}, {0x5D4A, "Failure Seek Time Performance"}, {0x5D4B, "Failure Spin-Up Retry Count"}, {0x5D4C, "Failure Drive Calibration Retry Count"}, {0x5D50, "Failure General Hard Drive Failure"}, {0x5D51, "Failure Drive Error Rate Too High"}, {0x5D52, "Failure Data Error Rate Too High"}, {0x5D53, "Failure Seek Error Rate Too High"}, {0x5D54, "Failure Too Many Block Reassigns"}, {0x5D55, "Failure Access Times Too High"}, {0x5D56, "Failure Start Unit Times Too High"}, {0x5D57, "Failure Channel Parametrics"}, {0x5D58, "Failure Controller Detected"}, {0x5D59, "Failure Throughput Performance"}, {0x5D5A, "Failure Seek Time Performance"}, {0x5D5B, "Failure Spin-Up Retry Count"}, {0x5D5C, "Failure Drive Calibration Retry Count"}, {0x5D60, "Failure General Hard Drive Failure"}, {0x5D61, "Failure Drive Error Rate Too High"}, {0x5D62, "Failure Data Error Rate Too High"}, {0x5D63, "Failure Seek Error Rate Too High"}, {0x5D64, "Failure Too Many Block Reassigns"}, {0x5D65, "Failure Access Times Too High"}, {0x5D66, "Failure Start Unit Times Too High"}, {0x5D67, "Failure Channel Parametrics"}, {0x5D68, "Failure Controller Detected"}, {0x5D69, "Failure Throughput Performance"}, {0x5D6A, "Failure Seek Time Performance"}, {0x5D6B, "Failure Spin-Up Retry Count"}, {0x5D6C, "Failure Drive Calibration Retry Count"}, {0x5DFF, "Failure Prediction Threshold Exceeded (False)"}, {0x5E00, "Low Power Condition On"}, {0x5E01, "Idle Condition Activated By Timer"}, {0x5E02, "Standby Condition Activated By Timer"}, {0x5E03, "Idle Condition Activated By Command"}, {0x5E04, "Standby Condition Activated By Command"}, {0x6500, "Voltage Fault"}, {0, NULL}, }; value_string_ext scsi_asc_val_ext = VALUE_STRING_EXT_INIT(scsi_asc_val); /* SCSI Status Codes */ const value_string scsi_status_val[] = { {0x00, "Good"}, {0x02, "Check Condition"}, {0x04, "Condition Met"}, {0x08, "Busy"}, {0x10, "Intermediate"}, {0x14, "Intermediate Condition Met"}, {0x18, "Reservation Conflict"}, {0x28, "Task Set Full"}, {0x30, "ACA Active"}, {0x40, "Task Aborted"}, {0, NULL}, }; static const value_string scsi_wb_mode_val[] = { {0x0, "Write combined header and data"}, {0x1, "Vendor specific"}, {0x2, "Write data"}, {0x3, "Reserved"}, {0x4, "Download microcode"}, {0x5, "Download microcode and save"}, {0x6, "Download microcode with offsets"}, {0x7, "Download microcode with offsets and save"}, {0x8, "Reserved"}, {0x9, "Reserved"}, {0xA, "Echo buffer"}, {0, NULL}, }; static const value_string scsi_senddiag_st_code_val[] = { {0, ""}, {0x1, "Start short self-test in background"}, {0x2, "Start extended self-test in background"}, {0x3, "Reserved"}, {0x4, "Abort background self-test"}, {0x5, "Foreground short self-test"}, {0x6, "Foreground extended self-test"}, {0x7, "Reserved"}, {0, NULL}, }; static const true_false_string scsi_senddiag_pf_val = { "Standard Page Format", "Vendor-specific Page Format", }; static gint scsi_def_devtype = SCSI_DEV_SBC; typedef struct _cmdset_t { int hf_opcode; value_string_ext *cdb_vals_ext; scsi_cdb_table_t *cdb_table; } cmdset_t; static cmdset_t *get_cmdset_data(wmem_allocator_t *pool, itlq_nexus_t *itlq, itl_nexus_t *itl); static void dissect_naa_designator(proto_tree *tree, tvbuff_t *tvb, guint offset, guint len) { proto_tree *naa_tree; guint8 naa_type; guint64 vs; naa_type = tvb_get_guint8(tvb, offset) >> 4; naa_tree = proto_tree_add_subtree_format(tree, tvb, offset, len, ett_scsi_naa, NULL, "NAA Designator: %s", val_to_str(naa_type, scsi_naa_designator_type_val, "Unknown (0x%08x)")); proto_tree_add_item(naa_tree, hf_scsi_naa_type, tvb, offset, 1, ENC_BIG_ENDIAN); switch(naa_type) { case NAA_TYPE_IEEE_EXTENDED: vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset, 2, (guint)((vs >> 48) & 0x0fff)); proto_tree_add_item(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset + 2, 3, ENC_BIG_ENDIAN); proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 5, 3, (guint)(vs & 0x00ffffff)); break; case NAA_TYPE_LOCALLY_ASSIGNED: proto_tree_add_item(naa_tree, hf_scsi_naa_locally_assigned, tvb, offset + 1, len - 1, ENC_NA); break; case NAA_TYPE_IEEE_REGISTERED: vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_uint(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset, 4, (guint)((vs >> 36) & 0x00ffffff)); proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 3, 4, (guint)(vs & 0x0fffffff)); break; case NAA_TYPE_IEEE_REGISTERED_EXTENDED: vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN); proto_tree_add_uint(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset, 4, (guint)((vs >> 36) & 0x00ffffff)); proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 3, 4, (guint)(vs & 0x0fffffff)); proto_tree_add_item(naa_tree, hf_scsi_naa_vendor_specific_extension, tvb, offset + 8, 8, ENC_NA); break; } } static void dissect_scsi_evpd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint tot_len _U_) { proto_tree *evpd_tree; proto_item *ti; guint pcode, plen, i, idlen; guint8 codeset, identifier_type; proto_tree *des_tree; if (tree) { pcode = tvb_get_guint8(tvb, offset+1); plen = tvb_get_guint8(tvb, offset+3); evpd_tree = proto_tree_add_subtree_format(tree, tvb, offset, plen+4, ett_scsi_page, NULL, "Page Code: %s", val_to_str(pcode, scsi_evpd_pagecode_val, "Unknown (0x%08x)")); proto_tree_add_item(evpd_tree, hf_scsi_inq_qualifier, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(evpd_tree, hf_scsi_inq_devtype, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(evpd_tree, hf_scsi_inquiry_evpd_page, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(evpd_tree, hf_scsi_inq_evpd_page_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); offset += 4; switch (pcode) { case SCSI_EVPD_SUPPPG: for (i = 0; i < plen; i++) { proto_tree_add_item(evpd_tree, hf_scsi_inq_evpd_supported_page, tvb, offset+i, 1, ENC_BIG_ENDIAN); } break; case SCSI_EVPD_DEVID: i = 0; while (plen != 0) { idlen = tvb_get_guint8(tvb, offset + 3); des_tree = proto_tree_add_subtree_format(evpd_tree, tvb, offset, idlen, ett_scsi_designation_descriptor, NULL, "Designation Descriptor"); i++; ti = proto_tree_add_uint(des_tree, hf_scsi_inq_evpd_identifier_number, tvb, offset, 0, i); proto_item_set_generated(ti); codeset = tvb_get_guint8(tvb, offset) & 0x0F; ti = proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_code_set, tvb, offset, 1, ENC_BIG_ENDIAN); plen -= 1; offset += 1; if (plen < 1) { expert_add_info(pinfo, ti, &ei_scsi_product_data_goes_past_end_of_page); break; } proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_association, tvb, offset, 1, ENC_BIG_ENDIAN); identifier_type = tvb_get_guint8(tvb, offset); ti = proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_identifier_type, tvb, offset, 1, ENC_BIG_ENDIAN); plen -= 1; offset += 1; /* Skip reserved byte */ if (plen < 1) { expert_add_info(pinfo, ti, &ei_scsi_product_data_goes_past_end_of_page); break; } plen -= 1; offset += 1; if (plen < 1) { expert_add_info(pinfo, ti, &ei_scsi_product_data_goes_past_end_of_page); break; } ti = proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_identifier_length, tvb, offset, 1, ENC_BIG_ENDIAN); plen -= 1; offset += 1; if (idlen != 0) { if (plen < idlen) { expert_add_info(pinfo, ti, &ei_scsi_product_data_goes_past_end_of_page); break; } if (codeset == CODESET_ASCII) { if (identifier_type == DEVID_TYPE_VEND_ID_VEND_SPEC_ID) { proto_tree_add_item(des_tree, hf_scsi_inq_vendor_id, tvb, offset, 8, ENC_ASCII); proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_identifier_str, tvb, offset + 8, idlen - 8, ENC_NA|ENC_ASCII); } else { proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_identifier_str, tvb, offset, idlen, ENC_NA|ENC_ASCII); } } else if (codeset == CODESET_BINARY && identifier_type == DEVID_TYPE_NAA) { dissect_naa_designator(des_tree, tvb, offset, idlen); } else { /* * XXX - decode this based on the identifier type, * if the codeset is CODESET_BINARY? */ proto_tree_add_item(des_tree, hf_scsi_inq_evpd_devid_identifier_bytes, tvb, offset, idlen, ENC_NA); } plen -= idlen; offset += idlen; } } break; case SCSI_EVPD_DEVSERNUM: if (plen > 0) { proto_tree_add_item(evpd_tree, hf_scsi_inq_evpd_product_serial_number, tvb, offset, plen, ENC_NA|ENC_ASCII); } break; case SCSI_EVPD_BLKDEVCHAR: proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_mrr, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_pt, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_wabereq, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_wacereq, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_nff, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_fuab, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(evpd_tree, hf_scsi_inquiry_bdc_vbuls, tvb, offset, 1, ENC_BIG_ENDIAN); /*offset += 1;*/ break; case SCSI_EVPD_BLKLIMITS: proto_tree_add_item(evpd_tree, hf_scsi_block_limits_wsnz, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_mcawl, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_otlg, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_mtl, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_otl, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_mpl, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_mulc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_mubdc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_oug, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_ugavalid, tvb, offset, 1, ENC_NA); proto_tree_add_item(evpd_tree, hf_scsi_block_limits_uga, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_mwsl, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_matl, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_aa, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(evpd_tree, hf_scsi_block_limits_atlg, tvb, offset, 4, ENC_BIG_ENDIAN); /*offset += 4;*/ break; case SCSI_EVPD_LBP: proto_tree_add_item(evpd_tree, hf_scsi_sbc_threshold_exponent, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(evpd_tree, hf_scsi_sbc_lbpu, tvb, offset, 1, ENC_NA); proto_tree_add_item(evpd_tree, hf_scsi_sbc_lbpws, tvb, offset, 1, ENC_NA); proto_tree_add_item(evpd_tree, hf_scsi_sbc_lbpws10, tvb, offset, 1, ENC_NA); proto_tree_add_item(evpd_tree, hf_scsi_sbc_lbprz, tvb, offset, 1, ENC_NA); proto_tree_add_item(evpd_tree, hf_scsi_sbc_anc_sup, tvb, offset, 1, ENC_NA); proto_tree_add_item(evpd_tree, hf_scsi_sbc_dp, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(evpd_tree, hf_scsi_sbc_ptype, tvb, offset, 1, ENC_BIG_ENDIAN); /*offset += 1;*/ break; } } } static void dissect_scsi_cmddt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint tot_len _U_) { proto_tree *cmdt_tree; guint plen; if (tree) { plen = tvb_get_guint8(tvb, offset+5); cmdt_tree = proto_tree_add_subtree_format(tree, tvb, offset, plen, ett_scsi_page, NULL, "Command Data"); proto_tree_add_item(cmdt_tree, hf_scsi_inq_qualifier, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cmdt_tree, hf_scsi_inq_devtype, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cmdt_tree, hf_scsi_inq_cmddt_support, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cmdt_tree, hf_scsi_inq_cmddt_version, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cmdt_tree, hf_scsi_inq_cmddt_cdb_size, tvb, offset+5, 1, ENC_BIG_ENDIAN); } } #define SCSI_INQ_ACAFLAGS_AERC 0x80 #define SCSI_INQ_ACAFLAGS_TRMTSK 0x40 #define SCSI_INQ_ACAFLAGS_NORMACA 0x20 #define SCSI_INQ_ACAFLAGS_HISUP 0x10 static const value_string inq_rdf_vals[] = { { 2, "SPC-2/SPC-3/SPC-4" }, { 0, NULL } }; #define SCSI_INQ_SCCSFLAGS_SCCS 0x80 #define SCSI_INQ_SCCSFLAGS_ACC 0x40 #define SCSI_INQ_SCCSFLAGS_TPC 0x08 #define SCSI_INQ_SCCSFLAGS_PROTECT 0x01 static const value_string inq_tpgs_vals[] = { { 0, "Asymmetric LU Access not supported" }, { 1, "Implicit Asymmetric LU Access supported" }, { 2, "Explicit LU Access supported" }, { 3, "Both Implicit and Explicit LU Access supported" }, { 0, NULL } }; /* This dissects byte 5 of the SPC/SPC-2/SPC-3/SPC-4 standard INQ data */ static int dissect_spc_inq_sccsflags(tvbuff_t *tvb, int offset, proto_tree *tree, int version) { static int * const sccs_fields_spc2[] = { &hf_scsi_inq_sccs, NULL }; static int * const sccs_fields_spc3[] = { &hf_scsi_inq_sccs, &hf_scsi_inq_acc, &hf_scsi_inq_tpgs, &hf_scsi_inq_tpc, &hf_scsi_inq_protect, NULL }; switch (version) { case 3: /* SPC */ break; case 4: /* SPC-2 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_sccsflags, ett_scsi_inq_sccsflags, sccs_fields_spc2, ENC_BIG_ENDIAN); break; case 5: /* SPC-3 */ case 6: /* SPC-4 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_sccsflags, ett_scsi_inq_sccsflags, sccs_fields_spc3, ENC_BIG_ENDIAN); break; default: /* including version 0 : claims conformance to no standard */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_sccsflags, ett_scsi_inq_sccsflags, sccs_fields_spc3, ENC_BIG_ENDIAN); } offset += 1; return offset; } #define SCSI_INQ_BQUEFLAGS_BQUE 0x80 #define SCSI_INQ_BQUEFLAGS_ENCSERV 0x40 #define SCSI_INQ_BQUEFLAGS_MULTIP 0x10 #define SCSI_INQ_BQUEFLAGS_MCHNGR 0x08 #define SCSI_INQ_BQUEFLAGS_ACKREQQ 0x04 /* This dissects byte 6 of the SPC/SPC-2/SPC-3/SPC-4 standard INQ data */ static int dissect_spc_inq_bqueflags(tvbuff_t *tvb, int offset, proto_tree *tree, int version) { static int * const bqe_fields_spc[] = { &hf_scsi_inq_encserv, &hf_scsi_inq_multip, &hf_scsi_inq_mchngr, &hf_scsi_inq_ackreqq, NULL }; static int * const bqe_fields_spc2[] = { &hf_scsi_inq_bque, &hf_scsi_inq_encserv, &hf_scsi_inq_multip, &hf_scsi_inq_mchngr, NULL }; static int * const bqe_fields_spc4[] = { &hf_scsi_inq_bque, &hf_scsi_inq_encserv, &hf_scsi_inq_multip, NULL }; switch (version) { case 3: /* SPC */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_bqueflags, ett_scsi_inq_bqueflags, bqe_fields_spc, ENC_BIG_ENDIAN); break; case 4: /* SPC-2 */ case 5: /* SPC-3 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_bqueflags, ett_scsi_inq_bqueflags, bqe_fields_spc2, ENC_BIG_ENDIAN); break; case 6: /* SPC-4 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_bqueflags, ett_scsi_inq_bqueflags, bqe_fields_spc4, ENC_BIG_ENDIAN); break; default: /* including version 0 : claims conformance to no standard */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_bqueflags, ett_scsi_inq_bqueflags, bqe_fields_spc4, ENC_BIG_ENDIAN); break; } offset+=1; return offset; } #define SCSI_INQ_RELADRFLAGS_RELADR 0x80 #define SCSI_INQ_RELADRFLAGS_LINKED 0x08 #define SCSI_INQ_RELADRFLAGS_TRANDIS 0x04 #define SCSI_INQ_RELADRFLAGS_CMDQUE 0x02 /* This dissects byte 7 of the SPC/SPC-2/SPC-3/SPC-4 standard INQ data */ static int dissect_spc_inq_reladrflags(tvbuff_t *tvb, int offset, proto_tree *tree, int version) { static int * const reladr_fields_spc[] = { &hf_scsi_inq_reladr, &hf_scsi_inq_linked, &hf_scsi_inq_trandis, &hf_scsi_inq_cmdque, NULL }; static int * const reladr_fields_spc2[] = { &hf_scsi_inq_reladr, &hf_scsi_inq_linked, &hf_scsi_inq_cmdque, NULL }; static int * const reladr_fields_spc3[] = { &hf_scsi_inq_linked, &hf_scsi_inq_cmdque, NULL }; static int * const reladr_fields_spc4[] = { &hf_scsi_inq_cmdque, NULL }; switch (version) { case 3: /* SPC */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_reladrflags, ett_scsi_inq_reladrflags, reladr_fields_spc, ENC_BIG_ENDIAN); break; case 4: /* SPC-2 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_reladrflags, ett_scsi_inq_reladrflags, reladr_fields_spc2, ENC_BIG_ENDIAN); break; case 5: /* SPC-3 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_reladrflags, ett_scsi_inq_reladrflags, reladr_fields_spc3, ENC_BIG_ENDIAN); break; case 6: /* SPC-4 */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_reladrflags, ett_scsi_inq_reladrflags, reladr_fields_spc4, ENC_BIG_ENDIAN); break; default: /* including version 0 : claims conformance to no standard */ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_reladrflags, ett_scsi_inq_reladrflags, reladr_fields_spc4, ENC_BIG_ENDIAN); } offset+=1; return offset; } static int * const peripheral_fields[] = { &hf_scsi_inq_qualifier, &hf_scsi_inq_devtype, NULL }; void dissect_spc_inquiry(tvbuff_t *tvb_a, packet_info *pinfo, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint32 payload_len, scsi_task_data_t *cdata) { guint8 flags, i, version; static int * const inq_control_fields[] = { &hf_scsi_inq_control_vendor_specific, &hf_scsi_inq_control_reserved, &hf_scsi_inq_control_naca, &hf_scsi_inq_control_obs1, &hf_scsi_inq_control_obs2, NULL }; static int * const aca_fields_spc[] = { &hf_scsi_inq_aerc, /* obsolete in spc3 and forward */ &hf_scsi_inq_trmtsk,/* obsolete in spc2 and forward */ &hf_scsi_inq_normaca, &hf_scsi_inq_hisup, &hf_scsi_inq_rdf, NULL }; static int * const aca_fields_spc2[] = { &hf_scsi_inq_aerc, /* obsolete in spc3 and forward */ &hf_scsi_inq_normaca, &hf_scsi_inq_hisup, &hf_scsi_inq_rdf, NULL }; static int * const aca_fields_spc3[] = { &hf_scsi_inq_normaca, &hf_scsi_inq_hisup, &hf_scsi_inq_rdf, NULL }; static int * const rmb_fields[] = { &hf_scsi_inq_rmb, NULL }; if (!isreq && ((cdata == NULL) || !(cdata->itlq->flags & 0x3)) && (tvb_reported_length_remaining(tvb_a, offset_a) >= 1) ) { /* * INQUIRY response with device type information; add device type * to list of known devices & their types if not already known. */ if (cdata && cdata->itl) { cdata->itl->cmdset = tvb_get_guint8(tvb_a, offset_a)&SCSI_DEV_BITS; } } if (isreq && iscdb) { flags = tvb_get_guint8(tvb_a, offset_a); if (cdata) { cdata->itlq->flags = flags; } proto_tree_add_uint_format(tree, hf_scsi_inquiry_flags, tvb_a, offset_a, 1, flags, "CMDT = %u, EVPD = %u", flags & 0x2, flags & 0x1); if (flags & 0x1) { proto_tree_add_item(tree, hf_scsi_inquiry_evpd_page, tvb_a, offset_a+1, 1, ENC_BIG_ENDIAN); col_add_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(tvb_get_guint8(tvb_a, offset_a+1), scsi_evpd_pagecode_val, "Unknown VPD 0x%02x")); } else if (flags & 0x2) { proto_tree_add_item(tree, hf_scsi_inquiry_cmdt_page, tvb_a, offset_a+1, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(tree, hf_scsi_alloclen16, tvb_a, offset_a+2, 2, ENC_BIG_ENDIAN); /* we need the alloc_len in the response */ if (cdata) { cdata->itlq->alloc_len = tvb_get_ntohs(tvb_a, offset_a+2); } proto_tree_add_bitmask(tree, tvb_a, offset_a+4, hf_scsi_inq_control, ett_scsi_inq_control, inq_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { if (!cdata) { return; } if (cdata->itlq->flags & 0x1) { dissect_scsi_evpd(tvb_a, pinfo, tree, offset_a, payload_len); return; } if (cdata->itlq->flags & 0x2) { dissect_scsi_cmddt(tvb_a, pinfo, tree, offset_a, payload_len); return; } /* These pdus are sometimes truncated by SCSI allocation length * in the CDB */ TRY_SCSI_CDB_ALLOC_LEN(cdata->itlq->alloc_len); /* (defines/initializes try_tvb & try_offset) */ /* Qualifier and DeviceType */ proto_tree_add_bitmask(tree, try_tvb, try_offset, hf_scsi_inq_peripheral, ett_scsi_inq_peripheral, peripheral_fields, ENC_BIG_ENDIAN); try_offset+=1; /* RMB */ proto_tree_add_bitmask(tree, try_tvb, try_offset, hf_scsi_inq_rmbflags, ett_scsi_inq_rmbflags, rmb_fields, ENC_BIG_ENDIAN); try_offset+=1; /* Version */ version = tvb_get_guint8(try_tvb, try_offset); proto_tree_add_item(tree, hf_scsi_inq_version, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; /* aca flags */ switch (version) { case 3: /* SPC */ proto_tree_add_bitmask(tree, try_tvb, try_offset, hf_scsi_inq_acaflags, ett_scsi_inq_acaflags, aca_fields_spc, ENC_BIG_ENDIAN); break; case 4: /* SPC-2 */ proto_tree_add_bitmask(tree, try_tvb, try_offset, hf_scsi_inq_acaflags, ett_scsi_inq_acaflags, aca_fields_spc2, ENC_BIG_ENDIAN); break; case 5: /* SPC-3 */ case 6: /* SPC-4 */ proto_tree_add_bitmask(tree, try_tvb, try_offset, hf_scsi_inq_acaflags, ett_scsi_inq_acaflags, aca_fields_spc3, ENC_BIG_ENDIAN); break; default: /* including version 0 : claims conformance to no standard */ proto_tree_add_bitmask(tree, try_tvb, try_offset, hf_scsi_inq_acaflags, ett_scsi_inq_acaflags, aca_fields_spc3, ENC_BIG_ENDIAN); } try_offset+=1; /* Additional Length */ SET_SCSI_DATA_END(tvb_get_guint8(try_tvb, try_offset)+try_offset); proto_tree_add_item(tree, hf_scsi_inq_add_len, try_tvb, try_offset, 1, ENC_BIG_ENDIAN); try_offset+=1; /* sccs flags */ try_offset = dissect_spc_inq_sccsflags(try_tvb, try_offset, tree, version); /* bque flags */ try_offset = dissect_spc_inq_bqueflags(try_tvb, try_offset, tree, version); /* reladdr flags */ try_offset = dissect_spc_inq_reladrflags(try_tvb, try_offset, tree, version); /* vendor id */ proto_tree_add_item(tree, hf_scsi_inq_vendor_id, try_tvb, try_offset, 8, ENC_ASCII); try_offset+=8; /* product id */ proto_tree_add_item(tree, hf_scsi_inq_product_id, try_tvb, try_offset, 16, ENC_ASCII); try_offset+=16; /* product revision level */ proto_tree_add_item(tree, hf_scsi_inq_product_rev, try_tvb, try_offset, 4, ENC_ASCII); try_offset+=4; /* vendor specific, 20 bytes */ proto_tree_add_item(tree, hf_scsi_inq_vendor_specific, try_tvb, try_offset, 20, ENC_NA); try_offset+=20; /* reserved */ try_offset += 2; /* version descriptors */ for(i = 0;i<8;i++) { proto_tree_add_item(tree, hf_scsi_inq_version_desc, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); try_offset+=2; } END_TRY_SCSI_CDB_ALLOC_LEN; } } #define XCOPY_LID1 0 #define XCOPY_LID4 1 static const value_string extcopy_service_vals[] = { { XCOPY_LID1, "Extended Copy (LID1)" }, { XCOPY_LID4, "Extended Copy (LID4)" }, { 0, NULL } }; #define RECV_COPY_PARAMS 0x3 static const value_string recv_copy_service_vals[] = { { 0x6, "Receive Copy Data (LID4)" }, { 0x1, "Receive Copy Data (LID1)" }, { RECV_COPY_PARAMS, "Receive Copy Parameters" }, { 0x4, "Receive Copy Failure details" }, { 0x5, "Receive Copy Status (LID4)" }, { 0x0, "Receive Copy Status (LID1)" }, { 0, NULL } }; #if 0 static const value_string cscd_desc_type_code_vals[] = { { 0xE0, "Fibre Channel N_Port_Name CSCD descriptor" }, { 0xE1, "Fibre Channel N_Port_ID CSCD descriptor" }, { 0xE2, "Fibre Channel N_Port_ID With N_Port_Name Checking CSCD descriptor" }, { 0xE3, "Parallel Interface T_L CSCD descriptor" }, { 0xE4, "Identification Descriptor CSCD descriptor" }, { 0xFF, "Extension descriptor" }, { 0, NULL } }; #endif static int * const per_dev_type_bitmask_fields[] = { &hf_scsi_spc_xcopy_lu_type, &hf_scsi_spc_xcopy_per_dev_type, NULL }; static int * const xcopy_param_list_bits[] = { &hf_scsi_spc_xcopy_param_str, &hf_scsi_spc_xcopy_param_list_id_usage, &hf_scsi_spc_xcopy_param_priority, NULL }; #define BLOCK_DEV_0 0x0 #define BLOCK_DEV_4 0x4 #define BLOCK_DEV_5 0x5 #define BLOCK_DEV_7 0x7 #define BLOCK_DEV_E 0xE static const value_string per_dev_type_vals[] = { { BLOCK_DEV_0, "Block devices" }, { 0x1, "Sequential access devices" }, { 0x3, "Processor devices" }, { BLOCK_DEV_4, "Block devices" }, { BLOCK_DEV_5, "Block devices" }, { BLOCK_DEV_7, "Block devices" }, { BLOCK_DEV_E, "Block devices" }, { 0, NULL } }; static const value_string lu_type_vals[] = { { 0, "Logical Unit Number" }, { 1, "Proxy Token" }, { 2, "Reserved" }, { 3, "Reserved" }, { 0, NULL } }; #define BLOCK_TO_BLOCK 2 static const range_string desc_type_rval[] = { { 0x0, 0x0, "Block to stream" }, { 0x1, 0x1, "Stream to block" }, { BLOCK_TO_BLOCK, BLOCK_TO_BLOCK, "Block to block" }, { 0x3, 0x3, "Stream to stream" }, { 0x4, 0x4, "Inline to stream" }, { 0x5, 0x5, "Embedded to strem" }, { 0x6, 0x6, "Stream to discard" }, { 0x7, 0x7, "Verify CSCD" }, { 0x0, 0xBF, "Segment descriptors" }, { 0xC, 0xDF, "Vendor-specific descriptors" }, { 0xE0, 0xE0, "Fibre Channel N_Port_Name CSCD descriptor" }, { 0xE1, 0xE1, "Fibre Channel N_Port_ID CSCD descriptor" }, { 0xE2, 0xE2, "Fibre Channel N_Port_ID With N_Port_Name Checking CSCD descriptor" }, { 0xE3, 0xE3, "Parallel Interface T_L CSCD descriptor" }, { 0xE4, 0xE4, "Identification Descriptor CSCD descriptor" }, { 0xE5, 0xFE, "CSCD descriptors" }, { 0xFF, 0xFF, "CSCD descriptor extension" }, { 0, 0, NULL } }; void dissect_spc_extcopy(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata) { guint16 serv_action; guint8 cscd_desc_type, dev_type, des_len, code_set, des_type, seg_type; guint16 cscd_desc_list_len, seg_desc_len; guint32 /*param_list_len,*/ seg_desc_list_len, inline_data_len, i; proto_tree *cscds_tree = NULL, *dev_tree = NULL, *cscd_tree = NULL, *segs_tree = NULL, *seg_tree = NULL, *seg_param_tree = NULL, *cscd_desc_tree; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_spc_xcopy_service, tvb, offset, 1, ENC_BIG_ENDIAN); serv_action = tvb_get_guint8(tvb, offset) & 0x1F; if (cdata) { cdata->itlq->flags = serv_action; } offset += 1; proto_tree_add_item(tree, hf_scsi_reserved_64, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_scsi_spc_xcopy_param_list_len, tvb, offset, 4, ENC_BIG_ENDIAN); /*param_list_len = tvb_get_ntohl(tvb, offset); */ offset += 4; proto_tree_add_item(tree, hf_scsi_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN); offset+= 1; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); /*offset += 1;*/ /*offset += (param_list_len - 15);*/ } else { if (cdata) { serv_action = cdata->itlq->flags; } else { return; } if (serv_action == XCOPY_LID1){ proto_tree_add_item(tree, hf_scsi_spc_xcopy_list_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_spc_xcopy_param_byte, ett_xcopy_param_byte, xcopy_param_list_bits, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_scsi_spc_xcopy_cscd_desc_list_len, tvb, offset, 2, ENC_BIG_ENDIAN); cscd_desc_list_len = tvb_get_ntohs(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_scsi_reserved_32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_spc_xcopy_seg_desc_list_len, tvb, offset, 4, ENC_BIG_ENDIAN); seg_desc_list_len = tvb_get_ntohl(tvb, offset); offset += 4; proto_tree_add_item(tree, hf_scsi_spc_xcopy_inline_data_len, tvb, offset, 4, ENC_BIG_ENDIAN); inline_data_len = tvb_get_ntohl(tvb, offset); offset += 4; if (cscd_desc_list_len > 0) { cscds_tree = proto_tree_add_subtree_format(tree, tvb, offset, cscd_desc_list_len, ett_scsi_xcopy_cscds, NULL, "CSCD (Copy Source and Copy Destination) descriptors (%u bytes)", cscd_desc_list_len); i = 1; while(cscd_desc_list_len > 0) { cscd_desc_type = tvb_get_guint8(tvb, offset); if (cscd_desc_type == 0xEA || cscd_desc_type == 0xEB) { /* both types occupy 64 bytes overall, everything else is 32 bytes */ cscd_tree = proto_tree_add_subtree_format(cscds_tree, tvb, offset, 64, ett_scsi_xcopy_cscd, NULL, "CSCD descriptor #%u", i); } else { cscd_tree = proto_tree_add_subtree_format(cscds_tree, tvb, offset, 32, ett_scsi_xcopy_cscd, NULL, "CSCD descriptor #%u", i); } i++; proto_tree_add_item(cscd_tree, hf_scsi_spc_xcopy_cscd_desc_type_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(cscd_tree, tvb, offset, hf_scsi_spc_xcopy_per_dev_type_byte, ett_xcopy_per_dev_type, per_dev_type_bitmask_fields, ENC_NA); dev_type = tvb_get_guint8(tvb, offset) & 0x1F; offset += 1; proto_tree_add_item(cscd_tree, hf_scsi_spc_xcopy_rel_init_port_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; cscd_desc_tree = proto_tree_add_subtree(cscd_tree, tvb, offset, 24, ett_scsi_cscd_desc, NULL, "CSCD descriptor parameters"); proto_tree_add_item(cscd_desc_tree, hf_scsi_spc_xcopy_cscd_desc_code_set, tvb, offset, 1, ENC_BIG_ENDIAN); code_set = tvb_get_guint8(tvb, offset) & 0x0F; offset += 1; proto_tree_add_item(cscd_desc_tree, hf_scsi_spc_xcopy_cscd_desc_assoc, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cscd_desc_tree, hf_scsi_spc_xcopy_cscd_desc_des_type, tvb, offset, 1, ENC_BIG_ENDIAN); des_type = tvb_get_guint8(tvb, offset) & 0x0F; offset += 1; proto_tree_add_item(cscd_desc_tree, hf_scsi_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(cscd_desc_tree, hf_scsi_spc_xcopy_cscd_desc_des_len, tvb, offset, 1, ENC_BIG_ENDIAN); des_len = tvb_get_guint8(tvb, offset); offset += 1; proto_tree_add_bytes_format(cscd_desc_tree, hf_scsi_designator, tvb, offset, 20, NULL, "Designator (20 bytes, zero padded, used length %u)", des_len); if (code_set == CODESET_BINARY && des_type == DEVID_TYPE_NAA) { /* des_type 3 = NAA */ dissect_naa_designator(cscd_tree, tvb, offset, des_len); } offset += 20; dev_tree = proto_tree_add_subtree(cscd_tree, tvb, offset, 4, ett_scsi_xcopy_dev_params, NULL, "Device type specific parameters"); if (dev_type == BLOCK_DEV_0 || dev_type == BLOCK_DEV_4 || dev_type == BLOCK_DEV_5 || dev_type == BLOCK_DEV_7 || dev_type == BLOCK_DEV_E) { proto_tree_add_item(dev_tree, hf_scsi_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /*TODO: dissect this byte */ proto_tree_add_item(dev_tree, hf_scsi_spc_xcopy_disk_block_len, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; } else { offset += 4; } cscd_desc_list_len -= 32; if (cscd_desc_type == 0xEA || cscd_desc_type == 0xEB) { /* both types occupy 64 bytes overall, everything else is 32 bytes */ offset += 32; cscd_desc_list_len -= 32; } } } if (seg_desc_list_len > 0) { segs_tree = proto_tree_add_subtree_format(tree, tvb, offset, seg_desc_list_len, ett_scsi_xcopy_segs, NULL, "Segment descriptor list (%u bytes)", seg_desc_list_len); i = 1; while(seg_desc_list_len > 0) { seg_desc_len = tvb_get_ntohs(tvb, offset + 2); seg_tree = proto_tree_add_subtree_format(segs_tree, tvb, offset, seg_desc_len + 4, ett_scsi_xcopy_seg, NULL, "Segment descriptor #%u", i); i++; proto_tree_add_item(seg_tree, hf_scsi_spc_xcopy_seg_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN); seg_type = tvb_get_guint8(tvb, offset); offset += 1; proto_tree_add_item(seg_tree, hf_scsi_spc_xcopy_seg_desc_dc, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(seg_tree, hf_scsi_spc_xcopy_seg_desc_cat, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(seg_tree, hf_scsi_segment_descriptor_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(seg_tree, hf_scsi_spc_xcopy_seg_des_src_desc_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(seg_tree, hf_scsi_spc_xcopy_seg_des_dest_desc_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; seg_param_tree = proto_tree_add_subtree(seg_tree, tvb, offset, seg_desc_len - 4, ett_scsi_xcopy_seg_param, NULL, "Segment descriptor parameters"); seg_desc_list_len -= (seg_desc_len + 4); if (seg_type == BLOCK_TO_BLOCK) { proto_tree_add_item(seg_param_tree, hf_scsi_reserved_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(seg_param_tree, hf_scsi_spc_xcopy_num_of_blocks, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(seg_param_tree, hf_scsi_spc_xcopy_source_lba, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(seg_param_tree, hf_scsi_spc_xcopy_dest_lba, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; } else { offset += (seg_desc_len - 4); } } } if (inline_data_len > 0) { proto_tree_add_item(tree, hf_scsi_inline_data, tvb, offset, inline_data_len, ENC_NA); /*offset += inline_data_len;*/ } } else if (serv_action == XCOPY_LID4) { proto_tree_add_item(tree, hf_scsi_spc_xcopy_param_list_format, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_spc_xcopy_param_byte, ett_xcopy_param_byte, xcopy_param_list_bits, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_scsi_spc_xcopy_head_cscd_desc_list_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_scsi_spc_xcopy_head_cscd_desc_type_code, tvb, offset, 1, ENC_BIG_ENDIAN); /*offset += 1;*/ } } } void dissect_spc_recvcopy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint offset _U_, gboolean isreq _U_, gboolean iscdb _U_, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint16 serv_action; guint8 imp_desc_list_len; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_spc_recv_copy_service, tvb, offset, 1, ENC_BIG_ENDIAN); serv_action = tvb_get_guint8(tvb, offset) & 0x1F; if (cdata) { cdata->itlq->flags = serv_action; } offset += 1; proto_tree_add_item(tree, hf_scsi_reserved_64, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_scsi_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); offset += 1; } else { if (cdata) { serv_action = cdata->itlq->flags; } else { return; } if (serv_action == RECV_COPY_PARAMS) { proto_tree_add_item(tree, hf_scsi_recv_copy_avail_data, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_recv_copy_snlid, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_scsi_reserved_24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_scsi_recv_copy_max_cscd_desc_count, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_scsi_recv_copy_max_seg_desc_count, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_scsi_recv_copy_max_desc_list_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_recv_copy_max_seg_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_recv_copy_max_inline_data_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_recv_copy_held_data_limit, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_recv_copy_max_stream_dev_trans_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_scsi_reserved_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_scsi_recv_copy_total_con_copies, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_scsi_recv_copy_max_con_copies, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_scsi_recv_copy_data_seg_gran, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_scsi_recv_copy_inline_data_gran, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_scsi_recv_copy_held_data_gran, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_scsi_reserved_24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_scsi_recv_copy_implemented_desc_list_len, tvb, offset, 1, ENC_BIG_ENDIAN); imp_desc_list_len = tvb_get_guint8(tvb, offset); offset += 1; while (imp_desc_list_len > 0) { proto_tree_add_item(tree, hf_scsi_spc_xcopy_cscd_desc_type_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; imp_desc_list_len--; } } else { proto_tree_add_expert_format(tree, pinfo, &ei_scsi_unknown_serv_action, tvb, offset, 0, "Unknown serv_action %u", serv_action); } } } static int dissect_scsi_log_page(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { static int * const pcflags_fields[] = { &hf_scsi_log_pagecode, NULL }; static int * const paramflags_fields[] = { &hf_scsi_log_pf_du, &hf_scsi_log_pf_ds, &hf_scsi_log_pf_tsd, &hf_scsi_log_pf_etc, &hf_scsi_log_pf_tmc, &hf_scsi_log_pf_lbin, &hf_scsi_log_pf_lp, NULL }; guint16 pagelen, pagecode; guint8 paramlen; proto_tree *log_tree; proto_item *ti; guint old_offset = offset; const log_pages_t *log_page; pagecode = tvb_get_guint8(tvb, offset) & 0x3f; log_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_scsi_log, &ti, "Log Page: %s", val_to_str(pagecode, scsi_log_page_val, "Unknown (0x%04x)")); /* page code */ proto_tree_add_bitmask(log_tree, tvb, offset, hf_scsi_log_pc_flags, ett_scsi_log_pc, pcflags_fields, ENC_BIG_ENDIAN); offset+=1; /* reserved byte */ offset+=1; /* page length */ pagelen = tvb_get_ntohs(tvb, offset); proto_tree_add_item(log_tree, hf_scsi_log_page_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* find the appropriate log page */ for(log_page = log_pages;log_page;log_page++) { if (log_page->parameters == NULL) { log_page = NULL; break; } if (log_page->page == pagecode) { break; } } /* loop over all parameters */ while( offset<(old_offset+4+pagelen) ) { const log_page_parameters_t *log_parameter = NULL; guint16 log_param; /* parameter code */ log_param = tvb_get_ntohs(tvb, offset); proto_tree_add_item(log_tree, hf_scsi_log_parameter_code, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; /* flags */ proto_tree_add_bitmask(log_tree, tvb, offset, hf_scsi_log_param_flags, ett_scsi_log_param, paramflags_fields, ENC_BIG_ENDIAN); offset+=1; /* parameter length */ paramlen = tvb_get_guint8(tvb, offset); proto_tree_add_item(log_tree, hf_scsi_log_param_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; /* find the log parameter */ if (log_page) { for(log_parameter = log_page->parameters;log_parameter;log_parameter++) { if (log_parameter->dissector == NULL) { log_parameter = NULL; break; } if (log_parameter->number == log_param) { break; } } } /* parameter data */ if (paramlen) { if (log_parameter && log_parameter->dissector) { tvbuff_t *param_tvb; param_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),paramlen), paramlen); log_parameter->dissector(param_tvb, pinfo, log_tree); } else { /* We did not have a dissector for this page/parameter so * just display it as data. */ proto_tree_add_item(log_tree, hf_scsi_log_param_data, tvb, offset, paramlen, ENC_NA); } offset+=paramlen; } } proto_item_set_len(ti, offset-old_offset); return offset; } void dissect_spc_logselect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const ppcflags_fields[] = { &hf_scsi_log_pcr, &hf_scsi_log_sp, NULL }; static int * const pcflags_fields[] = { &hf_scsi_log_pc, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_log_ppc_flags, ett_scsi_log_ppc, ppcflags_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+1, hf_scsi_log_pc_flags, ett_scsi_log_pc, pcflags_fields, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_paramlen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else { } } static const true_false_string scsi_log_pcr_tfs = { "Reset all parameters to default values", "Do not reset log parameters" }; static const true_false_string scsi_log_ppc_tfs = { "Return only parameters that have changed since last LOG SELECT/SENSE", "Return parameters even if they are unchanged" }; static const true_false_string scsi_log_sp_tfs = { "Device shall save all log parameters", "Device should not save any of the logged parameters" }; void dissect_spc_logsense(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { static int * const ppcflags_fields[] = { &hf_scsi_log_ppc, &hf_scsi_log_sp, NULL }; static int * const pcflags_fields[] = { &hf_scsi_log_pc, &hf_scsi_log_pagecode, NULL }; if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_log_ppc_flags, ett_scsi_log_ppc, ppcflags_fields, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+1, hf_scsi_log_pc_flags, ett_scsi_log_pc, pcflags_fields, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_log_parameter_ptr, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { if (!cdata) { return; } dissect_scsi_log_page(tvb, pinfo, tree, offset); } } static void dissect_scsi_blockdescs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *scsi_tree, scsi_task_data_t *cdata, gboolean longlba) { int offset = 0; /* without cdata there is no point in continuing */ if (!cdata) return; while (tvb_reported_length_remaining(tvb, offset) > 0) { if (longlba) { if (tvb_reported_length_remaining(tvb, offset)<8) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks64, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; if (tvb_reported_length_remaining(tvb, offset)<1) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_density_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 3 reserved bytes */ offset += 3; if (tvb_reported_length_remaining(tvb, offset)<4) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else { if ((cdata->itl->cmdset&SCSI_CMDSET_MASK) == SCSI_DEV_SBC) { if (tvb_reported_length_remaining(tvb, offset)<4) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset++; /* reserved */ if (tvb_reported_length_remaining(tvb, offset)<3) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; } else { if (tvb_reported_length_remaining(tvb, offset)<1) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_density_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (tvb_reported_length_remaining(tvb, offset)<3) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; offset++; /* reserved */ if (tvb_reported_length_remaining(tvb, offset)<3) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; } } } } static gboolean dissect_scsi_spc_modepage(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 pcode, guint8 spf, guint8 subpcode) { guint8 flags, proto; guint32 burst_size, condition_timer; switch (pcode) { case SCSI_SPC_MODEPAGE_CTL: if (!spf) { guint32 timeout_period; /* standard page for control */ proto_tree_add_item(tree, hf_scsi_modesns_tst, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_gltsd, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_report_log_exception_condition, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_modesns_qmod, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_modesns_qerr, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_disable_queuing, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_modesns_rac, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_modesns_tas, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_swp, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_autoload_mode, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_ready_aer_holdoff_period, tvb, offset+6, 2, ENC_BIG_ENDIAN); timeout_period = tvb_get_ntohs(tvb, offset+8)*100; proto_tree_add_uint(tree, hf_scsi_spc_modepage_busy_timeout_period, tvb, offset+8, 2, timeout_period); proto_tree_add_item(tree, hf_scsi_spc_modepage_extended_self_test_completion_time, tvb, offset+10, 2, ENC_BIG_ENDIAN); } else { switch (subpcode) { case 1: /* control extension subpage */ proto_item_append_text(tree, " Control Extension"); /* TCMOS SCSIP IALUAE */ proto_tree_add_item(tree, hf_scsi_modepage_tcmos, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_modepage_scsip, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_modepage_ialuae, tvb, offset + 4, 1, ENC_BIG_ENDIAN); /* Initial Command Priority */ proto_tree_add_item(tree, hf_scsi_modepage_icp, tvb, offset + 5, 1, ENC_BIG_ENDIAN); /* Maximum Sense Data Length */ proto_tree_add_item(tree, hf_scsi_modepage_msdl, tvb, offset + 6, 1, ENC_BIG_ENDIAN); break; } } break; case SCSI_SPC_MODEPAGE_DISCON: proto_tree_add_item(tree, hf_scsi_spc_modepage_buffer_full_ratio, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_buffer_empty_ratio, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_bus_inactivity_limit, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_disconnect_time_limit, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_connect_time_limit, tvb, offset+8, 2, ENC_BIG_ENDIAN); burst_size = tvb_get_ntohs(tvb, offset+10)*512; proto_tree_add_uint(tree, hf_scsi_spc_modepage_maximum_burst_size, tvb, offset+10, 2, burst_size); proto_tree_add_item(tree, hf_scsi_spc_modepage_emdp, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_faa, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_fab, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_fac, tvb, offset+12, 1, ENC_NA); burst_size = tvb_get_ntohs(tvb, offset+14)*512; proto_tree_add_uint(tree, hf_scsi_spc_modepage_first_burst_size, tvb, offset+14, 2, burst_size); break; case SCSI_SPC_MODEPAGE_INFOEXCP: flags = tvb_get_guint8(tvb, offset+2); proto_tree_add_item(tree, hf_scsi_spc_modepage_perf, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_ebf, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_ewasc, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_dexcpt, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_test, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_logerr, tvb, offset+2, 1, ENC_NA); if (!((flags & 0x10) >> 4) && ((flags & 0x08) >> 3)) { proto_item *hidden_item; hidden_item = proto_tree_add_item(tree, hf_scsi_modesns_errrep, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); } else { proto_tree_add_item(tree, hf_scsi_modesns_errrep, tvb, offset+3, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(tree, hf_scsi_spc_modepage_interval_timer, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_report_count, tvb, offset+8, 4, ENC_BIG_ENDIAN); break; case SCSI_SPC_MODEPAGE_PWR: proto_tree_add_item(tree, hf_scsi_spc_modepage_idle, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_standby, tvb, offset+3, 1, ENC_NA); condition_timer = tvb_get_ntohs(tvb, offset+4) * 100; proto_tree_add_uint(tree, hf_scsi_spc_modepage_idle_condition_timer, tvb, offset+4, 2, condition_timer); condition_timer = tvb_get_ntohs(tvb, offset+6) * 100; proto_tree_add_uint(tree, hf_scsi_spc_modepage_standby_condition_timer, tvb, offset+6, 2, condition_timer); break; case SCSI_SPC_MODEPAGE_LUN: return FALSE; case SCSI_SPC_MODEPAGE_PORT: proto = tvb_get_guint8(tvb, offset+2) & 0x0F; proto_tree_add_item(tree, hf_scsi_protocol, tvb, offset+2, 1, ENC_BIG_ENDIAN); if (proto == SCSI_PROTO_FCP) { proto_tree_add_item(tree, hf_scsi_spc_modepage_dtfd, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_plpb, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_ddis, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_dlm, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_rha, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_alwi, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_dtipe, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_dtoli, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_spc_modepage_rr_tov_units, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_spc_modepage_rr_tov, tvb, offset+7, 1, ENC_BIG_ENDIAN); } else if (proto == SCSI_PROTO_iSCSI) { return FALSE; } else { return FALSE; } break; case SCSI_SCSI2_MODEPAGE_PERDEV: return FALSE; default: return FALSE; } return TRUE; } static gboolean dissect_scsi_sbc_modepage(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 pcode, guint8 spf _U_, guint8 subpcode _U_) { switch (pcode) { case SCSI_SBC_MODEPAGE_FMTDEV: proto_tree_add_item(tree, hf_scsi_sbc_modepage_tracks_per_zone, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_alternate_sectors_per_zone, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_alternate_tracks_per_zone, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_alternate_tracks_per_lu, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_sectors_per_track, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_data_bytes_per_physical_sector, tvb, offset+12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_interleave, tvb, offset+14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_track_skew_factor, tvb, offset+16, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_cylinder_skew_factor, tvb, offset+18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_ssec, tvb, offset+20, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_hsec, tvb, offset+20, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_rmb, tvb, offset+20, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_surf, tvb, offset+20, 1, ENC_NA); break; case SCSI_SBC_MODEPAGE_RDWRERR: proto_tree_add_item(tree, hf_scsi_sbc_modepage_awre, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_arre, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_tb, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_rc, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_eer, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_per, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_dte, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_dcr, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_read_retry_count, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_correction_span, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_head_offset_count, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_data_strobe_offset_count, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_write_retry_count, tvb, offset+8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_recovery_time_limit, tvb, offset+10, 2, ENC_BIG_ENDIAN); break; case SCSI_SBC_MODEPAGE_DISKGEOM: proto_tree_add_item(tree, hf_scsi_sbc_modepage_number_of_cylinders, tvb, offset+2, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_number_of_heads, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_starting_cyl_pre_compensation, tvb, offset+6, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_starting_cyl_reduced_write_current, tvb, offset+9, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_device_step_rate, tvb, offset+12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_landing_zone_cyl, tvb, offset+14, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_rotational_offset, tvb, offset+18, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_medium_rotation_rate, tvb, offset+20, 2, ENC_BIG_ENDIAN); break; case SCSI_SBC_MODEPAGE_FLEXDISK: return FALSE; case SCSI_SBC_MODEPAGE_VERERR: return FALSE; case SCSI_SBC_MODEPAGE_CACHE: proto_tree_add_item(tree, hf_scsi_sbc_modepage_ic, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_abpf, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_cap, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_disc, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_size, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_wce, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_mf, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_rcd, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_demand_read_retention_priority, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_write_retention_priority, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_disable_pre_fetch_xfer_len, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_minimum_pre_fetch, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_maximum_pre_fetch, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_maximum_pre_fetch_ceiling, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_fsw, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_lbcss, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_dra, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_sbc_modepage_vendor_specific, tvb, offset+12, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_number_of_cache_segments, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_cache_segment_size, tvb, offset+14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_sbc_modepage_non_cache_segment_size, tvb, offset+17, 3, ENC_BIG_ENDIAN); break; case SCSI_SBC_MODEPAGE_MEDTYPE: return FALSE; case SCSI_SBC_MODEPAGE_NOTPART: return FALSE; case SCSI_SBC_MODEPAGE_XORCTL: return FALSE; default: return FALSE; } return TRUE; } static const value_string compression_algorithm_vals[] = { {0x00, "No algorithm selected"}, {0x01, "Default algorithm"}, {0x03, "IBM ALDC with 512-byte buffer"}, {0x04, "IBM ALDC with 1024-byte buffer"}, {0x05, "IBM ALDC with 2048-byte buffer"}, {0x10, "IBM IDRC"}, {0x20, "DCLZ"}, {0xFF, "Unregistered algorithm"}, {0, NULL} }; static gboolean dissect_scsi_ssc2_modepage(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint offset _U_, guint8 pcode, guint8 spf _U_, guint8 subpcode _U_) { switch (pcode) { case SCSI_SSC2_MODEPAGE_DATACOMP: proto_tree_add_item(tree, hf_scsi_ssc2_modepage_dce, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_dcc, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_dde, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_red, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_compression_algorithm, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_decompression_algorithm, tvb, offset+8, 4, ENC_BIG_ENDIAN); break; case SCSI_SSC2_MODEPAGE_DEVCONF: proto_tree_add_item(tree, hf_scsi_ssc2_modepage_caf, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_active_format, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_active_partition, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_write_object_buffer_full_ratio, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_read_object_buffer_empty_ratio, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(tree, hf_scsi_ssc2_modepage_write_delay_time, tvb, offset+6, 2, tvb_get_ntohs(tvb, offset+6), "%u 100ms", tvb_get_ntohs(tvb, offset+6)); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_obr, tvb, offset+8, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_lois, tvb, offset+8, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_rsmk, tvb, offset+8, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_avc, tvb, offset+8, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_socf, tvb, offset+8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_robo, tvb, offset+8, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_rew, tvb, offset+8, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_gap_size, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_eod_defined, tvb, offset+10, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_eeg, tvb, offset+10, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_sew, tvb, offset+10, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_swp, tvb, offset+10, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_baml, tvb, offset+10, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_bam, tvb, offset+10, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_object_buffer_size_at_early_warning, tvb, offset+11, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_select_data_compression_algorithm, tvb, offset+14, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_oir, tvb, offset+15, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_rewind_on_reset, tvb, offset+15, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_asocwp, tvb, offset+15, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_perswp, tvb, offset+15, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_prmwp, tvb, offset+15, 1, ENC_NA); break; case SCSI_SSC2_MODEPAGE_MEDPAR1: proto_tree_add_item(tree, hf_scsi_ssc2_modepage_maximum_additional_partitions, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_additional_partitions_defined, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_fdp, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_dsp, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_idp, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_psum, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_pofm, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_clear, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_addp, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_media_format_recognition, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_partition_units, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_ssc2_modepage_partition_size, tvb, offset+8, 2, ENC_BIG_ENDIAN); break; case SCSI_SSC2_MODEPAGE_MEDPAR2: return FALSE; case SCSI_SSC2_MODEPAGE_MEDPAR3: return FALSE; case SCSI_SSC2_MODEPAGE_MEDPAR4: return FALSE; default: return FALSE; } return TRUE; } static gboolean dissect_scsi_mmc5_modepage(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint offset _U_, guint8 pcode, guint8 spf _U_, guint8 subpcode _U_) { guint8 flags; guint8 i; switch (pcode) { case SCSI_MMC5_MODEPAGE_MRW: proto_tree_add_item(tree, hf_scsi_mmc5_modepage_lba_space, tvb, offset+3, 1, ENC_BIG_ENDIAN); break; case SCSI_MMC5_MODEPAGE_WRPARAM: proto_tree_add_item(tree, hf_scsi_mmc5_modepage_bufe, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_ls_v, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_wrparam_test_write, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_write_type, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_wrparam_multi_session, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_fp, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_copy, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_track_mode, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_data_block_type, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_link_size, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_initiator_application_code, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_session_format, tvb, offset+8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_packet_size, tvb, offset+10, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_audio_pause_length, tvb, offset+14, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_media_catalog_number, tvb, offset+16, 16, ENC_NA|ENC_ASCII); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_international_standard_recording_code, tvb, offset+32, 16, ENC_NA|ENC_ASCII); for (i = 0; i < 4; i++) { flags = tvb_get_guint8(tvb, offset+48+i); proto_tree_add_uint_format(tree, hf_scsi_mmc5_modepage_sub_header_byte, tvb, offset+48+i, 1, flags, "Sub-header Byte %u: %u", i, flags); } if (0x36 == tvb_get_guint8(tvb, offset+1)) proto_tree_add_item(tree, hf_scsi_mmc5_modepage_vendor_specific, tvb, offset+52, 4, ENC_BIG_ENDIAN); break; case SCSI_MMC3_MODEPAGE_MMCAP: proto_tree_add_item(tree, hf_scsi_mmc5_modepage_dvd_ram_read, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_dvd_r_read, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_dvd_rom_read, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_method_2, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_cd_rw_read, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_cd_r_read, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_dvd_ram_write, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_dvd_r_write, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_dvd_rom_write, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_mmcap_test_write, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_cd_rw_write, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_cd_r_write, tvb, offset+3, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_buf, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_mmcap_multi_session, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_mode_2_form2, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_mode_2_form1, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_digital_port2, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_digital_port1, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_composite, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_audio_play, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_read_bar_code, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_upc, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_isrc, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_c2_pointers_supported, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_rw_deinterleaved_corrected, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_rw_supported, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_cd_da_stream_is_accurate, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_cd_da_cmds_supported, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_loading_mechanism_type, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_eject, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_prevent_jumper, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_lock_state, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_lock, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_rw_in_lead_in, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_side_change_capable, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_sw_slot_selection, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_changer_supports_disc_present, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_separate_channel_mute, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_separate_volume_levels, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_number_of_volume_levels_supported, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_buffer_size_supported, tvb, offset+12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_length, tvb, offset+17, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_lsbf, tvb, offset+17, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_rck, tvb, offset+17, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_bckf, tvb, offset+17, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_copy_management_revision_support, tvb, offset+22, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_rotation_control_selected, tvb, offset+27, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_current_write_speed_selected, tvb, offset+28, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_mmc5_modepage_num_write_speed_performance, tvb, offset+30, 2, ENC_BIG_ENDIAN); break; default: return FALSE; } return TRUE; } static gboolean dissect_scsi_smc_modepage(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 pcode, guint8 spf _U_, guint8 subpcode _U_) { guint8 param_list_len; switch (pcode) { case SCSI_SMC_MODEPAGE_EAA: param_list_len = tvb_get_guint8(tvb, offset+1); if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_first_medium_transport_element_address, tvb, offset+2, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_number_of_medium_transport_elements, tvb, offset+4, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_first_storage_element_address, tvb, offset+6, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_number_of_storage_elements, tvb, offset+8, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_first_import_export_element_address, tvb, offset+10, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_number_of_import_export_elements, tvb, offset+12, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_first_data_transfer_element_address, tvb, offset+14, 2, ENC_BIG_ENDIAN); param_list_len -= 2; if (param_list_len < 2) break; proto_tree_add_item(tree, hf_scsi_smc_modepage_number_of_data_transfer_elements, tvb, offset+16, 2, ENC_BIG_ENDIAN); break; case SCSI_SMC_MODEPAGE_TRANGEOM: return FALSE; case SCSI_SMC_MODEPAGE_DEVCAP: proto_tree_add_item(tree, hf_scsi_smc_modepage_stordt, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_storie, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_storst, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_stormt, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_dt, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_ie, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_st, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_mt, tvb, offset+4, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_dt, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_ie, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_st, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_mt, tvb, offset+5, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_dt, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_ie, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_st, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_mt, tvb, offset+6, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_dt, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_ie, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_st, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_mt, tvb, offset+7, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_ne_dt, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_ne_ie, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_ne_st, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_mt_ne_mt, tvb, offset+12, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_ne_dt, tvb, offset+13, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_ne_ie, tvb, offset+13, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_ne_st, tvb, offset+13, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_st_ne_mt, tvb, offset+13, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_ne_dt, tvb, offset+14, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_ne_ie, tvb, offset+14, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_ne_st, tvb, offset+14, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_ie_ne_mt, tvb, offset+14, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_ne_dt, tvb, offset+15, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_ne_ie, tvb, offset+15, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_ne_st, tvb, offset+15, 1, ENC_NA); proto_tree_add_item(tree, hf_scsi_smc_modepage_dt_ne_mt, tvb, offset+15, 1, ENC_NA); break; default: return FALSE; } return TRUE; } static guint dissect_scsi_modepage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *scsi_tree, guint offset, scsi_device_type devtype) { guint16 plen; guint8 pcode, spf, subpcode = 0; proto_tree *tree; const value_string *modepage_val; int hf_pagecode; gboolean (*dissect_modepage)(tvbuff_t *, packet_info *, proto_tree *, guint, guint8, guint8, guint8); pcode = tvb_get_guint8(tvb, offset) & SCSI_MS_PCODE_BITS; spf = tvb_get_guint8(tvb, offset) & 0x40; if (spf) { subpcode = tvb_get_guint8(tvb, offset + 1); plen = tvb_get_ntohs(tvb, offset + 2); } else { plen = tvb_get_guint8(tvb, offset + 1); } if (try_val_to_str(pcode & SCSI_MS_PCODE_BITS, scsi_spc_modepage_val) == NULL) { /* * This isn't a generic mode page that applies to all SCSI * device types; try to interpret it based on what we deduced, * or were told, the device type is. */ switch (devtype) { case SCSI_DEV_SBC: modepage_val = scsi_sbc_modepage_val; hf_pagecode = hf_scsi_sbcpagecode; dissect_modepage = dissect_scsi_sbc_modepage; break; case SCSI_DEV_SSC: modepage_val = scsi_ssc2_modepage_val; hf_pagecode = hf_scsi_sscpagecode; dissect_modepage = dissect_scsi_ssc2_modepage; break; case SCSI_DEV_SMC: modepage_val = scsi_smc_modepage_val; hf_pagecode = hf_scsi_smcpagecode; dissect_modepage = dissect_scsi_smc_modepage; break; case SCSI_DEV_CDROM: modepage_val = scsi_mmc5_modepage_val; hf_pagecode = hf_scsi_mmcpagecode; dissect_modepage = dissect_scsi_mmc5_modepage; break; default: /* * The "val_to_str()" lookup will fail in this table * (it failed in "try_val_to_str()"), so it'll return * "Unknown (XXX)", which is what we want. */ modepage_val = scsi_spc_modepage_val; hf_pagecode = hf_scsi_spc_pagecode; dissect_modepage = dissect_scsi_spc_modepage; break; } } else { modepage_val = scsi_spc_modepage_val; hf_pagecode = hf_scsi_spc_pagecode; dissect_modepage = dissect_scsi_spc_modepage; } tree = proto_tree_add_subtree_format(scsi_tree, tvb, offset, plen + (spf ? 4 : 2), ett_scsi_page, NULL, "%s Mode Page", val_to_str(pcode & SCSI_MS_PCODE_BITS, modepage_val, "Unknown (0x%08x)")); proto_tree_add_item(tree, hf_scsi_modepage_ps, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_modepage_spf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_pagecode, tvb, offset, 1, ENC_BIG_ENDIAN); if (spf) { proto_tree_add_item(tree, hf_scsi_spc_subpagecode, tvb, offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_modepage_plen, tvb, offset + 2, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(tree, hf_scsi_modepage_plen, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } if (!tvb_bytes_exist(tvb, offset, plen)) { /* XXX - why not just drive on and throw an exception? */ return (plen + 2); } if (!(*dissect_modepage)(tvb, pinfo, tree, offset, pcode, spf, subpcode)) { proto_tree_add_expert(tree, pinfo, &ei_scsi_unknown_page, tvb, offset+2, plen); } return (plen+2); } void dissect_spc_modeselect6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata) { guint8 flags; guint plen; gint desclen; tvbuff_t *blockdesc_tvb; if (!tree) return; if (isreq && iscdb) { flags = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(tree, hf_scsi_modesel_flags, tvb, offset, 1, flags, "PF = %u, SP = %u", flags & 0x10, flags & 0x1); proto_tree_add_item(tree, hf_scsi_paramlen, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else { /* Mode Parameter has the following format: * Mode Parameter Header * - Mode Data Len, Medium Type, Dev Specific Parameter, * Blk Desc Len * Block Descriptor (s) * - Number of blocks, density code, block length * Page (s) * - Page code, Page length, Page Parameters */ if (payload_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_mode_data_length8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; payload_len -= 1; /* The mode data length is reserved for MODE SELECT, so we just use the payload length. */ if (payload_len < 1) return; switch (cdata->itl->cmdset&SCSI_CMDSET_MASK) { case SCSI_DEV_SBC: proto_tree_add_item(tree, hf_scsi_modesel_dev_sbc_medium_type, tvb, offset, 1, ENC_BIG_ENDIAN); break; default: proto_tree_add_item(tree, hf_scsi_modesel_medium_type, tvb, offset, 1, ENC_BIG_ENDIAN); break; } offset += 1; payload_len -= 1; if (payload_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_device_specific_parameter, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; payload_len -= 1; if (payload_len < 1) return; desclen = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_scsi_modesel_block_descriptor_length8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; payload_len -= 1; if (tvb_reported_length_remaining(tvb, offset)>0) { blockdesc_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, FALSE); } offset += desclen; payload_len -= desclen; /* offset points to the start of the mode page */ while ((payload_len > 0) && tvb_bytes_exist(tvb, offset, 2)) { plen = dissect_scsi_modepage(tvb, pinfo, tree, offset, cdata->itl->cmdset&SCSI_CMDSET_MASK); offset += plen; payload_len -= plen; } } } void dissect_spc_modeselect10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata) { guint8 flags; gboolean longlba; gint desclen; guint plen; tvbuff_t *blockdesc_tvb; if (!tree) return; if (isreq && iscdb) { flags = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(tree, hf_scsi_modesel_flags, tvb, offset, 1, flags, "PF = %u, SP = %u", flags & 0x10, flags & 0x1); proto_tree_add_item(tree, hf_scsi_paramlen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else { /* Mode Parameter has the following format: * Mode Parameter Header * - Mode Data Len, Medium Type, Dev Specific Parameter, * Blk Desc Len * Block Descriptor (s) * - Number of blocks, density code, block length * Page (s) * - Page code, Page length, Page Parameters */ if (payload_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_mode_data_length16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; payload_len -= 2; /* The mode data length is reserved for MODE SELECT, so we just use the payload length. */ if (payload_len < 1) return; if (!cdata->itl) return; switch (cdata->itl->cmdset&SCSI_CMDSET_MASK) { case SCSI_DEV_SBC: proto_tree_add_item(tree, hf_scsi_modesel_dev_sbc_medium_type, tvb, offset, 1, ENC_BIG_ENDIAN); break; default: proto_tree_add_item(tree, hf_scsi_modesel_medium_type, tvb, offset, 1, ENC_BIG_ENDIAN); break; } offset += 1; payload_len -= 1; if (payload_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_device_specific_parameter, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; payload_len -= 1; if (payload_len < 1) return; longlba = tvb_get_guint8(tvb, offset) & 0x1; proto_tree_add_item(tree, hf_scsi_modesel_longlba, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 2; /* skip LongLBA byte and reserved byte */ payload_len -= 2; if (payload_len < 1) return; desclen = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_scsi_modesel_block_descriptor_length16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; payload_len -= 2; if (tvb_reported_length_remaining(tvb, offset)>0) { blockdesc_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, longlba); } offset += desclen; payload_len -= desclen; /* offset points to the start of the mode page */ while ((payload_len > 0) && tvb_bytes_exist(tvb, offset, 2)) { plen = dissect_scsi_modepage(tvb, pinfo, tree, offset, cdata->itl->cmdset&SCSI_CMDSET_MASK); offset += plen; payload_len -= plen; } } } static void dissect_scsi_pagecode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, scsi_task_data_t *cdata) { guint8 pcode; int hf_pagecode; /* unless we have cdata there is not much point in continuing */ if (!cdata) return; pcode = tvb_get_guint8(tvb, offset); if (try_val_to_str(pcode & SCSI_MS_PCODE_BITS, scsi_spc_modepage_val) == NULL) { /* * This isn't a generic mode page that applies to all SCSI * device types; try to interpret it based on what we deduced, * or were told, the device type is. */ switch (cdata->itl->cmdset&SCSI_CMDSET_MASK) { case SCSI_DEV_SBC: hf_pagecode = hf_scsi_sbcpagecode; break; case SCSI_DEV_SSC: hf_pagecode = hf_scsi_sscpagecode; break; case SCSI_DEV_SMC: hf_pagecode = hf_scsi_smcpagecode; break; case SCSI_DEV_CDROM: hf_pagecode = hf_scsi_mmcpagecode; break; default: hf_pagecode = hf_scsi_spc_pagecode; break; } } else { hf_pagecode = hf_scsi_spc_pagecode; } proto_tree_add_uint(tree, hf_pagecode, tvb, offset, 1, pcode); } void dissect_spc_modesense6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata) { guint8 flags; guint plen; gint tot_len, desclen; tvbuff_t *blockdesc_tvb; if (!tree) return; if (isreq && iscdb) { flags = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(tree, hf_scsi_modesns_flags, tvb, offset, 1, flags, "DBD = %u", flags & 0x8); proto_tree_add_item(tree, hf_scsi_modesns_pc, tvb, offset+1, 1, ENC_BIG_ENDIAN); dissect_scsi_pagecode(tvb, pinfo, tree, offset+1, cdata); proto_tree_add_item(tree, hf_scsi_alloclen, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else { /* Mode sense response has the following format: * Mode Parameter Header * - Mode Data Len, Medium Type, Dev Specific Parameter, * Blk Desc Len * Block Descriptor (s) * - Number of blocks, density code, block length * Page (s) * - Page code, Page length, Page Parameters */ tot_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_scsi_modesel_mode_data_length8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* The actual payload is the min of the length in the response & the * space allocated by the initiator as specified in the request. * * XXX - the payload length includes the length field, so we * really should subtract the length of the length field from * the payload length - but can it really be zero here? */ if (payload_len && (tot_len > (gint)payload_len)) tot_len = payload_len; if (tot_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_medium_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; tot_len -= 1; if (tot_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_device_specific_parameter, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; tot_len -= 1; if (tot_len < 1) return; desclen = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_scsi_modesel_block_descriptor_length8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; tot_len -= 1; if (tvb_reported_length_remaining(tvb, offset)>0) { blockdesc_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, FALSE); } offset += desclen; tot_len -= desclen; /* offset points to the start of the mode page */ while ((tot_len > 0) && tvb_bytes_exist(tvb, offset, 2)) { plen = dissect_scsi_modepage(tvb, pinfo, tree, offset, cdata->itl->cmdset&SCSI_CMDSET_MASK); offset += plen; tot_len -= plen; } } } void dissect_spc_modesense10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata) { guint8 flags; gboolean longlba; gint tot_len, desclen; guint plen; tvbuff_t *blockdesc_tvb; if (!tree) return; if (isreq && iscdb) { flags = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(tree, hf_scsi_modesns_flags, tvb, offset, 1, flags, "LLBAA = %u, DBD = %u", flags & 0x10, flags & 0x8); proto_tree_add_item(tree, hf_scsi_modesns_pc, tvb, offset+1, 1, ENC_BIG_ENDIAN); dissect_scsi_pagecode(tvb, pinfo, tree, offset+1, cdata); proto_tree_add_item(tree, hf_scsi_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else { /* Mode sense response has the following format: * Mode Parameter Header * - Mode Data Len, Medium Type, Dev Specific Parameter, * Blk Desc Len * Block Descriptor (s) * - Number of blocks, density code, block length * Page (s) * - Page code, Page length, Page Parameters */ tot_len = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_scsi_modesel_mode_data_length16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* The actual payload is the min of the length in the response & the * space allocated by the initiator as specified in the request. * * XXX - the payload length includes the length field, so we * really should subtract the length of the length field from * the payload length - but can it really be zero here? */ if (payload_len && (tot_len > (gint)payload_len)) tot_len = payload_len; if (tot_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_medium_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; tot_len -= 1; if (tot_len < 1) return; proto_tree_add_item(tree, hf_scsi_modesel_device_specific_parameter, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; tot_len -= 1; if (tot_len < 1) return; longlba = tvb_get_guint8(tvb, offset) & 0x1; proto_tree_add_item(tree, hf_scsi_modesel_longlba, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 2; /* skip LongLBA byte and reserved byte */ tot_len -= 2; if (tot_len < 2) return; desclen = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_scsi_modesel_block_descriptor_length16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; tot_len -= 2; if (tvb_reported_length_remaining(tvb, offset)>0) { blockdesc_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, longlba); } offset += desclen; tot_len -= desclen; /* offset points to the start of the mode page */ while ((tot_len > 0) && tvb_bytes_exist(tvb, offset, 2)) { plen = dissect_scsi_modepage(tvb, pinfo, tree, offset, cdata->itl->cmdset&SCSI_CMDSET_MASK); offset += plen; tot_len -= plen; } } } void dissect_spc_preventallowmediaremoval(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (isreq && iscdb) { static int * const prevent_allow_fields[] = { &hf_scsi_prevent_allow_prevent, NULL }; guint8 flags; proto_tree_add_bitmask(tree, tvb, offset + 3, hf_scsi_prevent_allow_flags, ett_scsi_prevent_allow, prevent_allow_fields, ENC_BIG_ENDIAN); flags = tvb_get_guint8(tvb, offset + 3); if (flags & 0x01) { col_append_str(pinfo->cinfo, COL_INFO, " PREVENT"); } else { col_append_str(pinfo->cinfo, COL_INFO, " ALLOW"); } proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_spc_persistentreservein(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata) { guint16 flags; int numrec, i; guint len; if (!tree) return; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_persresvin_svcaction, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); /* We store the service action since we want to interpret the data */ cdata->itlq->flags = tvb_get_guint8(tvb, offset); } else { if (cdata) { flags = cdata->itlq->flags; } else { flags = 0xFF; } proto_tree_add_item(tree, hf_scsi_persresvin_generation_number, tvb, offset, 4, ENC_BIG_ENDIAN); len = tvb_get_ntohl(tvb, offset+4); proto_tree_add_item(tree, hf_scsi_persresvin_additional_length, tvb, offset+4, 4, ENC_BIG_ENDIAN); len = (payload_len > len) ? len : payload_len; if ((flags & 0x1F) == SCSI_SPC_RESVIN_SVCA_RDKEYS) { /* XXX - what if len is < 8? That may be illegal, but that doesn't make it impossible.... */ numrec = len / 8; offset += 8; for (i = 0; i < numrec; i++) { proto_tree_add_item(tree, hf_scsi_persresv_key, tvb, offset, 8, ENC_NA); offset += 8; } } else if ((flags & 0x1F) == SCSI_SPC_RESVIN_SVCA_RDRESV && len) { proto_tree_add_item(tree, hf_scsi_persresv_key, tvb, offset+8, 8, ENC_NA); proto_tree_add_item(tree, hf_scsi_persresv_scopeaddr, tvb, offset+16, 4, ENC_NA); proto_tree_add_item(tree, hf_scsi_persresv_scope, tvb, offset+21, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_persresv_type, tvb, offset+21, 1, ENC_BIG_ENDIAN); } } } void dissect_spc_persistentreserveout(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 svcaction; if (!tree) return; if (isreq && iscdb) { svcaction = tvb_get_guint8(tvb, offset) & 0x1F; proto_tree_add_item(tree, hf_scsi_persresvout_svcaction, tvb, offset, 1, ENC_BIG_ENDIAN); /* type and scope are ignored for REGISTER, REGISTER AND IGNORE EXISTING KEY, CLEAR service actions */ if (svcaction != SCSI_PR_REGISTER && svcaction != SCSI_PR_REG_IGNORE && svcaction != SCSI_PR_CLEAR) { proto_tree_add_item(tree, hf_scsi_persresv_scope, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_persresv_type, tvb, offset+1, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(tree, hf_scsi_paramlen16, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); /* We store the service action since we want to interpret the params */ cdata->itlq->flags = tvb_get_guint8(tvb, offset); } else if (isreq && !iscdb) { proto_tree_add_item(tree, hf_scsi_persresvout_reskey, tvb, offset, 8, ENC_NA); proto_tree_add_item(tree, hf_scsi_persresvout_sareskey, tvb, offset +8, 8, ENC_NA); if (cdata->itlq->flags == 0x07) { /* Service action REGISTER AND MOVE */ static int * const persresv_fields[] = { &hf_scsi_persresv_control_rsvd, &hf_scsi_persresv_control_unreg, &hf_scsi_persresv_control_aptpl, NULL }; guint32 tid_len = tvb_get_ntohl(tvb, offset+20); proto_tree_add_item(tree, hf_scsi_persresvout_obsolete, tvb, offset+16, 1, ENC_NA); proto_tree_add_bitmask(tree, tvb, offset+17, hf_scsi_persresvout_control, ett_persresv_control, persresv_fields, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_persresvout_rel_tpi, tvb, offset+18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_persresvout_transportid_len, tvb, offset+20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_persresvout_transportid, tvb, offset+24, tid_len, ENC_NA); } else { /* Other service actions than REGISTER AND MOVE. */ static int * const persresv_fields[] = { &hf_scsi_persresv_control_rsvd1, &hf_scsi_persresv_control_spec_i_pt, &hf_scsi_persresv_control_all_tg_pt, &hf_scsi_persresv_control_rsvd2, &hf_scsi_persresv_control_aptpl, NULL }; proto_tree_add_item(tree, hf_scsi_persresvout_obsolete, tvb, offset+16, 4, ENC_NA); proto_tree_add_bitmask(tree, tvb, offset+20, hf_scsi_persresvout_control, ett_persresv_control, persresv_fields, ENC_BIG_ENDIAN); } } else { } } void dissect_spc_release6(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_spc_release10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 flags; if (!tree) return; if (isreq && iscdb) { flags = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(tree, hf_scsi_release_flags, tvb, offset, 1, flags, "Flags: 3rd Party ID = %u, LongID = %u", flags & 0x10, flags & 0x2); if ((flags & 0x12) == 0x10) { proto_tree_add_item(tree, hf_scsi_release_thirdpartyid, tvb, offset+2, 1, ENC_NA); } proto_tree_add_item(tree, hf_scsi_paramlen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } static void dissect_spc_reportdeviceidentifier(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint offset _U_, gboolean isreq _U_, gboolean iscdb _U_, guint payload_len _U_, scsi_task_data_t *cdata _U_) { } void dissect_scsi_lun(proto_tree *tree, tvbuff_t *tvb, guint offset) { proto_item *ti; proto_tree *tt, *tl = proto_tree_add_subtree(tree, tvb, offset, 8, ett_scsi_lun, &ti, "LUN"); guint8 address_mode, lun_len = 0, ea_code = 0, len_code = 0, lun_count = 0, complex_lun = 0; guint16 lun = 0; const gchar *str = NULL; if (tvb_get_ntoh48(tvb, offset) << 16) { /* Pedantically change LUN to LUNs */ proto_item_append_text(tl, "s"); complex_lun = 1; } while (lun_len < 8) { lun = tvb_get_ntohs(tvb, offset + lun_len); /* Don't skip the first non-zero LUN */ if (lun_len && !lun) break; address_mode = tvb_get_guint8(tvb, offset + lun_len); if ((address_mode >> 6) < 0x3) len_code = 2; else { len_code = (address_mode & 0x30) >> 4; len_code = 2 + (len_code * 2); } if (complex_lun) { /* Add lun subtrees only for complex luns */ tt = proto_tree_add_subtree(tl, tvb, offset + lun_len, len_code, ett_scsi_lun_unit, &ti, "LUN"); proto_item_append_text(tt, " %d", lun_count++); } else tt = tl; /* Peripheral and Simple logical unit addressing share the same identifier, with bus defining the difference */ if (!address_mode) proto_tree_add_uint_format_value(tt, hf_scsi_lun_address_mode, tvb, offset + lun_len, 1, (address_mode >> 6), "Simple logical unit addressing (0x0%x)", address_mode >> 6); else proto_tree_add_item(tt, hf_scsi_lun_address_mode, tvb, offset + lun_len, 1, ENC_BIG_ENDIAN); switch (address_mode >> 6) { case 0: /* Simple logical unit addressing method has no bus id */ if (address_mode) { proto_tree_add_bits_item(tt, hf_scsi_bus, tvb, (offset + lun_len) * 8 + 2, 0x6, ENC_BIG_ENDIAN); lun = tvb_get_guint8(tvb, offset + lun_len + 1); proto_tree_add_uint(tt, hf_scsi_lun, tvb, offset + lun_len + 1, 1, lun); } else { proto_tree_add_bits_item(tt, hf_scsi_lun, tvb, (offset + lun_len) * 8 + 2, 0xe, ENC_BIG_ENDIAN); } lun_len += len_code; break; case 1: proto_tree_add_bits_item(tt, hf_scsi_lun, tvb, (offset + lun_len) * 8 + 2, 0xe, ENC_BIG_ENDIAN); lun_len += len_code; break; case 2: proto_tree_add_item(tt, hf_scsi_target, tvb, offset + lun_len, 1, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tt, hf_scsi_bus, tvb, (offset + lun_len + 1) * 8, 0x3, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tt, hf_scsi_lun, tvb, (offset + lun_len + 1) * 8 + 3, 0x5, ENC_BIG_ENDIAN); lun_len += len_code; break; case 3: ea_code = address_mode & 0xf; lun = len_code; len_code = (address_mode & 0x30) >> 4; ti = proto_tree_add_item(tt, hf_scsi_extended_add_method_len, tvb, offset + lun_len, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, " (%d bytes)", lun); ti = proto_tree_add_item(tt, hf_scsi_extended_add_method, tvb, offset + lun_len, 1, ENC_BIG_ENDIAN); str = NULL; switch(ea_code) { case 0x1: if (!len_code) { str = "Well known logical unit"; proto_tree_add_item(tt, hf_scsi_lun, tvb, offset + lun_len + 1, 1, ENC_BIG_ENDIAN); } break; case 0x2: if (len_code == 0x1) str = "Extended flat space addressing"; else if (len_code == 0x2) str = "Long extended flat space addressing"; if (str) proto_tree_add_item(tt, hf_scsi_lun_extended, tvb, offset + lun_len + 1, lun - 1, ENC_BIG_ENDIAN); break; case 0xe: if (len_code == 0x3) str = "Reserved for FC-SB-5"; break; case 0xf: /* The contents of all hierarchical LUN structure addressing fields following a logical unit not specified addressing * method addressing field shall be ignored. [SAM5] 4.7.7.5.4 */ if (len_code == 0x3) { proto_item_append_text(ti, " (Logical unit not specified)"); return; } break; default: str = "Reserved"; break; } len_code = (guint8)lun; if (!str) str = "Reserved"; proto_item_append_text(ti, " (%s)", str); lun_len += len_code; break; default: break; } } } void dissect_spc_reportluns(tvbuff_t *tvb_a, packet_info *pinfo _U_, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { gint listlen; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_select_report, tvb_a, offset_a+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_alloclen32, tvb_a, offset_a+5, 4, ENC_BIG_ENDIAN); if (cdata) { cdata->itlq->alloc_len = tvb_get_ntohl(tvb_a, offset_a+5); } proto_tree_add_bitmask(tree, tvb_a, offset_a+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { if (!cdata) { return; } TRY_SCSI_CDB_ALLOC_LEN(cdata->itlq->alloc_len); /* (defines/initializes try_tvb & try_offset) */ listlen = tvb_get_ntohl(try_tvb, try_offset); proto_tree_add_item(tree, hf_scsi_reportluns_lun_list_length, try_tvb, try_offset, 4, ENC_BIG_ENDIAN); try_offset += 8; while(listlen>0) { dissect_scsi_lun(tree, try_tvb, try_offset); try_offset+=8; listlen-=8; } END_TRY_SCSI_CDB_ALLOC_LEN; } } static const value_string mpi_action_vals[] = { {MPI_MANAGEMENT_PROTOCOL_IN , "Management Protocol In"}, {MPI_REPORT_SUPPORTED_OPERATION_CODES , "Report Supported Opcodes"}, {0, NULL} }; static const value_string report_opcodes_options_vals[] = { {0, "Report ALL opcodes"}, {1, "Report ONE opcode, NO service action"}, {2, "Report ONE opcode, WITH service action"}, {0, NULL} }; void dissect_spc_mgmt_protocol_in(tvbuff_t *tvb_a, packet_info *pinfo _U_, proto_tree *tree, guint offset_a, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 service_action; if (isreq && iscdb) { service_action = tvb_get_guint8 (tvb_a, offset_a) & 0x1F; if (cdata) { cdata->itlq->flags=service_action; } col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(service_action, mpi_action_vals, "Unknown")); proto_tree_add_item(tree, hf_scsi_mpi_service_action, tvb_a, offset_a, 1, ENC_BIG_ENDIAN); switch(service_action){ case MPI_REPORT_SUPPORTED_OPERATION_CODES: proto_tree_add_item(tree, hf_scsi_report_opcodes_rctd, tvb_a, offset_a+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_report_opcodes_options, tvb_a, offset_a+1, 1, ENC_BIG_ENDIAN); if (cdata && (tvb_get_guint8(tvb_a, offset_a+1) & 0x07)) { /* Need the one-command parameter format */ cdata->itlq->flags|=0x80; } proto_tree_add_item(tree, hf_scsi_report_opcodes_requested_o, tvb_a, offset_a+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_report_opcodes_requested_sa, tvb_a, offset_a+3, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_alloclen32, tvb_a, offset_a+5, 4, ENC_BIG_ENDIAN); if (cdata) { cdata->itlq->alloc_len = tvb_get_ntohl(tvb_a, offset_a+5); } break; default: proto_tree_add_expert(tree, pinfo, &ei_scsi_no_dissection_for_service_action, tvb_a, offset_a+1, 8); } proto_tree_add_bitmask(tree, tvb_a, offset_a+10, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { proto_item *it; int length; cmdset_t *csdata; int ctdp; if (!cdata || !cdata->itlq || !cdata->itl) { return; } csdata = get_cmdset_data(pinfo->pool, cdata->itlq, cdata->itl); it = proto_tree_add_uint(tree, hf_scsi_mpi_service_action, tvb_a, 0, 0, cdata->itlq->flags & 0x7f); proto_item_set_generated(it); TRY_SCSI_CDB_ALLOC_LEN(cdata->itlq->alloc_len); /* (defines/initializes try_tvb & try_offset) */ switch (cdata->itlq->flags & 0x7f) { case MPI_REPORT_SUPPORTED_OPERATION_CODES: if (cdata->itlq->flags & 0x80) { /* one-command format */ proto_tree_add_item(tree, hf_scsi_report_opcodes_ctdp_one, try_tvb, try_offset+1, 1, ENC_BIG_ENDIAN); ctdp = tvb_get_guint8(try_tvb, try_offset+1) & 0x80; proto_tree_add_item(tree, hf_scsi_report_opcodes_support, try_tvb, try_offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_report_opcodes_cdb_length, try_tvb, try_offset+2, 2, ENC_BIG_ENDIAN); length = tvb_get_ntohs(try_tvb, try_offset+2); proto_tree_add_item(tree, hf_scsi_report_opcodes_cdb_usage_data, try_tvb, try_offset+4, length, ENC_NA); if (ctdp) { proto_tree *tr; tr = proto_tree_add_subtree(tree, try_tvb, try_offset, 12, ett_timeout_descriptor, NULL, "Timeout Descriptor"); proto_tree_add_item(tr, hf_scsi_report_opcodes_tdl, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_npt, try_tvb, try_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_rct, try_tvb, try_offset + 8, 4, ENC_BIG_ENDIAN); } } else { /* all commands format */ proto_tree_add_item(tree, hf_scsi_report_opcodes_cdl, try_tvb, try_offset+0, 4, ENC_BIG_ENDIAN); length = tvb_get_ntohl(try_tvb, try_offset); try_offset += 4; while (length >= 20) { proto_tree *tr; tr = proto_tree_add_subtree_format(tree, try_tvb, try_offset, 20, ett_command_descriptor, NULL, "Command Descriptor: %s", val_to_str_ext_const(tvb_get_guint8(try_tvb, try_offset+0), csdata->cdb_vals_ext, "Unknown")); proto_tree_add_item(tr, csdata->hf_opcode, try_tvb, try_offset+0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_sa, try_tvb, try_offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_ctdp, try_tvb, try_offset+5, 1, ENC_BIG_ENDIAN); ctdp = tvb_get_guint8(try_tvb, try_offset+5) & 0x02; proto_tree_add_item(tr, hf_scsi_report_opcodes_servactv, try_tvb, try_offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_cdb_length, try_tvb, try_offset+6, 2, ENC_BIG_ENDIAN); try_offset += 8; length -= 8; if (!ctdp) { continue; } tr = proto_tree_add_subtree(tree, try_tvb, try_offset, 12, ett_timeout_descriptor, NULL, "Timeout Descriptor"); proto_tree_add_item(tr, hf_scsi_report_opcodes_tdl, try_tvb, try_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_npt, try_tvb, try_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tr, hf_scsi_report_opcodes_rct, try_tvb, try_offset + 8, 4, ENC_BIG_ENDIAN); try_offset += 12; length -= 12; } } break; default: proto_tree_add_expert(tree, pinfo, &ei_scsi_no_dissection_for_service_action, try_tvb, try_offset+1, 8); } END_TRY_SCSI_CDB_ALLOC_LEN; } } static void dissect_scsi_sns_specific_info(tvbuff_t *tvb, proto_tree *sns_tree, guint offset, guint8 sense_key) { guint8 valid = tvb_get_guint8(tvb, offset)&0x80; proto_tree_add_item(sns_tree, hf_scsi_sksv, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_sks_info, tvb, offset, 3, ENC_BIG_ENDIAN); if (sense_key==5&&valid) { /*illegal request*/ proto_tree_add_item(sns_tree, hf_scsi_sks_fp_cd, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_sks_fp_bpv, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_sks_fp_bit, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_sks_fp_field, tvb, offset, 3, ENC_BIG_ENDIAN); } } static void dissect_scsi_fix_snsinfo(tvbuff_t *tvb, proto_tree *sns_tree, guint offset) { proto_item *hidden_item; guint8 flags; proto_tree_add_item(sns_tree, hf_scsi_sns_valid, tvb, offset, 1, ENC_BIG_ENDIAN); flags = tvb_get_guint8(tvb, offset+2); proto_tree_add_item(sns_tree, hf_scsi_sns_filemark, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(sns_tree, hf_scsi_sns_eom, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(sns_tree, hf_scsi_sns_ili, tvb, offset+2, 1, ENC_NA); proto_tree_add_item(sns_tree, hf_scsi_snskey, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_snsinfo, tvb, offset+3, 4, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_addlsnslen, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_sns_command_specific_information, tvb, offset+8, 4, ENC_NA); proto_tree_add_item(sns_tree, hf_scsi_ascascq, tvb, offset+12, 2, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(sns_tree, hf_scsi_asc, tvb, offset+12, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_item(sns_tree, hf_scsi_ascq, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(sns_tree, hf_scsi_fru, tvb, offset+14, 1, ENC_BIG_ENDIAN); dissect_scsi_sns_specific_info(tvb,sns_tree,offset+15,flags&0x0F); } static void dissect_scsi_descriptor_snsinfo(tvbuff_t *tvb, proto_tree *sns_tree, guint offset) { guint8 additional_length, sense_key; guint end; proto_tree_add_item(sns_tree, hf_scsi_snskey, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_ascascq, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sns_tree, hf_scsi_addlsnslen, tvb, offset+7, 1, ENC_BIG_ENDIAN); sense_key = tvb_get_guint8(tvb, offset+1)&0xF; additional_length = tvb_get_guint8(tvb, offset+7); end = offset+7+additional_length; offset+=8; while (offset<end-2) { guint8 desc_type, desc_length, desc_end; proto_item *item; proto_tree *desc_tree; desc_type = tvb_get_guint8(tvb, offset); desc_length = tvb_get_guint8(tvb, offset+1); desc_end = offset+desc_length+2; desc_tree = proto_tree_add_subtree(sns_tree, tvb, offset, desc_length+2, ett_sense_descriptor, NULL, val_to_str(desc_type, scsi_sense_desc_type_val, "Unknown (0x%02x)")); proto_tree_add_item(desc_tree, hf_scsi_sns_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(desc_tree, hf_scsi_sns_desc_length, tvb, offset+1, 1, ENC_BIG_ENDIAN); switch (desc_type) { case 2: /*sense key specific*/ if (desc_length==6) { dissect_scsi_sns_specific_info(tvb,desc_tree,offset+4,sense_key); } break; case 6: /*OSD object identification*/ if (desc_length==0x1e) { static int * const command_functions[] = { &hf_scsi_sns_osd_object_validation, &hf_scsi_sns_osd_object_cmd_cap_v, &hf_scsi_sns_osd_object_command, &hf_scsi_sns_osd_object_imp_st_att, &hf_scsi_sns_osd_object_sa_cap_v, &hf_scsi_sns_osd_object_set_att, &hf_scsi_sns_osd_object_ga_cap_v, &hf_scsi_sns_osd_object_get_att, NULL }; proto_tree_add_bitmask(desc_tree, tvb, offset+8, hf_scsi_sns_osd_object_not_initiated, ett_sense_osd_not_initiated, command_functions, ENC_BIG_ENDIAN); proto_tree_add_bitmask(desc_tree, tvb, offset+12, hf_scsi_sns_osd_object_completed, ett_sense_osd_completed, command_functions, ENC_BIG_ENDIAN); proto_tree_add_item(desc_tree, hf_scsi_sns_osd_partition_id, tvb, offset+16, 8, ENC_BIG_ENDIAN); proto_tree_add_item(desc_tree, hf_scsi_sns_osd_object_id, tvb, offset+24, 8, ENC_BIG_ENDIAN); } break; case 8: /*OSD attribute identification*/ offset+=4; while (offset+8<=desc_end) { const attribute_page_numbers_t *apn; guint32 page,number; page=tvb_get_ntohl(tvb, offset); proto_tree_add_item(desc_tree, hf_scsi_sns_osd_attr_page, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; number=tvb_get_ntohl(tvb, offset); item=proto_tree_add_item(desc_tree, hf_scsi_sns_osd_attr_number, tvb, offset, 4, ENC_BIG_ENDIAN); apn=osd_lookup_attribute(page,number); offset+=4; if (apn) { proto_item_append_text(item, " (%s)", apn->name); } else { proto_item_append_text(item, " (Unknown)"); } } default: break; } offset += desc_length+2; } } static void dissect_scsi_sense(tvbuff_t *tvb, proto_tree *sns_tree, guint offset) { guint8 sense_type; proto_tree_add_item(sns_tree, hf_scsi_sns_errtype, tvb, offset, 1, ENC_BIG_ENDIAN); sense_type = tvb_get_guint8(tvb, offset) & 0x7f; switch (sense_type) { case 0x70: case 0x71: dissect_scsi_fix_snsinfo(tvb, sns_tree, offset); break; case 0x72: case 0x73: dissect_scsi_descriptor_snsinfo(tvb, sns_tree, offset); break; } } void dissect_spc_requestsense(tvbuff_t * tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_alloclen, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } else if (!isreq) { dissect_scsi_sense(tvb, tree, offset); } } void dissect_spc_reserve6(tvbuff_t * tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_spc_reserve10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { guint8 flags; if (!tree) return; if (isreq && iscdb) { flags = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(tree, hf_scsi_release_flags, tvb, offset, 1, flags, "Flags: 3rd Party ID = %u, LongID = %u", flags & 0x10, flags & 0x2); if ((flags & 0x12) == 0x10) { proto_tree_add_item(tree, hf_scsi_release_thirdpartyid, tvb, offset+2, 1, ENC_NA); } proto_tree_add_item(tree, hf_scsi_paramlen16, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_spc_testunitready(tvbuff_t * tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } } void dissect_spc_senddiagnostic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb _U_, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree && !isreq) return; proto_tree_add_item(tree, hf_scsi_senddiag_st_code, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_senddiag_pf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_senddiag_st, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_senddiag_devoff, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_senddiag_unitoff, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_paramlen16, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } void dissect_spc_writebuffer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb _U_, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree && !isreq) return; proto_tree_add_item(tree, hf_scsi_wb_mode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_wb_bufferid, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_wb_bufoffset, tvb, offset+2, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_paramlen24, tvb, offset+5, 3, ENC_BIG_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control, ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN); } static void dissect_scsi_varlencdb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_) { if (!tree) return; if (isreq && iscdb) { proto_tree_add_item(tree, hf_scsi_control, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_add_cdblen, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_scsi_svcaction, tvb, offset+7, 2, ENC_BIG_ENDIAN); } } void dissect_scsi_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, itlq_nexus_t *itlq, itl_nexus_t *itl, guint8 scsi_status) { proto_item *ti; proto_tree *scsi_tree = NULL; cmdset_t *csdata; scsi_task_data_t *cdata; cdata = wmem_new(pinfo->pool, scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_RSP; tap_queue_packet(scsi_tap, pinfo, cdata); csdata = get_cmdset_data(pinfo->pool, itlq, itl); /* Nothing really to do here, just print some stuff passed to us */ if (tree) { ti = proto_tree_add_protocol_format(tree, proto_scsi, tvb, 0, 0, "SCSI Response (%s)", val_to_str_ext(itlq->scsi_opcode, csdata->cdb_vals_ext, "CDB:0x%02x")); scsi_tree = proto_item_add_subtree(ti, ett_scsi); } ti = proto_tree_add_uint(scsi_tree, hf_scsi_lun, tvb, 0, 0, itlq->lun); proto_item_set_generated(ti); if (itl) { ti = proto_tree_add_uint_format(scsi_tree, hf_scsi_inq_devtype, tvb, 0, 0, itl->cmdset&SCSI_CMDSET_MASK, "Command Set:%s (0x%02x) %s", val_to_str(itl->cmdset&SCSI_CMDSET_MASK, scsi_devtype_val, "Unknown (%d)"), itl->cmdset&SCSI_CMDSET_MASK,itl->cmdset&SCSI_CMDSET_DEFAULT?"(Using default commandset)":""); proto_item_set_generated(ti); if (itlq->scsi_opcode != 0xffff) { ti = proto_tree_add_uint(scsi_tree, csdata->hf_opcode, tvb, 0, 0, itlq->scsi_opcode); proto_item_set_generated(ti); } } if (itlq->first_exchange_frame) { nstime_t delta_time; ti = proto_tree_add_uint(scsi_tree, hf_scsi_request_frame, tvb, 0, 0, itlq->first_exchange_frame); proto_item_set_generated(ti); nstime_delta(&delta_time, &pinfo->abs_ts, &itlq->fc_time); ti = proto_tree_add_time(scsi_tree, hf_scsi_time, tvb, 0, 0, &delta_time); proto_item_set_generated(ti); } ti = proto_tree_add_uint(scsi_tree, hf_scsi_status, tvb, 0, 0, scsi_status); proto_item_set_generated(ti); col_add_fstr(pinfo->cinfo, COL_INFO, "SCSI: Response LUN: 0x%02x (%s) (%s)", itlq->lun, val_to_str_ext(itlq->scsi_opcode, csdata->cdb_vals_ext, "CDB:0x%02x"), val_to_str(scsi_status, scsi_status_val, "Unknown (0x%08x)")); col_set_fence(pinfo->cinfo, COL_INFO); } void dissect_scsi_snsinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint snslen, itlq_nexus_t *itlq, itl_nexus_t *itl) { proto_item *ti; proto_tree *sns_tree = NULL; const char *old_proto; scsi_task_data_t *cdata; cdata = wmem_new(pinfo->pool, scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_SNS; tap_queue_packet(scsi_tap, pinfo, cdata); old_proto = pinfo->current_proto; pinfo->current_proto="SCSI"; if (tree) { ti = proto_tree_add_protocol_format(tree, proto_scsi, tvb, offset, snslen, "SCSI: SNS Info"); sns_tree = proto_item_add_subtree(ti, ett_scsi); } ti = proto_tree_add_uint(sns_tree, hf_scsi_lun, tvb, 0, 0, itlq->lun); proto_item_set_generated(ti); col_append_fstr(pinfo->cinfo, COL_INFO, " LUN:0x%02x ", itlq->lun); col_set_fence(pinfo->cinfo, COL_INFO); dissect_scsi_sense(tvb, sns_tree, offset); pinfo->current_proto = old_proto; } static scsi_cdb_table_t spc[256] = { /*SPC 0x00*/{dissect_spc_testunitready}, /*SPC 0x01*/{NULL}, /*SPC 0x02*/{NULL}, /*SPC 0x03*/{dissect_spc_requestsense}, /*SPC 0x04*/{NULL}, /*SPC 0x05*/{NULL}, /*SPC 0x06*/{NULL}, /*SPC 0x07*/{NULL}, /*SPC 0x08*/{NULL}, /*SPC 0x09*/{NULL}, /*SPC 0x0a*/{NULL}, /*SPC 0x0b*/{NULL}, /*SPC 0x0c*/{NULL}, /*SPC 0x0d*/{NULL}, /*SPC 0x0e*/{NULL}, /*SPC 0x0f*/{NULL}, /*SPC 0x10*/{NULL}, /*SPC 0x11*/{NULL}, /*SPC 0x12*/{dissect_spc_inquiry}, /*SPC 0x13*/{NULL}, /*SPC 0x14*/{NULL}, /*SPC 0x15*/{dissect_spc_modeselect6}, /*SPC 0x16*/{dissect_spc_reserve6}, /*SPC 0x17*/{dissect_spc_release6}, /*SPC 0x18*/{NULL}, /*SPC 0x19*/{NULL}, /*SPC 0x1a*/{dissect_spc_modesense6}, /*SPC 0x1b*/{NULL}, /*SPC 0x1c*/{NULL}, /*SPC 0x1d*/{dissect_spc_senddiagnostic}, /*SPC 0x1e*/{dissect_spc_preventallowmediaremoval}, /*SPC 0x1f*/{NULL}, /*SPC 0x20*/{NULL}, /*SPC 0x21*/{NULL}, /*SPC 0x22*/{NULL}, /*SPC 0x23*/{NULL}, /*SPC 0x24*/{NULL}, /*SPC 0x25*/{NULL}, /*SPC 0x26*/{NULL}, /*SPC 0x27*/{NULL}, /*SPC 0x28*/{NULL}, /*SPC 0x29*/{NULL}, /*SPC 0x2a*/{NULL}, /*SPC 0x2b*/{NULL}, /*SPC 0x2c*/{NULL}, /*SPC 0x2d*/{NULL}, /*SPC 0x2e*/{NULL}, /*SPC 0x2f*/{NULL}, /*SPC 0x30*/{NULL}, /*SPC 0x31*/{NULL}, /*SPC 0x32*/{NULL}, /*SPC 0x33*/{NULL}, /*SPC 0x34*/{NULL}, /*SPC 0x35*/{NULL}, /*SPC 0x36*/{NULL}, /*SPC 0x37*/{NULL}, /*SPC 0x38*/{NULL}, /*SPC 0x39*/{NULL}, /*SPC 0x3a*/{NULL}, /*SPC 0x3b*/{dissect_spc_writebuffer}, /*SPC 0x3c*/{NULL}, /*SPC 0x3d*/{NULL}, /*SPC 0x3e*/{NULL}, /*SPC 0x3f*/{NULL}, /*SPC 0x40*/{NULL}, /*SPC 0x41*/{NULL}, /*SPC 0x42*/{NULL}, /*SPC 0x43*/{NULL}, /*SPC 0x44*/{NULL}, /*SPC 0x45*/{NULL}, /*SPC 0x46*/{NULL}, /*SPC 0x47*/{NULL}, /*SPC 0x48*/{NULL}, /*SPC 0x49*/{NULL}, /*SPC 0x4a*/{NULL}, /*SPC 0x4b*/{NULL}, /*SPC 0x4c*/{dissect_spc_logselect}, /*SPC 0x4d*/{dissect_spc_logsense}, /*SPC 0x4e*/{NULL}, /*SPC 0x4f*/{NULL}, /*SPC 0x50*/{NULL}, /*SPC 0x51*/{NULL}, /*SPC 0x52*/{NULL}, /*SPC 0x53*/{NULL}, /*SPC 0x54*/{NULL}, /*SPC 0x55*/{dissect_spc_modeselect10}, /*SPC 0x56*/{dissect_spc_reserve10}, /*SPC 0x57*/{dissect_spc_release10}, /*SPC 0x58*/{NULL}, /*SPC 0x59*/{NULL}, /*SPC 0x5a*/{dissect_spc_modesense10}, /*SPC 0x5b*/{NULL}, /*SPC 0x5c*/{NULL}, /*SPC 0x5d*/{NULL}, /*SPC 0x5e*/{dissect_spc_persistentreservein}, /*SPC 0x5f*/{dissect_spc_persistentreserveout}, /*SPC 0x60*/{NULL}, /*SPC 0x61*/{NULL}, /*SPC 0x62*/{NULL}, /*SPC 0x63*/{NULL}, /*SPC 0x64*/{NULL}, /*SPC 0x65*/{NULL}, /*SPC 0x66*/{NULL}, /*SPC 0x67*/{NULL}, /*SPC 0x68*/{NULL}, /*SPC 0x69*/{NULL}, /*SPC 0x6a*/{NULL}, /*SPC 0x6b*/{NULL}, /*SPC 0x6c*/{NULL}, /*SPC 0x6d*/{NULL}, /*SPC 0x6e*/{NULL}, /*SPC 0x6f*/{NULL}, /*SPC 0x70*/{NULL}, /*SPC 0x71*/{NULL}, /*SPC 0x72*/{NULL}, /*SPC 0x73*/{NULL}, /*SPC 0x74*/{NULL}, /*SPC 0x75*/{NULL}, /*SPC 0x76*/{NULL}, /*SPC 0x77*/{NULL}, /*SPC 0x78*/{NULL}, /*SPC 0x79*/{NULL}, /*SPC 0x7a*/{NULL}, /*SPC 0x7b*/{NULL}, /*SPC 0x7c*/{NULL}, /*SPC 0x7d*/{NULL}, /*SPC 0x7e*/{NULL}, /*SPC 0x7f*/{dissect_scsi_varlencdb}, /*SPC 0x80*/{NULL}, /*SPC 0x81*/{NULL}, /*SPC 0x82*/{NULL}, /*SPC 0x83*/{dissect_spc_extcopy}, /*SPC 0x84*/{dissect_spc_recvcopy}, /*SPC 0x85*/{NULL}, /*SPC 0x86*/{NULL}, /*SPC 0x87*/{NULL}, /*SPC 0x88*/{NULL}, /*SPC 0x89*/{NULL}, /*SPC 0x8a*/{NULL}, /*SPC 0x8b*/{NULL}, /*SPC 0x8c*/{NULL}, /*SPC 0x8d*/{NULL}, /*SPC 0x8e*/{NULL}, /*SPC 0x8f*/{NULL}, /*SPC 0x90*/{NULL}, /*SPC 0x91*/{NULL}, /*SPC 0x92*/{NULL}, /*SPC 0x93*/{NULL}, /*SPC 0x94*/{NULL}, /*SPC 0x95*/{NULL}, /*SPC 0x96*/{NULL}, /*SPC 0x97*/{NULL}, /*SPC 0x98*/{NULL}, /*SPC 0x99*/{NULL}, /*SPC 0x9a*/{NULL}, /*SPC 0x9b*/{NULL}, /*SPC 0x9c*/{NULL}, /*SPC 0x9d*/{NULL}, /*SPC 0x9e*/{NULL}, /*SPC 0x9f*/{NULL}, /*SPC 0xa0*/{dissect_spc_reportluns}, /*SPC 0xa1*/{NULL}, /*SPC 0xa2*/{NULL}, /*SPC 0xa3*/{dissect_spc_reportdeviceidentifier}, /*SPC 0xa4*/{NULL}, /*SPC 0xa5*/{NULL}, /*SPC 0xa6*/{NULL}, /*SPC 0xa7*/{NULL}, /*SPC 0xa8*/{NULL}, /*SPC 0xa9*/{NULL}, /*SPC 0xaa*/{NULL}, /*SPC 0xab*/{NULL}, /*SPC 0xac*/{NULL}, /*SPC 0xad*/{NULL}, /*SPC 0xae*/{NULL}, /*SPC 0xaf*/{NULL}, /*SPC 0xb0*/{NULL}, /*SPC 0xb1*/{NULL}, /*SPC 0xb2*/{NULL}, /*SPC 0xb3*/{NULL}, /*SPC 0xb4*/{NULL}, /*SPC 0xb5*/{NULL}, /*SPC 0xb6*/{NULL}, /*SPC 0xb7*/{NULL}, /*SPC 0xb8*/{NULL}, /*SPC 0xb9*/{NULL}, /*SPC 0xba*/{NULL}, /*SPC 0xbb*/{NULL}, /*SPC 0xbc*/{NULL}, /*SPC 0xbd*/{NULL}, /*SPC 0xbe*/{NULL}, /*SPC 0xbf*/{NULL}, /*SPC 0xc0*/{NULL}, /*SPC 0xc1*/{NULL}, /*SPC 0xc2*/{NULL}, /*SPC 0xc3*/{NULL}, /*SPC 0xc4*/{NULL}, /*SPC 0xc5*/{NULL}, /*SPC 0xc6*/{NULL}, /*SPC 0xc7*/{NULL}, /*SPC 0xc8*/{NULL}, /*SPC 0xc9*/{NULL}, /*SPC 0xca*/{NULL}, /*SPC 0xcb*/{NULL}, /*SPC 0xcc*/{NULL}, /*SPC 0xcd*/{NULL}, /*SPC 0xce*/{NULL}, /*SPC 0xcf*/{NULL}, /*SPC 0xd0*/{NULL}, /*SPC 0xd1*/{NULL}, /*SPC 0xd2*/{NULL}, /*SPC 0xd3*/{NULL}, /*SPC 0xd4*/{NULL}, /*SPC 0xd5*/{NULL}, /*SPC 0xd6*/{NULL}, /*SPC 0xd7*/{NULL}, /*SPC 0xd8*/{NULL}, /*SPC 0xd9*/{NULL}, /*SPC 0xda*/{NULL}, /*SPC 0xdb*/{NULL}, /*SPC 0xdc*/{NULL}, /*SPC 0xdd*/{NULL}, /*SPC 0xde*/{NULL}, /*SPC 0xdf*/{NULL}, /*SPC 0xe0*/{NULL}, /*SPC 0xe1*/{NULL}, /*SPC 0xe2*/{NULL}, /*SPC 0xe3*/{NULL}, /*SPC 0xe4*/{NULL}, /*SPC 0xe5*/{NULL}, /*SPC 0xe6*/{NULL}, /*SPC 0xe7*/{NULL}, /*SPC 0xe8*/{NULL}, /*SPC 0xe9*/{NULL}, /*SPC 0xea*/{NULL}, /*SPC 0xeb*/{NULL}, /*SPC 0xec*/{NULL}, /*SPC 0xed*/{NULL}, /*SPC 0xee*/{NULL}, /*SPC 0xef*/{NULL}, /*SPC 0xf0*/{NULL}, /*SPC 0xf1*/{NULL}, /*SPC 0xf2*/{NULL}, /*SPC 0xf3*/{NULL}, /*SPC 0xf4*/{NULL}, /*SPC 0xf5*/{NULL}, /*SPC 0xf6*/{NULL}, /*SPC 0xf7*/{NULL}, /*SPC 0xf8*/{NULL}, /*SPC 0xf9*/{NULL}, /*SPC 0xfa*/{NULL}, /*SPC 0xfb*/{NULL}, /*SPC 0xfc*/{NULL}, /*SPC 0xfd*/{NULL}, /*SPC 0xfe*/{NULL}, /*SPC 0xff*/{NULL} }; /* This function must be called with valid pointers for both itlq and itl */ void dissect_scsi_cdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint devtype_arg _U_, itlq_nexus_t *itlq, itl_nexus_t *itl) { int offset = 0; proto_item *ti; proto_tree *scsi_tree = NULL; guint8 opcode; #if 0 scsi_device_type devtype; #endif const gchar *valstr; scsi_task_data_t *cdata; const char *old_proto; cmdset_t *csdata; old_proto = pinfo->current_proto; pinfo->current_proto="SCSI"; if (!itlq) { DISSECTOR_ASSERT_NOT_REACHED(); } if (!itl) { DISSECTOR_ASSERT_NOT_REACHED(); } opcode = tvb_get_guint8(tvb, offset); itlq->scsi_opcode = opcode; csdata = get_cmdset_data(pinfo->pool, itlq, itl); #if 0 /* XXX: devtype never actually used ?? */ if (devtype_arg != SCSI_DEV_UNKNOWN) { devtype = devtype_arg; } else { if (itl) { devtype = itl->cmdset; } else { devtype = (scsi_device_type)scsi_def_devtype; } } #endif if ((valstr = try_val_to_str_ext(opcode, &scsi_spc_vals_ext)) == NULL) { valstr = try_val_to_str_ext(opcode, csdata->cdb_vals_ext); } if (valstr != NULL) { col_add_fstr(pinfo->cinfo, COL_INFO, "SCSI: %s LUN: 0x%02x ", valstr, itlq->lun); } else { col_add_fstr(pinfo->cinfo, COL_INFO, "SCSI Command: 0x%02x LUN:0x%02x ", opcode, itlq->lun); } /* make sure no one will overwrite this in the info column */ col_set_fence(pinfo->cinfo, COL_INFO); cdata = wmem_new(pinfo->pool, scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_CDB; tap_queue_packet(scsi_tap, pinfo, cdata); if (tree) { ti = proto_tree_add_protocol_format(tree, proto_scsi, tvb, 0, -1, "SCSI CDB %s", val_to_str_ext(opcode, csdata->cdb_vals_ext, "0x%02x") ); scsi_tree = proto_item_add_subtree(ti, ett_scsi); } ti = proto_tree_add_uint(scsi_tree, hf_scsi_lun, tvb, 0, 0, itlq->lun); proto_item_set_generated(ti); if (itl) { ti = proto_tree_add_uint_format(scsi_tree, hf_scsi_inq_devtype, tvb, 0, 0, itl->cmdset&SCSI_CMDSET_MASK, "Command Set:%s (0x%02x) %s", val_to_str(itl->cmdset&SCSI_CMDSET_MASK, scsi_devtype_val, "Unknown (%d)"), itl->cmdset&SCSI_CMDSET_MASK,itl->cmdset&SCSI_CMDSET_DEFAULT?"(Using default commandset)":""); proto_item_set_generated(ti); } if (itlq->last_exchange_frame) { ti = proto_tree_add_uint(scsi_tree, hf_scsi_response_frame, tvb, 0, 0, itlq->last_exchange_frame); proto_item_set_generated(ti); } if (valstr != NULL) { proto_tree_add_uint_format(scsi_tree, csdata->hf_opcode, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Opcode: %s (0x%02x)", valstr, opcode); } else { proto_tree_add_item(scsi_tree, hf_scsi_spcopcode, tvb, offset, 1, ENC_BIG_ENDIAN); } if (csdata->cdb_table[opcode].func) { csdata->cdb_table[opcode].func(tvb, pinfo, scsi_tree, offset+1, TRUE, TRUE, 0, cdata); } else if (spc[opcode].func) { spc[opcode].func(tvb, pinfo, scsi_tree, offset+1, TRUE, TRUE, 0, cdata); } else { call_data_dissector(tvb, pinfo, scsi_tree); } pinfo->current_proto = old_proto; } void dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean isreq, itlq_nexus_t *itlq, itl_nexus_t *itl, guint32 relative_offset) { int offset = 0; proto_item *ti; proto_tree *scsi_tree = NULL; guint8 opcode; scsi_task_data_t *cdata; int payload_len; const char *old_proto; cmdset_t *csdata; guint32 expected_length; fragment_head *ipfd_head; tvbuff_t *next_tvb = tvb; gboolean update_col_info = TRUE; gboolean more_frags = FALSE; if (!itlq || !itl) { /* we have no record of this exchange and so we can't dissect the * payload */ expert_add_info(pinfo, tree, &ei_scsi_unknown_scsi_exchange); return; } payload_len = tvb_reported_length(tvb); cdata = wmem_new(pinfo->pool, scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_CDB; tap_queue_packet(scsi_tap, pinfo, cdata); csdata = get_cmdset_data(pinfo->pool, itlq, itl); old_proto = pinfo->current_proto; pinfo->current_proto="SCSI"; opcode = (guint8) cdata->itlq->scsi_opcode; if (tree) { ti = proto_tree_add_protocol_format(tree, proto_scsi, tvb, offset, payload_len, "SCSI Payload (%s %s)", val_to_str_ext(opcode, csdata->cdb_vals_ext, "CDB:0x%02x"), isreq ? "Request Data" : "Response Data"); scsi_tree = proto_item_add_subtree(ti, ett_scsi); } col_add_fstr(pinfo->cinfo, COL_INFO, "SCSI: Data %s LUN: 0x%02x (%s %s) ", isreq ? "Out" : "In", itlq->lun, val_to_str_ext(opcode, csdata->cdb_vals_ext, "0x%02x"), isreq ? "Request Data" : "Response Data"); col_set_fence(pinfo->cinfo, COL_INFO); ti = proto_tree_add_uint(scsi_tree, hf_scsi_lun, tvb, 0, 0, itlq->lun); proto_item_set_generated(ti); if (itl) { ti = proto_tree_add_uint_format(scsi_tree, hf_scsi_inq_devtype, tvb, 0, 0, itl->cmdset&SCSI_CMDSET_MASK, "Command Set:%s (0x%02x) %s", val_to_str(itl->cmdset&SCSI_CMDSET_MASK, scsi_devtype_val, "Unknown (%d)"), itl->cmdset&SCSI_CMDSET_MASK, itl->cmdset&SCSI_CMDSET_DEFAULT ? "(Using default commandset)" : ""); proto_item_set_generated(ti); if (itlq && (itlq->scsi_opcode != 0xffff)) { ti = proto_tree_add_uint(scsi_tree, csdata->hf_opcode, tvb, 0, 0, itlq->scsi_opcode); proto_item_set_generated(ti); } } if (itlq->first_exchange_frame) { ti = proto_tree_add_uint(scsi_tree, hf_scsi_request_frame, tvb, 0, 0, itlq->first_exchange_frame); proto_item_set_generated(ti); } if (itlq->last_exchange_frame) { ti = proto_tree_add_uint(scsi_tree, hf_scsi_response_frame, tvb, 0, 0, itlq->last_exchange_frame); proto_item_set_generated(ti); } /* If we don't know the CDB opcode there is no point in trying to * dissect the data. */ if ( !itlq->first_exchange_frame ) { call_data_dissector(tvb, pinfo, scsi_tree); goto end_of_payload; } /* If we are not doing data reassembly we only call the dissector * for the very first data in/out pdu in each transfer */ if (!scsi_defragment) { if (relative_offset) { call_data_dissector(tvb, pinfo, scsi_tree); goto end_of_payload; } else { goto dissect_the_payload; } } /* If we don't have the entire PDU there is no point in even trying * reassembly */ if (tvb_captured_length_remaining(tvb, offset) != tvb_reported_length_remaining(tvb, offset)) { if (relative_offset) { call_data_dissector(tvb, pinfo, scsi_tree); goto end_of_payload; } else { goto dissect_the_payload; } } /* What is the expected data length for this transfer */ if ( (itlq->task_flags&(SCSI_DATA_READ|SCSI_DATA_WRITE)) == (SCSI_DATA_READ|SCSI_DATA_WRITE) ) { /* This is a bidirectional transfer */ if (isreq) { expected_length = itlq->data_length; } else { expected_length = itlq->bidir_data_length; } } else { /* This is a unidirectional transfer */ expected_length = itlq->data_length; } /* If this PDU already contains all the expected data we don't have to do * reassembly. */ if ( (!relative_offset) && ((guint32)tvb_reported_length_remaining(tvb, offset) == expected_length) ) { goto dissect_the_payload; } /* Start reassembly */ if (tvb_reported_length_remaining(tvb, offset) < 0) { goto end_of_payload; } if ((tvb_reported_length_remaining(tvb,offset) + relative_offset) != expected_length) { more_frags = TRUE; } ipfd_head = fragment_add_check(&scsi_reassembly_table, tvb, offset, pinfo, itlq->first_exchange_frame, /* key */ NULL, relative_offset, tvb_reported_length_remaining(tvb, offset), more_frags); next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled SCSI DATA", ipfd_head, &scsi_frag_items, &update_col_info, tree); if ( ipfd_head && (ipfd_head->reassembled_in != pinfo->num) ) { col_prepend_fstr(pinfo->cinfo, COL_INFO, "[Reassembled in #%u] ", ipfd_head->reassembled_in); } dissect_the_payload: if (!next_tvb) { /* reassembly has not yet finished so we don't have a tvb yet */ goto end_of_payload; } if (tree == NULL) { /* * We have to dissect INQUIRY responses, in order to determine the * types of devices. * * We don't bother dissecting other payload if we're not building * a protocol tree. * * We assume opcode 0x12 is always INQUIRY regardless of the * commandset used. */ if (opcode == SCSI_SPC_INQUIRY) { dissect_spc_inquiry(next_tvb, pinfo, scsi_tree, offset, isreq, FALSE, payload_len, cdata); } } else { /* All commandsets support SPC? */ if (csdata->cdb_table && (csdata->cdb_table)[opcode].func) { (csdata->cdb_table)[opcode].func(next_tvb, pinfo, scsi_tree, offset, isreq, FALSE, payload_len, cdata); } else if (spc[opcode].func) { spc[opcode].func(next_tvb, pinfo, scsi_tree, offset, isreq, FALSE, payload_len, cdata); } else { /* don't know this CDB */ call_data_dissector(next_tvb, pinfo, scsi_tree); } } end_of_payload: pinfo->current_proto = old_proto; } static cmdset_t * get_cmdset_data(wmem_allocator_t *pool, itlq_nexus_t *itlq, itl_nexus_t *itl) { cmdset_t *csdata; guint8 cmdset; /* we must have an itlq structure */ if (!itlq) { DISSECTOR_ASSERT_NOT_REACHED(); } if (itl) { if (itl->cmdset == 0xff) { itl->cmdset = scsi_def_devtype|SCSI_CMDSET_DEFAULT; } cmdset = itl->cmdset; } else { cmdset = scsi_def_devtype; } csdata = wmem_new(pool, cmdset_t); switch(cmdset&SCSI_CMDSET_MASK) { case SCSI_DEV_SBC: csdata->hf_opcode = hf_scsi_sbc_opcode; csdata->cdb_vals_ext = &scsi_sbc_vals_ext; csdata->cdb_table = scsi_sbc_table; break; case SCSI_DEV_CDROM: csdata->hf_opcode = hf_scsi_mmc_opcode; csdata->cdb_vals_ext = &scsi_mmc_vals_ext; csdata->cdb_table = scsi_mmc_table; break; case SCSI_DEV_SSC: csdata->hf_opcode = hf_scsi_ssc_opcode; csdata->cdb_vals_ext = &scsi_ssc_vals_ext; csdata->cdb_table = scsi_ssc_table; break; case SCSI_DEV_SMC: csdata->hf_opcode = hf_scsi_smc_opcode; csdata->cdb_vals_ext = &scsi_smc_vals_ext; csdata->cdb_table = scsi_smc_table; break; case SCSI_DEV_OSD: csdata->hf_opcode = hf_scsi_osd_opcode; csdata->cdb_vals_ext = &scsi_osd_vals_ext; csdata->cdb_table = scsi_osd_table; break; default: csdata->hf_opcode = hf_scsi_spcopcode; csdata->cdb_vals_ext = &scsi_spc_vals_ext; csdata->cdb_table = spc; break; } return csdata; } void proto_register_scsi(void) { static hf_register_info hf[] = { { &hf_scsi_status, { "Status", "scsi.status", FT_UINT8, BASE_HEX, VALS(scsi_status_val), 0, "SCSI command status value", HFILL }}, { &hf_scsi_spcopcode, {"SPC-2 Opcode", "scsi.spc.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_spc_vals_ext, 0x0, NULL, HFILL}}, { &hf_scsi_control, {"Control", "scsi.cdb.control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_control_vendor_specific, {"Vendor specific", "scsi.cdb.control.vendorspecific", FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}}, { &hf_scsi_control_reserved, {"Reserved", "scsi.cdb.control.reserved", FT_UINT8, BASE_HEX, NULL, 0x38, NULL, HFILL}}, { &hf_scsi_control_naca, {"NACA", "scsi.cdb.control.naca", FT_BOOLEAN, 8, TFS(&scsi_naca_tfs), 0x04, NULL, HFILL}}, { &hf_scsi_control_obs1, {"Obsolete", "scsi.cdb.control.obs1", FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_control_obs2, {"Obsolete", "scsi.cdb.control.obs2", FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_inq_control, {"Control", "scsi.cdb.inq.control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_inquiry_flags, {"Inquiry Flags", "scsi.inquiry.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_inquiry_evpd_page, {"EVPD Page Code", "scsi.inquiry.evpd.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_evpd_pagecode_val), 0x0, NULL, HFILL}}, { &hf_scsi_inquiry_cmdt_page, {"CMDT Page Code", "scsi.inquiry.cmdt.pagecode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_alloclen, {"Allocation Length", "scsi.cdb.alloclen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_paramlen, {"Parameter Length", "scsi.cdb.paramlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_log_pc, {"Page Control", "scsi.log.pc", FT_UINT8, BASE_DEC, VALS(scsi_log_pc_val), 0xC0, NULL, HFILL}}, { &hf_scsi_log_pagecode, {"Page Code", "scsi.log.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_log_page_val), 0x3F, NULL, HFILL}}, { &hf_scsi_paramlen16, {"Parameter Length", "scsi.cdb.paramlen16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_modesel_flags, {"Mode Sense/Select Flags", "scsi.cdb.mode.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_alloclen16, {"Allocation Length", "scsi.cdb.alloclen16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_modesns_pc, {"Page Control", "scsi.mode.pc", FT_UINT8, BASE_DEC, VALS(scsi_modesns_pc_val), 0xC0, NULL, HFILL}}, { &hf_scsi_spc_subpagecode, {"SubPage Code", "scsi.mode.spc.subpagecode", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_spc_pagecode, {"SPC-2 Page Code", "scsi.mode.spc.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_spc_modepage_val), 0x3F, NULL, HFILL}}, { &hf_scsi_sbcpagecode, {"SBC-2 Page Code", "scsi.mode.sbc.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_sbc_modepage_val), 0x3F, NULL, HFILL}}, { &hf_scsi_sscpagecode, {"SSC-2 Page Code", "scsi.mode.ssc.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_ssc2_modepage_val), 0x3F, NULL, HFILL}}, { &hf_scsi_mmcpagecode, {"MMC-5 Page Code", "scsi.mode.mmc.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_mmc5_modepage_val), 0x3F, NULL, HFILL}}, { &hf_scsi_smcpagecode, {"SMC-2 Page Code", "scsi.mode.smc.pagecode", FT_UINT8, BASE_HEX, VALS(scsi_smc_modepage_val), 0x3F, NULL, HFILL}}, { &hf_scsi_modesns_flags, {"Mode Sense Flags", "scsi.mode.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresvin_svcaction, {"Service Action", "scsi.persresvin.svcaction", FT_UINT8, BASE_HEX, VALS(scsi_persresvin_svcaction_val), 0x1F, NULL, HFILL}}, { &hf_scsi_persresvout_svcaction, {"Service Action", "scsi.persresvout.svcaction", FT_UINT8, BASE_HEX, VALS(scsi_persresvout_svcaction_val), 0x1F, NULL, HFILL}}, { &hf_scsi_persresv_scope, {"Reservation Scope", "scsi.persresv.scope", FT_UINT8, BASE_HEX, VALS(scsi_persresv_scope_val), 0xF0, NULL, HFILL}}, { &hf_scsi_persresv_type, {"Reservation Type", "scsi.persresv.type", FT_UINT8, BASE_HEX, VALS(scsi_persresv_type_val), 0x0F, NULL, HFILL}}, { &hf_scsi_persresvout_reskey, {"Reservation Key", "scsi.persresv.reskey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresvout_sareskey, {"Service Action Reservation Key", "scsi.persresv.sareskey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresvout_obsolete, {"Obsolete", "scsi.presresv.obs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresvout_control, {"Control", "scsi.presresv.control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, /* Service action REGISTER AND MOVE */ { &hf_scsi_persresv_control_rsvd, {"Reserved", "scsi.persresv.control.reserved", FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL}}, { &hf_scsi_persresv_control_unreg, {"unreg", "scsi.persresv.control.unreg", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, /* Other service actions than REGISTER AND MOVE */ { &hf_scsi_persresv_control_rsvd1, {"Reserved", "scsi.persresv.control.reserved1", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}}, { &hf_scsi_persresv_control_rsvd2, {"Reserved", "scsi.persresv.control.reserved2", FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_persresv_control_spec_i_pt, {"SPEC_I_PT", "scsi.persresv.control.spec_i_pt", FT_BOOLEAN, 8, TFS(&scsi_spec_i_pt_tfs), 0x08, NULL, HFILL}}, { &hf_scsi_persresv_control_all_tg_pt, {"ALL_TG_PT", "scsi.persresv.control.all_tg_pt", FT_BOOLEAN, 8, TFS(&scsi_all_tg_pt_tfs), 0x04, NULL, HFILL}}, { &hf_scsi_persresv_control_aptpl, {"aptpl", "scsi.persresv.control.aptpl", FT_BOOLEAN, 8, TFS(&scsi_aptpl_tfs), 0x01, NULL, HFILL}}, { &hf_scsi_persresvout_rel_tpi, {"rel_tpi", "scsi.persresv.rel_tpi", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresvout_transportid_len, {"transportid_len", "scsi.persresv.transportid_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresvout_transportid, {"transportid_len", "scsi.persresv.transportid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_release_flags, {"Release Flags", "scsi.release.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_release_thirdpartyid, {"Third-Party ID", "scsi.release.thirdpartyid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_alloclen32, {"Allocation Length", "scsi.cdb.alloclen32", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_inq_add_len, {"Additional Length", "scsi.inquiry.add_len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_qualifier, {"Qualifier", "scsi.inquiry.qualifier", FT_UINT8, BASE_HEX, VALS(scsi_qualifier_val), 0xE0, NULL, HFILL}}, { &hf_scsi_inq_peripheral, {"Peripheral", "scsi.inquiry.peripheral", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_vendor_id, {"Vendor Id", "scsi.inquiry.vendor_id", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_product_id, {"Product Id", "scsi.inquiry.product_id", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_product_rev, {"Product Revision Level", "scsi.inquiry.product_rev", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_vendor_specific, {"Vendor Specific", "scsi.inquiry.vendor_specific", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_version_desc, {"Version Description", "scsi.inquiry.version_desc", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &scsi_verdesc_val_ext, 0, NULL, HFILL}}, { &hf_scsi_inq_devtype, {"Device Type", "scsi.inquiry.devtype", FT_UINT8, BASE_HEX, VALS(scsi_devtype_val), SCSI_DEV_BITS, NULL, HFILL}}, { &hf_scsi_inq_rmb, {"Removable", "scsi.inquiry.removable", FT_BOOLEAN, 8, TFS(&scsi_removable_val), 0x80, NULL, HFILL}}, { &hf_scsi_inq_version, {"Version", "scsi.inquiry.version", FT_UINT8, BASE_HEX, VALS(scsi_inquiry_vers_val), 0x0, NULL, HFILL}}, { &hf_scsi_inq_reladrflags, {"Inquiry RelAdr Flags", "scsi.inquiry.reladrflags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_reladr, {"RelAdr", "scsi.inquiry.reladr", FT_BOOLEAN, 8, TFS(&reladr_tfs), SCSI_INQ_RELADRFLAGS_RELADR, NULL, HFILL}}, { &hf_scsi_inq_linked, {"Linked", "scsi.inquiry.linked", FT_BOOLEAN, 8, TFS(&linked_tfs), SCSI_INQ_RELADRFLAGS_LINKED, NULL, HFILL}}, { &hf_scsi_inq_trandis, {"TranDis", "scsi.inquiry.trandis", FT_BOOLEAN, 8, NULL, SCSI_INQ_RELADRFLAGS_TRANDIS, NULL, HFILL}}, { &hf_scsi_inq_cmdque, {"CmdQue", "scsi.inquiry.cmdque", FT_BOOLEAN, 8, TFS(&cmdque_tfs), SCSI_INQ_RELADRFLAGS_CMDQUE, NULL, HFILL}}, { &hf_scsi_inq_bqueflags, {"Inquiry BQue Flags", "scsi.inquiry.bqueflags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_bque, {"BQue", "scsi.inquiry.bque", FT_BOOLEAN, 8, TFS(&bque_tfs), SCSI_INQ_BQUEFLAGS_BQUE, NULL, HFILL}}, { &hf_scsi_inq_encserv, {"EncServ", "scsi.inquiry.encserv", FT_BOOLEAN, 8, TFS(&encserv_tfs), SCSI_INQ_BQUEFLAGS_ENCSERV, NULL, HFILL}}, { &hf_scsi_inq_multip, {"MultiP", "scsi.inquiry.multip", FT_BOOLEAN, 8, TFS(&multip_tfs), SCSI_INQ_BQUEFLAGS_MULTIP, NULL, HFILL}}, { &hf_scsi_inq_mchngr, {"MChngr", "scsi.inquiry.mchngr", FT_BOOLEAN, 8, TFS(&mchngr_tfs), SCSI_INQ_BQUEFLAGS_MCHNGR, NULL, HFILL}}, { &hf_scsi_inq_ackreqq, {"ACKREQQ", "scsi.inquiry.ackreqq", FT_BOOLEAN, 8, NULL, SCSI_INQ_BQUEFLAGS_ACKREQQ, NULL, HFILL}}, { &hf_scsi_inq_sccsflags, {"Inquiry SCCS Flags", "scsi.inquiry.sccsflags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_sccs, {"SCCS", "scsi.inquiry.sccs", FT_BOOLEAN, 8, TFS(&sccs_tfs), SCSI_INQ_SCCSFLAGS_SCCS, NULL, HFILL}}, { &hf_scsi_inq_acc, {"ACC", "scsi.inquiry.acc", FT_BOOLEAN, 8, TFS(&acc_tfs), SCSI_INQ_SCCSFLAGS_ACC, NULL, HFILL}}, { &hf_scsi_inq_tpc, {"3PC", "scsi.inquiry.tpc", FT_BOOLEAN, 8, TFS(&tpc_tfs), SCSI_INQ_SCCSFLAGS_TPC, NULL, HFILL}}, { &hf_scsi_inq_protect, {"Protect", "scsi.inquiry.protect", FT_BOOLEAN, 8, TFS(&protect_tfs), SCSI_INQ_SCCSFLAGS_PROTECT, NULL, HFILL}}, { &hf_scsi_inq_tpgs, {"TPGS", "scsi.inquiry.tpgs", FT_UINT8, BASE_DEC, VALS(inq_tpgs_vals), 0x30, NULL, HFILL}}, { &hf_scsi_inq_acaflags, {"Inquiry ACA Flags", "scsi.inquiry.acaflags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_control_vendor_specific, {"Vendor specific", "scsi.inquiry.control.vendorspecific", FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}}, { &hf_scsi_inq_control_reserved, {"Reserved", "scsi.inquiry.control.reserved", FT_UINT8, BASE_HEX, NULL, 0x38, NULL, HFILL}}, { &hf_scsi_inq_control_naca, {"NACA", "scsi.inquiry.control.naca", FT_BOOLEAN, 8, TFS(&scsi_naca_tfs), 0x04, NULL, HFILL}}, { &hf_scsi_inq_control_obs1, {"Obsolete", "scsi.inquiry.control.obs1", FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_inq_control_obs2, {"Obsolete", "scsi.inquiry.control.obs2", FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_inq_rmbflags, {"Inquiry RMB Flags", "scsi.inquiry.rmbflags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_inq_normaca, {"NormACA", "scsi.inquiry.normaca", FT_BOOLEAN, 8, TFS(&normaca_tfs), SCSI_INQ_ACAFLAGS_NORMACA, NULL, HFILL}}, { &hf_scsi_inq_hisup, {"HiSup", "scsi.inquiry.hisup", FT_BOOLEAN, 8, TFS(&hisup_tfs), SCSI_INQ_ACAFLAGS_HISUP, NULL, HFILL}}, { &hf_scsi_inq_aerc, {"AERC", "scsi.inquiry.aerc", FT_BOOLEAN, 8, TFS(&aerc_tfs), SCSI_INQ_ACAFLAGS_AERC, "AERC is obsolete from SPC-3 and forward", HFILL}}, { &hf_scsi_inq_trmtsk, {"TrmTsk", "scsi.inquiry.trmtsk", FT_BOOLEAN, 8, TFS(&trmtsk_tfs), SCSI_INQ_ACAFLAGS_TRMTSK, "TRMTSK is obsolete from SPC-2 and forward", HFILL}}, { &hf_scsi_inq_rdf, {"Response Data Format", "scsi.inquiry.rdf", FT_UINT8, BASE_DEC, VALS(inq_rdf_vals), 0x0f, NULL, HFILL}}, { &hf_scsi_modesns_errrep, {"MRIE", "scsi.mode.mrie", FT_UINT8, BASE_HEX, VALS(scsi_modesns_mrie_val), 0x0F, NULL, HFILL}}, { &hf_scsi_modesns_tst, {"Task Set Type", "scsi.mode.tst", FT_UINT8, BASE_DEC, VALS(scsi_modesns_tst_val), 0xE0, NULL, HFILL}}, { &hf_scsi_modesns_qmod, {"Queue Algorithm Modifier", "scsi.mode.qmod", FT_UINT8, BASE_HEX, VALS(scsi_modesns_qmod_val), 0xF0, NULL, HFILL}}, { &hf_scsi_modesns_qerr, {"Queue Error Management", "scsi.mode.qerr", FT_BOOLEAN, 8, TFS(&scsi_modesns_qerr_val), 0x2, NULL, HFILL}}, { &hf_scsi_modesns_tas, {"Task Aborted Status", "scsi.mode.tac", FT_BOOLEAN, 8, TFS(&scsi_modesns_tas_val), 0x80, NULL, HFILL}}, { &hf_scsi_modesns_rac, {"Report a Check", "scsi.mode.rac", FT_BOOLEAN, 8, TFS(&scsi_modesns_rac_val), 0x40, NULL, HFILL}}, { &hf_scsi_protocol, {"Protocol", "scsi.proto", FT_UINT8, BASE_DEC, VALS(scsi_proto_val), 0x0F, NULL, HFILL}}, { &hf_scsi_sns_errtype, {"SNS Error Type", "scsi.sns.errtype", FT_UINT8, BASE_HEX, VALS(scsi_sns_errtype_val), 0x7F, NULL, HFILL}}, { &hf_scsi_snskey, {"Sense Key", "scsi.sns.key", FT_UINT8, BASE_HEX, VALS(scsi_sensekey_val), 0x0F, NULL, HFILL}}, { &hf_scsi_snsinfo, {"Sense Info", "scsi.sns.info", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_addlsnslen, {"Additional Sense Length", "scsi.sns.addlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_asc, {"Additional Sense Code", "scsi.sns.asc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ascq, {"Additional Sense Code Qualifier", "scsi.sns.ascq", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_ascascq, {"Additional Sense Code+Qualifier", "scsi.sns.ascascq", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &scsi_asc_val_ext, 0x0, NULL, HFILL}}, { &hf_scsi_fru, {"Field Replaceable Unit Code", "scsi.sns.fru", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_sksv, {"SKSV", "scsi.sns.sksv", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_sks_info, {"Sense Key Specific", "scsi.sns.sks_info", FT_UINT24, BASE_HEX, NULL, 0x7FFFFF, NULL, HFILL}}, { &hf_scsi_sks_fp_cd, {"Command/Data", "scsi.sns.sks.fp.cd", FT_UINT24, BASE_HEX, VALS(scsi_sense_sks_fp_cd_val), 0x400000, NULL, HFILL}}, { &hf_scsi_sks_fp_bpv, {"Bit pointer valid", "scsi.sns.sks.fp.bpv", FT_BOOLEAN, 24, NULL, 0x080000, NULL, HFILL}}, { &hf_scsi_sks_fp_bit, {"Bit pointer", "scsi.sns.sks.fp.bit", FT_UINT24, BASE_DEC, NULL, 0x070000, NULL, HFILL}}, { &hf_scsi_sks_fp_field, {"Field pointer", "scsi.sns.sks.fp.field", FT_UINT24, BASE_DEC, NULL, 0x00FFFF, NULL, HFILL}}, { &hf_scsi_sns_desc_type, {"Sense data descriptor type", "scsi.sns.desc.type", FT_UINT8, BASE_HEX, VALS(scsi_sense_desc_type_val), 0, NULL, HFILL}}, { &hf_scsi_sns_desc_length, {"Sense data descriptor length", "scsi.sns.desc.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sns_osd_object_not_initiated, {"Not initiated", "scsi.sns.desc.osd_object.not_initiated", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sns_osd_object_completed, {"Completed", "scsi.sns.desc.osd_object.completed", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sns_osd_object_validation, {"VALIDATION", "scsi.sns.desc.osd_object.validation", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL}}, { &hf_scsi_sns_osd_object_cmd_cap_v, {"CMD_CAP_V", "scsi.sns.desc.osd_object.cmd_cap_v", FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL}}, { &hf_scsi_sns_osd_object_command, {"COMMAND", "scsi.sns.desc.osd_object.command", FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL}}, { &hf_scsi_sns_osd_object_imp_st_att, {"IMP_ST_ATT", "scsi.sns.desc.osd_object.imp_st_att", FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL}}, { &hf_scsi_sns_osd_object_sa_cap_v, {"SA_CAP_V", "scsi.sns.desc.osd_object.sa_cap_v", FT_BOOLEAN, 32, NULL, 0x00002000, NULL, HFILL}}, { &hf_scsi_sns_osd_object_set_att, {"SET_ATT", "scsi.sns.desc.osd_object.set_att", FT_BOOLEAN, 32, NULL, 0x00001000, NULL, HFILL}}, { &hf_scsi_sns_osd_object_ga_cap_v, {"GA_CAP_V", "scsi.sns.desc.osd_object.ga_cap_v", FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL}}, { &hf_scsi_sns_osd_object_get_att, {"GET_ATT", "scsi.sns.desc.osd_object.get_att", FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL}}, { &hf_scsi_sns_osd_partition_id, {"Partition ID", "scsi.sns.desc.osd_object.partition_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sns_osd_object_id, {"Object ID", "scsi.sns.desc.osd_object.object_id", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_sns_osd_attr_page, {"Attribute page", "scsi.sns.desc.osd_attr.page", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &attributes_page_vals_ext, 0, NULL, HFILL}}, { &hf_scsi_sns_osd_attr_number, {"Attribute number", "scsi.sns.desc.osd_attr.number", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_persresv_key, {"Reservation Key", "scsi.spc.resv.key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_persresv_scopeaddr, {"Scope Address", "scsi.spc.resv.scopeaddr", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_add_cdblen, {"Additional CDB Length", "scsi.spc.addcdblen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_svcaction, {"Service Action", "scsi.spc.svcaction", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_wb_mode, {"Mode", "scsi.spc.wb.mode", FT_UINT8, BASE_HEX, VALS(scsi_wb_mode_val), 0xF, NULL, HFILL}}, { &hf_scsi_wb_bufferid, {"Buffer ID", "scsi.spc.sb.bufid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_wb_bufoffset, {"Buffer Offset", "scsi.spc.wb.bufoff", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_paramlen24, {"Parameter List Length", "scsi.cdb.paramlen24", FT_UINT24, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_scsi_senddiag_st_code, {"Self-Test Code", "scsi.spc.senddiag.code", FT_UINT8, BASE_HEX, VALS(scsi_senddiag_st_code_val), 0xE0, NULL, HFILL}}, { &hf_scsi_select_report, {"Select Report", "scsi.spc.select_report", FT_UINT8, BASE_HEX, VALS(scsi_select_report_val), 0x00, NULL, HFILL}}, { &hf_scsi_senddiag_pf, {"PF", "scsi.spc.senddiag.pf", FT_BOOLEAN, 8, TFS(&scsi_senddiag_pf_val), 0x10, NULL, HFILL}}, { &hf_scsi_senddiag_st, {"Self Test", "scsi.spc.senddiag.st", FT_BOOLEAN, 8, NULL, 0x4, NULL, HFILL}}, { &hf_scsi_senddiag_devoff, {"Device Offline", "scsi.spc.senddiag.devoff", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL}}, { &hf_scsi_senddiag_unitoff, {"Unit Offline", "scsi.spc.senddiag.unitoff", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL}}, { &hf_scsi_request_frame, { "Request in", "scsi.request_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The request to this transaction is in this frame", HFILL }}, { &hf_scsi_time, { "Time from request", "scsi.time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0, "Time between the Command and the Response", HFILL }}, { &hf_scsi_response_frame, { "Response in", "scsi.response_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The response to this transaction is in this frame", HFILL }}, { &hf_scsi_fragments, { "SCSI Fragments", "scsi.fragments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_fragment_overlap, { "Fragment overlap", "scsi.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL }}, { &hf_scsi_fragment_overlap_conflict, { "Conflicting data in fragment overlap", "scsi.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL }}, { &hf_scsi_fragment_multiple_tails, { "Multiple tail fragments found", "scsi.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL }}, { &hf_scsi_fragment_too_long_fragment, { "Fragment too long", "scsi.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL }}, { &hf_scsi_fragment_error, { "Defragmentation error", "scsi.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL }}, { &hf_scsi_fragment_count, { "Fragment count", "scsi.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_fragment, { "SCSI DATA Fragment", "scsi.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reassembled_in, { "Reassembled SCSI DATA in frame", "scsi.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This SCSI DATA packet is reassembled in this frame", HFILL }}, { &hf_scsi_reassembled_length, { "Reassembled SCSI DATA length", "scsi.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL }}, { &hf_scsi_log_ppc_flags, {"PPC Flags", "scsi.log.ppc.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_ppc, {"PPC", "scsi.log.ppc", FT_BOOLEAN, 8, TFS(&scsi_log_ppc_tfs), 0x02, NULL, HFILL}}, { &hf_scsi_log_pcr, {"PCR", "scsi.log.pcr", FT_BOOLEAN, 8, TFS(&scsi_log_pcr_tfs), 0x02, NULL, HFILL}}, { &hf_scsi_log_sp, {"SP", "scsi.log.sp", FT_BOOLEAN, 8, TFS(&scsi_log_sp_tfs), 0x01, NULL, HFILL}}, { &hf_scsi_log_pc_flags, {"PC Flags", "scsi.log.pc.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_parameter_ptr, {"Parameter Pointer", "scsi.log.param_ptr", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_page_length, {"Page Length", "scsi.log.page_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_parameter_code, {"Parameter Code", "scsi.log.parameter_code", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_param_flags, {"Param Flags", "scsi.log.param.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_param_len, {"Parameter Len", "scsi.log.param_len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_param_data, {"Parameter Data", "scsi.log.param_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_log_pf_du, {"DU", "scsi.log.pf.du", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_log_pf_ds, {"DS", "scsi.log.pf.ds", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_log_pf_tsd, {"TSD", "scsi.log.pf.tsd", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_log_pf_etc, {"ETC", "scsi.log.pf.etc", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, { &hf_scsi_log_pf_tmc, {"TMC", "scsi.log.pf.tmc", FT_UINT8, BASE_HEX, VALS(log_flags_tmc_vals), 0x0c, NULL, HFILL}}, { &hf_scsi_log_pf_lbin, {"LBIN", "scsi.log.pf.lbin", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_log_pf_lp, {"LP", "scsi.log.pf.lp", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_rw, {"Read Warning", "scsi.log.ta.rw", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_ww, {"write warning", "scsi.log.ta.ww", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_he, {"hard error", "scsi.log.ta.he", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_media, {"media", "scsi.log.ta.media", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_rf, {"read failure", "scsi.log.ta.rf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_wf, {"write failure", "scsi.log.ta.wf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_ml, {"media life", "scsi.log.ta.ml", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_ndg, {"not data grade", "scsi.log.ta.ndg", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_wp, {"write protect", "scsi.log.ta.wp", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_nr, {"no removal", "scsi.log.ta.nr", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_cm, {"cleaning media", "scsi.log.ta.cm", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_uf, {"unsupported format", "scsi.log.ta.uf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_rmcf, {"removable mechanical cartridge failure", "scsi.log.ta.rmcf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_umcf, {"unrecoverable mechanical cartridge failure", "scsi.log.ta.umcf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_mcicf, {"memory chip in cartridge failure", "scsi.log.ta.mcicf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_fe, {"forced eject", "scsi.log.ta.fe", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_rof, {"read only format", "scsi.log.ta.rof", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_tdcol, {"tape directory corrupted on load", "scsi.log.ta.tdcol", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_nml, {"nearing media life", "scsi.log.ta.nml", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_cn, {"clean now", "scsi.log.ta.cn", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_cp, {"clean periodic", "scsi.log.ta.cp", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_ecm, {"expired cleaning media", "scsi.log.ta.ecm", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_ict, {"invalid cleaning tape", "scsi.log.ta.ict", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_rr, {"retention requested", "scsi.log.ta.rr", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_dpie, {"dual port interface error", "scsi.log.ta.dpie", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_cff, {"cooling fan failure", "scsi.log.ta.cff", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_psf, {"power supply failure", "scsi.log.ta.psf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_pc, {"power consumption", "scsi.log.ta.pc", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_dm, {"drive maintenance", "scsi.log.ta.dm", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_hwa, {"hardware a", "scsi.log.ta.hwa", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_hwb, {"hardware b", "scsi.log.ta.hwb", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_if, {"interface", "scsi.log.ta.if", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_em, {"eject media", "scsi.log.ta.em", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_dwf, {"download failed", "scsi.log.ta.dwf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_drhu, {"drive humidity", "scsi.log.ta.drhu", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_drtm, {"drive temperature", "scsi.log.ta.drtm", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_drvo, {"drive voltage", "scsi.log.ta.drvo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_pefa, {"periodic failure", "scsi.log.ta.pefa", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_dire, {"diagnostics required", "scsi.log.ta.dire", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_lost, {"lost statistics", "scsi.log.ta.lost", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_tduau, {"tape directory invalid at unload", "scsi.log.ta.tduau", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_tsawf, {"tape system area write failure", "scsi.log.ta.tsawf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_tsarf, {"tape system area read failure", "scsi.log.ta.tsarf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_nsod, {"no start of data", "scsi.log.ta.nsod", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_lofa, {"loading failure", "scsi.log.ta.lofa", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_uuf, {"unrecoverable unload failure", "scsi.log.ta.uuf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_aif, {"automatic interface failure", "scsi.log.ta.aif", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_fwf, {"firmware failure", "scsi.log.ta.fwf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_wmicf, {"worm medium integrity check failed", "scsi.log.ta.wmicf", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_log_ta_wmoa, {"worm medium overwrite attempted", "scsi.log.ta.wmoa", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_threshold_exponent, {"Threshold Exponent", "scsi_sbc.threshold_exponent", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_sbc_lbpu, {"LBPU (logical block provisioning UNMAP)", "scsi_sbc.lbpu", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_sbc_lbpws, {"LBPWS (logical block provisioning WRITE SAME)", "scsi_sbc.lbpws", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_sbc_lbpws10, {"LBPWS10 (logical block provisioning WRITE SAME (10) )", "scsi_sbc.lbpws10", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, { &hf_scsi_sbc_lbprz, {"LBPRZ (logical block provisioning read zeros)", "scsi_sbc.lbprz", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_sbc_anc_sup, {"ANC_SUP (anchor supported)", "scsi_sbc.anc_sup", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_sbc_dp, {"DP (descriptor present)", "scsi_sbc.dp", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_sbc_ptype, {"Provisioning Type", "scsi_sbc.ptype", FT_UINT8, BASE_DEC, VALS(provisioning_vals), 0x07, NULL, HFILL}}, { &hf_scsi_block_limits_wsnz, {"WSNZ (write same non-zero)", "scsi_sbc.bl.wsnz", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_block_limits_mcawl, {"Maximum Compare And Write Length", "scsi_sbc.bl.mcawl", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_otlg, {"Optimal Transfer Length Granularity", "scsi_sbc.bl.otlg", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_mtl, {"Maximum Transfer Length", "scsi_sbc.bl.mtl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_otl, {"Optimal Transfer Length", "scsi_sbc.bl.otl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_mpl, {"Optimal Prefetch/Xdread/Xdwrite Transfer Length", "scsi_sbc.bl.mpl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_mulc, {"Maximum Unmap LBA Count", "scsi_sbc.bl.mulc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_mubdc, {"Maximum Unmap Block Descriptor Count", "scsi_sbc.bl.mubdc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_oug, {"Optimal Unmap Block Granularity", "scsi_sbc.bl.oug", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_ugavalid, {"UGAVALID", "scsi_sbc.bl.ugavalid", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_block_limits_uga, {"Unmap Granularity Alignment", "scsi_sbc.bl.uga", FT_UINT32, BASE_DEC, NULL, 0x7fffffff, NULL, HFILL}}, { &hf_scsi_block_limits_mwsl, {"Maximum Write Same Length", "scsi_sbc.bl.mwsl", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_matl, {"Maximum Atomic Transfer Length", "scsi_sbc.bl.matl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_aa, {"Atomic Alignment", "scsi_sbc.bl.aa", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_block_limits_atlg, {"Atomic Transfer Length Granularity", "scsi_sbc.bl.atlg", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_modepage_ps, {"PS", "scsi.spc.modepage.ps", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_modepage_spf, {"SPF", "scsi.spc.modepage.spf", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, { &hf_scsi_modepage_plen, {"Page Length", "scsi.spc.modepage.plen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_modepage_tcmos, {"TCMOS", "scsi.spc.modepage.tcmos", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, { &hf_scsi_modepage_scsip, {"SCSIP", "scsi.spc.modepage.scsip", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_modepage_ialuae, {"IALUAE", "scsi.spc.modepage.ialuae", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_modepage_icp, {"Initial Command Priority", "scsi.spc.modepage.icp", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_modepage_msdl, {"Maximum Sense Data Length", "scsi.spc.modepage.msdl", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_lun, { "LUN", "scsi.lun", FT_UINT16, BASE_HEX, NULL, 0, "Logical Unit Number", HFILL }}, { &hf_scsi_lun_extended, { "LUN", "scsi.lun_long", FT_UINT64, BASE_HEX, NULL, 0, "Logical Unit Number", HFILL }}, /* hf_scsi_bus has length of 0x6 with 2bit offset, or 0x3 with no offset so we handle it with add_bits_item */ { &hf_scsi_bus, { "BUS", "scsi.bus", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_scsi_target, { "Target", "scsi.target", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL }}, { &hf_scsi_lun_address_mode, { "Address Mode", "scsi.lun.address_mode", FT_UINT8, BASE_HEX, VALS(scsi_lun_address_mode_vals), 0xc0, "Addressing mode for the LUN", HFILL }}, { &hf_scsi_extended_add_method_len, { "Extended Address Method Length", "scsi.lun.extended_address_method.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x30, "Extended Address Method Specific Field", HFILL }}, { &hf_scsi_extended_add_method, { "Extended Address Method", "scsi.lun.extended_address_method", FT_UINT8, BASE_HEX, NULL, 0xf, "Extended Logical Unit Addressing", HFILL }}, { &hf_scsi_prevent_allow_flags, {"Prevent Allow Flags", "scsi.prevent_allow.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_prevent_allow_prevent, { "PREVENT", "scsi.prevent_allow.prevent", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_mpi_service_action, { "Service Action", "scsi.mpi.service_action", FT_UINT8, BASE_HEX, VALS(mpi_action_vals), 0x1f, "Management Protocol In Service Action", HFILL }}, { &hf_scsi_report_opcodes_rctd, { "RCTD", "scsi.report_opcodes.rctd", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_report_opcodes_options, { "Reporting Options", "scsi.report_opcodes.options", FT_UINT8, BASE_HEX, VALS(report_opcodes_options_vals), 0x07, NULL, HFILL}}, { &hf_scsi_report_opcodes_requested_o, { "Requested Operation Code", "scsi.report_opcodes.requested_operation_code", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_requested_sa, { "Requested Service Action", "scsi.report_opcodes.requested_service_action", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_cdl, { "Command Data Length", "scsi.report_opcodes.command_data_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_sa, { "Service Action", "scsi.report_opcodes.service_action", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_ctdp, { "CTDP", "scsi.report_opcodes.ctdp", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_report_opcodes_ctdp_one, { "CTDP", "scsi.report_opcodes_one.ctdp", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, { &hf_scsi_report_opcodes_servactv, { "SERVACTV", "scsi.report_opcodes.servactv", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, { &hf_scsi_report_opcodes_cdb_length, { "CDB Length", "scsi.report_opcodes.cdb_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_support, { "Support", "scsi.report_opcodes.support", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL}}, { &hf_scsi_report_opcodes_cdb_usage_data, {"CDB Usage Data", "scsi.report_opcodes.cdb_usage_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_tdl, { "Timeout Descriptor Length", "scsi.report_opcodes.timeout_descriptor_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_npt, { "Nominal Command Processing Timeout", "scsi.report_opcodes.ncpt", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_report_opcodes_rct, { "Recommended Command Timeout", "scsi.report_opcodes.rct", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_mrr, { "Medium Rotation Rate", "scsi.inquiry.bdc.mrr", FT_UINT16, BASE_DEC, VALS(mrr_val), 0, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_pt, { "Product Type", "scsi.inquiry.bdc.pt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_wabereq, { "WABEREQ", "scsi.inquiry.bdc.wabereq", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_wacereq, { "WACEREQ", "scsi.inquiry.bdc.wacereq", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_nff, { "Nominal Form factor", "scsi.inquiry.bdc.nff", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_fuab, { "FUAB", "scsi.inquiry.bdc.fuab", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, { &hf_scsi_inquiry_bdc_vbuls, { "VBULS", "scsi.inquiry.bdc.vbuls", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_scsi_inq_evpd_page_length, { "Page Length", "scsi.inquiry.evpd.pagelength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inq_evpd_supported_page, { "Supported Page", "scsi.inquiry.evpd.supported_page", FT_UINT8, BASE_HEX, VALS(scsi_evpd_pagecode_val), 0x0, NULL, HFILL }}, { &hf_scsi_inq_evpd_devid_code_set, { "Code Set", "scsi.inquiry.evpd.devid.code_set", FT_UINT8, BASE_HEX, VALS(scsi_devid_codeset_val), 0x0F, NULL, HFILL }}, { &hf_scsi_inq_evpd_devid_association, { "Association", "scsi.inquiry.evpd.devid.association", FT_UINT8, BASE_HEX, VALS(scsi_devid_assoc_val), 0x30, NULL, HFILL }}, { &hf_scsi_inq_evpd_devid_identifier_type, { "Identifier Type", "scsi.inquiry.evpd.devid.identifier_type", FT_UINT8, BASE_HEX, VALS(scsi_devid_idtype_val), 0x0F, NULL, HFILL }}, { &hf_scsi_inq_evpd_identifier_number, { "Identifier Number", "scsi.inquiry.evpd.identifier_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inq_evpd_devid_identifier_length, { "Identifier Length", "scsi.inquiry.evpd.devid.identifier_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inq_evpd_devid_identifier_str, { "Identifier", "scsi.inquiry.evpd.devid.identifier_str", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inq_evpd_devid_identifier_bytes, { "Identifier", "scsi.inquiry.evpd.devid.identifier_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inq_evpd_product_serial_number, { "Product Serial Number", "scsi.inquiry.evpd.product_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inq_cmddt_support, { "Support", "scsi.inquiry.cmddt.support", FT_UINT8, BASE_DEC, VALS(scsi_cmdt_supp_val), 0x07, NULL, HFILL }}, { &hf_scsi_inq_cmddt_version, { "Version", "scsi.inquiry.cmddt.version", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &scsi_verdesc_val_ext, 0x0, NULL, HFILL }}, { &hf_scsi_inq_cmddt_cdb_size, { "CDB Size", "scsi.inquiry.cmddt.cdb_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_blockdescs_no_of_blocks64, { "No. of Blocks", "scsi.blockdescs.no_of_blocks64", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_blockdescs_density_code, { "Density Code", "scsi.blockdescs.density_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_blockdescs_block_length32, { "Block Length", "scsi.blockdescs.block_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_blockdescs_no_of_blocks32, { "No. of Blocks", "scsi.blockdescs.no_of_blocks", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_blockdescs_block_length24, { "Block Length", "scsi.blockdescs.block_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_blockdescs_no_of_blocks24, { "No. of Blocks", "scsi.blockdescs.no_of_blocks", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_gltsd, { "Global Logging Target Save Disable", "scsi.spc.modepage.gltsd", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_spc_modepage_disable_queuing, { "Disable Queuing", "scsi.spc.modepage.disable_queuing", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_spc_modepage_swp, { "SWP", "scsi.spc.modepage.swp", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_spc_modepage_autoload_mode, { "Autoload Mode", "scsi.spc.modepage.autoload_mode", FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL }}, { &hf_scsi_spc_modepage_ready_aer_holdoff_period, { "Ready AER Holdoff Period (ms)", "scsi.spc.modepage.ready_aer_holdoff_period", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_busy_timeout_period, { "Busy Timeout Period (ms)", "scsi.spc.modepage.busy_timeout_period", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_extended_self_test_completion_time, { "Extended Self-Test Completion Time", "scsi.spc.modepage.extended_self_test_completion_time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_buffer_full_ratio, { "Buffer Full Ratio", "scsi.spc.modepage.buffer_full_ratio", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_buffer_empty_ratio, { "Buffer Empty Ratio", "scsi.spc.modepage.buffer_empty_ratio", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_bus_inactivity_limit, { "Bus Inactivity Limit", "scsi.spc.modepage.bus_inactivity_limit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_disconnect_time_limit, { "Disconnect Time Limit", "scsi.spc.modepage.disconnect_time_limit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_connect_time_limit, { "Connect Time Limit", "scsi.spc.modepage.connect_time_limit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_maximum_burst_size, { "Maximum Burst Size (bytes)", "scsi.spc.modepage.maximum_burst_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_emdp, { "EMDP", "scsi.spc.modepage.emdp", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_spc_modepage_first_burst_size, { "First Burst Size (bytes)", "scsi.spc.modepage.first_burst_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_perf, { "Perf", "scsi.spc.modepage.perf", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_spc_modepage_interval_timer, { "Interval Timer", "scsi.spc.modepage.interval_timer", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_report_count, { "Report Count", "scsi.spc.modepage.report_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_idle, { "Idle", "scsi.spc.modepage.idle", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_spc_modepage_idle_condition_timer, { "Idle Condition Timer (ms)", "scsi.spc.modepage.idle_condition_timer", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_standby_condition_timer, { "Standby Condition Timer (ms)", "scsi.spc.modepage.standby_condition_timer", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_dtfd, { "DTFD", "scsi.spc.modepage.dtfd", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_spc_modepage_rr_tov_units, { "RR_TOV Units", "scsi.spc.modepage.rr_tov_units", FT_UINT8, BASE_DEC, VALS(scsi_fcp_rrtov_val), 0x07, NULL, HFILL }}, { &hf_scsi_spc_modepage_rr_tov, { "RR_TOV", "scsi.spc.modepage.rr_tov", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_tracks_per_zone, { "Tracks Per Zone", "scsi.sbc.modepage.tracks_per_zone", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_alternate_sectors_per_zone, { "Alternate Sectors Per Zone", "scsi.sbc.modepage.alternate_sectors_per_zone", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_alternate_tracks_per_zone, { "Alternate Tracks Per Zone", "scsi.sbc.modepage.alternate_tracks_per_zone", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_alternate_tracks_per_lu, { "Alternate Tracks Per LU", "scsi.sbc.modepage.alternate_tracks_per_lu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_sectors_per_track, { "Sectors Per Track", "scsi.sbc.modepage.sectors_per_track", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_data_bytes_per_physical_sector, { "Data Bytes Per Physical Sector", "scsi.sbc.modepage.data_bytes_per_physical_sector", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_interleave, { "Interleave", "scsi.sbc.modepage.interleave", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_track_skew_factor, { "Track Skew Factor", "scsi.sbc.modepage.track_skew_factor", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_cylinder_skew_factor, { "Cylinder Skew Factor", "scsi.sbc.modepage.cylinder_skew_factor", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_ssec, { "SSEC", "scsi.sbc.modepage.ssec", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_sbc_modepage_awre, { "AWRE", "scsi.sbc.modepage.awre", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_sbc_modepage_read_retry_count, { "Read Retry Count", "scsi.sbc.modepage.read_retry_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_correction_span, { "Correction Span", "scsi.sbc.modepage.correction_span", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_head_offset_count, { "Head Offset Count", "scsi.sbc.modepage.head_offset_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_data_strobe_offset_count, { "Data Strobe Offset Count", "scsi.sbc.modepage.data_strobe_offset_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_write_retry_count, { "Write Retry Count", "scsi.sbc.modepage.write_retry_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_recovery_time_limit, { "Recovery Time Limit (ms)", "scsi.sbc.modepage.recovery_time_limit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_number_of_cylinders, { "Number of Cylinders", "scsi.sbc.modepage.number_of_cylinders", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_number_of_heads, { "Number of Heads", "scsi.sbc.modepage.number_of_heads", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_starting_cyl_pre_compensation, { "Starting Cyl Pre-compensation", "scsi.sbc.modepage.starting_cyl_pre_compensation", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_starting_cyl_reduced_write_current, { "Starting Cyl-reduced Write Current", "scsi.sbc.modepage.starting_cyl_reduced_write_current", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_device_step_rate, { "Device Step Rate", "scsi.sbc.modepage.device_step_rate", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_landing_zone_cyl, { "Landing Zone Cyl", "scsi.sbc.modepage.landing_zone_cyl", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_rotational_offset, { "Rotational Offset", "scsi.sbc.modepage.rotational_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_medium_rotation_rate, { "Medium Rotation Rate", "scsi.sbc.modepage.medium_rotation_rate", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_ic, { "IC", "scsi.sbc.modepage.ic", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_sbc_modepage_demand_read_retention_priority, { "Demand Read Retention Priority", "scsi.sbc.modepage.demand_read_retention_priority", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_disable_pre_fetch_xfer_len, { "Disable Pre-fetch Xfer Len", "scsi.sbc.modepage.disable_pre_fetch_xfer_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_minimum_pre_fetch, { "Minimum Pre-Fetch", "scsi.sbc.modepage.minimum_pre_fetch", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_maximum_pre_fetch, { "Maximum Pre-Fetch", "scsi.sbc.modepage.maximum_pre_fetch", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_maximum_pre_fetch_ceiling, { "Maximum Pre-Fetch Ceiling", "scsi.sbc.modepage.maximum_pre_fetch_ceiling", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_fsw, { "FSW", "scsi.sbc.modepage.fsw", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_sbc_modepage_number_of_cache_segments, { "Number of Cache Segments", "scsi.sbc.modepage.number_of_cache_segments", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_cache_segment_size, { "Cache Segment Size", "scsi.sbc.modepage.cache_segment_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sbc_modepage_non_cache_segment_size, { "Non-Cache Segment Size", "scsi.sbc.modepage.non_cache_segment_size", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_dce, { "DCE", "scsi.ssc2.modepage.dce", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_dde, { "DDE", "scsi.ssc2.modepage.dde", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_compression_algorithm, { "Compression algorithm", "scsi.ssc2.modepage.compression_algorithm", FT_UINT32, BASE_HEX, VALS(compression_algorithm_vals), 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_decompression_algorithm, { "Decompression algorithm", "scsi.ssc2.modepage.decompression_algorithm", FT_UINT32, BASE_HEX, VALS(compression_algorithm_vals), 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_caf, { "CAF", "scsi.ssc2.modepage.caf", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_active_partition, { "Active Partition", "scsi.ssc2.modepage.active_partition", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_write_object_buffer_full_ratio, { "Write Object Buffer Full Ratio", "scsi.ssc2.modepage.write_object_buffer_full_ratio", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_read_object_buffer_empty_ratio, { "Read Object Buffer Empty Ratio", "scsi.ssc2.modepage.read_object_buffer_empty_ratio", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_write_delay_time, { "Write Delay time", "scsi.ssc2.modepage.write_delay_time", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_100_milliseconds, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_obr, { "OBR", "scsi.ssc2.modepage.obr", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_gap_size, { "Gap Size", "scsi.ssc2.modepage.gap_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_eod_defined, { "EOD Defined", "scsi.ssc2.modepage.eod_defined", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_object_buffer_size_at_early_warning, { "Object Buffer Size At Early Warning", "scsi.ssc2.modepage.object_buffer_size_at_early_warning", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_select_data_compression_algorithm, { "Select Data Compression Algorithm", "scsi.ssc2.modepage.select_data_compression_algorithm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_oir, { "OIR", "scsi.ssc2.modepage.oir", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_maximum_additional_partitions, { "Maximum Additional Partitions", "scsi.ssc2.modepage.maximum_additional_partitions", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_additional_partitions_defined, { "Additional Partitions Defined", "scsi.ssc2.modepage.additional_partitions_defined", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_fdp, { "FDP", "scsi.ssc2.modepage.fdp", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_media_format_recognition, { "Media Format Recognition", "scsi.ssc2.modepage.media_format_recognition", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_partition_units, { "Partition Units", "scsi.ssc2.modepage.partition_units", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_partition_size, { "Partition Size", "scsi.ssc2.modepage.partition_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_lba_space, { "LBA Space", "scsi.mmc5.modepage.lba_space", FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_bufe, { "BUFE", "scsi.mmc5.modepage.bufe", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_wrparam_multi_session, { "Multi-session", "scsi.mmc5.modepage.wrparam_multi_session", FT_UINT8, BASE_DEC, NULL, 0xC0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_data_block_type, { "Data Block Type", "scsi.mmc5.modepage.data_block_type", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_link_size, { "Link Size", "scsi.mmc5.modepage.link_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_initiator_application_code, { "Initiator Application Code", "scsi.mmc5.modepage.initiator_application_code", FT_UINT8, BASE_DEC, NULL, 0x3F, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_session_format, { "Session Format", "scsi.mmc5.modepage.session_format", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_packet_size, { "Packet Size", "scsi.mmc5.modepage.packet_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_audio_pause_length, { "Audio Pause Length", "scsi.mmc5.modepage.audio_pause_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_media_catalog_number, { "Media Catalog Number", "scsi.mmc5.modepage.media_catalog_number", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_international_standard_recording_code, { "International Standard Recording Code", "scsi.mmc5.modepage.international_standard_recording_code", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_sub_header_byte, { "Sub-header Byte", "scsi.mmc5.modepage.sub_header_byte", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_vendor_specific, { "Vendor Specific", "scsi.mmc5.modepage.vendor_specific", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_dvd_ram_read, { "DVD-RAM Read", "scsi.mmc5.modepage.dvd_ram_read", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_dvd_ram_write, { "DVD-RAM Write", "scsi.mmc5.modepage.dvd_ram_write", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_buf, { "BUF", "scsi.mmc5.modepage.buf", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_read_bar_code, { "Read Bar Code", "scsi.mmc5.modepage.read_bar_code", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_loading_mechanism_type, { "Loading Mechanism Type", "scsi.mmc5.modepage.loading_mechanism_type", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_rw_in_lead_in, { "R-W in Lead-in", "scsi.mmc5.modepage.rw_in_lead_in", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_number_of_volume_levels_supported, { "Number of Volume Levels Supported", "scsi.mmc5.modepage.number_of_volume_levels_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_buffer_size_supported, { "Buffer Size Supported", "scsi.mmc5.modepage.buffer_size_supported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_length, { "Length", "scsi.mmc5.modepage.length", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_copy_management_revision_support, { "Copy Management Revision Support", "scsi.mmc5.modepage.copy_management_revision_support", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_rotation_control_selected, { "Rotation Control Selected", "scsi.mmc5.modepage.rotation_control_selected", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_current_write_speed_selected, { "Current Write Speed Selected", "scsi.mmc5.modepage.current_write_speed_selected", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_num_write_speed_performance, { "Number of Logical Unit Write Speed Performance Descriptor Tables", "scsi.mmc5.modepage.num_write_speed_performance", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_first_medium_transport_element_address, { "First Medium Transport Element Address", "scsi.mode.smc.first_medium_transport_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_number_of_medium_transport_elements, { "Number of Medium Transport Elements", "scsi.mode.smc.number_of_medium_transport_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_first_storage_element_address, { "First Storage Element Address", "scsi.mode.smc.first_storage_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_number_of_storage_elements, { "Number of Storage Elements", "scsi.mode.smc.number_of_storage_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_first_import_export_element_address, { "First Import/Export Element Address", "scsi.mode.smc.first_import_export_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_number_of_import_export_elements, { "Number of Import/Export Elements", "scsi.mode.smc.number_of_import_export_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_first_data_transfer_element_address, { "First Data Transfer Element Address", "scsi.mode.smc.first_data_transfer_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_number_of_data_transfer_elements, { "Number of Data Transfer Elements", "scsi.mode.smc.number_of_data_transfer_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_smc_modepage_stordt, { "STORDT", "scsi.mode.smc.stordt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_dt, { "MT->DT", "scsi.mode.smc.mt_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_dt, { "ST->DT", "scsi.mode.smc.st_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_dt, { "I/E->DT", "scsi.mode.smc.ie_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_dt, { "DT->DT", "scsi.mode.smc.dt_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_ne_dt, { "MT<>DT", "scsi.mode.smc.mt_ne_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_ne_dt, { "ST<>DT", "scsi.mode.smc.st_ne_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_ne_dt, { "I/E<>DT", "scsi.mode.smc.ie_ne_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_ne_dt, { "DT<>DT", "scsi.mode.smc.dt_ne_dt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_modesel_mode_data_length8, { "Mode Data Length", "scsi.cdb.mode.mode_data_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_modesel_dev_sbc_medium_type, { "Medium Type", "scsi.cdb.mode.medium_type", FT_UINT8, BASE_HEX, VALS(scsi_modesense_medtype_sbc_val), 0x0, NULL, HFILL }}, { &hf_scsi_modesel_medium_type, { "Medium Type", "scsi.cdb.mode.medium_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_modesel_device_specific_parameter, { "Device-Specific Parameter", "scsi.cdb.mode.device_specific_parameter", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_modesel_block_descriptor_length8, { "Block Descriptor Length", "scsi.cdb.mode.block_descriptor_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_modesel_mode_data_length16, { "Mode Data Length", "scsi.cdb.mode.mode_data_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_modesel_longlba, { "LongLBA", "scsi.cdb.mode.longlba", FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_modesel_block_descriptor_length16, { "Block Descriptor Length", "scsi.cdb.mode.block_descriptor_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_persresvin_generation_number, { "Generation Number", "scsi.persresvin.generation_number", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_persresvin_additional_length, { "Additional Length", "scsi.persresvin.additional_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reportluns_lun_list_length, { "LUN List Length", "scsi.reportluns.lun_list_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sns_valid, { "Valid", "scsi.sns.valid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_sns_filemark, { "Filemark", "scsi.sns.filemark", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_scsi_sns_command_specific_information, { "Command-Specific Information", "scsi.sns.command_specific_information", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_modepage_report_log_exception_condition, { "Report Log Exception Condition", "scsi.spc.modepage.report_log_exception_condition", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_spc_modepage_faa, { "FAA", "scsi.spc.modepage.faa", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_spc_modepage_fab, { "FAB", "scsi.spc.modepage.fab", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_spc_modepage_fac, { "FAC", "scsi.spc.modepage.fac", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_spc_modepage_ebf, { "EBF", "scsi.spc.modepage.ebf", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_spc_modepage_ewasc, { "EWasc", "scsi.spc.modepage.ewasc", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_spc_modepage_dexcpt, { "DExcpt", "scsi.spc.modepage.dexcpt", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_spc_modepage_test, { "Test", "scsi.spc.modepage.test", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_spc_modepage_logerr, { "LogErr", "scsi.spc.modepage.logerr", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_spc_modepage_standby, { "Standby", "scsi.spc.modepage.standby", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_spc_modepage_plpb, { "PLPB", "scsi.spc.modepage.plpb", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_spc_modepage_ddis, { "DDIS", "scsi.spc.modepage.ddis", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_spc_modepage_dlm, { "DLM", "scsi.spc.modepage.dlm", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_spc_modepage_rha, { "RHA", "scsi.spc.modepage.rha", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_spc_modepage_alwi, { "ALWI", "scsi.spc.modepage.alwi", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_spc_modepage_dtipe, { "DTIPE", "scsi.spc.modepage.dtipe", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_spc_modepage_dtoli, { "DTOLI", "scsi.spc.modepage.dtoli", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_sbc_modepage_hsec, { "HSEC", "scsi.sbc.modepage.hsec", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_sbc_modepage_rmb, { "RMB", "scsi.sbc.modepage.rmb", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_sbc_modepage_surf, { "SURF", "scsi.sbc.modepage.surf", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_sbc_modepage_arre, { "ARRE", "scsi.sbc.modepage.arre", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_sbc_modepage_tb, { "TB", "scsi.sbc.modepage.tb", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_sbc_modepage_rc, { "RC", "scsi.sbc.modepage.rc", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_sbc_modepage_eer, { "EER", "scsi.sbc.modepage.eer", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_sbc_modepage_per, { "PER", "scsi.sbc.modepage.per", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_sbc_modepage_dte, { "DTE", "scsi.sbc.modepage.dte", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_sbc_modepage_dcr, { "DCR", "scsi.sbc.modepage.dcr", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_sbc_modepage_abpf, { "ABPF", "scsi.sbc.modepage.abpf", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_sbc_modepage_cap, { "CAP", "scsi.sbc.modepage.cap", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_sbc_modepage_disc, { "Disc", "scsi.sbc.modepage.disc", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_sbc_modepage_size, { "Size", "scsi.sbc.modepage.size", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_sbc_modepage_wce, { "WCE", "scsi.sbc.modepage.wce", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_sbc_modepage_mf, { "MF", "scsi.sbc.modepage.mf", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_sbc_modepage_rcd, { "RCD", "scsi.sbc.modepage.rcd", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_sbc_modepage_write_retention_priority, { "Write Retention Priority", "scsi.sbc.modepage.write_retention_priority", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_scsi_sbc_modepage_lbcss, { "LBCSS", "scsi.sbc.modepage.lbcss", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_sbc_modepage_dra, { "DRA", "scsi.sbc.modepage.dra", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_sbc_modepage_vendor_specific, { "Vendor Specific", "scsi.sbc.modepage.vendor_specific", FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_dcc, { "DCC", "scsi.ssc2.modepage.dcc", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_red, { "RED", "scsi.ssc2.modepage.red", FT_UINT8, BASE_DEC, NULL, 0x60, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_active_format, { "Active Format", "scsi.ssc2.modepage.active_format", FT_UINT8, BASE_DEC, NULL, 0x1F, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_lois, { "LOIS", "scsi.ssc2.modepage.lois", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_rsmk, { "RSMK", "scsi.ssc2.modepage.rsmk", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_avc, { "AVC", "scsi.ssc2.modepage.avc", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_socf, { "SOCF", "scsi.ssc2.modepage.socf", FT_UINT8, BASE_DEC, NULL, 0x0C, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_robo, { "ROBO", "scsi.ssc2.modepage.robo", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_rew, { "REW", "scsi.ssc2.modepage.rew", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_eeg, { "EEG", "scsi.ssc2.modepage.eeg", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_sew, { "SEW", "scsi.ssc2.modepage.sew", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_swp, { "SWP", "scsi.ssc2.modepage.swp", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_baml, { "BAML", "scsi.ssc2.modepage.baml", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_bam, { "BAM", "scsi.ssc2.modepage.bam", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_rewind_on_reset, { "ReWind on Reset", "scsi.ssc2.modepage.rewind_on_reset", FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_asocwp, { "ASOCWP", "scsi.ssc2.modepage.asocwp", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_perswp, { "PERSWP", "scsi.ssc2.modepage.perswp", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_prmwp, { "PRMWP", "scsi.ssc2.modepage.prmwp", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_dsp, { "DSP", "scsi.ssc2.modepage.dsp", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_idp, { "IDP", "scsi.ssc2.modepage.idp", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_psum, { "PSUM", "scsi.ssc2.modepage.psum", FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_pofm, { "POFM", "scsi.ssc2.modepage.pofm", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_clear, { "CLEAR", "scsi.ssc2.modepage.clear", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_ssc2_modepage_addp, { "ADDP", "scsi.ssc2.modepage.addp", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_ls_v, { "LS_V", "scsi.mmc5.modepage.ls_v", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_wrparam_test_write, { "Test Write", "scsi.mmc5.modepage.wrparam_test_write", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_write_type, { "Write Type", "scsi.mmc5.modepage.write_type", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_fp, { "FP", "scsi.mmc5.modepage.fp", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_copy, { "Copy", "scsi.mmc5.modepage.copy", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_track_mode, { "Track Mode", "scsi.mmc5.modepage.track_mode", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_dvd_r_read, { "DVD-R Read", "scsi.mmc5.modepage.dvd_r_read", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_dvd_rom_read, { "DVD-ROM Read", "scsi.mmc5.modepage.dvd_rom_read", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_method_2, { "Method 2", "scsi.mmc5.modepage.method_2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_cd_rw_read, { "CD-RW Read", "scsi.mmc5.modepage.cd_rw_read", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_cd_r_read, { "CD-R Read", "scsi.mmc5.modepage.cd_r_read", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_dvd_r_write, { "DVD-R Write", "scsi.mmc5.modepage.dvd_r_write", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_dvd_rom_write, { "DVD-ROM Write", "scsi.mmc5.modepage.dvd_rom_write", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_mmcap_test_write, { "Test Write", "scsi.mmc5.modepage.mmcap_test_write", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_cd_rw_write, { "CD-RW Write", "scsi.mmc5.modepage.cd_rw_write", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_cd_r_write, { "CD-R Write", "scsi.mmc5.modepage.cd_r_write", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_mmcap_multi_session, { "Multi Session", "scsi.mmc5.modepage.mmcap_multi_session", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_mode_2_form2, { "Mode 2 Form 2", "scsi.mmc5.modepage.mode_2_form2", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_mode_2_form1, { "Mode 2 Form 1", "scsi.mmc5.modepage.mode_2_form1", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_digital_port2, { "Digital Port (2)", "scsi.mmc5.modepage.digital_port2", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_digital_port1, { "Digital Port (1)", "scsi.mmc5.modepage.digital_port1", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_composite, { "Composite", "scsi.mmc5.modepage.composite", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_audio_play, { "Audio Play", "scsi.mmc5.modepage.audio_play", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_upc, { "UPC", "scsi.mmc5.modepage.upc", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_isrc, { "ISRC", "scsi.mmc5.modepage.isrc", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_c2_pointers_supported, { "C2 Pointers supported", "scsi.mmc5.modepage.c2_pointers_supported", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_rw_deinterleaved_corrected, { "R-W Deinterleaved & corrected", "scsi.mmc5.modepage.rw_deinterleaved_corrected", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_rw_supported, { "R-W Supported", "scsi.mmc5.modepage.rw_supported", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_cd_da_stream_is_accurate, { "CD-DA Stream is Accurate", "scsi.mmc5.modepage.cd_da_stream_is_accurate", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_cd_da_cmds_supported, { "CD-DA Cmds Supported", "scsi.mmc5.modepage.cd_da_cmds_supported", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_eject, { "Eject", "scsi.mmc5.modepage.eject", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_prevent_jumper, { "Prevent Jumper", "scsi.mmc5.modepage.prevent_jumper", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_lock_state, { "Lock State", "scsi.mmc5.modepage.lock_state", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_lock, { "Lock", "scsi.mmc5.modepage.lock", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_side_change_capable, { "Side Change Capable", "scsi.mmc5.modepage.side_change_capable", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_sw_slot_selection, { "S/W Slot Selection", "scsi.mmc5.modepage.sw_slot_selection", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_changer_supports_disc_present, { "Changer Supports Disc Present", "scsi.mmc5.modepage.changer_supports_disc_present", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_separate_channel_mute, { "Separate Channel Mute", "scsi.mmc5.modepage.separate_channel_mute", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_separate_volume_levels, { "Separate volume levels", "scsi.mmc5.modepage.separate_volume_levels", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_lsbf, { "LSBF", "scsi.mmc5.modepage.lsbf", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_rck, { "RCK", "scsi.mmc5.modepage.rck", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_mmc5_modepage_bckf, { "BCKF", "scsi.mmc5.modepage.bckf", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_storie, { "STORI/E", "scsi.mode.smc.storie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_storst, { "STORST", "scsi.mode.smc.storst", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_stormt, { "STORMT", "scsi.mode.smc.stormt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_ie, { "MT->I/E", "scsi.mode.smc.mt_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_st, { "MT->ST", "scsi.mode.smc.mt_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_mt, { "MT->MT", "scsi.mode.smc.mt_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_ie, { "ST->I/E", "scsi.mode.smc.st_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_st, { "ST->ST", "scsi.mode.smc.st_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_mt, { "ST->MT", "scsi.mode.smc.st_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_ie, { "I/E->I/E", "scsi.mode.smc.ie_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_st, { "I/E->ST", "scsi.mode.smc.ie_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_mt, { "I/E->MT", "scsi.mode.smc.ie_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_ie, { "DT->I/E", "scsi.mode.smc.dt_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_st, { "DT->ST", "scsi.mode.smc.dt_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_mt, { "DT->MT", "scsi.mode.smc.dt_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_ne_ie, { "MT<>I/E", "scsi.mode.smc.mt_ne_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_ne_st, { "MT<>ST", "scsi.mode.smc.mt_ne_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_mt_ne_mt, { "MT<>MT", "scsi.mode.smc.mt_ne_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_ne_ie, { "ST<>I/E", "scsi.mode.smc.st_ne_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_ne_st, { "ST<>ST", "scsi.mode.smc.st_ne_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_st_ne_mt, { "ST<>MT", "scsi.mode.smc.st_ne_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_ne_ie, { "I/E<>I/E", "scsi.mode.smc.ie_ne_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_ne_st, { "I/E<>ST", "scsi.mode.smc.ie_ne_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_ie_ne_mt, { "I/E<>MT", "scsi.mode.smc.ie_ne_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_ne_ie, { "DT<>I/E", "scsi.mode.smc.dt_ne_ie", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_ne_st, { "DT<>ST", "scsi.mode.smc.dt_ne_st", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_scsi_smc_modepage_dt_ne_mt, { "DT<>MT", "scsi.mode.smc.dt_ne_mt", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_scsi_sns_eom, { "EOM", "scsi.sns.eom", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_scsi_sns_ili, { "ILI", "scsi.sns.ili", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_spc_xcopy_service, { "Service action", "scsi.extcopy.service_action", FT_UINT8, BASE_HEX, VALS(extcopy_service_vals), 0x0, NULL, HFILL }}, { &hf_scsi_spc_recv_copy_service, { "Service action", "scsi.recv_copy.service_action", FT_UINT8, BASE_HEX, VALS(recv_copy_service_vals), 0x1F, NULL, HFILL }}, { &hf_scsi_spc_xcopy_param_list_len, { "Parameter list length (bytes)", "scsi.extcopy.param_list_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_param_list_format, { "List format", "scsi.extcopy.list_format", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_head_cscd_desc_list_len, { "Header cscd descriptor list length", "scsi.extcopy.hdr_cscd_list_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_cscd_desc_list_len, { "CSCD descriptor list length", "scsi.extcopy.cscd_list_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_inline_data_len, { "Inline data length", "scsi.extcopy.inline_data_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_seg_desc_list_len, { "Segment descriptor list length", "scsi.extcopy.seg_desc_list_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_list_id, { "List ID", "scsi.extcopy.list_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_head_cscd_desc_type_code, { "Header CSCD description type code", "scsi.extcopy.head_cscd_desc_type_code", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_cscd_desc_type_code, { "CSCD description type code", "scsi.cscd_desc_type_code", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(desc_type_rval), 0x0, NULL, HFILL}}, { &hf_scsi_spc_xcopy_rel_init_port_id, { "Relative Initiator Port ID", "scsi.extcopy.rel_init_port_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_per_dev_type, { "Peripheral Device Type", "scsi.extcopy.per_dev_type", FT_UINT8, BASE_DEC, VALS(per_dev_type_vals), 0x1F, NULL, HFILL }}, { &hf_scsi_spc_xcopy_lu_type, { "LU type", "scsi.extcopy.lu_type", FT_UINT8, BASE_DEC, VALS(lu_type_vals), 0xC0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_per_dev_type_byte, { "Peripheral Device Type bits", "scsi.extcopy.per_dev_type_byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_disk_block_len, { "Disk block length", "scsi.extcopy.disk_block_len", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_cscd_desc_code_set, { "CSCD descriptor code set", "scsi.extcopy.cscd_code_set", FT_UINT8, BASE_DEC, VALS(scsi_devid_codeset_val), 0x0F, NULL, HFILL }}, { &hf_scsi_spc_xcopy_cscd_desc_assoc, { "CSCD descriptor association", "scsi.extcopy.cscd_assoc", FT_UINT8, BASE_DEC, VALS(scsi_devid_assoc_val), 0x30, NULL, HFILL }}, { &hf_scsi_spc_xcopy_cscd_desc_des_type, { "CSCD descriptor designator type", "scsi.extcopy.cscd_des_type", FT_UINT8, BASE_DEC, VALS(scsi_devid_idtype_val), 0x0F, NULL, HFILL }}, { &hf_scsi_spc_xcopy_cscd_desc_des_len, { "CSCD descriptor designator length", "scsi.extcopy.cscd_des_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_seg_desc_type, { "Segment descriptor type code", "scsi.extcopy.seg_desc_type", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(desc_type_rval), 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_seg_desc_dc, { "Segment descriptor designation count bit", "scsi.extcopy.seg_desc_dc", FT_UINT8, BASE_DEC, NULL, 0x2, NULL, HFILL }}, { &hf_scsi_spc_xcopy_seg_desc_cat, { "Segment descriptor CAT bit", "scsi.extcopy.seg_desc_cat", FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL }}, { &hf_scsi_spc_xcopy_seg_des_src_desc_id, { "Segment descriptor source ID", "scsi.extcopy.seg_desc_src_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_seg_des_dest_desc_id, { "Segment descriptor destination ID", "scsi.extcopy.seg_desc_dest_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_num_of_blocks, { "Number of blocks", "scsi.extcopy.seg_desc_num_of_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_param_list_id_usage, { "List ID usage", "scsi.extcopy.xcopy_param_list_id_usage", FT_UINT8, BASE_HEX, NULL, 0x18, NULL, HFILL }}, { &hf_scsi_spc_xcopy_param_str, { "Sequential strip bit (str)", "scsi.extcopy.xcopy_param_str", FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }}, { &hf_scsi_spc_xcopy_param_priority, { "Priority", "scsi.extcopy.xcopy_param_priority", FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL }}, { &hf_scsi_spc_xcopy_param_byte, { "Extended copy Parameters: str, list ID usage, priority", "scsi.extcopy.xcopy_params_byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_source_lba, { "Source LBA", "scsi.extcopy.source_lba", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_spc_xcopy_dest_lba, { "Destination LBA", "scsi.extcopy.dest_lba", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_cscd_desc_count, { "Max. CSCD descriptors count", "scsi.recv_copy.max_cscd_desc_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_seg_desc_count, { "Max. segment descriptors count", "scsi.recv_copy.max_seg_desc_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_desc_list_len, { "Max. descriptor list length", "scsi.recv_copy.max_desc_list_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_seg_len, { "Max. segment length", "scsi.recv_copy.max_seg_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_inline_data_len, { "Max. inline data length", "scsi.recv_copy.max_inline_data_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_held_data_limit, { "Held data limit", "scsi.recv_copy.max_held_data_limit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_stream_dev_trans_size, { "Max. stream device transfer size", "scsi.recv_copy.max_stream_dev_trans_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_snlid, { "SNLID bit", "scsi.recv_copy.snlid", FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL }}, { &hf_scsi_recv_copy_avail_data, { "Available data", "scsi.recv_copy.avail_data", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_total_con_copies, { "Total number of concurrent copies", "scsi.recv_copy.total_con_copies", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_max_con_copies, { "Max. number of concurrent copies", "scsi.recv_copy.max_con_copies", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_data_seg_gran, { "Data segment granularity", "scsi.recv_copy.data_seg_gran", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_inline_data_gran, { "Inline data granularity", "scsi.recv_copy.inline_data_gran", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_held_data_gran, { "Held data granularity", "scsi.recv_copy.held_data_gran", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_recv_copy_implemented_desc_list_len, { "Implemented description list length", "scsi.recv_copy.implemented_desc_list_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_designator, { "Designator", "scsi.designator", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_segment_descriptor_length, { "Segment descriptor length (bytes)", "scsi.segment_descriptor_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_inline_data, { "Inline data", "scsi.inline_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reserved_8, { "Reserved (1 byte)", "scsi.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reserved_16, { "Reserved (2 bytes)", "scsi.reserved2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reserved_24, { "Reserved (3 bytes)", "scsi.reserved3", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reserved_32, { "Reserved (4 bytes)", "scsi.reserved4", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_reserved_64, { "Reserved (8 bytes)", "scsi.reserved8", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_naa_type, { "NAA Designator Type", "scsi.naa.type", FT_UINT8, BASE_DEC, VALS(scsi_naa_designator_type_val), 0xF0, NULL, HFILL }}, { &hf_scsi_naa_locally_assigned, { "Locally Assigned", "scsi.naa.locally_assigned", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_naa_ieee_company_id, { "IEEE Company ID", "scsi.naa.ieee_company_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_naa_vendor_specific, { "Vendor Specific Identifier", "scsi.naa.vendor_specific", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_scsi_naa_vendor_specific_extension, { "Vendor Specific Identifier Extension", "scsi.naa.vendor_specific.extension", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_scsi, &ett_scsi_page, &ett_scsi_control, &ett_scsi_inq_control, &ett_scsi_inq_peripheral, &ett_scsi_inq_acaflags, &ett_scsi_inq_rmbflags, &ett_scsi_inq_sccsflags, &ett_scsi_inq_bqueflags, &ett_scsi_inq_reladrflags, &ett_scsi_log, &ett_scsi_log_ppc, &ett_scsi_log_pc, &ett_scsi_log_param, &ett_scsi_fragments, &ett_scsi_fragment, &ett_persresv_control, &ett_scsi_lun, &ett_scsi_lun_unit, &ett_scsi_prevent_allow, &ett_command_descriptor, &ett_timeout_descriptor, &ett_sense_descriptor, &ett_sense_osd_not_initiated, &ett_sense_osd_completed, &ett_xcopy_per_dev_type, &ett_scsi_xcopy_dev_params, &ett_scsi_xcopy_cscds, &ett_scsi_xcopy_cscd, &ett_scsi_xcopy_segs, &ett_scsi_xcopy_seg, &ett_scsi_xcopy_seg_param, &ett_xcopy_param_byte, &ett_scsi_cscd_desc, &ett_scsi_designation_descriptor, &ett_scsi_naa, }; static ei_register_info ei[] = { { &ei_scsi_product_data_goes_past_end_of_page, { "scsi.product_data_goes_past_end_of_page", PI_MALFORMED, PI_WARN, "Product data goes past end of page", EXPFILL }}, { &ei_scsi_unknown_page, { "scsi.unknown_page", PI_UNDECODED, PI_WARN, "Unknown Page", EXPFILL }}, { &ei_scsi_no_dissection_for_service_action, { "scsi.no_dissection_for_service_action", PI_UNDECODED, PI_WARN, "No dissection for this service action yet", EXPFILL }}, { &ei_scsi_unknown_scsi_exchange, { "scsi.unknown_scsi_exchange", PI_PROTOCOL, PI_WARN, "Unknown SCSI exchange, can not decode SCSI data", EXPFILL }}, { &ei_scsi_unknown_serv_action, { "scsi.unknown_serv_action", PI_PROTOCOL, PI_WARN, "Unknown serv_action", EXPFILL }}, }; module_t *scsi_module; expert_module_t* expert_scsi; /* Register the protocol name and description */ proto_scsi = proto_register_protocol("SCSI", "SCSI", "scsi"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_scsi, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_scsi = expert_register_protocol(proto_scsi); expert_register_field_array(expert_scsi, ei, array_length(ei)); /* add preferences to decode SCSI message */ scsi_module = prefs_register_protocol(proto_scsi, NULL); prefs_register_enum_preference(scsi_module, "decode_scsi_messages_as", "Decode SCSI Messages As", "When Target Cannot Be Identified, Decode SCSI Messages As", &scsi_def_devtype, scsi_devtype_options, FALSE); prefs_register_bool_preference(scsi_module, "defragment", "Reassemble fragmented SCSI DATA IN/OUT transfers", "Whether fragmented SCSI DATA IN/OUT transfers should be reassembled", &scsi_defragment); reassembly_table_register(&scsi_reassembly_table, &addresses_reassembly_table_functions); register_srt_table(proto_scsi, NULL, 1, scsistat_packet, scsistat_init, scsistat_param); scsi_tap = register_tap("scsi"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-scsi.h
/* packet-scsi.h * Author: Dinesh G Dutt ([email protected]) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 2002 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCSI_H_ #define __PACKET_SCSI_H_ #include <epan/exceptions.h> #include <epan/srt_table.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Structure containing itl nexus data : * The itlq nexus is a structure containing data specific * for a initiator target lun combination. */ typedef struct _itl_nexus_t { #define SCSI_CMDSET_DEFAULT 0x80 #define SCSI_CMDSET_MASK 0x7f guint8 cmdset; /* This is a bitfield. * The MSB (0x80) represents whether * 0: the commandset is known from a INQ PDU * 1: is using the "default" from preferences. * The lower 7 bits represent the commandset used * for decoding commands on this itl nexus. * The field is initialized to 0xff == unknown. */ conversation_t *conversation; } itl_nexus_t; /* Structure containing itlq nexus data : * The itlq nexus is a structure containing data specific * for a initiator target lun queue/commandid combination. */ typedef struct _itlq_nexus_t { guint32 first_exchange_frame; guint32 last_exchange_frame; guint16 lun; /* initialized to 0xffff == unknown */ guint16 scsi_opcode; /* initialized to 0xffff == unknown */ guint16 flags; #define SCSI_DATA_READ 0x0001 #define SCSI_DATA_WRITE 0x0002 guint16 task_flags; /* Flags set by the transport for this * scsi task. * * If there is no data being transferred both flags * are 0 and both data lengths below are undefined. * * If one of the flags are set the amount of * data being transferred is held in data_length * and bidir_data_length is undefined. * * If both flags are set (a bidirectional transfer) * data_length specifies the amount of DATA-OUT and * bidir_data_length specifies the amount of DATA-IN */ guint32 data_length; guint32 bidir_data_length; guint32 alloc_len; /* we need to track alloc_len between the CDB and * the DATA pdus for some opcodes. */ nstime_t fc_time; void *extra_data; /* extra data that is task specific */ } itlq_nexus_t; #define SCSI_PDU_TYPE_CDB 1 #define SCSI_PDU_TYPE_DATA 2 #define SCSI_PDU_TYPE_RSP 4 #define SCSI_PDU_TYPE_SNS 5 typedef struct _scsi_task_data { int type; itlq_nexus_t *itlq; itl_nexus_t *itl; } scsi_task_data_t; /* list of commands for each commandset */ typedef void (*scsi_dissector_t)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint32 payload_len, scsi_task_data_t *cdata); typedef struct _scsi_cdb_table_t { scsi_dissector_t func; } scsi_cdb_table_t; /* SPC Commands */ #define SCSI_SPC_ACCESS_CONTROL_IN 0x86 #define SCSI_SPC_ACCESS_CONTROL_OUT 0x87 #define SCSI_SPC_CHANGE_DEFINITION 0x40 #define SCSI_SPC_COMPARE 0x39 #define SCSI_SPC_COPY 0x18 #define SCSI_SPC_COPY_AND_VERIFY 0x3A #define SCSI_SPC_INQUIRY 0x12 #define SCSI_SPC_EXTCOPY 0x83 #define SCSI_SPC_RECVCOPY 0x84 #define SCSI_SPC_LOGSELECT 0x4C #define SCSI_SPC_LOGSENSE 0x4D #define SCSI_SPC_MODESELECT6 0x15 #define SCSI_SPC_MODESELECT10 0x55 #define SCSI_SPC_MODESENSE6 0x1A #define SCSI_SPC_MODESENSE10 0x5A #define SCSI_SPC_PERSRESVIN 0x5E #define SCSI_SPC_PERSRESVOUT 0x5F #define SCSI_SPC_PREVMEDREMOVAL 0x1E #define SCSI_SPC_READBUFFER 0x3C #define SCSI_SPC_RCVDIAGRESULTS 0x1C #define SCSI_SPC_RELEASE6 0x17 #define SCSI_SPC_RELEASE10 0x57 #define SCSI_SPC_MGMT_PROTOCOL_IN 0xA3 #define SCSI_SPC_REPORTLUNS 0xA0 #define SCSI_SPC_REQSENSE 0x03 #define SCSI_SPC_RESERVE6 0x16 #define SCSI_SPC_RESERVE10 0x56 #define SCSI_SPC_SENDDIAG 0x1D #define SCSI_SPC_SETDEVICEID 0xA4 #define SCSI_SPC_TESTUNITRDY 0x00 #define SCSI_SPC_WRITEBUFFER 0x3B #define SCSI_SPC_VARLENCDB 0x7F void dissect_spc_inquiry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint32 payload_len, scsi_task_data_t *cdata); void dissect_spc_logselect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_logsense(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_mgmt_protocol_in(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_modeselect6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata); void dissect_spc_modesense6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata); void dissect_spc_modeselect10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata); void dissect_spc_modesense10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata); void dissect_spc_persistentreservein(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata); void dissect_spc_persistentreserveout(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_reportluns(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_testunitready (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_requestsense (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_preventallowmediaremoval (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_writebuffer (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb _U_, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_reserve6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_release6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_reserve10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_release10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_senddiagnostic (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_extcopy (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_spc_recvcopy (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); extern const value_string scsi_status_val[]; /* * SCSI Device Types. * * These can be supplied to the dissection routines if the caller happens * to know the device type (e.g., NDMP assumes that a "jukebox" is a * media changer, SCSI_DEV_SMC, and a "tape" is a sequential access device, * SCSI_DEV_SSC). * * If the caller doesn't know the device type, it supplies SCSI_DEV_UNKNOWN. */ #define SCSI_DEV_UNKNOWN -1 #define SCSI_DEV_SBC 0x0 #define SCSI_DEV_SSC 0x1 #define SCSI_DEV_PRNT 0x2 #define SCSI_DEV_PROC 0x3 #define SCSI_DEV_WORM 0x4 #define SCSI_DEV_CDROM 0x5 #define SCSI_DEV_SCAN 0x6 #define SCSI_DEV_OPTMEM 0x7 #define SCSI_DEV_SMC 0x8 #define SCSI_DEV_COMM 0x9 #define SCSI_DEV_RAID 0xC #define SCSI_DEV_SES 0xD #define SCSI_DEV_RBC 0xE #define SCSI_DEV_OCRW 0xF #define SCSI_DEV_OSD 0x11 #define SCSI_DEV_ADC 0x12 #define SCSI_DEV_NOLUN 0x1F #define SCSI_DEV_BITS 0x1F /* the lower 5 bits indicate device type */ #define SCSI_MS_PCODE_BITS 0x3F /* Page code bits in Mode Sense */ /* Function Decls; functions invoked by SAM-2 transport protocols such as * FCP/iSCSI */ void dissect_scsi_cdb (tvbuff_t *, packet_info *, proto_tree *, gint, itlq_nexus_t *, itl_nexus_t *); void dissect_scsi_rsp (tvbuff_t *, packet_info *, proto_tree *, itlq_nexus_t *, itl_nexus_t *, guint8); void dissect_scsi_payload (tvbuff_t *, packet_info *, proto_tree *, gboolean, itlq_nexus_t *, itl_nexus_t *, guint32 relative_offset); void dissect_scsi_snsinfo (tvbuff_t *, packet_info *, proto_tree *, guint, guint, itlq_nexus_t *, itl_nexus_t *); void dissect_scsi_lun(proto_tree *, tvbuff_t *, guint); extern int * const cdb_control_fields[6]; extern gint ett_scsi_control; extern int hf_scsi_control; extern int hf_scsi_alloclen16; /* service actions */ #define SHORT_FORM_BLOCK_ID 0x00 #define SHORT_FORM_VENDOR_SPECIFIC 0x01 #define LONG_FORM 0x06 #define EXTENDED_FORM 0x08 #define SERVICE_READ_CAPACITY16 0x10 #define SERVICE_READ_LONG16 0x11 #define SERVICE_WRITE_LONG16 0x11 #define SERVICE_GET_LBA_STATUS 0x12 #define SERVICE_REPORT_REFERRALS 0x13 extern const value_string service_action_vals[]; extern const value_string scsi_devid_codeset_val[]; extern const value_string scsi_devid_idtype_val[]; extern value_string_ext scsi_asc_val_ext; /* 0xA3 MGMT PROTOCOL IN service actions */ #define MPI_MANAGEMENT_PROTOCOL_IN 0x10 #define MPI_REPORT_SUPPORTED_OPERATION_CODES 0x0C /* These two defines are used to handle cases where data coming back from * the device is truncated due to a too short allocation_length specified * in the command CDB. * This is semi-common in SCSI and it would be wrong to mark these packets * as [malformed packets]. * These macros will reset the reported length to what the data pdu specified * and if a ContainedBoundsError or ReportedBoundsError is generated we will * instead throw ScsiBoundsError * * Please see dissect_spc_inquiry() for an example how to use these * macros. * * Note that try_tvb & try_offset are initialized to be used in the code * bounded by TRY_SCSI_ALLOC_LEN and END_TRY_SCSI_CDB_ALLOC_LEN */ #define TRY_SCSI_CDB_ALLOC_LEN(length_arg) \ { \ tvbuff_t *try_tvb; \ volatile guint try_offset; \ guint32 try_end_data_offset=0; \ \ try_tvb=tvb_new_subset_length(tvb_a, offset_a, length_arg); \ try_offset=0; \ TRY { #define END_TRY_SCSI_CDB_ALLOC_LEN \ if(try_end_data_offset){ \ /* just verify we can read all the bytes we were\ * supposed to. \ */ \ tvb_get_guint8(try_tvb,try_end_data_offset); \ } \ } /* TRY */ \ CATCH(BoundsError) { \ /* this was a short packet */ \ RETHROW; \ } \ CATCH(ContainedBoundsError) { \ /* We probably tried to dissect beyond the end \ * of the alloc len reported in the data \ * pdu. This is not an error so don't flag it \ * as one \ * it is the alloc_len in the CDB that is the \ * important one \ */ \ } \ CATCH(ReportedBoundsError) { \ /* this packet was not really short but limited \ * due to a short SCSI allocation length \ */ \ THROW(ScsiBoundsError); \ } \ ENDTRY; \ } /* If the data pdu contains an alloc_len as well, this macro can be set * to registe this offset for the TRY section above. * At the end of the TRY section we will, if set, verify that the data * pdu contained all bytes that was specified in the data alloc len. * * This macro does currently not do anything but we might enhance it in * the future. There is no harm in teaching the dissector about how long * the data pdu is supposed to be according to alloc_len in the data pdu */ #define SET_SCSI_DATA_END(offset_arg) \ try_end_data_offset=offset_arg; WS_DLL_PUBLIC guint scsistat_param(register_srt_t* srt, const char* opt_arg, char** err); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-scte35.c
/* packet-scte35.c * Routines for SCTE-35 dissection * Author: Ben Stewart <bst[at]google.com> * Copyright 2016 Google Inc. * * The SCTE-35 protocol is described by the Society of Cable Telecommunications * Engineers at <https://www.scte.org/documents/pdf/Standards/Top%20Ten/ANSI_SCTE%2035%202013.pdf>. * * This module implements a dissector for the main table in a SCTE-35 message, a * splice_info_section. This payload is carried in a MPEG Section Table with a * table ID of 0xFC. PIDs carrying this sort of table are also noted in the PMT * with a stream type of 0x86, and a registration descriptor with fourcc 'CUEI'. * * The various splice command types are implemented in separate modules, and are * linked to this dissector through the field scte35.splice_command_type. All * field names follow the conventions documented in the SCTE35 specification. * * This dissector does not support encrypted SCTE35 messages, other than * indicating through the scte35.encrypted_packet flag. * * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #define SCTE35_CMD_SPLICE_NULL (0x00) #define SCTE35_CMD_SPLICE_SCHEDULE (0x04) #define SCTE35_CMD_SPLICE_INSERT (0x05) #define SCTE35_CMD_TIME_SIGNAL (0x06) #define SCTE35_CMD_BANDWIDTH_RESERVATION (0x07) #define SCTE35_CMD_PRIVATE_COMMAND (0xff) #define SCTE35_AVAIL_DESCRIPTOR (0x00) #define SCTE35_DTMF_DESCRIPTOR (0x01) #define SCTE35_SEGMENTATION_DESCRIPTOR (0x02) void proto_register_scte35(void); void proto_register_scte35_private_command(void); void proto_register_scte35_splice_insert(void); void proto_register_scte35_splice_schedule(void); void proto_register_scte35_time_signal(void); void proto_reg_handoff_scte35(void); void proto_reg_handoff_scte35_private_command(void); void proto_reg_handoff_scte35_splice_insert(void); void proto_reg_handoff_scte35_splice_schedule(void); void proto_reg_handoff_scte35_time_signal(void); /* MPEG Section Table ID for a SCTE35 splice_info_section. */ static const unsigned char SCTE35_TABLE_ID = 0xFCU; /* Minimum length for a splice_info_section, excluding any splice commands, * splice descriptors, encrypted CRC or alignment stuffing. */ static const int SCTE35_SI_MIN_LEN = 20; /* Protocol handle */ static int proto_scte35 = -1; /* Dissector table for scte35.splice_command_type */ static dissector_table_t scte35_cmd_dissector_table = NULL; /* splice_info_section table */ static gint ett_scte35_splice_info_section = -1; /* splice_info_section fields */ static gint hf_table_id = -1; static gint hf_section_syntax_indicator = -1; static gint hf_private_indicator = -1; static gint hf_reserved = -1; static gint hf_section_length = -1; static gint hf_protocol_version = -1; static gint hf_encrypted_packet = -1; static gint hf_encryption_algorithm = -1; static gint hf_pts_adjustment = -1; static gint hf_cw_index = -1; static gint hf_tier = -1; static gint hf_splice_command_length = -1; static gint hf_splice_command_type = -1; static gint hf_descriptor_loop_length = -1; static gint hf_splice_descriptor_tag = -1; static gint hf_splice_descriptor_length = -1; static gint hf_splice_descriptor_identifier = -1; static gint hf_descriptor_provider_avail_id = -1; static gint hf_descriptor_preroll = -1; static gint hf_descriptor_dtmf_count = -1; static gint hf_descriptor_dtmf_reserved = -1; static gint hf_descriptor_dtmf = -1; static gint hf_descriptor_event_id = -1; static gint hf_descriptor_cancel_indicator = -1; static gint hf_descriptor_reserved0 = -1; static gint hf_descriptor_psf = -1; static gint hf_descriptor_segmentation_duration_flag = -1; static gint hf_descriptor_delivery_not_restricted_flag = -1; static gint hf_descriptor_web_delivery_allowed_flag = -1; static gint hf_descriptor_no_regional_blackout_flag = -1; static gint hf_descriptor_archive_allow_flag = -1; static gint hf_descriptor_device_restrictions = -1; static gint hf_descriptor_reserved1 = -1; static gint hf_descriptor_component_count = -1; static gint hf_descriptor_component_tag = -1; static gint hf_descriptor_component_reserved = -1; static gint hf_descriptor_component_pts_offset = -1; static gint hf_descriptor_segmentation_duration = -1; static gint hf_descriptor_segmentation_upid_type = -1; static gint hf_descriptor_segmentation_upid_length = -1; static gint hf_descriptor_segmentation_upid = -1; static gint hf_descriptor_segmentation_type_id = -1; static gint hf_descriptor_segment_num = -1; static gint hf_descriptor_segments_expected = -1; static gint hf_e_crc32 = -1; static gint hf_crc32 = -1; /* time_signal protocol and fields */ static int proto_scte35_time = -1; static gint ett_scte35_time_signal = -1; static gint ett_scte35_time_signal_splice_time = -1; static gint hf_time_specified = -1; static gint hf_time_reserved = -1; static gint hf_time_pts = -1; /* private_command protocol and fields */ static int proto_private_command = -1; static gint ett_private_command = -1; static gint hf_identifier = -1; static gint hf_private_byte = -1; /* Dissector table for scte35_private_command.identifier */ static dissector_table_t private_identifier_table = NULL; static dissector_handle_t scte35_handle = NULL; /* splice_insert protocol and fields */ static int proto_scte35_si = -1; static gint ett_scte35_splice_insert = -1; static gint hf_splice_insert_event_id = -1; static gint hf_splice_cancel_indicator = -1; static gint hf_reserved0 = -1; static gint hf_out_of_network_indicator = -1; static gint hf_program_splice_flag = -1; static gint hf_duration_flag = -1; static gint hf_splice_immediate_flag = -1; static gint hf_reserved1 = -1; static gint hf_splice_time_specified_flag = -1; static gint hf_splice_time_reserved = -1; static gint hf_splice_time_pts_time = -1; static gint hf_component_count = -1; static gint hf_component_tag = -1; static gint hf_component_splice_time_tsf = -1; static gint hf_component_splice_time_reserved = -1; static gint hf_component_splice_time_pts_time = -1; static gint hf_break_duration_auto_return = -1; static gint hf_break_duration_reserved = -1; static gint hf_break_duration_duration = -1; static gint hf_unique_program_id = -1; static gint hf_avail_num = -1; static gint hf_avails_expected = -1; /* splice_schedule protocol and fields */ static int proto_scte35_splice_schedule = -1; static gint ett_scte35_splice_schedule = -1; static gint hf_splice_count = -1; static gint hf_splice_event_id = -1; static gint hf_splice_event_cancel_indicator = -1; static gint hf_splice_reserved0 = -1; static gint hf_splice_out_of_network = -1; static gint hf_splice_program_splice_flag = -1; static gint hf_splice_duration_flag = -1; static gint hf_splice_reserved1 = -1; static gint hf_splice_utc_splice_time = -1; static gint hf_splice_component_count = -1; static gint hf_splice_component_tag = -1; static gint hf_splice_component_utc_splice_time = -1; static gint hf_splice_break_duration_auto_return = -1; static gint hf_splice_break_duration_reserved = -1; static gint hf_splice_break_duration_duration = -1; static gint hf_splice_unique_program_id = -1; static gint hf_splice_avail_num = -1; static gint hf_splice_avails_expected = -1; static const true_false_string tfs_section_syntax_indicator = { "Reserved", "MPEG short sections in use"}; static const true_false_string tfs_private_indicator = { "Reserved", "Mandatory value"}; static const true_false_string tfs_encrypted_packet = { "Encrypted data", "Cleartext"}; static const true_false_string tfs_descriptor_cancel_indicator = { "Cancel Request", "New or existing event"}; static const true_false_string tfs_descriptor_psf = { "All PIDs to be spliced", "Component Splice Mode"}; static const true_false_string tfs_descriptor_sdf = { "Segmentation duration present", "No duration present"}; static const true_false_string tfs_descriptor_dnr = { "No delivery restrictions", "Restricted delivery"}; static const true_false_string tfs_descriptor_web = { "Permitted", "Restricted"}; static const true_false_string tfs_descriptor_blackout = { "No regional blackouts", "Regional restrictions"}; static const true_false_string tfs_descriptor_archive = { "No recording restrictions", "Recording is restricted"}; static const range_string rv_splice_command_type[] = { { SCTE35_CMD_SPLICE_NULL, SCTE35_CMD_SPLICE_NULL, "splice_null" }, { 0x01, 0x03, "Reserved" }, { SCTE35_CMD_SPLICE_SCHEDULE, SCTE35_CMD_SPLICE_SCHEDULE, "splice_schedule" }, { SCTE35_CMD_SPLICE_INSERT, SCTE35_CMD_SPLICE_INSERT, "splice_insert" }, { SCTE35_CMD_TIME_SIGNAL, SCTE35_CMD_TIME_SIGNAL, "time_signal" }, { SCTE35_CMD_BANDWIDTH_RESERVATION, SCTE35_CMD_BANDWIDTH_RESERVATION, "bandwidth_reservation" }, { 0x08, 0xfe, "Reserved" }, { SCTE35_CMD_PRIVATE_COMMAND, SCTE35_CMD_PRIVATE_COMMAND, "private_command" }, { 0, 0, NULL } }; static const range_string rv_splice_descriptor_tag[] = { { SCTE35_AVAIL_DESCRIPTOR, SCTE35_AVAIL_DESCRIPTOR, "avail_descriptor" }, { SCTE35_DTMF_DESCRIPTOR, SCTE35_DTMF_DESCRIPTOR, "DTMF_descriptor" }, { SCTE35_SEGMENTATION_DESCRIPTOR, SCTE35_SEGMENTATION_DESCRIPTOR, "segmentation_descriptor" }, { 0x03, 0xff, "Reserved" }, { 0, 0, NULL } }; static const range_string scte35_device_restrictions[] = { { 0x00, 0x00, "Restrict Group 0" }, { 0x01, 0x01, "Restrict Group 1" }, { 0x02, 0x02, "Restrict Group 2" }, { 0x03, 0x03, "No Restrictions" }, { 0, 0, NULL } }; static const range_string scte35_segmentation_upid_type[] = { { 0x00, 0x00, "Not Used" }, { 0x01, 0x01, "User Defined (deprecated)" }, { 0x02, 0x02, "ISCI" }, { 0x03, 0x03, "Ad-ID" }, { 0x04, 0x04, "UMID (SMPTE 330M)" }, { 0x05, 0x05, "ISAN" }, { 0x06, 0x06, "Versioned ISAN" }, { 0x07, 0x07, "Tribune TID" }, { 0x08, 0x08, "Turner Identifier" }, { 0x09, 0x09, "CableLabs ADI Identifier" }, { 0x0a, 0x0a, "EIDR" }, { 0x0b, 0x0b, "ATSC A57/B Content Identifier" }, { 0x0c, 0x0c, "Managed Private UPID" }, { 0x0d, 0x0d, "Multiple UPIDs" }, { 0x0e, 0xff, "Reserved" }, { 0, 0, NULL } }; static const range_string scte35_segmentation_type_id[] = { { 0x00, 0x00, "Not Indicated" }, { 0x01, 0x01, "Content Identification" }, { 0x10, 0x10, "Program Start" }, { 0x11, 0x11, "Program End" }, { 0x12, 0x12, "Program Early Termination" }, { 0x13, 0x13, "Program Breakaway" }, { 0x14, 0x14, "Program Resumption" }, { 0x15, 0x15, "Program Runover Planned" }, { 0x16, 0x16, "Program Runover Unplanned" }, { 0x17, 0x17, "Program Overlap Start" }, { 0x20, 0x20, "Chapter Start" }, { 0x21, 0x21, "Chapter End" }, { 0x30, 0x30, "Provider Advertisement Start" }, { 0x31, 0x31, "Provider Advertisement End" }, { 0x32, 0x32, "Distributor Advertisement Start" }, { 0x33, 0x33, "Distributor Advertisement End" }, { 0x34, 0x34, "Placement Opportunity Start" }, { 0x35, 0x35, "Placement Opportunity End" }, { 0x40, 0x40, "Unscheduled Event Start" }, { 0x41, 0x41, "Unscheduled Event End" }, { 0, 0, NULL } }; static const range_string rv_encryption_algorithm[] = { { 0x00, 0x00, "No encryption"}, { 0x01, 0x01, "DES - ECB mode"}, { 0x02, 0x02, "DES - CBC mode"}, { 0x03, 0x03, "Triple DES EDE3 - ECB mode"}, { 0x04, 0x1F, "Reserved"}, { 0x20, 0x3F, "User private"}, { 0, 0, NULL } }; /* time_signal dissector */ static int dissect_scte35_time_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint tvb_len, min_length = 1, offset = 0; guint8 time_specified_flag; proto_item *ti; proto_tree *time_tree; /* Check packet length. */ tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < min_length) return 0; time_specified_flag = tvb_get_guint8(tvb, offset) & 0x80; if (time_specified_flag) min_length += 4; if (tvb_len < min_length) return 0; /* Set up headers in the packet list */ col_add_fstr(pinfo->cinfo, COL_INFO, "Time Signal (%s)", time_specified_flag ? "Future" : "Immediate"); /* Create a subtee for the time_signal */ ti = proto_tree_add_item(tree, proto_scte35_time, tvb, 0, -1, ENC_NA); time_tree = proto_item_add_subtree(ti, ett_scte35_time_signal); /* Parse out the fields. */ proto_tree_add_item(time_tree, hf_time_specified, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(time_tree, hf_time_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); if (time_specified_flag) { proto_tree_add_item(time_tree, hf_time_pts, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 4; } offset += 1; return offset; } void proto_register_scte35_time_signal(void) { static gint *ett[] = { &ett_scte35_time_signal, &ett_scte35_time_signal_splice_time, }; static hf_register_info hf[] = { {&hf_time_specified, {"Time Specified", "scte35_time.splice.time_specified", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_time_reserved, {"Reserved", "scte35_time.splice.reserved", FT_UINT8, BASE_HEX, NULL, 0x7E, NULL, HFILL}}, {&hf_time_pts, {"PTS Time", "scte35_time.splice.pts", FT_UINT64, BASE_DEC, NULL, G_GUINT64_CONSTANT(0x01FFFFFFFF), NULL, HFILL}}, }; proto_scte35_time = proto_register_protocol("SCTE-35 Time Signal", "SCTE35 TS", "scte35_time"); proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_scte35_time, hf, array_length(hf)); } void proto_reg_handoff_scte35_time_signal(void) { dissector_handle_t scte35_time_handle; /* Create a dissector for time_signal packets. */ scte35_time_handle = create_dissector_handle(dissect_scte35_time_signal, proto_scte35_time); /* And hook it up to SCTE-35 messages. */ dissector_add_uint("scte35.splice_command_type", SCTE35_CMD_TIME_SIGNAL, scte35_time_handle); } /* scte35 private_command dissector */ static int dissect_scte35_private_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint tvb_len; guint32 identifier; gint offset = 0; proto_item *ti; proto_tree *pc_tree; tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < 4) return 0; /* Display rudimentary header information. */ ti = proto_tree_add_item(tree, proto_private_command, tvb, 0, -1, ENC_NA); pc_tree = proto_item_add_subtree(ti, ett_private_command); proto_tree_add_item_ret_uint(pc_tree, hf_identifier, tvb, offset, 4, ENC_BIG_ENDIAN, &identifier); col_add_fstr(pinfo->cinfo, COL_INFO, "Private Command (0x%08x)", identifier); offset += 4; proto_tree_add_item(pc_tree, hf_private_byte, tvb, offset, -1, ENC_NA); /* Let another dissector try to decode this data. */ dissector_try_uint(private_identifier_table, identifier, tvb, pinfo, tree); return tvb_len; } void proto_register_scte35_private_command(void) { static gint *ett[] = { &ett_private_command, }; static hf_register_info hf[] = { {&hf_identifier, {"Identifier", "scte35_private_command.identifier", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_private_byte, {"Private Bytes", "scte35_private_command.private_byte", FT_BYTES, 0, NULL, 0, NULL, HFILL}}, }; proto_private_command = proto_register_protocol("SCTE-35 Private Command", "SCTE35 PC", "scte35_private_command"); proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_private_command, hf, array_length(hf)); /* Allow other modules to hook private commands and decode them. */ private_identifier_table = register_dissector_table( "scte35_private_command.identifier", "SCTE-35 Private Command Identifier", proto_private_command, FT_UINT32, BASE_HEX); } void proto_reg_handoff_scte35_private_command(void) { dissector_handle_t scte35_private_command_handle; /* Create a dissector for private commands. */ scte35_private_command_handle = create_dissector_handle(dissect_scte35_private_command, proto_private_command); /* Trigger our dissector on any private_command SCTE-35 messages. */ dissector_add_uint("scte35.splice_command_type", SCTE35_CMD_PRIVATE_COMMAND, scte35_private_command_handle); } /* scte35 splice_insert dissector */ static int dissect_component(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint8 sif, int idx) { gint offset = 0; guint8 component_tag, tsf = 0; proto_tree *component_tree; gint tvb_len, min_length = sif ? 1 : 2; tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < min_length) return 0; if (!sif) { /* Check whether time is present in the component. */ tsf = tvb_get_guint8(tvb, offset + 1) & 0x80; if (tsf) { min_length += 4; if (tvb_len < min_length) return 0; } } /* Create a subtree for the component. */ component_tag = tvb_get_guint8(tvb, offset); proto_tree_add_subtree_format( tree, tvb, offset, min_length, idx, &component_tree, "Component %d (0x%02x)", idx, component_tag); /* Parse out component flags. */ proto_tree_add_item(component_tree, hf_component_tag, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* For non-immediate splices.. */ if (!sif) { proto_tree_add_item(component_tree, hf_component_splice_time_tsf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(component_tree, hf_component_splice_time_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); /* And the PTS if present. */ if (tsf) { proto_tree_add_item(component_tree, hf_component_splice_time_pts_time, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 4; } offset++; } return offset; } static int dissect_scte35_splice_insert(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint tvb_len, min_length = 5, dissected_length; guint8 cancel_flag, psf, df, sif, tsf, component_count; guint32 event_id; gint component; gint offset = 0; proto_item *ti; proto_tree *si_tree, *st_tree; static int * const new_event_fields[] = { &hf_out_of_network_indicator, &hf_program_splice_flag, &hf_duration_flag, &hf_splice_immediate_flag, &hf_reserved1, NULL }; /* Check with no optional subfields */ tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < min_length) return 0; cancel_flag = tvb_get_guint8(tvb, offset + 4) & 0x80; event_id = tvb_get_ntohl(tvb, 0); if (!cancel_flag) { min_length += 5; if (tvb_len < min_length) return 0; } /* Set up headers in the packet list */ col_add_fstr(pinfo->cinfo, COL_INFO, "Splice %s Event 0x%08x", cancel_flag ? "Cancellation" : "Insertion", event_id); /* Create a root tree element for the splice_insert protocol. */ ti = proto_tree_add_item(tree, proto_scte35_si, tvb, 0, -1, ENC_NA); si_tree = proto_item_add_subtree(ti, ett_scte35_splice_insert); /* Parse header fields */ proto_tree_add_item(si_tree, hf_splice_insert_event_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(si_tree, hf_splice_cancel_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(si_tree, hf_reserved0, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Check for a new event. */ if (!cancel_flag) { /* Parse out the 'new event' fields. */ psf = tvb_get_guint8(tvb, offset) & 0x40; df = tvb_get_guint8(tvb, offset) & 0x20; sif = tvb_get_guint8(tvb, offset) & 0x10; proto_tree_add_bitmask_list(si_tree, tvb, offset, 1, new_event_fields, ENC_BIG_ENDIAN); offset++; /* Parse out the program-level splice fields. */ if (psf && !sif) { min_length += 1; if (tvb_len < min_length) return offset; tsf = tvb_get_bits8(tvb, offset * 8, 1); proto_tree_add_subtree(si_tree, tvb, offset, tsf ? 5 : 1, 0, &st_tree, "Program Splice Time"); proto_tree_add_item(st_tree, hf_splice_time_specified_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(st_tree, hf_splice_time_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); /* If a time is specified, display it too. */ if (tsf) { min_length += 4; if (tvb_len < min_length) return offset; proto_tree_add_item(st_tree, hf_splice_time_pts_time, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 4; } offset++; } /* For component-level splices, parse the component table. */ if (!psf) { min_length += 1; if (tvb_len < min_length) return offset; component_count = tvb_get_guint8(tvb, offset); proto_tree_add_item(si_tree, hf_component_count, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; min_length += component_count * (sif ? 1 : 2); if (tvb_len < min_length) return offset; /* Dissect each splice component. */ for (component = 0; component < component_count; ++component) { dissected_length = dissect_component( tvb_new_subset_remaining(tvb, offset), pinfo, si_tree, sif, component); /* Propagate failures. */ if (dissected_length < 1) return offset; offset += dissected_length; } } /* If present, parse out the duration field. */ if (df) { min_length += 5; if (tvb_len < min_length) return offset; proto_tree_add_item(si_tree, hf_break_duration_auto_return, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(si_tree, hf_break_duration_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(si_tree, hf_break_duration_duration, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 5; } /* Parse the UPID and avails fields. */ proto_tree_add_item(si_tree, hf_unique_program_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(si_tree, hf_avail_num, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(si_tree, hf_avails_expected, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } return offset; } void proto_register_scte35_splice_insert(void) { static hf_register_info hf[] = { {&hf_splice_insert_event_id, {"Event ID", "scte35_si.event_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_splice_cancel_indicator, {"Cancelled", "scte35_si.cancelled", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_reserved0, {"Reserved", "scte35_si.reserved0", FT_UINT8, 1, NULL, 0x7F, NULL, HFILL}}, {&hf_out_of_network_indicator, {"Out of Network", "scte35_si.out_of_net", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_program_splice_flag, {"Program Splice Point", "scte35_si.psf", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, {&hf_duration_flag, {"Duration Present", "scte35_si.duration_flag", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, {&hf_splice_immediate_flag, {"Splice Immediate", "scte35_si.splice_immediate", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, {&hf_reserved1, {"Reserved", "scte35_si.reserved1", FT_UINT8, 1, NULL, 0x0f, NULL, HFILL}}, {&hf_splice_time_specified_flag, {"Time Specified", "scte35_si.splice_time.time_specified", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_splice_time_reserved, {"Reserved", "scte35_si.splice_time.reserved", FT_UINT8, 1, NULL, 0x7E, NULL, HFILL}}, {&hf_splice_time_pts_time, {"PTS Time", "scte35_si.splice_time.pts", FT_UINT64, 5, NULL, G_GUINT64_CONSTANT(0x1FFFFFFFF), NULL, HFILL}}, {&hf_component_count, {"Component Count", "scte35_si.component_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_component_tag, {"Component Tag", "scte35_si.component.tag", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_component_splice_time_tsf, {"Time Specified", "scte35_si.component.time_specified", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_component_splice_time_reserved, {"Reserved", "scte35_si.component.reserved", FT_UINT8, 1, NULL, 0x7E, NULL, HFILL}}, {&hf_component_splice_time_pts_time, {"PTS Time", "scte35_si.component.pts", FT_UINT64, 5, NULL, G_GUINT64_CONSTANT(0x1FFFFFFFF), NULL, HFILL}}, {&hf_break_duration_auto_return, {"Auto Return", "scte35_si.break.auto_return", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_break_duration_reserved, {"Reserved", "scte35_si.break.reserved", FT_UINT8, 1, NULL, 0x7E, NULL, HFILL}}, {&hf_break_duration_duration, {"Duration", "scte35_si.break.duration", FT_UINT64, 5, NULL, G_GUINT64_CONSTANT(0x1FFFFFFFF), NULL, HFILL}}, {&hf_unique_program_id, {"Unique Program ID", "scte35_si.upid", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_avail_num, {"Avail Number", "scte35_si.avail", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_avails_expected, {"Avails Expected", "scte35_si.avails_expected", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, }; static gint *ett[] = { &ett_scte35_splice_insert, }; proto_scte35_si = proto_register_protocol("SCTE-35 Splice Insert", "SCTE35 SI", "scte35_si"); proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_scte35_si, hf, array_length(hf)); } void proto_reg_handoff_scte35_splice_insert(void) { dissector_handle_t scte35_si_handle; /* Create a splice_insert dissector, and hook it into SCTE35 parsing. */ scte35_si_handle = create_dissector_handle(dissect_scte35_splice_insert, proto_scte35_si); dissector_add_uint("scte35.splice_command_type", SCTE35_CMD_SPLICE_INSERT, scte35_si_handle); } /* scte35 splice_schedule dissector */ static int dissect_scte35_splice_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint tvb_len, min_length = 1; guint8 splice_count, cancel_flag, psf, df, component_count; gint component, splice; gint offset = 0, splice_length; proto_item *ti; proto_tree *ss_tree, *sp_tree, *component_tree; static int * const splice_event_flags[] = { &hf_splice_out_of_network, &hf_splice_program_splice_flag, &hf_splice_duration_flag, &hf_splice_reserved1, NULL }; /* Check with no optional subfields */ tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < min_length) return 0; /* Set up headers in the packet list */ splice_count = tvb_get_guint8(tvb, 0); min_length += splice_count * 5; if (tvb_len < min_length) return 0; col_add_fstr(pinfo->cinfo, COL_INFO, "Splice Schedule (%d splices)", splice_count); /* Create the root of the dissection */ ti = proto_tree_add_item(tree, proto_scte35_splice_schedule, tvb, 0, -1, ENC_NA); ss_tree = proto_item_add_subtree(ti, ett_scte35_splice_schedule); /* Header fields for splice_schedule() message */ proto_tree_add_item(ss_tree, hf_splice_count, tvb, offset, 1, ENC_NA); offset++; /* Process each splice. */ for (splice = 0; splice < splice_count; ++splice) { cancel_flag = tvb_get_bits8(tvb, offset * 8 + 32, 1); psf = cancel_flag ? 0 : tvb_get_bits8(tvb, offset * 8 + 41, 1); df = cancel_flag ? 0 : tvb_get_bits8(tvb, offset * 8 + 42, 1); component_count = cancel_flag ? 0 : (psf ? 0 : tvb_get_guint8(tvb, offset + 6)); splice_length = 5; if (!cancel_flag) splice_length += 4 + 1; if (!cancel_flag && psf) splice_length += 4; if (!cancel_flag && !psf) splice_length += 1 + 5 * component_count; if (!cancel_flag && df) splice_length += 5; /* Add a subtree for the splice. */ proto_tree_add_subtree_format( ss_tree, tvb, offset, splice_length, splice, &sp_tree, "Splice %d", splice); /* Show the splice header. */ proto_tree_add_item(ss_tree, hf_splice_event_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(ss_tree, hf_splice_event_cancel_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ss_tree, hf_splice_reserved0, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (!cancel_flag) { min_length += 5; if (tvb_len < min_length) return offset; df = tvb_get_bits8(tvb, offset * 8 + 2, 1); /* Parse out the splice event flags. */ proto_tree_add_bitmask_list(ss_tree, tvb, offset, 1, splice_event_flags, ENC_BIG_ENDIAN); offset++; min_length += (psf ? 4 : 1); if (tvb_len < min_length) return offset; if (psf) { proto_tree_add_item(ss_tree, hf_splice_utc_splice_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else { component_count = tvb_get_guint8(tvb, offset); proto_tree_add_item(ss_tree, hf_splice_component_count, tvb, offset, 1, ENC_NA); offset++; min_length += 5 * component_count; if (tvb_len < min_length) return offset; /* Parse out each component stream. */ for (component = 0; component < component_count; ++component) { proto_tree_add_subtree_format(sp_tree, tvb, offset, 5, component, &component_tree, "Component %d", component); proto_tree_add_item(component_tree, hf_splice_component_tag, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(component_tree, hf_splice_component_utc_splice_time, tvb, offset, 4, ENC_NA); offset += 4; } } /* Parse out break duration, if present. */ if (df) { min_length += 5; if (tvb_len < min_length) return offset; proto_tree_add_item(ss_tree, hf_splice_break_duration_auto_return, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ss_tree, hf_splice_break_duration_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ss_tree, hf_splice_break_duration_duration, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 5; } } proto_tree_add_item(ss_tree, hf_splice_unique_program_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(ss_tree, hf_splice_avail_num, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(ss_tree, hf_splice_avails_expected, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } return offset; } void proto_register_scte35_splice_schedule(void) { static hf_register_info hf[] = { {&hf_splice_count, {"Splice Count", "scte35_splice_schedule.splice_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_splice_event_id, {"Event ID", "scte35_splice_schedule.splice.event_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_splice_event_cancel_indicator, {"Event Cancel Indicator", "scte35_splice_schedule.splice.event_cancel_indicator", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_splice_reserved0, {"Reserved", "scte35_splice_schedule.splice.reserved0", FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}}, {&hf_splice_out_of_network, {"Out of Network Indicator", "scte35_splice_schedule.splice.out_of_network_indicator", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_splice_program_splice_flag, {"Program Splice Flag", "scte35_splice_schedule.splice.program_splice_flag", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, {&hf_splice_duration_flag, {"Duration Flag", "scte35_splice_schedule.splice.duration_flag", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, {&hf_splice_reserved1, {"Reserved", "scte35_splice_schedule.splice.reserved1", FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}}, {&hf_splice_utc_splice_time, {"UTC Splice Time", "scte35_splice_schedule.splice.utc_splice_time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_splice_component_count, {"Component Count", "scte35_splice_schedule.splice.component_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_splice_component_tag, {"Component Tag", "scte35_splice_schedule.splice.component.tag", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_splice_component_utc_splice_time, {"UTC Splice Time", "scte35_splice_schedule.splice.component.utc_splice_time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_splice_break_duration_auto_return, {"Auto Return", "scte35_splice_schedule.splice.break_duration.auto_return", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, {&hf_splice_break_duration_reserved, {"Reserved", "scte35_splice_schedule.splice.break_duration.reserved", FT_UINT8, BASE_HEX, NULL, 0x7E, NULL, HFILL}}, {&hf_splice_break_duration_duration, {"Duration", "scte35_splice_schedule.splice.break_duration.duration", FT_UINT64, BASE_DEC, NULL, G_GUINT64_CONSTANT(0x1FFFFFFFF), NULL, HFILL}}, {&hf_splice_unique_program_id, {"Unique Program ID", "scte35_splice_schedule.splice.unique_program_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_splice_avail_num, {"Avail Number", "scte35_splice_schedule.splice.avail_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_splice_avails_expected, {"Avails Expected", "scte35_splice_schedule.splice.avails_expected", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, }; static gint *ett[] = { &ett_scte35_splice_schedule, }; proto_scte35_splice_schedule = proto_register_protocol("SCTE-35 Splice Schedule", "SCTE35 SS", "scte35_splice_schedule"); proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_scte35_splice_schedule, hf, array_length(hf)); } void proto_reg_handoff_scte35_splice_schedule(void) { dissector_handle_t dissector; dissector = create_dissector_handle(dissect_scte35_splice_schedule, proto_scte35_splice_schedule); dissector_add_uint("scte35.splice_command_type", SCTE35_CMD_SPLICE_SCHEDULE, dissector); } /* core scte35 splice_info_section dissector */ static int dissect_scte35_avail_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { gint offset = 0; gint tvb_len; /* Check length. */ tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < 4) return 0; /* Show the field. */ proto_tree_add_item(tree, hf_descriptor_provider_avail_id, tvb, offset, 4, ENC_NA); offset += 4; return offset; } static int dissect_scte35_dtmf_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { gint offset = 0; gint tvb_len, min_length = 2; guint8 dtmf_count; /* Check length. */ tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < min_length) return 0; dtmf_count = tvb_get_bits8(tvb, (offset+1)* 8, 3); /* Check length with DTMF string too. */ min_length += dtmf_count; if (tvb_len < min_length) return 0; /* Describe header. */ proto_tree_add_item(tree, hf_descriptor_preroll, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_descriptor_dtmf_count, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_dtmf_reserved, tvb, offset, 1, ENC_NA); offset++; /* Show the DTMF string field. */ proto_tree_add_item(tree, hf_descriptor_dtmf, tvb, offset, dtmf_count, ENC_NA | ENC_ASCII); offset += dtmf_count; return offset; } static int dissect_scte35_component(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int idx) { gint offset = 0; proto_tree *subtree; /* Create the subtree. */ proto_tree_add_subtree_format(tree, tvb, offset, 6, idx, &subtree, "Component %d", idx); /* Display the component fields. */ proto_tree_add_item(subtree, hf_descriptor_component_tag, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(subtree, hf_descriptor_component_reserved, tvb, offset, 1, ENC_NA); proto_tree_add_item(subtree, hf_descriptor_component_pts_offset, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 5; return offset; } static int dissect_scte35_segmentation_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gint offset = 0, dissected_length = 0, component; guint8 cancel_indicator, psf, sdf, dnr, component_count, upid_length; /* Parse the common header */ proto_tree_add_item(tree, hf_descriptor_event_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; cancel_indicator = tvb_get_bits8(tvb, offset * 8, 1); proto_tree_add_item(tree, hf_descriptor_cancel_indicator, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_reserved0, tvb, offset, 1, ENC_NA); offset++; /* Parse fields for new segmentation events. */ if (!cancel_indicator) { psf = tvb_get_bits8(tvb, offset * 8, 1); sdf = tvb_get_bits8(tvb, offset * 8 + 1, 1); dnr = tvb_get_bits8(tvb, offset * 8 + 2, 1); proto_tree_add_item(tree, hf_descriptor_psf, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_segmentation_duration_flag, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_delivery_not_restricted_flag, tvb, offset, 1, ENC_NA); /* Parse delivery flags */ if (dnr) { proto_tree_add_item(tree, hf_descriptor_reserved1, tvb, offset, 1, ENC_NA); } else { proto_tree_add_item(tree, hf_descriptor_web_delivery_allowed_flag, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_no_regional_blackout_flag, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_archive_allow_flag, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_descriptor_device_restrictions, tvb, offset, 1, ENC_NA); } offset++; /* Parse component segmentation offsets if not switched as a program. */ if (!psf) { component_count = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_descriptor_component_count, tvb, offset, 1, ENC_NA); offset++; /* Parse each component */ for (component = 0; component < component_count; ++component) { dissected_length = dissect_scte35_component( tvb_new_subset_length(tvb, offset, 6), pinfo, tree, component); /* Propagate errors. */ if (dissected_length < 1) return dissected_length; offset += dissected_length; } } /* Parse segementation duration if present. */ if (sdf) { proto_tree_add_item(tree, hf_descriptor_segmentation_duration, tvb, offset, 5, ENC_BIG_ENDIAN); offset += 5; } /* Parse UPID. */ proto_tree_add_item(tree, hf_descriptor_segmentation_upid_type, tvb, offset, 1, ENC_NA); offset++; upid_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_descriptor_segmentation_upid_length, tvb, offset, 1, ENC_NA); offset++; /* Only show non-empty UPIDs. */ if (upid_length) { proto_tree_add_item(tree, hf_descriptor_segmentation_upid, tvb, offset, upid_length, ENC_NA | ENC_ASCII); offset += upid_length; } /* Parse Segment counts. */ proto_tree_add_item(tree, hf_descriptor_segmentation_type_id, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_descriptor_segment_num, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_descriptor_segments_expected, tvb, offset, 1, ENC_NA); offset++; } return offset; } static int dissect_scte35_splice_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int idx) { proto_tree *subtree; tvbuff_t *descriptor_tvb; gint offset = 0, dissected_length = 0; guint8 tag, length = 0; /* Create the subtree header for the descriptor. */ tag = tvb_get_guint8(tvb, offset); length = tvb_get_guint8(tvb, offset + 1); proto_tree_add_subtree_format( tree, tvb, offset, length + 2, idx, &subtree, "Descriptor %d (0x%02x)", idx, tag); /* Parse descriptor headers */ proto_tree_add_item(subtree, hf_splice_descriptor_tag, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(subtree, hf_splice_descriptor_length, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(subtree, hf_splice_descriptor_identifier, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Parse the specific descriptor type. */ descriptor_tvb = tvb_new_subset_length(tvb, offset, length - 4); switch (tag) { case SCTE35_AVAIL_DESCRIPTOR: dissected_length = dissect_scte35_avail_descriptor(descriptor_tvb, pinfo, subtree); break; case SCTE35_DTMF_DESCRIPTOR: dissected_length = dissect_scte35_dtmf_descriptor(descriptor_tvb, pinfo, subtree); break; case SCTE35_SEGMENTATION_DESCRIPTOR: dissected_length = dissect_scte35_segmentation_descriptor(descriptor_tvb, pinfo, subtree); break; default: /* Just trust the descriptor_length field. */ dissected_length = length - 4; } /* Propagate errors. */ if (dissected_length < 1) return dissected_length; offset += dissected_length; return offset; } static int dissect_scte35_splice_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint tvb_len, min_length = SCTE35_SI_MIN_LEN, dissected_length = 0; guint8 table_id, encrypted_packet, command_type; guint16 command_length, descriptor_loop_length, i; proto_item *ti; proto_tree *splice_info_tree; gint offset = 0, descriptor_offset = 0; tvbuff_t *command_tvb; static int * const section_flags[] = { &hf_section_syntax_indicator, &hf_private_indicator, &hf_reserved, &hf_section_length, NULL }; static int * const encrypt_flags[] = { &hf_encrypted_packet, &hf_encryption_algorithm, &hf_pts_adjustment, NULL }; tvb_len = (gint)tvb_reported_length(tvb); if (tvb_len < min_length) return 0; /* Pre-fetch a few fields in the message. */ table_id = tvb_get_guint8(tvb, offset); encrypted_packet = tvb_get_guint8(tvb, offset + 4) & 0x80; command_type = tvb_get_guint8(tvb, offset + 13); command_length = tvb_get_ntohs(tvb, offset + 11) & 0xFFF; /* Check for excessive length before indexing past the command. */ min_length += command_length; if (tvb_len < min_length) return 0; /* Determine length of descriptors. */ descriptor_loop_length = tvb_get_ntohs(tvb, 14 + command_length); min_length += descriptor_loop_length; if (tvb_len < min_length) return 0; /* Check for excessive length before parsing the remainder of the packet. */ if (encrypted_packet) min_length += 4; if (tvb_len < min_length) return 0; /* Set up headers in the packet list */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCTE-35"); col_add_fstr(pinfo->cinfo, COL_INFO, "Table 0x%02x", table_id); /* Create the protocol header. */ ti = proto_tree_add_item(tree, proto_scte35, tvb, 0, -1, ENC_NA); splice_info_tree = proto_item_add_subtree(ti, ett_scte35_splice_info_section); /* Explain the root fields. */ proto_tree_add_item(splice_info_tree, hf_table_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_bitmask_list(splice_info_tree, tvb, offset, 2, section_flags, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(splice_info_tree, hf_protocol_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* 7 bits of flags, 33 bits of PTS */ proto_tree_add_bitmask_list(splice_info_tree, tvb, offset, 5, encrypt_flags, ENC_BIG_ENDIAN); offset += 5; proto_tree_add_item(splice_info_tree, hf_cw_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Two twelve-bit fields */ proto_tree_add_item(splice_info_tree, hf_tier, tvb, offset, 2, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(splice_info_tree, hf_splice_command_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(splice_info_tree, hf_splice_command_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Extract the splice command payload for later use. */ command_tvb = tvb_new_subset_length(tvb, offset, command_length); offset += command_length; /* Process the descriptor loop. */ proto_tree_add_item(splice_info_tree, hf_descriptor_loop_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Explain each descriptor. */ for (i = 0, descriptor_offset = offset; descriptor_offset < offset + descriptor_loop_length; ++i) { dissected_length = dissect_scte35_splice_descriptor( tvb_new_subset_remaining(tvb, descriptor_offset), pinfo, splice_info_tree, i); /* Escalate failure. */ if (dissected_length < 1) return offset; descriptor_offset += dissected_length; } offset += descriptor_loop_length; /* Explain the packet footer. */ if (encrypted_packet) { proto_tree_add_item(splice_info_tree, hf_e_crc32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } proto_tree_add_item(splice_info_tree, hf_crc32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* We've reached the end. Run a child dissector for the splice command. */ dissector_try_uint_new(scte35_cmd_dissector_table, command_type, command_tvb, pinfo, tree, FALSE, NULL); return offset; } void proto_register_scte35(void) { static gint *ett[] = { &ett_scte35_splice_info_section, }; static hf_register_info hf[] = { /* MPEG Section Table Headers. Field members taken from mpeg-sect.c. */ {&hf_table_id, {"Table ID", "scte35.tid", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_section_syntax_indicator, {"Section Syntax Identifier", "scte35.syntax_indicator", FT_BOOLEAN, 16, TFS(&tfs_section_syntax_indicator), 0x8000, NULL, HFILL }}, {&hf_private_indicator, {"Private Indicator", "scte35.private", FT_BOOLEAN, 16, TFS(&tfs_private_indicator), 0x4000, NULL, HFILL }}, {&hf_reserved, {"Reserved", "scte35.reserved", FT_UINT16, BASE_HEX, NULL, 0x3000, NULL, HFILL }}, {&hf_section_length, {"Section length", "scte35.len", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL}}, /* SCTE35-specific headers */ {&hf_protocol_version, {"Protocol Version", "scte35.protocol_version", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_encrypted_packet, {"Encrypted Packet", "scte35.encrypted_packet", FT_BOOLEAN, 40, TFS(&tfs_encrypted_packet), G_GUINT64_CONSTANT(0x8000000000), NULL, HFILL}}, {&hf_encryption_algorithm, {"Encryption Algorithm", "scte35.encryption_algorithm", FT_UINT40, BASE_HEX | BASE_RANGE_STRING, RVALS(rv_encryption_algorithm), G_GUINT64_CONSTANT(0x7E00000000), NULL, HFILL}}, {&hf_pts_adjustment, {"PTS Adjustment", "scte35.pts_adjustment", FT_UINT40, BASE_DEC, NULL, G_GUINT64_CONSTANT(0x1FFFFFFFF), NULL, HFILL}}, {&hf_cw_index, {"Control Word Index", "scte35.cw_index", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_tier, {"Authorisation Tier", "scte35.tier", FT_UINT16, BASE_DEC, NULL, 0xFFF0, NULL, HFILL}}, {&hf_splice_command_length, {"Command Length", "scte35.splice_command_length", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL}}, {&hf_splice_command_type, {"Command Type", "scte35.splice_command_type", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(rv_splice_command_type), 0, NULL, HFILL}}, /* Splice command payload goes here via the dissector table. */ /* Descriptor loop header. */ {&hf_descriptor_loop_length, {"Descriptor Loop Length", "scte35.desc_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, /* Descriptor loop entries. */ {&hf_splice_descriptor_tag, {"Tag", "scte35.splice_descriptor.tag", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(rv_splice_descriptor_tag), 0, NULL, HFILL}}, {&hf_splice_descriptor_length, {"Length", "scte35.splice_descriptor.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_splice_descriptor_identifier, {"Descriptor ID", "scte35.splice_descriptor.identifier", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, /* avail_descriptor */ {&hf_descriptor_provider_avail_id, {"Provider Avail ID", "scte35.splice_descriptor.provider_avail_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, /* dtmf_descriptor */ {&hf_descriptor_preroll, {"Preroll", "scte35.splice_descriptor.preroll", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_descriptor_dtmf_count, {"DTMF Count", "scte35.splice_descriptor.dtmf_count", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL}}, {&hf_descriptor_dtmf_reserved, {"DTMF Reserved", "scte35.splice_descriptor.dtmf_reserved", FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}}, {&hf_descriptor_dtmf, {"DTMF", "scte35.splice_descriptor.dtmf", FT_STRING, 0, NULL, 0, NULL, HFILL}}, /* segmentation_descriptor */ {&hf_descriptor_event_id, {"Segmentation Event ID", "scte35.splice_descriptor.event_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_descriptor_cancel_indicator, {"Cancel Indicator", "scte35.splice_descriptor.cancel_indicator", FT_BOOLEAN, 8, TFS(&tfs_descriptor_cancel_indicator), 0x80, NULL, HFILL}}, {&hf_descriptor_reserved0, {"Reserved", "scte35.splice_descriptor.reserved0", FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}}, {&hf_descriptor_psf, {"Program Segmentation Flag", "scte35.splice_descriptor.psf", FT_BOOLEAN, 8, TFS(&tfs_descriptor_psf), 0x80, NULL, HFILL}}, {&hf_descriptor_segmentation_duration_flag, {"Segmentation Duration Flag", "scte35.splice_descriptor.sdf", FT_BOOLEAN, 8, TFS(&tfs_descriptor_sdf), 0x40, NULL, HFILL}}, {&hf_descriptor_delivery_not_restricted_flag, {"Delivery not Restricted", "scte35.splice_descriptor.dnr", FT_BOOLEAN, 8, TFS(&tfs_descriptor_dnr), 0x20, NULL, HFILL}}, {&hf_descriptor_web_delivery_allowed_flag, {"Web Delivery Allowed", "scte35.splice_descriptor.web_delivery_allowed", FT_BOOLEAN, 8, TFS(&tfs_descriptor_web), 0x10, NULL, HFILL}}, {&hf_descriptor_no_regional_blackout_flag, {"No Regional Blackout", "scte35.splice_descriptor.no_regional_blackout", FT_BOOLEAN, 8, TFS(&tfs_descriptor_blackout), 0x08, NULL, HFILL}}, {&hf_descriptor_archive_allow_flag, {"Archive Allowed", "scte35.splice_descriptor.archive_allowed", FT_BOOLEAN, 8, TFS(&tfs_descriptor_archive), 0x04, NULL, HFILL}}, {&hf_descriptor_device_restrictions, {"Device Restrictions", "scte35.splice_descriptor.device_restrictions", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(scte35_device_restrictions), 0x03, NULL, HFILL}}, {&hf_descriptor_reserved1, {"Reserved", "scte35.splice_descriptor.reserved1", FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}}, {&hf_descriptor_component_count, {"Component Count", "scte35.splice_descriptor.component_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_descriptor_component_tag, {"Component Tag", "scte35.splice_descriptor.component.tag", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}}, {&hf_descriptor_component_reserved, {"Reserved", "scte35.splice_descriptor.component.reserved", FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL}}, {&hf_descriptor_component_pts_offset, {"PTS Offset", "scte35.splice_descriptor.component.pts_offset", FT_UINT64, BASE_DEC, NULL, 0x1FFFFFFFF, NULL, HFILL}}, {&hf_descriptor_segmentation_duration, {"Segmentation Duration", "scte35.splice_descriptor.segmentation_duration", FT_UINT64, BASE_DEC, NULL, 0xFFFFFFFFFF, NULL, HFILL}}, {&hf_descriptor_segmentation_upid_type, {"UPID Type", "scte35.splice_descriptor.upid_type", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(scte35_segmentation_upid_type), 0, NULL, HFILL}}, {&hf_descriptor_segmentation_upid_length, {"UPID Length", "scte35.splice_descriptor.upid_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_descriptor_segmentation_upid, {"UPID", "scte35.splice_descriptor.upid", FT_STRING, 0, NULL, 0, NULL, HFILL}}, {&hf_descriptor_segmentation_type_id, {"Segmentation Type", "scte35.splice_descriptor.segmentation_type_id", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(scte35_segmentation_type_id), 0, NULL, HFILL}}, {&hf_descriptor_segment_num, {"Segment Number", "scte35.splice_descriptor.segment_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_descriptor_segments_expected, {"Segments Expected", "scte35.splice_descriptor.segments_expected", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, /* Optional alignment padding, encrypted CRC32 suffix. */ {&hf_e_crc32, {"Encrypted CRC32", "scte35.ecrc32", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, /* MPEG Section table CRC suffix */ {&hf_crc32, {"CRC32", "scte35.crc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, }; /* Allocate a protocol number. */ proto_scte35 = proto_register_protocol( "SCTE-35 Splice Information", /* name */ "SCTE 35", /* short name */ "scte35" /* abbreviation */ ); scte35_handle = register_dissector("scte35", dissect_scte35_splice_info, proto_scte35); /* Register groups and fields. */ proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_scte35, hf, array_length(hf)); /* Allow other protocols to discriminate against the splice command type * to further dissect the payload. */ scte35_cmd_dissector_table = register_dissector_table( "scte35.splice_command_type", "SCTE-35 Command", proto_scte35, FT_UINT8, BASE_HEX); } void proto_reg_handoff_scte35(void) { /* Invoke the splice_info_section parser for a section table with ID 0xFC */ dissector_add_uint("mpeg_sect.tid", SCTE35_TABLE_ID, scte35_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sctp.c
/* packet-sctp.c * Routines for Stream Control Transmission Protocol dissection * Copyright 2000-2012 Michael Tuexen <tuexen [AT] fh-muenster.de> * Copyright 2011-2021 Thomas Dreibholz <dreibh [AT] iem.uni-due.de> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * It should be compliant to * - RFC 2960 * - RFC 3309 * - RFC 3758 * - RFC 4460 * - RFC 4895 * - RFC 4960 * - RFC 5061 * - RFC 6525 * - RFC 7053 * - https://tools.ietf.org/html/draft-stewart-sctp-pktdrprep-02 * - https://www.ietf.org/archive/id/draft-ietf-tsvwg-sctp-zero-checksum-01.html * * Still to do (so stay tuned) * - error checking mode * * padding errors * * length errors * * bundling errors * * value errors * * Reassembly added 2006 by Robin Seggelmann * TSN Tracking by Luis E. G. Ontanon (Feb 2007) * Copyright 2009, Varun Notibala <nbvarun [AT] gmail.com> * * PPID types updated by Thomas Dreibholz (Feb 2011) */ #include "config.h" #include "ws_symbol_export.h" #include <epan/packet.h> #include <epan/capture_dissectors.h> #include <epan/prefs.h> #include <epan/exceptions.h> #include <epan/exported_pdu.h> #include <epan/ipproto.h> #include <epan/addr_resolv.h> #include <epan/sctpppids.h> #include <epan/uat.h> #include <epan/expert.h> #include <epan/conversation_table.h> #include <epan/show_exception.h> #include <epan/decode_as.h> #include <epan/proto_data.h> #include <wsutil/crc32.h> #include <wsutil/adler32.h> #include <wsutil/utf8_entities.h> #include <wsutil/str_util.h> #include <wsutil/ws_roundup.h> #include "packet-sctp.h" #define LT(x, y) ((gint32)((x) - (y)) < 0) #define UDP_TUNNELING_PORT 9899 #define MAX_NUMBER_OF_PPIDS 2 /** This is a valid PPID, but we use it to mark the end of the list */ #define LAST_PPID 0xffffffff void proto_register_sctp(void); void proto_reg_handoff_sctp(void); /* Initialize the protocol and registered fields */ static int proto_sctp = -1; static int hf_port = -1; static int hf_source_port = -1; static int hf_destination_port = -1; static int hf_verification_tag = -1; static int hf_checksum = -1; static int hf_checksum_adler = -1; static int hf_checksum_crc32c = -1; static int hf_checksum_status = -1; static int hf_chunk_type = -1; static int hf_chunk_flags = -1; static int hf_chunk_bit_1 = -1; static int hf_chunk_bit_2 = -1; static int hf_chunk_length = -1; static int hf_chunk_padding = -1; static int hf_chunk_value = -1; static int hf_initiate_tag = -1; static int hf_init_chunk_initiate_tag = -1; static int hf_init_chunk_adv_rec_window_credit = -1; static int hf_init_chunk_number_of_outbound_streams = -1; static int hf_init_chunk_number_of_inbound_streams = -1; static int hf_init_chunk_initial_tsn = -1; static int hf_initack_chunk_initiate_tag = -1; static int hf_initack_chunk_adv_rec_window_credit = -1; static int hf_initack_chunk_number_of_outbound_streams = -1; static int hf_initack_chunk_number_of_inbound_streams = -1; static int hf_initack_chunk_initial_tsn = -1; static int hf_data_chunk_tsn = -1; static int hf_data_chunk_tsn_raw = -1; static int hf_data_chunk_stream_id = -1; static int hf_data_chunk_stream_seq_number = -1; static int hf_data_chunk_payload_proto_id = -1; static int hf_idata_chunk_reserved = -1; static int hf_idata_chunk_mid = -1; static int hf_idata_chunk_fsn = -1; static int hf_data_chunk_e_bit = -1; static int hf_data_chunk_b_bit = -1; static int hf_data_chunk_u_bit = -1; static int hf_data_chunk_i_bit = -1; static int hf_sack_chunk_ns = -1; static int hf_sack_chunk_cumulative_tsn_ack = -1; static int hf_sack_chunk_cumulative_tsn_ack_raw = -1; static int hf_sack_chunk_adv_rec_window_credit = -1; static int hf_sack_chunk_number_of_gap_blocks = -1; static int hf_sack_chunk_number_of_dup_tsns = -1; static int hf_sack_chunk_gap_block_start = -1; static int hf_sack_chunk_gap_block_end = -1; static int hf_sack_chunk_gap_block_start_tsn = -1; static int hf_sack_chunk_gap_block_end_tsn = -1; static int hf_sack_chunk_number_tsns_gap_acked = -1; static int hf_sack_chunk_duplicate_tsn = -1; static int hf_nr_sack_chunk_ns = -1; static int hf_nr_sack_chunk_cumulative_tsn_ack = -1; static int hf_nr_sack_chunk_adv_rec_window_credit = -1; static int hf_nr_sack_chunk_number_of_gap_blocks = -1; static int hf_nr_sack_chunk_number_of_nr_gap_blocks = -1; static int hf_nr_sack_chunk_number_of_dup_tsns = -1; static int hf_nr_sack_chunk_reserved = -1; static int hf_nr_sack_chunk_gap_block_start = -1; static int hf_nr_sack_chunk_gap_block_end = -1; static int hf_nr_sack_chunk_gap_block_start_tsn = -1; static int hf_nr_sack_chunk_gap_block_end_tsn = -1; static int hf_nr_sack_chunk_number_tsns_gap_acked = -1; static int hf_nr_sack_chunk_nr_gap_block_start = -1; static int hf_nr_sack_chunk_nr_gap_block_end = -1; static int hf_nr_sack_chunk_nr_gap_block_start_tsn = -1; static int hf_nr_sack_chunk_nr_gap_block_end_tsn = -1; static int hf_nr_sack_chunk_number_tsns_nr_gap_acked = -1; static int hf_nr_sack_chunk_duplicate_tsn = -1; static int hf_shutdown_chunk_cumulative_tsn_ack = -1; static int hf_cookie = -1; static int hf_cwr_chunk_lowest_tsn = -1; static int hf_ecne_chunk_lowest_tsn = -1; static int hf_abort_chunk_t_bit = -1; static int hf_shutdown_complete_chunk_t_bit = -1; static int hf_parameter_type = -1; static int hf_parameter_length = -1; static int hf_parameter_value = -1; static int hf_parameter_padding = -1; static int hf_parameter_bit_1 = -1; static int hf_parameter_bit_2 = -1; static int hf_ipv4_address = -1; static int hf_ipv6_address = -1; static int hf_heartbeat_info = -1; static int hf_state_cookie = -1; static int hf_cookie_preservative_increment = -1; static int hf_hostname = -1; static int hf_supported_address_type = -1; static int hf_stream_reset_req_seq_nr = -1; static int hf_stream_reset_rsp_seq_nr = -1; static int hf_senders_last_assigned_tsn = -1; static int hf_senders_next_tsn = -1; static int hf_receivers_next_tsn = -1; static int hf_stream_reset_rsp_result = -1; static int hf_stream_reset_sid = -1; static int hf_add_outgoing_streams_number_streams = -1; static int hf_add_outgoing_streams_reserved = -1; static int hf_add_incoming_streams_number_streams = -1; static int hf_add_incoming_streams_reserved = -1; static int hf_zero_checksum_edmid = -1; static int hf_random_number = -1; static int hf_chunks_to_auth = -1; static int hf_hmac_id = -1; static int hf_hmac = -1; static int hf_shared_key_id = -1; static int hf_supported_chunk_type = -1; static int hf_cause_code = -1; static int hf_cause_length = -1; static int hf_cause_padding = -1; static int hf_cause_info = -1; static int hf_cause_stream_identifier = -1; static int hf_cause_reserved = -1; static int hf_cause_number_of_missing_parameters = -1; static int hf_cause_missing_parameter_type = -1; static int hf_cause_measure_of_staleness = -1; static int hf_cause_tsn = -1; static int hf_forward_tsn_chunk_tsn = -1; static int hf_forward_tsn_chunk_sid = -1; static int hf_forward_tsn_chunk_ssn = -1; static int hf_i_forward_tsn_chunk_tsn = -1; static int hf_i_forward_tsn_chunk_sid = -1; static int hf_i_forward_tsn_chunk_flags = -1; static int hf_i_forward_tsn_chunk_res = -1; static int hf_i_forward_tsn_chunk_u_bit = -1; static int hf_i_forward_tsn_chunk_mid = -1; static int hf_asconf_ack_seq_nr = -1; static int hf_asconf_seq_nr = -1; static int hf_correlation_id = -1; static int hf_adap_indication = -1; static int hf_pktdrop_chunk_m_bit = -1; static int hf_pktdrop_chunk_b_bit = -1; static int hf_pktdrop_chunk_t_bit = -1; static int hf_pktdrop_chunk_bandwidth = -1; static int hf_pktdrop_chunk_queuesize = -1; static int hf_pktdrop_chunk_truncated_length = -1; static int hf_pktdrop_chunk_reserved = -1; static int hf_pktdrop_chunk_data_field = -1; static int hf_pad_chunk_padding_data = -1; static int hf_sctp_reassembled_in = -1; static int hf_sctp_duplicate = -1; static int hf_sctp_fragments = -1; static int hf_sctp_fragment = -1; static int hf_sctp_retransmission = -1; static int hf_sctp_retransmitted = -1; static int hf_sctp_retransmitted_count = -1; static int hf_sctp_data_rtt = -1; static int hf_sctp_sack_rtt = -1; static int hf_sctp_rto = -1; static int hf_sctp_ack_tsn = -1; static int hf_sctp_ack_frame = -1; static int hf_sctp_acked = -1; static int hf_sctp_retransmitted_after_ack = -1; static int hf_sctp_assoc_index = -1; static dissector_table_t sctp_port_dissector_table; static dissector_table_t sctp_ppi_dissector_table; static heur_dissector_list_t sctp_heur_subdissector_list; static int sctp_tap = -1; static int exported_pdu_tap = -1; /* Initialize the subtree pointers */ static gint ett_sctp = -1; static gint ett_sctp_chunk = -1; static gint ett_sctp_chunk_parameter = -1; static gint ett_sctp_chunk_cause = -1; static gint ett_sctp_chunk_type = -1; static gint ett_sctp_data_chunk_flags = -1; static gint ett_sctp_sack_chunk_flags = -1; static gint ett_sctp_nr_sack_chunk_flags = -1; static gint ett_sctp_abort_chunk_flags = -1; static gint ett_sctp_shutdown_complete_chunk_flags = -1; static gint ett_sctp_pktdrop_chunk_flags = -1; static gint ett_sctp_parameter_type= -1; static gint ett_sctp_sack_chunk_gap_block = -1; static gint ett_sctp_sack_chunk_gap_block_start = -1; static gint ett_sctp_sack_chunk_gap_block_end = -1; static gint ett_sctp_nr_sack_chunk_gap_block = -1; static gint ett_sctp_nr_sack_chunk_gap_block_start = -1; static gint ett_sctp_nr_sack_chunk_gap_block_end = -1; static gint ett_sctp_nr_sack_chunk_nr_gap_block = -1; static gint ett_sctp_nr_sack_chunk_nr_gap_block_start = -1; static gint ett_sctp_nr_sack_chunk_nr_gap_block_end = -1; static gint ett_sctp_unrecognized_parameter_parameter = -1; static gint ett_sctp_i_forward_tsn_chunk_flags = -1; static gint ett_sctp_fragments = -1; static gint ett_sctp_fragment = -1; static gint ett_sctp_tsn = -1; static gint ett_sctp_ack = -1; static gint ett_sctp_acked = -1; static gint ett_sctp_tsn_retransmission = -1; static gint ett_sctp_tsn_retransmitted_count = -1; static gint ett_sctp_tsn_retransmitted = -1; static expert_field ei_sctp_sack_chunk_adv_rec_window_credit = EI_INIT; static expert_field ei_sctp_nr_sack_chunk_number_tsns_gap_acked_100 = EI_INIT; static expert_field ei_sctp_parameter_length = EI_INIT; static expert_field ei_sctp_bad_sctp_checksum = EI_INIT; static expert_field ei_sctp_tsn_retransmitted_more_than_twice = EI_INIT; static expert_field ei_sctp_parameter_padding = EI_INIT; static expert_field ei_sctp_retransmitted_after_ack = EI_INIT; static expert_field ei_sctp_nr_sack_chunk_number_tsns_nr_gap_acked_100 = EI_INIT; static expert_field ei_sctp_sack_chunk_gap_block_out_of_order = EI_INIT; static expert_field ei_sctp_chunk_length_bad = EI_INIT; static expert_field ei_sctp_tsn_retransmitted = EI_INIT; static expert_field ei_sctp_sack_chunk_gap_block_malformed = EI_INIT; static expert_field ei_sctp_sack_chunk_number_tsns_gap_acked_100 = EI_INIT; WS_DLL_PUBLIC_DEF const value_string chunk_type_values[] = { { SCTP_DATA_CHUNK_ID, "DATA" }, { SCTP_INIT_CHUNK_ID, "INIT" }, { SCTP_INIT_ACK_CHUNK_ID, "INIT_ACK" }, { SCTP_SACK_CHUNK_ID, "SACK" }, { SCTP_HEARTBEAT_CHUNK_ID, "HEARTBEAT" }, { SCTP_HEARTBEAT_ACK_CHUNK_ID, "HEARTBEAT_ACK" }, { SCTP_ABORT_CHUNK_ID, "ABORT" }, { SCTP_SHUTDOWN_CHUNK_ID, "SHUTDOWN" }, { SCTP_SHUTDOWN_ACK_CHUNK_ID, "SHUTDOWN_ACK" }, { SCTP_ERROR_CHUNK_ID, "ERROR" }, { SCTP_COOKIE_ECHO_CHUNK_ID, "COOKIE_ECHO" }, { SCTP_COOKIE_ACK_CHUNK_ID, "COOKIE_ACK" }, { SCTP_ECNE_CHUNK_ID, "ECNE" }, { SCTP_CWR_CHUNK_ID, "CWR" }, { SCTP_SHUTDOWN_COMPLETE_CHUNK_ID, "SHUTDOWN_COMPLETE" }, { SCTP_AUTH_CHUNK_ID, "AUTH" }, { SCTP_NR_SACK_CHUNK_ID, "NR_SACK" }, { SCTP_I_DATA_CHUNK_ID, "I_DATA" }, { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF_ACK" }, { SCTP_PKTDROP_CHUNK_ID, "PKTDROP" }, { SCTP_RE_CONFIG_CHUNK_ID, "RE_CONFIG" }, { SCTP_PAD_CHUNK_ID, "PAD" }, { SCTP_FORWARD_TSN_CHUNK_ID, "FORWARD_TSN" }, { SCTP_ASCONF_CHUNK_ID, "ASCONF" }, { SCTP_I_FORWARD_TSN_CHUNK_ID, "I_FORWARD_TSN" }, { SCTP_IETF_EXT, "IETF_EXTENSION" }, { 0, NULL } }; #define CHUNK_TYPE_LENGTH 1 #define CHUNK_FLAGS_LENGTH 1 #define CHUNK_LENGTH_LENGTH 2 #define CHUNK_HEADER_LENGTH (CHUNK_TYPE_LENGTH + \ CHUNK_FLAGS_LENGTH + \ CHUNK_LENGTH_LENGTH) #define CHUNK_HEADER_OFFSET 0 #define CHUNK_TYPE_OFFSET CHUNK_HEADER_OFFSET #define CHUNK_FLAGS_OFFSET (CHUNK_TYPE_OFFSET + CHUNK_TYPE_LENGTH) #define CHUNK_LENGTH_OFFSET (CHUNK_FLAGS_OFFSET + CHUNK_FLAGS_LENGTH) #define CHUNK_VALUE_OFFSET (CHUNK_LENGTH_OFFSET + CHUNK_LENGTH_LENGTH) #define PARAMETER_TYPE_LENGTH 2 #define PARAMETER_LENGTH_LENGTH 2 #define PARAMETER_HEADER_LENGTH (PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_LENGTH) #define PARAMETER_HEADER_OFFSET 0 #define PARAMETER_TYPE_OFFSET PARAMETER_HEADER_OFFSET #define PARAMETER_LENGTH_OFFSET (PARAMETER_TYPE_OFFSET + PARAMETER_TYPE_LENGTH) #define PARAMETER_VALUE_OFFSET (PARAMETER_LENGTH_OFFSET + PARAMETER_LENGTH_LENGTH) #define SOURCE_PORT_LENGTH 2 #define DESTINATION_PORT_LENGTH 2 #define VERIFICATION_TAG_LENGTH 4 #define CHECKSUM_LENGTH 4 #define COMMON_HEADER_LENGTH (SOURCE_PORT_LENGTH + \ DESTINATION_PORT_LENGTH + \ VERIFICATION_TAG_LENGTH + \ CHECKSUM_LENGTH) #define SOURCE_PORT_OFFSET 0 #define DESTINATION_PORT_OFFSET (SOURCE_PORT_OFFSET + SOURCE_PORT_LENGTH) #define VERIFICATION_TAG_OFFSET (DESTINATION_PORT_OFFSET + DESTINATION_PORT_LENGTH) #define CHECKSUM_OFFSET (VERIFICATION_TAG_OFFSET + VERIFICATION_TAG_LENGTH) #define SCTP_CHECKSUM_NONE 0 #define SCTP_CHECKSUM_ADLER32 1 #define SCTP_CHECKSUM_CRC32C 2 #define SCTP_CHECKSUM_AUTOMATIC 3 #define FORWARD_STREAM 0 #define BACKWARD_STREAM 1 #define FORWARD_ADD_FORWARD_VTAG 2 #define BACKWARD_ADD_FORWARD_VTAG 3 #define BACKWARD_ADD_BACKWARD_VTAG 4 #define ASSOC_NOT_FOUND 5 /* Default values for preferences */ static gboolean show_port_numbers = TRUE; static gint sctp_checksum = SCTP_CHECKSUM_NONE; static gboolean enable_tsn_analysis = TRUE; static gboolean enable_association_indexing = FALSE; static gboolean enable_ulp_dissection = TRUE; static gboolean use_reassembly = TRUE; static gboolean show_always_control_chunks = TRUE; static gboolean show_relative_tsns = TRUE; /* Data types and functions for generation/handling of chunk types for chunk statistics */ static const value_string chunk_enabled[] = { {0,"Show"}, {1,"Hide"}, {0, NULL} }; typedef struct _type_field_t { guint type_id; gchar* type_name; guint type_enable; } type_field_t; static type_field_t* type_fields = NULL; static guint num_type_fields = 0; typedef struct _assoc_info_t { guint16 assoc_index; guint16 direction; gboolean vtag_reflected; guint16 sport; guint16 dport; guint32 verification_tag1; guint32 verification_tag2; guint32 initiate_tag; } assoc_info_t; typedef struct _infodata_t { guint16 assoc_index; guint16 direction; } infodata_t; static wmem_list_t *assoc_info_list = NULL; static guint num_assocs = 0; UAT_CSTRING_CB_DEF(type_fields, type_name, type_field_t) UAT_VS_DEF(type_fields, type_enable, type_field_t, guint, 0, "Show") UAT_DEC_CB_DEF(type_fields, type_id, type_field_t) static void *sctp_chunk_type_copy_cb(void* n, const void* o, size_t siz _U_) { type_field_t* new_rec = (type_field_t*)n; const type_field_t* old_rec = (const type_field_t*)o; new_rec->type_name = g_strdup(old_rec->type_name); return new_rec; } static void sctp_chunk_type_free_cb(void* r) { type_field_t* rec = (type_field_t*)r; g_free(rec->type_name); } static gboolean sctp_chunk_type_update_cb(void *r, char **err) { type_field_t *rec = (type_field_t *)r; char c; if (rec->type_name == NULL) { *err = g_strdup("Header name can't be empty"); return FALSE; } g_strstrip(rec->type_name); if (rec->type_name[0] == 0) { *err = g_strdup("Header name can't be empty"); return FALSE; } /* Check for invalid characters (to avoid asserting out when * registering the field). */ c = proto_check_field_name(rec->type_name); if (c) { *err = ws_strdup_printf("Header name can't contain '%c'", c); return FALSE; } *err = NULL; return TRUE; } static dissector_handle_t sctp_handle; static struct _sctp_info sctp_info; #define RETURN_DIRECTION(direction) \ do { \ /*ws_warning("Returning %d at %d: a-itag=0x%x, a-vtag1=0x%x, a-vtag2=0x%x, b-itag=0x%x, b-vtag1=0x%x, b-vtag2=0x%x", \ direction, __LINE__, a->initiate_tag, a->verification_tag1, a->verification_tag2, b->initiate_tag, b->verification_tag1, b->verification_tag2);*/ \ return direction; \ } while (0) static gint sctp_assoc_vtag_cmp(const assoc_info_t *a, const assoc_info_t *b) { if (a == NULL || b == NULL) RETURN_DIRECTION(ASSOC_NOT_FOUND); if ((a->sport == b->sport) && (a->dport == b->dport) && (b->verification_tag2 != 0) && (a->initiate_tag == b->verification_tag2) && (a->initiate_tag == b->initiate_tag)) RETURN_DIRECTION(FORWARD_STREAM); if ((a->sport == b->sport) && (a->dport == b->dport) && (a->verification_tag1 == b->verification_tag1) && (a->initiate_tag == b->initiate_tag)) RETURN_DIRECTION(FORWARD_STREAM); if ((a->sport == b->sport) && (a->dport == b->dport) && (a->verification_tag1 == b->verification_tag1) && (a->verification_tag1 == 0 && a->initiate_tag != 0) && (a->initiate_tag != b->initiate_tag )) RETURN_DIRECTION(ASSOC_NOT_FOUND); /* two INITs that belong to different assocs */ /* assoc known*/ if ((a->sport == b->sport) && (a->dport == b->dport) && (a->verification_tag1 == b->verification_tag1) && ((a->verification_tag1 != 0 || (b->verification_tag2 != 0)))) RETURN_DIRECTION(FORWARD_STREAM); /* ABORT, vtag reflected */ if ((a->sport == b->sport) && (a->dport == b->dport) && (a->verification_tag2 == b->verification_tag2) && (a->verification_tag1 == 0 && b->verification_tag1 != 0)) RETURN_DIRECTION(FORWARD_STREAM); if ((a->sport == b->dport) && (a->dport == b->sport) && (a->verification_tag1 == b->verification_tag2) && (a->verification_tag1 != 0)) RETURN_DIRECTION(BACKWARD_STREAM); if ((a->sport == b->dport) && (a->dport == b->sport) && (a->verification_tag2 == b->verification_tag1) && (a->verification_tag2 != 0)) RETURN_DIRECTION(BACKWARD_STREAM); if ((a->sport == b->dport) && (a->dport == b->sport) && (a->verification_tag1 == b->initiate_tag) && (a->verification_tag2 == 0)) RETURN_DIRECTION(BACKWARD_ADD_BACKWARD_VTAG); /* ABORT, vtag reflected */ if ((a->sport == b->dport) && (a->dport == b->sport) && (a->verification_tag2 == b->verification_tag1) && (a->verification_tag1 == 0 && b->verification_tag2 != 0)) RETURN_DIRECTION(BACKWARD_STREAM); /*forward stream verification tag can be added*/ if ((a->sport == b->sport) && (a->dport == b->dport) && (a->verification_tag1 != 0) && (b->verification_tag1 == 0) && (b->verification_tag2 !=0)) RETURN_DIRECTION(FORWARD_ADD_FORWARD_VTAG); if ((a->sport == b->dport) && (a->dport == b->sport) && (a->verification_tag1 == b->verification_tag2) && (b->verification_tag1 == 0)) RETURN_DIRECTION(BACKWARD_ADD_FORWARD_VTAG); /*backward stream verification tag can be added */ if ((a->sport == b->dport) && (a->dport == b->sport) && (a->verification_tag1 != 0) && (b->verification_tag1 != 0) && (b->verification_tag2 == 0)) RETURN_DIRECTION(BACKWARD_ADD_BACKWARD_VTAG); RETURN_DIRECTION(ASSOC_NOT_FOUND); } #undef RETURN_DIRECTION static infodata_t find_assoc_index(assoc_info_t* tmpinfo, gboolean visited) { assoc_info_t *info = NULL; wmem_list_frame_t *elem; gboolean cmp = FALSE; infodata_t inf; inf.assoc_index = -1; inf.direction = 1; if (assoc_info_list == NULL) { assoc_info_list = wmem_list_new(wmem_file_scope()); } for (elem = wmem_list_head(assoc_info_list); elem; elem = wmem_list_frame_next(elem)) { info = (assoc_info_t*) wmem_list_frame_data(elem); if (!visited) { cmp = sctp_assoc_vtag_cmp(tmpinfo, info); if (cmp < ASSOC_NOT_FOUND) { switch (cmp) { case FORWARD_ADD_FORWARD_VTAG: case BACKWARD_ADD_FORWARD_VTAG: info->verification_tag1 = tmpinfo->verification_tag1; break; case BACKWARD_ADD_BACKWARD_VTAG: info->verification_tag2 = tmpinfo->verification_tag1; info->direction = 1; inf.assoc_index = info->assoc_index; inf.direction = 2; return inf; case BACKWARD_STREAM: inf.assoc_index = info->assoc_index; inf.direction = 2; return inf; } if (cmp == FORWARD_STREAM || cmp == FORWARD_ADD_FORWARD_VTAG) { info->direction = 1; } else { info->direction = 2; } inf.assoc_index = info->assoc_index; inf.direction = info->direction; return inf; } } else { if ((tmpinfo->initiate_tag != 0 && tmpinfo->initiate_tag == info->initiate_tag) || (tmpinfo->verification_tag1 != 0 && tmpinfo->verification_tag1 == info->verification_tag1) || (tmpinfo->verification_tag2 != 0 && tmpinfo->verification_tag2 == info->verification_tag2)) { inf.assoc_index = info->assoc_index; inf.direction = info->direction; return inf; } else if ((tmpinfo->verification_tag1 != 0 && tmpinfo->verification_tag1 == info->verification_tag2) || (tmpinfo->verification_tag2 != 0 && tmpinfo->verification_tag2 == info->verification_tag1) || (tmpinfo->verification_tag1 == 0 && tmpinfo->initiate_tag != 0 && tmpinfo->initiate_tag == info->verification_tag1)) { inf.assoc_index = info->assoc_index; if (info->direction == 1) inf.direction = 2; else inf.direction = 1; return inf; } } } if (!elem && !visited) { info = wmem_new0(wmem_file_scope(), assoc_info_t); info->assoc_index = num_assocs; info->sport = tmpinfo->sport; info->dport = tmpinfo->dport; info->verification_tag1 = tmpinfo->verification_tag1; info->verification_tag2 = tmpinfo->verification_tag2; info->initiate_tag = tmpinfo->initiate_tag; num_assocs++; wmem_list_prepend(assoc_info_list, info); inf.assoc_index = info->assoc_index; inf.direction = 1; } return inf; } static void sctp_src_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_source_port, pinfo->curr_layer_num)); snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer sctp_src_value(packet_info *pinfo) { return p_get_proto_data(pinfo->pool, pinfo, hf_source_port, pinfo->curr_layer_num); } static void sctp_dst_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_destination_port, pinfo->curr_layer_num)); snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer sctp_dst_value(packet_info *pinfo) { return p_get_proto_data(pinfo->pool, pinfo, hf_destination_port, pinfo->curr_layer_num); } static void sctp_both_prompt(packet_info *pinfo, gchar *result) { guint32 srcport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_source_port, pinfo->curr_layer_num)), destport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_destination_port, pinfo->curr_layer_num)); snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } static void sctp_ppi_prompt1(packet_info *pinfo _U_, gchar* result) { guint32 ppid = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 0)); if (ppid == LAST_PPID) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (none)"); } else { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (%d)", ppid); } } static void sctp_ppi_prompt2(packet_info *pinfo _U_, gchar* result) { guint32 ppid = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 1)); if (ppid == LAST_PPID) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (none)"); } else { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (%d)", ppid); } } static gpointer sctp_ppi_value1(packet_info *pinfo) { return p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 0); } static gpointer sctp_ppi_value2(packet_info *pinfo) { return p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 1); } static const char* sctp_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) { if (filter == CONV_FT_SRC_PORT) return "sctp.srcport"; if (filter == CONV_FT_DST_PORT) return "sctp.dstport"; if (filter == CONV_FT_ANY_PORT) return "sctp.port"; if(!conv) { return CONV_FILTER_INVALID; } if (filter == CONV_FT_SRC_ADDRESS) { if (conv->src_address.type == AT_IPv4) return "ip.src"; if (conv->src_address.type == AT_IPv6) return "ipv6.src"; } if (filter == CONV_FT_DST_ADDRESS) { if (conv->dst_address.type == AT_IPv4) return "ip.dst"; if (conv->dst_address.type == AT_IPv6) return "ipv6.dst"; } if (filter == CONV_FT_ANY_ADDRESS) { if (conv->src_address.type == AT_IPv4) return "ip.addr"; if (conv->src_address.type == AT_IPv6) return "ipv6.addr"; } return CONV_FILTER_INVALID; } static ct_dissector_info_t sctp_ct_dissector_info = {&sctp_conv_get_filter_type}; static tap_packet_status sctp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags) { conv_hash_t *hash = (conv_hash_t*) pct; hash->flags = flags; const struct _sctp_info *sctphdr=(const struct _sctp_info *)vip; add_conversation_table_data(hash, &sctphdr->ip_src, &sctphdr->ip_dst, sctphdr->sport, sctphdr->dport, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &sctp_ct_dissector_info, CONVERSATION_SCTP); return TAP_PACKET_REDRAW; } static const char* sctp_endpoint_get_filter_type(endpoint_item_t* endpoint, conv_filter_type_e filter) { if (filter == CONV_FT_SRC_PORT) return "sctp.srcport"; if (filter == CONV_FT_DST_PORT) return "sctp.dstport"; if (filter == CONV_FT_ANY_PORT) return "sctp.port"; if(!endpoint) { return CONV_FILTER_INVALID; } if (filter == CONV_FT_SRC_ADDRESS) { if (endpoint->myaddress.type == AT_IPv4) return "ip.src"; if (endpoint->myaddress.type == AT_IPv6) return "ipv6.src"; } if (filter == CONV_FT_DST_ADDRESS) { if (endpoint->myaddress.type == AT_IPv4) return "ip.dst"; if (endpoint->myaddress.type == AT_IPv6) return "ipv6.dst"; } if (filter == CONV_FT_ANY_ADDRESS) { if (endpoint->myaddress.type == AT_IPv4) return "ip.addr"; if (endpoint->myaddress.type == AT_IPv6) return "ipv6.addr"; } return CONV_FILTER_INVALID; } static et_dissector_info_t sctp_endpoint_dissector_info = {&sctp_endpoint_get_filter_type}; static tap_packet_status sctp_endpoint_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags) { conv_hash_t *hash = (conv_hash_t*) pit; hash->flags = flags; const struct _sctp_info *sctphdr=(const struct _sctp_info *)vip; /* Take two "add" passes per packet, adding for each direction, ensures that all packets are counted properly (even if address is sending to itself) XXX - this could probably be done more efficiently inside endpoint_table */ add_endpoint_table_data(hash, &sctphdr->ip_src, sctphdr->sport, TRUE, 1, pinfo->fd->pkt_len, &sctp_endpoint_dissector_info, ENDPOINT_SCTP); add_endpoint_table_data(hash, &sctphdr->ip_dst, sctphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &sctp_endpoint_dissector_info, ENDPOINT_SCTP); return TAP_PACKET_REDRAW; } static unsigned int sctp_adler32(tvbuff_t *tvb, unsigned int len) { const guint8 *buf = tvb_get_ptr(tvb, 0, len); guint32 result = 1; result = update_adler32(result, buf, SOURCE_PORT_LENGTH + DESTINATION_PORT_LENGTH + VERIFICATION_TAG_LENGTH); /* handle four 0 bytes as checksum */ result = update_adler32(result, "\0\0\0\0", 4); result = update_adler32(result, buf+COMMON_HEADER_LENGTH, len-COMMON_HEADER_LENGTH); return result; } static guint32 sctp_crc32c(tvbuff_t *tvb, unsigned int len) { const guint8 *buf = tvb_get_ptr(tvb, 0, len); guint32 crc32, zero = 0; guint32 result; /* CRC for header */ crc32 = crc32c_calculate_no_swap(buf, SOURCE_PORT_LENGTH + DESTINATION_PORT_LENGTH + VERIFICATION_TAG_LENGTH, CRC32C_PRELOAD); /* handle four 0 bytes as checksum */ crc32 = crc32c_calculate_no_swap(&zero, 4, crc32); /* CRC for the rest of the packet */ crc32 = crc32c_calculate_no_swap(&buf[COMMON_HEADER_LENGTH], len-COMMON_HEADER_LENGTH, crc32); result = CRC32C_SWAP(crc32); return ( ~result ); } /* * Routines for dissecting parameters */ typedef struct _sctp_half_assoc_t sctp_half_assoc_t; static void dissect_parameter(tvbuff_t *, packet_info *, proto_tree *, proto_item *, gboolean, gboolean); static void dissect_parameters(tvbuff_t *, packet_info *, proto_tree *, proto_item *, gboolean); static void dissect_error_cause(tvbuff_t *, packet_info *, proto_tree *); static void dissect_error_causes(tvbuff_t *, packet_info *, proto_tree *); static gboolean dissect_data_chunk(tvbuff_t*, guint16, packet_info*, proto_tree*, proto_tree*, proto_item*, proto_item*, sctp_half_assoc_t*, gboolean); static void dissect_sctp_packet(tvbuff_t *, packet_info *, proto_tree *, gboolean); /* TSN ANALYSIS CODE */ struct _sctp_half_assoc_t { guint32 spt; guint32 dpt; guint32 vtag; gboolean started; guint32 first_tsn; /* start */ guint32 cumm_ack; /* rel */ wmem_tree_t *tsns; /* sctp_tsn_t* by rel_tsn */ wmem_tree_t *tsn_acks; /* sctp_tsn_t* by ctsn_frame */ struct _sctp_half_assoc_t *peer; }; typedef struct _retransmit_t { guint32 framenum; nstime_t ts; struct _retransmit_t *next; } retransmit_t; typedef struct _sctp_tsn_t { guint32 tsn; struct { guint32 framenum; nstime_t ts; } first_transmit; struct { guint32 framenum; nstime_t ts; } ack; retransmit_t *retransmit; guint32 retransmit_count; struct _sctp_tsn_t *next; } sctp_tsn_t; static wmem_tree_key_t* make_address_key(wmem_allocator_t *pool, guint32 spt, guint32 dpt, address *addr) { wmem_tree_key_t *k = (wmem_tree_key_t *)wmem_alloc(pool, sizeof(wmem_tree_key_t)*6); k[0].length = 1; k[0].key = (guint32*)wmem_memdup(pool, &spt,sizeof(spt)); k[1].length = 1; k[1].key = (guint32*)wmem_memdup(pool, &dpt,sizeof(dpt)); k[2].length = 1; k[2].key = (guint32*)(void *)&(addr->type); k[3].length = 1; k[3].key = (guint32*)(void *)&(addr->len); k[4].length = ((addr->len/4)+1); k[4].key = (guint32*)wmem_alloc0(pool, ((addr->len/4)+1)*4); if (addr->len) memcpy(k[4].key, addr->data, addr->len); k[5].length = 0; k[5].key = NULL; return k; } static wmem_tree_key_t * make_dir_key(wmem_allocator_t *pool, guint32 spt, guint32 dpt, guint32 vtag) { wmem_tree_key_t *k = (wmem_tree_key_t *)wmem_alloc(pool, sizeof(wmem_tree_key_t)*4); k[0].length = 1; k[0].key = (guint32*)wmem_memdup(pool, &spt,sizeof(spt)); k[1].length = 1; k[1].key = (guint32*)wmem_memdup(pool, &dpt,sizeof(dpt)); k[2].length = 1; k[2].key = (guint32*)wmem_memdup(pool, &vtag,sizeof(vtag)); k[3].length = 0; k[3].key = NULL; return k; } static wmem_tree_t *dirs_by_ptvtag; /* sctp_half_assoc_t* */ static wmem_tree_t *dirs_by_ptaddr; /* sctp_half_assoc_t**, it may contain a null pointer */ static sctp_half_assoc_t * get_half_assoc(packet_info *pinfo, guint32 spt, guint32 dpt, guint32 vtag) { sctp_half_assoc_t *ha; sctp_half_assoc_t **hb; wmem_tree_key_t *k; if (!enable_tsn_analysis || !vtag || pinfo->flags.in_error_pkt) return NULL; /* look for the current half_assoc by spt, dpt and vtag */ k = make_dir_key(pinfo->pool, spt, dpt, vtag); if (( ha = (sctp_half_assoc_t *)wmem_tree_lookup32_array(dirs_by_ptvtag, k) )) { /* found, if it has been already matched we're done */ if (ha->peer) return ha; } else { /* not found, make a new one and add it to the table */ ha = wmem_new0(wmem_file_scope(), sctp_half_assoc_t); ha->spt = spt; ha->dpt = dpt; ha->vtag = vtag; ha->tsns = wmem_tree_new(wmem_file_scope()); ha->tsn_acks = wmem_tree_new(wmem_file_scope()); ha->started = FALSE; ha->first_tsn= 0; ha->cumm_ack= 0; /* add this half to the table indexed by ports and vtag */ wmem_tree_insert32_array(dirs_by_ptvtag, k, ha); } /* at this point we have an unmatched half, look for its other half using the ports and IP address */ k = make_address_key(pinfo->pool, dpt, spt, &(pinfo->dst)); if (( hb = (sctp_half_assoc_t **)wmem_tree_lookup32_array(dirs_by_ptaddr, k) )) { /*the table contains a pointer to a pointer to a half */ if (! *hb) { /* if there is no half pointed by this, add the current half to the table */ *hb = ha; } else { /* there's a half pointed by this, assume it's our peer and clear the table's pointer */ ha->peer = *hb; (*hb)->peer = ha; *hb = NULL; } } else { /* we found no entry in the table: add one (using reversed ports and src addresss) so that it can be matched later */ *(hb = (sctp_half_assoc_t **)wmem_alloc(wmem_file_scope(), sizeof(void*))) = ha; k = make_address_key(pinfo->pool, spt, dpt, &(pinfo->src)); wmem_tree_insert32_array(dirs_by_ptaddr, k, hb); } return ha; } /* Limit the number of retransmissions we track (to limit memory usage--and * tree size--in pathological cases, for example zero window probing forever). */ #define MAX_RETRANS_TRACKED_PER_TSN 100 static void tsn_tree(sctp_tsn_t *t, proto_item *tsn_item, packet_info *pinfo, tvbuff_t *tvb, guint32 framenum) { proto_item *pi; proto_tree *pt; proto_tree *tsn_tree_pt = proto_item_add_subtree(tsn_item, ett_sctp_tsn); if (t->first_transmit.framenum != framenum) { nstime_t rto; pi = proto_tree_add_uint(tsn_tree_pt, hf_sctp_retransmission, tvb, 0, 0, t->first_transmit.framenum); pt = proto_item_add_subtree(pi, ett_sctp_tsn_retransmission); proto_item_set_generated(pi); expert_add_info(pinfo, pi, &ei_sctp_tsn_retransmitted); nstime_delta( &rto, &pinfo->abs_ts, &(t->first_transmit.ts) ); pi = proto_tree_add_time(pt, hf_sctp_rto, tvb, 0, 0, &rto); proto_item_set_generated(pi); /* Detect reneged acks */ /* XXX what if the frames aren't sorted by time? */ if (t->ack.framenum && t->ack.framenum < framenum) { pi = proto_tree_add_uint_format(pt, hf_sctp_retransmitted_after_ack, tvb, 0, 0, t->ack.framenum, "This TSN was acked (in frame %u) prior to this retransmission (reneged ack?)", t->ack.framenum); proto_item_set_generated(pi); expert_add_info(pinfo, pi, &ei_sctp_retransmitted_after_ack); } } else if (t->retransmit) { retransmit_t **r; nstime_t rto; char ds[64]; if (t->retransmit_count > MAX_RETRANS_TRACKED_PER_TSN) snprintf(ds, sizeof(ds), " (only %d displayed)", MAX_RETRANS_TRACKED_PER_TSN); else ds[0] = 0; pi = proto_tree_add_uint_format(tsn_tree_pt, hf_sctp_retransmitted_count, tvb, 0, 0, t->retransmit_count, "This TSN was retransmitted %u time%s%s", t->retransmit_count, plurality(t->retransmit_count, "", "s"), ds); proto_item_set_generated(pi); if (t->retransmit_count > 2) expert_add_info(pinfo, pi, &ei_sctp_tsn_retransmitted_more_than_twice); pt = proto_item_add_subtree(pi, ett_sctp_tsn_retransmitted_count); r = &t->retransmit; while (*r) { nstime_delta(&rto, &((*r)->ts), &pinfo->abs_ts); pi = proto_tree_add_uint_format(pt, hf_sctp_retransmitted, tvb, 0, 0, (*r)->framenum, "This TSN was retransmitted in frame %u (%s seconds after this frame)", (*r)->framenum, rel_time_to_secs_str(pinfo->pool, &rto)); proto_item_set_generated(pi); r = &(*r)->next; } } if (t->ack.framenum) { nstime_t rtt; pi = proto_tree_add_uint(tsn_tree_pt, hf_sctp_acked, tvb, 0 , 0, t->ack.framenum); proto_item_set_generated(pi); pt = proto_item_add_subtree(pi, ett_sctp_ack); nstime_delta( &rtt, &(t->ack.ts), &(t->first_transmit.ts) ); pi = proto_tree_add_time(pt, hf_sctp_data_rtt, tvb, 0, 0, &rtt); proto_item_set_generated(pi); } } #define RELTSN(tsn) (((tsn) < h->first_tsn) ? (tsn + (0xffffffff - (h->first_tsn)) + 1) : (tsn - h->first_tsn)) /* Returns TRUE if the tsn is a retransmission (we've seen it before), FALSE * otherwise. */ static gboolean sctp_tsn(packet_info *pinfo, tvbuff_t *tvb, proto_item *tsn_item, sctp_half_assoc_t *h, guint32 tsn) { sctp_tsn_t *t; guint32 framenum; guint32 reltsn; gboolean is_retransmission = FALSE; /* no half assoc? nothing to do!*/ if (!h) return(is_retransmission); framenum = pinfo->num; /* If we're dissecting for a read filter in the GUI [tshark assigns * frame numbers before running the read filter], don't do the TSN * analysis. (We can't anyway because we don't have a valid frame * number...) * * Without this check if you load a capture file in the * GUI while using a read filter, every SCTP TSN is marked as a * retransmission of that in frame 0. */ if (framenum == 0) return(is_retransmission); /* we have not seen any tsn yet in this half assoc set the ground */ if (! h->started) { h->first_tsn = tsn; h->started = TRUE; } reltsn = RELTSN(tsn); /* printf("%.3d REL TSN: %p->%p [%u] %u \n",framenum,h,h->peer,tsn,reltsn); */ /* look for this tsn in this half's tsn table */ if (! (t = (sctp_tsn_t *)wmem_tree_lookup32(h->tsns,reltsn) )) { /* no tsn found, create a new one */ t = wmem_new0(wmem_file_scope(), sctp_tsn_t); t->tsn = tsn; t->first_transmit.framenum = framenum; t->first_transmit.ts = pinfo->abs_ts; wmem_tree_insert32(h->tsns,reltsn,t); } is_retransmission = (t->first_transmit.framenum != framenum); if ( (! pinfo->fd->visited ) && is_retransmission ) { retransmit_t **r; int i; t->retransmit_count++; r = &t->retransmit; i = 0; while (*r && i < MAX_RETRANS_TRACKED_PER_TSN) { r = &(*r)->next; i++; } if (i <= MAX_RETRANS_TRACKED_PER_TSN) { *r = wmem_new0(wmem_file_scope(), retransmit_t); (*r)->framenum = framenum; (*r)->ts = pinfo->abs_ts; } } tsn_tree(t, tsn_item, pinfo, tvb, framenum); return(is_retransmission); } static void ack_tree(sctp_tsn_t *t, proto_tree *acks_tree, tvbuff_t *tvb, packet_info *pinfo) { proto_item *pi; proto_tree *pt; nstime_t rtt; guint framenum = pinfo->num; if ( t->ack.framenum == framenum ) { nstime_delta( &rtt, &(t->ack.ts), &(t->first_transmit.ts) ); pi = proto_tree_add_uint(acks_tree, hf_sctp_ack_tsn, tvb, 0 , 0, t->tsn); proto_item_set_generated(pi); pt = proto_item_add_subtree(pi, ett_sctp_acked); pi = proto_tree_add_uint(pt, hf_sctp_ack_frame, tvb, 0 , 0, t->first_transmit.framenum); proto_item_set_generated(pi); pi = proto_tree_add_time(pt, hf_sctp_sack_rtt, tvb, 0, 0, &rtt); proto_item_set_generated(pi); } } static void sctp_ack(packet_info *pinfo, tvbuff_t *tvb, proto_tree *acks_tree, sctp_half_assoc_t *h, guint32 reltsn) { sctp_tsn_t *t; guint32 framenum; if (!h || !h->peer) return; framenum = pinfo->num; /* printf("%.6d ACK: %p->%p [%u] \n",framenum,h,h->peer,reltsn); */ t = (sctp_tsn_t *)wmem_tree_lookup32(h->peer->tsns,reltsn); if (t) { if (! t->ack.framenum) { sctp_tsn_t *t2; t->ack.framenum = framenum; t->ack.ts = pinfo->abs_ts; if (( t2 = (sctp_tsn_t *)wmem_tree_lookup32(h->peer->tsn_acks, framenum) )) { for(;t2->next;t2 = t2->next) ; t2->next = t; } else { wmem_tree_insert32(h->peer->tsn_acks, framenum,t); } } if ( t->ack.framenum == framenum) ack_tree(t, acks_tree, tvb, pinfo); } /* else { proto_tree_add_debug_text(acks_tree, tvb, 0 , 0, "Assoc: %p vs %p ?? %ld",h,h->peer,tsn); } */ } #define RELTSNACK(tsn) (((tsn) < h->peer->first_tsn) ? ((tsn) + (0xffffffff - (h->peer->first_tsn)) + 1) : ((tsn) - h->peer->first_tsn)) static void sctp_ack_block(packet_info *pinfo, sctp_half_assoc_t *h, tvbuff_t *tvb, proto_item *acks_tree, const guint32 *tsn_start_ptr, guint32 tsn_end) { sctp_tsn_t *t; guint32 framenum; guint32 rel_start; guint32 rel_end; if ( !h || !h->peer || ! h->peer->started ) return; framenum = pinfo->num; rel_end = RELTSNACK(tsn_end); if (tsn_start_ptr) { rel_start = RELTSNACK(*tsn_start_ptr); /* printf("%.3d BACK: %p->%p [%u-%u]\n",framenum,h,h->peer,rel_start,rel_end); */ } else { rel_start = h->peer->cumm_ack; /* printf("%.3d CACK: %p->%p [%u-%u]\n",framenum,h,h->peer,rel_start,rel_end); */ } if ((t = (sctp_tsn_t *)wmem_tree_lookup32(h->peer->tsn_acks, framenum))) { for(;t;t = t->next) { guint32 tsn = t->tsn; tsn -= h->peer->first_tsn; if (t->ack.framenum == framenum && ( (!tsn_start_ptr) || rel_start <= tsn) && tsn <= rel_end) ack_tree(t, acks_tree, tvb, pinfo); } return; } if (PINFO_FD_VISITED(pinfo) || rel_end < rel_start || rel_end - rel_start > 0xffff0000 ) return; if (! tsn_start_ptr ) h->peer->cumm_ack = rel_end + 1; if (rel_start <= rel_end && rel_end - rel_start < 5000 ) { guint32 rel_tsn, i; for (i=0; i <= rel_end-rel_start; i++) { rel_tsn = (guint32) (i+rel_start); sctp_ack(pinfo, tvb, acks_tree, h, rel_tsn); } } } /* END TSN ANALYSIS CODE */ #define HEARTBEAT_INFO_PARAMETER_INFO_OFFSET PARAMETER_VALUE_OFFSET static void dissect_heartbeat_info_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 heartbeat_info_length; heartbeat_info_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; if (heartbeat_info_length > 0) proto_tree_add_item(parameter_tree, hf_heartbeat_info, parameter_tvb, HEARTBEAT_INFO_PARAMETER_INFO_OFFSET, heartbeat_info_length, ENC_NA); proto_item_append_text(parameter_item, " (Information: %u byte%s)", heartbeat_info_length, plurality(heartbeat_info_length, "", "s")); } #define IPV4_ADDRESS_LENGTH 4 #define IPV4_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET static void dissect_ipv4_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, proto_item *additional_item, gboolean dissecting_init_init_ack_chunk) { if (parameter_tree) { proto_tree_add_item(parameter_tree, hf_ipv4_address, parameter_tvb, IPV4_ADDRESS_OFFSET, IPV4_ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (Address: %s)", tvb_ip_to_str(wmem_packet_scope(), parameter_tvb, IPV4_ADDRESS_OFFSET)); if (additional_item) proto_item_append_text(additional_item, "%s", tvb_ip_to_str(wmem_packet_scope(), parameter_tvb, IPV4_ADDRESS_OFFSET)); } if (dissecting_init_init_ack_chunk) { if (sctp_info.number_of_tvbs < MAXIMUM_NUMBER_OF_TVBS) sctp_info.tvb[sctp_info.number_of_tvbs++] = parameter_tvb; else sctp_info.incomplete = TRUE; } } #define IPV6_ADDRESS_LENGTH 16 #define IPV6_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET static void dissect_ipv6_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, proto_item *additional_item, gboolean dissecting_init_init_ack_chunk) { if (parameter_tree) { proto_tree_add_item(parameter_tree, hf_ipv6_address, parameter_tvb, IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH, ENC_NA); proto_item_append_text(parameter_item, " (Address: %s)", tvb_ip6_to_str(wmem_packet_scope(), parameter_tvb, IPV6_ADDRESS_OFFSET)); if (additional_item) proto_item_append_text(additional_item, "%s", tvb_ip6_to_str(wmem_packet_scope(), parameter_tvb, IPV6_ADDRESS_OFFSET)); } if (dissecting_init_init_ack_chunk) { if (sctp_info.number_of_tvbs < MAXIMUM_NUMBER_OF_TVBS) sctp_info.tvb[sctp_info.number_of_tvbs++] = parameter_tvb; else sctp_info.incomplete = TRUE; } } #define STATE_COOKIE_PARAMETER_COOKIE_OFFSET PARAMETER_VALUE_OFFSET static void dissect_state_cookie_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 state_cookie_length; state_cookie_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; if (state_cookie_length > 0) proto_tree_add_item(parameter_tree, hf_state_cookie, parameter_tvb, STATE_COOKIE_PARAMETER_COOKIE_OFFSET, state_cookie_length, ENC_NA); proto_item_append_text(parameter_item, " (Cookie length: %u byte%s)", state_cookie_length, plurality(state_cookie_length, "", "s")); } static void dissect_unrecognized_parameters_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree) { /* FIXME: Does it contain one or more parameters? */ dissect_parameter(tvb_new_subset_remaining(parameter_tvb, PARAMETER_VALUE_OFFSET), pinfo, parameter_tree, NULL, FALSE, FALSE); } #define COOKIE_PRESERVATIVE_PARAMETER_INCR_LENGTH 4 #define COOKIE_PRESERVATIVE_PARAMETER_INCR_OFFSET PARAMETER_VALUE_OFFSET static void dissect_cookie_preservative_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_cookie_preservative_increment, parameter_tvb, COOKIE_PRESERVATIVE_PARAMETER_INCR_OFFSET, COOKIE_PRESERVATIVE_PARAMETER_INCR_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (Increment :%u msec)", tvb_get_ntohl(parameter_tvb, COOKIE_PRESERVATIVE_PARAMETER_INCR_OFFSET)); } #define HOSTNAME_OFFSET PARAMETER_VALUE_OFFSET static void dissect_hostname_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, proto_item *additional_item) { gchar *hostname; guint16 hostname_length; hostname_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; proto_tree_add_item_ret_display_string(parameter_tree, hf_hostname, parameter_tvb, HOSTNAME_OFFSET, hostname_length, ENC_ASCII, wmem_packet_scope(), &hostname); if (hostname_length > 1) { proto_item_append_text(parameter_item, " (Hostname: %s)", hostname); if (additional_item != NULL) { proto_item_append_text(additional_item, " (Hostname: %s)", hostname); } } } #define IPv4_ADDRESS_TYPE 5 #define IPv6_ADDRESS_TYPE 6 #define HOSTNAME_ADDRESS_TYPE 11 static const value_string address_types_values[] = { { IPv4_ADDRESS_TYPE, "IPv4 address" }, { IPv6_ADDRESS_TYPE, "IPv6 address" }, { HOSTNAME_ADDRESS_TYPE, "Hostname address" }, { 0, NULL } }; #define SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH 2 static void dissect_supported_address_types_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 addr_type, number_of_addr_types, addr_type_number; guint offset; number_of_addr_types = (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) / SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH; offset = PARAMETER_VALUE_OFFSET; proto_item_append_text(parameter_item, " (Supported types: "); for(addr_type_number = 0; addr_type_number < number_of_addr_types; addr_type_number++) { proto_tree_add_item(parameter_tree, hf_supported_address_type, parameter_tvb, offset, SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH, ENC_BIG_ENDIAN); addr_type = tvb_get_ntohs(parameter_tvb, offset); switch (addr_type) { case IPv4_ADDRESS_TYPE: proto_item_append_text(parameter_item, "IPv4"); break; case IPv6_ADDRESS_TYPE: proto_item_append_text(parameter_item, "IPv6"); break; case HOSTNAME_ADDRESS_TYPE: proto_item_append_text(parameter_item, "hostname"); break; default: proto_item_append_text(parameter_item, "%u", addr_type); } if (addr_type_number < (number_of_addr_types-1)) proto_item_append_text(parameter_item, ", "); offset += SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH; } proto_item_append_text(parameter_item, ")"); } #define STREAM_RESET_SEQ_NR_LENGTH 4 #define SENDERS_LAST_ASSIGNED_TSN_LENGTH 4 #define SID_LENGTH 2 #define STREAM_RESET_REQ_SEQ_NR_OFFSET PARAMETER_VALUE_OFFSET #define STREAM_RESET_REQ_RSP_SEQ_NR_OFFSET (PARAMETER_VALUE_OFFSET + STREAM_RESET_SEQ_NR_LENGTH) #define SENDERS_LAST_ASSIGNED_TSN_OFFSET (STREAM_RESET_REQ_RSP_SEQ_NR_OFFSET + STREAM_RESET_SEQ_NR_LENGTH) static void dissect_outgoing_ssn_reset_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item _U_) { guint length, number_of_sids, sid_number, sid_offset; proto_tree_add_item(parameter_tree, hf_stream_reset_req_seq_nr, parameter_tvb, STREAM_RESET_REQ_SEQ_NR_OFFSET, STREAM_RESET_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_stream_reset_rsp_seq_nr, parameter_tvb, STREAM_RESET_REQ_RSP_SEQ_NR_OFFSET, STREAM_RESET_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_senders_last_assigned_tsn, parameter_tvb, SENDERS_LAST_ASSIGNED_TSN_OFFSET, SENDERS_LAST_ASSIGNED_TSN_LENGTH, ENC_BIG_ENDIAN); length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); sid_offset = SENDERS_LAST_ASSIGNED_TSN_OFFSET + SENDERS_LAST_ASSIGNED_TSN_LENGTH; if (length > PARAMETER_HEADER_LENGTH + STREAM_RESET_SEQ_NR_LENGTH + STREAM_RESET_SEQ_NR_LENGTH + SENDERS_LAST_ASSIGNED_TSN_LENGTH) { number_of_sids = (length - (PARAMETER_HEADER_LENGTH + STREAM_RESET_SEQ_NR_LENGTH + STREAM_RESET_SEQ_NR_LENGTH + SENDERS_LAST_ASSIGNED_TSN_LENGTH)) / SID_LENGTH; for(sid_number = 0; sid_number < number_of_sids; sid_number++) { proto_tree_add_item(parameter_tree, hf_stream_reset_sid, parameter_tvb, sid_offset, SID_LENGTH, ENC_BIG_ENDIAN); sid_offset += SID_LENGTH; } } } static void dissect_incoming_ssn_reset_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item _U_) { guint length, number_of_sids, sid_number, sid_offset; proto_tree_add_item(parameter_tree, hf_stream_reset_req_seq_nr, parameter_tvb, STREAM_RESET_REQ_SEQ_NR_OFFSET, STREAM_RESET_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); sid_offset = STREAM_RESET_REQ_SEQ_NR_OFFSET + STREAM_RESET_SEQ_NR_LENGTH; if (length > PARAMETER_HEADER_LENGTH + STREAM_RESET_SEQ_NR_LENGTH) { number_of_sids = (length - (PARAMETER_HEADER_LENGTH + STREAM_RESET_SEQ_NR_LENGTH)) / SID_LENGTH; for(sid_number = 0; sid_number < number_of_sids; sid_number++) { proto_tree_add_item(parameter_tree, hf_stream_reset_sid, parameter_tvb, sid_offset, SID_LENGTH, ENC_BIG_ENDIAN); sid_offset += SID_LENGTH; } } } #define STREAM_RESET_REQ_SEQ_NR_OFFSET PARAMETER_VALUE_OFFSET static void dissect_ssn_tsn_reset_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item _U_) { proto_tree_add_item(parameter_tree, hf_stream_reset_req_seq_nr, parameter_tvb, STREAM_RESET_REQ_SEQ_NR_OFFSET, STREAM_RESET_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); } #define STREAM_RESET_RSP_RESULT_LENGTH 4 #define SENDERS_NEXT_TSN_LENGTH 4 #define RECEIVERS_NEXT_TSN_LENGTH 4 #define STREAM_RESET_RSP_RSP_SEQ_NR_OFFSET PARAMETER_VALUE_OFFSET #define STREAM_RESET_RSP_RESULT_OFFSET (STREAM_RESET_RSP_RSP_SEQ_NR_OFFSET + STREAM_RESET_SEQ_NR_LENGTH) #define SENDERS_NEXT_TSN_OFFSET (STREAM_RESET_RSP_RESULT_OFFSET + STREAM_RESET_RSP_RESULT_LENGTH) #define RECEIVERS_NEXT_TSN_OFFSET (SENDERS_NEXT_TSN_OFFSET + SENDERS_NEXT_TSN_LENGTH) static const value_string stream_reset_result_values[] = { { 0, "Nothing to do" }, { 1, "Performed" }, { 2, "Denied" }, { 3, "Error - Wrong SSN" }, { 4, "Error - Request already in progress" }, { 5, "Error - Bad sequence number" }, { 6, "In progress" }, { 0, NULL } }; static void dissect_re_configuration_response_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item _U_) { guint length; length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); proto_tree_add_item(parameter_tree, hf_stream_reset_rsp_seq_nr, parameter_tvb, STREAM_RESET_RSP_RSP_SEQ_NR_OFFSET, STREAM_RESET_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_stream_reset_rsp_result, parameter_tvb, STREAM_RESET_RSP_RESULT_OFFSET, STREAM_RESET_RSP_RESULT_LENGTH, ENC_BIG_ENDIAN); if (length >= PARAMETER_HEADER_LENGTH + STREAM_RESET_SEQ_NR_LENGTH + STREAM_RESET_RSP_RESULT_LENGTH + SENDERS_NEXT_TSN_LENGTH) proto_tree_add_item(parameter_tree, hf_senders_next_tsn, parameter_tvb, SENDERS_NEXT_TSN_OFFSET, SENDERS_NEXT_TSN_LENGTH, ENC_BIG_ENDIAN); if (length >= PARAMETER_HEADER_LENGTH + STREAM_RESET_SEQ_NR_LENGTH + STREAM_RESET_RSP_RESULT_LENGTH + SENDERS_NEXT_TSN_LENGTH + RECEIVERS_NEXT_TSN_LENGTH) proto_tree_add_item(parameter_tree, hf_receivers_next_tsn, parameter_tvb, RECEIVERS_NEXT_TSN_OFFSET, RECEIVERS_NEXT_TSN_LENGTH, ENC_BIG_ENDIAN); } #define ADD_OUTGOING_STREAM_REQ_SEQ_NR_LENGTH 4 #define ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_LENGTH 2 #define ADD_OUTGOING_STREAM_REQ_RESERVED_LENGTH 2 #define ADD_OUTGOING_STREAM_REQ_SEQ_NR_OFFSET PARAMETER_VALUE_OFFSET #define ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_OFFSET (ADD_OUTGOING_STREAM_REQ_SEQ_NR_OFFSET + ADD_OUTGOING_STREAM_REQ_SEQ_NR_LENGTH) #define ADD_OUTGOING_STREAM_REQ_RESERVED_OFFSET (ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_OFFSET + ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_LENGTH) static void dissect_add_outgoing_streams_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item _U_) { /* guint length; */ /* length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); */ proto_tree_add_item(parameter_tree, hf_stream_reset_req_seq_nr, parameter_tvb, ADD_OUTGOING_STREAM_REQ_SEQ_NR_OFFSET, ADD_OUTGOING_STREAM_REQ_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_add_outgoing_streams_number_streams, parameter_tvb, ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_OFFSET, ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_add_outgoing_streams_reserved, parameter_tvb, ADD_OUTGOING_STREAM_REQ_RESERVED_OFFSET, ADD_OUTGOING_STREAM_REQ_RESERVED_LENGTH, ENC_BIG_ENDIAN); } #define ADD_INCOMING_STREAM_REQ_SEQ_NR_LENGTH 4 #define ADD_INCOMING_STREAM_REQ_NUM_STREAMS_LENGTH 2 #define ADD_INCOMING_STREAM_REQ_RESERVED_LENGTH 2 #define ADD_INCOMING_STREAM_REQ_SEQ_NR_OFFSET PARAMETER_VALUE_OFFSET #define ADD_INCOMING_STREAM_REQ_NUM_STREAMS_OFFSET (ADD_INCOMING_STREAM_REQ_SEQ_NR_OFFSET + ADD_OUTGOING_STREAM_REQ_SEQ_NR_LENGTH) #define ADD_INCOMING_STREAM_REQ_RESERVED_OFFSET (ADD_INCOMING_STREAM_REQ_NUM_STREAMS_OFFSET + ADD_OUTGOING_STREAM_REQ_NUM_STREAMS_LENGTH) static void dissect_add_incoming_streams_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item _U_) { /* guint length; */ /* length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); */ proto_tree_add_item(parameter_tree, hf_stream_reset_req_seq_nr, parameter_tvb, ADD_INCOMING_STREAM_REQ_SEQ_NR_OFFSET, ADD_OUTGOING_STREAM_REQ_SEQ_NR_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_add_incoming_streams_number_streams, parameter_tvb, ADD_INCOMING_STREAM_REQ_NUM_STREAMS_OFFSET, ADD_INCOMING_STREAM_REQ_NUM_STREAMS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_add_incoming_streams_reserved, parameter_tvb, ADD_INCOMING_STREAM_REQ_RESERVED_OFFSET, ADD_INCOMING_STREAM_REQ_RESERVED_LENGTH, ENC_BIG_ENDIAN); } static void dissect_ecn_parameter(tvbuff_t *parameter_tvb _U_) { } #define ZERO_CHECKSUM_PARAMETER_EDMID_LENGTH 4 #define ZERO_CHECKSUM_PARAMETER_EDMID_OFFSET PARAMETER_VALUE_OFFSET static const value_string edmid_values[] = { { 1, "SCTP over DTLS" }, { 0, NULL } }; static void dissect_zero_checksum_acceptable_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_zero_checksum_edmid, parameter_tvb, ZERO_CHECKSUM_PARAMETER_EDMID_OFFSET, ZERO_CHECKSUM_PARAMETER_EDMID_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (EDMID: %s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ZERO_CHECKSUM_PARAMETER_EDMID_OFFSET), edmid_values, "Unknown")); } #define RANDOM_NUMBER_OFFSET PARAMETER_VALUE_OFFSET static void dissect_random_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree) { gint32 number_length; number_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; if (number_length > 0) proto_tree_add_item(parameter_tree, hf_random_number, parameter_tvb, RANDOM_NUMBER_OFFSET, number_length, ENC_NA); } static void dissect_chunks_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 number_of_chunks; guint16 chunk_number, offset; proto_item_append_text(parameter_item, " (Chunk types to be authenticated: "); number_of_chunks = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; for(chunk_number = 0, offset = PARAMETER_VALUE_OFFSET; chunk_number < number_of_chunks; chunk_number++, offset += CHUNK_TYPE_LENGTH) { proto_tree_add_item(parameter_tree, hf_chunks_to_auth, parameter_tvb, offset, CHUNK_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, "%s", val_to_str_const(tvb_get_guint8(parameter_tvb, offset), chunk_type_values, "Unknown")); if (chunk_number < (number_of_chunks - 1)) proto_item_append_text(parameter_item, ", "); } proto_item_append_text(parameter_item, ")"); } static const value_string hmac_id_values[] = { { 0x0000, "Reserved" }, { 0x0001, "SHA-1" }, { 0x0002, "Reserved" }, { 0x0003, "SHA-256" }, { 0, NULL } }; #define HMAC_ID_LENGTH 2 static void dissect_hmac_algo_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 number_of_ids; guint16 id_number, offset; proto_item_append_text(parameter_item, " (Supported HMACs: "); number_of_ids = (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) / HMAC_ID_LENGTH; for(id_number = 0, offset = PARAMETER_VALUE_OFFSET; id_number < number_of_ids; id_number++, offset += HMAC_ID_LENGTH) { proto_tree_add_item(parameter_tree, hf_hmac_id, parameter_tvb, offset, HMAC_ID_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, "%s", val_to_str_const(tvb_get_ntohs(parameter_tvb, offset), hmac_id_values, "Unknown")); if (id_number < (number_of_ids - 1)) proto_item_append_text(parameter_item, ", "); } proto_item_append_text(parameter_item, ")"); } static void dissect_supported_extensions_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 number_of_types; guint16 type_number, offset; proto_item_append_text(parameter_item, " (Supported types: "); number_of_types = (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) / CHUNK_TYPE_LENGTH; for(type_number = 0, offset = PARAMETER_VALUE_OFFSET; type_number < number_of_types; type_number++, offset += CHUNK_TYPE_LENGTH) { proto_tree_add_item(parameter_tree, hf_supported_chunk_type, parameter_tvb, offset, CHUNK_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, "%s", val_to_str_const(tvb_get_guint8(parameter_tvb, offset), chunk_type_values, "Unknown")); if (type_number < (number_of_types - 1)) proto_item_append_text(parameter_item, ", "); } proto_item_append_text(parameter_item, ")"); } static void dissect_forward_tsn_supported_parameter(tvbuff_t *parameter_tvb _U_) { } #define CORRELATION_ID_LENGTH 4 #define CORRELATION_ID_OFFSET PARAMETER_VALUE_OFFSET #define ADDRESS_PARAMETER_OFFSET (CORRELATION_ID_OFFSET + CORRELATION_ID_LENGTH) static void dissect_add_ip_address_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 address_length; tvbuff_t *address_tvb; address_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - CORRELATION_ID_LENGTH; proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN); address_tvb = tvb_new_subset_length_caplen(parameter_tvb, ADDRESS_PARAMETER_OFFSET, MIN(address_length, tvb_captured_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)), MIN(address_length, tvb_reported_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET))); proto_item_append_text(parameter_item, " (Address: "); dissect_parameter(address_tvb, pinfo, parameter_tree, parameter_item, FALSE, FALSE); proto_item_append_text(parameter_item, ", correlation ID: %u)", tvb_get_ntohl(parameter_tvb, CORRELATION_ID_OFFSET)); } static void dissect_del_ip_address_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 address_length; tvbuff_t *address_tvb; address_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - CORRELATION_ID_LENGTH; proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN); address_tvb = tvb_new_subset_length_caplen(parameter_tvb, ADDRESS_PARAMETER_OFFSET, MIN(address_length, tvb_captured_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)), MIN(address_length, tvb_reported_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET))); proto_item_append_text(parameter_item, " (Address: "); dissect_parameter(address_tvb, pinfo, parameter_tree, parameter_item, FALSE, FALSE); proto_item_append_text(parameter_item, ", correlation ID: %u)", tvb_get_ntohl(parameter_tvb, CORRELATION_ID_OFFSET)); } #define ERROR_CAUSE_IND_CASUES_OFFSET (CORRELATION_ID_OFFSET + CORRELATION_ID_LENGTH) static void dissect_error_cause_indication_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree) { guint16 causes_length; tvbuff_t *causes_tvb; proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN); causes_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - CORRELATION_ID_LENGTH; causes_tvb = tvb_new_subset_length_caplen(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET, MIN(causes_length, tvb_captured_length_remaining(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET)), MIN(causes_length, tvb_reported_length_remaining(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET))); dissect_error_causes(causes_tvb, pinfo, parameter_tree); } static void dissect_set_primary_address_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 address_length; tvbuff_t *address_tvb; address_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - CORRELATION_ID_LENGTH; proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN); address_tvb = tvb_new_subset_length_caplen(parameter_tvb, ADDRESS_PARAMETER_OFFSET, MIN(address_length, tvb_captured_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)), MIN(address_length, tvb_reported_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET))); proto_item_append_text(parameter_item, " (Address: "); dissect_parameter(address_tvb, pinfo, parameter_tree, parameter_item, FALSE, FALSE); proto_item_append_text(parameter_item, ", correlation ID: %u)", tvb_get_ntohl(parameter_tvb, CORRELATION_ID_OFFSET)); } static void dissect_success_report_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (Correlation ID: %u)", tvb_get_ntohl(parameter_tvb, CORRELATION_ID_OFFSET)); } #define ADAP_INDICATION_LENGTH 4 #define ADAP_INDICATION_OFFSET PARAMETER_VALUE_OFFSET static void dissect_adap_indication_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_adap_indication, parameter_tvb, ADAP_INDICATION_OFFSET, ADAP_INDICATION_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (Indication: %u)", tvb_get_ntohl(parameter_tvb, ADAP_INDICATION_OFFSET)); } static void dissect_unknown_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 type, parameter_value_length; type = tvb_get_ntohs(parameter_tvb, PARAMETER_TYPE_OFFSET); parameter_value_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; if (parameter_value_length > 0) proto_tree_add_item(parameter_tree, hf_parameter_value, parameter_tvb, PARAMETER_VALUE_OFFSET, parameter_value_length, ENC_NA); proto_item_append_text(parameter_item, " (Type %u, value length: %u byte%s)", type, parameter_value_length, plurality(parameter_value_length, "", "s")); } #define HEARTBEAT_INFO_PARAMETER_ID 0x0001 #define IPV4ADDRESS_PARAMETER_ID 0x0005 #define IPV6ADDRESS_PARAMETER_ID 0x0006 #define STATE_COOKIE_PARAMETER_ID 0x0007 #define UNREC_PARA_PARAMETER_ID 0x0008 #define COOKIE_PRESERVATIVE_PARAMETER_ID 0x0009 #define HOSTNAME_ADDRESS_PARAMETER_ID 0x000b #define SUPPORTED_ADDRESS_TYPES_PARAMETER_ID 0x000c #define OUTGOING_SSN_RESET_REQUEST_PARAMETER_ID 0x000d #define INCOMING_SSN_RESET_REQUEST_PARAMETER_ID 0x000e #define SSN_TSN_RESET_REQUEST_PARAMETER_ID 0x000f #define RE_CONFIGURATION_RESPONSE_PARAMETER_ID 0x0010 #define ADD_OUTGOING_STREAMS_REQUEST_PARAMETER_ID 0x0011 #define ADD_INCOMING_STREAMS_REQUEST_PARAMETER_ID 0x0012 #define ECN_PARAMETER_ID 0x8000 #define ZERO_CHECKSUM_ACCEPTABLE_PARAMETER_ID 0x8001 #define RANDOM_PARAMETER_ID 0x8002 #define CHUNKS_PARAMETER_ID 0x8003 #define HMAC_ALGO_PARAMETER_ID 0x8004 #define SUPPORTED_EXTENSIONS_PARAMETER_ID 0x8008 #define FORWARD_TSN_SUPPORTED_PARAMETER_ID 0xC000 #define ADD_IP_ADDRESS_PARAMETER_ID 0xC001 #define DEL_IP_ADDRESS_PARAMETER_ID 0xC002 #define ERROR_CAUSE_INDICATION_PARAMETER_ID 0xC003 #define SET_PRIMARY_ADDRESS_PARAMETER_ID 0xC004 #define SUCCESS_REPORT_PARAMETER_ID 0xC005 #define ADAP_LAYER_INDICATION_PARAMETER_ID 0xC006 static const value_string parameter_identifier_values[] = { { HEARTBEAT_INFO_PARAMETER_ID, "Heartbeat info" }, { IPV4ADDRESS_PARAMETER_ID, "IPv4 address" }, { IPV6ADDRESS_PARAMETER_ID, "IPv6 address" }, { STATE_COOKIE_PARAMETER_ID, "State cookie" }, { UNREC_PARA_PARAMETER_ID, "Unrecognized parameter" }, { COOKIE_PRESERVATIVE_PARAMETER_ID, "Cookie preservative" }, { HOSTNAME_ADDRESS_PARAMETER_ID, "Hostname address" }, { OUTGOING_SSN_RESET_REQUEST_PARAMETER_ID, "Outgoing SSN reset request" }, { INCOMING_SSN_RESET_REQUEST_PARAMETER_ID, "Incoming SSN reset request" }, { SSN_TSN_RESET_REQUEST_PARAMETER_ID, "SSN/TSN reset request" }, { RE_CONFIGURATION_RESPONSE_PARAMETER_ID, "Re-configuration response" }, { ADD_OUTGOING_STREAMS_REQUEST_PARAMETER_ID, "Add outgoing streams request" }, { ADD_INCOMING_STREAMS_REQUEST_PARAMETER_ID, "Add incoming streams request" }, { SUPPORTED_ADDRESS_TYPES_PARAMETER_ID, "Supported address types" }, { ECN_PARAMETER_ID, "ECN" }, { ZERO_CHECKSUM_ACCEPTABLE_PARAMETER_ID, "Zero checksum acceptable" }, { RANDOM_PARAMETER_ID, "Random" }, { CHUNKS_PARAMETER_ID, "Authenticated Chunk list" }, { HMAC_ALGO_PARAMETER_ID, "Requested HMAC Algorithm" }, { SUPPORTED_EXTENSIONS_PARAMETER_ID, "Supported Extensions" }, { FORWARD_TSN_SUPPORTED_PARAMETER_ID, "Forward TSN supported" }, { ADD_IP_ADDRESS_PARAMETER_ID, "Add IP address" }, { DEL_IP_ADDRESS_PARAMETER_ID, "Delete IP address" }, { ERROR_CAUSE_INDICATION_PARAMETER_ID, "Error cause indication" }, { SET_PRIMARY_ADDRESS_PARAMETER_ID, "Set primary address" }, { SUCCESS_REPORT_PARAMETER_ID, "Success report" }, { ADAP_LAYER_INDICATION_PARAMETER_ID, "Adaptation Layer Indication" }, { 0, NULL } }; #define SCTP_PARAMETER_BIT_1 0x8000 #define SCTP_PARAMETER_BIT_2 0x4000 static const true_false_string sctp_parameter_bit_1_value = { "Skip parameter and continue processing of the chunk", "Stop processing of chunk" }; static const true_false_string sctp_parameter_bit_2_value = { "Do report", "Do not report" }; static void dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *chunk_tree, proto_item *additional_item, gboolean dissecting_init_init_ack_chunk, gboolean final_parameter) { guint16 type, length, padding_length, reported_length; proto_item *parameter_item, *type_item; proto_tree *parameter_tree, *type_tree; type = tvb_get_ntohs(parameter_tvb, PARAMETER_TYPE_OFFSET); length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); reported_length = tvb_reported_length(parameter_tvb); padding_length = reported_length - length; parameter_tree = proto_tree_add_subtree_format(chunk_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, -1, ett_sctp_chunk_parameter, &parameter_item, "%s parameter", val_to_str_const(type, parameter_identifier_values, "Unknown")); if (final_parameter) { if (padding_length > 0) { expert_add_info(pinfo, parameter_item, &ei_sctp_parameter_padding); } } else { if (reported_length % 4) { expert_add_info_format(pinfo, parameter_item, &ei_sctp_parameter_length, "Parameter length is not padded to a multiple of 4 bytes (length=%d)", reported_length); } } if (!(chunk_tree || (dissecting_init_init_ack_chunk && (type == IPV4ADDRESS_PARAMETER_ID || type == IPV6ADDRESS_PARAMETER_ID)))) return; if (chunk_tree) { type_item = proto_tree_add_item(parameter_tree, hf_parameter_type, parameter_tvb, PARAMETER_TYPE_OFFSET, PARAMETER_TYPE_LENGTH, ENC_BIG_ENDIAN); type_tree = proto_item_add_subtree(type_item, ett_sctp_parameter_type); proto_tree_add_item(type_tree, hf_parameter_bit_1, parameter_tvb, PARAMETER_TYPE_OFFSET, PARAMETER_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(type_tree, hf_parameter_bit_2, parameter_tvb, PARAMETER_TYPE_OFFSET, PARAMETER_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_parameter_length, parameter_tvb, PARAMETER_LENGTH_OFFSET, PARAMETER_LENGTH_LENGTH, ENC_BIG_ENDIAN); /* XXX - add expert info if length is bogus? */ } else { parameter_item = NULL; parameter_tree = NULL; } switch(type) { case HEARTBEAT_INFO_PARAMETER_ID: dissect_heartbeat_info_parameter(parameter_tvb, parameter_tree, parameter_item); break; case IPV4ADDRESS_PARAMETER_ID: dissect_ipv4_parameter(parameter_tvb, parameter_tree, parameter_item, additional_item, dissecting_init_init_ack_chunk); break; case IPV6ADDRESS_PARAMETER_ID: dissect_ipv6_parameter(parameter_tvb, parameter_tree, parameter_item, additional_item, dissecting_init_init_ack_chunk); break; case STATE_COOKIE_PARAMETER_ID: dissect_state_cookie_parameter(parameter_tvb, parameter_tree, parameter_item); break; case UNREC_PARA_PARAMETER_ID: dissect_unrecognized_parameters_parameter(parameter_tvb, pinfo, parameter_tree); break; case COOKIE_PRESERVATIVE_PARAMETER_ID: dissect_cookie_preservative_parameter(parameter_tvb, parameter_tree, parameter_item); break; case HOSTNAME_ADDRESS_PARAMETER_ID: dissect_hostname_parameter(parameter_tvb, parameter_tree, parameter_item, additional_item); break; case SUPPORTED_ADDRESS_TYPES_PARAMETER_ID: dissect_supported_address_types_parameter(parameter_tvb, parameter_tree, parameter_item); break; case OUTGOING_SSN_RESET_REQUEST_PARAMETER_ID: dissect_outgoing_ssn_reset_request_parameter(parameter_tvb, parameter_tree, parameter_item); break; case INCOMING_SSN_RESET_REQUEST_PARAMETER_ID: dissect_incoming_ssn_reset_request_parameter(parameter_tvb, parameter_tree, parameter_item); break; case SSN_TSN_RESET_REQUEST_PARAMETER_ID: dissect_ssn_tsn_reset_request_parameter(parameter_tvb, parameter_tree, parameter_item); break; case RE_CONFIGURATION_RESPONSE_PARAMETER_ID: dissect_re_configuration_response_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ADD_OUTGOING_STREAMS_REQUEST_PARAMETER_ID: dissect_add_outgoing_streams_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ADD_INCOMING_STREAMS_REQUEST_PARAMETER_ID: dissect_add_incoming_streams_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ECN_PARAMETER_ID: dissect_ecn_parameter(parameter_tvb); break; case ZERO_CHECKSUM_ACCEPTABLE_PARAMETER_ID: dissect_zero_checksum_acceptable_parameter(parameter_tvb, parameter_tree, parameter_item); break; case RANDOM_PARAMETER_ID: dissect_random_parameter(parameter_tvb, parameter_tree); break; case CHUNKS_PARAMETER_ID: dissect_chunks_parameter(parameter_tvb, parameter_tree, parameter_item); break; case HMAC_ALGO_PARAMETER_ID: dissect_hmac_algo_parameter(parameter_tvb, parameter_tree, parameter_item); break; case SUPPORTED_EXTENSIONS_PARAMETER_ID: dissect_supported_extensions_parameter(parameter_tvb, parameter_tree, parameter_item); break; case FORWARD_TSN_SUPPORTED_PARAMETER_ID: dissect_forward_tsn_supported_parameter(parameter_tvb); break; case ADD_IP_ADDRESS_PARAMETER_ID: dissect_add_ip_address_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item); break; case DEL_IP_ADDRESS_PARAMETER_ID: dissect_del_ip_address_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item); break; case ERROR_CAUSE_INDICATION_PARAMETER_ID: dissect_error_cause_indication_parameter(parameter_tvb, pinfo, parameter_tree); break; case SET_PRIMARY_ADDRESS_PARAMETER_ID: dissect_set_primary_address_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item); break; case SUCCESS_REPORT_PARAMETER_ID: dissect_success_report_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ADAP_LAYER_INDICATION_PARAMETER_ID: dissect_adap_indication_parameter(parameter_tvb, parameter_tree, parameter_item); break; default: dissect_unknown_parameter(parameter_tvb, parameter_tree, parameter_item); break; } if (padding_length > 0) { proto_tree_add_item(parameter_tree, hf_parameter_padding, parameter_tvb, PARAMETER_HEADER_OFFSET + length, padding_length, ENC_NA); } } static void dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tree, proto_item *additional_item, gboolean dissecting_init_init_ack_chunk) { gint offset, length, total_length, remaining_length; tvbuff_t *parameter_tvb; gboolean final_parameter; offset = 0; remaining_length = tvb_reported_length_remaining(parameters_tvb, offset); while (remaining_length > 0) { if ((offset > 0) && additional_item) proto_item_append_text(additional_item, " "); length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET); total_length = WS_ROUNDUP_4(length); /* If we have less bytes than we need, throw an exception while dissecting * the parameter--not when generating the parameter_tvb below. */ total_length = MIN(total_length, remaining_length); /* create a tvb for the parameter including the padding bytes */ parameter_tvb = tvb_new_subset_length_caplen(parameters_tvb, offset, MIN(total_length, tvb_captured_length_remaining(parameters_tvb, offset)), total_length); /* get rid of the handled parameter */ offset += total_length; remaining_length = tvb_reported_length_remaining(parameters_tvb, offset); if (remaining_length > 0) { final_parameter = FALSE; } else { final_parameter = TRUE; } dissect_parameter(parameter_tvb, pinfo, tree, additional_item, dissecting_init_init_ack_chunk, final_parameter); } } /* * Code to handle error causes for ABORT and ERROR chunks */ #define CAUSE_CODE_LENGTH 2 #define CAUSE_LENGTH_LENGTH 2 #define CAUSE_HEADER_LENGTH (CAUSE_CODE_LENGTH + CAUSE_LENGTH_LENGTH) #define CAUSE_HEADER_OFFSET 0 #define CAUSE_CODE_OFFSET CAUSE_HEADER_OFFSET #define CAUSE_LENGTH_OFFSET (CAUSE_CODE_OFFSET + CAUSE_CODE_LENGTH) #define CAUSE_INFO_OFFSET (CAUSE_LENGTH_OFFSET + CAUSE_LENGTH_LENGTH) #define CAUSE_STREAM_IDENTIFIER_LENGTH 2 #define CAUSE_RESERVED_LENGTH 2 #define CAUSE_STREAM_IDENTIFIER_OFFSET CAUSE_INFO_OFFSET #define CAUSE_RESERVED_OFFSET (CAUSE_STREAM_IDENTIFIER_OFFSET + CAUSE_STREAM_IDENTIFIER_LENGTH) static void dissect_invalid_stream_identifier_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree, proto_item *cause_item) { proto_tree_add_item(cause_tree, hf_cause_stream_identifier, cause_tvb, CAUSE_STREAM_IDENTIFIER_OFFSET, CAUSE_STREAM_IDENTIFIER_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(cause_tree, hf_cause_reserved, cause_tvb, CAUSE_RESERVED_OFFSET, CAUSE_RESERVED_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(cause_item, " (SID: %u)", tvb_get_ntohs(cause_tvb, CAUSE_STREAM_IDENTIFIER_OFFSET)); } #define CAUSE_NUMBER_OF_MISSING_PARAMETERS_LENGTH 4 #define CAUSE_MISSING_PARAMETER_TYPE_LENGTH 2 #define CAUSE_NUMBER_OF_MISSING_PARAMETERS_OFFSET CAUSE_INFO_OFFSET #define CAUSE_FIRST_MISSING_PARAMETER_TYPE_OFFSET (CAUSE_NUMBER_OF_MISSING_PARAMETERS_OFFSET + \ CAUSE_NUMBER_OF_MISSING_PARAMETERS_LENGTH ) static void dissect_missing_mandatory_parameters_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree) { guint32 number_of_missing_parameters, missing_parameter_number; guint offset; number_of_missing_parameters = tvb_get_ntohl(cause_tvb, CAUSE_NUMBER_OF_MISSING_PARAMETERS_OFFSET); proto_tree_add_item(cause_tree, hf_cause_number_of_missing_parameters, cause_tvb, CAUSE_NUMBER_OF_MISSING_PARAMETERS_OFFSET, CAUSE_NUMBER_OF_MISSING_PARAMETERS_LENGTH, ENC_BIG_ENDIAN); offset = CAUSE_FIRST_MISSING_PARAMETER_TYPE_OFFSET; for(missing_parameter_number = 0; missing_parameter_number < number_of_missing_parameters; missing_parameter_number++) { proto_tree_add_item(cause_tree, hf_cause_missing_parameter_type, cause_tvb, offset, CAUSE_MISSING_PARAMETER_TYPE_LENGTH, ENC_BIG_ENDIAN); offset += CAUSE_MISSING_PARAMETER_TYPE_LENGTH; } } #define CAUSE_MEASURE_OF_STALENESS_LENGTH 4 #define CAUSE_MEASURE_OF_STALENESS_OFFSET CAUSE_INFO_OFFSET static void dissect_stale_cookie_error_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree, proto_item *cause_item) { proto_tree_add_item(cause_tree, hf_cause_measure_of_staleness, cause_tvb, CAUSE_MEASURE_OF_STALENESS_OFFSET, CAUSE_MEASURE_OF_STALENESS_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(cause_item, " (Measure: %u usec)", tvb_get_ntohl(cause_tvb, CAUSE_MEASURE_OF_STALENESS_OFFSET)); } static void dissect_out_of_resource_cause(tvbuff_t *cause_tvb _U_) { } static void dissect_unresolvable_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree, proto_item *cause_item) { guint16 parameter_length; tvbuff_t *parameter_tvb; parameter_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; parameter_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(parameter_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(parameter_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); dissect_parameter(parameter_tvb, pinfo, cause_tree, cause_item, FALSE, TRUE); } static gboolean dissect_sctp_chunk(tvbuff_t *chunk_tvb, packet_info *pinfo, proto_tree *tree, proto_tree *sctp_tree, sctp_half_assoc_t *assoc, gboolean useinfo); static void dissect_unrecognized_chunk_type_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree, proto_item *cause_item) { guint16 chunk_length; guint8 unrecognized_type; tvbuff_t *unrecognized_chunk_tvb; chunk_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; unrecognized_chunk_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(chunk_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(chunk_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); dissect_sctp_chunk(unrecognized_chunk_tvb, pinfo, cause_tree,cause_tree, NULL, FALSE); unrecognized_type = tvb_get_guint8(unrecognized_chunk_tvb, CHUNK_TYPE_OFFSET); proto_item_append_text(cause_item, " (Type: %u (%s))", unrecognized_type, val_to_str_const(unrecognized_type, chunk_type_values, "unknown")); } static void dissect_invalid_mandatory_parameter_cause(tvbuff_t *cause_tvb _U_) { } static void dissect_unrecognized_parameters_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree) { guint16 cause_info_length; tvbuff_t *unrecognized_parameters_tvb; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; unrecognized_parameters_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); dissect_parameters(unrecognized_parameters_tvb, pinfo, cause_tree, NULL, FALSE); } #define CAUSE_TSN_LENGTH 4 #define CAUSE_TSN_OFFSET CAUSE_INFO_OFFSET static void dissect_no_user_data_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree, proto_item *cause_item) { proto_tree_add_item(cause_tree, hf_cause_tsn, cause_tvb, CAUSE_TSN_OFFSET, CAUSE_TSN_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(cause_item, " (TSN: %u)", tvb_get_ntohl(cause_tvb, CAUSE_TSN_OFFSET)); } static void dissect_cookie_received_while_shutting_down_cause(tvbuff_t *cause_tvb _U_) { } static void dissect_restart_with_new_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree, proto_item *cause_item) { guint16 cause_info_length; tvbuff_t *parameter_tvb; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; parameter_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); proto_item_append_text(cause_item, " (New addresses: "); dissect_parameters(parameter_tvb, pinfo, cause_tree, cause_item, FALSE); proto_item_append_text(cause_item, ")"); } static void dissect_user_initiated_abort_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree) { guint16 cause_info_length; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; if (cause_info_length > 0) proto_tree_add_item(cause_tree, hf_cause_info, cause_tvb, CAUSE_INFO_OFFSET, cause_info_length, ENC_NA); } static void dissect_protocol_violation_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree) { guint16 cause_info_length; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; if (cause_info_length > 0) proto_tree_add_item(cause_tree, hf_cause_info, cause_tvb, CAUSE_INFO_OFFSET, cause_info_length, ENC_NA); } static void dissect_delete_last_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree, proto_item *cause_item) { guint16 cause_info_length; tvbuff_t *parameter_tvb; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; parameter_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); proto_item_append_text(cause_item, " (Last address: "); dissect_parameter(parameter_tvb, pinfo, cause_tree, cause_item, FALSE, FALSE); proto_item_append_text(cause_item, ")"); } static void dissect_resource_outage_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree) { guint16 cause_info_length; tvbuff_t *parameter_tvb; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; parameter_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); dissect_parameter(parameter_tvb, pinfo, cause_tree, NULL, FALSE, FALSE); } static void dissect_delete_source_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree, proto_item *cause_item) { guint16 cause_info_length; tvbuff_t *parameter_tvb; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; parameter_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); proto_item_append_text(cause_item, " (Deleted address: "); dissect_parameter(parameter_tvb, pinfo, cause_tree, cause_item, FALSE, FALSE); proto_item_append_text(cause_item, ")"); } static void dissect_request_refused_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *cause_tree) { guint16 cause_info_length; tvbuff_t *parameter_tvb; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; parameter_tvb = tvb_new_subset_length_caplen(cause_tvb, CAUSE_INFO_OFFSET, MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)), MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET))); dissect_parameter(parameter_tvb, pinfo, cause_tree, NULL, FALSE, FALSE); } static void dissect_unsupported_hmac_id_cause(tvbuff_t *cause_tvb, packet_info *pinfo _U_, proto_tree *cause_tree) { proto_tree_add_item(cause_tree, hf_hmac_id, cause_tvb, CAUSE_INFO_OFFSET, HMAC_ID_LENGTH, ENC_BIG_ENDIAN); } static void dissect_unknown_cause(tvbuff_t *cause_tvb, proto_tree *cause_tree, proto_item *cause_item) { guint16 cause_info_length; cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH; if (cause_info_length > 0) proto_tree_add_item(cause_tree, hf_cause_info, cause_tvb, CAUSE_INFO_OFFSET, cause_info_length, ENC_NA); proto_item_append_text(cause_item, " (Code: %u, information length: %u byte%s)", tvb_get_ntohs(cause_tvb, CAUSE_CODE_OFFSET), cause_info_length, plurality(cause_info_length, "", "s")); } #define INVALID_STREAM_IDENTIFIER 0x01 #define MISSING_MANDATORY_PARAMETERS 0x02 #define STALE_COOKIE_ERROR 0x03 #define OUT_OF_RESOURCE 0x04 #define UNRESOLVABLE_ADDRESS 0x05 #define UNRECOGNIZED_CHUNK_TYPE 0x06 #define INVALID_MANDATORY_PARAMETER 0x07 #define UNRECOGNIZED_PARAMETERS 0x08 #define NO_USER_DATA 0x09 #define COOKIE_RECEIVED_WHILE_SHUTTING_DOWN 0x0a #define RESTART_WITH_NEW_ADDRESSES 0x0b #define USER_INITIATED_ABORT 0x0c #define PROTOCOL_VIOLATION 0x0d #define REQUEST_TO_DELETE_LAST_ADDRESS 0x00a0 #define OPERATION_REFUSED_DUE_TO_RESOURCE_SHORTAGE 0x00a1 #define REQUEST_TO_DELETE_SOURCE_ADDRESS 0x00a2 #define ABORT_DUE_TO_ILLEGAL_ASCONF 0x00a3 #define REQUEST_REFUSED 0x00a4 #define UNSUPPORTED_HMAC_ID 0x0105 static const value_string cause_code_values[] = { { INVALID_STREAM_IDENTIFIER, "Invalid stream identifier" }, { MISSING_MANDATORY_PARAMETERS, "Missing mandatory parameter" }, { STALE_COOKIE_ERROR, "Stale cookie error" }, { OUT_OF_RESOURCE, "Out of resource" }, { UNRESOLVABLE_ADDRESS, "Unresolvable address" }, { UNRECOGNIZED_CHUNK_TYPE, "Unrecognized chunk type" }, { INVALID_MANDATORY_PARAMETER, "Invalid mandatory parameter" }, { UNRECOGNIZED_PARAMETERS, "Unrecognized parameters" }, { NO_USER_DATA, "No user data" }, { COOKIE_RECEIVED_WHILE_SHUTTING_DOWN, "Cookie received while shutting down" }, { RESTART_WITH_NEW_ADDRESSES, "Restart of an association with new addresses" }, { USER_INITIATED_ABORT, "User initiated ABORT" }, { PROTOCOL_VIOLATION, "Protocol violation" }, { REQUEST_TO_DELETE_LAST_ADDRESS, "Request to delete last address" }, { OPERATION_REFUSED_DUE_TO_RESOURCE_SHORTAGE, "Operation refused due to resource shortage" }, { REQUEST_TO_DELETE_SOURCE_ADDRESS, "Request to delete source address" }, { ABORT_DUE_TO_ILLEGAL_ASCONF, "Association Aborted due to illegal ASCONF-ACK" }, { REQUEST_REFUSED, "Request refused - no authorization" }, { UNSUPPORTED_HMAC_ID, "Unsupported HMAC identifier" }, { 0, NULL } }; static void dissect_error_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *chunk_tree) { guint16 code, length, padding_length; proto_item *cause_item; proto_tree *cause_tree; code = tvb_get_ntohs(cause_tvb, CAUSE_CODE_OFFSET); length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET); padding_length = tvb_reported_length(cause_tvb) - length; cause_tree = proto_tree_add_subtree_format(chunk_tree, cause_tvb, CAUSE_HEADER_OFFSET, -1, ett_sctp_chunk_cause, &cause_item, "%s cause", val_to_str_const(code, cause_code_values, "Unknown")); proto_tree_add_item(cause_tree, hf_cause_code, cause_tvb, CAUSE_CODE_OFFSET, CAUSE_CODE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(cause_tree, hf_cause_length, cause_tvb, CAUSE_LENGTH_OFFSET, CAUSE_LENGTH_LENGTH, ENC_BIG_ENDIAN); /* XXX - add expert info if length is bogus? */ switch(code) { case INVALID_STREAM_IDENTIFIER: dissect_invalid_stream_identifier_cause(cause_tvb, cause_tree, cause_item); break; case MISSING_MANDATORY_PARAMETERS: dissect_missing_mandatory_parameters_cause(cause_tvb, cause_tree); break; case STALE_COOKIE_ERROR: dissect_stale_cookie_error_cause(cause_tvb, cause_tree, cause_item); break; case OUT_OF_RESOURCE: dissect_out_of_resource_cause(cause_tvb); break; case UNRESOLVABLE_ADDRESS: dissect_unresolvable_address_cause(cause_tvb, pinfo, cause_tree, cause_item); break; case UNRECOGNIZED_CHUNK_TYPE: dissect_unrecognized_chunk_type_cause(cause_tvb, pinfo, cause_tree, cause_item); break; case INVALID_MANDATORY_PARAMETER: dissect_invalid_mandatory_parameter_cause(cause_tvb); break; case UNRECOGNIZED_PARAMETERS: dissect_unrecognized_parameters_cause(cause_tvb, pinfo, cause_tree); break; case NO_USER_DATA: dissect_no_user_data_cause(cause_tvb, cause_tree, cause_item); break; case COOKIE_RECEIVED_WHILE_SHUTTING_DOWN: dissect_cookie_received_while_shutting_down_cause(cause_tvb); break; case RESTART_WITH_NEW_ADDRESSES: dissect_restart_with_new_address_cause(cause_tvb, pinfo, cause_tree, cause_item); break; case USER_INITIATED_ABORT: dissect_user_initiated_abort_cause(cause_tvb, cause_tree); break; case PROTOCOL_VIOLATION: dissect_protocol_violation_cause(cause_tvb, cause_tree); break; case REQUEST_TO_DELETE_LAST_ADDRESS: dissect_delete_last_address_cause(cause_tvb, pinfo, cause_tree, cause_item); break; case OPERATION_REFUSED_DUE_TO_RESOURCE_SHORTAGE: dissect_resource_outage_cause(cause_tvb, pinfo, cause_tree); break; case REQUEST_TO_DELETE_SOURCE_ADDRESS: dissect_delete_source_address_cause(cause_tvb, pinfo, cause_tree, cause_item); break; case REQUEST_REFUSED: dissect_request_refused_cause(cause_tvb, pinfo, cause_tree); break; case UNSUPPORTED_HMAC_ID: dissect_unsupported_hmac_id_cause(cause_tvb, pinfo, cause_tree); break; default: dissect_unknown_cause(cause_tvb, cause_tree, cause_item); break; } if (padding_length > 0) proto_tree_add_item(cause_tree, hf_cause_padding, cause_tvb, CAUSE_HEADER_OFFSET + length, padding_length, ENC_NA); } static void dissect_error_causes(tvbuff_t *causes_tvb, packet_info *pinfo, proto_tree *tree) { gint offset, length, total_length, remaining_length; tvbuff_t *cause_tvb; offset = 0; while((remaining_length = tvb_reported_length_remaining(causes_tvb, offset))) { length = tvb_get_ntohs(causes_tvb, offset + CAUSE_LENGTH_OFFSET); total_length = WS_ROUNDUP_4(length); /* If we have less bytes than we need, throw an exception while dissecting * the cause--not when generating the causes_tvb below. */ total_length = MIN(total_length, remaining_length); /* create a tvb for the parameter including the padding bytes */ cause_tvb = tvb_new_subset_length_caplen(causes_tvb, offset, MIN(total_length, tvb_captured_length_remaining(causes_tvb, offset)), total_length); dissect_error_cause(cause_tvb, pinfo, tree); /* get rid of the handled cause */ offset += total_length; } } /* * Code to actually dissect the packets */ static gboolean try_heuristic_first = FALSE; static gboolean dissect_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, guint32 ppi) { guint32 low_port, high_port; gboolean try_ppi, try_low_port, try_high_port; heur_dtbl_entry_t *hdtbl_entry; if (enable_ulp_dissection) { /* XXX - we ignore port numbers of 0, as some dissectors use a port number of 0 to disable the port. */ if (pinfo->srcport > pinfo->destport) { low_port = pinfo->destport; high_port = pinfo->srcport; } else { low_port = pinfo->srcport; high_port = pinfo->destport; } try_ppi = FALSE; if (dissector_is_uint_changed(sctp_ppi_dissector_table, ppi)) { if (dissector_try_uint_new(sctp_ppi_dissector_table, ppi, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(ppi))) { return TRUE; } } else { /* The default; try it later */ try_ppi = TRUE; } try_low_port = FALSE; if (low_port != 0) { if (dissector_is_uint_changed(sctp_port_dissector_table, low_port)) { if (dissector_try_uint_new(sctp_port_dissector_table, low_port, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(ppi))) { return TRUE; } } else { /* The default; try it later */ try_low_port = TRUE; } } try_high_port = FALSE; if (high_port != 0) { if (dissector_is_uint_changed(sctp_port_dissector_table, high_port)) { if (dissector_try_uint_new(sctp_port_dissector_table, high_port, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(ppi))) { return TRUE; } } else { /* The default; try it later */ try_high_port = TRUE; } } if (try_heuristic_first) { /* do lookup with the heuristic subdissector table */ if (dissector_try_heuristic(sctp_heur_subdissector_list, payload_tvb, pinfo, tree, &hdtbl_entry, GUINT_TO_POINTER(ppi))) return TRUE; } /* Do lookups with the subdissector table. First try the PPI. When trying port numbers, we try the port number with the lower value first, followed by the port number with the higher value. This means that, for packets where a dissector is registered for *both* port numbers, and where there's no match on the PPI: 1) we pick the same dissector for traffic going in both directions; 2) we prefer the port number that's more likely to be the right one (as that prefers well-known ports to reserved ports); although there is, of course, no guarantee that any such strategy will always pick the right port number. */ if (try_ppi && dissector_try_uint_new(sctp_ppi_dissector_table, ppi, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(ppi))) return TRUE; if (try_low_port && dissector_try_uint_new(sctp_port_dissector_table, low_port, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(ppi))) return TRUE; if (try_high_port && dissector_try_uint_new(sctp_port_dissector_table, high_port, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(ppi))) return TRUE; if (!try_heuristic_first) { /* do lookup with the heuristic subdissector table */ if (dissector_try_heuristic(sctp_heur_subdissector_list, payload_tvb, pinfo, tree, &hdtbl_entry, GUINT_TO_POINTER(ppi))) return TRUE; } } /* Oh, well, we don't know this; dissect it as data. */ call_data_dissector(payload_tvb, pinfo, tree); return TRUE; } #define DATA_CHUNK_TSN_LENGTH 4 #define DATA_CHUNK_STREAM_ID_LENGTH 2 #define DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH 2 #define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 #define I_DATA_CHUNK_RESERVED_LENGTH 2 #define I_DATA_CHUNK_MID_LENGTH 4 #define I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 #define I_DATA_CHUNK_FSN_LENGTH 4 #define DATA_CHUNK_TSN_OFFSET (CHUNK_VALUE_OFFSET + 0) #define DATA_CHUNK_STREAM_ID_OFFSET (DATA_CHUNK_TSN_OFFSET + DATA_CHUNK_TSN_LENGTH) #define DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET (DATA_CHUNK_STREAM_ID_OFFSET + \ DATA_CHUNK_STREAM_ID_LENGTH) #define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET (DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET + \ DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH) #define DATA_CHUNK_PAYLOAD_OFFSET (DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET + \ DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define I_DATA_CHUNK_RESERVED_OFFSET (DATA_CHUNK_STREAM_ID_OFFSET + \ DATA_CHUNK_STREAM_ID_LENGTH) #define I_DATA_CHUNK_MID_OFFSET (I_DATA_CHUNK_RESERVED_OFFSET + \ I_DATA_CHUNK_RESERVED_LENGTH) #define I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET (I_DATA_CHUNK_MID_OFFSET + \ I_DATA_CHUNK_MID_LENGTH) #define I_DATA_CHUNK_FSN_OFFSET (I_DATA_CHUNK_MID_OFFSET + \ I_DATA_CHUNK_MID_LENGTH) #define I_DATA_CHUNK_PAYLOAD_OFFSET (I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET + \ I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ DATA_CHUNK_TSN_LENGTH + \ DATA_CHUNK_STREAM_ID_LENGTH + \ DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH + \ DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define I_DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ DATA_CHUNK_TSN_LENGTH + \ DATA_CHUNK_STREAM_ID_LENGTH + \ I_DATA_CHUNK_RESERVED_LENGTH + \ I_DATA_CHUNK_MID_LENGTH +\ I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define SCTP_DATA_CHUNK_E_BIT 0x01 #define SCTP_DATA_CHUNK_B_BIT 0x02 #define SCTP_DATA_CHUNK_U_BIT 0x04 #define SCTP_DATA_CHUNK_I_BIT 0x08 /* table to hold fragmented SCTP messages */ static GHashTable *frag_table = NULL; typedef struct _frag_key { guint16 sport; guint16 dport; guint32 verification_tag; guint16 stream_id; guint32 stream_seq_num; guint8 u_bit; } frag_key; static gint frag_equal(gconstpointer k1, gconstpointer k2) { const frag_key *key1 = (const frag_key *) k1; const frag_key *key2 = (const frag_key *) k2; return ( (key1->sport == key2->sport) && (key1->dport == key2->dport) && (key1->verification_tag == key2->verification_tag) && (key1->stream_id == key2->stream_id) && (key1->stream_seq_num == key2->stream_seq_num) && (key1->u_bit == key2->u_bit) ? TRUE : FALSE); } static guint frag_hash(gconstpointer k) { const frag_key *key = (const frag_key *) k; return key->sport ^ key->dport ^ key->verification_tag ^ key->stream_id ^ key->stream_seq_num ^ key->u_bit; } static void frag_free_msgs(sctp_frag_msg *msg) { sctp_frag_be *beginend; sctp_fragment *fragment; /* free all begins */ while (msg->begins) { beginend = msg->begins; msg->begins = msg->begins->next; g_free(beginend); } /* free all ends */ while (msg->ends) { beginend = msg->ends; msg->ends = msg->ends->next; g_free(beginend); } /* free all fragments */ while (msg->fragments) { fragment = msg->fragments; msg->fragments = msg->fragments->next; g_free(fragment->data); g_free(fragment); } /* msg->messages is wmem_ allocated, no need to free it */ g_free(msg); } static void sctp_init(void) { frag_table = g_hash_table_new_full(frag_hash, frag_equal, (GDestroyNotify)g_free, (GDestroyNotify)frag_free_msgs); num_assocs = 0; assoc_info_list = NULL; } static void sctp_cleanup(void) { g_hash_table_destroy(frag_table); } static sctp_frag_msg* find_message(guint16 stream_id, guint32 stream_seq_num, guint8 u_bit) { frag_key key; key.sport = sctp_info.sport; key.dport = sctp_info.dport; key.verification_tag = sctp_info.verification_tag; key.stream_id = stream_id; key.stream_seq_num = stream_seq_num; key.u_bit = u_bit; return (sctp_frag_msg *)g_hash_table_lookup(frag_table, &key); } static sctp_fragment* find_fragment(guint32 tsn, guint16 stream_id, guint32 stream_seq_num, guint8 u_bit) { sctp_frag_msg *msg; sctp_fragment *next_fragment; msg = find_message(stream_id, stream_seq_num, u_bit); if (msg) { next_fragment = msg->fragments; while (next_fragment) { if (next_fragment->tsn == tsn) return next_fragment; next_fragment = next_fragment->next; } } return NULL; } static sctp_fragment * add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn, guint16 stream_id, guint32 stream_seq_num, guint8 b_bit, guint8 e_bit, guint8 u_bit, guint32 ppi, gboolean is_idata) { sctp_frag_msg *msg; sctp_fragment *fragment, *last_fragment; sctp_frag_be *beginend, *last_beginend; frag_key *key; /* Don't try to do reassembly on error packets */ if (pinfo->flags.in_error_pkt) return NULL; /* lookup message. if not found, create it */ msg = find_message(stream_id, stream_seq_num, u_bit); if (!msg) { msg = g_new(sctp_frag_msg, 1); msg->begins = NULL; msg->ends = NULL; msg->fragments = NULL; msg->messages = NULL; msg->next = NULL; if (is_idata) if (b_bit) msg->ppi = ppi; else msg->ppi = 0; else msg->ppi = ppi; key = g_new(frag_key, 1); key->sport = sctp_info.sport; key->dport = sctp_info.dport; key->verification_tag = sctp_info.verification_tag; key->stream_id = stream_id; key->stream_seq_num = stream_seq_num; key->u_bit = u_bit; g_hash_table_insert(frag_table, key, msg); } else { if (b_bit) msg->ppi = ppi; } /* lookup segment. if not found, create it */ fragment = find_fragment(tsn, stream_id, stream_seq_num, u_bit); if (fragment) { /* this fragment is already known. * compare frame number to check if it's a duplicate */ if (fragment->frame_num == pinfo->num) { return fragment; } else { /* There already is a fragment having the same ports, v_tag, * stream id, stream_seq_num and tsn but it appeared in a different * frame, so it must be a duplicate fragment. Maybe a retransmission? * Mark it as duplicate and return NULL. * * Note: This won't happen if TSN analysis is on: the caller will have * detected the retransmission and not pass it to the reassembly code. */ col_append_str(pinfo->cinfo, COL_INFO, "(Duplicate Message Fragment) "); proto_tree_add_uint(tree, hf_sctp_duplicate, tvb, 0, 0, fragment->frame_num); return NULL; } } /* There is no point in storing a fragment with no data in it */ if (tvb_captured_length(tvb) == 0) return NULL; /* create new fragment */ fragment = g_new(sctp_fragment, 1); fragment->frame_num = pinfo->num; fragment->tsn = tsn; fragment->len = tvb_captured_length(tvb); fragment->ppi = msg->ppi; fragment->next = NULL; fragment->data = (unsigned char *)g_malloc (fragment->len); tvb_memcpy(tvb, fragment->data, 0, fragment->len); /* add new fragment to linked list. sort ascending by tsn */ if (!msg->fragments) msg->fragments = fragment; else { if (msg->fragments->tsn > fragment->tsn) { fragment->next = msg->fragments; msg->fragments = fragment; } else { last_fragment = msg->fragments; while (last_fragment->next && last_fragment->next->tsn < fragment->tsn) last_fragment = last_fragment->next; fragment->next = last_fragment->next; last_fragment->next = fragment; } } /* save begin or end if necessary */ if (b_bit && !e_bit) { beginend = g_new(sctp_frag_be, 1); beginend->fragment = fragment; beginend->next = NULL; /* add begin to linked list. sort descending by tsn */ if (!msg->begins) msg->begins = beginend; else { if (msg->begins->fragment->tsn < beginend->fragment->tsn) { beginend->next = msg->begins; msg->begins = beginend; } else { last_beginend = msg->begins; while (last_beginend->next && last_beginend->next->fragment->tsn > beginend->fragment->tsn) last_beginend = last_beginend->next; beginend->next = last_beginend->next; last_beginend->next = beginend; } } } if (!b_bit && e_bit) { beginend = g_new(sctp_frag_be, 1); beginend->fragment = fragment; beginend->next = NULL; /* add end to linked list. sort ascending by tsn */ if (!msg->ends) msg->ends = beginend; else { if (msg->ends->fragment->tsn > beginend->fragment->tsn) { beginend->next = msg->ends; msg->ends = beginend; } else { last_beginend = msg->ends; while (last_beginend->next && last_beginend->next->fragment->tsn < beginend->fragment->tsn) last_beginend = last_beginend->next; beginend->next = last_beginend->next; last_beginend->next = beginend; } } } return fragment; } static tvbuff_t* fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, packet_info *pinfo, proto_tree *tree, guint16 stream_id, guint32 stream_seq_num, guint8 u_bit) { sctp_frag_msg *msg; sctp_complete_msg *message, *last_message; sctp_fragment *frag_i, *last_frag, *first_frag; sctp_frag_be *begin, *end, *beginend; guint32 len, offset = 0; tvbuff_t *new_tvb = NULL; proto_item *item; proto_tree *ptree; msg = find_message(stream_id, stream_seq_num, u_bit); if (!msg) { /* no message, we can't do anything */ return NULL; } /* check if fragment is part of an already reassembled message */ for (message = msg->messages; message && !(message->begin <= fragment->tsn && message->end >= fragment->tsn) && !(message->begin > message->end && (message->begin <= fragment->tsn || message->end >= fragment->tsn)); message = message->next); if (message) { /* we found the reassembled message this fragment belongs to */ if (fragment == message->reassembled_in) { /* this is the last fragment, create data source */ new_tvb = tvb_new_child_real_data(tvb, message->data, message->len, message->len); add_new_data_source(pinfo, new_tvb, "Reassembled SCTP Message"); /* display reassembly info */ item = proto_tree_add_item(tree, hf_sctp_fragments, tvb, 0, -1, ENC_NA); ptree = proto_item_add_subtree(item, ett_sctp_fragments); proto_item_append_text(item, " (%u bytes, %u fragments): ", message->len, message->end - message->begin + 1); if (message->begin > message->end) { for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); frag_i; frag_i = frag_i->next) { proto_tree_add_uint_format(ptree, hf_sctp_fragment, new_tvb, offset, frag_i->len, frag_i->frame_num, "Frame: %u, payload: %u-%u (%u bytes)", frag_i->frame_num, offset, offset + frag_i->len - 1, frag_i->len); offset += frag_i->len; mark_frame_as_depended_upon(pinfo->fd, frag_i->frame_num); } for (frag_i = msg->fragments; frag_i && frag_i->tsn <= message->end; frag_i = frag_i->next) { proto_tree_add_uint_format(ptree, hf_sctp_fragment, new_tvb, offset, frag_i->len, frag_i->frame_num, "Frame: %u, payload: %u-%u (%u bytes)", frag_i->frame_num, offset, offset + frag_i->len - 1, frag_i->len); offset += frag_i->len; mark_frame_as_depended_upon(pinfo->fd, frag_i->frame_num); } } else { for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); frag_i && frag_i->tsn <= message->end; frag_i = frag_i->next) { proto_tree_add_uint_format(ptree, hf_sctp_fragment, new_tvb, offset, frag_i->len, frag_i->frame_num, "Frame: %u, payload: %u-%u (%u bytes)", frag_i->frame_num, offset, offset + frag_i->len - 1, frag_i->len); offset += frag_i->len; mark_frame_as_depended_upon(pinfo->fd, frag_i->frame_num); } } return new_tvb; } /* this is not the last fragment, * so let the user know the frame where the reassembly is */ col_append_str(pinfo->cinfo, COL_INFO, "(Message Fragment) "); proto_tree_add_uint(tree, hf_sctp_reassembled_in, tvb, 0, 0, message->reassembled_in->frame_num); return NULL; } /* this fragment has not been reassembled, yet * check now if we can reassemble it * at first look for the first and last tsn of the msg */ for (begin = msg->begins; begin && begin->fragment->tsn > fragment->tsn; begin = begin->next); /* in case begin still is null, set it to first (highest) begin * maybe the message tsn restart at 0 in between */ if (!begin) begin = msg->begins; for (end = msg->ends; end && end->fragment->tsn < fragment->tsn; end = end->next); /* in case end still is null, set it to first (lowest) end * maybe the message tsn restart at 0 in between */ if (!end) end = msg->ends; if (!begin || !end || !msg->fragments || (begin->fragment->tsn > end->fragment->tsn && msg->fragments->tsn)) { /* begin and end have not been collected, yet * or there might be a tsn restart but the first fragment hasn't a tsn of 0 * just mark as fragment */ col_append_str(pinfo->cinfo, COL_INFO, "(Message Fragment) "); return NULL; } /* we found possible begin and end * look for the first fragment and then try to get to the end */ first_frag = begin->fragment; /* while looking if all fragments are there * we can calculate the overall length that * we need in case of success */ len = first_frag->len; /* check if begin is past end * this can happen if there has been a tsn restart * or we just got the wrong begin and end * so give it a try */ if (begin->fragment->tsn > end->fragment->tsn) { for (last_frag = first_frag, frag_i = first_frag->next; frag_i && frag_i->tsn == (last_frag->tsn + 1); last_frag = frag_i, frag_i = frag_i->next) len += frag_i->len; /* check if we reached the last possible tsn * if yes, restart and continue */ if ((last_frag->tsn + 1)) { /* there are just fragments missing */ col_append_str(pinfo->cinfo, COL_INFO, "(Message Fragment) "); return NULL; } /* we got all fragments until the last possible tsn * and the first is 0 if we got here */ len += msg->fragments->len; for (last_frag = msg->fragments, frag_i = last_frag->next; frag_i && frag_i->tsn < end->fragment->tsn && frag_i->tsn == (last_frag->tsn + 1); last_frag = frag_i, frag_i = frag_i->next) len += frag_i->len; } else { for (last_frag = first_frag, frag_i = first_frag->next; frag_i && frag_i->tsn < end->fragment->tsn && frag_i->tsn == (last_frag->tsn + 1); last_frag = frag_i, frag_i = frag_i->next) len += frag_i->len; } if (!frag_i || frag_i != end->fragment || frag_i->tsn != (last_frag->tsn + 1)) { /* we need more fragments. just mark as fragment */ col_append_str(pinfo->cinfo, COL_INFO, "(Message Fragment) "); return NULL; } /* ok, this message is complete, we can reassemble it * but at first don't forget to add the length of the last fragment */ len += frag_i->len; message = wmem_new(wmem_file_scope(), sctp_complete_msg); message->begin = begin->fragment->tsn; message->end = end->fragment->tsn; message->reassembled_in = fragment; message->len = len; message->data = (unsigned char *)wmem_alloc(wmem_file_scope(), len); message->next = NULL; /* now copy all fragments */ if (begin->fragment->tsn > end->fragment->tsn) { /* a tsn restart has occurred */ for (frag_i = first_frag; frag_i; frag_i = frag_i->next) { if (frag_i->len && frag_i->data) memcpy(message->data + offset, frag_i->data, frag_i->len); offset += frag_i->len; /* release fragment data */ g_free(frag_i->data); frag_i->data = NULL; } for (frag_i = msg->fragments; frag_i && frag_i->tsn <= end->fragment->tsn; frag_i = frag_i->next) { if (frag_i->len && frag_i->data) memcpy(message->data + offset, frag_i->data, frag_i->len); offset += frag_i->len; /* release fragment data */ g_free(frag_i->data); frag_i->data = NULL; } } else { for (frag_i = first_frag; frag_i && frag_i->tsn <= end->fragment->tsn; frag_i = frag_i->next) { if (frag_i->len && frag_i->data) memcpy(message->data + offset, frag_i->data, frag_i->len); offset += frag_i->len; /* release fragment data */ g_free(frag_i->data); frag_i->data = NULL; } } /* save message */ if (!msg->messages) { msg->messages = message; } else { for (last_message = msg->messages; last_message->next; last_message = last_message->next); last_message->next = message; } /* remove begin and end from list */ if (msg->begins == begin) { msg->begins = begin->next; } else { for (beginend = msg->begins; beginend && beginend->next != begin; beginend = beginend->next); if (beginend && beginend->next == begin) beginend->next = begin->next; } g_free(begin); if (msg->ends == end) { msg->ends = end->next; } else { for (beginend = msg->ends; beginend && beginend->next != end; beginend = beginend->next); if (beginend && beginend->next == end) beginend->next = end->next; } g_free(end); /* create data source */ new_tvb = tvb_new_child_real_data(tvb, message->data, len, len); add_new_data_source(pinfo, new_tvb, "Reassembled SCTP Message"); /* display reassembly info */ item = proto_tree_add_item(tree, hf_sctp_fragments, tvb, 0, -1, ENC_NA); ptree = proto_item_add_subtree(item, ett_sctp_fragments); proto_item_append_text(item, " (%u bytes, %u fragments): ", message->len, message->end - message->begin + 1); if (message->begin > message->end) { for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); frag_i; frag_i = frag_i->next) { proto_tree_add_uint_format(ptree, hf_sctp_fragment, new_tvb, offset, frag_i->len, frag_i->frame_num, "Frame: %u, payload: %u-%u (%u bytes)", frag_i->frame_num, offset, offset + frag_i->len - 1, frag_i->len); offset += frag_i->len; mark_frame_as_depended_upon(pinfo->fd, frag_i->frame_num); } for (frag_i = msg->fragments; frag_i && frag_i->tsn <= message->end; frag_i = frag_i->next) { proto_tree_add_uint_format(ptree, hf_sctp_fragment, new_tvb, offset, frag_i->len, frag_i->frame_num, "Frame: %u, payload: %u-%u (%u bytes)", frag_i->frame_num, offset, offset + frag_i->len - 1, frag_i->len); offset += frag_i->len; mark_frame_as_depended_upon(pinfo->fd, frag_i->frame_num); } } else { for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); frag_i && frag_i->tsn <= message->end; frag_i = frag_i->next) { proto_tree_add_uint_format(ptree, hf_sctp_fragment, new_tvb, offset, frag_i->len, frag_i->frame_num, "Frame: %u, payload: %u-%u (%u bytes)", frag_i->frame_num, offset, offset + frag_i->len - 1, frag_i->len); offset += frag_i->len; mark_frame_as_depended_upon(pinfo->fd, frag_i->frame_num); } } /* it's not fragmented anymore */ pinfo->fragmented = FALSE; return new_tvb; } static exp_pdu_data_t* create_exp_pdu_table(packet_info *pinfo, tvbuff_t *tvb, const char *table_name, guint32 table_value) { exp_pdu_data_item_t exp_pdu_data_table_value = { exp_pdu_data_dissector_table_num_value_size, exp_pdu_data_dissector_table_num_value_populate_data, GUINT_TO_POINTER(table_value) }; const exp_pdu_data_item_t *sctp_exp_pdu_items[] = { &exp_pdu_data_src_ip, &exp_pdu_data_dst_ip, &exp_pdu_data_port_type, &exp_pdu_data_src_port, &exp_pdu_data_dst_port, &exp_pdu_data_orig_frame_num, &exp_pdu_data_table_value, NULL }; exp_pdu_data_t *exp_pdu_data = export_pdu_create_tags(pinfo, table_name, EXP_PDU_TAG_DISSECTOR_TABLE_NAME, sctp_exp_pdu_items); exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb); exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb); exp_pdu_data->pdu_tvb = tvb; return exp_pdu_data; } static exp_pdu_data_t* create_exp_pdu_proto_name(packet_info *pinfo, tvbuff_t *tvb, const gchar *proto_name) { exp_pdu_data_t *exp_pdu_data = export_pdu_create_common_tags(pinfo, proto_name, EXP_PDU_TAG_DISSECTOR_NAME); exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb); exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb); exp_pdu_data->pdu_tvb = tvb; return exp_pdu_data; } static void export_sctp_data_chunk(packet_info *pinfo, tvbuff_t *tvb, guint32 payload_proto_id, const wmem_list_frame_t *frame) { const gchar *proto_name = NULL; exp_pdu_data_t *exp_pdu_data = NULL; if (!have_tap_listener(exported_pdu_tap)) { /* Do nothing when there is no export pdu tap listener */ return; } if (enable_ulp_dissection && frame) { /* get the proto_name of the next frame */ proto_name = proto_get_protocol_filter_name(GPOINTER_TO_UINT(wmem_list_frame_data(frame))); } if (proto_name && (strcmp(proto_name, "data") != 0)) { /* when we have proto_name and it is not "data" export using the proto_name */ exp_pdu_data = create_exp_pdu_proto_name(pinfo, tvb, proto_name); } else if (payload_proto_id != 0) { exp_pdu_data = create_exp_pdu_table(pinfo, tvb, "sctp.ppi", payload_proto_id); } else if (pinfo->destport != 0) { exp_pdu_data = create_exp_pdu_table(pinfo, tvb, "sctp.port", pinfo->destport); } else if (pinfo->srcport != 0) { exp_pdu_data = create_exp_pdu_table(pinfo, tvb, "sctp.port", pinfo->srcport); } else { /* do not export anything when none of the above fileds are available */ return; } tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data); } static gboolean dissect_fragmented_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, proto_tree *chunk_tree, guint32 tsn, guint32 ppi, guint16 stream_id, guint32 stream_seq_num, guint8 b_bit, guint8 e_bit, guint8 u_bit, gboolean is_idata) { sctp_fragment *fragment; tvbuff_t *new_tvb = NULL; /* * If this is a short frame, then we can't, and don't, do * reassembly on it. We just give up. */ if (tvb_reported_length(payload_tvb) > tvb_captured_length(payload_tvb)) return TRUE; /* add fragment to list of known fragments. returns NULL if segment is a duplicate */ fragment = add_fragment(payload_tvb, pinfo, chunk_tree, tsn, stream_id, stream_seq_num, b_bit, e_bit, u_bit, ppi, is_idata); if (fragment) new_tvb = fragment_reassembly(payload_tvb, fragment, pinfo, chunk_tree, stream_id, stream_seq_num, u_bit); /* pass reassembled data to next dissector, if possible */ if (new_tvb){ gboolean retval; wmem_list_frame_t *cur = wmem_list_tail(pinfo->layers); retval = dissect_payload(new_tvb, pinfo, tree, ppi); export_sctp_data_chunk(pinfo, new_tvb, ppi, wmem_list_frame_next(cur)); return retval; } /* no reassembly done, do nothing */ return TRUE; } static const true_false_string sctp_data_chunk_e_bit_value = { "Last segment", "Not the last segment" }; static const true_false_string sctp_data_chunk_b_bit_value = { "First segment", "Subsequent segment" }; static const true_false_string sctp_data_chunk_u_bit_value = { "Unordered delivery", "Ordered delivery" }; static const true_false_string sctp_data_chunk_i_bit_value = { "Send SACK immediately", "Possibly delay SACK" }; static gboolean dissect_data_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *tree, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item, sctp_half_assoc_t *ha, gboolean is_idata) { guint number_of_ppid; volatile guint32 payload_proto_id; tvbuff_t *payload_tvb; proto_tree *flags_tree; guint8 oct, e_bit, b_bit, u_bit; guint16 stream_id; guint32 tsn, rawtsn, ppid, stream_seq_num = 0; proto_item *tsn_item = NULL; gboolean call_subdissector = FALSE; gboolean is_retransmission; guint16 header_length; guint16 payload_offset; static int* const chunk_flags[] = { &hf_data_chunk_i_bit, &hf_data_chunk_u_bit, &hf_data_chunk_b_bit, &hf_data_chunk_e_bit, NULL }; if (is_idata) { if (chunk_length < I_DATA_CHUNK_HEADER_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, I_DATA_CHUNK_HEADER_LENGTH); return TRUE; } payload_proto_id = tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET); } else { if (chunk_length < DATA_CHUNK_HEADER_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, DATA_CHUNK_HEADER_LENGTH); return TRUE; } payload_proto_id = tvb_get_ntohl(chunk_tvb, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET); } /* insert the PPID in the pinfo structure if it is not already there and there is still room */ for(number_of_ppid = 0; number_of_ppid < MAX_NUMBER_OF_PPIDS; number_of_ppid++) { void *tmp = p_get_proto_data(pinfo->pool, pinfo, proto_sctp, number_of_ppid); ppid = GPOINTER_TO_UINT(tmp); if ((ppid == LAST_PPID) || (ppid == payload_proto_id)) break; } if ((number_of_ppid < MAX_NUMBER_OF_PPIDS) && (ppid == LAST_PPID)) p_add_proto_data(pinfo->pool, pinfo, proto_sctp, number_of_ppid, GUINT_TO_POINTER(payload_proto_id)); oct = tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET); e_bit = oct & SCTP_DATA_CHUNK_E_BIT; b_bit = oct & SCTP_DATA_CHUNK_B_BIT; u_bit = oct & SCTP_DATA_CHUNK_U_BIT; tsn = rawtsn = tvb_get_ntohl(chunk_tvb, DATA_CHUNK_TSN_OFFSET); if ((show_relative_tsns) && (ha)) { if (!ha->started) { ha->first_tsn = tsn; ha->started = TRUE; } tsn -= ha->first_tsn; } col_append_fstr(pinfo->cinfo, COL_INFO, "(TSN=%" PRIu32 ") ", tsn); if (chunk_tree) { if (is_idata) proto_item_set_len(chunk_item, I_DATA_CHUNK_HEADER_LENGTH); else proto_item_set_len(chunk_item, DATA_CHUNK_HEADER_LENGTH); flags_tree = proto_item_add_subtree(flags_item, ett_sctp_data_chunk_flags); proto_tree_add_bitmask_list(flags_tree, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, chunk_flags, ENC_NA); if((show_relative_tsns) && (ha)) { tsn_item = proto_tree_add_uint(chunk_tree, hf_data_chunk_tsn, chunk_tvb, DATA_CHUNK_TSN_OFFSET, DATA_CHUNK_TSN_LENGTH, tsn); proto_tree_add_item(chunk_tree, hf_data_chunk_tsn_raw, chunk_tvb, DATA_CHUNK_TSN_OFFSET, DATA_CHUNK_TSN_LENGTH, ENC_BIG_ENDIAN); } else { tsn_item = proto_tree_add_item(chunk_tree, hf_data_chunk_tsn_raw, chunk_tvb, DATA_CHUNK_TSN_OFFSET, DATA_CHUNK_TSN_LENGTH, ENC_BIG_ENDIAN); } proto_tree_add_item(chunk_tree, hf_data_chunk_stream_id, chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET, DATA_CHUNK_STREAM_ID_LENGTH, ENC_BIG_ENDIAN); if (is_idata) { proto_tree_add_item(chunk_tree, hf_idata_chunk_reserved, chunk_tvb, I_DATA_CHUNK_RESERVED_OFFSET, I_DATA_CHUNK_RESERVED_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_idata_chunk_mid, chunk_tvb, I_DATA_CHUNK_MID_OFFSET, I_DATA_CHUNK_MID_LENGTH, ENC_BIG_ENDIAN); if (b_bit) proto_tree_add_item(chunk_tree, hf_data_chunk_payload_proto_id, chunk_tvb, I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET, I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH, ENC_BIG_ENDIAN); else proto_tree_add_item(chunk_tree, hf_idata_chunk_fsn, chunk_tvb, I_DATA_CHUNK_FSN_OFFSET, I_DATA_CHUNK_FSN_LENGTH, ENC_BIG_ENDIAN); } else { proto_tree_add_item(chunk_tree, hf_data_chunk_stream_seq_number, chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET, DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_data_chunk_payload_proto_id, chunk_tvb, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH, ENC_BIG_ENDIAN); } proto_item_append_text(chunk_item, " (%s, ", (u_bit) ? "unordered" : "ordered"); if (b_bit) { if (e_bit) proto_item_append_text(chunk_item, "complete"); else proto_item_append_text(chunk_item, "first"); } else { if (e_bit) proto_item_append_text(chunk_item, "last"); else proto_item_append_text(chunk_item, "middle"); } if (is_idata) { if (b_bit) proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, MID: %u, payload length: %u byte%s)", tsn, tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_MID_OFFSET), chunk_length - I_DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - I_DATA_CHUNK_HEADER_LENGTH, "", "s")); else proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, MID: %u, FSN: %u, payload length: %u byte%s)", tsn, tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_MID_OFFSET), tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_FSN_OFFSET), chunk_length - I_DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - I_DATA_CHUNK_HEADER_LENGTH, "", "s")); } else proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, SSN: %u, PPID: %u, payload length: %u byte%s)", tsn, tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET), payload_proto_id, chunk_length - DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - DATA_CHUNK_HEADER_LENGTH, "", "s")); } is_retransmission = sctp_tsn(pinfo, chunk_tvb, tsn_item, ha, rawtsn); if (is_idata) { header_length = I_DATA_CHUNK_HEADER_LENGTH; payload_offset = I_DATA_CHUNK_PAYLOAD_OFFSET; } else { header_length = DATA_CHUNK_HEADER_LENGTH; payload_offset = DATA_CHUNK_PAYLOAD_OFFSET; } payload_tvb = tvb_new_subset_length_caplen(chunk_tvb, payload_offset, MIN(chunk_length - header_length, tvb_captured_length_remaining(chunk_tvb, payload_offset)), MIN(chunk_length - header_length, tvb_reported_length_remaining(chunk_tvb, payload_offset))); /* Is this a fragment? */ if (b_bit && e_bit) { /* No - just call the subdissector. */ if (!is_retransmission) call_subdissector = TRUE; } else { /* Yes. */ pinfo->fragmented = TRUE; /* if reassembly is off just mark as fragment for next dissector and proceed */ if (!use_reassembly) { /* Don't pass on non-first fragments since the next dissector will * almost certainly not understand the data. */ if (b_bit) { if (!is_retransmission) call_subdissector = TRUE; } else return FALSE; } } if (call_subdissector) { /* This isn't a fragment or reassembly is off and it's the first fragment */ volatile gboolean retval = FALSE; wmem_list_frame_t *cur = wmem_list_tail(pinfo->layers); TRY { retval = dissect_payload(payload_tvb, pinfo, tree, payload_proto_id); } CATCH_NONFATAL_ERRORS { /* * Somebody threw an exception that means that there was a problem * dissecting the payload; that means that a dissector was found, * so we don't need to dissect the payload as data or update the * protocol or info columns. * * Just show the exception and then continue dissecting chunks. */ show_exception(payload_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; export_sctp_data_chunk(pinfo, payload_tvb, payload_proto_id, wmem_list_frame_next(cur)); return retval; } else if (is_retransmission) { col_append_str(pinfo->cinfo, COL_INFO, "(retransmission) "); return FALSE; } else { /* The logic above should ensure this... */ DISSECTOR_ASSERT(use_reassembly); stream_id = tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET); if (is_idata) { /* The stream_seq_num variable is used to hold the MID, the tsn variable holds the FSN*/ stream_seq_num = tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_MID_OFFSET); if (b_bit) { tsn = 0; } else { tsn = tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_FSN_OFFSET); payload_proto_id = 0; } } else { /* if unordered set stream_seq_num to 0 for easier handling */ if (u_bit) stream_seq_num = 0; else stream_seq_num = tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET); } /* start reassembly */ return dissect_fragmented_payload(payload_tvb, pinfo, tree, chunk_tree, tsn, payload_proto_id, stream_id, stream_seq_num, b_bit, e_bit, u_bit, is_idata); } } #define INIT_CHUNK_INITIATE_TAG_LENGTH 4 #define INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 #define INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH 2 #define INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH 2 #define INIT_CHUNK_INITIAL_TSN_LENGTH 4 #define INIT_CHUNK_FIXED_PARAMTERS_LENGTH (CHUNK_HEADER_LENGTH + \ INIT_CHUNK_INITIATE_TAG_LENGTH + \ INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH + \ INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH + \ INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH + \ INIT_CHUNK_INITIAL_TSN_LENGTH) #define INIT_CHUNK_INITIATE_TAG_OFFSET CHUNK_VALUE_OFFSET #define INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (INIT_CHUNK_INITIATE_TAG_OFFSET + \ INIT_CHUNK_INITIATE_TAG_LENGTH ) #define INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET (INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET + \ INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH ) #define INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET (INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET + \ INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH ) #define INIT_CHUNK_INITIAL_TSN_OFFSET (INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET + \ INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH ) #define INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET (INIT_CHUNK_INITIAL_TSN_OFFSET + \ INIT_CHUNK_INITIAL_TSN_LENGTH ) static void dissect_init_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item) { tvbuff_t *parameters_tvb; proto_item *hidden_item; if (chunk_length < INIT_CHUNK_FIXED_PARAMTERS_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, INIT_CHUNK_FIXED_PARAMTERS_LENGTH); return; } if (chunk_tree) { /* handle fixed parameters */ proto_tree_add_item(chunk_tree, hf_init_chunk_initiate_tag, chunk_tvb, INIT_CHUNK_INITIATE_TAG_OFFSET, INIT_CHUNK_INITIATE_TAG_LENGTH, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(chunk_tree, hf_initiate_tag, chunk_tvb, INIT_CHUNK_INITIATE_TAG_OFFSET, INIT_CHUNK_INITIATE_TAG_LENGTH, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(chunk_tree, hf_init_chunk_adv_rec_window_credit, chunk_tvb, INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET, INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_init_chunk_number_of_outbound_streams, chunk_tvb, INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET, INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_init_chunk_number_of_inbound_streams, chunk_tvb, INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET, INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_init_chunk_initial_tsn, chunk_tvb, INIT_CHUNK_INITIAL_TSN_OFFSET, INIT_CHUNK_INITIAL_TSN_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(chunk_item, " (Outbound streams: %u, inbound streams: %u)", tvb_get_ntohs(chunk_tvb, INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET), tvb_get_ntohs(chunk_tvb, INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET)); } /* handle variable parameters */ chunk_length -= INIT_CHUNK_FIXED_PARAMTERS_LENGTH; parameters_tvb = tvb_new_subset_length_caplen(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET, MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)), MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET))); dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, TRUE); } static void dissect_init_ack_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item) { tvbuff_t *parameters_tvb; proto_item *hidden_item; if (chunk_length < INIT_CHUNK_FIXED_PARAMTERS_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, INIT_CHUNK_FIXED_PARAMTERS_LENGTH); return; } if (chunk_tree) { /* handle fixed parameters */ proto_tree_add_item(chunk_tree, hf_initack_chunk_initiate_tag, chunk_tvb, INIT_CHUNK_INITIATE_TAG_OFFSET, INIT_CHUNK_INITIATE_TAG_LENGTH, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(chunk_tree, hf_initiate_tag, chunk_tvb, INIT_CHUNK_INITIATE_TAG_OFFSET, INIT_CHUNK_INITIATE_TAG_LENGTH, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); proto_tree_add_item(chunk_tree, hf_initack_chunk_adv_rec_window_credit, chunk_tvb, INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET, INIT_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_initack_chunk_number_of_outbound_streams, chunk_tvb, INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET, INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_initack_chunk_number_of_inbound_streams, chunk_tvb, INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET, INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_initack_chunk_initial_tsn, chunk_tvb, INIT_CHUNK_INITIAL_TSN_OFFSET, INIT_CHUNK_INITIAL_TSN_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(chunk_item, " (Outbound streams: %u, inbound streams: %u)", tvb_get_ntohs(chunk_tvb, INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET), tvb_get_ntohs(chunk_tvb, INIT_CHUNK_NUMBER_OF_INBOUND_STREAMS_OFFSET)); } /* handle variable paramters */ chunk_length -= INIT_CHUNK_FIXED_PARAMTERS_LENGTH; parameters_tvb = tvb_new_subset_length_caplen(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET, MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)), MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET))); dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, TRUE); } #define SCTP_SACK_CHUNK_NS_BIT 0x01 #define SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH 4 #define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 #define SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_LENGTH 2 #define SACK_CHUNK_NUMBER_OF_DUP_TSNS_LENGTH 2 #define SACK_CHUNK_GAP_BLOCK_LENGTH 4 #define SACK_CHUNK_GAP_BLOCK_START_LENGTH 2 #define SACK_CHUNK_GAP_BLOCK_END_LENGTH 2 #define SACK_CHUNK_DUP_TSN_LENGTH 4 #define SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET (CHUNK_VALUE_OFFSET + 0) #define SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET + \ SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH) #define SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET (SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET + \ SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH) #define SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET (SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET + \ SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_LENGTH) #define SACK_CHUNK_GAP_BLOCK_OFFSET (SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET + \ SACK_CHUNK_NUMBER_OF_DUP_TSNS_LENGTH) static void dissect_sack_chunk(packet_info *pinfo, tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item, sctp_half_assoc_t *ha) { guint16 number_of_gap_blocks, number_of_dup_tsns; guint16 gap_block_number, dup_tsn_number, start, end; gint gap_block_offset, dup_tsn_offset; guint32 cum_tsn_ack; proto_tree *block_tree; proto_tree *flags_tree; proto_item *ctsa_item; proto_item *a_rwnd_item; proto_tree *acks_tree; guint32 tsns_gap_acked = 0; guint32 a_rwnd; guint16 last_end; cum_tsn_ack = tvb_get_ntohl(chunk_tvb, SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); if((show_relative_tsns) && (ha) && (ha->peer)) { cum_tsn_ack -= ha->peer->first_tsn; } flags_tree = proto_item_add_subtree(flags_item, ett_sctp_sack_chunk_flags); proto_tree_add_item(flags_tree, hf_sack_chunk_ns, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); if((show_relative_tsns) && (ha) && (ha->peer)) { ctsa_item = proto_tree_add_uint(chunk_tree, hf_sack_chunk_cumulative_tsn_ack, chunk_tvb, SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET, SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH, cum_tsn_ack); proto_tree_add_item(chunk_tree, hf_sack_chunk_cumulative_tsn_ack_raw, chunk_tvb, SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET, SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH, ENC_BIG_ENDIAN); } else { ctsa_item = proto_tree_add_item(chunk_tree, hf_sack_chunk_cumulative_tsn_ack_raw, chunk_tvb, SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET, SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH, ENC_BIG_ENDIAN); } a_rwnd_item = proto_tree_add_item(chunk_tree, hf_sack_chunk_adv_rec_window_credit, chunk_tvb, SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET, SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_sack_chunk_number_of_gap_blocks, chunk_tvb, SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET, SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_sack_chunk_number_of_dup_tsns, chunk_tvb, SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET, SACK_CHUNK_NUMBER_OF_DUP_TSNS_LENGTH, ENC_BIG_ENDIAN); a_rwnd = tvb_get_ntohl(chunk_tvb, SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET); if (a_rwnd == 0) expert_add_info(pinfo, a_rwnd_item, &ei_sctp_sack_chunk_adv_rec_window_credit); /* handle the gap acknowledgement blocks */ number_of_gap_blocks = tvb_get_ntohs(chunk_tvb, SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET); gap_block_offset = SACK_CHUNK_GAP_BLOCK_OFFSET; acks_tree = proto_item_add_subtree(ctsa_item,ett_sctp_ack); sctp_ack_block(pinfo, ha, chunk_tvb, acks_tree, NULL, cum_tsn_ack); last_end = 0; for(gap_block_number = 0; gap_block_number < number_of_gap_blocks; gap_block_number++) { proto_item *pi; proto_tree *pt; guint32 tsn_start; start = tvb_get_ntohs(chunk_tvb, gap_block_offset); end = tvb_get_ntohs(chunk_tvb, gap_block_offset + SACK_CHUNK_GAP_BLOCK_START_LENGTH); tsn_start = cum_tsn_ack + start; block_tree = proto_tree_add_subtree_format(chunk_tree, chunk_tvb, gap_block_offset, SACK_CHUNK_GAP_BLOCK_LENGTH, ett_sctp_sack_chunk_gap_block, NULL, "Gap Acknowledgement for TSN %u to %u", cum_tsn_ack + start, cum_tsn_ack + end); pi = proto_tree_add_item(block_tree, hf_sack_chunk_gap_block_start, chunk_tvb, gap_block_offset, SACK_CHUNK_GAP_BLOCK_START_LENGTH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_sack_chunk_gap_block_start); pi = proto_tree_add_uint(pt, hf_sack_chunk_gap_block_start_tsn, chunk_tvb, gap_block_offset,SACK_CHUNK_GAP_BLOCK_START_LENGTH, cum_tsn_ack + start); proto_item_set_generated(pi); pi = proto_tree_add_item(block_tree, hf_sack_chunk_gap_block_end, chunk_tvb, gap_block_offset + SACK_CHUNK_GAP_BLOCK_START_LENGTH, SACK_CHUNK_GAP_BLOCK_END_LENGTH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_sack_chunk_gap_block_end); pi = proto_tree_add_uint(pt, hf_sack_chunk_gap_block_end_tsn, chunk_tvb, gap_block_offset + SACK_CHUNK_GAP_BLOCK_START_LENGTH, SACK_CHUNK_GAP_BLOCK_END_LENGTH, cum_tsn_ack + end); proto_item_set_generated(pi); sctp_ack_block(pinfo, ha, chunk_tvb, block_tree, &tsn_start, cum_tsn_ack + end); gap_block_offset += SACK_CHUNK_GAP_BLOCK_LENGTH; tsns_gap_acked += (end+1 - start); /* Check validity */ if (start > end) { expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_gap_block_malformed); } if (last_end > start) { expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_gap_block_out_of_order); } last_end = end; } if(last_end == 0) { /* No GapAck -> only show CumAck */ col_append_fstr(pinfo->cinfo, COL_INFO, "(Ack=%" PRIu32 ", Arwnd=%" PRIu32 ") ", cum_tsn_ack, a_rwnd); } else { /* Show CumAck + highest GapAck */ col_append_fstr(pinfo->cinfo, COL_INFO, "(Ack=%" PRIu32 "+%" PRIu32 ", Arwnd=%" PRIu32 ") ", cum_tsn_ack, last_end, a_rwnd); } if (tsns_gap_acked) { proto_item *pi; pi = proto_tree_add_uint(chunk_tree, hf_sack_chunk_number_tsns_gap_acked, chunk_tvb, 0, 0, tsns_gap_acked); proto_item_set_generated(pi); /* If there are a huge number of GAP ACKs, warn the user. 100 is a random * number: it could be tuned. */ if (tsns_gap_acked > 100) expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_number_tsns_gap_acked_100); } /* handle the duplicate TSNs */ number_of_dup_tsns = tvb_get_ntohs(chunk_tvb, SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET); dup_tsn_offset = SACK_CHUNK_GAP_BLOCK_OFFSET + number_of_gap_blocks * SACK_CHUNK_GAP_BLOCK_LENGTH; for(dup_tsn_number = 0; dup_tsn_number < number_of_dup_tsns; dup_tsn_number++) { proto_tree_add_item(chunk_tree, hf_sack_chunk_duplicate_tsn, chunk_tvb, dup_tsn_offset, SACK_CHUNK_DUP_TSN_LENGTH, ENC_BIG_ENDIAN); dup_tsn_offset += SACK_CHUNK_DUP_TSN_LENGTH; } proto_item_append_text(chunk_item, " (Cumulative TSN: %u, a_rwnd: %u, gaps: %u, duplicate TSNs: %u)", tvb_get_ntohl(chunk_tvb, SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET), a_rwnd, number_of_gap_blocks, number_of_dup_tsns); } /* NE: Dissect nr-sack chunk */ #define SCTP_NR_SACK_CHUNK_NS_BIT 0x01 #define NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH 4 #define NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH 4 #define NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_LENGTH 2 #define NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_LENGTH 2 #define NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_LENGTH 2 #define NR_SACK_CHUNK_RESERVED_LENGTH 2 #define NR_SACK_CHUNK_GAP_BLOCK_LENGTH 4 #define NR_SACK_CHUNK_GAP_BLOCK_START_LENGTH 2 #define NR_SACK_CHUNK_GAP_BLOCK_END_LENGTH 2 #define NR_SACK_CHUNK_NR_GAP_BLOCK_LENGTH 4 #define NR_SACK_CHUNK_NR_GAP_BLOCK_START_LENGTH 2 #define NR_SACK_CHUNK_NR_GAP_BLOCK_END_LENGTH 2 #define NR_SACK_CHUNK_DUP_TSN_LENGTH 4 #define NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET (CHUNK_VALUE_OFFSET + 0) #define NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET (NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET + \ NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH) #define NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET (NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET + \ NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH) #define NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_OFFSET (NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET + \ NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_LENGTH) #define NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET (NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_OFFSET + \ NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_LENGTH) #define NR_SACK_CHUNK_RESERVED_OFFSET (NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET + \ NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_LENGTH) #define NR_SACK_CHUNK_GAP_BLOCK_OFFSET (NR_SACK_CHUNK_RESERVED_OFFSET + \ NR_SACK_CHUNK_RESERVED_LENGTH) static void dissect_nr_sack_chunk(packet_info *pinfo, tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item, sctp_half_assoc_t *ha) { guint16 number_of_gap_blocks, number_of_dup_tsns; guint16 number_of_nr_gap_blocks; guint16 gap_block_number, nr_gap_block_number, dup_tsn_number, start, end; gint gap_block_offset, nr_gap_block_offset, dup_tsn_offset; guint32 cum_tsn_ack; proto_tree *block_tree; proto_tree *flags_tree; proto_item *ctsa_item; proto_tree *acks_tree; guint32 tsns_gap_acked = 0; guint32 tsns_nr_gap_acked = 0; guint16 last_end; flags_tree = proto_item_add_subtree(flags_item, ett_sctp_nr_sack_chunk_flags); proto_tree_add_item(flags_tree, hf_nr_sack_chunk_ns, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); ctsa_item = proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_cumulative_tsn_ack, chunk_tvb, NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET, NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_adv_rec_window_credit, chunk_tvb, NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET, NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_number_of_gap_blocks, chunk_tvb, NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET, NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_number_of_nr_gap_blocks, chunk_tvb, NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_OFFSET, NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_number_of_dup_tsns, chunk_tvb, NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET, NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_reserved, chunk_tvb, NR_SACK_CHUNK_RESERVED_OFFSET, NR_SACK_CHUNK_RESERVED_LENGTH, ENC_BIG_ENDIAN); number_of_gap_blocks = tvb_get_ntohs(chunk_tvb, NR_SACK_CHUNK_NUMBER_OF_GAP_BLOCKS_OFFSET); gap_block_offset = NR_SACK_CHUNK_GAP_BLOCK_OFFSET; cum_tsn_ack = tvb_get_ntohl(chunk_tvb, NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); acks_tree = proto_item_add_subtree(ctsa_item,ett_sctp_ack); sctp_ack_block(pinfo, ha, chunk_tvb, acks_tree, NULL, cum_tsn_ack); last_end = 0; for(gap_block_number = 0; gap_block_number < number_of_gap_blocks; gap_block_number++) { proto_item *pi; proto_tree *pt; guint32 tsn_start; start = tvb_get_ntohs(chunk_tvb, gap_block_offset); end = tvb_get_ntohs(chunk_tvb, gap_block_offset + NR_SACK_CHUNK_GAP_BLOCK_START_LENGTH); tsn_start = cum_tsn_ack + start; block_tree = proto_tree_add_subtree_format(chunk_tree, chunk_tvb, gap_block_offset, NR_SACK_CHUNK_GAP_BLOCK_LENGTH, ett_sctp_nr_sack_chunk_gap_block, NULL, "Gap Acknowledgement for TSN %u to %u", cum_tsn_ack + start, cum_tsn_ack + end); pi = proto_tree_add_item(block_tree, hf_nr_sack_chunk_gap_block_start, chunk_tvb, gap_block_offset, NR_SACK_CHUNK_GAP_BLOCK_START_LENGTH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_nr_sack_chunk_gap_block_start); pi = proto_tree_add_uint(pt, hf_nr_sack_chunk_gap_block_start_tsn, chunk_tvb, gap_block_offset,NR_SACK_CHUNK_GAP_BLOCK_START_LENGTH, cum_tsn_ack + start); proto_item_set_generated(pi); pi = proto_tree_add_item(block_tree, hf_nr_sack_chunk_gap_block_end, chunk_tvb, gap_block_offset + NR_SACK_CHUNK_GAP_BLOCK_START_LENGTH, NR_SACK_CHUNK_GAP_BLOCK_END_LENGTH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_nr_sack_chunk_gap_block_end); pi = proto_tree_add_uint(pt, hf_nr_sack_chunk_gap_block_end_tsn, chunk_tvb, gap_block_offset + NR_SACK_CHUNK_GAP_BLOCK_START_LENGTH, NR_SACK_CHUNK_GAP_BLOCK_END_LENGTH, cum_tsn_ack + end); proto_item_set_generated(pi); sctp_ack_block(pinfo, ha, chunk_tvb, block_tree, &tsn_start, cum_tsn_ack + end); gap_block_offset += NR_SACK_CHUNK_GAP_BLOCK_LENGTH; tsns_gap_acked += (end - start) + 1; /* Check validity */ if (start > end) { expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_gap_block_malformed); } if (last_end > start) { expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_gap_block_out_of_order); } last_end = end; } if (tsns_gap_acked) { proto_item *pi; pi = proto_tree_add_uint(chunk_tree, hf_nr_sack_chunk_number_tsns_gap_acked, chunk_tvb, 0, 0, tsns_gap_acked); proto_item_set_generated(pi); /* If there are a huge number of GAP ACKs, warn the user. 100 is a random * number: it could be tuned. */ if (tsns_gap_acked > 100) expert_add_info(pinfo, pi, &ei_sctp_nr_sack_chunk_number_tsns_gap_acked_100); } /* NE: handle the nr-sack chunk's nr-gap blocks */ number_of_nr_gap_blocks = tvb_get_ntohs(chunk_tvb, NR_SACK_CHUNK_NUMBER_OF_NR_GAP_BLOCKS_OFFSET); nr_gap_block_offset = gap_block_offset; last_end = 0; for(nr_gap_block_number = 0; nr_gap_block_number < number_of_nr_gap_blocks; nr_gap_block_number++) { proto_item *pi; proto_tree *pt; /*guint32 tsn_start;*/ start = tvb_get_ntohs(chunk_tvb, nr_gap_block_offset); end = tvb_get_ntohs(chunk_tvb, nr_gap_block_offset + NR_SACK_CHUNK_NR_GAP_BLOCK_START_LENGTH); /*tsn_start = cum_tsn_ack + start;*/ block_tree = proto_tree_add_subtree_format(chunk_tree, chunk_tvb, nr_gap_block_offset, NR_SACK_CHUNK_NR_GAP_BLOCK_LENGTH, ett_sctp_nr_sack_chunk_nr_gap_block, NULL, "NR-Gap Acknowledgement for TSN %u to %u", cum_tsn_ack + start, cum_tsn_ack + end); pi = proto_tree_add_item(block_tree, hf_nr_sack_chunk_nr_gap_block_start, chunk_tvb, nr_gap_block_offset, NR_SACK_CHUNK_NR_GAP_BLOCK_START_LENGTH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_nr_sack_chunk_nr_gap_block_start); pi = proto_tree_add_uint(pt, hf_nr_sack_chunk_nr_gap_block_start_tsn, chunk_tvb, nr_gap_block_offset, NR_SACK_CHUNK_NR_GAP_BLOCK_START_LENGTH, cum_tsn_ack + start); proto_item_set_generated(pi); pi = proto_tree_add_item(block_tree, hf_nr_sack_chunk_nr_gap_block_end, chunk_tvb, nr_gap_block_offset + NR_SACK_CHUNK_NR_GAP_BLOCK_START_LENGTH, NR_SACK_CHUNK_NR_GAP_BLOCK_END_LENGTH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_nr_sack_chunk_nr_gap_block_end); pi = proto_tree_add_uint(pt, hf_nr_sack_chunk_nr_gap_block_end_tsn, chunk_tvb, nr_gap_block_offset + NR_SACK_CHUNK_NR_GAP_BLOCK_START_LENGTH, NR_SACK_CHUNK_NR_GAP_BLOCK_END_LENGTH, cum_tsn_ack + end); proto_item_set_generated(pi); /* sctp_ack_block(pinfo, ha, chunk_tvb, block_tree, &tsn_start, cum_tsn_ack + end); */ nr_gap_block_offset += NR_SACK_CHUNK_NR_GAP_BLOCK_LENGTH; tsns_nr_gap_acked += (end - start) + 1; /* Check validity */ if (start > end) { expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_gap_block_malformed); } if (last_end > start) { expert_add_info(pinfo, pi, &ei_sctp_sack_chunk_gap_block_out_of_order); } last_end = end; } if (tsns_nr_gap_acked) { proto_item *pi; pi = proto_tree_add_uint(chunk_tree, hf_nr_sack_chunk_number_tsns_nr_gap_acked, chunk_tvb, 0, 0, tsns_nr_gap_acked); proto_item_set_generated(pi); /* If there are a huge number of GAP ACKs, warn the user. 100 is a random * number: it could be tuned. */ if (tsns_nr_gap_acked > 100) expert_add_info(pinfo, pi, &ei_sctp_nr_sack_chunk_number_tsns_nr_gap_acked_100); } /* handle the duplicate TSNs */ number_of_dup_tsns = tvb_get_ntohs(chunk_tvb, NR_SACK_CHUNK_NUMBER_OF_DUP_TSNS_OFFSET); dup_tsn_offset = NR_SACK_CHUNK_GAP_BLOCK_OFFSET + number_of_gap_blocks * NR_SACK_CHUNK_GAP_BLOCK_LENGTH + number_of_nr_gap_blocks * NR_SACK_CHUNK_NR_GAP_BLOCK_LENGTH; for(dup_tsn_number = 0; dup_tsn_number < number_of_dup_tsns; dup_tsn_number++) { proto_tree_add_item(chunk_tree, hf_nr_sack_chunk_duplicate_tsn, chunk_tvb, dup_tsn_offset, NR_SACK_CHUNK_DUP_TSN_LENGTH, ENC_BIG_ENDIAN); dup_tsn_offset += NR_SACK_CHUNK_DUP_TSN_LENGTH; } proto_item_append_text(chunk_item, " (Cumulative TSN: %u, a_rwnd: %u, gaps: %u, nr-gaps: %u, duplicate TSNs: %u)", tvb_get_ntohl(chunk_tvb, NR_SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET), tvb_get_ntohl(chunk_tvb, NR_SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET), number_of_gap_blocks, number_of_nr_gap_blocks, number_of_dup_tsns); } #define HEARTBEAT_CHUNK_INFO_OFFSET CHUNK_VALUE_OFFSET static void dissect_heartbeat_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item) { tvbuff_t *parameter_tvb; if (chunk_tree) { proto_item_append_text(chunk_item, " (Information: %u byte%s)", chunk_length - CHUNK_HEADER_LENGTH, plurality(chunk_length - CHUNK_HEADER_LENGTH, "", "s")); parameter_tvb = tvb_new_subset_length_caplen(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET, MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)), MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET))); /* FIXME: Parameters or parameter? */ dissect_parameter(parameter_tvb, pinfo, chunk_tree, NULL, FALSE, TRUE); } } #define HEARTBEAT_ACK_CHUNK_INFO_OFFSET CHUNK_VALUE_OFFSET static void dissect_heartbeat_ack_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item) { tvbuff_t *parameter_tvb; if (chunk_tree) { proto_item_append_text(chunk_item, " (Information: %u byte%s)", chunk_length - CHUNK_HEADER_LENGTH, plurality(chunk_length - CHUNK_HEADER_LENGTH, "", "s")); parameter_tvb = tvb_new_subset_length_caplen(chunk_tvb, HEARTBEAT_ACK_CHUNK_INFO_OFFSET, MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, HEARTBEAT_ACK_CHUNK_INFO_OFFSET)), MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, HEARTBEAT_ACK_CHUNK_INFO_OFFSET))); /* FIXME: Parameters or parameter? */ dissect_parameter(parameter_tvb, pinfo, chunk_tree, NULL, FALSE, TRUE); } } #define ABORT_CHUNK_FIRST_ERROR_CAUSE_OFFSET 4 #define SCTP_ABORT_CHUNK_T_BIT 0x01 static void dissect_abort_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *flags_item) { tvbuff_t *causes_tvb; proto_tree *flags_tree; sctp_info.vtag_reflected = (tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_ABORT_CHUNK_T_BIT) != 0; if (chunk_tree) { flags_tree = proto_item_add_subtree(flags_item, ett_sctp_abort_chunk_flags); proto_tree_add_item(flags_tree, hf_abort_chunk_t_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); causes_tvb = tvb_new_subset_length_caplen(chunk_tvb, CHUNK_VALUE_OFFSET, MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, CHUNK_VALUE_OFFSET)), MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, CHUNK_VALUE_OFFSET))); dissect_error_causes(causes_tvb, pinfo, chunk_tree); } } #define SHUTDOWN_CHUNK_CUMULATIVE_TSN_ACK_OFFSET CHUNK_VALUE_OFFSET #define SHUTDOWN_CHUNK_CUMULATIVE_TSN_ACK_LENGTH 4 static void dissect_shutdown_chunk(tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item) { if (chunk_tree) { proto_tree_add_item(chunk_tree, hf_shutdown_chunk_cumulative_tsn_ack, chunk_tvb, SHUTDOWN_CHUNK_CUMULATIVE_TSN_ACK_OFFSET, SHUTDOWN_CHUNK_CUMULATIVE_TSN_ACK_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(chunk_item, " (Cumulative TSN ack: %u)", tvb_get_ntohl(chunk_tvb, SHUTDOWN_CHUNK_CUMULATIVE_TSN_ACK_OFFSET)); } } static void dissect_shutdown_ack_chunk(tvbuff_t *chunk_tvb _U_) { } #define ERROR_CAUSE_IND_CAUSES_OFFSET CHUNK_VALUE_OFFSET static void dissect_error_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree) { tvbuff_t *causes_tvb; if (chunk_tree) { causes_tvb = tvb_new_subset_length_caplen(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET, MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET)), MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET))); dissect_error_causes(causes_tvb, pinfo, chunk_tree); } } #define COOKIE_OFFSET CHUNK_VALUE_OFFSET static void dissect_cookie_echo_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, proto_tree *chunk_tree, proto_item *chunk_item) { if (chunk_tree) { proto_tree_add_item(chunk_tree, hf_cookie, chunk_tvb, COOKIE_OFFSET, chunk_length - CHUNK_HEADER_LENGTH, ENC_NA); proto_item_append_text(chunk_item, " (Cookie length: %u byte%s)", chunk_length - CHUNK_HEADER_LENGTH, plurality(chunk_length - CHUNK_HEADER_LENGTH, "", "s")); } } static void dissect_cookie_ack_chunk(tvbuff_t *chunk_tvb _U_) { } #define ECNE_CHUNK_LOWEST_TSN_OFFSET CHUNK_VALUE_OFFSET #define ECNE_CHUNK_LOWEST_TSN_LENGTH 4 static void dissect_ecne_chunk(tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item) { proto_tree_add_item(chunk_tree, hf_ecne_chunk_lowest_tsn, chunk_tvb, ECNE_CHUNK_LOWEST_TSN_OFFSET, ECNE_CHUNK_LOWEST_TSN_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(chunk_item, " (Lowest TSN: %u)", tvb_get_ntohl(chunk_tvb, ECNE_CHUNK_LOWEST_TSN_OFFSET)); } #define CWR_CHUNK_LOWEST_TSN_OFFSET CHUNK_VALUE_OFFSET #define CWR_CHUNK_LOWEST_TSN_LENGTH 4 static void dissect_cwr_chunk(tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item) { proto_tree_add_item(chunk_tree, hf_cwr_chunk_lowest_tsn, chunk_tvb, CWR_CHUNK_LOWEST_TSN_OFFSET, CWR_CHUNK_LOWEST_TSN_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(chunk_item, " (Lowest TSN: %u)", tvb_get_ntohl(chunk_tvb, CWR_CHUNK_LOWEST_TSN_OFFSET)); } #define SCTP_SHUTDOWN_COMPLETE_CHUNK_T_BIT 0x01 static const true_false_string sctp_shutdown_complete_chunk_t_bit_value = { "Tag reflected", "Tag not reflected" }; static void dissect_shutdown_complete_chunk(tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *flags_item) { proto_tree *flags_tree; sctp_info.vtag_reflected = (tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_SHUTDOWN_COMPLETE_CHUNK_T_BIT) != 0; if (chunk_tree) { flags_tree = proto_item_add_subtree(flags_item, ett_sctp_shutdown_complete_chunk_flags); proto_tree_add_item(flags_tree, hf_shutdown_complete_chunk_t_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); } } #define FORWARD_TSN_CHUNK_TSN_LENGTH 4 #define FORWARD_TSN_CHUNK_SID_LENGTH 2 #define FORWARD_TSN_CHUNK_SSN_LENGTH 2 #define FORWARD_TSN_CHUNK_TSN_OFFSET CHUNK_VALUE_OFFSET #define FORWARD_TSN_CHUNK_SID_OFFSET 0 #define FORWARD_TSN_CHUNK_SSN_OFFSET (FORWARD_TSN_CHUNK_SID_OFFSET + FORWARD_TSN_CHUNK_SID_LENGTH) static void dissect_forward_tsn_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, proto_tree *chunk_tree, proto_item *chunk_item) { guint offset; guint16 number_of_affected_streams, affected_stream; /* FIXME */ if (chunk_length < CHUNK_HEADER_LENGTH + FORWARD_TSN_CHUNK_TSN_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, CHUNK_HEADER_LENGTH + FORWARD_TSN_CHUNK_TSN_LENGTH); return; } if (chunk_tree) { proto_tree_add_item(chunk_tree, hf_forward_tsn_chunk_tsn, chunk_tvb, FORWARD_TSN_CHUNK_TSN_OFFSET, FORWARD_TSN_CHUNK_TSN_LENGTH, ENC_BIG_ENDIAN); number_of_affected_streams = (chunk_length - CHUNK_HEADER_LENGTH - FORWARD_TSN_CHUNK_TSN_LENGTH) / (FORWARD_TSN_CHUNK_SID_LENGTH + FORWARD_TSN_CHUNK_SSN_LENGTH); offset = CHUNK_VALUE_OFFSET + FORWARD_TSN_CHUNK_TSN_LENGTH; for(affected_stream = 0; affected_stream < number_of_affected_streams; affected_stream++) { proto_tree_add_item(chunk_tree, hf_forward_tsn_chunk_sid, chunk_tvb, offset + FORWARD_TSN_CHUNK_SID_OFFSET, FORWARD_TSN_CHUNK_SID_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_forward_tsn_chunk_ssn, chunk_tvb, offset + FORWARD_TSN_CHUNK_SSN_OFFSET, FORWARD_TSN_CHUNK_SSN_LENGTH, ENC_BIG_ENDIAN); offset = offset + (FORWARD_TSN_CHUNK_SID_LENGTH + FORWARD_TSN_CHUNK_SSN_LENGTH); } proto_item_append_text(chunk_item, "(Cumulative TSN: %u)", tvb_get_ntohl(chunk_tvb, FORWARD_TSN_CHUNK_TSN_OFFSET)); } } #define I_FORWARD_TSN_CHUNK_TSN_LENGTH 4 #define I_FORWARD_TSN_CHUNK_SID_LENGTH 2 #define I_FORWARD_TSN_CHUNK_FLAGS_LENGTH 2 #define I_FORWARD_TSN_CHUNK_MID_LENGTH 4 #define I_FORWARD_TSN_CHUNK_TSN_OFFSET CHUNK_VALUE_OFFSET #define I_FORWARD_TSN_CHUNK_SID_OFFSET 0 #define I_FORWARD_TSN_CHUNK_FLAGS_OFFSET (I_FORWARD_TSN_CHUNK_SID_OFFSET + I_FORWARD_TSN_CHUNK_SID_LENGTH) #define I_FORWARD_TSN_CHUNK_MID_OFFSET (I_FORWARD_TSN_CHUNK_FLAGS_OFFSET + I_FORWARD_TSN_CHUNK_FLAGS_LENGTH) #define SCTP_I_FORWARD_TSN_CHUNK_U_BIT 0x0001 #define SCTP_I_FORWARD_TSN_CHUNK_RES_MASK 0xfffe static const true_false_string sctp_i_forward_tsn_chunk_u_bit_value = { "Unordered messages", "Ordered messages" }; static void dissect_i_forward_tsn_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, proto_tree *chunk_tree, proto_item *chunk_item) { guint offset; guint16 number_of_affected_streams, affected_stream; proto_tree *flags_tree; proto_item *flags_item = NULL; /* FIXME */ if (chunk_length < CHUNK_HEADER_LENGTH + I_FORWARD_TSN_CHUNK_TSN_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, CHUNK_HEADER_LENGTH + I_FORWARD_TSN_CHUNK_TSN_LENGTH); return; } if (chunk_tree) { proto_tree_add_item(chunk_tree, hf_i_forward_tsn_chunk_tsn, chunk_tvb, I_FORWARD_TSN_CHUNK_TSN_OFFSET, I_FORWARD_TSN_CHUNK_TSN_LENGTH, ENC_BIG_ENDIAN); number_of_affected_streams = (chunk_length - CHUNK_HEADER_LENGTH - I_FORWARD_TSN_CHUNK_TSN_LENGTH) / (I_FORWARD_TSN_CHUNK_SID_LENGTH + I_FORWARD_TSN_CHUNK_FLAGS_LENGTH + I_FORWARD_TSN_CHUNK_MID_LENGTH); offset = CHUNK_VALUE_OFFSET + I_FORWARD_TSN_CHUNK_TSN_LENGTH; for(affected_stream = 0; affected_stream < number_of_affected_streams; affected_stream++) { proto_tree_add_item(chunk_tree, hf_i_forward_tsn_chunk_sid, chunk_tvb, offset + I_FORWARD_TSN_CHUNK_SID_OFFSET, I_FORWARD_TSN_CHUNK_SID_LENGTH, ENC_BIG_ENDIAN); flags_item = proto_tree_add_item(chunk_tree, hf_i_forward_tsn_chunk_flags, chunk_tvb, offset + I_FORWARD_TSN_CHUNK_FLAGS_OFFSET, I_FORWARD_TSN_CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_sctp_i_forward_tsn_chunk_flags); proto_tree_add_item(flags_tree, hf_i_forward_tsn_chunk_res, chunk_tvb, offset + I_FORWARD_TSN_CHUNK_FLAGS_OFFSET, I_FORWARD_TSN_CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_i_forward_tsn_chunk_u_bit, chunk_tvb, offset + I_FORWARD_TSN_CHUNK_FLAGS_OFFSET, I_FORWARD_TSN_CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_i_forward_tsn_chunk_mid, chunk_tvb, offset + I_FORWARD_TSN_CHUNK_MID_OFFSET, I_FORWARD_TSN_CHUNK_MID_LENGTH, ENC_BIG_ENDIAN); offset += (I_FORWARD_TSN_CHUNK_SID_LENGTH + I_FORWARD_TSN_CHUNK_FLAGS_LENGTH + I_FORWARD_TSN_CHUNK_MID_LENGTH); } proto_item_append_text(chunk_item, "(Cumulative TSN: %u)", tvb_get_ntohl(chunk_tvb, I_FORWARD_TSN_CHUNK_TSN_OFFSET)); } } #define RE_CONFIG_PARAMETERS_OFFSET CHUNK_HEADER_LENGTH static void dissect_re_config_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item _U_) { tvbuff_t *parameters_tvb; parameters_tvb = tvb_new_subset_length_caplen(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET, MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET)), MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET))); dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, FALSE); } #define SHARED_KEY_ID_LENGTH 2 #define SHARED_KEY_ID_OFFSET PARAMETER_VALUE_OFFSET #define HMAC_ID_OFFSET (SHARED_KEY_ID_OFFSET + SHARED_KEY_ID_LENGTH) #define HMAC_OFFSET (HMAC_ID_OFFSET + HMAC_ID_LENGTH) static void dissect_auth_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, proto_tree *chunk_tree, proto_item *chunk_item _U_) { guint hmac_length; hmac_length = chunk_length - CHUNK_HEADER_LENGTH - HMAC_ID_LENGTH - SHARED_KEY_ID_LENGTH; proto_tree_add_item(chunk_tree, hf_shared_key_id, chunk_tvb, SHARED_KEY_ID_OFFSET, SHARED_KEY_ID_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_hmac_id, chunk_tvb, HMAC_ID_OFFSET, HMAC_ID_LENGTH, ENC_BIG_ENDIAN); if (hmac_length > 0) proto_tree_add_item(chunk_tree, hf_hmac, chunk_tvb, HMAC_OFFSET, hmac_length, ENC_NA); } #define SCTP_SEQUENCE_NUMBER_LENGTH 4 #define SEQUENCE_NUMBER_OFFSET CHUNK_VALUE_OFFSET #define ASCONF_CHUNK_PARAMETERS_OFFSET (SEQUENCE_NUMBER_OFFSET + SCTP_SEQUENCE_NUMBER_LENGTH) static void dissect_asconf_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item) { tvbuff_t *parameters_tvb; if (chunk_length < CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH); return; } if (chunk_tree) { proto_tree_add_item(chunk_tree, hf_asconf_seq_nr, chunk_tvb, SEQUENCE_NUMBER_OFFSET, SCTP_SEQUENCE_NUMBER_LENGTH, ENC_BIG_ENDIAN); } chunk_length -= CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH; parameters_tvb = tvb_new_subset_length_caplen(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET, MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET)), MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET))); dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, FALSE); } #define ASCONF_ACK_CHUNK_PARAMETERS_OFFSET (SEQUENCE_NUMBER_OFFSET + SCTP_SEQUENCE_NUMBER_LENGTH) static void dissect_asconf_ack_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item) { tvbuff_t *parameters_tvb; if (chunk_length < CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length + CHUNK_HEADER_LENGTH, CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH); return; } if (chunk_tree) { proto_tree_add_item(chunk_tree, hf_asconf_ack_seq_nr, chunk_tvb, SEQUENCE_NUMBER_OFFSET, SCTP_SEQUENCE_NUMBER_LENGTH, ENC_BIG_ENDIAN); } chunk_length -= CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH; parameters_tvb = tvb_new_subset_length_caplen(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET, MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET)), MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET))); dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, FALSE); } #define PKTDROP_CHUNK_BANDWIDTH_LENGTH 4 #define PKTDROP_CHUNK_QUEUESIZE_LENGTH 4 #define PKTDROP_CHUNK_TRUNCATED_SIZE_LENGTH 2 #define PKTDROP_CHUNK_RESERVED_SIZE_LENGTH 2 #define PKTDROP_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ PKTDROP_CHUNK_BANDWIDTH_LENGTH + \ PKTDROP_CHUNK_QUEUESIZE_LENGTH + \ PKTDROP_CHUNK_TRUNCATED_SIZE_LENGTH + \ PKTDROP_CHUNK_RESERVED_SIZE_LENGTH) #define PKTDROP_CHUNK_BANDWIDTH_OFFSET CHUNK_VALUE_OFFSET #define PKTDROP_CHUNK_QUEUESIZE_OFFSET (PKTDROP_CHUNK_BANDWIDTH_OFFSET + PKTDROP_CHUNK_BANDWIDTH_LENGTH) #define PKTDROP_CHUNK_TRUNCATED_SIZE_OFFSET (PKTDROP_CHUNK_QUEUESIZE_OFFSET + PKTDROP_CHUNK_QUEUESIZE_LENGTH) #define PKTDROP_CHUNK_RESERVED_SIZE_OFFSET (PKTDROP_CHUNK_TRUNCATED_SIZE_OFFSET + PKTDROP_CHUNK_TRUNCATED_SIZE_LENGTH) #define PKTDROP_CHUNK_DATA_FIELD_OFFSET (PKTDROP_CHUNK_RESERVED_SIZE_OFFSET + PKTDROP_CHUNK_RESERVED_SIZE_LENGTH) #define SCTP_PKTDROP_CHUNK_M_BIT 0x01 #define SCTP_PKTDROP_CHUNK_B_BIT 0x02 #define SCTP_PKTDROP_CHUNK_T_BIT 0x04 static const true_false_string sctp_pktdropk_m_bit_value = { "Source is a middlebox", "Source is an endhost" }; static const true_false_string sctp_pktdropk_b_bit_value = { "SCTP checksum was incorrect", "SCTP checksum was correct" }; static const true_false_string sctp_pktdropk_t_bit_value = { "Packet is truncated", "Packet is not truncated" }; static void dissect_pktdrop_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item) { tvbuff_t *data_field_tvb; proto_tree *flags_tree; if (chunk_length < PKTDROP_CHUNK_HEADER_LENGTH) { proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, PKTDROP_CHUNK_HEADER_LENGTH); return; } chunk_length -= PKTDROP_CHUNK_HEADER_LENGTH; data_field_tvb = tvb_new_subset_length_caplen(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET, MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET)), MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET))); if (chunk_tree) { flags_tree = proto_item_add_subtree(flags_item, ett_sctp_pktdrop_chunk_flags); proto_tree_add_item(flags_tree, hf_pktdrop_chunk_m_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_pktdrop_chunk_b_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_pktdrop_chunk_t_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_pktdrop_chunk_bandwidth, chunk_tvb, PKTDROP_CHUNK_BANDWIDTH_OFFSET, PKTDROP_CHUNK_BANDWIDTH_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_pktdrop_chunk_queuesize, chunk_tvb, PKTDROP_CHUNK_QUEUESIZE_OFFSET, PKTDROP_CHUNK_QUEUESIZE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_pktdrop_chunk_truncated_length, chunk_tvb, PKTDROP_CHUNK_TRUNCATED_SIZE_OFFSET, PKTDROP_CHUNK_TRUNCATED_SIZE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_pktdrop_chunk_reserved, chunk_tvb, PKTDROP_CHUNK_RESERVED_SIZE_OFFSET, PKTDROP_CHUNK_RESERVED_SIZE_LENGTH, ENC_BIG_ENDIAN); if (chunk_length > 0) { /* XXX - We should dissect what we can and catch the BoundsError when we run out of bytes */ if (tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_PKTDROP_CHUNK_T_BIT) proto_tree_add_item(chunk_tree, hf_pktdrop_chunk_data_field, chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET, chunk_length, ENC_NA); else { gboolean save_in_error_pkt = pinfo->flags.in_error_pkt; pinfo->flags.in_error_pkt = TRUE; dissect_sctp_packet(data_field_tvb, pinfo, chunk_tree, TRUE); pinfo->flags.in_error_pkt = save_in_error_pkt; } } } } static void dissect_pad_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, proto_tree *chunk_tree, proto_item *chunk_item) { guint16 value_length; if (chunk_tree) { value_length = chunk_length - CHUNK_HEADER_LENGTH; proto_tree_add_item(chunk_tree, hf_pad_chunk_padding_data, chunk_tvb, CHUNK_VALUE_OFFSET, value_length, ENC_NA); proto_item_append_text(chunk_item, " (Padding data length: %u byte%s)", value_length, plurality(value_length, "", "s")); } } static void dissect_unknown_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, guint8 chunk_type, proto_tree *chunk_tree, proto_item *chunk_item) { guint16 value_length; if (chunk_tree) { value_length = chunk_length - CHUNK_HEADER_LENGTH; if (value_length > 0) proto_tree_add_item(chunk_tree, hf_chunk_value, chunk_tvb, CHUNK_VALUE_OFFSET, value_length, ENC_NA); proto_item_append_text(chunk_item, " (Type: %u, value length: %u byte%s)", chunk_type, value_length, plurality(value_length, "", "s")); } } #define SCTP_CHUNK_BIT_1 0x80 #define SCTP_CHUNK_BIT_2 0x40 static const true_false_string sctp_chunk_bit_1_value = { "Skip chunk and continue processing of the packet", "Stop processing of the packet" }; static const true_false_string sctp_chunk_bit_2_value = { "Do report", "Do not report" }; static gboolean dissect_sctp_chunk(tvbuff_t *chunk_tvb, packet_info *pinfo, proto_tree *tree, proto_tree *sctp_tree, sctp_half_assoc_t *ha, gboolean useinfo) { guint8 type; guint16 length, padding_length, reported_length; gboolean result; proto_item *flags_item, *chunk_item, *type_item, *length_item; proto_tree *chunk_tree, *type_tree; result = FALSE; /* first extract the chunk header */ type = tvb_get_guint8(chunk_tvb, CHUNK_TYPE_OFFSET); length = tvb_get_ntohs(chunk_tvb, CHUNK_LENGTH_OFFSET); reported_length = tvb_reported_length(chunk_tvb); padding_length = reported_length - length; if (useinfo) col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, chunk_type_values, "RESERVED")); /* create proto_tree stuff */ chunk_tree = proto_tree_add_subtree_format(sctp_tree, chunk_tvb, CHUNK_HEADER_OFFSET, reported_length, ett_sctp_chunk, &chunk_item, "%s chunk", val_to_str_const(type, chunk_type_values, "RESERVED")); if (tree) { /* then insert the chunk header components into the protocol tree */ type_item = proto_tree_add_item(chunk_tree, hf_chunk_type, chunk_tvb, CHUNK_TYPE_OFFSET, CHUNK_TYPE_LENGTH, ENC_BIG_ENDIAN); type_tree = proto_item_add_subtree(type_item, ett_sctp_chunk_type); proto_tree_add_item(type_tree, hf_chunk_bit_1, chunk_tvb, CHUNK_TYPE_OFFSET, CHUNK_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(type_tree, hf_chunk_bit_2, chunk_tvb, CHUNK_TYPE_OFFSET, CHUNK_TYPE_LENGTH, ENC_BIG_ENDIAN); flags_item = proto_tree_add_item(chunk_tree, hf_chunk_flags, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); } else { chunk_tree = NULL; chunk_item = NULL; flags_item = NULL; } if (length < CHUNK_HEADER_LENGTH) { if (tree) { proto_tree_add_uint_format_value(chunk_tree, hf_chunk_length, chunk_tvb, CHUNK_LENGTH_OFFSET, CHUNK_LENGTH_LENGTH, length, "%u (invalid, should be >= %u)", length, CHUNK_HEADER_LENGTH); proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", length, CHUNK_HEADER_LENGTH); } if (type == SCTP_DATA_CHUNK_ID) result = TRUE; return result; } length_item = proto_tree_add_uint(chunk_tree, hf_chunk_length, chunk_tvb, CHUNK_LENGTH_OFFSET, CHUNK_LENGTH_LENGTH, length); if (length > reported_length && !pinfo->flags.in_error_pkt) { expert_add_info_format(pinfo, length_item, &ei_sctp_chunk_length_bad, "Chunk length (%d) is longer than remaining data (%d) in the packet.", length, reported_length); /* We'll almost certainly throw an exception shortly... */ } /* length -= CHUNK_HEADER_LENGTH; */ /* now dissect the chunk value */ switch(type) { case SCTP_DATA_CHUNK_ID: result = dissect_data_chunk(chunk_tvb, length, pinfo, tree, chunk_tree, chunk_item, flags_item, ha, FALSE); break; case SCTP_I_DATA_CHUNK_ID: result = dissect_data_chunk(chunk_tvb, length, pinfo, tree, chunk_tree, chunk_item, flags_item, ha, TRUE); break; case SCTP_INIT_CHUNK_ID: dissect_init_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_INIT_ACK_CHUNK_ID: dissect_init_ack_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_SACK_CHUNK_ID: dissect_sack_chunk(pinfo, chunk_tvb, chunk_tree, chunk_item, flags_item, ha); break; case SCTP_HEARTBEAT_CHUNK_ID: dissect_heartbeat_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_HEARTBEAT_ACK_CHUNK_ID: dissect_heartbeat_ack_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_ABORT_CHUNK_ID: dissect_abort_chunk(chunk_tvb, length, pinfo, chunk_tree, flags_item); break; case SCTP_SHUTDOWN_CHUNK_ID: dissect_shutdown_chunk(chunk_tvb, chunk_tree, chunk_item); break; case SCTP_SHUTDOWN_ACK_CHUNK_ID: dissect_shutdown_ack_chunk(chunk_tvb); break; case SCTP_ERROR_CHUNK_ID: dissect_error_chunk(chunk_tvb, length, pinfo, chunk_tree); break; case SCTP_COOKIE_ECHO_CHUNK_ID: dissect_cookie_echo_chunk(chunk_tvb, length, chunk_tree, chunk_item); break; case SCTP_COOKIE_ACK_CHUNK_ID: dissect_cookie_ack_chunk(chunk_tvb); break; case SCTP_ECNE_CHUNK_ID: dissect_ecne_chunk(chunk_tvb, chunk_tree, chunk_item); break; case SCTP_CWR_CHUNK_ID: dissect_cwr_chunk(chunk_tvb, chunk_tree, chunk_item); break; case SCTP_SHUTDOWN_COMPLETE_CHUNK_ID: dissect_shutdown_complete_chunk(chunk_tvb, chunk_tree, flags_item); break; case SCTP_FORWARD_TSN_CHUNK_ID: dissect_forward_tsn_chunk(chunk_tvb, length, chunk_tree, chunk_item); break; case SCTP_RE_CONFIG_CHUNK_ID: dissect_re_config_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_AUTH_CHUNK_ID: dissect_auth_chunk(chunk_tvb, length, chunk_tree, chunk_item); break; case SCTP_NR_SACK_CHUNK_ID: dissect_nr_sack_chunk(pinfo, chunk_tvb, chunk_tree, chunk_item, flags_item, ha); break; case SCTP_ASCONF_ACK_CHUNK_ID: dissect_asconf_ack_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_ASCONF_CHUNK_ID: dissect_asconf_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); break; case SCTP_I_FORWARD_TSN_CHUNK_ID: dissect_i_forward_tsn_chunk(chunk_tvb, length, chunk_tree, chunk_item); break; case SCTP_PKTDROP_CHUNK_ID: col_set_writable(pinfo->cinfo, -1, FALSE); dissect_pktdrop_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item, flags_item); col_set_writable(pinfo->cinfo, -1, TRUE); break; case SCTP_PAD_CHUNK_ID: dissect_pad_chunk(chunk_tvb, length, chunk_tree, chunk_item); break; default: dissect_unknown_chunk(chunk_tvb, length, type, chunk_tree, chunk_item); break; } if (padding_length > 0) proto_tree_add_item(chunk_tree, hf_chunk_padding, chunk_tvb, CHUNK_HEADER_OFFSET + length, padding_length, ENC_NA); if (useinfo && ((type == SCTP_DATA_CHUNK_ID) || show_always_control_chunks)) col_set_fence(pinfo->cinfo, COL_INFO); return result; } static void dissect_sctp_chunks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *sctp_item, proto_tree *sctp_tree, sctp_half_assoc_t *ha, gboolean encapsulated) { tvbuff_t *chunk_tvb; guint16 length, total_length, remaining_length; gint last_offset, offset; gboolean sctp_item_length_set; assoc_info_t tmpinfo; infodata_t id_dir; /* the common header of the datagram is already handled */ last_offset = 0; offset = COMMON_HEADER_LENGTH; sctp_item_length_set = FALSE; while((remaining_length = tvb_reported_length_remaining(tvb, offset))) { /* extract the chunk length and compute number of padding bytes */ length = tvb_get_ntohs(tvb, offset + CHUNK_LENGTH_OFFSET); total_length = WS_ROUNDUP_4(length); /* If we have less bytes than we need, throw an exception while dissecting * the chunk--not when generating the chunk_tvb below. */ total_length = MIN(total_length, remaining_length); /* create a tvb for the chunk including the padding bytes */ chunk_tvb = tvb_new_subset_length_caplen(tvb, offset, MIN(total_length, tvb_captured_length_remaining(tvb, offset)), total_length); /* save it in the sctp_info structure */ if (!encapsulated) { if (sctp_info.number_of_tvbs < MAXIMUM_NUMBER_OF_TVBS) sctp_info.tvb[sctp_info.number_of_tvbs++] = chunk_tvb; else sctp_info.incomplete = TRUE; } if (enable_association_indexing) { tmpinfo.assoc_index = -1; tmpinfo.sport = sctp_info.sport; tmpinfo.dport = sctp_info.dport; tmpinfo.vtag_reflected = FALSE; if (tvb_get_guint8(chunk_tvb, CHUNK_TYPE_OFFSET) == SCTP_ABORT_CHUNK_ID) { if ((tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_ABORT_CHUNK_T_BIT) != 0) { tmpinfo.vtag_reflected = TRUE; } } if (tvb_get_guint8(chunk_tvb, CHUNK_TYPE_OFFSET) == SCTP_SHUTDOWN_COMPLETE_CHUNK_ID) { if ((tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_SHUTDOWN_COMPLETE_CHUNK_T_BIT) != 0) { tmpinfo.vtag_reflected = TRUE; } } if (tmpinfo.vtag_reflected) { tmpinfo.verification_tag2 = sctp_info.verification_tag; tmpinfo.verification_tag1 = 0; } else { tmpinfo.verification_tag1 = sctp_info.verification_tag; tmpinfo.verification_tag2 = 0; } if (tvb_get_guint8(chunk_tvb, CHUNK_TYPE_OFFSET) == SCTP_INIT_CHUNK_ID) { tmpinfo.initiate_tag = tvb_get_ntohl(sctp_info.tvb[0], 4); } else { tmpinfo.initiate_tag = 0; } id_dir = find_assoc_index(&tmpinfo, PINFO_FD_VISITED(pinfo)); sctp_info.assoc_index = id_dir.assoc_index; sctp_info.direction = id_dir.direction; } else { sctp_info.assoc_index = -1; sctp_info.direction = ASSOC_NOT_FOUND; } /* call dissect_sctp_chunk for the actual work */ if (dissect_sctp_chunk(chunk_tvb, pinfo, tree, sctp_tree, ha, !encapsulated) && (tree)) { proto_item_set_len(sctp_item, offset - last_offset + DATA_CHUNK_HEADER_LENGTH); sctp_item_length_set = TRUE; offset += total_length; last_offset = offset; if (tvb_reported_length_remaining(tvb, offset) > 0) { sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, offset, -1, ENC_NA); sctp_tree = proto_item_add_subtree(sctp_item, ett_sctp); sctp_item_length_set = FALSE; } } else { /* get rid of the dissected chunk */ offset += total_length; } } if (!sctp_item_length_set && (tree)) { proto_item_set_len(sctp_item, offset - last_offset); } } static void dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean encapsulated) { guint32 checksum = 0, calculated_crc32c = 0, calculated_adler32 = 0; guint16 source_port, destination_port; guint captured_length, reported_length; gboolean crc32c_correct = FALSE, adler32_correct = FALSE; proto_item *sctp_item, *hidden_item; proto_tree *sctp_tree; guint32 vtag; sctp_half_assoc_t *ha = NULL; proto_item *pi, *vt = NULL; captured_length = tvb_captured_length(tvb); reported_length = tvb_reported_length(tvb); checksum = tvb_get_ntohl(tvb, CHECKSUM_OFFSET); sctp_info.checksum_zero = (checksum == 0); /* Only try to checksum the packet if we have all of it */ if ((captured_length == reported_length) && (captured_length >= COMMON_HEADER_LENGTH)) { switch(sctp_checksum) { case SCTP_CHECKSUM_NONE: break; case SCTP_CHECKSUM_ADLER32: calculated_adler32 = sctp_adler32(tvb, captured_length); adler32_correct = (checksum == calculated_adler32); sctp_info.adler32_calculated = TRUE; sctp_info.adler32_correct = adler32_correct; break; case SCTP_CHECKSUM_CRC32C: calculated_crc32c = sctp_crc32c(tvb, captured_length); crc32c_correct = (checksum == calculated_crc32c); sctp_info.crc32c_calculated = TRUE; sctp_info.crc32c_correct = crc32c_correct; break; case SCTP_CHECKSUM_AUTOMATIC: calculated_adler32 = sctp_adler32(tvb, captured_length); adler32_correct = (checksum == calculated_adler32); calculated_crc32c = sctp_crc32c(tvb, captured_length); crc32c_correct = (checksum == calculated_crc32c); sctp_info.adler32_calculated = TRUE; sctp_info.adler32_correct = adler32_correct; sctp_info.crc32c_calculated = TRUE; sctp_info.crc32c_correct = crc32c_correct; break; } } source_port = tvb_get_ntohs(tvb, SOURCE_PORT_OFFSET); destination_port = tvb_get_ntohs(tvb, DESTINATION_PORT_OFFSET); vtag = tvb_get_ntohl(tvb,VERIFICATION_TAG_OFFSET); ha = get_half_assoc(pinfo, source_port, destination_port, vtag); /* In the interest of speed, if "tree" is NULL, don't do any work not necessary to generate protocol tree items. */ if (tree) { /* create the sctp protocol tree */ if (show_port_numbers) sctp_item = proto_tree_add_protocol_format(tree, proto_sctp, tvb, 0, -1, "Stream Control Transmission Protocol, Src Port: %s (%u), Dst Port: %s (%u)", sctp_port_to_display(pinfo->pool, source_port), source_port, sctp_port_to_display(pinfo->pool, destination_port), destination_port); else sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, 0, -1, ENC_NA); sctp_tree = proto_item_add_subtree(sctp_item, ett_sctp); /* add the components of the common header to the protocol tree */ proto_tree_add_item(sctp_tree, hf_source_port, tvb, SOURCE_PORT_OFFSET, SOURCE_PORT_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(sctp_tree, hf_destination_port, tvb, DESTINATION_PORT_OFFSET, DESTINATION_PORT_LENGTH, ENC_BIG_ENDIAN); vt = proto_tree_add_item(sctp_tree, hf_verification_tag, tvb, VERIFICATION_TAG_OFFSET, VERIFICATION_TAG_LENGTH, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(sctp_tree, hf_port, tvb, SOURCE_PORT_OFFSET, SOURCE_PORT_LENGTH, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_item(sctp_tree, hf_port, tvb, DESTINATION_PORT_OFFSET, DESTINATION_PORT_LENGTH, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); } else { sctp_tree = NULL; sctp_item = NULL; } if (captured_length == reported_length) { /* We have the whole packet */ switch(sctp_checksum) { case SCTP_CHECKSUM_NONE: proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); break; case SCTP_CHECKSUM_ADLER32: proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum_adler, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, calculated_adler32, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); break; case SCTP_CHECKSUM_CRC32C: proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum_crc32c, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, calculated_crc32c, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); break; case SCTP_CHECKSUM_AUTOMATIC: if ((adler32_correct) && !(crc32c_correct)) proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum_adler, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, calculated_adler32, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); else if ((!adler32_correct) && (crc32c_correct)) proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum_crc32c, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, calculated_crc32c, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); else { proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum_adler, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, calculated_adler32, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum_crc32c, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, calculated_crc32c, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); } break; } } else { /* We don't have the whole packet so we can't verify the checksum */ proto_tree_add_checksum(sctp_tree, tvb, CHECKSUM_OFFSET, hf_checksum, hf_checksum_status, &ei_sctp_bad_sctp_checksum, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); } /* add all chunks of the sctp datagram to the protocol tree */ dissect_sctp_chunks(tvb, pinfo, tree, sctp_item, sctp_tree, ha, encapsulated); /* add assoc_index and move it behind the verification tag */ if (enable_association_indexing) { pi = proto_tree_add_uint(sctp_tree, hf_sctp_assoc_index, tvb, 0 , 0, sctp_info.assoc_index); } else { pi = proto_tree_add_uint_format_value(sctp_tree, hf_sctp_assoc_index, tvb, 0 , 0, sctp_info.assoc_index, "disabled (enable in preferences)"); } proto_item_set_generated(pi); proto_tree_move_item(sctp_tree, vt, pi); } static gboolean capture_sctp(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) { capture_dissector_increment_count(cpinfo, proto_sctp); return TRUE; } static int dissect_sctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint16 source_port, destination_port; guint number_of_ppid; /* Extract the common header */ source_port = tvb_get_ntohs(tvb, SOURCE_PORT_OFFSET); destination_port = tvb_get_ntohs(tvb, DESTINATION_PORT_OFFSET); /* update pi structure */ pinfo->ptype = PT_SCTP; pinfo->srcport = source_port; pinfo->destport = destination_port; /* make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCTP"); /* Clear entries in Info column on summary display */ col_clear(pinfo->cinfo, COL_INFO); for(number_of_ppid = 0; number_of_ppid < MAX_NUMBER_OF_PPIDS; number_of_ppid++) { p_add_proto_data(pinfo->pool, pinfo, proto_sctp, number_of_ppid, GUINT_TO_POINTER(LAST_PPID)); } /* The tvb array in struct _sctp_info is huge: currently 2k pointers. * We know (by the value of 'number_of_tvbs') which of these entries have * been used, so don't memset() the array. This saves us from zeroing out * 8k (4-byte pointers) or 16k (8-byte pointers) of memory every time we * dissect a packet (saving quite a bit of time!). */ sctp_info.incomplete = 0; sctp_info.adler32_calculated = 0; sctp_info.adler32_correct = 0; sctp_info.crc32c_calculated = 0; sctp_info.crc32c_correct = 0; sctp_info.vtag_reflected = 0; sctp_info.number_of_tvbs = 0; sctp_info.verification_tag = tvb_get_ntohl(tvb, VERIFICATION_TAG_OFFSET); sctp_info.sport = pinfo->srcport; sctp_info.dport = pinfo->destport; set_address(&sctp_info.ip_src, pinfo->src.type, pinfo->src.len, pinfo->src.data); set_address(&sctp_info.ip_dst, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data); p_add_proto_data(pinfo->pool, pinfo, hf_source_port, pinfo->curr_layer_num, GUINT_TO_POINTER(pinfo->srcport)); p_add_proto_data(pinfo->pool, pinfo, hf_destination_port, pinfo->curr_layer_num, GUINT_TO_POINTER(pinfo->destport)); dissect_sctp_packet(tvb, pinfo, tree, FALSE); if (!pinfo->flags.in_error_pkt && sctp_info.number_of_tvbs > 0) tap_queue_packet(sctp_tap, pinfo, &sctp_info); return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ void proto_register_sctp(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_source_port, { "Source port", "sctp.srcport", FT_UINT16, BASE_PT_SCTP, NULL, 0x0, NULL, HFILL } }, { &hf_destination_port, { "Destination port", "sctp.dstport", FT_UINT16, BASE_PT_SCTP, NULL, 0x0, NULL, HFILL } }, { &hf_port, { "Port", "sctp.port", FT_UINT16, BASE_PT_SCTP, NULL, 0x0, NULL, HFILL } }, { &hf_verification_tag, { "Verification tag", "sctp.verification_tag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_checksum, { "Checksum", "sctp.checksum", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_checksum_adler, { "Checksum (Adler)", "sctp.checksum", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_checksum_crc32c, { "Checksum (CRC32C)", "sctp.checksum", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_checksum_status, { "Checksum Status", "sctp.checksum.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL } }, { &hf_chunk_type, { "Chunk type", "sctp.chunk_type", FT_UINT8, BASE_DEC, VALS(chunk_type_values), 0x0, NULL, HFILL } }, { &hf_chunk_flags, { "Chunk flags", "sctp.chunk_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_chunk_bit_1, { "Bit", "sctp.chunk_bit_1", FT_BOOLEAN, 8, TFS(&sctp_chunk_bit_1_value), SCTP_CHUNK_BIT_1, NULL, HFILL } }, { &hf_chunk_bit_2, { "Bit", "sctp.chunk_bit_2", FT_BOOLEAN, 8, TFS(&sctp_chunk_bit_2_value), SCTP_CHUNK_BIT_2, NULL, HFILL } }, { &hf_chunk_length, { "Chunk length", "sctp.chunk_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_chunk_padding, { "Chunk padding", "sctp.chunk_padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_chunk_value, { "Chunk value", "sctp.chunk_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_cookie, { "Cookie", "sctp.cookie", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_initiate_tag, { "Initiate tag", "sctp.initiate_tag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_init_chunk_initiate_tag, { "Initiate tag", "sctp.init_initiate_tag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_init_chunk_adv_rec_window_credit, { "Advertised receiver window credit (a_rwnd)", "sctp.init_credit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_init_chunk_number_of_outbound_streams, { "Number of outbound streams", "sctp.init_nr_out_streams", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_init_chunk_number_of_inbound_streams, { "Number of inbound streams", "sctp.init_nr_in_streams", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_init_chunk_initial_tsn, { "Initial TSN", "sctp.init_initial_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_initack_chunk_initiate_tag, { "Initiate tag", "sctp.initack_initiate_tag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_initack_chunk_adv_rec_window_credit, { "Advertised receiver window credit (a_rwnd)", "sctp.initack_credit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_initack_chunk_number_of_outbound_streams, { "Number of outbound streams", "sctp.initack_nr_out_streams", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_initack_chunk_number_of_inbound_streams, { "Number of inbound streams", "sctp.initack_nr_in_streams", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_initack_chunk_initial_tsn, { "Initial TSN", "sctp.initack_initial_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_tsn, { "Transmission sequence number (relative)", "sctp.data_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_tsn_raw, { "Transmission sequence number (absolute)", "sctp.data_tsn_raw", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_stream_id, { "Stream identifier", "sctp.data_sid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_stream_seq_number, { "Stream sequence number", "sctp.data_ssn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_payload_proto_id, { "Payload protocol identifier", "sctp.data_payload_proto_id", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sctpppid_val_ext, 0x0, NULL, HFILL } }, { &hf_idata_chunk_reserved, { "Reserved", "sctp.data_reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_idata_chunk_mid, { "Message identifier", "sctp.data_mid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_idata_chunk_fsn, { "Fragment sequence number", "sctp.data_fsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_e_bit, { "E-Bit", "sctp.data_e_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_e_bit_value), SCTP_DATA_CHUNK_E_BIT, NULL, HFILL } }, { &hf_data_chunk_b_bit, { "B-Bit", "sctp.data_b_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_b_bit_value), SCTP_DATA_CHUNK_B_BIT, NULL, HFILL } }, { &hf_data_chunk_u_bit, { "U-Bit", "sctp.data_u_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_u_bit_value), SCTP_DATA_CHUNK_U_BIT, NULL, HFILL } }, { &hf_data_chunk_i_bit, { "I-Bit", "sctp.data_i_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_i_bit_value), SCTP_DATA_CHUNK_I_BIT, NULL, HFILL } }, { &hf_sack_chunk_ns, { "Nonce sum", "sctp.sack_nonce_sum", FT_UINT8, BASE_DEC, NULL, SCTP_SACK_CHUNK_NS_BIT, NULL, HFILL } }, { &hf_sack_chunk_cumulative_tsn_ack, { "Cumulative TSN ACK (relative)", "sctp.sack_cumulative_tsn_ack", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_cumulative_tsn_ack_raw, { "Cumulative TSN ACK (absolute)", "sctp.sack_cumulative_tsn_ack_raw", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_adv_rec_window_credit, { "Advertised receiver window credit (a_rwnd)", "sctp.sack_a_rwnd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_number_of_gap_blocks, { "Number of gap acknowledgement blocks", "sctp.sack_number_of_gap_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_number_of_dup_tsns, { "Number of duplicated TSNs", "sctp.sack_number_of_duplicated_tsns", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_gap_block_start, { "Start", "sctp.sack_gap_block_start", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_gap_block_start_tsn, { "Start TSN", "sctp.sack_gap_block_start_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_gap_block_end, { "End", "sctp.sack_gap_block_end", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_gap_block_end_tsn, { "End TSN", "sctp.sack_gap_block_end_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_number_tsns_gap_acked, { "Number of TSNs in gap acknowledgement blocks", "sctp.sack_number_of_tsns_gap_acked", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sack_chunk_duplicate_tsn, { "Duplicate TSN", "sctp.sack_duplicate_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_ns, { "Nonce sum", "sctp.nr_sack_nonce_sum", FT_UINT8, BASE_DEC, NULL, SCTP_NR_SACK_CHUNK_NS_BIT, NULL, HFILL } }, { &hf_nr_sack_chunk_cumulative_tsn_ack, { "Cumulative TSN ACK", "sctp.nr_sack_cumulative_tsn_ack", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_adv_rec_window_credit, { "Advertised receiver window credit (a_rwnd)", "sctp.nr_sack_a_rwnd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_number_of_gap_blocks, { "Number of gap acknowledgement blocks", "sctp.nr_sack_number_of_gap_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_number_of_nr_gap_blocks, { "Number of nr-gap acknowledgement blocks", "sctp.nr_sack_number_of_nr_gap_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_number_of_dup_tsns, { "Number of duplicated TSNs", "sctp.nr_sack_number_of_duplicated_tsns", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_reserved, { "Reserved", "sctp.nr_sack_reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_gap_block_start, { "Start", "sctp.nr_sack_gap_block_start", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_gap_block_start_tsn, { "Start TSN", "sctp.nr_sack_gap_block_start_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_gap_block_end, { "End", "sctp.nr_sack_gap_block_end", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_gap_block_end_tsn, { "End TSN", "sctp.nr_sack_gap_block_end_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_number_tsns_gap_acked, { "Number of TSNs in gap acknowledgement blocks", "sctp.nr_sack_number_of_tsns_gap_acked", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_nr_gap_block_start, { "Start", "sctp.nr_sack_nr_gap_block_start", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_nr_gap_block_start_tsn, { "Start TSN", "sctp.nr_sack_nr_gap_block_start_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_nr_gap_block_end, { "End", "sctp.nr_sack_nr_gap_block_end", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_nr_gap_block_end_tsn, { "End TSN", "sctp.nr_sack_nr_gap_block_end_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_number_tsns_nr_gap_acked, { "Number of TSNs in nr-gap acknowledgement blocks","sctp.nr_sack_number_of_tsns_nr_gap_acked", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nr_sack_chunk_duplicate_tsn, { "Duplicate TSN", "sctp.nr_sack_duplicate_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shutdown_chunk_cumulative_tsn_ack, { "Cumulative TSN Ack", "sctp.shutdown_cumulative_tsn_ack", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecne_chunk_lowest_tsn, { "Lowest TSN", "sctp.ecne_lowest_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_cwr_chunk_lowest_tsn, { "Lowest TSN", "sctp.cwr_lowest_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shutdown_complete_chunk_t_bit, { "T-Bit", "sctp.shutdown_complete_t_bit", FT_BOOLEAN, 8, TFS(&sctp_shutdown_complete_chunk_t_bit_value), SCTP_SHUTDOWN_COMPLETE_CHUNK_T_BIT, NULL, HFILL } }, { &hf_abort_chunk_t_bit, { "T-Bit", "sctp.abort_t_bit", FT_BOOLEAN, 8, TFS(&sctp_shutdown_complete_chunk_t_bit_value), SCTP_ABORT_CHUNK_T_BIT, NULL, HFILL } }, { &hf_forward_tsn_chunk_tsn, { "New cumulative TSN", "sctp.forward_tsn_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_forward_tsn_chunk_sid, { "Stream identifier", "sctp.forward_tsn_sid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_forward_tsn_chunk_ssn, { "Stream sequence number", "sctp.forward_tsn_ssn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_i_forward_tsn_chunk_tsn, { "New cumulative TSN", "sctp.i_forward_tsn_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_i_forward_tsn_chunk_sid, { "Stream identifier", "sctp.i_forward_tsn_sid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_i_forward_tsn_chunk_flags, { "Flags", "sctp.i_forward_tsn_flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_i_forward_tsn_chunk_res, { "Reserved", "sctp.i_forward_tsn_res", FT_UINT16, BASE_DEC, NULL, SCTP_I_FORWARD_TSN_CHUNK_RES_MASK, NULL, HFILL } }, { &hf_i_forward_tsn_chunk_u_bit, { "U-Bit", "sctp.i_forward_tsn_u_bit", FT_BOOLEAN, 16, TFS(&sctp_i_forward_tsn_chunk_u_bit_value), SCTP_I_FORWARD_TSN_CHUNK_U_BIT, NULL, HFILL } }, { &hf_i_forward_tsn_chunk_mid, { "Message identifier", "sctp.forward_tsn_mid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_parameter_type, { "Parameter type", "sctp.parameter_type", FT_UINT16, BASE_HEX, VALS(parameter_identifier_values), 0x0, NULL, HFILL } }, { &hf_parameter_length, { "Parameter length", "sctp.parameter_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_parameter_value, { "Parameter value", "sctp.parameter_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_parameter_padding, { "Parameter padding", "sctp.parameter_padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_parameter_bit_1, { "Bit", "sctp.parameter_bit_1", FT_BOOLEAN, 16, TFS(&sctp_parameter_bit_1_value), SCTP_PARAMETER_BIT_1, NULL, HFILL } }, { &hf_parameter_bit_2, { "Bit", "sctp.parameter_bit_2", FT_BOOLEAN, 16, TFS(&sctp_parameter_bit_2_value), SCTP_PARAMETER_BIT_2, NULL, HFILL } }, { &hf_ipv4_address, { "IP Version 4 address", "sctp.parameter_ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ipv6_address, { "IP Version 6 address", "sctp.parameter_ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_heartbeat_info, { "Heartbeat information", "sctp.parameter_heartbeat_information", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_state_cookie, { "State cookie", "sctp.parameter_state_cookie", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_cookie_preservative_increment, { "Suggested Cookie life-span increment (msec)", "sctp.parameter_cookie_preservative_incr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_hostname, { "Hostname", "sctp.parameter_hostname", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_supported_address_type, { "Supported address type", "sctp.parameter_supported_address_type", FT_UINT16, BASE_DEC, VALS(address_types_values), 0x0, NULL, HFILL } }, { &hf_stream_reset_req_seq_nr, { "Re-configuration request sequence number", "sctp.parameter_reconfig_request_sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_stream_reset_rsp_seq_nr, { "Re-configuration response sequence number", "sctp.parameter_reconfig_response_sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_senders_last_assigned_tsn, { "Senders last assigned TSN", "sctp.parameter_senders_last_assigned_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_senders_next_tsn, { "Senders next TSN", "sctp.parameter_senders_next_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_receivers_next_tsn, { "Receivers next TSN", "sctp.parameter_receivers_next_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_stream_reset_rsp_result, { "Result", "sctp.parameter_reconfig_response_result", FT_UINT32, BASE_DEC, VALS(stream_reset_result_values), 0x0, NULL, HFILL } }, { &hf_stream_reset_sid, { "Stream Identifier", "sctp.parameter_reconfig_sid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_add_outgoing_streams_number_streams, { "Number of streams", "sctp.parameter_add_outgoing_streams_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_add_outgoing_streams_reserved, { "Reserved", "sctp.parameter_add_outgoing_streams_reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_add_incoming_streams_number_streams, { "Number of streams", "sctp.parameter_add_incoming_streams_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_add_incoming_streams_reserved, { "Reserved", "sctp.parameter_add_incoming_streams_reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_asconf_seq_nr, { "Sequence number", "sctp.asconf_seq_nr_number", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_asconf_ack_seq_nr, { "Sequence number", "sctp.asconf_ack_seq_nr_number", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_correlation_id, { "Correlation_id", "sctp.correlation_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_adap_indication, { "Indication", "sctp.adaptation_layer_indication", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_zero_checksum_edmid, { "Error Detection Method Identifier", "sctp.edmid", FT_UINT32, BASE_DEC, VALS(edmid_values), 0x0, NULL, HFILL } }, { &hf_random_number, { "Random number", "sctp.random_number", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_chunks_to_auth, { "Chunk type", "sctp.chunk_type_to_auth", FT_UINT8, BASE_DEC, VALS(chunk_type_values), 0x0, NULL, HFILL } }, { &hf_hmac_id, { "HMAC identifier", "sctp.hmac_id", FT_UINT16, BASE_DEC, VALS(hmac_id_values), 0x0, NULL, HFILL } }, { &hf_hmac, { "HMAC", "sctp.hmac", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shared_key_id, { "Shared key identifier", "sctp.shared_key_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_supported_chunk_type, { "Supported chunk type", "sctp.supported_chunk_type", FT_UINT8, BASE_DEC, VALS(chunk_type_values), 0x0, NULL, HFILL } }, { &hf_cause_code, { "Cause code", "sctp.cause_code", FT_UINT16, BASE_HEX, VALS(cause_code_values), 0x0, NULL, HFILL } }, { &hf_cause_length, { "Cause length", "sctp.cause_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_cause_info, { "Cause information", "sctp.cause_information", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_cause_padding, { "Cause padding", "sctp.cause_padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_cause_stream_identifier, { "Stream identifier", "sctp.cause_stream_identifier", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_cause_reserved, { "Reserved", "sctp.cause_reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_cause_number_of_missing_parameters, { "Number of missing parameters", "sctp.cause_nr_of_missing_parameters", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_cause_missing_parameter_type, { "Missing parameter type", "sctp.cause_missing_parameter_type", FT_UINT16, BASE_HEX, VALS(parameter_identifier_values), 0x0, NULL, HFILL } }, { &hf_cause_measure_of_staleness, { "Measure of staleness in usec", "sctp.cause_measure_of_staleness", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_cause_tsn, { "TSN", "sctp.cause_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pktdrop_chunk_m_bit, { "M-Bit", "sctp.pckdrop_m_bit", FT_BOOLEAN, 8, TFS(&sctp_pktdropk_m_bit_value), SCTP_PKTDROP_CHUNK_M_BIT, NULL, HFILL } }, { &hf_pktdrop_chunk_b_bit, { "B-Bit", "sctp.pckdrop_b_bit", FT_BOOLEAN, 8, TFS(&sctp_pktdropk_b_bit_value), SCTP_PKTDROP_CHUNK_B_BIT, NULL, HFILL } }, { &hf_pktdrop_chunk_t_bit, { "T-Bit", "sctp.pckdrop_t_bit", FT_BOOLEAN, 8, TFS(&sctp_pktdropk_t_bit_value), SCTP_PKTDROP_CHUNK_T_BIT, NULL, HFILL } }, { &hf_pktdrop_chunk_bandwidth, { "Bandwidth", "sctp.pktdrop_bandwidth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pktdrop_chunk_queuesize, { "Queuesize", "sctp.pktdrop_queuesize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pktdrop_chunk_truncated_length, { "Truncated length", "sctp.pktdrop_truncated_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pktdrop_chunk_reserved, { "Reserved", "sctp.pktdrop_reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pktdrop_chunk_data_field, { "Data field", "sctp.pktdrop_datafield", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_pad_chunk_padding_data, { "Padding data", "sctp.padding_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_fragment, { "SCTP Fragment", "sctp.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_fragments, { "Reassembled SCTP Fragments", "sctp.fragments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_reassembled_in, { "Reassembled Message in frame", "sctp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_duplicate, { "Fragment already seen in frame", "sctp.duplicate", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_data_rtt, { "The RTT to SACK was", "sctp.data_rtt", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_sack_rtt, { "The RTT since DATA was", "sctp.sack_rtt", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_rto, { "Retransmitted after", "sctp.retransmission_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_retransmission, { "This TSN is a retransmission of one in frame", "sctp.retransmission", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_retransmitted, { "This TSN is retransmitted in frame", "sctp.retransmitted", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_retransmitted_count, { "TSN was retransmitted this many times", "sctp.retransmitted_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_acked, { "This chunk is acked in frame", "sctp.acked", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_ack_tsn, { "Acknowledges TSN", "sctp.ack", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_ack_frame, { "Acknowledges TSN in frame", "sctp.ack_frame", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_ACK), 0x0, NULL, HFILL } }, { &hf_sctp_retransmitted_after_ack, { "Chunk was acked prior to retransmission", "sctp.retransmitted_after_ack", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sctp_assoc_index, { "Association index", "sctp.assoc_index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sctp, &ett_sctp_chunk, &ett_sctp_chunk_parameter, &ett_sctp_chunk_cause, &ett_sctp_chunk_type, &ett_sctp_data_chunk_flags, &ett_sctp_sack_chunk_flags, &ett_sctp_nr_sack_chunk_flags, &ett_sctp_abort_chunk_flags, &ett_sctp_shutdown_complete_chunk_flags, &ett_sctp_pktdrop_chunk_flags, &ett_sctp_parameter_type, &ett_sctp_sack_chunk_gap_block, &ett_sctp_sack_chunk_gap_block_start, &ett_sctp_sack_chunk_gap_block_end, &ett_sctp_nr_sack_chunk_gap_block, &ett_sctp_nr_sack_chunk_gap_block_start, &ett_sctp_nr_sack_chunk_gap_block_end, &ett_sctp_nr_sack_chunk_nr_gap_block, &ett_sctp_nr_sack_chunk_nr_gap_block_start, &ett_sctp_nr_sack_chunk_nr_gap_block_end, &ett_sctp_unrecognized_parameter_parameter, &ett_sctp_i_forward_tsn_chunk_flags, &ett_sctp_fragments, &ett_sctp_fragment, &ett_sctp_ack, &ett_sctp_acked, &ett_sctp_tsn, &ett_sctp_tsn_retransmission, &ett_sctp_tsn_retransmitted_count, &ett_sctp_tsn_retransmitted }; static ei_register_info ei[] = { { &ei_sctp_tsn_retransmitted, { "sctp.retransmission.expert", PI_SEQUENCE, PI_NOTE, "Retransmitted TSN", EXPFILL }}, { &ei_sctp_retransmitted_after_ack, { "sctp.retransmitted_after_ack.expert", PI_SEQUENCE, PI_WARN, "This TSN was acked prior to this retransmission (reneged ack?).", EXPFILL }}, { &ei_sctp_tsn_retransmitted_more_than_twice, { "sctp.retransmission.more_than_twice", PI_SEQUENCE, PI_WARN, "This TSN was retransmitted more than 2 times.", EXPFILL }}, { &ei_sctp_parameter_padding, { "sctp.parameter_padding.expert", PI_MALFORMED, PI_NOTE, "The padding of this final parameter should be the padding of the chunk.", EXPFILL }}, { &ei_sctp_parameter_length, { "sctp.parameter_length.bad", PI_MALFORMED, PI_ERROR, "Parameter length bad", EXPFILL }}, { &ei_sctp_sack_chunk_adv_rec_window_credit, { "sctp.sack_a_rwnd.expert", PI_SEQUENCE, PI_NOTE, "Zero Advertised Receiver Window Credit", EXPFILL }}, { &ei_sctp_sack_chunk_gap_block_malformed, { "sctp.sack_gap_block_malformed", PI_PROTOCOL, PI_ERROR, "Malformed gap block.", EXPFILL }}, { &ei_sctp_sack_chunk_gap_block_out_of_order, { "sctp.sack_gap_block_out_of_order", PI_PROTOCOL, PI_WARN, "Gap blocks not in strict order.", EXPFILL }}, { &ei_sctp_sack_chunk_number_tsns_gap_acked_100, { "sctp.sack_number_of_tsns_gap_acked.100", PI_SEQUENCE, PI_WARN, "More than 100 TSNs were gap-acknowledged in this SACK.", EXPFILL }}, { &ei_sctp_nr_sack_chunk_number_tsns_gap_acked_100, { "sctp.nr_sack_number_of_tsns_gap_acked.100", PI_SEQUENCE, PI_WARN, "More than 100 TSNs were gap-acknowledged in this NR-SACK.", EXPFILL }}, { &ei_sctp_nr_sack_chunk_number_tsns_nr_gap_acked_100, { "sctp.nr_sack_number_of_tsns_nr_gap_acked.100", PI_SEQUENCE, PI_WARN, "More than 100 TSNs were nr-gap-acknowledged in this NR-SACK.", EXPFILL }}, { &ei_sctp_chunk_length_bad, { "sctp.chunk_length.bad", PI_MALFORMED, PI_ERROR, "Chunk length bad", EXPFILL }}, { &ei_sctp_bad_sctp_checksum, { "sctp.checksum_bad.expert", PI_CHECKSUM, PI_ERROR, "Bad SCTP checksum.", EXPFILL }}, }; static const enum_val_t sctp_checksum_options[] = { { "none", "None", SCTP_CHECKSUM_NONE }, { "adler-32", "Adler 32", SCTP_CHECKSUM_ADLER32 }, { "crc-32c", "CRC 32c", SCTP_CHECKSUM_CRC32C }, { "automatic", "Automatic", SCTP_CHECKSUM_AUTOMATIC}, { NULL, NULL, 0 } }; /* Decode As handling */ static build_valid_func sctp_da_src_values[1] = {sctp_src_value}; static build_valid_func sctp_da_dst_values[1] = {sctp_dst_value}; static build_valid_func sctp_da_both_values[2] = {sctp_src_value, sctp_dst_value}; static decode_as_value_t sctp_da_port_values[3] = {{sctp_src_prompt, 1, sctp_da_src_values}, {sctp_dst_prompt, 1, sctp_da_dst_values}, {sctp_both_prompt, 2, sctp_da_both_values}}; static decode_as_t sctp_da_port = {"sctp", "sctp.port", 3, 2, sctp_da_port_values, "SCTP", "port(s) as", decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; static build_valid_func sctp_da_ppi_build_value1[1] = {sctp_ppi_value1}; static build_valid_func sctp_da_ppi_build_value2[1] = {sctp_ppi_value2}; static decode_as_value_t sctp_da_ppi_values[2] = {{sctp_ppi_prompt1, 1, sctp_da_ppi_build_value1}, {sctp_ppi_prompt2, 1, sctp_da_ppi_build_value2}}; static decode_as_t sctp_da_ppi = {"sctp", "sctp.ppi", 2, 0, sctp_da_ppi_values, "SCTP", NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; /* UAT for header fields */ static uat_field_t custom_types_uat_fields[] = { UAT_FLD_NONE(type_fields, type_id, "Chunk ID", "IANA chunk type ID"), UAT_FLD_CSTRING(type_fields, type_name, "Type name", "Chunk Type name"), UAT_FLD_VS(type_fields, type_enable, "Visibility", chunk_enabled, "Hide or show the type in the chunk statistics"), UAT_END_FIELDS }; module_t *sctp_module; expert_module_t* expert_sctp; uat_t* chunk_types_uat; chunk_types_uat = uat_new("Chunk types for the statistics dialog", sizeof(type_field_t), "statistics_chunk_types", TRUE, &type_fields, &num_type_fields, 0, NULL, sctp_chunk_type_copy_cb, sctp_chunk_type_update_cb, sctp_chunk_type_free_cb, NULL, NULL, custom_types_uat_fields ); /* Register the protocol name and description */ proto_sctp = proto_register_protocol("Stream Control Transmission Protocol", "SCTP", "sctp"); sctp_module = prefs_register_protocol(proto_sctp, NULL); prefs_register_bool_preference(sctp_module, "show_port_numbers_in_tree", "Show port numbers in the protocol tree", "Show source and destination port numbers in the protocol tree", &show_port_numbers); prefs_register_bool_preference(sctp_module, "relative_tsns", "Relative TSNs", "Use relative TSNs instead of absolute ones", &show_relative_tsns); prefs_register_enum_preference(sctp_module, "checksum", "Checksum type", "The type of checksum used in SCTP packets", &sctp_checksum, sctp_checksum_options, FALSE); prefs_register_bool_preference(sctp_module, "show_always_control_chunks", "Show always control chunks", "Show always SCTP control chunks in the Info column", &show_always_control_chunks); prefs_register_bool_preference(sctp_module, "try_heuristic_first", "Try heuristic sub-dissectors first", "Try to decode a packet using an heuristic sub-dissector before using a sub-dissector registered to a specific port or PPI", &try_heuristic_first); prefs_register_bool_preference(sctp_module, "reassembly", "Reassemble fragmented SCTP user messages", "Whether fragmented SCTP user messages should be reassembled", &use_reassembly); prefs_register_bool_preference(sctp_module, "tsn_analysis", "Enable TSN analysis", "Match TSNs and their SACKs", &enable_tsn_analysis); prefs_register_bool_preference(sctp_module, "association_index", "Enable Association indexing (Can be CPU intense)", "Match verification tags (CPU intense)", &enable_association_indexing); prefs_register_bool_preference(sctp_module, "ulp_dissection", "Dissect upper layer protocols", "Dissect upper layer protocols", &enable_ulp_dissection); prefs_register_uat_preference_qt(sctp_module, "statistics_chunk_types", "Select the chunk types for the statistics dialog", "Select the chunk types for the statistics dialog", chunk_types_uat); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sctp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sctp = expert_register_protocol(proto_sctp); expert_register_field_array(expert_sctp, ei, array_length(ei)); sctp_tap = register_tap("sctp"); exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_3); /* subdissector code */ sctp_port_dissector_table = register_dissector_table("sctp.port", "SCTP port", proto_sctp, FT_UINT16, BASE_DEC); sctp_ppi_dissector_table = register_dissector_table("sctp.ppi", "SCTP payload protocol identifier", proto_sctp, FT_UINT32, BASE_HEX); sctp_handle = register_dissector("sctp", dissect_sctp, proto_sctp); sctp_heur_subdissector_list = register_heur_dissector_list("sctp", proto_sctp); register_init_routine(sctp_init); register_cleanup_routine(sctp_cleanup); dirs_by_ptvtag = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); dirs_by_ptaddr = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); register_decode_as(&sctp_da_port); register_decode_as(&sctp_da_ppi); register_conversation_table(proto_sctp, FALSE, sctp_conversation_packet, sctp_endpoint_packet); } void proto_reg_handoff_sctp(void) { capture_dissector_handle_t sctp_cap_handle; dissector_add_uint("wtap_encap", WTAP_ENCAP_SCTP, sctp_handle); dissector_add_uint("ip.proto", IP_PROTO_SCTP, sctp_handle); dissector_add_uint_with_preference("udp.port", UDP_TUNNELING_PORT, sctp_handle); dissector_add_uint_with_preference("dtls.port", UDP_TUNNELING_PORT, sctp_handle); sctp_cap_handle = create_capture_dissector_handle(capture_sctp, proto_sctp); capture_dissector_add_uint("ip.proto", IP_PROTO_SCTP, sctp_cap_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-sctp.h
/* packet-sctp.h * * Defintion of SCTP specific structures used by tap listeners. * * Copyright 2004 Michael Tuexen <tuexen [AT] fh-muenster.de> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SCTP_H__ #define __PACKET_SCTP_H__ #include "ws_symbol_export.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define MAXIMUM_NUMBER_OF_TVBS 2048 struct _sctp_info { gboolean incomplete; gboolean adler32_calculated; gboolean adler32_correct; gboolean crc32c_calculated; gboolean crc32c_correct; gboolean checksum_zero; gboolean vtag_reflected; guint16 sport; guint16 dport; address ip_src; address ip_dst; guint32 verification_tag; guint16 assoc_index; guint16 direction; guint32 number_of_tvbs; tvbuff_t *tvb[MAXIMUM_NUMBER_OF_TVBS]; }; typedef struct _sctp_fragment { guint32 frame_num; guint32 tsn; guint32 len; guint32 ppi; unsigned char *data; struct _sctp_fragment *next; } sctp_fragment; typedef struct _sctp_frag_be { sctp_fragment* fragment; struct _sctp_frag_be *next; } sctp_frag_be; typedef struct _sctp_complete_msg { guint32 begin; guint32 end; sctp_fragment* reassembled_in; guint32 len; unsigned char *data; struct _sctp_complete_msg *next; } sctp_complete_msg; typedef struct _sctp_frag_msg { sctp_frag_be* begins; sctp_frag_be* ends; sctp_fragment* fragments; sctp_complete_msg* messages; guint32 ppi; struct _sctp_frag_msg* next; } sctp_frag_msg; #define SCTP_DATA_CHUNK_ID 0 #define SCTP_INIT_CHUNK_ID 1 #define SCTP_INIT_ACK_CHUNK_ID 2 #define SCTP_SACK_CHUNK_ID 3 #define SCTP_HEARTBEAT_CHUNK_ID 4 #define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 #define SCTP_ABORT_CHUNK_ID 6 #define SCTP_SHUTDOWN_CHUNK_ID 7 #define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 #define SCTP_ERROR_CHUNK_ID 9 #define SCTP_COOKIE_ECHO_CHUNK_ID 10 #define SCTP_COOKIE_ACK_CHUNK_ID 11 #define SCTP_ECNE_CHUNK_ID 12 #define SCTP_CWR_CHUNK_ID 13 #define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 #define SCTP_AUTH_CHUNK_ID 15 #define SCTP_NR_SACK_CHUNK_ID 16 #define SCTP_I_DATA_CHUNK_ID 0x40 #define SCTP_ASCONF_ACK_CHUNK_ID 0x80 #define SCTP_PKTDROP_CHUNK_ID 0x81 #define SCTP_RE_CONFIG_CHUNK_ID 0x82 #define SCTP_PAD_CHUNK_ID 0x84 #define SCTP_FORWARD_TSN_CHUNK_ID 0xC0 #define SCTP_ASCONF_CHUNK_ID 0xC1 #define SCTP_I_FORWARD_TSN_CHUNK_ID 0xC2 #define SCTP_IETF_EXT 0xFF #define IS_SCTP_CHUNK_TYPE(t) \ (((t) <= SCTP_NR_SACK_CHUNK_ID) || \ ((t) == SCTP_I_DATA_CHUNK_ID) || \ ((t) == SCTP_FORWARD_TSN_CHUNK_ID) || \ ((t) == SCTP_ASCONF_CHUNK_ID) || \ ((t) == SCTP_ASCONF_ACK_CHUNK_ID) || \ ((t) == SCTP_PKTDROP_CHUNK_ID)) WS_DLL_PUBLIC const value_string chunk_type_values[]; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-scylla.c
/* packet-scylla.c * Routines for Scylla RPC dissection * Copyright 2020 ScyllaDB, Piotr Sarna <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * ScyllaDB RPC protocol is used for inter-node communication * in the ScyllaDB database - reading/sending data, exchanging * cluster information through gossip, updating schemas, etc. * * Protocol references: * https://github.com/scylladb/seastar/blob/master/doc/rpc.md * https://github.com/scylladb/scylla/blob/master/message/messaging_service.hh * */ #include <config.h> #include <epan/expert.h> #include <epan/packet.h> #include <epan/prefs.h> #include "packet-tcp.h" void proto_reg_handoff_scylla(void); void proto_register_scylla(void); #define SCYLLA_PORT 0 /* Not IANA registered, 7000 is the expected value */ #define SCYLLA_HEADER_SIZE 28 #define SCYLLA_HEADER_VERB_OFFSET 8 #define SCYLLA_HEADER_MSG_ID_OFFSET 16 #define SCYLLA_HEADER_LEN_OFFSET 24 #define SCYLLA_RESPONSE_SIZE 12 #define SCYLLA_RESPONSE_MSG_ID_OFFSET 0 #define SCYLLA_RESPONSE_LEN_OFFSET 8 #define SCYLLA_NEGOTIATION_SIZE 12 #define SCYLLA_NEGOTIATION_LEN_OFFSET 8 static int proto_scylla = -1; static int hf_scylla_request = -1; static int hf_scylla_request_response_frame = -1; static int hf_scylla_timeout = -1; static int hf_scylla_verb = -1; static int hf_scylla_msg_id = -1; static int hf_scylla_len = -1; static int hf_scylla_response = -1; static int hf_scylla_response_size = -1; static int hf_scylla_response_request_frame = -1; static int hf_scylla_negotiation_magic = -1; static int hf_scylla_negotiation_size = -1; static int hf_scylla_payload = -1; // TODO: dissect everything, so that generic "payload" is not needed // Mutation static int hf_scylla_mut_size1 = -1; static int hf_scylla_mut_size2 = -1; static int hf_scylla_mut_table_id = -1; static int hf_scylla_mut_schema_id = -1; static int hf_scylla_mut_len_pkeys = -1; static int hf_scylla_mut_num_pkeys = -1; static int hf_scylla_mut_len_pkey = -1; static int hf_scylla_mut_pkey = -1; // Read data static int hf_scylla_read_data_timeout = -1; static int hf_scylla_read_data_table_id = -1; static int hf_scylla_read_data_schema_version = -1; static gint ett_scylla = -1; static gint ett_scylla_header = -1; static gint ett_scylla_response = -1; static gint ett_scylla_negotiation = -1; static gint ett_scylla_mut = -1; static gint ett_scylla_mut_pkey = -1; static gint ett_scylla_read_data = -1; static gboolean scylla_desegment = TRUE; static expert_field ei_scylla_response_missing = EI_INIT; enum scylla_packets { CLIENT_ID = 0, MUTATION = 1, MUTATION_DONE = 2, READ_DATA = 3, READ_MUTATION_DATA = 4, READ_DIGEST = 5, // Used by gossip GOSSIP_DIGEST_SYN = 6, GOSSIP_DIGEST_ACK = 7, GOSSIP_DIGEST_ACK2 = 8, GOSSIP_ECHO = 9, GOSSIP_SHUTDOWN = 10, // end of gossip verb DEFINITIONS_UPDATE = 11, TRUNCATE = 12, REPLICATION_FINISHED = 13, MIGRATION_REQUEST = 14, // Used by streaming PREPARE_MESSAGE = 15, PREPARE_DONE_MESSAGE = 16, STREAM_MUTATION = 17, STREAM_MUTATION_DONE = 18, COMPLETE_MESSAGE = 19, // end of streaming verbs REPAIR_CHECKSUM_RANGE = 20, GET_SCHEMA_VERSION = 21, SCHEMA_CHECK = 22, COUNTER_MUTATION = 23, MUTATION_FAILED = 24, STREAM_MUTATION_FRAGMENTS = 25, REPAIR_ROW_LEVEL_START = 26, REPAIR_ROW_LEVEL_STOP = 27, REPAIR_GET_FULL_ROW_HASHES = 28, REPAIR_GET_COMBINED_ROW_HASH = 29, REPAIR_GET_SYNC_BOUNDARY = 30, REPAIR_GET_ROW_DIFF = 31, REPAIR_PUT_ROW_DIFF = 32, REPAIR_GET_ESTIMATED_PARTITIONS = 33, REPAIR_SET_ESTIMATED_PARTITIONS = 34, REPAIR_GET_DIFF_ALGORITHMS = 35, REPAIR_GET_ROW_DIFF_WITH_RPC_STREAM = 36, REPAIR_PUT_ROW_DIFF_WITH_RPC_STREAM = 37, REPAIR_GET_FULL_ROW_HASHES_WITH_RPC_STREAM = 38, PAXOS_PREPARE = 39, PAXOS_ACCEPT = 40, PAXOS_LEARN = 41, HINT_MUTATION = 42, PAXOS_PRUNE = 43, LAST = 44, }; static const val64_string packettypenames[] = { {CLIENT_ID, "CLIENT_ID"}, {MUTATION, "MUTATION"}, {MUTATION_DONE, "MUTATION_DONE"}, {READ_DATA, "READ_DATA"}, {READ_MUTATION_DATA, "READ_MUTATION_DATA"}, {READ_DIGEST, "READ_DIGEST"}, {GOSSIP_DIGEST_SYN, "GOSSIP_DIGEST_SYN"}, {GOSSIP_DIGEST_ACK, "GOSSIP_DIGEST_ACK"}, {GOSSIP_DIGEST_ACK2, "GOSSIP_DIGEST_ACK2"}, {GOSSIP_ECHO, "GOSSIP_ECHO"}, {GOSSIP_SHUTDOWN, "GOSSIP_SHUTDOWN"}, {DEFINITIONS_UPDATE, "DEFINITIONS_UPDATE"}, {TRUNCATE, "TRUNCATE"}, {REPLICATION_FINISHED, "REPLICATION_FINISHED"}, {MIGRATION_REQUEST, "MIGRATION_REQUEST"}, {PREPARE_MESSAGE, "PREPARE_MESSAGE"}, {PREPARE_DONE_MESSAGE, "PREPARE_DONE_MESSAGE"}, {STREAM_MUTATION, "STREAM_MUTATION"}, {STREAM_MUTATION_DONE, "STREAM_MUTATION_DONE"}, {COMPLETE_MESSAGE, "COMPLETE_MESSAGE"}, {REPAIR_CHECKSUM_RANGE, "REPAIR_CHECKSUM_RANGE"}, {GET_SCHEMA_VERSION, "GET_SCHEMA_VERSION"}, {SCHEMA_CHECK, "SCHEMA_CHECK"}, {COUNTER_MUTATION, "COUNTER_MUTATION"}, {MUTATION_FAILED, "MUTATION_FAILED"}, {STREAM_MUTATION_FRAGMENTS, "STREAM_MUTATION_FRAGMENTS"}, {REPAIR_ROW_LEVEL_START, "REPAIR_ROW_LEVEL_START"}, {REPAIR_ROW_LEVEL_STOP, "REPAIR_ROW_LEVEL_STOP"}, {REPAIR_GET_FULL_ROW_HASHES, "REPAIR_GET_FULL_ROW_HASHES"}, {REPAIR_GET_COMBINED_ROW_HASH, "REPAIR_GET_COMBINED_ROW_HASH"}, {REPAIR_GET_SYNC_BOUNDARY, "REPAIR_GET_SYNC_BOUNDARY"}, {REPAIR_GET_ROW_DIFF, "REPAIR_GET_ROW_DIFF"}, {REPAIR_PUT_ROW_DIFF, "REPAIR_PUT_ROW_DIFF"}, {REPAIR_GET_ESTIMATED_PARTITIONS, "REPAIR_GET_ESTIMATED_PARTITIONS"}, {REPAIR_SET_ESTIMATED_PARTITIONS, "REPAIR_SET_ESTIMATED_PARTITIONS"}, {REPAIR_GET_DIFF_ALGORITHMS, "REPAIR_GET_DIFF_ALGORITHMS"}, {REPAIR_GET_ROW_DIFF_WITH_RPC_STREAM, "REPAIR_GET_ROW_DIFF_WITH_RPC_STREAM"}, {REPAIR_PUT_ROW_DIFF_WITH_RPC_STREAM, "REPAIR_PUT_ROW_DIFF_WITH_RPC_STREAM"}, {REPAIR_GET_FULL_ROW_HASHES_WITH_RPC_STREAM, "REPAIR_GET_FULL_ROW_HASHES_WITH_RPC_STREAM"}, {PAXOS_PREPARE, "PAXOS_PREPARE"}, {PAXOS_ACCEPT, "PAXOS_ACCEPT"}, {PAXOS_LEARN, "PAXOS_LEARN"}, {HINT_MUTATION, "HINT_MUTATION"}, {PAXOS_PRUNE, "PAXOS_PRUNE"}, {0, NULL} }; static gboolean looks_like_rpc_negotiation(tvbuff_t *tvb, const gint offset) { return tvb_memeql(tvb, offset, (const guint8 *)"SSTARRPC", 8) == 0; } static gboolean looks_like_response(guint64 verb_type, guint32 len) { return verb_type >= LAST || len > 64*1024*1024; } typedef struct { guint64 verb_type; guint32 request_frame_num; guint32 response_frame_num; } request_response_t; static guint get_scylla_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint64 verb_type = LAST; guint32 plen = 0; if (looks_like_rpc_negotiation(tvb, offset)) { return tvb_get_letohl(tvb, offset + SCYLLA_NEGOTIATION_LEN_OFFSET) + SCYLLA_NEGOTIATION_SIZE; } if (tvb_reported_length(tvb) >= SCYLLA_HEADER_SIZE) { plen = tvb_get_letohl(tvb, offset + SCYLLA_HEADER_LEN_OFFSET); verb_type = tvb_get_letoh64(tvb, offset + SCYLLA_HEADER_VERB_OFFSET); } if (looks_like_response(verb_type, plen)) { return tvb_get_letohl(tvb, offset + SCYLLA_RESPONSE_LEN_OFFSET) + SCYLLA_RESPONSE_SIZE; } return plen + SCYLLA_HEADER_SIZE; } static int dissect_scylla_negotiation_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *scylla_tree) { gint offset = 0; guint32 len = tvb_get_letohl(tvb, offset + SCYLLA_NEGOTIATION_LEN_OFFSET) + SCYLLA_NEGOTIATION_SIZE; proto_tree *scylla_negotiation_tree = proto_tree_add_subtree(scylla_tree, tvb, offset, len, ett_scylla_negotiation, NULL, "Protocol negotiation"); proto_tree_add_item(scylla_negotiation_tree, hf_scylla_negotiation_magic, tvb, offset, 8, ENC_ASCII); gint negotiation_offset = 8; proto_tree_add_item(scylla_negotiation_tree, hf_scylla_negotiation_size, tvb, offset + negotiation_offset, 4, ENC_LITTLE_ENDIAN); negotiation_offset += 4; proto_tree_add_item(scylla_negotiation_tree, hf_scylla_payload, tvb, offset + negotiation_offset, len - negotiation_offset, ENC_NA); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Scylla"); col_set_str(pinfo->cinfo, COL_INFO, "Protocol negotiation"); return tvb_reported_length(tvb); } static int dissect_scylla_response_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *scylla_tree, request_response_t *req_resp) { gint offset = 0; guint32 len = tvb_get_letohl(tvb, offset + SCYLLA_RESPONSE_LEN_OFFSET) + SCYLLA_RESPONSE_SIZE; /* Add response subtree */ proto_item *response_ti = proto_tree_add_string_format(scylla_tree, hf_scylla_response, tvb, offset, len, "", "Response"); proto_tree *scylla_response_tree = proto_item_add_subtree(response_ti, ett_scylla_response); gint resp_offset = 0; guint64 msg_id; proto_tree_add_item_ret_uint64(scylla_response_tree, hf_scylla_msg_id, tvb, offset + resp_offset, 8, ENC_LITTLE_ENDIAN, &msg_id); resp_offset += 8; proto_tree_add_item(scylla_response_tree, hf_scylla_response_size, tvb, offset + resp_offset, 4, ENC_LITTLE_ENDIAN); resp_offset += 4; proto_tree_add_item(scylla_response_tree, hf_scylla_payload, tvb, offset + resp_offset, len - resp_offset, ENC_NA); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Scylla"); if (req_resp) { /* Fill in the response frame */ req_resp->response_frame_num = pinfo->num; proto_item *verb_item = proto_tree_add_uint64(scylla_response_tree, hf_scylla_verb, tvb, offset + len, 8, req_resp->verb_type); proto_item_set_generated(verb_item); proto_item *req = proto_tree_add_uint(scylla_tree, hf_scylla_response_request_frame, tvb, 0, 0, req_resp->request_frame_num); proto_item_set_generated(req); proto_item_append_text(response_ti, " (msg_id=%" PRIu64 ", %s)", msg_id, val64_to_str(req_resp->verb_type, packettypenames, "Unknown (0x%02x)")); col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "Response for %s", val64_to_str(req_resp->verb_type, packettypenames, "Unknown (0x%02x)")); } else { col_set_str(pinfo->cinfo, COL_INFO, "Response for unknown packet"); } return tvb_reported_length(tvb); } static int dissect_scylla_msg_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *scylla_tree, proto_item *ti, guint64 verb_type, guint32 len, request_response_t *req_resp) { gint offset = 0; /* Add request subtree */ proto_item *request_ti = proto_tree_add_string_format(scylla_tree, hf_scylla_request, tvb, offset, SCYLLA_HEADER_SIZE, "", "Header for %s", val64_to_str(verb_type, packettypenames, "Unknown (0x%02x)")); proto_tree *scylla_header_tree = proto_item_add_subtree(request_ti, ett_scylla_response); proto_tree_add_item(scylla_header_tree, hf_scylla_timeout, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_item_append_text(ti, ", Type %s", val64_to_str(verb_type, packettypenames, "Unknown (0x%02x)")); proto_tree_add_item(scylla_header_tree, hf_scylla_verb, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; guint64 msg_id; proto_tree_add_item_ret_uint64(scylla_header_tree, hf_scylla_msg_id, tvb, offset, 8, ENC_LITTLE_ENDIAN, &msg_id); offset += 8; proto_tree_add_item(scylla_header_tree, hf_scylla_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_item_append_text(request_ti, " (msg_id=%" PRIu64 ")", msg_id); switch (verb_type) { case MUTATION: { proto_tree* scylla_mut_tree = proto_tree_add_subtree(scylla_tree, tvb, offset, len, ett_scylla_mut, NULL, "Mutation"); gint mut_offset = 0; guint32 len_keys; guint32 num_keys; proto_tree_add_item(scylla_mut_tree, hf_scylla_mut_size1, tvb, offset + mut_offset, 4, ENC_LITTLE_ENDIAN); mut_offset += 4; proto_tree_add_item(scylla_mut_tree, hf_scylla_mut_size2, tvb, offset + mut_offset, 4, ENC_LITTLE_ENDIAN); mut_offset += 4; proto_tree_add_item(scylla_mut_tree, hf_scylla_mut_table_id, tvb, offset + mut_offset, 16, ENC_NA); mut_offset += 16; proto_tree_add_item(scylla_mut_tree, hf_scylla_mut_schema_id, tvb, offset + mut_offset, 16, ENC_NA); mut_offset += 16; proto_tree_add_item_ret_uint(scylla_mut_tree, hf_scylla_mut_len_pkeys, tvb, offset + mut_offset, 4, ENC_LITTLE_ENDIAN, &len_keys); mut_offset += 4; proto_tree* scylla_mut_pkey_tree = proto_tree_add_subtree(scylla_mut_tree, tvb, offset + mut_offset, len - mut_offset, ett_scylla_mut_pkey, NULL, "Partition key"); proto_tree_add_item_ret_uint(scylla_mut_pkey_tree, hf_scylla_mut_num_pkeys, tvb, offset + mut_offset, 4, ENC_LITTLE_ENDIAN, &num_keys); mut_offset += 4; guint i; for (i = 0; i < num_keys; ++i) { guint32 len_pkey = tvb_get_letohl(tvb, offset + mut_offset); proto_tree_add_item(scylla_mut_pkey_tree, hf_scylla_mut_len_pkey, tvb, offset + mut_offset, 4, ENC_LITTLE_ENDIAN); mut_offset += 4; proto_tree_add_item(scylla_mut_pkey_tree, hf_scylla_mut_pkey, tvb, offset + mut_offset, len_pkey, ENC_NA); mut_offset += len_pkey; } // TODO: dissect further proto_tree_add_item(scylla_mut_tree, hf_scylla_payload, tvb, offset + mut_offset, len - mut_offset, ENC_NA); } break; case READ_DATA: { proto_tree* scylla_read_tree = proto_tree_add_subtree(scylla_tree, tvb, offset, len, ett_scylla_read_data, NULL, "Read data"); gint rd_offset = 0; proto_tree_add_item(scylla_read_tree, hf_scylla_read_data_timeout, tvb, offset + rd_offset, 4, ENC_LITTLE_ENDIAN); rd_offset += 4; proto_tree_add_item(scylla_read_tree, hf_scylla_read_data_table_id, tvb, offset + rd_offset, 16, ENC_NA); rd_offset += 16; proto_tree_add_item(scylla_read_tree, hf_scylla_read_data_schema_version, tvb, offset + rd_offset, 16, ENC_NA); rd_offset += 16; //TODO: dissect further proto_tree_add_item(scylla_read_tree, hf_scylla_payload, tvb, offset + rd_offset, len - rd_offset, ENC_NA); } break; default: // Generic payload. TODO: dissect proto_tree_add_item(scylla_tree, hf_scylla_payload, tvb, offset, len, ENC_NA); break; } /* req_resp will only be set if fd was already visited (PINFO_FD_VISITED(pinfo)) */ if (req_resp) { if (req_resp->response_frame_num > 0) { proto_item *rep = proto_tree_add_uint(scylla_tree, hf_scylla_request_response_frame, tvb, 0, 0, req_resp->response_frame_num); proto_item_set_generated(rep); } else { expert_add_info(pinfo, request_ti, &ei_scylla_response_missing); } } col_set_str(pinfo->cinfo, COL_PROTOCOL, "Scylla"); col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "Request %s", val64_to_str(verb_type, packettypenames, "Unknown (0x%02x)")); return tvb_reported_length(tvb); } static gboolean response_expected(guint64 verb_type) { switch (verb_type) { case GOSSIP_DIGEST_SYN: case GOSSIP_DIGEST_ACK: case GOSSIP_DIGEST_ACK2: case GOSSIP_SHUTDOWN: case DEFINITIONS_UPDATE: case MUTATION: case MUTATION_DONE: case MUTATION_FAILED: case HINT_MUTATION: case PAXOS_LEARN: case PAXOS_PRUNE: return FALSE; default: return TRUE; } } static int dissect_scylla_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset = 0; conversation_t *conversation; wmem_map_t *conv_map; proto_item *ti = proto_tree_add_item(tree, proto_scylla, tvb, 0, -1, ENC_NA); proto_tree *scylla_tree = proto_item_add_subtree(ti, ett_scylla); guint64 verb_type = LAST; guint32 len = 0; if (looks_like_rpc_negotiation(tvb, offset)) { return dissect_scylla_negotiation_pdu(tvb, pinfo, scylla_tree); } if (tvb_reported_length(tvb) >= SCYLLA_HEADER_SIZE) { verb_type = tvb_get_letoh64(tvb, offset + SCYLLA_HEADER_VERB_OFFSET); len = tvb_get_letohl(tvb, offset + SCYLLA_HEADER_LEN_OFFSET); } conversation = find_or_create_conversation(pinfo); conv_map = (wmem_map_t *)conversation_get_proto_data(conversation, proto_scylla); if (conv_map == NULL) { conv_map = wmem_map_new(wmem_file_scope(), wmem_int64_hash, g_int64_equal); conversation_add_proto_data(conversation, proto_scylla, conv_map); } if (looks_like_response(verb_type, len)) { void *req_resp; guint64 msg_id; msg_id = tvb_get_letoh64(tvb, offset + SCYLLA_RESPONSE_MSG_ID_OFFSET); req_resp = wmem_map_lookup(conv_map, &msg_id); return dissect_scylla_response_pdu(tvb, pinfo, scylla_tree, (request_response_t *)req_resp); } guint64 msg_id = tvb_get_letoh64(tvb, offset + SCYLLA_HEADER_MSG_ID_OFFSET); void *req_resp = NULL; if (response_expected(verb_type)) { if (!PINFO_FD_VISITED(pinfo)) { guint64 *key = wmem_new(wmem_file_scope(), guint64); request_response_t *val = wmem_new(wmem_file_scope(), request_response_t); *key = msg_id; val->verb_type = verb_type; val->request_frame_num = pinfo->num; wmem_map_insert(conv_map, key, val); } else { req_resp = wmem_map_lookup(conv_map, &msg_id); } } return dissect_scylla_msg_pdu(tvb, pinfo, scylla_tree, ti, verb_type, len, (request_response_t *)req_resp); } static int dissect_scylla(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, scylla_desegment, SCYLLA_NEGOTIATION_SIZE, get_scylla_pdu_len, dissect_scylla_pdu, data); return tvb_reported_length(tvb); } void proto_register_scylla(void) { static hf_register_info hf[] = { // RPC header { &hf_scylla_request, { "request", "scylla.request", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_request_response_frame, { "Response frame", "scylla.request.response", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0, NULL, HFILL } }, { &hf_scylla_timeout, { "RPC timeout", "scylla.timeout", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_verb, { "verb", "scylla.verb", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(packettypenames), 0x0, NULL, HFILL } }, { &hf_scylla_msg_id, { "msg id", "scylla.msg_id", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_len, { "packet length", "scylla.len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_payload, { "payload", "scylla.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_response, { "response", "scylla.response", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_response_size, { "response size", "scylla.response.size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_response_request_frame, { "Request frame", "scylla.response.request", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, NULL, HFILL } }, { &hf_scylla_negotiation_magic, { "negotiation magic sequence", "scylla.negotiation.magic", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_negotiation_size, { "negotiation size", "scylla.negotiation.size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, // mutation verb { &hf_scylla_mut_size1, { "mutation size 1", "scylla.mut.size1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_size2, { "mutation size 2", "scylla.mut.size2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_table_id, { "mutation table id", "scylla.mut.table_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_schema_id, { "mutation schema id", "scylla.mut.schema_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_len_pkeys, { "size of partition keys payload", "scylla.mut.len_pkeys", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_num_pkeys, { "number of partition keys", "scylla.mut.num_pkeys", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_len_pkey, { "length of a partition key", "scylla.mut.len_pkey", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_mut_pkey, { "partition key", "scylla.mut.pkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, // read_data verb { &hf_scylla_read_data_timeout, { "timeout", "scylla.read_data.timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_read_data_table_id, { "table ID", "scylla.read_data.table_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_scylla_read_data_schema_version, { "Schema version", "scylla.read_data.schema_version", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static ei_register_info ei[] = { { &ei_scylla_response_missing, { "scylla.ei_scylla_response_missing", PI_COMMENTS_GROUP, PI_NOTE, "Response has not arrived yet", EXPFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_scylla, &ett_scylla_header, &ett_scylla_response, &ett_scylla_negotiation, &ett_scylla_mut, &ett_scylla_mut_pkey, &ett_scylla_read_data, }; expert_module_t* expert_scylla; proto_scylla = proto_register_protocol("Scylla RPC protocol", "Scylla", "scylla"); module_t* scylla_module = prefs_register_protocol(proto_scylla, NULL); prefs_register_bool_preference(scylla_module, "desegment", "Desegment all Scylla messages spanning multiple TCP segments", "Whether Scylla dissector should desegment all messages spanning multiple TCP segments", &scylla_desegment); proto_register_field_array(proto_scylla, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_scylla = expert_register_protocol(proto_scylla); expert_register_field_array(expert_scylla, ei, array_length(ei)); } void proto_reg_handoff_scylla(void) { static dissector_handle_t scylla_handle; scylla_handle = create_dissector_handle(dissect_scylla, proto_scylla); dissector_add_uint_with_preference("tcp.port", SCYLLA_PORT, scylla_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sdh.c
/* packet-sdh.c * Routines for SDH/SONET encapsulation dissection * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 - 2012 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <wiretap/wtap.h> #include "packet-erf.h" #define COLUMNS 270 #define EXT_HDR_TYPE_RAW_LINK 5 void proto_register_sdh(void); void proto_reg_handoff_sdh(void); static int proto_sdh = -1; static gint ett_sdh = -1; static int hf_sdh_a1 = -1; static int hf_sdh_a2 = -1; static int hf_sdh_j0 = -1; static int hf_sdh_b1 = -1; static int hf_sdh_e1 = -1; static int hf_sdh_f1 = -1; static int hf_sdh_d1 = -1; static int hf_sdh_d2 = -1; static int hf_sdh_d3 = -1; static int hf_sdh_au = -1; static int hf_sdh_b2 = -1; static int hf_sdh_k1 = -1; static int hf_sdh_k2 = -1; static int hf_sdh_d4 = -1; static int hf_sdh_d5 = -1; static int hf_sdh_d6 = -1; static int hf_sdh_d7 = -1; static int hf_sdh_d8 = -1; static int hf_sdh_d9 = -1; static int hf_sdh_d10 = -1; static int hf_sdh_d11 = -1; static int hf_sdh_d12 = -1; static int hf_sdh_s1 = -1; static int hf_sdh_m1 = -1; static int hf_sdh_e2 = -1; static int hf_sdh_h1 = -1; static int hf_sdh_h2 = -1; static int hf_sdh_j1 = -1; static dissector_handle_t sdh_handle; static gint sdh_data_rate = 1; static const enum_val_t data_rates[] = { {"Attempt to guess", "Attempt to guess", -1}, {"OC-3", "OC-3", 1}, {"OC-12", "OC-12", 4}, {"OC-24", "OC-24", 8}, {"OC-48", "OC-48", 16}, {NULL, NULL, -1} }; static const value_string sdh_s1_vals[] = { { 0, "Quality unknown" }, { 1, "Reserved" }, { 2, "Rec G.811" }, { 3, "Reserved" }, { 4, "SSU-A" }, { 5, "Reserved" }, { 6, "Reserved" }, { 7, "Reserved" }, { 8, "SSU-B" }, { 9, "Reserved" }, { 10, "Reserved" }, { 11, "SDH Equipment Source" }, { 12, "Reserved" }, { 13, "Reserved" }, { 14, "Reserved" }, { 15, "do not use for sync" }, { 0, NULL } }; static int get_sdh_level(tvbuff_t *tvb, packet_info *pinfo) { guint64 *hdr = NULL; /*data rate has been set in the SDH options*/ if(sdh_data_rate != -1) return sdh_data_rate; /*ERF specifies data rate*/ hdr = erf_get_ehdr(pinfo, EXT_HDR_TYPE_RAW_LINK, NULL); if (hdr != NULL){ switch((*hdr & 0xff00) >> 8){ case 1: /*OC-3*/ return 1; case 2: /*OC-12*/ return 4; case 3: /*OC-48*/ return 16; default: /*drop through and try the next method*/ ; } } /*returns the multiplier for each data level*/ switch(tvb_reported_length(tvb)){ case 2430: /*OC-3*/ return 1; case 9720: /*OC-12*/ return 4; case 19440: /*OC-24*/ return 8; case 38880: /*OC-48*/ return 16; } return 1; } static int dissect_sdh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "SDH"); col_clear(pinfo->cinfo,COL_INFO); if (tree) { proto_tree *sdh_tree; proto_item *sdh_item; int level = get_sdh_level(tvb, pinfo); guint8 h1; guint8 h2; guint16 au; int auoffset; sdh_item = proto_tree_add_protocol_format(tree, proto_sdh, tvb, 0, -1, "SDH"); sdh_tree = proto_item_add_subtree(sdh_item, ett_sdh); h1 = tvb_get_guint8(tvb, 0*level+(3*level*COLUMNS)); h2 = tvb_get_guint8(tvb, 3*level+(3*level*COLUMNS)); au = (h2 | ((0x03 & h1) << 8)); proto_tree_add_item(sdh_tree, hf_sdh_a1, tvb, 0*level, 3*level, ENC_NA); proto_tree_add_item(sdh_tree, hf_sdh_a2, tvb, 3*level, 3*level, ENC_NA); proto_tree_add_item(sdh_tree, hf_sdh_j0, tvb, 6*level, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_b1, tvb, 0*level+(1*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_e1, tvb, 3*level+(1*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_f1, tvb, 6*level+(1*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d1, tvb, 0*level+(2*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d2, tvb, 3*level+(2*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d3, tvb, 6*level+(2*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_h1, tvb, 0*level+(3*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_h2, tvb, 3*level+(3*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_uint(sdh_tree, hf_sdh_au, tvb, 0*level+(3*level*COLUMNS), 3*level+1, au); proto_tree_add_item(sdh_tree, hf_sdh_b2, tvb, 0*level+(4*level*COLUMNS), 3*level, ENC_NA); proto_tree_add_item(sdh_tree, hf_sdh_k1, tvb, 3*level+(4*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_k2, tvb, 6*level+(4*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d4, tvb, 0*level+(5*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d5, tvb, 3*level+(5*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d6, tvb, 6*level+(5*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d7, tvb, 0*level+(6*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d8, tvb, 3*level+(6*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d9, tvb, 6*level+(6*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d10, tvb, 0*level+(7*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d11, tvb, 3*level+(7*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_d12, tvb, 6*level+(7*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_s1, tvb, 0*level+(8*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_m1, tvb, 3*level+2+(8*level*COLUMNS), 1, ENC_BIG_ENDIAN); proto_tree_add_item(sdh_tree, hf_sdh_e2, tvb, 6*level+(8*level*COLUMNS), 1, ENC_BIG_ENDIAN); /*XXX: POH that au points to may not be in the same frame. Also wrong on pointer justification*/ /*calculate start of SPE by wrapping AU pointer*/ auoffset = (((9 + 3*COLUMNS) /*start after H3*/ + au*3 + 9*(au/87) /*add extra SOH rows to offset*/) * level) % (COLUMNS*9*level); proto_tree_add_item(sdh_tree, hf_sdh_j1, tvb, auoffset, 1, ENC_BIG_ENDIAN); } return tvb_captured_length(tvb); } void proto_register_sdh(void) { static hf_register_info hf[] = { { &hf_sdh_a1, { "A1", "sdh.a1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_a2, { "A2", "sdh.a2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_j0, { "J0", "sdh.j0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_b1, { "B1", "sdh.b1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_e1, { "E1", "sdh.e1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_f1, { "F1", "sdh.f1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d1, { "D1", "sdh.d1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d2, { "D2", "sdh.d2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d3, { "D3", "sdh.d3", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_au, { "AU", "sdh.au", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_b2, { "B2", "sdh.b2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_k1, { "K1", "sdh.k1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_k2, { "K2", "sdh.k2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d4, { "D4", "sdh.d4", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d5, { "D5", "sdh.d5", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d6, { "D6", "sdh.d6", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d7, { "D7", "sdh.d7", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d8, { "D8", "sdh.d8", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d9, { "D9", "sdh.d9", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d10, { "D10", "sdh.d10", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d11, { "D11", "sdh.d11", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_d12, { "D12", "sdh.d12", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_s1, { "S1", "sdh.s1", FT_UINT8, BASE_HEX, VALS(sdh_s1_vals), 0x0, NULL, HFILL }}, { &hf_sdh_m1, { "M1", "sdh.m1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_e2, { "E2", "sdh.e2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_j1, { "J1", "sdh.j1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_h1, { "H1", "sdh.h1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdh_h2, { "H2", "sdh.h2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_sdh, }; module_t *sdh_module; proto_sdh = proto_register_protocol("SDH/SONET Protocol", "SDH", "sdh"); proto_register_field_array(proto_sdh, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sdh_module = prefs_register_protocol(proto_sdh, NULL); prefs_register_enum_preference(sdh_module, "data.rate", "Data rate", "Data rate", &sdh_data_rate, data_rates, ENC_BIG_ENDIAN); sdh_handle = register_dissector("sdh", dissect_sdh, proto_sdh); } void proto_reg_handoff_sdh(void) { dissector_add_uint("wtap_encap", WTAP_ENCAP_SDH, sdh_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sdlc.c
/* packet-sdlc.c * Routines for SDLC frame disassembly * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <wiretap/wtap.h> #include <epan/xdlc.h> /* * See: * * http://web.archive.org/web/20020206033700/http://www.wanresources.com/snacell.html * * http://web.archive.org/web/20150522015710/http://www.protocols.com/pbook/sna.htm * * Systems Network Architecture Formats, GA27-3136-20: * https://publibz.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/D50A5007/CCONTENTS */ void proto_register_sdlc(void); void proto_reg_handoff_sdlc(void); static int proto_sdlc = -1; static int hf_sdlc_address = -1; static int hf_sdlc_control = -1; static int hf_sdlc_n_r = -1; static int hf_sdlc_n_s = -1; static int hf_sdlc_p = -1; static int hf_sdlc_f = -1; static int hf_sdlc_s_ftype = -1; static int hf_sdlc_u_modifier_cmd = -1; static int hf_sdlc_u_modifier_resp = -1; static int hf_sdlc_ftype_i = -1; static int hf_sdlc_ftype_s_u = -1; static gint ett_sdlc = -1; static gint ett_sdlc_control = -1; static dissector_handle_t sna_handle; static const xdlc_cf_items sdlc_cf_items = { &hf_sdlc_n_r, &hf_sdlc_n_s, &hf_sdlc_p, &hf_sdlc_f, &hf_sdlc_s_ftype, &hf_sdlc_u_modifier_cmd, &hf_sdlc_u_modifier_resp, &hf_sdlc_ftype_i, &hf_sdlc_ftype_s_u }; static int dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *sdlc_tree; proto_item *sdlc_ti; guint8 addr; guint16 control; int sdlc_header_len; gboolean is_response; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SDLC"); col_clear(pinfo->cinfo, COL_INFO); addr = tvb_get_guint8(tvb, 0); sdlc_header_len = 1; /* address */ /* * XXX - is there something in the SDLC header that indicates * how to interpret "command vs. response" based on the * direction? */ if (pinfo->p2p_dir == P2P_DIR_SENT) { is_response = FALSE; col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DCE"); col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DTE"); } else { /* XXX - what if the direction is unknown? */ is_response = TRUE; col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DTE"); col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DCE"); } sdlc_ti = proto_tree_add_item(tree, proto_sdlc, tvb, 0, -1, ENC_NA); sdlc_tree = proto_item_add_subtree(sdlc_ti, ett_sdlc); proto_tree_add_uint(sdlc_tree, hf_sdlc_address, tvb, 0, 1, addr); /* * XXX - SDLC has a mod-128 mode as well as a mod-7 mode. * We can infer the mode from an SNRM/SRME frame, but if * we don't see one of them, we may have to have a preference * to control what to use. */ control = dissect_xdlc_control(tvb, 1, pinfo, sdlc_tree, hf_sdlc_control, ett_sdlc_control, &sdlc_cf_items, NULL, NULL, NULL, is_response, FALSE, FALSE); sdlc_header_len += XDLC_CONTROL_LEN(control, FALSE); proto_item_set_len(sdlc_ti, sdlc_header_len); /* * XXX - is there an FCS at the end, at least in Sniffer * captures? (There doesn't appear to be.) */ next_tvb = tvb_new_subset_remaining(tvb, sdlc_header_len); if (XDLC_IS_INFORMATION(control)) { /* call the SNA dissector */ call_dissector(sna_handle, next_tvb, pinfo, tree); } else call_data_dissector(next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_sdlc(void) { static hf_register_info hf[] = { { &hf_sdlc_address, { "Address Field", "sdlc.address", FT_UINT8, BASE_HEX, NULL, 0x0, "Address", HFILL }}, { &hf_sdlc_control, { "Control Field", "sdlc.control", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sdlc_n_r, { "N(R)", "sdlc.control.n_r", FT_UINT8, BASE_DEC, NULL, XDLC_N_R_MASK, NULL, HFILL }}, { &hf_sdlc_n_s, { "N(S)", "sdlc.control.n_s", FT_UINT8, BASE_DEC, NULL, XDLC_N_S_MASK, NULL, HFILL }}, { &hf_sdlc_p, { "Poll", "sdlc.control.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }}, { &hf_sdlc_f, { "Final", "sdlc.control.f", FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }}, { &hf_sdlc_s_ftype, { "Supervisory frame type", "sdlc.control.s_ftype", FT_UINT8, BASE_HEX, VALS(stype_vals), XDLC_S_FTYPE_MASK, NULL, HFILL }}, { &hf_sdlc_u_modifier_cmd, { "Command", "sdlc.control.u_modifier_cmd", FT_UINT8, BASE_HEX, VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK, NULL, HFILL }}, { &hf_sdlc_u_modifier_resp, { "Response", "sdlc.control.u_modifier_resp", FT_UINT8, BASE_HEX, VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK, NULL, HFILL }}, { &hf_sdlc_ftype_i, { "Frame type", "sdlc.control.ftype", FT_UINT8, BASE_HEX, VALS(ftype_vals), XDLC_I_MASK, NULL, HFILL }}, { &hf_sdlc_ftype_s_u, { "Frame type", "sdlc.control.ftype", FT_UINT8, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }}, }; static gint *ett[] = { &ett_sdlc, &ett_sdlc_control, }; proto_sdlc = proto_register_protocol( "Synchronous Data Link Control (SDLC)", "SDLC", "sdlc"); proto_register_field_array(proto_sdlc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_sdlc(void) { dissector_handle_t sdlc_handle; /* * Get handle for the SNA dissector. */ sna_handle = find_dissector_add_dependency("sna", proto_sdlc); sdlc_handle = create_dissector_handle(dissect_sdlc, proto_sdlc); dissector_add_uint("wtap_encap", WTAP_ENCAP_SDLC, sdlc_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sdp.c
/* packet-sdp.c * Routines for SDP packet disassembly (RFC 2327) * * Jason Lango <[email protected]> * Liberally copied from packet-http.c, by Guy Harris <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * Ref https://www.ietf.org/rfc/rfc4566 */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/asn1.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/tap.h> #include <epan/rtp_pt.h> #include <epan/show_exception.h> #include <epan/addr_resolv.h> #include <epan/conversation.h> #include <epan/strutil.h> #include <wsutil/strtoi.h> #include <wsutil/str_util.h> #include "packet-media-type.h" #include "packet-sdp.h" /* un-comment the following as well as this line in conversation.c, to enable debug printing */ /* #define DEBUG_CONVERSATION */ #include "conversation_debug.h" #include "packet-rtp.h" #include "packet-rtcp.h" #include "packet-t38.h" #include "packet-msrp.h" #include "packet-sprt.h" #include "packet-bfcp.h" #include "packet-h245.h" #include "packet-h264.h" #include "packet-h265.h" #include "packet-mp4ves.h" void proto_register_sdp(void); void proto_reg_handoff_sdp(void); static dissector_handle_t sdp_handle; static dissector_handle_t rtcp_handle; static dissector_handle_t sprt_handle; static dissector_handle_t msrp_handle; static dissector_handle_t bfcp_handle; static dissector_handle_t h264_handle; static dissector_handle_t h265_handle; static dissector_handle_t mp4ves_config_handle; static int sdp_tap = -1; static int proto_sdp = -1; static int proto_sprt = -1; static const char* UNKNOWN_ENCODING = "Unknown"; static wmem_tree_t *sdp_transport_reqs = NULL; static wmem_tree_t *sdp_transport_rsps = NULL; /* preference globals */ static gboolean global_sdp_establish_conversation = TRUE; /* Top level fields */ static int hf_protocol_version = -1; static int hf_owner = -1; static int hf_session_name = -1; static int hf_session_info = -1; static int hf_uri = -1; static int hf_email = -1; static int hf_phone = -1; static int hf_connection_info = -1; static int hf_bandwidth = -1; static int hf_timezone = -1; static int hf_encryption_key = -1; static int hf_session_attribute = -1; static int hf_media_attribute = -1; static int hf_time = -1; static int hf_repeat_time = -1; static int hf_media = -1; static int hf_media_title = -1; static int hf_unknown = -1; static int hf_invalid = -1; static int hf_ipbcp_version = -1; static int hf_ipbcp_type = -1; /* hf_owner subfields*/ static int hf_owner_username = -1; static int hf_owner_sessionid = -1; static int hf_owner_version = -1; static int hf_owner_network_type = -1; static int hf_owner_address_type = -1; static int hf_owner_address = -1; /* hf_connection_info subfields */ static int hf_connection_info_network_type = -1; static int hf_connection_info_address_type = -1; static int hf_connection_info_connection_address = -1; static int hf_connection_info_ttl = -1; static int hf_connection_info_num_addr = -1; /* hf_bandwidth subfields */ static int hf_bandwidth_modifier = -1; static int hf_bandwidth_value = -1; /* hf_time subfields */ static int hf_time_start = -1; static int hf_time_stop = -1; /* hf_repeat_time subfield */ static int hf_repeat_time_interval = -1; static int hf_repeat_time_duration = -1; static int hf_repeat_time_offset = -1; /* hf_timezone subfields */ static int hf_timezone_time = -1; static int hf_timezone_offset = -1; /* hf_encryption_key subfields */ static int hf_encryption_key_type = -1; static int hf_encryption_key_data = -1; /* hf_session_attribute subfields */ static int hf_session_attribute_field = -1; static int hf_session_attribute_value = -1; /* hf_media subfields */ static int hf_media_media = -1; static int hf_media_port = -1; static int hf_media_port_string = -1; static int hf_media_portcount = -1; static int hf_media_proto = -1; static int hf_media_format = -1; /* hf_session_attribute subfields */ static int hf_media_attribute_field = -1; static int hf_media_attribute_value = -1; static int hf_media_encoding_name = -1; static int hf_media_sample_rate = -1; static int hf_media_channels = -1; static int hf_media_format_specific_parameter = -1; static int hf_sdp_fmtp_mpeg4_profile_level_id = -1; static int hf_sdp_fmtp_h263_profile = -1; static int hf_sdp_fmtp_h263_level = -1; static int hf_sdp_h264_packetization_mode = -1; static int hf_SDPh223LogicalChannelParameters = -1; /* hf_session_attribute hf_media_attribute subfields */ static int hf_key_mgmt_att_value = -1; static int hf_key_mgmt_prtcl_id = -1; static int hf_key_mgmt_data = -1; static int hf_sdp_crypto_tag = -1; static int hf_sdp_crypto_crypto_suite = -1; static int hf_sdp_crypto_master_key = -1; static int hf_sdp_crypto_master_salt = -1; static int hf_sdp_crypto_lifetime = -1; static int hf_sdp_crypto_mki = -1; static int hf_sdp_crypto_mki_length = -1; /* a=candidate subfields */ static int hf_ice_candidate_foundation = -1; static int hf_ice_candidate_componentid = -1; static int hf_ice_candidate_transport = -1; static int hf_ice_candidate_priority = -1; static int hf_ice_candidate_address = -1; static int hf_ice_candidate_port = -1; static int hf_ice_candidate_type = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_sdp_nal_unit_2_string = -1; static int hf_sdp_key_and_salt = -1; static int hf_sdp_nal_unit_1_string = -1; static int hf_sdp_data = -1; /* trees */ static int ett_sdp = -1; static int ett_sdp_owner = -1; static int ett_sdp_connection_info = -1; static int ett_sdp_bandwidth = -1; static int ett_sdp_time = -1; static int ett_sdp_repeat_time = -1; static int ett_sdp_timezone = -1; static int ett_sdp_encryption_key = -1; static int ett_sdp_session_attribute = -1; static int ett_sdp_media = -1; static int ett_sdp_media_attribute = -1; static int ett_sdp_fmtp = -1; static int ett_sdp_key_mgmt = -1; static int ett_sdp_crypto_key_parameters = -1; static expert_field ei_sdp_invalid_key_param = EI_INIT; static expert_field ei_sdp_invalid_line_equal = EI_INIT; static expert_field ei_sdp_invalid_line_fields = EI_INIT; static expert_field ei_sdp_invalid_line_space = EI_INIT; static expert_field ei_sdp_invalid_conversion = EI_INIT; static expert_field ei_sdp_invalid_media_port = EI_INIT; static expert_field ei_sdp_invalid_sample_rate = EI_INIT; static expert_field ei_sdp_invalid_channels = EI_INIT; static expert_field ei_sdp_invalid_media_format = EI_INIT; static expert_field ei_sdp_invalid_crypto_tag = EI_INIT; static expert_field ei_sdp_invalid_crypto_mki_length = EI_INIT; /* patterns used for tvb_ws_mempbrk_pattern_guint8 */ static ws_mempbrk_pattern pbrk_digits; static ws_mempbrk_pattern pbrk_alpha; typedef enum { SDP_PROTO_UNKNOWN = 0, SDP_PROTO_RTP, SDP_PROTO_SRTP, SDP_PROTO_T38, SDP_PROTO_MSRP, SDP_PROTO_SPRT, SDP_PROTO_BFCP, } transport_proto_t; #define SDP_MAX_RTP_CHANNELS 4 #define SDP_MAX_RTP_PAYLOAD_TYPES 20 #define SDP_NO_OF_PT 128 /* * All parameters specific to one media description ("m="). */ typedef struct { gint32 pt[SDP_MAX_RTP_PAYLOAD_TYPES]; gint8 pt_count; rtp_dyn_payload_t *rtp_dyn_payload; gboolean set_rtp; } transport_media_pt_t; /* * Store data extracted from one Media Description section of a SDP. Memory is * allocated in wmem_file_scope(). */ typedef struct { transport_proto_t proto; /**< Protocol, parsed from "m=" line. */ guint32 media_types; /**< Whether "m=video" or others */ gboolean bundled; /**< "m=" lines are "bundled", that is, all on same port */ guint16 media_port; /**< Port number, parsed from "m=" line. */ guint16 control_port; /**< Port number, parsed from "a=rtcp" or "a=rtcp-mux" line. */ address conn_addr; /**< The address from the "c=" line (default from session level, possibly overridden at the media level). */ transport_media_pt_t media; /**< Information about payload numbers for this media. */ /* * Media-level only attributes. */ union { struct { address ipaddr; guint16 port_number; } msrp; /**< MSRP transport info, parsed from "a=label:" */ } media_attr; } media_description_t; /* * Information parsed from one or two (offer/answer) SDPs that is stored in the * conversation. The contents are allocated within wmem_file_scope(). */ typedef struct { enum sdp_exchange_type sdp_status; char *encoding_name[SDP_NO_OF_PT]; int sample_rate[SDP_NO_OF_PT]; unsigned channels[SDP_NO_OF_PT]; /* Data parsed from "m=" */ wmem_array_t *media_descriptions; /* array of media_description_t */ /* SRTP related info XXX note currently we only handle one crypto line in the SDP * We should probably handle offer/answer and session updates etc(SIP) quite possibly the whole handling of * seting up the RTP conversations should be done by the signaling protocol(s) calling the SDP dissector * and the SDP dissector just provide the relevant data. * YES! packet-sdp.c should be about SDP parsing... SDP *state* needs to be maintained by upper * protocols, because each one has different rules/semantics. */ guint encryption_algorithm; guint auth_algorithm; guint mki_len; /* number of octets used for the MKI in the RTP payload */ guint auth_tag_len; /* number of octets used for the Auth Tag in the RTP payload */ } transport_info_t; /* * Information about the session description. These are accumulated while * parsing the session description and will be applied to the media description. * Memory scope can be pinfo->pool since the contents are no longer * needed once they are processed into transport_info_t (via * complete_descriptions). */ typedef struct { address conn_addr; /**< Parsed from "c=" line. */ rtp_dyn_payload_t *rtp_dyn_payload; /**< Parsed from "a=rtpmap:" line. Note: wmem_file_scope, needs manual dealloc. */ } session_info_t; /* Structure for private data to hold ED137 related values */ typedef struct sdp_data_t { char *ed137_type; /* Radio session type */ char *ed137_txrxmode; /* Tx/Rx mode */ char *ed137_fid; /* Frequency ID */ } sdp_data_t; /* here lie the debugging dumper functions */ #ifdef DEBUG_CONVERSATION static void sdp_dump_transport_media(const transport_media_pt_t* media) { int i; int count; DPRINT2(("transport_media contents:")); DINDENT(); if (!media) { DPRINT2(("null transport_media_pt_t*")); DENDENT(); return; } count = (int)media->pt_count; DPRINT2(("pt_count=%d",count)); DINDENT(); for (i=0; i < count; i++) { DPRINT2(("pt=%d", media->pt[i])); } DENDENT(); DPRINT2(("rtp_dyn_payload hashtable=%s", media->rtp_dyn_payload ? "YES" : "NO")); if (media->rtp_dyn_payload) { rtp_dump_dyn_payload(media->rtp_dyn_payload); } DPRINT2(("set_rtp=%s", media->set_rtp ? "TRUE" : "FALSE")); DENDENT(); } static const value_string sdp_exchange_type_vs[] = { { SDP_EXCHANGE_OFFER, "SDP_EXCHANGE_OFFER" }, { SDP_EXCHANGE_ANSWER_ACCEPT, "SDP_EXCHANGE_ANSWER_ACCEPT" }, { SDP_EXCHANGE_ANSWER_REJECT, "SDP_EXCHANGE_ANSWER_REJECT" }, { 0, NULL } }; static void sdp_dump_transport_info(const transport_info_t* info) { int i; int count; DPRINT2(("transport_info contents:")); DINDENT(); if (!info) { DPRINT2(("null transport_info_t*")); DENDENT(); return; } DPRINT2(("sdp_status=%s", val_to_str_const(info->sdp_status, sdp_exchange_type_vs, "SDP_EXCHANGE_UNKNOWN"))); DPRINT2(("payload type contents:")); DINDENT(); for (i=0; i < SDP_NO_OF_PT; i++) { /* don't print out unknown encodings */ if (info->encoding_name[i] && strcmp(UNKNOWN_ENCODING,info->encoding_name[i]) != 0) { DPRINT2(("payload type #%d:",i)); DINDENT(); DPRINT2(("encoding_name=%s", info->encoding_name[i])); DPRINT2(("sample_rate=%d", info->sample_rate[i])); DENDENT(); } } DENDENT(); count = wmem_array_get_count(info->media_descriptions); DPRINT2(("media_count=%d", count)); DPRINT2(("rtp channels:")); DINDENT(); for (i=0; i < count; i++) { media_description_t *media_desc = (media_description_t *)wmem_array_index(info->media_descriptions, i); DPRINT2(("channel #%d:",i)); DINDENT(); DPRINT2(("conn_addr=%s", address_to_str(pinfo->pool, &(media_desc->conn_addr)))); DPRINT2(("media_port=%d", media_desc->media_port)); DPRINT2(("proto=%d", media_desc->proto)); sdp_dump_transport_media(&(media_desc->media)); DENDENT(); } DENDENT(); DPRINT2(("encryption_algorithm=%u", info->encryption_algorithm)); DPRINT2(("auth_algorithm=%u", info->auth_algorithm)); if (info->encryption_algorithm || info->auth_algorithm) { DPRINT2(("mki_len=%u", info->mki_len)); if (info->auth_algorithm) { DPRINT2(("auth_tag_len=%u", info->auth_tag_len)); } } DENDENT(); } #endif /* DEBUG_CONVERSATION */ /* key-mgmt dissector * IANA registry: * http://www.iana.org/assignments/sdp-parameters */ static dissector_table_t key_mgmt_dissector_table; /* Finds next token (sequence of non-space chars) in tvb from given offset. * The returned value is the token length, or 0 if none found. * The offset is changed to be the starting offset, in case there were one or more * spaces at the beginning. (this will also add expert info in such a case) * The next_offset is set to the next found space after the token, or -1 if the * end of line is hit or no token found. * If this is the last token in the line, tokenlen will not be 0, but next_offset * will be -1. * * The optional param, if TRUE, means no expert error will be issued if no token * is found; if FALSE then a expert error will be issued if no token is found. * * This function expects to be given a tvb of only one line, and does no error * checking of its given arguments. */ static inline gint find_next_optional_token_in_line(tvbuff_t *tvb, proto_tree *tree, gint *offset, gint *next_offset, const gboolean optional) { gint tokenlen = 0; gint next_off = -1; gint off = *offset; if (tvb_offset_exists(tvb, off)) { while (tokenlen == 0) { next_off = tvb_find_guint8(tvb, off, -1, ' '); if (next_off == -1) { tokenlen = tvb_captured_length_remaining(tvb, off); break; /* Nothing more left */ } tokenlen = next_off - off; if (tokenlen == 0) { /* two spaces in a row - illegal, but we'll keep dissecting */ proto_tree_add_expert(tree, NULL, &ei_sdp_invalid_line_space, tvb, off-1, 2); off = next_off + 1; } } } if (!optional && tokenlen == 0) { proto_tree_add_expert(tree, NULL, &ei_sdp_invalid_line_fields, tvb, 0, -1); } *next_offset = next_off; *offset = off; return tokenlen; } /* Same as above, but always issues an expert error if a token is not found. */ static inline gint find_next_token_in_line(tvbuff_t *tvb, proto_tree *tree, gint *offset, gint *next_offset) { return find_next_optional_token_in_line(tvb, tree, offset, next_offset, FALSE); } /* Convert the protocol from the "m=" line to something we understand. */ static transport_proto_t parse_sdp_media_protocol(const char *media_proto) { /* Sorted according to the "proto" registry at * https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-2 */ const struct { const char *proto_name; transport_proto_t proto; } protocols[] = { { "RTP/AVP", SDP_PROTO_RTP }, /* RFC 4566 */ { "udptl", SDP_PROTO_T38 }, /* ITU-T T.38, example in Annex E */ { "UDPTL", SDP_PROTO_T38 }, /* Note: IANA registry contains lower case */ { "RTP/AVPF", SDP_PROTO_RTP }, /* RFC 4585 */ { "RTP/SAVP", SDP_PROTO_SRTP }, /* RFC 3711 */ { "RTP/SAVPF", SDP_PROTO_SRTP }, /* RFC 5124 */ { "UDP/TLS/RTP/SAVP", SDP_PROTO_SRTP }, /* RFC 5764 */ { "UDP/TLS/RTP/SAVPF", SDP_PROTO_SRTP }, /* RFC 5764 */ { "msrp/tcp", SDP_PROTO_MSRP }, /* Not in IANA, where is this from? */ { "UDPSPRT", SDP_PROTO_SPRT }, /* Not in IANA, but draft-rajeshkumar-avt-v150-registration-00 */ { "udpsprt", SDP_PROTO_SPRT }, /* lowercase per section E.1.1 of ITU-T V.150.1 */ { "udpsprt", SDP_PROTO_SPRT }, /* lowercase per section E.1.1 of ITU-T V.150.1 */ { "UDP/BFCP", SDP_PROTO_BFCP }, /* RFC 8856 */ }; for (guint i = 0; i < G_N_ELEMENTS(protocols); i++) { if (!strcmp(protocols[i].proto_name, media_proto)) { return protocols[i].proto; } } return SDP_PROTO_UNKNOWN; } /* Parses the parts from "c=" into address structures. */ static void parse_sdp_connection_address(const guint8 *connection_type, const char *connection_address, wmem_allocator_t *allocator, address *conn_addr) { if (strcmp(connection_type, "IP4") == 0) { guint32 ip4_addr; if (str_to_ip(connection_address, &ip4_addr)) { /* connection_address could be converted to a valid ipv4 address*/ alloc_address_wmem(allocator, conn_addr, AT_IPv4, 4, &ip4_addr); } } else if (strcmp(connection_type, "IP6") == 0) { ws_in6_addr ip6_addr; if (str_to_ip6(connection_address, &ip6_addr)) { /* connection_address could be converted to a valid ipv6 address*/ alloc_address_wmem(allocator, conn_addr, AT_IPv6, 16, &ip6_addr); } } } /** * Starts a new media description. If there are too many media descriptions, * no new media description is started and NULL is returned. */ static media_description_t * sdp_new_media_description(wmem_array_t *media_descriptions, session_info_t *session_info) { media_description_t empty_desc; media_description_t *media_desc; /* Limit number to avoid consuming excess memory. */ if (wmem_array_get_count(media_descriptions) >= SDP_MAX_RTP_CHANNELS) { DPRINT(("Too many media descriptions (more than %d), returning NULL!", wmem_array_get_count(media_descriptions))); return NULL; } memset(&empty_desc, 0, sizeof(media_description_t)); wmem_array_append_one(media_descriptions, empty_desc); media_desc = (media_description_t *) wmem_array_index(media_descriptions, wmem_array_get_count(media_descriptions) - 1); /* XXX does it make sense making media_desc->media.pt a wmem array? */ /* If "c=" is given at the session level, copy it to the media description. * It will be overridden as needed. */ if (session_info->conn_addr.type != AT_NONE) { copy_address_wmem(wmem_file_scope(), &media_desc->conn_addr, &session_info->conn_addr); } /* If "a=rtpmap:" was set on the session level, copy them to media level. */ media_desc->media.rtp_dyn_payload = rtp_dyn_payload_dup(session_info->rtp_dyn_payload); return media_desc; } /* Remove information about media descriptions which are unused. These appeared * in the "a=rtpmap:" (and maybe even in the payload types part of "m="?), but * are not used (port is zero or it was not assigned to RTP dissector). */ static void clean_unused_media_descriptions(wmem_array_t *descs) { for (guint i = 0; i < wmem_array_get_count(descs); i++) { media_description_t *media_desc = (media_description_t *)wmem_array_index(descs, i); /* If not assigned to subdissector, clear the unused information. */ if (!media_desc->media.set_rtp) { rtp_dyn_payload_free(media_desc->media.rtp_dyn_payload); media_desc->media.rtp_dyn_payload = NULL; } } } /* Subdissector functions */ static void dissect_sdp_owner(tvbuff_t *tvb, proto_item *ti) { proto_tree *sdp_owner_tree; gint offset, next_offset, tokenlen; offset = 0; sdp_owner_tree = proto_item_add_subtree(ti, ett_sdp_owner); /* Find the username */ tokenlen = find_next_token_in_line(tvb, sdp_owner_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_owner_tree, hf_owner_username, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* Find the session id */ tokenlen = find_next_token_in_line(tvb, sdp_owner_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_owner_tree, hf_owner_sessionid, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* Find the version */ tokenlen = find_next_token_in_line(tvb, sdp_owner_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_owner_tree, hf_owner_version, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* Find the network type */ tokenlen = find_next_token_in_line(tvb, sdp_owner_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_owner_tree, hf_owner_network_type, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* Find the address type */ tokenlen = find_next_token_in_line(tvb, sdp_owner_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_owner_tree, hf_owner_address_type, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* Find the address */ proto_tree_add_item(sdp_owner_tree, hf_owner_address, tvb, offset, -1, ENC_UTF_8); } /* * XXX - this can leak memory if an exception is thrown after we've fetched * a string. */ static void dissect_sdp_connection_info(packet_info *pinfo, tvbuff_t *tvb, proto_item* ti, session_info_t *session_info, media_description_t *media_desc) { proto_tree *sdp_connection_info_tree; gint offset, next_offset, tokenlen; const guint8 *connection_type, *connection_address; offset = 0; sdp_connection_info_tree = proto_item_add_subtree(ti, ett_sdp_connection_info); /* Find the network type */ tokenlen = find_next_token_in_line(tvb, sdp_connection_info_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_connection_info_tree, hf_connection_info_network_type, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* Find the address type */ tokenlen = find_next_token_in_line(tvb, sdp_connection_info_tree, &offset, &next_offset); if (tokenlen == 0) return; /* Save connection address type */ proto_tree_add_item_ret_string(sdp_connection_info_tree, hf_connection_info_address_type, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &connection_type); DPRINT(("parsed connection line type=%s", connection_type)); offset = next_offset + 1; /* Find the connection address */ /* XXX - what if there's a <number of addresses> value? */ next_offset = tvb_find_guint8(tvb, offset, -1, '/'); if (next_offset == -1) { tokenlen = -1; /* end of tvbuff */ /* Save connection address */ connection_address = tvb_get_string_enc(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_UTF_8|ENC_NA); } else { tokenlen = next_offset - offset; /* Save connection address */ connection_address = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA); } DPRINT(("parsed connection line address=%s", connection_address)); /* Parse and store connection address. Session-level addresses are * packet-scoped since they will be cloned in file-scope when needed. */ if (session_info) { parse_sdp_connection_address(connection_type, connection_address, pinfo->pool, &session_info->conn_addr); } else if (media_desc) { /* Clear possibly inherited address from session level. */ free_address_wmem(wmem_file_scope(), &media_desc->conn_addr); parse_sdp_connection_address(connection_type, connection_address, wmem_file_scope(), &media_desc->conn_addr); } proto_tree_add_item(sdp_connection_info_tree, hf_connection_info_connection_address, tvb, offset, tokenlen, ENC_UTF_8); if (next_offset != -1) { offset = next_offset + 1; next_offset = tvb_find_guint8(tvb, offset, -1, '/'); if (next_offset == -1) { tokenlen = -1; /* end of tvbuff */ } else { tokenlen = next_offset - offset; } proto_tree_add_item(sdp_connection_info_tree, hf_connection_info_ttl, tvb, offset, tokenlen, ENC_UTF_8); if (next_offset != -1) { offset = next_offset + 1; proto_tree_add_item(sdp_connection_info_tree, hf_connection_info_num_addr, tvb, offset, -1, ENC_UTF_8); } } } static void dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti) { proto_tree *sdp_bandwidth_tree; gint offset, next_offset, tokenlen; proto_item *item; gboolean unit_is_kbs = FALSE; gboolean unit_is_bps = FALSE; offset = 0; sdp_bandwidth_tree = proto_item_add_subtree(ti, ett_sdp_bandwidth); /* find the modifier */ next_offset = tvb_find_guint8(tvb, offset, -1, ':'); if (next_offset == -1) return; tokenlen = next_offset - offset; item = proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_modifier, tvb, offset, tokenlen, ENC_UTF_8); if (tvb_strneql(tvb, offset, "CT", 2) == 0) { proto_item_append_text(item, " [Conference Total(total bandwidth of all RTP sessions)]"); unit_is_kbs = TRUE; } else if (tvb_strneql(tvb, offset, "AS", 2) == 0) { proto_item_append_text(item, " [Application Specific (RTP session bandwidth)]"); unit_is_kbs = TRUE; } else if (tvb_strneql(tvb, offset, "TIAS", 4) == 0) { proto_item_append_text(item, " [Transport Independent Application Specific maximum]"); unit_is_bps = TRUE; } offset = next_offset + 1; item = proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_value, tvb, offset, -1, ENC_UTF_8); if (unit_is_kbs == TRUE) proto_item_append_text(item, " kb/s"); if (unit_is_bps == TRUE) proto_item_append_text(item, " b/s"); } static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti) { proto_tree *sdp_time_tree; gint offset, next_offset, tokenlen; offset = 0; sdp_time_tree = proto_item_add_subtree(ti, ett_sdp_time); /* get start time */ tokenlen = find_next_token_in_line(tvb, sdp_time_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_time_tree, hf_time_start, tvb, offset, tokenlen, ENC_UTF_8); /* get stop time */ offset = next_offset + 1; proto_tree_add_item(sdp_time_tree, hf_time_stop, tvb, offset, -1, ENC_UTF_8); } static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti) { proto_tree *sdp_repeat_time_tree; gint offset, next_offset, tokenlen; gboolean optional = FALSE; offset = 0; sdp_repeat_time_tree = proto_item_add_subtree(ti, ett_sdp_time); /* get interval */ tokenlen = find_next_token_in_line(tvb, sdp_repeat_time_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_interval, tvb, offset, tokenlen, ENC_UTF_8); /* get duration */ offset = next_offset + 1; tokenlen = find_next_token_in_line(tvb, sdp_repeat_time_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_duration, tvb, offset, tokenlen, ENC_UTF_8); /* get offsets */ do { offset = next_offset +1; tokenlen = find_next_optional_token_in_line(tvb, sdp_repeat_time_tree, &offset, &next_offset, optional); if (tokenlen == 0) break; proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_offset, tvb, offset, tokenlen, ENC_UTF_8); optional = TRUE; } while (next_offset != -1); } static void dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti) { proto_tree* sdp_timezone_tree; gint offset, next_offset, tokenlen; gboolean optional = FALSE; offset = 0; sdp_timezone_tree = proto_item_add_subtree(ti, ett_sdp_timezone); do { tokenlen = find_next_optional_token_in_line(tvb, sdp_timezone_tree, &offset, &next_offset, optional); if (tokenlen == 0) break; proto_tree_add_item(sdp_timezone_tree, hf_timezone_time, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; tokenlen = find_next_optional_token_in_line(tvb, sdp_timezone_tree, &offset, &next_offset, optional); if (tokenlen == 0) break; proto_tree_add_item(sdp_timezone_tree, hf_timezone_offset, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; optional = TRUE; } while (next_offset != -1); } static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti) { proto_tree *sdp_encryption_key_tree; gint offset, next_offset, tokenlen; offset = 0; sdp_encryption_key_tree = proto_item_add_subtree(ti, ett_sdp_encryption_key); next_offset = tvb_find_guint8(tvb, offset, -1, ':'); if (next_offset == -1) return; tokenlen = next_offset - offset; proto_tree_add_item(sdp_encryption_key_tree, hf_encryption_key_type, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; proto_tree_add_item(sdp_encryption_key_tree, hf_encryption_key_data, tvb, offset, -1, ENC_UTF_8); } static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti) { gchar *data_p = NULL; const guint8 *prtcl_id = NULL; gint len; tvbuff_t *keymgmt_tvb; int found_match = 0; proto_tree *key_tree; gint next_offset; gint offset = 0; gint tokenlen; key_tree = proto_item_add_subtree(ti, ett_sdp_key_mgmt); tokenlen = find_next_token_in_line(tvb, key_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item_ret_string(key_tree, hf_key_mgmt_prtcl_id, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &prtcl_id); offset = next_offset + 1; len = tvb_captured_length_remaining(tvb, offset); if (len < 0) return; data_p = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_UTF_8|ENC_NA); keymgmt_tvb = base64_to_tvb(tvb, data_p); add_new_data_source(pinfo, keymgmt_tvb, "Key Management Data"); if ((prtcl_id != NULL) && (key_mgmt_dissector_table != NULL)) { found_match = dissector_try_string(key_mgmt_dissector_table, (const gchar *)prtcl_id, keymgmt_tvb, pinfo, key_tree, NULL); } if (found_match) { proto_item *ti2 = proto_tree_add_item(key_tree, hf_key_mgmt_data, keymgmt_tvb, 0, -1, ENC_NA); proto_item_set_hidden(ti2); } else { proto_tree_add_item(key_tree, hf_key_mgmt_data, keymgmt_tvb, 0, -1, ENC_NA); } } static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti) { proto_tree *sdp_session_attribute_tree; gint offset, next_offset, tokenlen; const guint8 *field_name; offset = 0; sdp_session_attribute_tree = proto_item_add_subtree(ti, ett_sdp_session_attribute); next_offset = tvb_find_guint8(tvb, offset, -1, ':'); if (next_offset == -1) return; tokenlen = next_offset - offset; proto_tree_add_item_ret_string(sdp_session_attribute_tree, hf_session_attribute_field, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &field_name); offset = next_offset + 1; if (strcmp((const char *)field_name, "ipbcp") == 0) { offset = tvb_ws_mempbrk_pattern_guint8(tvb, offset, -1,&pbrk_digits, NULL); if (offset == -1) return; tokenlen = find_next_token_in_line(tvb, sdp_session_attribute_tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(sdp_session_attribute_tree, hf_ipbcp_version, tvb, offset, tokenlen, ENC_UTF_8); offset = tvb_ws_mempbrk_pattern_guint8(tvb, offset, -1,&pbrk_alpha, NULL); if (offset == -1) return; tokenlen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); if (tokenlen == -1) return; proto_tree_add_item(sdp_session_attribute_tree, hf_ipbcp_type, tvb, offset, tokenlen, ENC_UTF_8); } else if (strcmp((const char *)field_name, "key-mgmt") == 0) { tvbuff_t *key_tvb; proto_item *key_ti; key_tvb = tvb_new_subset_remaining(tvb, offset); key_ti = proto_tree_add_item(sdp_session_attribute_tree, hf_key_mgmt_att_value, key_tvb, 0, -1, ENC_UTF_8); dissect_key_mgmt(key_tvb, pinfo, key_ti); } else { proto_tree_add_item(sdp_session_attribute_tree, hf_session_attribute_value, tvb, offset, -1, ENC_UTF_8); } } /* Dissect media description - this is passed the line starting after 'm=', so like one of these: * audio 29156 RTP/AVP 18 0 * video 49170/2 RTP/AVP 31 99 */ static void dissect_sdp_media(tvbuff_t *tvb, packet_info* pinfo, proto_item *ti, media_description_t *media_desc) { proto_tree *sdp_media_tree; gint offset, next_offset, tokenlen, idx; guint8 *media_format; gboolean optional = FALSE; proto_item *it; const guint8 *media_type_str; const guint8 *media_port_str; const guint8 *media_proto_str; transport_proto_t transport_proto; guint16 media_port; gboolean media_port_valid; proto_item *pi; offset = 0; /* Create tree for media session */ sdp_media_tree = proto_item_add_subtree(ti, ett_sdp_media); tokenlen = find_next_token_in_line(tvb, sdp_media_tree, &offset, &next_offset); if (tokenlen == 0) return; /* Type of media session */ proto_tree_add_item_ret_string(sdp_media_tree, hf_media_media, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &media_type_str); if (media_desc) { /* for RTP statistics (supposedly?) */ if (strcmp((const char*)media_type_str, "audio") == 0) media_desc->media_types |= RTP_MEDIA_AUDIO; else if (strcmp((const char*)media_type_str, "video") == 0) media_desc->media_types |= RTP_MEDIA_VIDEO; else media_desc->media_types |= RTP_MEDIA_OTHER; } DPRINT(("parsed media_type=%s", media_type_str)); offset = next_offset + 1; tokenlen = find_next_token_in_line(tvb, sdp_media_tree, &offset, &next_offset); if (tokenlen == 0) return; next_offset = tvb_find_guint8(tvb, offset, tokenlen, '/'); if (next_offset != -1) { tokenlen = next_offset - offset; /* Save port info */ it = proto_tree_add_item_ret_string(sdp_media_tree, hf_media_port_string, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &media_port_str); DPRINT(("parsed media_port=%s", media_port_str)); if (g_ascii_isdigit(media_port_str[0])) { proto_item_set_hidden(it); media_port_valid = ws_strtou16(media_port_str, NULL, &media_port); pi = proto_tree_add_uint(sdp_media_tree, hf_media_port, tvb, offset, tokenlen, media_port); if (!media_port_valid) expert_add_info(pinfo, pi, &ei_sdp_invalid_media_port); if (media_desc) { media_desc->media_port = media_port; } } offset = next_offset + 1; tokenlen = find_next_token_in_line(tvb, sdp_media_tree, &offset, &next_offset); if (tokenlen == 0) return; /* TODO: this puts the (optional) number of ports in the tree, but we don't actually use it for building the extra RTP flows, which we should. */ proto_tree_add_item(sdp_media_tree, hf_media_portcount, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; } else { tokenlen = find_next_token_in_line(tvb, sdp_media_tree, &offset, &next_offset); if (tokenlen == 0) return; /* Save port info */ it = proto_tree_add_item_ret_string(sdp_media_tree, hf_media_port_string, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &media_port_str); DPRINT(("parsed media_port=%s", media_port_str)); if (g_ascii_isdigit(media_port_str[0])) { proto_item_set_hidden(it); media_port_valid = ws_strtou16(media_port_str, NULL, &media_port); pi = proto_tree_add_uint(sdp_media_tree, hf_media_port, tvb, offset, tokenlen, media_port); if (!media_port_valid) expert_add_info(pinfo, pi, &ei_sdp_invalid_media_port); if (media_desc) { media_desc->media_port = media_port; } } offset = next_offset + 1; } tokenlen = find_next_token_in_line(tvb, sdp_media_tree, &offset, &next_offset); if (tokenlen == 0) return; /* Save port protocol */ proto_tree_add_item_ret_string(sdp_media_tree, hf_media_proto, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &media_proto_str); DPRINT(("parsed media_proto=%s", media_proto_str)); /* Detect protocol for registering with other dissectors like RTP. */ transport_proto = parse_sdp_media_protocol(media_proto_str); if (media_desc) { media_desc->proto = transport_proto; } do { offset = next_offset + 1; tokenlen = find_next_optional_token_in_line(tvb, sdp_media_tree, &offset, &next_offset, optional); if (tokenlen == 0) break; /* RFC 4566: If the <proto> sub-field is "RTP/AVP" or "RTP/SAVP" the * <fmt> sub-fields contain RTP payload type numbers. */ if (transport_proto == SDP_PROTO_RTP || transport_proto == SDP_PROTO_SRTP) { media_format = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA); if (g_ascii_isdigit(media_format[0])) { proto_tree_add_string(sdp_media_tree, hf_media_format, tvb, offset, tokenlen, val_to_str_ext((guint32)strtoul((char*)media_format, NULL, 10), &rtp_payload_type_vals_ext, "%u")); if (media_desc) { idx = media_desc->media.pt_count; media_desc->media.pt[idx] = (gint32)strtol((char*)media_format, NULL, 10); DPRINT(("parsed media codec pt=%d", media_desc->media.pt[idx])); if (idx < (SDP_MAX_RTP_PAYLOAD_TYPES-1)) media_desc->media.pt_count++; } } else { proto_tree_add_item(sdp_media_tree, hf_media_format, tvb, offset, tokenlen, ENC_UTF_8); } } else { proto_tree_add_item(sdp_media_tree, hf_media_format, tvb, offset, tokenlen, ENC_UTF_8); } optional = TRUE; } while (next_offset != -1); /* XXX Dissect traffic to "Port" as "Protocol" * Remember this Port/Protocol pair so we can tear it down again later * Actually, it's harder than that: * We need to find out the address of the other side first and it * looks like that info can be found in SIP headers only. */ } static tvbuff_t * ascii_bytes_to_tvb(tvbuff_t *tvb, packet_info *pinfo, gchar *msg) { size_t nbytes; guint8 *buf = convert_string_to_hex(msg, &nbytes); if (buf) { tvbuff_t *bytes_tvb; bytes_tvb = tvb_new_child_real_data(tvb, buf, (unsigned)nbytes, (unsigned)nbytes); tvb_set_free_cb(bytes_tvb, g_free); add_new_data_source(pinfo, bytes_tvb, "ASCII bytes to tvb"); return bytes_tvb; } return NULL; } /* Annex X Profiles and levels definition */ static const value_string h263_profile_vals[] = { { 0, "Baseline Profile" }, { 1, "H.320 Coding Efficiency Version 2 Backward-Compatibility Profile" }, { 2, "Version 1 Backward-Compatibility Profile" }, { 3, "Version 2 Interactive and Streaming Wireless Profile" }, { 4, "Version 3 Interactive and Streaming Wireless Profile" }, { 5, "Conversational High Compression Profile" }, { 6, "Conversational Internet Profile" }, { 7, "Conversational Interlace Profile" }, { 8, "High Latency Profile" }, { 0, NULL }, }; /* RFC 4629 The level are described in table X.2 of H.263 annex X */ static const value_string h263_level_vals[] = { { 10, "QCIF (176 x 144), 1 x 64Kb/s" }, { 20, "CIF (352 x 288), 2 x 64Kb/s" }, { 30, "CIF (352 x 288), 6 x 64Kb/s" }, { 40, "CIF (352 x 288), 32 x 64Kb/s" }, { 45, "QCIF (176 x144) support of CPFMT, 2 x 64Kb/s" }, { 50, "CIF (352 x 288) support of CPFMT, 64 x 64Kb/s" }, { 60, "CPFMT: 720 x 288 support of CPFMT, 128 x 64Kb/s" }, { 70, "CPFMT: 720 x 576 support of CPFMT, 256 x 64Kb/s" }, { 0, NULL }, }; static const value_string h264_packetization_mode_vals[] = { { 0, "Single NAL mode" }, { 1, "Non-interleaved mode" }, { 2, "Interleaved mode" }, { 0, NULL }, }; /* * TODO: Make this a more generic routine to dissect fmtp parameters depending on media types */ static void decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset, gint tokenlen, guint8 pt, transport_info_t *transport_info, rtp_dyn_payload_t *rtp_dyn_payload) { gint next_offset; gint end_offset; guint8 *field_name; gchar *format_specific_parameter; proto_item *item; tvbuff_t * volatile data_tvb; const char *mime_type = transport_info->encoding_name[pt]; end_offset = offset + tokenlen; #if 0 proto_tree_add_debug(tree, tvb, offset, tokenlen, "Debug; Analysed string: '%s'", tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII)); #endif /* Look for an '=' within this string - RFC 4855 suggets that parameters be "parameter=value" pairs. We'll store them in a hash map from the parameter name to the value, as well as dissect some of them here, depending on the media type. */ next_offset = tvb_find_guint8(tvb, offset, -1, '='); if (next_offset == -1) { /* Some media types, like telephone-event and RED, don't have the * "parameter=value" syntax: * https://datatracker.ietf.org/doc/html/rfc4733 * 2.4.1. "Relationship to SDP" * "The "events" media type parameter deviates from the convention * suggested in RFC 3555 because it omits the string "events=" before * the list of supported events." * https://www.iana.org/assignments/media-types/audio/RED * We'll handle them with the empty string as the parameter name. * The media types should know how to deal with that, if necessary. */ field_name = wmem_strdup(pinfo->pool, ""); } else { /* Find the name of the parameter */ tokenlen = next_offset - offset; field_name = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8); #if 0 proto_tree_add_debug(tree, tvb, offset, tokenlen, "Debug; MIMEtype '%s'Parameter name: '%s'", mime_type, field_name); */ #endif /* Move past the '=' */ offset = next_offset + 1; } /* Get the value */ tokenlen = end_offset - offset; format_specific_parameter = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8); if (rtp_dyn_payload) { rtp_dyn_payload_add_fmtp(rtp_dyn_payload, pt, field_name, format_specific_parameter); } /* Dissect the MPEG4 profile-level-id parameter if present */ if ((mime_type != NULL) && (g_ascii_strcasecmp(mime_type, "MP4V-ES") == 0)) { if (strcmp((char*)field_name, "profile-level-id") == 0) { item = proto_tree_add_uint(tree, hf_sdp_fmtp_mpeg4_profile_level_id, tvb, offset, tokenlen, (guint32)strtol((char*)format_specific_parameter, NULL, 10)); proto_item_set_generated(item); } else if (strcmp((char*)field_name, "config") == 0) { data_tvb = ascii_bytes_to_tvb(tvb, pinfo, format_specific_parameter); if (mp4ves_config_handle && data_tvb) { call_dissector(mp4ves_config_handle, data_tvb, pinfo, tree); } } } /* Dissect the H263-2000 profile parameter if present */ if (((mime_type != NULL) && (g_ascii_strcasecmp(mime_type, "H263-2000") == 0)) || ((mime_type != NULL) && (g_ascii_strcasecmp(mime_type, "H263-1998") == 0))) { if (strcmp((char*)field_name, "profile") == 0) { item = proto_tree_add_uint(tree, hf_sdp_fmtp_h263_profile, tvb, offset, tokenlen, (guint32)strtol((char*)format_specific_parameter, NULL, 10)); proto_item_set_generated(item); } else if (strcmp((char*)field_name, "level") == 0) { item = proto_tree_add_uint(tree, hf_sdp_fmtp_h263_level, tvb, offset, tokenlen, (guint32)strtol((char*)format_specific_parameter, NULL, 10)); proto_item_set_generated(item); } } /* Dissect the H264 profile-level-id parameter * RFC 3984: * A base16 [6] (hexadecimal) representation of * the following three bytes in the sequence * parameter set NAL unit specified in [1]: 1) * profile_idc, 2) a byte herein referred to as * profile-iop, composed of the values of * constraint_set0_flag, constraint_set1_flag, * constraint_set2_flag, and reserved_zero_5bits * in bit-significance order, starting from the * most significant bit, and 3) level_idc. */ if ((mime_type != NULL) && ((g_ascii_strcasecmp(mime_type, "H264") == 0) || (g_ascii_strcasecmp(mime_type, "H264-SVC") == 0))) { if (strcmp(field_name, "profile-level-id") == 0) { int length = 0; data_tvb = ascii_bytes_to_tvb(tvb, pinfo, format_specific_parameter); if (!data_tvb) { proto_tree_add_expert_format(tree, pinfo, &ei_sdp_invalid_conversion, tvb, offset, tokenlen, "Could not convert '%s' to 3 bytes", format_specific_parameter); return; } length = tvb_reported_length(data_tvb); if (length == 3) { if (h264_handle && data_tvb) { dissect_h264_profile(data_tvb, pinfo, tree); } } else { item = proto_tree_add_expert_format(tree, pinfo, &ei_sdp_invalid_conversion, tvb, offset, tokenlen, "Incorrectly coded, must be three bytes"); proto_item_set_generated(item); } } else if (strcmp(field_name, "packetization-mode") == 0) { item = proto_tree_add_uint(tree, hf_sdp_h264_packetization_mode, tvb, offset, tokenlen, (guint32)strtol((char*)format_specific_parameter, NULL, 10)); proto_item_set_generated(item); } else if (strcmp(field_name, "sprop-parameter-sets") == 0) { /* The value of the parameter is the base64 [6] representation of the initial parameter set NAL units as specified in sections 7.3.2.1 and 7.3.2.2 of [1]. The parameter sets are conveyed in decoding order, and no framing of the parameter set NAL units takes place. A comma is used to separate any pair of parameter sets in the list. */ const guint8 *data_p = NULL; gint comma_offset; comma_offset = tvb_find_guint8(tvb, offset, -1, ','); if (comma_offset != -1) { tokenlen = comma_offset - offset; } else { tokenlen = end_offset - offset; } proto_tree_add_item_ret_string(tree, hf_sdp_nal_unit_1_string, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &data_p); data_tvb = base64_to_tvb(tvb, data_p); add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets"); if (h264_handle && data_tvb) { TRY { dissect_h264_nal_unit(data_tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; if (comma_offset != -1) { /* Second NAL unit */ offset = comma_offset +1; tokenlen = end_offset - offset; proto_tree_add_item_ret_string(tree, hf_sdp_nal_unit_2_string, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &data_p); data_tvb = base64_to_tvb(tvb, data_p); add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets 2"); dissect_h264_nal_unit(data_tvb, pinfo, tree); } } } } /* Dissect the H265 * RFC 7798: */ else if ((mime_type != NULL) && (g_ascii_strcasecmp(mime_type, "H265") == 0)) { if (strcmp(field_name, "sprop-vps") == 0 || strcmp(field_name, "sprop-sps") == 0 || strcmp(field_name, "sprop-pps") == 0) { data_tvb = base64_to_tvb(tvb, format_specific_parameter); add_new_data_source(pinfo, data_tvb, field_name); if (h265_handle && data_tvb) { dissect_h265_format_specific_parameter(tree, data_tvb, pinfo); } } } } static const string_string ice_candidate_types[] = { { "host", "Host candidate" }, { "srflx", "Server reflexive candidate" }, { "prflx", "Peer reflexive candidate" }, { "relay", "Relayed candidate" }, { 0, NULL } }; static void dissect_sdp_media_attribute_candidate(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { /* RFC 5245 (ICE): "The candidate attribute is a media-level attribute * only. It contains a transport address for a candidate that can be * used for connectivity checks." * https://tools.ietf.org/html/rfc5245#section-15.1 * * candidate-attribute = "candidate" ":" foundation SP component-id SP * transport SP * priority SP * connection-address SP ;from RFC 4566 * port ;port from RFC 4566 * SP cand-type * [SP rel-addr] * [SP rel-port] * *(SP extension-att-name SP * extension-att-value) * * Example: "candidate:0 1 UDP 2122252543 10.9.0.2 60299 typ host" */ proto_item *pi; gint next_offset, tokenlen; const guint8 *candidate_type; /* foundation: between 1 and 32 "ICE chars" (ALPHA / DIGIT / "+" / "/") */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(tree, hf_ice_candidate_foundation, tvb, offset, tokenlen, ENC_ASCII); offset = next_offset + 1; /* component-id: integer between 1 and 256. * For RTP, 1 MUST be RTP and 2 MUST be RTCP (RFC 5245) */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(tree, hf_ice_candidate_componentid, tvb, offset, tokenlen, ENC_ASCII); offset = next_offset + 1; /* transport: "UDP", etc. */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(tree, hf_ice_candidate_transport, tvb, offset, tokenlen, ENC_ASCII); offset = next_offset + 1; /* priority: integer between 1 and 2^31-1 */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(tree, hf_ice_candidate_priority, tvb, offset, tokenlen, ENC_ASCII); offset = next_offset + 1; /* connection-address: IPv4, IPv6 address or FQDN. */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(tree, hf_ice_candidate_address, tvb, offset, tokenlen, ENC_ASCII); offset = next_offset + 1; /* port */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; proto_tree_add_item(tree, hf_ice_candidate_port, tvb, offset, tokenlen, ENC_ASCII); offset = next_offset + 1; /* cand-type: type of candidate (where it learned the candidate) * Check for "typ " in "typ host" and skip it. */ if (tvb_strneql(tvb, offset, "typ ", 4)) return; offset += 4; tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; pi = proto_tree_add_item_ret_string(tree, hf_ice_candidate_type, tvb, offset, tokenlen, ENC_ASCII|ENC_NA, pinfo->pool, &candidate_type); if ((candidate_type = try_str_to_str(candidate_type, ice_candidate_types))) { proto_item_append_text(pi, " (%s)", candidate_type); } /* offset = next_offset + 1; */ /* Ignored: [rel-addr] [rel-port] *(extension-att-name extension-att-value) */ } typedef struct { const char *name; } sdp_names_t; #define SDP_RTPMAP 1 #define SDP_FMTP 2 #define SDP_PATH 3 #define SDP_H248_ITEM 4 #define SDP_CRYPTO 5 #define SDP_SPRTMAP 6 #define SDP_CANDIDATE 7 #define SDP_ED137_TYPE 8 #define SDP_ED137_TXRXMODE 9 #define SDP_ED137_FID 10 #define SDP_RTCP 11 #define SDP_RTCP_MUX 12 static const sdp_names_t sdp_media_attribute_names[] = { { "Unknown-name"}, /* 0 Pad so that the real headers start at index 1 */ { "rtpmap"}, /* 1 */ { "fmtp"}, /* 2 */ { "path"}, /* 3 */ { "h248item"}, /* 4 */ { "crypto"}, /* 5 */ { "sprt"}, /* 6 */ { "candidate" }, /* 7 */ { "type" }, /* 8 */ { "txrxmode" }, /* 9 */ { "fid" }, /* 10 */ { "rtcp" }, /* 11 */ { "rtcp-mux" }, /* 12 */ }; static gint find_sdp_media_attribute_names(tvbuff_t *tvb, int offset, guint len) { guint i; for (i = 1; i < array_length(sdp_media_attribute_names); i++) { if ((len == strlen(sdp_media_attribute_names[i].name)) && (tvb_strncaseeql(tvb, offset, sdp_media_attribute_names[i].name, len) == 0)) return i; } return -1; } /* A few protocols give the fmtp parameter as a string instead of a * numeric payload type, list them here (lower case for comparison). */ static const string_string media_format_str_types[] = { /* ETSI TS 102 472, ETSI TS 102 592 */ { "ipdc-kmm", "IP Datacast Key Management Message"}, { "ipdc-ksm", "IP Datacast Key Stream Message"}, /* ETSI TS 124 380 */ { "mcptt", "Mission Critical Push To Talk"}, /* ETSI TS 124 581 */ { "mcvideo", "Mission Critical Video"}, /* OMA PoC Control Plane */ { "tbcp", "Talk Burst Control Protocol"}, { 0, NULL } }; static void dissect_sdp_media_attribute_rtpmap(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int length, transport_info_t *transport_info, session_info_t *session_info, media_description_t *media_desc, int offset) { gint next_offset, tokenlen; const guint8 *payload_type; proto_item *pi; guint8 pt; /* RFC 8866 6.6 rtpmap Syntax: rtpmap-value = payload-type SP encoding-name "/" clock-rate [ "/" encoding-params ] payload-type = zero-based-integer encoding-name = token clock-rate = integer encoding-params = channels channels = integer */ next_offset = tvb_find_guint8(tvb, offset, -1, ' '); if (next_offset == -1) return; tokenlen = next_offset - offset; proto_tree_add_item_ret_string(tree, hf_media_format, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA, pinfo->pool, &payload_type); offset = next_offset + 1; next_offset = tvb_find_guint8(tvb, offset, -1, '/'); if (next_offset == -1) { return; } tokenlen = next_offset - offset; proto_tree_add_item(tree, hf_media_encoding_name, tvb, offset, tokenlen, ENC_UTF_8); if (!ws_strtou8(payload_type, NULL, &pt) || pt >= SDP_NO_OF_PT) { return; /* Invalid */ } /* String is file scope allocated because transport_info is connection related */ transport_info->encoding_name[pt] = (char*)tvb_get_string_enc(wmem_file_scope(), tvb, offset, tokenlen, ENC_UTF_8|ENC_NA); offset = next_offset + 1; next_offset = tvb_find_guint8(tvb, offset, length - offset, '/'); if (next_offset == -1) { next_offset = length; } tokenlen = next_offset - offset; pi = proto_tree_add_item(tree, hf_media_sample_rate, tvb, offset, tokenlen, ENC_UTF_8); transport_info->sample_rate[pt] = 0; if (!ws_strtou32(tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA), NULL, &transport_info->sample_rate[pt])) { expert_add_info(pinfo, pi, &ei_sdp_invalid_sample_rate); } else if (!strcmp(transport_info->encoding_name[pt], "G722")) { // The reported sampling rate is 8000, but the actual value is // 16kHz. https://tools.ietf.org/html/rfc3551#section-4.5.2 proto_item_append_text(pi, " (RTP clock rate is 8kHz, actual sampling rate is 16kHz)"); } transport_info->channels[pt] = 1; if (media_desc && media_desc->media_types & RTP_MEDIA_AUDIO) { if (next_offset < length) { offset = next_offset + 1; tokenlen = length - offset; pi = proto_tree_add_item(tree, hf_media_channels, tvb, offset, tokenlen, ENC_UTF_8); if (!ws_strtou32(tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA), NULL, &transport_info->channels[pt])) { expert_add_info(pinfo, pi, &ei_sdp_invalid_channels); } } } /* As per RFC2327 it is possible to have multiple Media Descriptions ("m="). For example: a=rtpmap:101 G726-32/8000 m=audio 49170 RTP/AVP 0 97 a=rtpmap:97 telephone-event/8000 m=audio 49172 RTP/AVP 97 101 a=rtpmap:97 G726-24/8000 The Media attributes ("a="s) after the "m=" only apply for that "m=". If there is an "a=" before the first "m=", that attribute applies for all the session (all the "m="s). */ if (session_info) { /* If this "a=" appear before any "m=", we add it to the session * info, these will be added later to all media (via * sdp_new_media_description). * * NOTE: This should not happen, because rtpmap is Usage Level: media * (RFC 8866 6.6, also RFC 4566 6, and heavily implied by RFC 2327) */ rtp_dyn_payload_insert(session_info->rtp_dyn_payload, pt, transport_info->encoding_name[pt], transport_info->sample_rate[pt], transport_info->channels[pt]); } else if (media_desc) { /* if the "a=" is after an "m=", only apply to this "m=" */ rtp_dyn_payload_insert(media_desc->media.rtp_dyn_payload, pt, transport_info->encoding_name[pt], transport_info->sample_rate[pt], transport_info->channels[pt]); } } static void dissect_sdp_media_attribute_fmtp(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, transport_info_t *transport_info, session_info_t *session_info, media_description_t *media_desc, int offset) { gint next_offset, tokenlen; proto_item *fmtp_item, *media_format_item; const guint8 *payload_type; const guint8 *media_format_str; proto_tree *fmtp_tree; gboolean has_more_pars = TRUE; /* Reading the Format parameter(fmtp) */ guint8 media_format; /* Skip leading space, if any */ offset = tvb_skip_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)); /* Media format extends to the next space */ next_offset = tvb_find_guint8(tvb, offset, -1, ' '); if (next_offset == -1) return; tokenlen = next_offset - offset; media_format_item = proto_tree_add_item_ret_string(tree, hf_media_format, tvb, offset, tokenlen, ENC_UTF_8 | ENC_NA, pinfo->pool, &payload_type); /* Append encoding name to format if known */ payload_type = wmem_ascii_strdown(pinfo->pool, payload_type, -1); media_format = 0; if ((media_format_str = try_str_to_str(payload_type, media_format_str_types))) { proto_item_append_text(media_format_item, " [%s]", media_format_str); } else if (ws_strtou8(payload_type, NULL, &media_format) && media_format < SDP_NO_OF_PT) { if (media_format) { proto_item_append_text(media_format_item, " [%s]", transport_info->encoding_name[media_format]); } } else { expert_add_info(pinfo, media_format_item, &ei_sdp_invalid_media_format); return; } #if 0 /* XXX: ?? */ payload_type = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII); #endif /* Move offset past the payload type */ offset = next_offset + 1; while (has_more_pars == TRUE) { next_offset = tvb_find_guint8(tvb, offset, -1, ';'); offset = tvb_skip_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)); if (next_offset == -1) { has_more_pars = FALSE; next_offset= tvb_captured_length(tvb); } /* There are at least 2 - add the first parameter */ tokenlen = next_offset - offset; fmtp_item = proto_tree_add_item(tree, hf_media_format_specific_parameter, tvb, offset, tokenlen, ENC_UTF_8); fmtp_tree = proto_item_add_subtree(fmtp_item, ett_sdp_fmtp); rtp_dyn_payload_t *rtp_dyn_payload = NULL; if (session_info) { rtp_dyn_payload = session_info->rtp_dyn_payload; } else if (media_desc) { rtp_dyn_payload = media_desc->media.rtp_dyn_payload; } decode_sdp_fmtp(fmtp_tree, tvb, pinfo, offset, tokenlen, media_format, transport_info, rtp_dyn_payload); /* Move offset past "; " and onto firts char */ offset = next_offset + 1; } } static void dissect_sdp_media_attribute_path(packet_info *pinfo, tvbuff_t *tvb, guint8 *attribute_value, media_description_t *media_desc, const char *msrp_res, int offset) { /* msrp attributes that contain address needed for conversation */ /* RFC 4975 * path = path-label ":" path-list * path-label = "path" * path-list= MSRP-URI *(SP MSRP-URI) * MSRP-URI = msrp-scheme "://" authority * ["/" session-id] ";" transport *( ";" URI-parameter) * ; authority as defined in RFC3986 * * msrp-scheme = "msrp" / "msrps" * RFC 3986 * The authority component is preceded by a double slash ("//") and is terminated by * the next slash ("/"), question mark ("?"), or number sign ("#") character, or by * the end of the URI. */ /* Check for "msrp://" */ if (strncmp((char*)attribute_value, msrp_res, strlen(msrp_res)) == 0 && msrp_handle && media_desc && media_desc->proto == SDP_PROTO_MSRP) { int address_offset, port_offset, port_end_offset; /* Address starts here */ address_offset = offset + (int)strlen(msrp_res); /* Port is after next ':' */ port_offset = tvb_find_guint8(tvb, address_offset, -1, ':'); /* Check if port is present if not skipp */ if (port_offset!= -1) { /* Port ends with '/' */ port_end_offset = tvb_find_guint8(tvb, port_offset, -1, '/'); if (port_end_offset == -1) { /* No "/" look for the ";" */ port_end_offset = tvb_find_guint8(tvb, port_offset, -1, ';'); } /* Attempt to convert address */ guint32 msrp_ipaddr; guint16 msrp_port_number; if (str_to_ip((char*)tvb_get_string_enc(pinfo->pool, tvb, address_offset, port_offset-address_offset, ENC_UTF_8|ENC_NA), &msrp_ipaddr)) { /* Get port number */ if (ws_strtou16(tvb_get_string_enc(pinfo->pool, tvb, port_offset + 1, port_end_offset - port_offset - 1, ENC_UTF_8|ENC_NA), NULL, &msrp_port_number)) { /* Port and address are usable, store for later use in * complete_descriptions (overrides the "c=" address). */ alloc_address_wmem(wmem_file_scope(), &media_desc->media_attr.msrp.ipaddr, AT_IPv4, 4, &msrp_ipaddr); media_desc->media_attr.msrp.port_number = msrp_port_number; } } } } } static void dissect_sdp_media_attribute_h248_item(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint8 *attribute_value, const char *msrp_res) { const char *h324ext_h223lcparm = "h324ext/h223lcparm"; tvbuff_t *h245_tvb; if (strncmp((char*)attribute_value, h324ext_h223lcparm, strlen(msrp_res)) == 0) { /* A.5.1.3 H.223 Logical channel parameters * This property indicates the H.245 * H223LogicalChannelsParameters structure encoded by applying the PER specified in * ITU-T Rec. X.691. Value encoded as per A.5.1.2. For text encoding the mechanism defined * in ITU-T Rec. H.248.15 is used. * * H.248.15 6 IANA considerations * The format of the Package attribute is as below: * a=h248item:<package name>/<property name> = <value> */ asn1_ctx_t actx; attribute_value = strchr(attribute_value, '='); if (!attribute_value) { return; } h245_tvb = ascii_bytes_to_tvb(tvb, pinfo, ++attribute_value); /* should go through a handle, however, the two h245 entry points are different, one is over tpkt and the other is raw */ if (h245_tvb) { asn1_ctx_init(&actx, ASN1_ENC_PER, TRUE, pinfo); dissect_h245_H223LogicalChannelParameters(h245_tvb, 0, &actx, tree,hf_SDPh223LogicalChannelParameters); } } } static void dissect_sdp_media_attribute_crypto(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, transport_info_t *transport_info, int offset) { /* https://tools.ietf.org/html/rfc4568 * 9.1. Generic "Crypto" Attribute Grammar * * The ABNF grammar for the crypto attribute is defined below: * * "a=crypto:" tag 1*WSP crypto-suite 1*WSP key-params * *(1*WSP session-param) * * tag = 1*9DIGIT * crypto-suite = 1*(ALPHA / DIGIT / "_") * * key-params = key-param *(";" key-param) * key-param = key-method ":" key-info * key-method = "inline" / key-method-ext * key-method-ext = 1*(ALPHA / DIGIT / "_") * key-info = 1*(%x21-3A / %x3C-7E) ; visible (printing) chars * ; except semi-colon * session-param = 1*(VCHAR) ; visible (printing) characters * * where WSP, ALPHA, DIGIT, and VCHAR are defined in [RFC4234]. * */ gint next_offset, tokenlen; proto_tree *parameter_item; proto_item *parameter_tree; guint32 crypto_tag; gboolean crypto_tag_valid; gboolean has_more_pars = TRUE; guint8 master_key_length = 0, master_salt_length = 0; gboolean mki_len_valid; proto_item *pi; /* We are at the first colon */ /* tag */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; crypto_tag_valid = ws_strtou32(tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA), NULL, &crypto_tag); pi = proto_tree_add_uint(tree, hf_sdp_crypto_tag, tvb, offset, tokenlen, crypto_tag); if (!crypto_tag_valid) expert_add_info(pinfo, pi, &ei_sdp_invalid_crypto_tag); offset = next_offset + 1; /* crypto-suite */ tokenlen = find_next_token_in_line(tvb, tree, &offset, &next_offset); if (tokenlen == 0) return; parameter_item = proto_tree_add_item(tree, hf_sdp_crypto_crypto_suite, tvb, offset, tokenlen, ENC_UTF_8); if (tvb_strncaseeql(tvb, offset, "AES_CM_128_HMAC_SHA1_80", tokenlen) == 0) { /* XXX This may only work in simple cases */ if (transport_info->encryption_algorithm == SRTP_ENC_ALG_NOT_SET) { transport_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM; transport_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA1; /* number of octets used for the Auth Tag in the RTP payload */ transport_info->auth_tag_len = 10; } master_key_length = 16; /* 128 bits = 16 octets */ master_salt_length = 14; /* 112 bits = 14 octets */ } else if (tvb_strncaseeql(tvb, offset, "AES_CM_128_HMAC_SHA1_32", tokenlen) == 0) { /* XXX This may only work in simple cases */ if (transport_info->encryption_algorithm == SRTP_ENC_ALG_NOT_SET) { transport_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM; transport_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA1; /* number of octets used for the Auth Tag in the RTP payload */ transport_info->auth_tag_len = 4; } master_key_length = 16; /* 128 bits = 16 octets */ master_salt_length = 14; /* 112 bits = 14 octets */ } else if (tvb_strncaseeql(tvb, offset, "F8_128_HMAC_SHA1_80", tokenlen) == 0) { if (transport_info->encryption_algorithm == SRTP_ENC_ALG_NOT_SET) { /* XXX This may only work in simple cases */ transport_info->encryption_algorithm = SRTP_ENC_ALG_AES_F8; transport_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA1; /* number of octets used for the Auth Tag in the RTP payload */ transport_info->auth_tag_len = 10; } master_key_length = 16; /* 128 bits = 16 octets */ master_salt_length = 14; /* 112 bits = 14 octets */ } offset = next_offset + 1; /* key-params */ while (has_more_pars == TRUE) { int param_end_offset; tvbuff_t *key_salt_tvb; gchar *data_p = NULL; param_end_offset = tvb_find_guint8(tvb, offset, -1, ';'); if (param_end_offset == -1) { has_more_pars = FALSE; param_end_offset = tvb_captured_length(tvb); } /* key-method or key-method-ext */ next_offset = tvb_find_guint8(tvb, offset, -1, ':'); if (next_offset == -1) { expert_add_info(pinfo, parameter_item, &ei_sdp_invalid_key_param); break; } if (tvb_strncaseeql(tvb, offset, "inline", next_offset-offset) == 0) { parameter_tree = proto_tree_add_subtree(tree, tvb, offset,param_end_offset-offset, ett_sdp_crypto_key_parameters, NULL, "Key parameters"); /* XXX only for SRTP? */ /* srtp-key-info = key-salt ["|" lifetime] ["|" mki] */ offset = next_offset +1; next_offset = tvb_find_guint8(tvb, offset, -1, '|'); if (next_offset == -1) { tokenlen = param_end_offset - offset; } else { tokenlen = next_offset - offset; } data_p = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA); key_salt_tvb = base64_to_tvb(tvb, data_p); add_new_data_source(pinfo, key_salt_tvb, "Key_Salt_tvb"); if (master_key_length != 0) { proto_tree_add_item(parameter_tree, hf_sdp_key_and_salt, tvb, offset, tokenlen, ENC_NA); proto_tree_add_item(parameter_tree, hf_sdp_crypto_master_key, key_salt_tvb, 0, master_key_length, ENC_NA); proto_tree_add_item(parameter_tree, hf_sdp_crypto_master_salt, key_salt_tvb, master_key_length, master_salt_length, ENC_NA); } else { proto_tree_add_item(parameter_tree, hf_sdp_key_and_salt, key_salt_tvb, 0, -1, ENC_NA); } /* ["|" lifetime] ["|" mki] are optional */ if (next_offset != -1) { offset = next_offset + 1; next_offset = tvb_find_guint8(tvb, offset, -1, '|'); if (next_offset == -1) { if (next_offset < param_end_offset){ next_offset = param_end_offset; } } if (next_offset != -1) { /*lifetime = ["2^"] 1*(DIGIT) ; see section 6.1 for "2^" */ tokenlen = next_offset - offset; proto_tree_add_item(parameter_tree, hf_sdp_crypto_lifetime, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; } /* mki = mki-value ":" mki-length * * mki-value = 1*DIGIT */ if (offset>param_end_offset) { next_offset = -1; } else { next_offset = tvb_find_guint8(tvb, offset, -1, ':'); } if (next_offset != -1) { tokenlen = next_offset - offset; proto_tree_add_item(parameter_tree, hf_sdp_crypto_mki, tvb, offset, tokenlen, ENC_UTF_8); offset = next_offset + 1; /* mki-length = 1*3DIGIT ; range 1..128. */ next_offset = param_end_offset; tokenlen = next_offset - offset; /* This will not work if more than one parameter */ /* number of octets used for the MKI in the RTP payload */ mki_len_valid = ws_strtou32(tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_UTF_8|ENC_NA), NULL, &transport_info->mki_len); pi = proto_tree_add_item(parameter_tree, hf_sdp_crypto_mki_length, tvb, offset, tokenlen, ENC_UTF_8); if (!mki_len_valid) expert_add_info(pinfo, pi, &ei_sdp_invalid_crypto_mki_length); } } offset = param_end_offset; } else { break; } } } static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_item * ti, int length, transport_info_t *transport_info, session_info_t *session_info, media_description_t *media_desc, sdp_data_t *sdp_data) { proto_tree *sdp_media_attribute_tree; proto_item *pi; gint offset, tokenlen, colon_offset; guint8 *attribute_value; gint sdp_media_attrbute_code; const char *msrp_res = "msrp://"; offset = 0; /* Create attribute tree */ sdp_media_attribute_tree = proto_item_add_subtree(ti, ett_sdp_media_attribute); /* Find end of field */ colon_offset = tvb_find_guint8(tvb, offset, -1, ':'); if (colon_offset == -1) return; /* Attribute field name is token before ':' */ tokenlen = colon_offset - offset; pi = proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_field, tvb, offset, tokenlen, ENC_UTF_8); /*??field_name = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII);*/ sdp_media_attrbute_code = find_sdp_media_attribute_names(tvb, offset, tokenlen); /* Skip colon */ offset = colon_offset + 1; /* skip leading wsp */ offset = tvb_skip_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)); /* Value is the remainder of the line */ if (tvb_captured_length_remaining(tvb, offset) > 0) attribute_value = tvb_get_string_enc(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_UTF_8|ENC_NA); else { expert_add_info(pinfo, pi, &ei_sdp_invalid_line_fields); return; } /*********************************************/ /* Special parsing for some field name types */ switch (sdp_media_attrbute_code) { case SDP_RTPMAP: /* decode the rtpmap to see if it is DynamicPayload to dissect them automatic */ dissect_sdp_media_attribute_rtpmap(sdp_media_attribute_tree, pinfo, tvb, length, transport_info, session_info, media_desc, offset); break; case SDP_FMTP: dissect_sdp_media_attribute_fmtp(sdp_media_attribute_tree, pinfo, tvb, transport_info, session_info, media_desc, offset); break; case SDP_PATH: dissect_sdp_media_attribute_path(pinfo, tvb, attribute_value, media_desc, msrp_res, offset); break; case SDP_H248_ITEM: /* Decode h248 item ITU-T Rec. H.248.12 (2001)/Amd.1 (11/2002)*/ dissect_sdp_media_attribute_h248_item(sdp_media_attribute_tree, pinfo, tvb, attribute_value, msrp_res); break; case SDP_CRYPTO: dissect_sdp_media_attribute_crypto(sdp_media_attribute_tree, pinfo, tvb, transport_info, offset); break; case SDP_CANDIDATE: dissect_sdp_media_attribute_candidate(sdp_media_attribute_tree, pinfo, tvb, offset); break; case SDP_ED137_TYPE: /* Remember the value and add it to tree */ sdp_data->ed137_type = attribute_value; proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value, tvb, offset, -1, ENC_UTF_8); break; case SDP_ED137_TXRXMODE: /* Remember the value and add it to tree */ sdp_data->ed137_txrxmode = attribute_value; proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value, tvb, offset, -1, ENC_UTF_8); break; case SDP_ED137_FID: /* Remember the value and add it to tree */ sdp_data->ed137_fid = attribute_value; proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value, tvb, offset, -1, ENC_UTF_8); break; case SDP_RTCP : if (media_desc) { if (!ws_strtou16(attribute_value, NULL, &media_desc->control_port)) media_desc->control_port = 0; /* Just use default, if not legal port */ } proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value, tvb, offset, -1, ENC_UTF_8); break; case SDP_RTCP_MUX : if (media_desc) { media_desc->control_port = media_desc->media_port; } proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value, tvb, offset, -1, ENC_UTF_8); break; default: /* No special treatment for values of this attribute type, just add as one item. */ proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value, tvb, offset, -1, ENC_UTF_8); break; } } static void call_sdp_subdissector(tvbuff_t *tvb, packet_info *pinfo, int hf, proto_tree* ti, int length, transport_info_t *transport_info, session_info_t *session_info, media_description_t *media_desc, sdp_data_t *sdp_data) { if (hf == hf_owner) { dissect_sdp_owner(tvb, ti); } else if (hf == hf_connection_info) { dissect_sdp_connection_info(pinfo, tvb, ti, session_info, media_desc); } else if (hf == hf_bandwidth) { dissect_sdp_bandwidth(tvb, ti); } else if (hf == hf_time) { dissect_sdp_time(tvb, ti); } else if (hf == hf_repeat_time) { dissect_sdp_repeat_time(tvb, ti); } else if (hf == hf_timezone) { dissect_sdp_timezone(tvb, ti); } else if (hf == hf_encryption_key) { dissect_sdp_encryption_key(tvb, ti); } else if (hf == hf_session_attribute) { dissect_sdp_session_attribute(tvb, pinfo, ti); } else if (hf == hf_media) { dissect_sdp_media(tvb, pinfo, ti, media_desc); } else if (hf == hf_media_attribute) { dissect_sdp_media_attribute(tvb, pinfo, ti, length, transport_info, session_info, media_desc, sdp_data); } } /** * Post-processes the media descriptions after parsing it from the tvb. This * performs processing that can only be done when the full media description is * parsed (since otherwise the order of attributes could influence the result). * Must be called before applying the SDP with apply_sdp_transport. * It will remove media streams when the port number in the answer is zero. * * If the currently processed SDP is an Answer to a known previous Offer, then * answer_offset is non-zero. */ static void complete_descriptions(transport_info_t *transport_info, guint answer_offset) { guint media_count = wmem_array_get_count(transport_info->media_descriptions); media_description_t *media_descs = (media_description_t *)wmem_array_get_raw(transport_info->media_descriptions); media_description_t *bundle_media_desc = NULL; DPRINT(("complete_descriptions called with answer_offset=%d media_count=%d", answer_offset, media_count)); for (guint i = answer_offset; i < media_count && !bundle_media_desc; i++) { for (guint j = i+1; j < media_count && !bundle_media_desc; j++) { if (media_descs[i].media_port == media_descs[j].media_port) bundle_media_desc = &media_descs[i]; } } if (bundle_media_desc) { /* We have "bundling" of media, so now combine all the media bit masks and merge the rtp_dyn_payload so that the first media description has all the data for every media desciption. */ for (guint i = answer_offset; i < media_count; i++) { media_description_t *media_desc = &media_descs[i]; if (bundle_media_desc->media_port == media_desc->media_port) { media_desc->bundled = TRUE; if (media_desc != bundle_media_desc) { bundle_media_desc->media_types |= media_desc->media_types; for (guint pt = 0; pt < 128; ++pt) { const char * encoding_name; int sample_rate; unsigned channels; wmem_map_t *fmtp_map; if (rtp_dyn_payload_get_full(media_desc->media.rtp_dyn_payload, pt, &encoding_name, &sample_rate, &channels, &fmtp_map)) rtp_dyn_payload_insert_full(bundle_media_desc->media.rtp_dyn_payload, pt, encoding_name, sample_rate, channels, fmtp_map); } } } } } for (guint i = answer_offset; i < media_count; i++) { media_description_t *media_desc = &media_descs[i]; if (media_desc->control_port == 0) media_desc->control_port = media_desc->media_port + 1; if (media_desc->control_port == 0) media_desc->control_port = media_desc->media_port + 1; /* If this is an answer to a previous offer... */ if (answer_offset > 0) { /* A zero port removes the media stream (RFC 3264, Section 8.2) */ if (media_desc->media_port == 0) { DPRINT(("disabling media_port=%d, for index=%d", media_descs[i - answer_offset].media_port, i - answer_offset)); media_descs[i - answer_offset].media_port = 0; } } /* MSRP uses addresses discovered in attribute rather than connection information of media session line */ if (media_desc->proto == SDP_PROTO_MSRP && msrp_handle && media_desc->media_attr.msrp.ipaddr.type != AT_NONE) { /* clear old address and set new address and port. */ free_address_wmem(wmem_file_scope(), &media_desc->conn_addr); copy_address_shallow(&media_desc->conn_addr, &media_desc->media_attr.msrp.ipaddr); media_desc->media_port = media_desc->media_attr.msrp.port_number; } } } /** * Given is a structure containing the parsed result from the SDP (including * protocol type (RTP, SRTP, T38, etc.), media info (payload type, etc.) and * connection info (address, port). Register the addresss+port such that the * protocol will be invoked for this tuple with the media information. * * For use with SDP using the Offer/Answer model (such as SIP with INVITE and * 200 OK). * XXX what about RTSP where the SDP merely provides media info, without * actually establishing connections (Bug 5208). * * The passed transport information is modified: 'set_rtp' is set when the media * is assigned to a conversation. Note that the unassigned media (payload types) * are not freed, this is the responsibility of the caller. */ static void apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int request_frame, sdp_setup_info_t *setup_info) { int establish_frame = 0; struct srtp_info *srtp_info = NULL; if (!global_sdp_establish_conversation) { /* Do not register with other dissectors when this pref is disabled. */ return; } /* If no request_frame number has been found use this frame's number */ if (request_frame == 0) { establish_frame = pinfo->num; } else { establish_frame = request_frame; } gboolean bundled_media_set = FALSE; for (guint i = 0; i < wmem_array_get_count(transport_info->media_descriptions); i++) { media_description_t *media_desc = (media_description_t *)wmem_array_index(transport_info->media_descriptions, i); guint32 current_rtp_port = 0; /* Add (s)rtp and (s)rtcp conversation, if available (overrides t38 if conversation already set) */ if ((media_desc->media_port != 0) && !media_desc->media.set_rtp && (media_desc->proto == SDP_PROTO_RTP || media_desc->proto == SDP_PROTO_SRTP) && (media_desc->conn_addr.type == AT_IPv4 || media_desc->conn_addr.type == AT_IPv6)) { media_desc->media.set_rtp = TRUE; if (media_desc->bundled) { if (bundled_media_set) continue; bundled_media_set = TRUE; } if (media_desc->proto == SDP_PROTO_SRTP) { srtp_info = wmem_new0(wmem_file_scope(), struct srtp_info); if (transport_info->encryption_algorithm != SRTP_ENC_ALG_NOT_SET) { srtp_info->encryption_algorithm = transport_info->encryption_algorithm; srtp_info->auth_algorithm = transport_info->auth_algorithm; srtp_info->mki_len = transport_info->mki_len; srtp_info->auth_tag_len = transport_info->auth_tag_len; } DPRINT(("calling srtp_add_address, channel=%d, media_port=%d", i, media_desc->media_port)); DINDENT(); /* srtp_add_address and rtp_add_address are given the request_frame's not this frame's number, because that's where the RTP flow started, and thus conversation needs to check against */ srtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame, media_desc->media_types, media_desc->media.rtp_dyn_payload, srtp_info, setup_info); DENDENT(); } else { DPRINT(("calling rtp_add_address, channel=%d, media_port=%d", i, media_desc->media_port)); DINDENT(); srtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame, media_desc->media_types, media_desc->media.rtp_dyn_payload, NULL, setup_info); DENDENT(); } /* SPRT might use the same port... */ current_rtp_port = media_desc->media_port; if (rtcp_handle && media_desc->media_port != media_desc->control_port) { if (media_desc->proto == SDP_PROTO_SRTP) { DPRINT(("calling rtcp_add_address, channel=%d, control_port=%d", i, media_desc->control_port)); DINDENT(); srtcp_add_address(pinfo, &media_desc->conn_addr, media_desc->control_port, 0, "SDP", establish_frame, srtp_info); DENDENT(); } else { DPRINT(("calling rtcp_add_address, channel=%d, control_port=%d", i, media_desc->control_port)); DINDENT(); rtcp_add_address(pinfo, &media_desc->conn_addr, media_desc->control_port, 0, "SDP", establish_frame); DENDENT(); } } } /* add SPRT conversation */ if (media_desc->proto == SDP_PROTO_SPRT && (media_desc->conn_addr.type == AT_IPv4 || media_desc->conn_addr.type == AT_IPv6) && (sprt_handle)) { if (media_desc->media_port == 0 && current_rtp_port) { sprt_add_address(pinfo, &media_desc->conn_addr, current_rtp_port, 0, "SDP", pinfo->num); /* will use same port as RTP */ } else { sprt_add_address(pinfo, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", pinfo->num); } } /* Add t38 conversation, if available and only if no rtp */ if ((media_desc->media_port != 0) && !media_desc->media.set_rtp && media_desc->proto == SDP_PROTO_T38 && media_desc->conn_addr.type == AT_IPv4) { t38_add_address(pinfo, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", pinfo->num); } /* Add MSRP conversation. Uses addresses discovered in attribute rather than connection information of media session line (already handled in media conversion) */ if (media_desc->proto == SDP_PROTO_MSRP && msrp_handle) { msrp_add_address(pinfo, &media_desc->conn_addr, media_desc->media_port, "SDP", pinfo->num); } /* Add BFCP conversation. Uses addresses discovered in attribute rather than connection information of media session line (already handled in media conversion) */ if (media_desc->proto == SDP_PROTO_BFCP && bfcp_handle) { bfcp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, "SDP", establish_frame); } } /* end of loop through all media descriptions. */ } void setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type exchange_type, int request_frame, const gboolean delay, sdp_setup_info_t *setup_info) { gint offset = 0, next_offset, n; int linelen; gboolean in_media_description = FALSE; guchar type, delim; const int tokenoffset = 2; int hf = -1; gint start_transport_info_count = 0; transport_info_t* transport_info = NULL; media_description_t *media_desc = NULL; session_info_t session_info; sdp_data_t sdp_data; DPRINT2(("-------------------- setup_sdp_transport -------------------")); /* Only do this once during first pass */ if (pinfo->fd->visited) { DPRINT(("already visited")); return; } memset(&sdp_data, 0, sizeof(sdp_data)); if (request_frame != 0) transport_info = (transport_info_t*)wmem_tree_lookup32( sdp_transport_reqs, request_frame ); if (transport_info == NULL) { transport_info = wmem_new0(wmem_file_scope(), transport_info_t); transport_info->media_descriptions = wmem_array_new(wmem_file_scope(), sizeof(media_description_t)); for (n = 0; n < SDP_NO_OF_PT; n++) { /* String is file scope allocated because transport_info is connection related */ transport_info->encoding_name[n] = wmem_strdup(wmem_file_scope(), UNKNOWN_ENCODING); } if (request_frame != 0) wmem_tree_insert32(sdp_transport_reqs, request_frame, (void *)transport_info); } #ifdef DEBUG_CONVERSATION else { DPRINT(("found previous transport_info:")); sdp_dump_transport_info(pinfo, transport_info); } #endif if (exchange_type != SDP_EXCHANGE_OFFER) wmem_tree_insert32(sdp_transport_rsps, pinfo->num, (void *)transport_info); /* Offer has already been answered or rejected and hash tables freed, so * don't try to add to it * XXX - Need to support "modified offers" */ if ((transport_info->sdp_status == SDP_EXCHANGE_ANSWER_REJECT) || (transport_info->sdp_status == SDP_EXCHANGE_ANSWER_ACCEPT)) return; /* Initialize the session description before parsing the media descriptions. */ memset(&session_info, 0, sizeof(session_info_t)); session_info.rtp_dyn_payload = rtp_dyn_payload_new(); /* Remember where the answer should start (it will be zero if there was no * previous offer with media descriptions). */ start_transport_info_count = wmem_array_get_count(transport_info->media_descriptions); DPRINT(("start_transport_info_count=%d", start_transport_info_count)); /* * Show the SDP message a line at a time. */ while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ linelen = tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset); /* * Line must contain at least e.g. "v=". */ if (linelen < 2) break; type = tvb_get_guint8(tvb, offset); delim = tvb_get_guint8(tvb, offset + 1); if (delim != '=') { offset = next_offset; continue; } /* * Attributes. Only care about ones that affect the transport. Ignore others. */ switch (type) { case 'c': hf = hf_connection_info; break; case 'm': hf = hf_media; /* Try to create a new media description (it will return NULL if * there are too many). */ media_desc = sdp_new_media_description(transport_info->media_descriptions, &session_info); in_media_description = TRUE; DPRINT(("in media description, media descriptions count=%d", wmem_array_get_count(transport_info->media_descriptions))); break; case 'a': if (in_media_description) { hf = hf_media_attribute; } else { hf = hf_session_attribute; } break; default: hf = hf_unknown; break; } if (hf != hf_unknown) { DINDENT(); call_sdp_subdissector(tvb_new_subset_length(tvb, offset + tokenoffset, linelen - tokenoffset), pinfo, hf, NULL, linelen-tokenoffset, transport_info, in_media_description ? NULL : &session_info, media_desc, &sdp_data); DENDENT(); } offset = next_offset; } /* Done parsing media description, no more need for the session-level details. */ rtp_dyn_payload_free(session_info.rtp_dyn_payload); session_info.rtp_dyn_payload = NULL; /* Post-processing, close media streams, apply attributes, etc. */ complete_descriptions(transport_info, start_transport_info_count); #ifdef DEBUG_CONVERSATION sdp_dump_transport_info(pinfo, transport_info); #endif /* We have a successful negotiation, apply data to their respective protocols */ if (!delay || ((exchange_type == SDP_EXCHANGE_ANSWER_ACCEPT) && (transport_info->sdp_status == SDP_EXCHANGE_OFFER))) { /* Accepting answer to a previous offer (or delay pref is false). */ apply_sdp_transport(pinfo, transport_info, request_frame, setup_info); /* Free all media hash tables that were not assigned to a conversation * ('set_rtp' is false) */ clean_unused_media_descriptions(transport_info->media_descriptions); transport_info->sdp_status = exchange_type; } else if ((exchange_type == SDP_EXCHANGE_ANSWER_REJECT) && (transport_info->sdp_status != SDP_EXCHANGE_ANSWER_REJECT)) { /* Rejecting answer */ clean_unused_media_descriptions(transport_info->media_descriptions); transport_info->sdp_status = SDP_EXCHANGE_ANSWER_REJECT; } /* else attempt to accept an unknown offer. */ } void setup_sdp_transport_resend(int current_frame, int request_frame) { transport_info_t* transport_info = NULL; if (request_frame != 0) { transport_info = (transport_info_t*)wmem_tree_lookup32( sdp_transport_reqs, request_frame ); if (transport_info != NULL) { wmem_tree_insert32(sdp_transport_reqs, current_frame, (void *)transport_info); } } } static int dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_tree *sdp_tree; proto_item *ti, *sub_ti; gint offset = 0, next_offset, n; int linelen; gboolean in_media_description; guchar type, delim; int datalen, tokenoffset, hf = -1; char *string; sdp_data_t sdp_data; transport_info_t local_transport_info; transport_info_t* transport_info = NULL; media_description_t *media_desc = NULL; session_info_t session_info; sdp_packet_info *sdp_pi; sdp_setup_info_t *setup_info = NULL; if (data) { media_content_info_t *content_info = (media_content_info_t *)data; if (content_info->type == MEDIA_CONTAINER_SIP_DATA) { setup_info = (sdp_setup_info_t *)content_info->data; } } DPRINT2(("----------------------- dissect_sdp ------------------------")); /* Initialise packet info for passing to tap */ sdp_pi = wmem_new(pinfo->pool, sdp_packet_info); sdp_pi->summary_str[0] = '\0'; memset(&sdp_data, 0, sizeof(sdp_data)); if (!pinfo->fd->visited) { transport_info = (transport_info_t*)wmem_tree_lookup32( sdp_transport_reqs, pinfo->num ); if (transport_info == NULL) { /* Can't find it in the requests, make sure it's not a response */ transport_info = (transport_info_t*)wmem_tree_lookup32( sdp_transport_rsps, pinfo->num ); } } if (transport_info == NULL) { transport_info = &local_transport_info; } #ifdef DEBUG_CONVERSATION else { DPRINT(("found previous transport_info:")); sdp_dump_transport_info(pinfo, transport_info); } #endif /* Initialize local transport info */ memset(&local_transport_info, 0, sizeof(local_transport_info)); /* Note: packet-scoped since it is only needed while parsing this packet. */ local_transport_info.media_descriptions = wmem_array_new(pinfo->pool, sizeof(media_description_t)); for (n = 0; n < SDP_NO_OF_PT; n++) { local_transport_info.encoding_name[n] = wmem_strdup(pinfo->pool, UNKNOWN_ENCODING); } /* * As RFC 2327 says, "SDP is purely a format for session * description - it does not incorporate a transport protocol, * and is intended to use different transport protocols as * appropriate including the Session Announcement Protocol, * Session Initiation Protocol, Real-Time Streaming Protocol, * electronic mail using the MIME extensions, and the * Hypertext Transport Protocol." * * We therefore don't set the protocol or info columns; * instead, we append to them, so that we don't erase * what the protocol inside which the SDP stuff resides * put there. */ col_append_str(pinfo->cinfo, COL_PROTOCOL, "/SDP"); ti = proto_tree_add_item(tree, proto_sdp, tvb, offset, -1, ENC_NA); sdp_tree = proto_item_add_subtree(ti, ett_sdp); /* * Show the SDP message a line at a time. */ in_media_description = FALSE; /* Initialize the session description before parsing the media level. */ memset(&session_info, 0, sizeof(session_info_t)); session_info.rtp_dyn_payload = rtp_dyn_payload_new(); while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ linelen = tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset); /* * Line must contain at least e.g. "v=". */ if (linelen < 2) break; type = tvb_get_guint8(tvb, offset); delim = tvb_get_guint8(tvb, offset + 1); if (delim != '=') { proto_item *ti2 = proto_tree_add_item(sdp_tree, hf_invalid, tvb, offset, linelen, ENC_UTF_8); expert_add_info(pinfo, ti2, &ei_sdp_invalid_line_equal); offset = next_offset; continue; } /* * Attributes. */ switch (type) { case 'v': hf = hf_protocol_version; break; case 'o': hf = hf_owner; break; case 's': hf = hf_session_name; break; case 'i': if (in_media_description) { hf = hf_media_title; } else { hf = hf_session_info; } break; case 'u': hf = hf_uri; break; case 'e': hf = hf_email; break; case 'p': hf = hf_phone; break; case 'c': hf = hf_connection_info; break; case 'b': hf = hf_bandwidth; break; case 't': hf = hf_time; break; case 'r': hf = hf_repeat_time; break; case 'm': hf = hf_media; /* Try to create a new media description (it will return NULL if * there are too many). Pass local_transport_info since we do * not want to modify the transport_info that was created by * setup_sdp_transport. */ media_desc = sdp_new_media_description(local_transport_info.media_descriptions, &session_info); in_media_description = TRUE; break; case 'k': hf = hf_encryption_key; break; case 'a': if (in_media_description) { hf = hf_media_attribute; } else { hf = hf_session_attribute; } break; case 'z': hf = hf_timezone; break; default: hf = hf_unknown; break; } tokenoffset = 2; if (hf == hf_unknown) tokenoffset = 0; string = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset + tokenoffset, linelen - tokenoffset, ENC_ASCII); sub_ti = proto_tree_add_string(sdp_tree, hf, tvb, offset, linelen, string); call_sdp_subdissector(tvb_new_subset_length(tvb, offset + tokenoffset, linelen - tokenoffset), pinfo, hf, sub_ti, linelen-tokenoffset, &local_transport_info, in_media_description ? NULL : &session_info, in_media_description ? media_desc : NULL, &sdp_data); offset = next_offset; } if (NULL != sdp_data.ed137_fid) { col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", sdp_data.ed137_fid); (void) g_strlcat(sdp_pi->summary_str, sdp_data.ed137_fid, 50); } if (NULL != sdp_data.ed137_txrxmode) { col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", sdp_data.ed137_txrxmode); if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, sdp_data.ed137_txrxmode, 50); } if (NULL != sdp_data.ed137_type) { col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", sdp_data.ed137_type); if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, sdp_data.ed137_type, 50); } /* Done parsing media description, no more need for the session-level details. */ rtp_dyn_payload_free(session_info.rtp_dyn_payload); session_info.rtp_dyn_payload = NULL; /* Post-processing, close media streams, apply attributes, etc. */ if (transport_info == &local_transport_info) { DPRINT(("no previous transport_info saved, calling complete_descriptions()")); DINDENT(); complete_descriptions(transport_info, 0); DENDENT(); #ifdef DEBUG_CONVERSATION sdp_dump_transport_info(pinfo, transport_info); #endif } #ifdef DEBUG_CONVERSATION else { DPRINT(("not overwriting previous transport_info, local_transport_info contents:")); sdp_dump_transport_info(pinfo, &local_transport_info); } #endif /* For messages not part of the Offer/Answer model, assume that the SDP is * immediately effective (apply it now). */ if ((!pinfo->fd->visited) && (transport_info == &local_transport_info)) { /* XXX - This is a placeholder for higher layer protocols that haven't implemented the proper * OFFER/ANSWER functionality using setup_sdp_transport(). Once all of the higher layers * use setup_sdp_transport(), this should be removed * Note that transport_info contains the SDP info from this frame (and * not an earlier request (transport_info == &local_transport_info). * Use 0 as request_frame since there is no (known) request. */ apply_sdp_transport(pinfo, transport_info, 0, setup_info); } /* Add information to the VoIP Calls dialog. */ for (guint i = 0; i < wmem_array_get_count(local_transport_info.media_descriptions); i++) { media_desc = (media_description_t *)wmem_array_index(local_transport_info.media_descriptions, i); if (media_desc->media_port != 0) { /* Create the RTP summary str for the Voip Call analysis. * XXX - Currently this is based only on the current packet */ for (int j = 0; j < media_desc->media.pt_count; j++) { DPRINT(("in for-loop for voip call analysis setting for media #%d, pt=%d", j, media_desc->media. pt[j])); /* if the payload type is dynamic (96 to 127), check the hash table to add the desc in the SDP summary */ if ((media_desc->media.pt[j] >= 96) && (media_desc->media.pt[j] <= 127)) { const gchar *payload_type_str = rtp_dyn_payload_get_name( media_desc->media.rtp_dyn_payload, media_desc->media.pt[j]); if (payload_type_str) { if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, payload_type_str, 50); } else { char num_pt[10]; snprintf(num_pt, 10, "%u", media_desc->media.pt[j]); if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, num_pt, 50); } } else { if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, val_to_str_ext(media_desc->media.pt[j], &rtp_payload_type_short_vals_ext, "%u"), 50); } } } /* Create the T38 summary str for the Voip Call analysis * XXX - Currently this is based only on the current packet */ if ((media_desc->media_port != 0) && media_desc->proto == SDP_PROTO_T38) { if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, "t38", 50); } } /* Free all media hash tables that were not assigned to a conversation * ('set_rtp' is false) */ if (transport_info == &local_transport_info) { clean_unused_media_descriptions(transport_info->media_descriptions); } datalen = tvb_captured_length_remaining(tvb, offset); if (datalen > 0) { proto_tree_add_item(sdp_tree, hf_sdp_data, tvb, offset, datalen, ENC_NA); } /* Add Trace info */ conversation_t *sdp_conv; wmem_array_t *sdp_conv_info_list; sdp_conv = find_conversation_pinfo(pinfo, 0); if (sdp_conv) { guint i; sdp_setup_info_t *stored_setup_info; proto_item *item; sdp_conv_info_list = (wmem_array_t *)conversation_get_proto_data(sdp_conv, proto_sdp); if(sdp_conv_info_list){ for (i = 0; i < wmem_array_get_count(sdp_conv_info_list); i++) { stored_setup_info = (sdp_setup_info_t *)wmem_array_index(sdp_conv_info_list, i); if (stored_setup_info->hf_id) { if (stored_setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_STR) { item = proto_tree_add_string(sdp_tree, stored_setup_info->hf_id, tvb, 0, 0, stored_setup_info->trace_id.str); proto_item_set_generated(item); if (stored_setup_info->add_hidden == TRUE) { proto_item_set_hidden(item); } } else if (stored_setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_GUINT32) { item = proto_tree_add_uint(sdp_tree, stored_setup_info->hf_id, tvb, 0, 0, stored_setup_info->trace_id.num); proto_item_set_generated(item); if (stored_setup_info->add_hidden == TRUE) { proto_item_set_hidden(item); } } } } } } /* Report this packet to the tap */ tap_queue_packet(sdp_tap, pinfo, sdp_pi); return tvb_captured_length(tvb); } void proto_register_sdp(void) { static hf_register_info hf[] = { { &hf_protocol_version, { "Session Description Protocol Version (v)", "sdp.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner, { "Owner/Creator, Session Id (o)", "sdp.owner", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_session_name, { "Session Name (s)", "sdp.session_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_session_info, { "Session Information (i)", "sdp.session_info", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uri, { "URI of Description (u)", "sdp.uri", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_email, { "E-mail Address (e)", "sdp.email", FT_STRING, BASE_NONE, NULL, 0x0, "E-mail Address", HFILL } }, { &hf_phone, { "Phone Number (p)", "sdp.phone", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connection_info, { "Connection Information (c)", "sdp.connection_info", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_bandwidth, { "Bandwidth Information (b)", "sdp.bandwidth", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_timezone, { "Time Zone Adjustments (z)", "sdp.timezone", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_encryption_key, { "Encryption Key (k)", "sdp.encryption_key", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_session_attribute, { "Session Attribute (a)", "sdp.session_attr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_attribute, { "Media Attribute (a)", "sdp.media_attr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_time, { "Time Description, active time (t)", "sdp.time", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_repeat_time, { "Repeat Time (r)", "sdp.repeat_time", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media, { "Media Description, name and address (m)", "sdp.media", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_title, { "Media Title (i)", "sdp.media_title", FT_STRING, BASE_NONE, NULL, 0x0, "Media Title", HFILL } }, { &hf_unknown, { "Unknown", "sdp.unknown", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_invalid, { "Invalid line", "sdp.invalid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner_username, { "Owner Username", "sdp.owner.username", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner_sessionid, { "Session ID", "sdp.owner.sessionid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner_version, { "Session Version", "sdp.owner.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner_network_type, { "Owner Network Type", "sdp.owner.network_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner_address_type, { "Owner Address Type", "sdp.owner.address_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_owner_address, { "Owner Address", "sdp.owner.address", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connection_info_network_type, { "Connection Network Type", "sdp.connection_info.network_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connection_info_address_type, { "Connection Address Type", "sdp.connection_info.address_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connection_info_connection_address, { "Connection Address", "sdp.connection_info.address", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connection_info_ttl, { "Connection TTL", "sdp.connection_info.ttl", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connection_info_num_addr, { "Connection Number of Addresses", "sdp.connection_info.num_addr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_bandwidth_modifier, { "Bandwidth Modifier", "sdp.bandwidth.modifier", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_bandwidth_value, { "Bandwidth Value", "sdp.bandwidth.value", FT_STRING, BASE_NONE, NULL, 0x0, "Bandwidth Value (in kbits/s)", HFILL } }, { &hf_time_start, { "Session Start Time", "sdp.time.start", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_time_stop, { "Session Stop Time", "sdp.time.stop", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_repeat_time_interval, { "Repeat Interval", "sdp.repeat_time.interval", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_repeat_time_duration, { "Repeat Duration", "sdp.repeat_time.duration", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_repeat_time_offset, { "Repeat Offset", "sdp.repeat_time.offset", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_timezone_time, { "Timezone Time", "sdp.timezone.time", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_timezone_offset, { "Timezone Offset", "sdp.timezone.offset", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_encryption_key_type, { "Key Type", "sdp.encryption_key.type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_encryption_key_data, { "Key Data", "sdp.encryption_key.data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_session_attribute_field, { "Session Attribute Fieldname", "sdp.session_attr.field", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_session_attribute_value, { "Session Attribute Value", "sdp.session_attr.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_media, { "Media Type", "sdp.media.media", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_port, { "Media Port", "sdp.media.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_media_port_string, { "Media Port", "sdp.media.port_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_portcount, { "Media Port Count", "sdp.media.portcount", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_proto, { "Media Protocol", "sdp.media.proto", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_format, { "Media Format", "sdp.media.format", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_attribute_field, { "Media Attribute Fieldname", "sdp.media_attribute.field", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_attribute_value, { "Media Attribute Value", "sdp.media_attribute.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_encoding_name, { "MIME Type", "sdp.mime.type", FT_STRING, BASE_NONE, NULL, 0x0, "SDP MIME Type", HFILL } }, { &hf_media_sample_rate, { "Sample Rate", "sdp.sample_rate", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_channels, { "Audio Channels", "sdp.channels", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_media_format_specific_parameter, { "Media format specific parameters", "sdp.fmtp.parameter", FT_STRING, BASE_NONE, NULL, 0x0, "Format specific parameter(fmtp)", HFILL } }, { &hf_ipbcp_version, { "IPBCP Protocol Version", "sdp.ipbcp.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ipbcp_type, { "IPBCP Command Type", "sdp.ipbcp.command", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_sdp_fmtp_mpeg4_profile_level_id, { "Level Code", "sdp.fmtp.profile_level_id", FT_UINT32, BASE_DEC, VALS(mp4ves_level_indication_vals), 0x0, NULL, HFILL } }, { &hf_sdp_fmtp_h263_profile, { "Profile", "sdp.fmtp.h263profile", FT_UINT32, BASE_DEC, VALS(h263_profile_vals), 0x0, NULL, HFILL } }, { &hf_sdp_fmtp_h263_level, { "Level", "sdp.fmtp.h263level", FT_UINT32, BASE_DEC, VALS(h263_level_vals), 0x0, NULL, HFILL } }, { &hf_sdp_h264_packetization_mode, { "Packetization mode", "sdp.fmtp.h264_packetization_mode", FT_UINT32, BASE_DEC, VALS(h264_packetization_mode_vals), 0x0, NULL, HFILL } }, { &hf_SDPh223LogicalChannelParameters, { "h223LogicalChannelParameters", "sdp.h223LogicalChannelParameters", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_key_mgmt_att_value, { "Key Management", "sdp.key_mgmt", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_key_mgmt_prtcl_id, { "Key Management Protocol (kmpid)", "sdp.key_mgmt.kmpid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_key_mgmt_data, { "Key Management Data", "sdp.key_mgmt.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_tag, { "tag", "sdp.crypto.tag", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_crypto_suite, { "Crypto suite", "sdp.crypto.crypto_suite", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_master_key, { "Master Key", "sdp.crypto.master_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_master_salt, { "Master salt", "sdp.crypto.master_salt", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_lifetime, { "Lifetime", "sdp.crypto.lifetime", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_mki, { "mki-value", "sdp.crypto.mki-valu", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sdp_crypto_mki_length, { "mki_length", "sdp.crypto.mki_length", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ice_candidate_foundation, { "Foundation", "sdp.ice_candidate.foundation", FT_STRING, BASE_NONE, NULL, 0x0, "Identifier, same for two candidates with same type, base address, protocol and STUN server", HFILL } }, { &hf_ice_candidate_componentid, { "Component ID", "sdp.ice_candidate.componentid", FT_STRING, BASE_NONE, NULL, 0x0, "Media component identifier (For RTP media, 1 is RTP, 2 is RTCP)", HFILL } }, { &hf_ice_candidate_transport, { "Transport", "sdp.ice_candidate.transport", FT_STRING, BASE_NONE, NULL, 0x0, "Transport protocol", HFILL } }, { &hf_ice_candidate_priority, { "Priority", "sdp.ice_candidate.priority", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ice_candidate_address, { "Connection Address", "sdp.ice_candidate.address", FT_STRING, BASE_NONE, NULL, 0x0, "IP address or FQDN of the candidate", HFILL } }, { &hf_ice_candidate_port, { "Candidate Port", "sdp.ice_candidate.port", FT_STRING, BASE_NONE, NULL, 0x0, "Port of the candidate", HFILL } }, { &hf_ice_candidate_type, { "Candidate Type", "sdp.ice_candidate.type", FT_STRING, BASE_NONE, NULL, 0x0, "The origin of the address and port, i.e. where it was learned", HFILL } }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_sdp_nal_unit_1_string, { "NAL unit 1 string", "sdp.nal_unit_1_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sdp_nal_unit_2_string, { "NAL unit 2 string", "sdp.nal_unit_2_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sdp_key_and_salt, { "Key and Salt", "sdp.key_and_salt", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sdp_data, { "Data", "sdp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_sdp, &ett_sdp_owner, &ett_sdp_connection_info, &ett_sdp_bandwidth, &ett_sdp_time, &ett_sdp_repeat_time, &ett_sdp_timezone, &ett_sdp_encryption_key, &ett_sdp_session_attribute, &ett_sdp_media, &ett_sdp_media_attribute, &ett_sdp_fmtp, &ett_sdp_key_mgmt, &ett_sdp_crypto_key_parameters, }; static ei_register_info ei[] = { { &ei_sdp_invalid_key_param, { "sdp.invalid_key_param", PI_MALFORMED, PI_NOTE, "Invalid key-param (no ':' delimiter)", EXPFILL } }, { &ei_sdp_invalid_line_equal, { "sdp.invalid_line.no_equal", PI_MALFORMED, PI_NOTE, "Invalid SDP line (no '=' delimiter)", EXPFILL } }, { &ei_sdp_invalid_line_fields, { "sdp.invalid_line.missing_fields", PI_MALFORMED, PI_ERROR, "Invalid SDP line (missing required fields)", EXPFILL } }, { &ei_sdp_invalid_line_space, { "sdp.invalid_line.extra_space", PI_MALFORMED, PI_ERROR, "Invalid SDP whitespace (extra space character)", EXPFILL } }, { &ei_sdp_invalid_conversion, { "sdp.invalid_conversion", PI_PROTOCOL, PI_WARN, "Invalid conversion", EXPFILL } }, { &ei_sdp_invalid_media_port, { "sdp.invalid_media_port", PI_MALFORMED, PI_ERROR, "Invalid media port", EXPFILL } }, { &ei_sdp_invalid_sample_rate, { "sdp.invalid_sample_rate", PI_MALFORMED, PI_ERROR, "Invalid sample rate", EXPFILL } }, { &ei_sdp_invalid_channels, { "sdp.invalid_channels", PI_MALFORMED, PI_WARN, "Invalid number of audio channels", EXPFILL } }, { &ei_sdp_invalid_media_format, { "sdp.invalid_media_format", PI_MALFORMED, PI_ERROR, "Invalid media format", EXPFILL } }, { &ei_sdp_invalid_crypto_tag, { "sdp.invalid_crypto_tag", PI_MALFORMED, PI_ERROR, "Invalid crypto tag", EXPFILL } }, { &ei_sdp_invalid_crypto_mki_length, { "sdp.invalid_crypto_mki_length", PI_MALFORMED, PI_ERROR, "Invalid crypto mki length", EXPFILL } } }; module_t *sdp_module; expert_module_t* expert_sdp; proto_sdp = proto_register_protocol("Session Description Protocol", "SDP", "sdp"); proto_register_field_array(proto_sdp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sdp = expert_register_protocol(proto_sdp); expert_register_field_array(expert_sdp, ei, array_length(ei)); key_mgmt_dissector_table = register_dissector_table("key_mgmt", "Key Management", proto_sdp, FT_STRING, STRING_CASE_SENSITIVE); /* * Preferences registration */ sdp_module = prefs_register_protocol(proto_sdp, NULL); prefs_register_bool_preference(sdp_module, "establish_conversation", "Establish Media Conversation", "Specifies that RTP/RTCP/T.38/MSRP/etc streams are decoded based " "upon port numbers found in SDP payload", &global_sdp_establish_conversation); sdp_transport_reqs = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); sdp_transport_rsps = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* * Register the dissector by name, so other dissectors can * grab it by name rather than just referring to it directly. */ sdp_handle = register_dissector("sdp", dissect_sdp, proto_sdp); /* Register for tapping */ sdp_tap = register_tap("sdp"); /* compile patterns */ ws_mempbrk_compile(&pbrk_digits, "0123456789"); ws_mempbrk_compile(&pbrk_alpha, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); } void proto_reg_handoff_sdp(void) { rtcp_handle = find_dissector_add_dependency("rtcp", proto_sdp); msrp_handle = find_dissector_add_dependency("msrp", proto_sdp); sprt_handle = find_dissector_add_dependency("sprt", proto_sdp); bfcp_handle = find_dissector_add_dependency("bfcp", proto_sdp); h264_handle = find_dissector_add_dependency("h264", proto_sdp); h265_handle = find_dissector_add_dependency("h265", proto_sdp); mp4ves_config_handle = find_dissector_add_dependency("mp4ves_config", proto_sdp); proto_sprt = dissector_handle_get_protocol_index(find_dissector("sprt")); dissector_add_string("media_type", "application/sdp", sdp_handle); dissector_add_uint("bctp.tpi", 0x20, sdp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-sdp.h
/* packet-sdp.h * Routines for SDP packet disassembly (RFC 2327) * * Jason Lango <[email protected]> * Liberally copied from packet-http.c, by Guy Harris <[email protected]> * 2005 Alejandro Vaquero <[email protected]>, add support for tap * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SDP_H__ #define __PACKET_SDP_H__ typedef struct _sdp_packet_info { gchar summary_str[50]; /* SDP summary string for VoIP calls graph analysis */ } sdp_packet_info; enum sdp_exchange_type { SDP_EXCHANGE_OFFER = 0, SDP_EXCHANGE_ANSWER_ACCEPT, SDP_EXCHANGE_ANSWER_REJECT }; enum sdp_trace_id_hf_type { SDP_TRACE_ID_HF_TYPE_STR = 0, /* */ SDP_TRACE_ID_HF_TYPE_GUINT32 /* */ }; /* * Information needed to set up a trace id in RTP(t ex SIP CallId ) */ #define SDP_INFO_OFFSET 10 /* Max number of SDP data occurensies in a single frame */ typedef struct _sdp_conv_info { wmem_array_t *sdp_setup_info_list; } sdp_conv_info_t; typedef struct _sdp_setup_info { int hf_id; /* Header field to use */ enum sdp_trace_id_hf_type hf_type; /* Indicates which of the following variables to use( add guint32 etc as needed)*/ gboolean add_hidden; union { gchar *str; /* The trace id if the hf_type is str */ guint32 num; /* Numerical trace id */ } trace_id; } sdp_setup_info_t; extern void setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type type, int request_frame, const gboolean delay, sdp_setup_info_t *setup_info); /* Handles duplicate OFFER packets so they don't end up processed by dissect_sdp(). This can probably * be removed when all higher layer dissectors properly handle SDP themselves with setup_sdp_transport() */ extern void setup_sdp_transport_resend(int current_frame, int request_frame); #endif /* __PACKET_SDP_H__ */
C
wireshark/epan/dissectors/packet-sebek.c
/* packet-sebek.c * Routines for Sebek - Kernel based data capture - packet dissection * Modified to add sebek V3 * Copyright 2006, Camilo Viecco <[email protected]> * Copyright 1999, Nathan Neulinger <[email protected]> * * See: http://project.honeynet.org/tools/sebek/ for more details * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <math.h> #include <epan/packet.h> /* Sebek v2: IP address: 32bit unsigned MAGIC Val: 32bit unsigned Sebek Ver: 16bit unsigned #value must match 2 Type 16bit unsigned Counter: 32bit unsigned Time_sec: 32bit unsigned Time_usec: 32bit unsigned Proc ID: 32bit unsigned User ID: 32bit unsigned File Desc: 32bit unsigned Command: 12char array Length: Data Length Data: Variable Length data Sebek v3 header IP address: 32bit unsigned MAGIC Val: 32bit unsigned Sebek Ver: 16bit unsigned #value must match 3 Type 16bit unsigned Counter: 32bit unsigned Time_sec: 32bit unsigned Time_usec: 32bit unsigned Parent_pid: 32bit unsigned Proc ID: 32bit unsigned User ID: 32bit unsigned File Desc: 32bit unsigned inode: 32bit unsigned Command: 12char array Length: Data Length Data: Variable data length Sebekv3 has a sock_socket_record subheader for IPV4: Dest_ip: 32bit unsigned Dest_port: 16bit unsigned Src_ip: 32bit unsigned src_port: 16bit unsigned call: 16bit unsigned proto 8bit unsigned */ /* By default, but can be completely different */ #define UDP_PORT_SEBEK 1101 /* Not IANA registered */ void proto_register_sebek(void); void proto_reg_handoff_sebek(void); static int proto_sebek = -1; static int hf_sebek_magic = -1; static int hf_sebek_version = -1; static int hf_sebek_type = -1; static int hf_sebek_counter = -1; static int hf_sebek_time = -1; static int hf_sebek_pid = -1; static int hf_sebek_uid = -1; static int hf_sebek_fd = -1; static int hf_sebek_cmd = -1; static int hf_sebek_len = -1; static int hf_sebek_data = -1; static int hf_sebek_ppid = -1; static int hf_sebek_inode = -1; static int hf_sebek_socket_src_ip=-1; static int hf_sebek_socket_src_port=-1; static int hf_sebek_socket_dst_ip=-1; static int hf_sebek_socket_dst_port=-1; static int hf_sebek_socket_call=-1; static int hf_sebek_socket_proto=-1; static gint ett_sebek = -1; /* dissect_sebek - dissects sebek packet data * tvb - tvbuff for packet data (IN) * pinfo - packet info * proto_tree - resolved protocol tree */ static int dissect_sebek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_tree *sebek_tree; proto_item *ti; int offset = 0; int sebek_ver = 0; int sebek_type = 0; int cmd_len = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SEBEK"); col_set_str(pinfo->cinfo, COL_INFO, "SEBEK - "); if (tvb_captured_length(tvb)<6) sebek_ver = 0; else sebek_ver = tvb_get_ntohs(tvb, 4); switch (sebek_ver) { case 2: col_append_fstr(pinfo->cinfo, COL_INFO, " pid(%d)", tvb_get_ntohl(tvb, 20)); col_append_fstr(pinfo->cinfo, COL_INFO, " uid(%d)", tvb_get_ntohl(tvb, 24)); col_append_fstr(pinfo->cinfo, COL_INFO, " fd(%d)", tvb_get_ntohl(tvb, 28)); col_append_fstr(pinfo->cinfo, COL_INFO, " cmd: %s", tvb_format_text(pinfo->pool, tvb, 32, 12)); break; case 3: col_append_fstr(pinfo->cinfo, COL_INFO, " pid(%d)", tvb_get_ntohl(tvb, 24)); col_append_fstr(pinfo->cinfo, COL_INFO, " uid(%d)", tvb_get_ntohl(tvb, 28)); col_append_fstr(pinfo->cinfo, COL_INFO, " fd(%d)", tvb_get_ntohl(tvb, 32)); cmd_len = tvb_strnlen(tvb, 40, 12); if (cmd_len<0) cmd_len = 0; col_append_fstr(pinfo->cinfo, COL_INFO, " cmd: %s", tvb_format_text(pinfo->pool, tvb, 40, cmd_len)); break; default: break; } if (tree) { /* Adding Sebek item and subtree */ ti = proto_tree_add_item(tree, proto_sebek, tvb, 0, -1, ENC_NA); sebek_tree = proto_item_add_subtree(ti, ett_sebek); /* check for minimum length before deciding where to go*/ if (tvb_captured_length(tvb)<6) sebek_ver = 0; else sebek_ver = tvb_get_ntohs(tvb, 4); switch (sebek_ver) { case 2: proto_tree_add_item(sebek_tree, hf_sebek_magic, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sebek_tree, hf_sebek_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sebek_tree, hf_sebek_counter, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_time, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(sebek_tree, hf_sebek_pid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_uid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_fd, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_cmd, tvb, offset, 12, ENC_ASCII); offset += 12; proto_tree_add_item(sebek_tree, hf_sebek_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_data, tvb, offset, -1, ENC_ASCII); break; case 3: proto_tree_add_item(sebek_tree, hf_sebek_magic, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; sebek_type=tvb_get_ntohs(tvb, offset); proto_tree_add_item(sebek_tree, hf_sebek_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sebek_tree, hf_sebek_counter, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_time, tvb, offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(sebek_tree, hf_sebek_ppid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_pid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_uid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_fd, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_inode, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_cmd, tvb, offset, 12, ENC_ASCII); offset += 12; proto_tree_add_item(sebek_tree, hf_sebek_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (sebek_type == 2) { /*data is socket data, process accordingly*/ proto_tree_add_item(sebek_tree, hf_sebek_socket_dst_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_socket_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sebek_tree, hf_sebek_socket_src_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sebek_tree, hf_sebek_socket_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sebek_tree, hf_sebek_socket_call, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sebek_tree, hf_sebek_socket_proto, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } else { proto_tree_add_item(sebek_tree, hf_sebek_data, tvb, offset, -1, ENC_ASCII); } break; default: break; } } return offset; } void proto_register_sebek(void) { static hf_register_info hf[] = { { &hf_sebek_magic, { "Magic", "sebek.magic", FT_UINT32, BASE_HEX, NULL, 0, "Magic Number", HFILL }}, { &hf_sebek_version, { "Version", "sebek.version", FT_UINT16, BASE_DEC, NULL, 0, "Version Number", HFILL }}, { &hf_sebek_type, { "Type", "sebek.type", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sebek_counter, { "Counter", "sebek.counter", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sebek_time, { "Time", "sebek.time.sec", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }}, { &hf_sebek_pid, { "Process ID", "sebek.pid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sebek_uid, { "User ID", "sebek.uid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sebek_fd, { "File Descriptor", "sebek.fd", FT_UINT32, BASE_DEC, NULL, 0, "File Descriptor Number", HFILL }}, { &hf_sebek_cmd, { "Command Name", "sebek.cmd", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sebek_len, { "Data Length", "sebek.len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_sebek_ppid, { "Parent Process ID", "sebek.ppid", FT_UINT32, BASE_DEC, NULL, 0, "Process ID", HFILL }}, { &hf_sebek_inode, { "Inode ID", "sebek.inode", FT_UINT32, BASE_DEC, NULL, 0, "Process ID", HFILL }}, { &hf_sebek_data, { "Data", "sebek.data", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_sebek_socket_src_ip, { "Socket.local_ip", "sebek.socket.src_ip", FT_IPv4, BASE_NONE, NULL, 0, "Socket.src_ip", HFILL }}, { &hf_sebek_socket_src_port, { "Socket.local_port", "sebek.socket.src_port", FT_UINT16, BASE_DEC, NULL, 0, "Socket.src_port", HFILL }}, { &hf_sebek_socket_dst_ip, { "Socket.remote_ip", "sebek.socket.dst_ip", FT_IPv4, BASE_NONE, NULL, 0, "Socket.dst_ip", HFILL }}, { &hf_sebek_socket_dst_port, { "Socket.remote_port", "sebek.socket.dst_port", FT_UINT16, BASE_DEC, NULL, 0, "Socket.dst_port", HFILL }}, { &hf_sebek_socket_call, { "Socket.Call_id", "sebek.socket.call", FT_UINT16, BASE_DEC, NULL, 0, "Socket.call", HFILL }}, { &hf_sebek_socket_proto, { "Socket.ip_proto", "sebek.socket.ip_proto", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }} }; static gint *ett[] = { &ett_sebek }; proto_sebek = proto_register_protocol("SEBEK - Kernel Data Capture", "SEBEK", "sebek"); proto_register_field_array(proto_sebek, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_sebek(void) { dissector_handle_t sebek_handle; sebek_handle = create_dissector_handle(dissect_sebek, proto_sebek); dissector_add_uint_with_preference("udp.port", UDP_PORT_SEBEK, sebek_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-selfm.c
/* packet-selfm.c * Routines for Schweitzer Engineering Laboratories (SEL) Protocols Dissection * By Chris Bontje (cbontje[AT]gmail.com * Copyright 2012-2021, * ************************************************************************************************ * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * ************************************************************************************************ * Schweitzer Engineering Labs ("SEL") manufactures and sells digital protective relay equipment * for use in industrial high-voltage installations. SEL Protocol evolved over time as a * (semi)proprietary method for auto-configuration of connected SEL devices for retrieval of * analog and digital status data. The protocol itself supports embedded binary messages * (which are what this dissector looks for) slip-streamed in the data stream with normal * ASCII text data. A combination of both are used for full auto-configuration of devices, * but a wealth of information can be extracted from the binary messages alone. * * 'SEL Protocol' encompasses several message types, including * - Fast Meter * - Fast Operate * - Fast SER * - Fast Message * * Documentation on Fast Meter and Fast Message standards available from www.selinc.com in * SEL Application Guides AG95-10_20091109.pdf and AG_200214.pdf ************************************************************************************************ * Dissector Notes: * * 1) All SEL Protocol messages over TCP are normally tunneled via a Telnet connection. As Telnet * has special handling for the 0xFF character ("IAC"), normally a pair of 0xFF's are inserted * to represent an actual payload byte of 0xFF. A function from the packet-telnet.c dissector has * been borrowed to automatically pre-process any Ethernet-based packet and remove these 'extra' * 0xFF bytes. Wireshark Notes on Telnet 0xFF doubling are discussed here: * https://www.wireshark.org/lists/wireshark-bugs/201204/msg00198.html * * 2) The auto-configuration process for Fast Meter will exchange several "configuration" messages * that describe various data regions (METER, DEMAND, PEAK, etc) that will later have corresponding * "data" messages. This dissector code will currently save and accurately retrieve the 3 sets * of these exchanges: * 0xA5C1, 0xA5D1, "METER" region * 0xA5C2, 0xA5D2, "DEMAND" region * 0xA5C3, 0xA5D3, "PEAK" region * The configuration messages are stored in structs that are managed using the wmem library and * the Wireshark conversation functionality. */ #include "config.h" #include <epan/packet.h> #include "packet-tcp.h" #include <epan/prefs.h> #include <epan/to_str.h> #include <epan/strutil.h> #include <epan/reassemble.h> #include <epan/expert.h> #include <epan/crc16-tvb.h> #include <epan/proto_data.h> void proto_register_selfm(void); /* Initialize the protocol and registered fields */ static int proto_selfm = -1; static int hf_selfm_msgtype = -1; static int hf_selfm_padbyte = -1; static int hf_selfm_checksum = -1; static int hf_selfm_relaydef_len = -1; static int hf_selfm_relaydef_numproto = -1; static int hf_selfm_relaydef_numfm = -1; static int hf_selfm_relaydef_numflags = -1; static int hf_selfm_relaydef_fmcfg_cmd = -1; static int hf_selfm_relaydef_fmdata_cmd = -1; static int hf_selfm_relaydef_statbit = -1; static int hf_selfm_relaydef_statbit_cmd = -1; static int hf_selfm_relaydef_proto = -1; static int hf_selfm_fmconfig_len = -1; static int hf_selfm_fmconfig_numflags = -1; static int hf_selfm_fmconfig_loc_sf = -1; static int hf_selfm_fmconfig_num_sf = -1; static int hf_selfm_fmconfig_num_ai = -1; static int hf_selfm_fmconfig_num_samp = -1; static int hf_selfm_fmconfig_num_dig = -1; static int hf_selfm_fmconfig_num_calc = -1; static int hf_selfm_fmconfig_ofs_ai = -1; static int hf_selfm_fmconfig_ofs_ts = -1; static int hf_selfm_fmconfig_ofs_dig = -1; static int hf_selfm_fmconfig_ai_type = -1; static int hf_selfm_fmconfig_ai_sf_type = -1; static int hf_selfm_fmconfig_ai_sf_ofs = -1; static int hf_selfm_fmconfig_cblk_rot = -1; static int hf_selfm_fmconfig_cblk_vconn = -1; static int hf_selfm_fmconfig_cblk_iconn = -1; static int hf_selfm_fmconfig_cblk_ctype = -1; static int hf_selfm_fmconfig_cblk_deskew_ofs = -1; static int hf_selfm_fmconfig_cblk_rs_ofs = -1; static int hf_selfm_fmconfig_cblk_xs_ofs = -1; static int hf_selfm_fmconfig_cblk_ia_idx = -1; static int hf_selfm_fmconfig_cblk_ib_idx = -1; static int hf_selfm_fmconfig_cblk_ic_idx = -1; static int hf_selfm_fmconfig_cblk_va_idx = -1; static int hf_selfm_fmconfig_cblk_vb_idx = -1; static int hf_selfm_fmconfig_cblk_vc_idx = -1; static int hf_selfm_fmconfig_ai_sf_float = -1; static int hf_selfm_fmdata_len = -1; static int hf_selfm_fmdata_flagbyte = -1; static int hf_selfm_fmdata_dig_b0 = -1; static int hf_selfm_fmdata_dig_b1 = -1; static int hf_selfm_fmdata_dig_b2 = -1; static int hf_selfm_fmdata_dig_b3 = -1; static int hf_selfm_fmdata_dig_b4 = -1; static int hf_selfm_fmdata_dig_b5 = -1; static int hf_selfm_fmdata_dig_b6 = -1; static int hf_selfm_fmdata_dig_b7 = -1; static int hf_selfm_fmdata_ai_sf_fp = -1; static int hf_selfm_foconfig_len = -1; static int hf_selfm_foconfig_num_brkr = -1; static int hf_selfm_foconfig_num_rb = -1; static int hf_selfm_foconfig_prb_supp = -1; static int hf_selfm_foconfig_reserved = -1; static int hf_selfm_foconfig_brkr_open = -1; static int hf_selfm_foconfig_brkr_close = -1; static int hf_selfm_foconfig_rb_cmd = -1; static int hf_selfm_fastop_len = -1; static int hf_selfm_fastop_rb_code = -1; static int hf_selfm_fastop_br_code = -1; static int hf_selfm_fastop_valid = -1; static int hf_selfm_alt_foconfig_len = -1; static int hf_selfm_alt_foconfig_num_ports = -1; static int hf_selfm_alt_foconfig_num_brkr = -1; static int hf_selfm_alt_foconfig_num_rb = -1; static int hf_selfm_alt_foconfig_funccode = -1; static int hf_selfm_alt_fastop_len = -1; static int hf_selfm_alt_fastop_code = -1; static int hf_selfm_alt_fastop_valid = -1; static int hf_selfm_fastmsg_len = -1; static int hf_selfm_fastmsg_routing_addr = -1; static int hf_selfm_fastmsg_status = -1; static int hf_selfm_fastmsg_funccode = -1; static int hf_selfm_fastmsg_response_code = -1; static int hf_selfm_fastmsg_seq = -1; static int hf_selfm_fastmsg_seq_fir = -1; static int hf_selfm_fastmsg_seq_fin = -1; static int hf_selfm_fastmsg_seq_cnt = -1; static int hf_selfm_fastmsg_resp_num = -1; static int hf_selfm_fastmsg_crc16 = -1; static int hf_selfm_fastmsg_def_route_sup = -1; static int hf_selfm_fastmsg_def_rx_stat = -1; static int hf_selfm_fastmsg_def_tx_stat = -1; static int hf_selfm_fastmsg_def_rx_maxfr = -1; static int hf_selfm_fastmsg_def_tx_maxfr = -1; static int hf_selfm_fastmsg_def_rx_num_fc = -1; static int hf_selfm_fastmsg_def_rx_fc = -1; static int hf_selfm_fastmsg_def_tx_num_fc = -1; static int hf_selfm_fastmsg_def_tx_fc = -1; static int hf_selfm_fastmsg_uns_en_fc = -1; static int hf_selfm_fastmsg_uns_en_fc_data = -1; static int hf_selfm_fastmsg_uns_dis_fc = -1; static int hf_selfm_fastmsg_uns_dis_fc_data = -1; static int hf_selfm_fastmsg_baseaddr = -1; static int hf_selfm_fastmsg_numwords = -1; static int hf_selfm_fastmsg_flags = -1; static int hf_selfm_fastmsg_datafmt_resp_numitem = -1; static int hf_selfm_fastmsg_dataitem_qty = -1; static int hf_selfm_fastmsg_dataitem_type = -1; static int hf_selfm_fastmsg_dataitem_uint16 = -1; static int hf_selfm_fastmsg_dataitem_int16 = -1; static int hf_selfm_fastmsg_dataitem_uint32 = -1; static int hf_selfm_fastmsg_dataitem_int32 = -1; static int hf_selfm_fastmsg_dataitem_float = -1; static int hf_selfm_fastmsg_devdesc_num_region = -1; static int hf_selfm_fastmsg_devdesc_num_ctrl = -1; static int hf_selfm_fastmsg_unsresp_orig = -1; static int hf_selfm_fastmsg_unsresp_doy = -1; static int hf_selfm_fastmsg_unsresp_year = -1; static int hf_selfm_fastmsg_unsresp_todms = -1; static int hf_selfm_fastmsg_unsresp_num_elmt = -1; static int hf_selfm_fastmsg_unsresp_elmt_idx = -1; static int hf_selfm_fastmsg_unsresp_elmt_ts_ofs = -1; static int hf_selfm_fastmsg_unsresp_elmt_status = -1; static int hf_selfm_fastmsg_unsresp_eor = -1; static int hf_selfm_fastmsg_unsresp_elmt_statword = -1; static int hf_selfm_fastmsg_unswrite_addr1 = -1; static int hf_selfm_fastmsg_unswrite_addr2 = -1; static int hf_selfm_fastmsg_unswrite_num_reg = -1; static int hf_selfm_fastmsg_unswrite_reg_val = -1; static int hf_selfm_fastmsg_soe_req_orig = -1; static int hf_selfm_fastmsg_soe_resp_numblks = -1; static int hf_selfm_fastmsg_soe_resp_orig = -1; static int hf_selfm_fastmsg_soe_resp_numbits = -1; static int hf_selfm_fastmsg_soe_resp_pad = -1; static int hf_selfm_fastmsg_soe_resp_doy = -1; static int hf_selfm_fastmsg_soe_resp_year = -1; static int hf_selfm_fastmsg_soe_resp_tod = -1; static int hf_selfm_fastmsg_soe_resp_data = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_selfm_fmconfig_ai_channel = -1; static int hf_selfm_fmdata_ai_value16 = -1; static int hf_selfm_fmdata_ai_scale_factor = -1; static int hf_selfm_fmdata_ai_value_float = -1; static int hf_selfm_fmdata_ai_value_double = -1; static int hf_selfm_fmdata_data_type = -1; static int hf_selfm_fmdata_quantity = -1; static int hf_selfm_fmdata_ai_value_string = -1; static int hf_selfm_fastmsg_unsresp_elmt_ts_ofs_decoded = -1; static int hf_selfm_fid = -1; static int hf_selfm_rid = -1; static int hf_selfm_fastmsg_data_region_name = -1; static int hf_selfm_fmdata_timestamp = -1; static int hf_selfm_fmdata_frame_data_format_reference = -1; static int hf_selfm_fastmsg_bit_label_name = -1; /* Initialize the subtree pointers */ static gint ett_selfm = -1; static gint ett_selfm_relaydef = -1; static gint ett_selfm_relaydef_fm = -1; static gint ett_selfm_relaydef_proto = -1; static gint ett_selfm_relaydef_flags = -1; static gint ett_selfm_fmconfig = -1; static gint ett_selfm_fmconfig_ai = -1; static gint ett_selfm_fmconfig_calc = -1; static gint ett_selfm_foconfig = -1; static gint ett_selfm_foconfig_brkr = -1; static gint ett_selfm_foconfig_rb = -1; static gint ett_selfm_fastop = -1; static gint ett_selfm_fmdata = -1; static gint ett_selfm_fmdata_ai = -1; static gint ett_selfm_fmdata_dig = -1; static gint ett_selfm_fmdata_ai_ch = -1; static gint ett_selfm_fmdata_dig_ch = -1; static gint ett_selfm_fastmsg = -1; static gint ett_selfm_fastmsg_seq = -1; static gint ett_selfm_fastmsg_def_fc = -1; static gint ett_selfm_fastmsg_datareg = -1; static gint ett_selfm_fastmsg_soeblk = -1; static gint ett_selfm_fastmsg_tag = -1; static gint ett_selfm_fastmsg_element_list = -1; static gint ett_selfm_fastmsg_element = -1; /* Expert fields */ static expert_field ei_selfm_crc16_incorrect = EI_INIT; static dissector_handle_t selfm_handle; #define CMD_FAST_MSG 0xA546 #define CMD_CLEAR_STATBIT 0xA5B9 #define CMD_RELAY_DEF 0xA5C0 #define CMD_FM_CONFIG 0xA5C1 #define CMD_DFM_CONFIG 0xA5C2 #define CMD_PDFM_CONFIG 0xA5C3 #define CMD_FASTOP_RESETDEF 0xA5CD #define CMD_FASTOP_CONFIG 0xA5CE #define CMD_ALT_FASTOP_CONFIG 0xA5CF #define CMD_FM_DATA 0xA5D1 #define CMD_DFM_DATA 0xA5D2 #define CMD_PDFM_DATA 0xA5D3 #define CMD_FASTOP_RB_CTRL 0xA5E0 #define CMD_FASTOP_BR_CTRL 0xA5E3 #define CMD_ALT_FASTOP_OPEN 0xA5E5 #define CMD_ALT_FASTOP_CLOSE 0xA5E6 #define CMD_ALT_FASTOP_SET 0xA5E7 #define CMD_ALT_FASTOP_CLEAR 0xA5E8 #define CMD_ALT_FASTOP_PULSE 0xA5E9 #define CMD_FASTOP_RESET 0xA5ED #define FM_CONFIG_SF_LOC_FM 0 #define FM_CONFIG_SF_LOC_CFG 1 #define FM_CONFIG_ANA_CHNAME_LEN 6 #define FM_CONFIG_ANA_CHTYPE_INT16 0x00 #define FM_CONFIG_ANA_CHTYPE_FP 0x01 #define FM_CONFIG_ANA_CHTYPE_FPD 0x02 #define FM_CONFIG_ANA_CHTYPE_TS 0x03 #define FM_CONFIG_ANA_CHTYPE_TS_LEN 8 #define FM_CONFIG_ANA_SFTYPE_INT16 0x00 #define FM_CONFIG_ANA_SFTYPE_FP 0x01 #define FM_CONFIG_ANA_SFTYPE_FPD 0x02 #define FM_CONFIG_ANA_SFTYPE_TS 0x03 #define FM_CONFIG_ANA_SFTYPE_NONE 0xFF /* Fast Message Function Codes, "response" or "ACK" messages are the same as the request, but have the MSB set */ #define FAST_MSG_CFG_BLOCK 0x00 #define FAST_MSG_EN_UNS_DATA 0x01 #define FAST_MSG_DIS_UNS_DATA 0x02 #define FAST_MSG_PING 0x05 #define FAST_MSG_READ_REQ 0x10 #define FAST_MSG_GEN_UNS_DATA 0x12 #define FAST_MSG_SOE_STATE_REQ 0x16 #define FAST_MSG_UNS_RESP 0x18 #define FAST_MSG_UNS_WRITE 0x20 #define FAST_MSG_UNS_WRITE_REQ 0x21 #define FAST_MSG_DEVDESC_REQ 0x30 #define FAST_MSG_DATAFMT_REQ 0x31 #define FAST_MSG_UNS_DATAFMT_RESP 0x32 #define FAST_MSG_BITLABEL_REQ 0x33 #define FAST_MSG_MGMT_REQ 0x40 #define FAST_MSG_CFG_BLOCK_RESP 0x80 #define FAST_MSG_EN_UNS_DATA_ACK 0x81 #define FAST_MSG_DIS_UNS_DATA_ACK 0x82 #define FAST_MSG_PING_ACK 0x85 #define FAST_MSG_READ_RESP 0x90 #define FAST_MSG_SOE_STATE_RESP 0x96 #define FAST_MSG_UNS_RESP_ACK 0x98 #define FAST_MSG_DEVDESC_RESP 0xB0 #define FAST_MSG_DATAFMT_RESP 0xB1 #define FAST_MSG_BITLABEL_RESP 0xB3 /* Fast Message Sequence Byte Masks */ #define FAST_MSG_SEQ_FIR 0x80 #define FAST_MSG_SEQ_FIN 0x40 #define FAST_MSG_SEQ_CNT 0x3f /* Fast Message Tag Data Types */ #define FAST_MSG_TAGTYPE_CHAR8 0x0011 /* 1 x 8-bit character per item */ #define FAST_MSG_TAGTYPE_CHAR16 0x0012 /* 2 x 8-bit characters per item */ #define FAST_MSG_TAGTYPE_DIGWORD8_BL 0x0021 /* 8-bit binary item, with labels */ #define FAST_MSG_TAGTYPE_DIGWORD8 0x0022 /* 8-bit binary item, without labels */ #define FAST_MSG_TAGTYPE_DIGWORD16_BL 0x0023 /* 16-bit binary item, with labels */ #define FAST_MSG_TAGTYPE_DIGWORD16 0x0024 /* 16-bit binary item, without labels */ #define FAST_MSG_TAGTYPE_INT16 0x0031 /* 16-bit signed integer */ #define FAST_MSG_TAGTYPE_UINT16 0x0032 /* 16-bit unsigned integer */ #define FAST_MSG_TAGTYPE_INT32 0x0033 /* 32-bit signed integer */ #define FAST_MSG_TAGTYPE_UINT32 0x0034 /* 32-bit unsigned integer */ #define FAST_MSG_TAGTYPE_FLOAT 0x0041 /* 32-bit floating point */ /* Globals for SEL Protocol Preferences */ static gboolean selfm_desegment = TRUE; static gboolean selfm_telnet_clean = TRUE; static gboolean selfm_crc16 = FALSE; /* Default CRC16 valdiation to false */ static const char *selfm_ser_list = NULL; /***************************************************************************************/ /* Fast Meter Message structs */ /***************************************************************************************/ /* Holds Configuration Information required to decode a Fast Meter analog value */ typedef struct { gchar name[FM_CONFIG_ANA_CHNAME_LEN+1]; /* Name of Analog Channel, 6 char + a null */ guint8 type; /* Analog Channel Type, Int, FP, etc */ guint8 sf_type; /* Analog Scale Factor Type, none, etc */ guint16 sf_offset; /* Analog Scale Factor Offset */ gfloat sf_fp; /* Scale factor, if present in Cfg message */ } fm_analog_info; /* Holds Information from a single "Fast Meter Configuration" frame. Required to dissect subsequent "Data" frames. */ typedef struct { guint32 fnum; /* frame number */ guint16 cfg_cmd; /* holds ID of config command, ie: 0xa5c1 */ guint8 num_flags; /* Number of Flag Bytes */ guint8 sf_loc; /* Scale Factor Location */ guint8 sf_num; /* Number of Scale Factors */ guint8 num_ai; /* Number of Analog Inputs */ guint8 num_ai_samples; /* Number samples per Analog Input */ guint16 offset_ai; /* Start Offset of Analog Inputs */ guint8 num_dig; /* Number of Digital Input Blocks */ guint16 offset_dig; /* Start Offset of Digital Inputs */ guint16 offset_ts; /* Start Offset of Time Stamp */ guint8 num_calc; /* Number of Calculations */ fm_analog_info *analogs; /* Array of fm_analog_infos */ } fm_config_frame; /**************************************************************************************/ /* Fast Message Data Item struct */ /**************************************************************************************/ /* Holds Configuration Information required to decode a Fast Message Data Item */ /* Each data region format is returned as a sequential list of tags, w/o reference to */ /* an absolute address. The format information will consist of a name, a data type */ /* and a quantity of values contained within the data item. We will retrieve this */ /* format information later while attempting to dissect Read Response frames */ typedef struct { guint32 fnum; /* frame number */ guint32 base_address; /* Base address of Data Item Region */ guint8 index_pos; /* Index Offset Position within data format message (1-16) */ gchar name[10+1]; /* Name of Data Item, 10 chars, null-terminated */ guint16 quantity; /* Quantity of values within Data Item */ guint16 data_type; /* Data Item Type, Char, Int, FP, etc */ } fastmsg_dataitem; /**************************************************************************************/ /* Fast Message Data Region struct */ /**************************************************************************************/ /* Holds Configuration Information required to decode a Fast Message Data Region */ /* Each data region format is returned as a sequential list of tags, w/o reference to */ typedef struct { gchar name[10+1]; /* Name of Data Region, 10 chars, null-terminated */ } fastmsg_dataregion; /**************************************************************************************/ /* Fast Unsolicited SER Index Lookup */ /**************************************************************************************/ /* Holds user-configurable naming information for Unsolicited Fast SER word bits */ /* that will later be present in an 0xA546 msg with only an index position reference */ typedef struct { gchar *name; /* Name of Word Bit, 8 chars, null-terminated */ } fastser_uns_wordbit; /**************************************************************************************/ /* Fast Message Conversation struct */ /**************************************************************************************/ typedef struct { wmem_list_t *fm_config_frames; /* List contains a fm_config_data struct for each Fast Meter configuration frame */ wmem_list_t *fastmsg_dataitems; /* List contains a fastmsg_dataitem struct for each Fast Message Data Item */ wmem_tree_t *fastmsg_dataregions; /* Tree contains a fastmsg_dataregion struct for each Fast Message Data Region */ wmem_tree_t *fastser_uns_wordbits; /* Tree contains a fastser_uns_wordbit struct for each comma-separated entry in the 'SER List' User Preference */ } fm_conversation; static const value_string selfm_msgtype_vals[] = { { CMD_FAST_MSG, "Fast Message Block" }, /* 0xA546 */ { CMD_CLEAR_STATBIT, "Clear Status Bits Command" }, /* 0xA5B9 */ { CMD_RELAY_DEF, "Relay Definition Block" }, /* 0xA5C0 */ { CMD_FM_CONFIG, "Fast Meter Configuration Block" }, /* 0xA5C1 */ { CMD_DFM_CONFIG, "Demand Fast Meter Configuration Block" }, /* 0xA5C2 */ { CMD_PDFM_CONFIG, "Peak Demand Fast Meter Configuration Block" }, /* 0xA5C3 */ { CMD_FASTOP_RESETDEF, "Fast Operate Reset Definition" }, /* 0xA5CD */ { CMD_FASTOP_CONFIG, "Fast Operate Configuration" }, /* 0xA5CE */ { CMD_ALT_FASTOP_CONFIG, "Alternate Fast Operate Configuration" }, /* 0xA5CF */ { CMD_FM_DATA, "Fast Meter Data Block" }, /* 0xA5D1 */ { CMD_DFM_DATA, "Demand Fast Meter Data Block" }, /* 0xA5D2 */ { CMD_PDFM_DATA, "Peak Demand Fast Meter Data Block" }, /* 0xA5D3 */ { CMD_FASTOP_RB_CTRL, "Fast Operate Remote Bit Control" }, /* 0xA5E0 */ { CMD_FASTOP_BR_CTRL, "Fast Operate Breaker Bit Control" }, /* 0xA5E3 */ { CMD_ALT_FASTOP_OPEN, "Alternate Fast Operate Open Breaker Control" }, /* 0xA5E5 */ { CMD_ALT_FASTOP_CLOSE, "Alternate Fast Operate Close Breaker Control" }, /* 0xA5E6 */ { CMD_ALT_FASTOP_SET, "Alternate Fast Operate Set Remote Bit Control" }, /* 0xA5E7 */ { CMD_ALT_FASTOP_CLEAR, "Alternate Fast Operate Clear Remote Bit Control" }, /* 0xA5E8 */ { CMD_ALT_FASTOP_PULSE, "Alternate Fast Operate Pulse Remote Bit Control" }, /* 0xA5E9 */ { CMD_FASTOP_RESET, "Fast Operate Reset" }, /* 0xA5ED */ { 0, NULL } }; static value_string_ext selfm_msgtype_vals_ext = VALUE_STRING_EXT_INIT(selfm_msgtype_vals); static const value_string selfm_relaydef_proto_vals[] = { { 0x0000, "SEL Fast Meter" }, { 0x0001, "SEL Limited Multidrop (LMD)" }, { 0x0002, "Modbus" }, { 0x0003, "SY/MAX" }, { 0x0004, "SEL Relay-to-Relay" }, { 0x0005, "DNP 3.0" }, { 0x0006, "SEL Mirrored Bits" }, { 0x0007, "IEEE 37.118 Synchrophasors" }, { 0x0008, "IEC 61850" }, { 0x0100, "SEL Fast Meter w/ Fast Operate" }, { 0x0101, "SEL Limited Multidrop (LMD) w/ Fast Operate" }, { 0x0200, "SEL Fast Meter w/ Fast Message" }, { 0x0300, "SEL Fast Meter w/ Fast Operate and Fast Message" }, { 0x0301, "SEL Limited Multidrop (LMD) w/ Fast Operate and Fast Message" }, { 0, NULL } }; static value_string_ext selfm_relaydef_proto_vals_ext = VALUE_STRING_EXT_INIT(selfm_relaydef_proto_vals); static const value_string selfm_fmconfig_ai_chtype_vals[] = { { FM_CONFIG_ANA_CHTYPE_INT16, "16-Bit Integer" }, { FM_CONFIG_ANA_CHTYPE_FP, "IEEE Floating Point" }, { FM_CONFIG_ANA_CHTYPE_FPD, "IEEE Floating Point (Double)" }, { FM_CONFIG_ANA_CHTYPE_TS, "8-byte Time Stamp" }, { 0, NULL } }; static const value_string selfm_fmconfig_ai_sftype_vals[] = { { FM_CONFIG_ANA_SFTYPE_INT16, "16-Bit Integer" }, { FM_CONFIG_ANA_SFTYPE_FP, "IEEE Floating Point" }, { FM_CONFIG_ANA_SFTYPE_FPD, "IEEE Floating Point (Double)" }, { FM_CONFIG_ANA_SFTYPE_TS, "8-byte Time Stamp" }, { FM_CONFIG_ANA_SFTYPE_NONE, "None" }, { 0, NULL } }; static const value_string selfm_fmconfig_sfloc_vals[] = { { FM_CONFIG_SF_LOC_FM, "In Fast Meter Message" }, { FM_CONFIG_SF_LOC_CFG, "In Configuration Message" }, { 0, NULL } }; /* Depending on number of analog samples present in Fast Meter Messages, identification of data will change */ static const value_string selfm_fmconfig_numsamples1_vals[] = { { 1, "Magnitudes Only" }, { 0, NULL } }; static const value_string selfm_fmconfig_numsamples2_vals[] = { { 1, "Imaginary Components" }, { 2, "Real Components" }, { 0, NULL } }; static const value_string selfm_fmconfig_numsamples4_vals[] = { { 1, "1st Quarter Cycle Data" }, { 2, "2nd Quarter Cycle Data" }, { 3, "5th Quarter-Cycle Data" }, { 4, "6th Quarter-Cycle Data" }, { 0, NULL } }; /* Calculation Block lookup values */ static const value_string selfm_fmconfig_cblk_rot_vals[] = { { 0x00, "ABC Rotation" }, { 0x01, "ACB Rotation" }, { 0, NULL } }; static const value_string selfm_fmconfig_cblk_vconn_vals[] = { { 0x00, "Y-Connected" }, { 0x01, "Delta-Connected (in seq. Vab, Vbc, Vca)" }, { 0x02, "Delta-Connected (in seq. Vac, Vba, Vcb)" }, { 0, NULL } }; static const value_string selfm_fmconfig_cblk_iconn_vals[] = { { 0x00, "Y-Connected" }, { 0x01, "Delta-Connected (in seq. Iab, Ibc, Ica)" }, { 0x02, "Delta-Connected (in seq. Iac, Iba, Icb)" }, { 0, NULL } }; static const value_string selfm_fmconfig_cblk_ctype_vals[] = { { 0, "Standard Power Calculations" }, { 1, "2-1/2 Element Delta Power Calculation" }, { 2, "Voltages-Only" }, { 3, "Currents-Only" }, { 4, "Single-Phase Ia and Va Only" }, { 5, "Standard Power Calcs with 2 sets of Currents" }, { 6, "2-1/2 Element Delta Power Calcs with 2 sets of Currents" }, { 0, NULL } }; /* Fast Operate Remote Bit 'Pulse Supported' Lookup */ static const value_string selfm_foconfig_prb_supp_vals[] = { { 0x00, "No" }, { 0x01, "Yes" }, { 0, NULL } }; /* SER Status Value Lookup */ static const value_string selfm_ser_status_vals[] = { { 0x00, "Deasserted" }, { 0x01, "Asserted" }, { 0, NULL } }; /* Fast Operate Remote Bit Lookup */ static const value_string selfm_fo_rb_vals[] = { { 0x00, "RB01 Clear" }, { 0x01, "RB02 Clear" }, { 0x02, "RB03 Clear" }, { 0x03, "RB04 Clear" }, { 0x04, "RB05 Clear" }, { 0x05, "RB06 Clear" }, { 0x06, "RB07 Clear" }, { 0x07, "RB08 Clear" }, { 0x08, "RB09 Clear" }, { 0x09, "RB10 Clear" }, { 0x0A, "RB11 Clear" }, { 0x0B, "RB12 Clear" }, { 0x0C, "RB13 Clear" }, { 0x0D, "RB14 Clear" }, { 0x0E, "RB15 Clear" }, { 0x0F, "RB16 Clear" }, { 0x10, "RB17 Clear" }, { 0x11, "RB18 Clear" }, { 0x12, "RB19 Clear" }, { 0x13, "RB20 Clear" }, { 0x14, "RB21 Clear" }, { 0x15, "RB22 Clear" }, { 0x16, "RB23 Clear" }, { 0x17, "RB24 Clear" }, { 0x18, "RB25 Clear" }, { 0x19, "RB26 Clear" }, { 0x1A, "RB27 Clear" }, { 0x1B, "RB28 Clear" }, { 0x1C, "RB29 Clear" }, { 0x1D, "RB30 Clear" }, { 0x1E, "RB31 Clear" }, { 0x1F, "RB32 Clear" }, { 0x20, "RB01 Set" }, { 0x21, "RB02 Set" }, { 0x22, "RB03 Set" }, { 0x23, "RB04 Set" }, { 0x24, "RB05 Set" }, { 0x25, "RB06 Set" }, { 0x26, "RB07 Set" }, { 0x27, "RB08 Set" }, { 0x28, "RB09 Set" }, { 0x29, "RB10 Set" }, { 0x2A, "RB11 Set" }, { 0x2B, "RB12 Set" }, { 0x2C, "RB13 Set" }, { 0x2D, "RB14 Set" }, { 0x2E, "RB15 Set" }, { 0x2F, "RB16 Set" }, { 0x30, "RB17 Set" }, { 0x31, "RB18 Set" }, { 0x32, "RB19 Set" }, { 0x33, "RB20 Set" }, { 0x34, "RB21 Set" }, { 0x35, "RB22 Set" }, { 0x36, "RB23 Set" }, { 0x37, "RB24 Set" }, { 0x38, "RB25 Set" }, { 0x39, "RB26 Set" }, { 0x3A, "RB27 Set" }, { 0x3B, "RB28 Set" }, { 0x3C, "RB29 Set" }, { 0x3D, "RB30 Set" }, { 0x3E, "RB31 Set" }, { 0x3F, "RB32 Set" }, { 0x40, "RB01 Pulse" }, { 0x41, "RB02 Pulse" }, { 0x42, "RB03 Pulse" }, { 0x43, "RB04 Pulse" }, { 0x44, "RB05 Pulse" }, { 0x45, "RB06 Pulse" }, { 0x46, "RB07 Pulse" }, { 0x47, "RB08 Pulse" }, { 0x48, "RB09 Pulse" }, { 0x49, "RB10 Pulse" }, { 0x4A, "RB11 Pulse" }, { 0x4B, "RB12 Pulse" }, { 0x4C, "RB13 Pulse" }, { 0x4D, "RB14 Pulse" }, { 0x4E, "RB15 Pulse" }, { 0x4F, "RB16 Pulse" }, { 0x50, "RB17 Pulse" }, { 0x51, "RB18 Pulse" }, { 0x52, "RB19 Pulse" }, { 0x53, "RB20 Pulse" }, { 0x54, "RB21 Pulse" }, { 0x55, "RB22 Pulse" }, { 0x56, "RB23 Pulse" }, { 0x57, "RB24 Pulse" }, { 0x58, "RB25 Pulse" }, { 0x59, "RB26 Pulse" }, { 0x5A, "RB27 Pulse" }, { 0x5B, "RB28 Pulse" }, { 0x5C, "RB29 Pulse" }, { 0x5D, "RB30 Pulse" }, { 0x5E, "RB31 Pulse" }, { 0x5F, "RB32 Pulse" }, { 0, NULL } }; static value_string_ext selfm_fo_rb_vals_ext = VALUE_STRING_EXT_INIT(selfm_fo_rb_vals); /* Fast Operate Breaker Bit Lookup */ static const value_string selfm_fo_br_vals[] = { { 0x11, "Breaker Bit 1 Close (CC/CC1)" }, { 0x12, "Breaker Bit 2 Close (CC2)" }, { 0x13, "Breaker Bit 3 Close (CC3)" }, { 0x14, "Breaker Bit 4 Close (CC4)" }, { 0x15, "Breaker Bit 5 Close (CC5)" }, { 0x16, "Breaker Bit 6 Close (CC6)" }, { 0x17, "Breaker Bit 7 Close (CC7)" }, { 0x18, "Breaker Bit 8 Close (CC8)" }, { 0x19, "Breaker Bit 9 Close (CC9)" }, { 0x1A, "Breaker Bit 10 Close (CC10)" }, { 0x1B, "Breaker Bit 11 Close (CC11)" }, { 0x1C, "Breaker Bit 12 Close (CC12)" }, { 0x1D, "Breaker Bit 13 Close (CC13)" }, { 0x1E, "Breaker Bit 14 Close (CC14)" }, { 0x1F, "Breaker Bit 15 Close (CC15)" }, { 0x20, "Breaker Bit 16 Close (CC16)" }, { 0x21, "Breaker Bit 17 Close (CC17)" }, { 0x22, "Breaker Bit 18 Close (CC18)" }, { 0x31, "Breaker Bit 1 Open (OC/OC1)" }, { 0x32, "Breaker Bit 2 Open (OC2)" }, { 0x33, "Breaker Bit 3 Open (OC3)" }, { 0x34, "Breaker Bit 4 Open (OC4)" }, { 0x35, "Breaker Bit 5 Open (OC5)" }, { 0x36, "Breaker Bit 6 Open (OC6)" }, { 0x37, "Breaker Bit 7 Open (OC7)" }, { 0x38, "Breaker Bit 8 Open (OC8)" }, { 0x39, "Breaker Bit 9 Open (OC9)" }, { 0x3A, "Breaker Bit 10 Open (OC10)" }, { 0x3B, "Breaker Bit 11 Open (OC11)" }, { 0x3C, "Breaker Bit 12 Open (OC12)" }, { 0x3D, "Breaker Bit 13 Open (OC13)" }, { 0x3E, "Breaker Bit 14 Open (OC14)" }, { 0x3F, "Breaker Bit 15 Open (OC15)" }, { 0x40, "Breaker Bit 16 Open (OC16)" }, { 0x41, "Breaker Bit 17 Open (OC17)" }, { 0x42, "Breaker Bit 18 Open (OC18)" }, { 0, NULL } }; static value_string_ext selfm_fo_br_vals_ext = VALUE_STRING_EXT_INIT(selfm_fo_br_vals); /* Alternate Fast Operate Function Code Lookup */ static const value_string selfm_foconfig_alt_funccode_vals[] = { { 0xE5, "Open Breaker Bit" }, { 0xE6, "Close Breaker Bit" }, { 0xE7, "Set Remote Bit" }, { 0xE8, "Clear Remote Bit" }, { 0xE9, "Pulse Remote Bit" }, { 0x00, "Unsupported" }, { 0, NULL } }; /* Fast Message Function Codes */ static const value_string selfm_fastmsg_func_code_vals[] = { { FAST_MSG_CFG_BLOCK, "Fast Message Configuration Block Request" }, { FAST_MSG_EN_UNS_DATA, "Enable Unsolicited Data" }, { FAST_MSG_DIS_UNS_DATA, "Disable Unsolicited Data" }, { FAST_MSG_PING, "Ping Message" }, { FAST_MSG_READ_REQ, "Read Request" }, { FAST_MSG_GEN_UNS_DATA, "Generic Unsolicited Data" }, { FAST_MSG_SOE_STATE_REQ, "SOE Present State Request" }, { FAST_MSG_UNS_RESP, "Unsolicited Fast SER Data Response" }, { FAST_MSG_UNS_WRITE, "Unsolicited Write" }, { FAST_MSG_UNS_WRITE_REQ, "Unsolicited Write Request" }, { FAST_MSG_DEVDESC_REQ, "Device Description Request" }, { FAST_MSG_DATAFMT_REQ, "Data Format Request" }, { FAST_MSG_UNS_DATAFMT_RESP, "Unsolicited Data Format Response" }, { FAST_MSG_BITLABEL_REQ, "Bit Label Request" }, { FAST_MSG_MGMT_REQ, "Management Request" }, { FAST_MSG_CFG_BLOCK_RESP, "Fast Message Configuration Block Response" }, { FAST_MSG_EN_UNS_DATA_ACK, "Enable Unsolicited Data ACK" }, { FAST_MSG_DIS_UNS_DATA_ACK, "Disable Unsolicited Data ACK" }, { FAST_MSG_PING_ACK, "Ping Message ACK" }, { FAST_MSG_READ_RESP, "Read Response" }, { FAST_MSG_SOE_STATE_RESP, "SOE Present State Response" }, { FAST_MSG_UNS_RESP_ACK, "Unsolicited Fast SER Data Response ACK" }, { FAST_MSG_DEVDESC_RESP, "Device Description Response" }, { FAST_MSG_DATAFMT_RESP, "Data Format Response" }, { FAST_MSG_BITLABEL_RESP, "Bit Label Response" }, { 0, NULL } }; static value_string_ext selfm_fastmsg_func_code_vals_ext = VALUE_STRING_EXT_INIT(selfm_fastmsg_func_code_vals); static const value_string selfm_fastmsg_tagtype_vals[] = { { FAST_MSG_TAGTYPE_CHAR8, "1 x 8-bit character per item" }, { FAST_MSG_TAGTYPE_CHAR16, "2 x 8-bit characters per item" }, { FAST_MSG_TAGTYPE_DIGWORD8_BL, "8-bit binary item, with labels" }, { FAST_MSG_TAGTYPE_DIGWORD8, "8-bit binary item, without labels" }, { FAST_MSG_TAGTYPE_DIGWORD16_BL, "16-bit binary item, with labels" }, { FAST_MSG_TAGTYPE_DIGWORD16, "16-bit binary item, without labels" }, { FAST_MSG_TAGTYPE_INT16, "16-bit Signed Integer" }, { FAST_MSG_TAGTYPE_UINT16, "16-bit Unsigned Integer" }, { FAST_MSG_TAGTYPE_INT32, "32-bit Signed Integer" }, { FAST_MSG_TAGTYPE_UINT32, "32-bit Unsigned Integer" }, { FAST_MSG_TAGTYPE_FLOAT, "IEEE Floating Point" }, { 0, NULL } }; /* Fast Message ACK Response Codes */ static const value_string selfm_fastmsg_ack_responsecode_vals[] = { { 0x0, "Success" }, { 0x1, "Function code not recognized" }, { 0x2, "Function code supported but disabled" }, { 0x3, "Invalid Data Address" }, { 0x4, "Bad Data" }, { 0x5, "Insufficient Memory" }, { 0x6, "Busy" }, { 0, NULL } }; static value_string_ext selfm_fastmsg_ack_responsecode_vals_ext = VALUE_STRING_EXT_INIT(selfm_fastmsg_ack_responsecode_vals); /* Fast Message Unsolicited Write COM Port Codes */ static const value_string selfm_fastmsg_unswrite_com_vals[] = { { 0x0100, "COM01" }, { 0x0200, "COM02" }, { 0x0300, "COM03" }, { 0x0400, "COM04" }, { 0x0500, "COM05" }, { 0x0600, "COM06" }, { 0x0700, "COM07" }, { 0x0800, "COM08" }, { 0x0900, "COM09" }, { 0x0A00, "COM10" }, { 0x0B00, "COM11" }, { 0x0C00, "COM12" }, { 0x0D00, "COM13" }, { 0x0E00, "COM14" }, { 0x0F00, "COM15" }, { 0, NULL } }; static value_string_ext selfm_fastmsg_unswrite_com_vals_ext = VALUE_STRING_EXT_INIT(selfm_fastmsg_unswrite_com_vals); /* Tables for reassembly of fragments. */ static reassembly_table selfm_reassembly_table; /* ************************************************************************* */ /* Header values for reassembly */ /* ************************************************************************* */ static int hf_selfm_fragment = -1; static int hf_selfm_fragments = -1; static int hf_selfm_fragment_overlap = -1; static int hf_selfm_fragment_overlap_conflict = -1; static int hf_selfm_fragment_multiple_tails = -1; static int hf_selfm_fragment_too_long_fragment = -1; static int hf_selfm_fragment_error = -1; static int hf_selfm_fragment_count = -1; static int hf_selfm_fragment_reassembled_in = -1; static int hf_selfm_fragment_reassembled_length = -1; static gint ett_selfm_fragment = -1; static gint ett_selfm_fragments = -1; static const fragment_items selfm_frag_items = { &ett_selfm_fragment, &ett_selfm_fragments, &hf_selfm_fragments, &hf_selfm_fragment, &hf_selfm_fragment_overlap, &hf_selfm_fragment_overlap_conflict, &hf_selfm_fragment_multiple_tails, &hf_selfm_fragment_too_long_fragment, &hf_selfm_fragment_error, &hf_selfm_fragment_count, &hf_selfm_fragment_reassembled_in, &hf_selfm_fragment_reassembled_length, /* Reassembled data field */ NULL, "SEL Fast Message fragments" }; /**********************************************************************************************************/ /* Clean all instances of 0xFFFF from Telnet payload to compensate for IAC control code (replace w/ 0xFF) */ /* Function Duplicated from packet-telnet.c (unescape_and_tvbuffify_telnet_option) */ /**********************************************************************************************************/ static tvbuff_t * clean_telnet_iac(packet_info *pinfo, tvbuff_t *tvb, int offset, int len, int *num_skip_byte) { tvbuff_t *telnet_tvb; guint8 *buf; const guint8 *spos; guint8 *dpos; int len_remaining, skip_byte = 0; spos=tvb_get_ptr(tvb, offset, len); buf=(guint8 *)wmem_alloc(pinfo->pool, len); dpos=buf; len_remaining = len; while(len_remaining > 0){ /* Only analyze two sequential bytes of source tvb if we have at least two bytes left */ if (len_remaining > 1) { /* If two sequential 0xFF's exist, increment skip_byte counter, decrement */ /* len_remaining by 2 and copy a single 0xFF to dest tvb. */ if((spos[0]==0xff) && (spos[1]==0xff)){ skip_byte++; len_remaining -= 2; *(dpos++)=0xff; spos+=2; continue; } } /* If we only have a single byte left, or there were no sequential 0xFF's, copy byte from src tvb to dest tvb */ *(dpos++)=*(spos++); len_remaining--; } telnet_tvb = tvb_new_child_real_data(tvb, buf, len-skip_byte, len-skip_byte); add_new_data_source(pinfo, telnet_tvb, "Processed Telnet Data"); *num_skip_byte = skip_byte; return telnet_tvb; } /******************************************************************************************************/ /* Execute dissection of Fast Meter configuration frames independent of any GUI access of said frames */ /* Load configuration information into fm_config_frame struct */ /******************************************************************************************************/ static fm_config_frame* fmconfig_frame_fast(tvbuff_t *tvb) { /* Set up structures needed to add the protocol subtree and manage it */ guint count, offset = 0; fm_config_frame *frame; /* get a new frame and initialize it */ frame = wmem_new(wmem_file_scope(), fm_config_frame); /* Get data packet setup information from config message and copy into ai_info (if required) */ frame->cfg_cmd = tvb_get_ntohs(tvb, offset); /* skip length byte, position offset+2 */ frame->num_flags = tvb_get_guint8(tvb, offset+3); frame->sf_loc = tvb_get_guint8(tvb, offset+4); frame->sf_num = tvb_get_guint8(tvb, offset+5); frame->num_ai = tvb_get_guint8(tvb, offset+6); frame->num_ai_samples = tvb_get_guint8(tvb, offset+7); frame->num_dig = tvb_get_guint8(tvb, offset+8); frame->num_calc = tvb_get_guint8(tvb, offset+9); /* Update offset pointer */ offset += 10; /* Get data packet analog/timestamp/digital offsets and copy into ai_info */ frame->offset_ai = tvb_get_ntohs(tvb, offset); frame->offset_ts = tvb_get_ntohs(tvb, offset+2); frame->offset_dig = tvb_get_ntohs(tvb, offset+4); /* Update offset pointer */ offset += 6; frame->analogs = (fm_analog_info *)wmem_alloc(wmem_file_scope(), frame->num_ai * sizeof(fm_analog_info)); /* Get AI Channel Details and copy into ai_info */ for (count = 0; count < frame->num_ai; count++) { fm_analog_info *analog = &(frame->analogs[count]); tvb_memcpy(tvb, analog->name, offset, FM_CONFIG_ANA_CHNAME_LEN); analog->name[FM_CONFIG_ANA_CHNAME_LEN] = '\0'; /* Put a terminating null onto the end of the AI Channel name */ analog->type = tvb_get_guint8(tvb, offset+6); analog->sf_type = tvb_get_guint8(tvb, offset+7); analog->sf_offset = tvb_get_ntohs(tvb, offset+8); /* If Scale Factors are present in the cfg message, retrieve and store them per analog */ /* Otherwise, default to Scale Factor of 1 for now */ if (frame->sf_loc == FM_CONFIG_SF_LOC_CFG) { analog->sf_fp = tvb_get_ntohieee_float(tvb, analog->sf_offset); } else { analog->sf_fp = 1; } offset += 10; } return frame; } /******************************************************************************************************/ /* Execute dissection of Data Item definition info before loading GUI tree */ /* Load configuration information into fastmsg_dataitem struct */ /******************************************************************************************************/ static fastmsg_dataitem* fastmsg_dataitem_save(tvbuff_t *tvb, int offset) { fastmsg_dataitem *dataitem; /* get a new dataitem and initialize it */ dataitem = wmem_new(wmem_file_scope(), fastmsg_dataitem); /* retrieve data item name and terminate with a null */ tvb_memcpy(tvb, dataitem->name, offset, 10); dataitem->name[10] = '\0'; /* Put a terminating null onto the end of the string */ /* retrieve data item quantity and type */ dataitem->quantity = tvb_get_ntohs(tvb, offset+10); dataitem->data_type = tvb_get_ntohs(tvb, offset+12); return dataitem; } /******************************************************************************************************/ /* Execute dissection of Data Region definition info before loading GUI tree */ /* Load configuration information into fastmsg_dataregion struct */ /******************************************************************************************************/ static fastmsg_dataregion* fastmsg_dataregion_save(tvbuff_t *tvb, int offset) { fastmsg_dataregion *dataregion; /* get a new dataregion and initialize it */ dataregion = wmem_new(wmem_file_scope(), fastmsg_dataregion); /* retrieve data region name and terminate with a null */ tvb_memcpy(tvb, dataregion->name, offset, 10); dataregion->name[10] = '\0'; /* Put a terminating null onto the end of the string */ return dataregion; } /********************************************************************************************************/ /* Lookup region name using current base address & saved conversation data. Return ptr to gchar string */ /********************************************************************************************************/ static const gchar* region_lookup(packet_info *pinfo, guint32 base_addr) { fm_conversation *conv; fastmsg_dataregion *dataregion = NULL; conv = (fm_conversation *)p_get_proto_data(wmem_file_scope(), pinfo, proto_selfm, 0); if (conv) { dataregion = (fastmsg_dataregion*)wmem_tree_lookup32(conv->fastmsg_dataregions, base_addr); } if (dataregion) { return dataregion->name; } /* If we couldn't identify the region using the current base address, return a default string */ return "Unknown Region"; } /***********************************************************************************************************/ /* Create Fast SER Unsolicited Word Bit item. Return item to calling function. 'index' parameter */ /* will be used to store 'name' parameter in lookup tree. Index 254 and 255 are special (hardcoded) cases */ /***********************************************************************************************************/ static fastser_uns_wordbit* fastser_uns_wordbit_save(guint8 idx, const char *name) { fastser_uns_wordbit *wordbit_item; /* get a new wordbit_item and initialize it */ wordbit_item = wmem_new(wmem_file_scope(), fastser_uns_wordbit); if (idx <= 253) { wordbit_item->name = wmem_strdup(wmem_file_scope(), name); } if (idx == 254) { wordbit_item->name = wmem_strdup(wmem_file_scope(), "POWER_UP"); } if (idx == 255) { wordbit_item->name = wmem_strdup(wmem_file_scope(), "SET_CHNG"); } return wordbit_item; } /***************************************************************************************************************/ /* Lookup uns wordbit name using current index position & saved conversation data. Return ptr to gchar string */ /***************************************************************************************************************/ static const gchar* fastser_uns_wordbit_lookup(packet_info *pinfo, guint8 idx) { fm_conversation *conv; fastser_uns_wordbit *wordbit = NULL; conv = (fm_conversation *)p_get_proto_data(wmem_file_scope(), pinfo, proto_selfm, 0); if (conv) { wordbit = (fastser_uns_wordbit*)wmem_tree_lookup32(conv->fastser_uns_wordbits, idx); } if (wordbit) { return wordbit->name; } /* If we couldn't identify the bit using the index, return a default string */ return "Unknown"; } /******************************************************************************************************/ /* Code to Dissect Relay Definition Frames */ /******************************************************************************************************/ static int dissect_relaydef_frame(tvbuff_t *tvb, proto_tree *tree, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *relaydef_fm_item, *relaydef_flags_item, *relaydef_proto_item; proto_tree *relaydef_tree, *relaydef_fm_tree, *relaydef_flags_tree, *relaydef_proto_tree; guint8 len, num_proto, num_fm, num_flags; int count; len = tvb_get_guint8(tvb, offset); num_proto = tvb_get_guint8(tvb, offset+1); num_fm = tvb_get_guint8(tvb, offset+2); num_flags = tvb_get_guint8(tvb, offset+3); /* Add items to protocol tree specific to Relay Definition Block */ relaydef_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_relaydef, NULL, "Relay Definition Block Details"); /* Reported length */ proto_tree_add_item(relaydef_tree, hf_selfm_relaydef_len, tvb, offset, 1, ENC_BIG_ENDIAN); /* Reported Number of Protocols Supported */ relaydef_proto_item = proto_tree_add_item(relaydef_tree, hf_selfm_relaydef_numproto, tvb, offset+1, 1, ENC_BIG_ENDIAN); relaydef_proto_tree = proto_item_add_subtree(relaydef_proto_item, ett_selfm_relaydef_proto); /* Reported Number of Fast Meter Commands Supported */ relaydef_fm_item = proto_tree_add_item(relaydef_tree, hf_selfm_relaydef_numfm, tvb, offset+2, 1, ENC_BIG_ENDIAN); relaydef_fm_tree = proto_item_add_subtree(relaydef_fm_item, ett_selfm_relaydef_fm); /* Reported Number of Status Bit Flags Supported */ relaydef_flags_item = proto_tree_add_item(relaydef_tree, hf_selfm_relaydef_numflags, tvb, offset+3, 1, ENC_BIG_ENDIAN); relaydef_flags_tree = proto_item_add_subtree(relaydef_flags_item, ett_selfm_relaydef_flags); /* Get our offset up-to-date */ offset += 4; /* Add each reported Fast Meter cfg/data message */ for (count = 1; count <= num_fm; count++) { proto_tree_add_item(relaydef_fm_tree, hf_selfm_relaydef_fmcfg_cmd, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(relaydef_fm_tree, hf_selfm_relaydef_fmdata_cmd, tvb, offset+2, 2, ENC_BIG_ENDIAN); offset += 4; } /* Add each reported status bit flag, along with corresponding response command */ for (count = 1; count <= num_flags; count++) { proto_tree_add_item(relaydef_flags_tree, hf_selfm_relaydef_statbit, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(relaydef_flags_tree, hf_selfm_relaydef_statbit_cmd, tvb, offset+2, 6, ENC_NA); offset += 8; } /* Add each supported protocol */ for (count = 1; count <= num_proto; count++) { proto_tree_add_item(relaydef_proto_tree, hf_selfm_relaydef_proto, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } /* Add Pad byte (if present) and checksum */ if (tvb_reported_length_remaining(tvb, offset) > 1) { proto_tree_add_item(relaydef_tree, hf_selfm_padbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } proto_tree_add_checksum(relaydef_tree, tvb, offset, hf_selfm_checksum, -1, NULL, NULL, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 1; return offset; } /******************************************************************************************************/ /* Code to dissect Fast Meter Configuration Frames */ /******************************************************************************************************/ static int dissect_fmconfig_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_tree *fmconfig_tree, *fmconfig_ai_tree=NULL, *fmconfig_calc_tree=NULL; guint count; guint8 len, sf_loc, num_sf, num_ai, num_calc; gchar* ai_name; len = tvb_get_guint8(tvb, offset); /* skip num_flags, position offset+1 */ sf_loc = tvb_get_guint8(tvb, offset+2); num_sf = tvb_get_guint8(tvb, offset+3); num_ai = tvb_get_guint8(tvb, offset+4); /* skip num_samp, position offset+5 */ /* skip num_dig, position offset+6 */ num_calc = tvb_get_guint8(tvb, offset+7); fmconfig_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_fmconfig, NULL, "Fast Meter Configuration Details"); /* Add items to protocol tree specific to Fast Meter Configuration Block */ /* Get Setup Information for FM Config Block */ proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_len, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_numflags, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_loc_sf, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_num_sf, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_num_ai, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_num_samp, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_num_dig, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_num_calc, tvb, offset+7, 1, ENC_BIG_ENDIAN); /* Update offset pointer */ offset += 8; /* Add data packet offsets to tree and update offset pointer */ proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_ofs_ai, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_ofs_ts, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_ofs_dig, tvb, offset+4, 2, ENC_BIG_ENDIAN); offset += 6; /* Get AI Channel Details */ for (count = 0; count < num_ai; count++) { ai_name = tvb_get_string_enc(pinfo->pool, tvb, offset, 6, ENC_ASCII); fmconfig_ai_tree = proto_tree_add_subtree_format(fmconfig_tree, tvb, offset, 10, ett_selfm_fmconfig_ai, NULL, "Analog Channel: %s", ai_name); /* Add Channel Name, Channel Data Type, Scale Factor Type and Scale Factor Offset to tree */ proto_tree_add_item(fmconfig_ai_tree, hf_selfm_fmconfig_ai_channel, tvb, offset, 6, ENC_ASCII); proto_tree_add_item(fmconfig_ai_tree, hf_selfm_fmconfig_ai_type, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_ai_tree, hf_selfm_fmconfig_ai_sf_type, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_ai_tree, hf_selfm_fmconfig_ai_sf_ofs, tvb, offset+8, 2, ENC_BIG_ENDIAN); /* Update Offset Pointer */ offset += 10; } /* 14-byte Calculation block instances based on num_calc */ for (count = 0; count < num_calc; count++) { fmconfig_calc_tree = proto_tree_add_subtree_format(fmconfig_tree, tvb, offset, 14, ett_selfm_fmconfig_calc, NULL, "Calculation Block: %d", count+1); /* Rotation, Voltage Connection and Current Connection are all bit-masked on the same byte */ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_rot, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_vconn, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_iconn, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ctype, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_deskew_ofs, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_rs_ofs, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_xs_ofs, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ia_idx, tvb, offset+8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ib_idx, tvb, offset+9, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ic_idx, tvb, offset+10, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_va_idx, tvb, offset+11, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_vb_idx, tvb, offset+12, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_vc_idx, tvb, offset+13, 1, ENC_BIG_ENDIAN); offset += 14; } /* Add Config Message Scale Factor(s) (if present) */ if ((num_sf != 0) && (sf_loc == FM_CONFIG_SF_LOC_CFG)) { for (count = 0; count < num_sf; count++) { proto_tree_add_item(fmconfig_tree, hf_selfm_fmconfig_ai_sf_float, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } /* Add Pad byte (if present) and checksum */ if (tvb_reported_length_remaining(tvb, offset) > 1) { proto_tree_add_item(fmconfig_tree, hf_selfm_padbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } proto_tree_add_checksum(fmconfig_tree, tvb, offset, hf_selfm_checksum, -1, NULL, NULL, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 1; return offset; } /******************************************************************************************************/ /* Code to dissect Fast Meter Data Frames */ /* Formatting depends heavily on previously-encountered Configuration Frames so search array instances for them */ /******************************************************************************************************/ static int dissect_fmdata_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset, guint16 config_cmd_match) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *fmdata_item, *fmdata_dig_ch_item; proto_item *fmdata_ai_sf_item; proto_tree *fmdata_tree, *fmdata_ai_tree=NULL, *fmdata_dig_tree=NULL, *fmdata_ai_ch_tree=NULL, *fmdata_dig_ch_tree=NULL; guint8 len, idx=0, j=0; guint16 config_cmd; gint16 ai_int16val; gint cnt = 0, ch_size=0; gfloat ai_sf_fp; gboolean config_found = FALSE; fm_conversation *conv; fm_config_frame *cfg_data = NULL; nstime_t datetime; struct tm tm; len = tvb_get_guint8(tvb, offset); fmdata_tree = proto_tree_add_subtree_format(tree, tvb, offset, len-2, ett_selfm_fmdata, &fmdata_item, "Fast Meter Data Details"); /* Reported length */ proto_tree_add_item(fmdata_tree, hf_selfm_fmdata_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Search for previously-encountered Configuration information to dissect the frame */ { conv = (fm_conversation *)p_get_proto_data(wmem_file_scope(), pinfo, proto_selfm, 0); if (conv) { wmem_list_frame_t *frame = wmem_list_head(conv->fm_config_frames); /* Cycle through possible instances of multiple fm_config_data_blocks, looking for match */ while (frame && !config_found) { cfg_data = (fm_config_frame *)wmem_list_frame_data(frame); config_cmd = cfg_data->cfg_cmd; /* If the stored config_cmd matches the expected one we are looking for, mark that the config data was found */ if (config_cmd == config_cmd_match) { proto_item_append_text(fmdata_item, ", using frame number %"PRIu32" as Configuration Frame", cfg_data->fnum); config_found = TRUE; } frame = wmem_list_frame_next(frame); } if (config_found) { /* Retrieve number of Status Flag bytes and setup tree */ if (cfg_data->num_flags == 1){ proto_tree_add_item(fmdata_tree, hf_selfm_fmdata_flagbyte, tvb, offset, 1, ENC_BIG_ENDIAN); /*offset += 1;*/ } cnt = cfg_data->num_ai; /* actual number of analog values to available to dissect */ /* Update our current tvb offset to the actual AI offset saved from the Configuration message */ offset = cfg_data->offset_ai; /* Check that we actually have analog data to dissect */ if (cnt > 0) { /* Include decoding for each Sample provided for the Analog Channels */ for (j=0; j < cfg_data->num_ai_samples; j++) { /* Use different lookup strings, depending on how many samples are available per Analog Channel */ if (cfg_data->num_ai_samples == 1) { fmdata_ai_tree = proto_tree_add_subtree_format(fmdata_tree, tvb, offset, ((cfg_data->offset_ts - cfg_data->offset_ai)/cfg_data->num_ai_samples), ett_selfm_fmdata_ai, NULL, "Analog Channels (%d), Sample: %d (%s)", cfg_data->num_ai, j+1, val_to_str_const(j+1, selfm_fmconfig_numsamples1_vals, "Unknown")); } else if (cfg_data->num_ai_samples == 2) { fmdata_ai_tree = proto_tree_add_subtree_format(fmdata_tree, tvb, offset, ((cfg_data->offset_ts - cfg_data->offset_ai)/cfg_data->num_ai_samples), ett_selfm_fmdata_ai, NULL, "Analog Channels (%d), Sample: %d (%s)", cfg_data->num_ai, j+1, val_to_str_const(j+1, selfm_fmconfig_numsamples2_vals, "Unknown")); } else if (cfg_data->num_ai_samples == 4) { fmdata_ai_tree = proto_tree_add_subtree_format(fmdata_tree, tvb, offset, ((cfg_data->offset_ts - cfg_data->offset_ai)/cfg_data->num_ai_samples), ett_selfm_fmdata_ai, NULL, "Analog Channels (%d), Sample: %d (%s)", cfg_data->num_ai, j+1, val_to_str_const(j+1, selfm_fmconfig_numsamples4_vals, "Unknown")); } /* For each analog channel we encounter... */ for (idx = 0; idx < cnt; idx++) { fm_analog_info *ai = &(cfg_data->analogs[idx]); /* Channel size (in bytes) determined by data type */ switch (ai->type) { case FM_CONFIG_ANA_CHTYPE_INT16: ch_size = 2; /* 2 bytes */ break; case FM_CONFIG_ANA_CHTYPE_FP: ch_size = 4; /* 4 bytes */ break; case FM_CONFIG_ANA_CHTYPE_FPD: ch_size = 8; /* 8 bytes */ break; default: break; } /* Build sub-tree for each Analog Channel */ fmdata_ai_ch_tree = proto_tree_add_subtree_format(fmdata_ai_tree, tvb, offset, ch_size, ett_selfm_fmdata_ai_ch, NULL, "Analog Channel %d: %s", idx+1, ai->name); /* XXX - Need more decoding options here for different data types, but I need packet capture examples first */ /* Decode analog value appropriately, according to data type */ switch (ai->type) { /* Channel type is 16-bit Integer */ case FM_CONFIG_ANA_CHTYPE_INT16: ai_int16val = tvb_get_ntohs(tvb, offset); /* If we've got a scale factor, apply it before printing the analog */ /* For scale factors present in the Fast Meter Data message... */ if ((ai->sf_offset != 0) && (ai->sf_type == FM_CONFIG_ANA_SFTYPE_FP) && (cfg_data->sf_loc == FM_CONFIG_SF_LOC_FM)) { ai_sf_fp = tvb_get_ntohieee_float(tvb, ai->sf_offset); proto_tree_add_float(fmdata_ai_ch_tree, hf_selfm_fmdata_ai_sf_fp, tvb, ai->sf_offset, 4, ai_sf_fp); } /* For scale factors present in the Fast Meter Configuration Message... */ else if (cfg_data->sf_loc == FM_CONFIG_SF_LOC_CFG) { ai_sf_fp = ai->sf_fp; fmdata_ai_sf_item = proto_tree_add_float(fmdata_ai_ch_tree, hf_selfm_fmdata_ai_sf_fp, tvb, offset, ch_size, ai_sf_fp); proto_item_set_generated(fmdata_ai_sf_item); } /* If there was no scale factor, default value to 1 */ else { ai_sf_fp = 1; } proto_tree_add_uint(fmdata_ai_ch_tree, hf_selfm_fmdata_ai_value16, tvb, offset, ch_size, ai_int16val); proto_tree_add_float(fmdata_ai_ch_tree, hf_selfm_fmdata_ai_scale_factor, tvb, offset, ch_size, ((gfloat)ai_int16val*ai_sf_fp)); offset += ch_size; break; /* Channel type is IEEE Floating point */ case FM_CONFIG_ANA_CHTYPE_FP: proto_tree_add_item(fmdata_ai_ch_tree, hf_selfm_fmdata_ai_value_float, tvb, offset, ch_size, ENC_BIG_ENDIAN); offset += ch_size; break; /* Channel type is Double IEEE Floating point */ case FM_CONFIG_ANA_CHTYPE_FPD: proto_tree_add_item(fmdata_ai_ch_tree, hf_selfm_fmdata_ai_value_double, tvb, offset, ch_size, ENC_BIG_ENDIAN); offset += ch_size; break; } /* channel type */ } /* number of analog channels */ } /* number of samples */ } /* there were analogs */ /* Check if we have a time-stamp in this message */ if (cfg_data->offset_ts != 0xFFFF) { /* Retrieve timestamp from 8-byte format */ /* Stored as: month, day, year (xx), hr, min, sec, msec (16-bit) */ tm.tm_mon = tvb_get_guint8(tvb, offset) - 1; tm.tm_mday = tvb_get_guint8(tvb, offset+1); tm.tm_year = tvb_get_guint8(tvb, offset+2) + 100; tm.tm_hour = tvb_get_guint8(tvb, offset+3); tm.tm_min = tvb_get_guint8(tvb, offset+4); tm.tm_sec = tvb_get_guint8(tvb, offset+5); tm.tm_isdst = 0; datetime.nsecs = (tvb_get_ntohs(tvb, offset+6) % 1000) * 1000000; datetime.secs = mktime(&tm); proto_tree_add_time(fmdata_tree, hf_selfm_fmdata_timestamp, tvb, offset, 8, &datetime); offset += 8; } /* Check that we actually have digital data */ if (cfg_data->num_dig > 0) { fmdata_dig_tree = proto_tree_add_subtree_format(fmdata_tree, tvb, offset, cfg_data->num_dig, ett_selfm_fmdata_dig, NULL, "Digital Channels (%d)", cfg_data->num_dig); for (idx=0; idx < cfg_data->num_dig; idx++) { fmdata_dig_ch_tree = proto_tree_add_subtree_format(fmdata_dig_tree, tvb, offset, 1, ett_selfm_fmdata_dig_ch, &fmdata_dig_ch_item, "Digital Word Bit Row: %2d", idx+1); /* Display the bit pattern on the digital channel proto_item */ proto_item_append_text(fmdata_dig_ch_item, " [ %d %d %d %d %d %d %d %d ]", ((tvb_get_guint8(tvb, offset) & 0x80) >> 7), ((tvb_get_guint8(tvb, offset) & 0x40) >> 6), ((tvb_get_guint8(tvb, offset) & 0x20) >> 5), ((tvb_get_guint8(tvb, offset) & 0x10) >> 4), ((tvb_get_guint8(tvb, offset) & 0x08) >> 3), ((tvb_get_guint8(tvb, offset) & 0x04) >> 2), ((tvb_get_guint8(tvb, offset) & 0x02) >> 1), (tvb_get_guint8(tvb, offset) & 0x01)); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b0, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_ch_tree, hf_selfm_fmdata_dig_b7, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } } /* digital data was available */ /* Add Pad byte (if present) and checksum */ if (tvb_reported_length_remaining(tvb, offset) > 1) { proto_tree_add_item(fmdata_tree, hf_selfm_padbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } proto_tree_add_checksum(fmdata_tree, tvb, offset, hf_selfm_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 1; } /* matching config frame message was found */ } /* config data found */ if (!config_found) { proto_item_append_text(fmdata_item, ", No Fast Meter Configuration frame found"); offset += (len-3); /* Don't include the 2 header bytes or 1 length byte, those are already in the offset */ return offset; } } return offset; } /******************************************************************************************************/ /* Code to Dissect Fast Operate Configuration Frames */ /******************************************************************************************************/ static int dissect_foconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *foconfig_brkr_item, *foconfig_rb_item; proto_tree *foconfig_tree, *foconfig_brkr_tree=NULL, *foconfig_rb_tree=NULL; guint count; guint8 len, num_brkr, prb_supp; guint16 num_rb; len = tvb_get_guint8(tvb, offset); num_brkr = tvb_get_guint8(tvb, offset+1); num_rb = tvb_get_ntohs(tvb, offset+2); prb_supp = tvb_get_guint8(tvb, offset+4); foconfig_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_foconfig, NULL, "Fast Operate Configuration Details"); /* Add items to protocol tree specific to Fast Operate Configuration Block */ /* Reported length */ proto_tree_add_item(foconfig_tree, hf_selfm_foconfig_len, tvb, offset, 1, ENC_BIG_ENDIAN); /* Supported Breaker Bits */ foconfig_brkr_item = proto_tree_add_item(foconfig_tree, hf_selfm_foconfig_num_brkr, tvb, offset+1, 1, ENC_BIG_ENDIAN); /* Supported Remote Bits */ foconfig_rb_item = proto_tree_add_item(foconfig_tree, hf_selfm_foconfig_num_rb, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* Add "Remote Bit Pulse Supported?" and "Reserved Bit" to Tree */ proto_tree_add_item(foconfig_tree, hf_selfm_foconfig_prb_supp, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(foconfig_tree, hf_selfm_foconfig_reserved, tvb, offset+5, 1, ENC_BIG_ENDIAN); /* Update offset pointer */ offset += 6; /* Get Breaker Bit Command Details */ for (count = 1; count <= num_brkr; count++) { foconfig_brkr_tree = proto_item_add_subtree(foconfig_brkr_item, ett_selfm_foconfig_brkr); /* Add Breaker Open/Close commands to tree */ proto_tree_add_item(foconfig_brkr_tree, hf_selfm_foconfig_brkr_open, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(foconfig_brkr_tree, hf_selfm_foconfig_brkr_close, tvb, offset+1, 1, ENC_BIG_ENDIAN); offset += 2; } /* Get Remote Bit Command Details */ for (count = 1; count <= num_rb; count++) { foconfig_rb_tree = proto_item_add_subtree(foconfig_rb_item, ett_selfm_foconfig_rb); /* Add "Remote Bit Set" command to tree */ proto_tree_add_item(foconfig_rb_tree, hf_selfm_foconfig_rb_cmd, tvb, offset, 1, ENC_BIG_ENDIAN); /* Print "Remote Bit Clear" command to tree */ proto_tree_add_item(foconfig_rb_tree, hf_selfm_foconfig_rb_cmd, tvb, offset+1, 1, ENC_BIG_ENDIAN); /* If Remote Bit "pulse" is supported, retrieve that command as well */ if (prb_supp) { proto_tree_add_item(foconfig_rb_tree, hf_selfm_foconfig_rb_cmd, tvb, offset+2, 1, ENC_BIG_ENDIAN); offset += 3; } else{ offset += 2; } } /* Add Pad byte (if present) and checksum */ if (tvb_reported_length_remaining(tvb, offset) > 1) { proto_tree_add_item(foconfig_tree, hf_selfm_padbyte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } proto_tree_add_checksum(foconfig_tree, tvb, offset, hf_selfm_checksum, -1, NULL, NULL, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 1; return offset; } /******************************************************************************************************/ /* Code to Dissect Alternate Fast Operate (AFO) Configuration Frames */ /******************************************************************************************************/ static int dissect_alt_fastop_config_frame(tvbuff_t *tvb, proto_tree *tree, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_tree *foconfig_tree; guint8 len; len = tvb_get_guint8(tvb, offset); foconfig_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_foconfig, NULL, "Alternate Fast Operate Configuration Details"); /* Add items to protocol tree specific to Fast Operate Configuration Block */ /* Reported length */ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_len, tvb, offset, 1, ENC_BIG_ENDIAN); /* Number of Ports */ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_num_ports, tvb, offset+1, 1, ENC_BIG_ENDIAN); /* Number of Breaker Bits */ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_num_brkr, tvb, offset+2, 1, ENC_BIG_ENDIAN); /* Number of Remote Bits */ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_num_rb, tvb, offset+3, 1, ENC_BIG_ENDIAN); /* Function Code(s) Supported */ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+8, 1, ENC_BIG_ENDIAN); offset += (len - 2); return offset; } /******************************************************************************************************/ /* Code to Dissect Fast Operate (Remote Bit or Breaker Bit) Frames */ /******************************************************************************************************/ static int dissect_fastop_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_tree *fastop_tree; guint8 len, opcode; guint16 msg_type; msg_type = tvb_get_ntohs(tvb, offset-2); len = tvb_get_guint8(tvb, offset); fastop_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_fastop, NULL, "Fast Operate Details"); /* Add Reported length to tree*/ proto_tree_add_item(fastop_tree, hf_selfm_fastop_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Operate Code */ opcode = tvb_get_guint8(tvb, offset); /* Use different lookup table for different msg_type */ if (msg_type == CMD_FASTOP_RB_CTRL) { proto_tree_add_item(fastop_tree, hf_selfm_fastop_rb_code, tvb, offset, 1, ENC_BIG_ENDIAN); /* Append Column Info w/ Control Code Code */ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, val_to_str_ext_const(opcode, &selfm_fo_rb_vals_ext, "Unknown Control Code")); } else if (msg_type == CMD_FASTOP_BR_CTRL) { proto_tree_add_item(fastop_tree, hf_selfm_fastop_br_code, tvb, offset, 1, ENC_BIG_ENDIAN); /* Append Column Info w/ Control Code Code */ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, val_to_str_ext_const(opcode, &selfm_fo_br_vals_ext, "Unknown Control Code")); } offset += 1; /* Operate Code Validation */ proto_tree_add_item(fastop_tree, hf_selfm_fastop_valid, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Add checksum */ proto_tree_add_checksum(fastop_tree, tvb, offset, hf_selfm_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 1; return offset; } /******************************************************************************************************/ /* Code to Dissect Alternate Fast Operate (AFO) Command Frames */ /******************************************************************************************************/ static int dissect_alt_fastop_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_tree *fastop_tree; guint8 len; guint16 opcode; len = tvb_get_guint8(tvb, offset); fastop_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_fastop, NULL, "Alternate Fast Operate Details"); /* Add Reported length to tree */ proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Operate Code */ opcode = tvb_get_ntohs(tvb, offset); /* Append Column Info w/ Control Code Code */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", opcode); proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_code, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Operate Code Validation */ proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_valid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } /************************************************************************************************************************/ /* Code to dissect Fast Message Read Response Messages */ /************************************************************************************************************************/ /* Each Read Response frame can have a maximum data size of 117 x 16-bit words (or 234 bytes) - this is due to the 20 */ /* bytes of overhead and 254 max frame size. In the event of a larger data payload than 234 bytes, the FIR and FIN */ /* bits will be used to indicate either the first frame, last frame, or a neither/middle frame. */ /* We can use the FIN bit to attempt a reassembly of the data payload since all messages will arrive sequentially. */ /************************************************************************************************************************/ static int dissect_fastmsg_readresp_frame(tvbuff_t *tvb, proto_tree *fastmsg_tree, packet_info *pinfo, int offset, guint8 seq_byte) { proto_item *fastmsg_tag_value_item=NULL, *fmdata_dig_item=NULL; proto_item *pi_baseaddr=NULL, *pi_fnum=NULL, *pi_type=NULL, *pi_qty=NULL; proto_tree *fastmsg_tag_tree=NULL, *fmdata_dig_tree=NULL; guint32 base_addr; guint16 data_size, num_addr, cnt; guint8 seq_cnt; gboolean seq_fir, seq_fin, save_fragmented; int payload_offset=0; fm_conversation *conv; fastmsg_dataitem *dataitem; tvbuff_t *data_tvb, *payload_tvb; /* Decode sequence byte components */ seq_cnt = seq_byte & FAST_MSG_SEQ_CNT; seq_fir = ((seq_byte & FAST_MSG_SEQ_FIR) >> 7); seq_fin = ((seq_byte & FAST_MSG_SEQ_FIN) >> 6); base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */ num_addr = tvb_get_ntohs(tvb, offset+4); /* 16-bit field with number of 16-bit addresses to read */ /* Append Column Info w/ Base Address */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x [%s]", base_addr, region_lookup(pinfo, base_addr)); pi_baseaddr = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(pi_baseaddr, " [%s]", region_lookup(pinfo, base_addr)); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_numwords, tvb, offset+4, 2, ENC_BIG_ENDIAN); offset += 6; /* Setup a new tvb representing just the data payload of this particular message */ data_tvb = tvb_new_subset_length_caplen( tvb, offset, (tvb_reported_length_remaining(tvb, offset)-2), (tvb_reported_length_remaining(tvb, offset)-2)); save_fragmented = pinfo->fragmented; /* Check for fragmented packet by looking at the FIR and FIN bits */ if (! (seq_fir && seq_fin)) { fragment_head *frag_msg; /* This is a fragmented packet, mark it as such */ pinfo->fragmented = TRUE; frag_msg = fragment_add_seq_next(&selfm_reassembly_table, data_tvb, 0, pinfo, 0, NULL, tvb_reported_length(data_tvb), !seq_fin); payload_tvb = process_reassembled_data(data_tvb, 0, pinfo, "Reassembled Data Response Payload", frag_msg, &selfm_frag_items, NULL, fastmsg_tree); if (payload_tvb) { /* Reassembled */ /* We have the complete payload */ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Reassembled Data Response"); } else { /* We don't have the complete reassembled payload. */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Response Data Fragment %u" , seq_cnt); } } /* No re-assembly required, setup the payload_tvb based on the single-frame data payload tvb */ else { payload_tvb = data_tvb; add_new_data_source(pinfo, payload_tvb, "Data Response Payload"); } pinfo->fragmented = save_fragmented; /* If we had no need to re-assemble or this is the final packet of a reassembly, let's attempt to dissect the */ /* data payload using any previously-captured data format information */ if (payload_tvb) { /* Search for previously-encountered data format reference information to dissect the frame */ conv = (fm_conversation *)p_get_proto_data(wmem_file_scope(), pinfo, proto_selfm, 0); if (conv) { /* Start at front of list and cycle through possible instances of multiple fastmsg_dataitem frames, looking for match */ wmem_list_frame_t *frame = wmem_list_head(conv->fastmsg_dataitems); while (frame && (tvb_reported_length_remaining(payload_tvb, payload_offset) > 0)) { dataitem = (fastmsg_dataitem *)wmem_list_frame_data(frame); /* If the stored base address of the current data item matches the current base address of this response frame */ /* mark that the config data was found and attempt further dissection */ if (dataitem->base_address == base_addr) { /* Data Item size (in bytes) determined by data type and quantity within item */ switch (dataitem->data_type) { case FAST_MSG_TAGTYPE_CHAR8: case FAST_MSG_TAGTYPE_DIGWORD8_BL: case FAST_MSG_TAGTYPE_DIGWORD8: data_size = 1 * dataitem->quantity; /* 1 byte per qty */ break; case FAST_MSG_TAGTYPE_CHAR16: case FAST_MSG_TAGTYPE_DIGWORD16_BL: case FAST_MSG_TAGTYPE_DIGWORD16: case FAST_MSG_TAGTYPE_INT16: case FAST_MSG_TAGTYPE_UINT16: data_size = 2 * dataitem->quantity; /* 2 bytes per qty */ break; case FAST_MSG_TAGTYPE_INT32: case FAST_MSG_TAGTYPE_UINT32: case FAST_MSG_TAGTYPE_FLOAT: data_size = 4 * dataitem->quantity; /* 4 bytes per qty */ break; default: data_size = 0; break; } fastmsg_tag_tree = proto_tree_add_subtree_format(fastmsg_tree, payload_tvb, payload_offset, data_size, ett_selfm_fastmsg_tag, NULL, "Data Item Name: %s", dataitem->name); /* Load some information from the stored Data Format Response message into the tree for reference */ pi_fnum = proto_tree_add_uint_format(fastmsg_tag_tree, hf_selfm_fmdata_frame_data_format_reference, payload_tvb, payload_offset, data_size, dataitem->fnum, "Using frame number %d (Index Pos: %d) as Data Format Reference",dataitem->fnum, dataitem->index_pos ); pi_type = proto_tree_add_uint(fastmsg_tag_tree, hf_selfm_fmdata_data_type, payload_tvb, payload_offset, 0, dataitem->data_type); pi_qty = proto_tree_add_uint(fastmsg_tag_tree, hf_selfm_fmdata_quantity, payload_tvb, payload_offset, 0, dataitem->quantity ); proto_item_set_generated(pi_fnum); proto_item_set_generated(pi_type); proto_item_set_len(pi_type, data_size); proto_item_set_generated(pi_qty); proto_item_set_len(pi_qty, data_size); /* Data Item Type determines how to decode */ switch (dataitem->data_type) { case FAST_MSG_TAGTYPE_DIGWORD8_BL: case FAST_MSG_TAGTYPE_DIGWORD8: for (cnt=1; cnt <= dataitem->quantity; cnt++) { fmdata_dig_tree = proto_tree_add_subtree_format(fastmsg_tag_tree, payload_tvb, payload_offset, 1, ett_selfm_fmdata_dig, &fmdata_dig_item, "8-bit Binary Items (Row: %2d)", cnt); /* Display the bit pattern on the digital channel proto_item */ proto_item_append_text(fmdata_dig_item, " [ %d %d %d %d %d %d %d %d ]", ((tvb_get_guint8(payload_tvb, payload_offset) & 0x80) >> 7), ((tvb_get_guint8(payload_tvb, payload_offset) & 0x40) >> 6), ((tvb_get_guint8(payload_tvb, payload_offset) & 0x20) >> 5), ((tvb_get_guint8(payload_tvb, payload_offset) & 0x10) >> 4), ((tvb_get_guint8(payload_tvb, payload_offset) & 0x08) >> 3), ((tvb_get_guint8(payload_tvb, payload_offset) & 0x04) >> 2), ((tvb_get_guint8(payload_tvb, payload_offset) & 0x02) >> 1), (tvb_get_guint8(payload_tvb, payload_offset) & 0x01)); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b0, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b1, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b2, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b3, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b4, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b5, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b6, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b7, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN); payload_offset += 1; } break; case FAST_MSG_TAGTYPE_CHAR8: case FAST_MSG_TAGTYPE_CHAR16: proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fmdata_ai_value_string, payload_tvb, payload_offset, data_size, ENC_ASCII); payload_offset += data_size; break; case FAST_MSG_TAGTYPE_INT16: for (cnt=1; cnt <= dataitem->quantity; cnt++) { fastmsg_tag_value_item = proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_int16, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN); proto_item_prepend_text(fastmsg_tag_value_item, "Value %d ", cnt); payload_offset += data_size/dataitem->quantity; } break; case FAST_MSG_TAGTYPE_UINT16: for (cnt=1; cnt <= dataitem->quantity; cnt++) { fastmsg_tag_value_item = proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_uint16, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN); proto_item_prepend_text(fastmsg_tag_value_item, "Value %d ", cnt); payload_offset += data_size/dataitem->quantity; } break; case FAST_MSG_TAGTYPE_INT32: for (cnt=1; cnt <= dataitem->quantity; cnt++) { fastmsg_tag_value_item = proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_int32, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN); proto_item_prepend_text(fastmsg_tag_value_item, "Value %d ", cnt); payload_offset += data_size/dataitem->quantity; } break; case FAST_MSG_TAGTYPE_UINT32: for (cnt=1; cnt <= dataitem->quantity; cnt++) { fastmsg_tag_value_item = proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_uint32, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN); proto_item_prepend_text(fastmsg_tag_value_item, "Value %d ", cnt); payload_offset += data_size/dataitem->quantity; } break; case FAST_MSG_TAGTYPE_FLOAT: for (cnt=1; cnt <= dataitem->quantity; cnt++) { fastmsg_tag_value_item = proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_float, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN); proto_item_prepend_text(fastmsg_tag_value_item, "Value %d ", cnt); payload_offset += data_size/dataitem->quantity; } break; default: break; } /* data item type switch */ } /* base address is correct */ /* After processing this frame/data item, proceed to the next */ frame = wmem_list_frame_next(frame); } /* while (frame) */ } /* if (conv) found */ } /* if payload_tvb */ /* Update the offset field before we leave this frame */ offset += num_addr*2; return offset; } /******************************************************************************************************/ /* Code to dissect Fast Message Frames */ /******************************************************************************************************/ static int dissect_fastmsg_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *fastmsg_def_fc_item, *fastmsg_elementlist_item; proto_item *pi_baseaddr, *fastmsg_crc16_item; proto_tree *fastmsg_tree, *fastmsg_def_fc_tree=NULL, *fastmsg_elementlist_tree=NULL; proto_tree *fastmsg_element_tree=NULL, *fastmsg_datareg_tree=NULL, *fastmsg_tag_tree=NULL, *fastmsg_soeblk_tree=NULL; gint cnt, cnt1, num_elements, elmt_status32_ofs=0, elmt_status, null_offset; guint8 len, funccode, seq=0, rx_num_fc, tx_num_fc; guint8 seq_cnt=0, elmt_idx, fc_enable, soe_num_reg; guint8 *tag_name_ptr; guint16 base_addr, num_addr, num_reg, addr1, addr2, crc16, crc16_calc, soe_num_blks; guint32 tod_ms, elmt_status32, elmt_ts_offset; static int * const seq_fields[] = { &hf_selfm_fastmsg_seq_fir, &hf_selfm_fastmsg_seq_fin, &hf_selfm_fastmsg_seq_cnt, NULL }; len = tvb_get_guint8(tvb, offset); fastmsg_tree = proto_tree_add_subtree(tree, tvb, offset, len-2, ett_selfm_fastmsg, NULL, "Fast Message Details"); /* Reported length */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_len, tvb, offset, 1, ENC_BIG_ENDIAN); /* 5-byte Future Routing Address */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_routing_addr, tvb, offset+1, 5, ENC_NA); offset += 6; /* Add Status Byte to tree */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Get Function Code, add to tree */ funccode = tvb_get_guint8(tvb, offset); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_funccode, tvb, offset, 1, ENC_BIG_ENDIAN); /* Append Column Info w/ Function Code */ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, val_to_str_ext_const(funccode, &selfm_fastmsg_func_code_vals_ext, "Unknown Function Code")); offset += 1; /* If this is an ACK message, process this byte as a Response Code. */ if ((funccode == FAST_MSG_EN_UNS_DATA_ACK) || (funccode == FAST_MSG_DIS_UNS_DATA_ACK) || (funccode == FAST_MSG_UNS_RESP_ACK)) { proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_response_code, tvb, offset, 1, ENC_BIG_ENDIAN); } else { /* Otherwise, it is the sequence byte, add to Tree */ seq = tvb_get_guint8(tvb, offset); seq_cnt = seq & FAST_MSG_SEQ_CNT; proto_tree_add_bitmask_with_flags(fastmsg_tree, tvb, offset, hf_selfm_fastmsg_seq, ett_selfm_fastmsg_seq, seq_fields, ENC_NA, BMT_NO_APPEND); } offset += 1; /* Add Response Number to tree */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_resp_num, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Depending on Function Code used, remaining section of packet will be handled differently. */ switch (funccode) { case FAST_MSG_EN_UNS_DATA: /* 0x01 - Enabled Unsolicited Data Transfers */ /* Function code to enable */ fc_enable = tvb_get_guint8(tvb, offset); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_uns_en_fc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Append Column Info w/ "Enable" Function Code */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Function to Enable (%#x)", fc_enable); /* 3-byte Function Code data */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_uns_en_fc_data, tvb, offset+1, 3, ENC_NA); offset += 4; break; case FAST_MSG_DIS_UNS_DATA: /* 0x02 - Disable Unsolicited Data Transfers */ /* Function code to disable */ fc_enable = tvb_get_guint8(tvb, offset); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_uns_dis_fc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Append Column Info w/ "Disable" Function Code */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Function to Disable (%#x)", fc_enable); /* 1-byte Function Code data */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_uns_dis_fc_data, tvb, offset+1, 1, ENC_NA); offset += 2; break; case FAST_MSG_READ_REQ: /* 0x10 - Read Request */ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */ /* Append Column Info w/ Base Address */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x [%s]", base_addr, region_lookup(pinfo, base_addr)); pi_baseaddr = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(pi_baseaddr, " [%s]", region_lookup(pinfo, base_addr)); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_numwords, tvb, offset+4, 2, ENC_BIG_ENDIAN); offset += 6; break; case FAST_MSG_GEN_UNS_DATA: /* 0x12 - Generic Unsolicited Data */ num_addr = len - 14; /* 12 header bytes + 2-byte CRC, whatever is left is the data portion of this message */ num_reg = num_addr / 2; /* For the number of registers, step through and retrieve/print each 16-bit component */ for (cnt=0; cnt < num_reg; cnt++) { proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unswrite_reg_val, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } break; case FAST_MSG_SOE_STATE_REQ: /* 0x16 - SOE Present State Request */ /* 4 bytes - "Origination Path" */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_soe_req_orig, tvb, offset, 4, ENC_NA); offset += 4; break; case FAST_MSG_UNS_RESP: /* 0x18 - Unsolicited Fast SER Data Response */ /* 4 bytes - "Origination Path" */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unsresp_orig, tvb, offset, 4, ENC_NA); offset += 4; /* Timestamp: 2-byte day-of-year, 2-byte year, 4-byte time-of-day in milliseconds */ /* XXX - We can use a built-in function to convert the tod_ms to a readable time format, is there anything for day_of_year? */ tod_ms = tvb_get_ntohl(tvb, offset+4); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unsresp_doy, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unsresp_year, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(fastmsg_tree, hf_selfm_fastmsg_unsresp_todms, tvb, offset+4, 4, tod_ms, "%s", signed_time_msecs_to_str(pinfo->pool, tod_ms)); offset += 8; /* Build element tree */ /* Determine the number of elements returned in this unsolicited message */ /* The general formula is: (Length - 34) / 4 */ num_elements = (len-34) / 4; fastmsg_elementlist_item = proto_tree_add_uint(fastmsg_tree, hf_selfm_fastmsg_unsresp_num_elmt, tvb, offset, (4*num_elements), num_elements); fastmsg_elementlist_tree = proto_item_add_subtree(fastmsg_elementlist_item, ett_selfm_fastmsg_element_list); /* "Reported New Status" word for up to 32 index elements is following the upcoming 0xFFFFFFFE End-of-record indicator Search for that indicator and use the detected tvb offset+4 to retrieve the proper 32-bit status word. Save this word for use in the element index printing but don't print the word itself until the end of the tree dissection */ for (cnt = offset; cnt < len; cnt++) { if (tvb_memeql(tvb, cnt, (const guint8*)"\xFF\xFF\xFF\xFE", 4) == 0) { elmt_status32_ofs = cnt+4; } } elmt_status32 = tvb_get_ntohl(tvb, elmt_status32_ofs ); /* Cycle through each element we have detected that exists in the SER record */ for (cnt=0; cnt<num_elements; cnt++) { /* Get Element Index and Timestamp Offset (in uSec) */ elmt_idx = tvb_get_guint8(tvb, offset); elmt_ts_offset = (guint32)((tvb_get_guint8(tvb, offset+1) << 16) | (tvb_get_guint8(tvb, offset+2) << 8) | (tvb_get_guint8(tvb, offset+3))); /* Bit shift the appropriate element from the 32-bit elmt_status word to position 0 and get the bit state for use in the tree */ elmt_status = ((elmt_status32 >> cnt) & 0x01); /* Build the tree */ fastmsg_element_tree = proto_tree_add_subtree_format(fastmsg_elementlist_tree, tvb, offset, 4, ett_selfm_fastmsg_element, NULL, "Reported Event %d (Index: %d [%s], New State: %s)", cnt+1, elmt_idx, fastser_uns_wordbit_lookup(pinfo, elmt_idx), val_to_str_const(elmt_status, selfm_ser_status_vals, "Unknown")); /* Add Index Number and Timestamp offset to tree */ proto_tree_add_item(fastmsg_element_tree, hf_selfm_fastmsg_unsresp_elmt_idx, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_element_tree, hf_selfm_fastmsg_unsresp_elmt_ts_ofs, tvb, offset+1, 3, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(fastmsg_element_tree, hf_selfm_fastmsg_unsresp_elmt_ts_ofs_decoded, tvb, offset+1, 3, tod_ms + (elmt_ts_offset/1000), "%s", signed_time_msecs_to_str(pinfo->pool, tod_ms + (elmt_ts_offset/1000))); proto_tree_add_uint(fastmsg_element_tree, hf_selfm_fastmsg_unsresp_elmt_status, tvb, elmt_status32_ofs, 4, elmt_status); offset += 4; } /* 4-byte End-of-Record Terminator 0xFFFFFFFE */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unsresp_eor, tvb, offset, 4, ENC_NA); offset += 4; /* 4-byte Element Status word */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unsresp_elmt_statword, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case FAST_MSG_UNS_WRITE: /* 0x20 - Unsolicited Write */ /* Write Address Region #1 and #2, along with number of 16-bit registers */ addr1 = tvb_get_ntohs(tvb, offset); addr2 = tvb_get_ntohs(tvb, offset+2); num_reg = tvb_get_ntohs(tvb, offset+4); /* Append Column Info w/ Address Information */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x, %#x", addr1, addr2); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unswrite_addr1, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unswrite_addr2, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unswrite_num_reg, tvb, offset+4, 2, ENC_BIG_ENDIAN); offset += 6; /* For the number of registers, step through and retrieve/print each 16-bit component */ for (cnt=0; cnt < num_reg; cnt++) { proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_unswrite_reg_val, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } break; case FAST_MSG_DATAFMT_REQ: /* 0x31 - Data Format Request */ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */ /* Append Column Info w/ Base Address */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x [%s]", base_addr, region_lookup(pinfo, base_addr)); /* Add Base Address to Tree */ pi_baseaddr = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(pi_baseaddr, " [%s]", region_lookup(pinfo, base_addr)); offset += 4; break; case FAST_MSG_BITLABEL_REQ: /* 0x33 - Bit Label Request */ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Append Column Info w/ Base Address */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr); break; case FAST_MSG_CFG_BLOCK_RESP: /* 0x80 (resp to 0x00) - Fast Message Configuration Block Response */ /* Routing Support */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_route_sup, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* RX / TX Status */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_rx_stat, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_tx_stat, tvb, offset+1, 1, ENC_BIG_ENDIAN); offset += 2; /* Max Frames RX/TX */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_rx_maxfr, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_tx_maxfr, tvb, offset+1, 1, ENC_BIG_ENDIAN); offset += 2; /* 6 bytes of reserved space */ offset += 6; /* Number of Supported RX Function Codes */ rx_num_fc = tvb_get_guint8(tvb, offset); fastmsg_def_fc_item = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_rx_num_fc, tvb, offset, 1, ENC_BIG_ENDIAN); fastmsg_def_fc_tree = proto_item_add_subtree(fastmsg_def_fc_item, ett_selfm_fastmsg_def_fc); offset += 1; /* Add Supported RX Function Codes to tree */ for (cnt=0; cnt<rx_num_fc; cnt++) { proto_tree_add_item(fastmsg_def_fc_tree, hf_selfm_fastmsg_def_rx_fc, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 2; } /* Number of Supported TX Function Codes */ tx_num_fc = tvb_get_guint8(tvb, offset); fastmsg_def_fc_item = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_def_tx_num_fc, tvb, offset, 1, ENC_BIG_ENDIAN); fastmsg_def_fc_tree = proto_item_add_subtree(fastmsg_def_fc_item, ett_selfm_fastmsg_def_fc); offset += 1; /* Add Supported TX Function Codes to tree */ for (cnt=0; cnt<tx_num_fc; cnt++) { proto_tree_add_item(fastmsg_def_fc_tree, hf_selfm_fastmsg_def_tx_fc, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 2; } break; case FAST_MSG_READ_RESP: /* 0x90 (resp to 0x10) - Read Response */ offset = dissect_fastmsg_readresp_frame( tvb, fastmsg_tree, pinfo, offset, seq); break; case FAST_MSG_SOE_STATE_RESP: /* 0x96 - (resp to 0x16) SOE Present State Response */ /* 16-bit field with number of blocks of present state data */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_soe_resp_numblks, tvb, offset, 2, ENC_BIG_ENDIAN); soe_num_blks = tvb_get_ntohs(tvb, offset); offset += 2; /* Loop through each one of these block based on the num_blocks */ for (cnt=0; cnt<soe_num_blks; cnt++) { /* Blocks of 16 bits are packed into 16-bit registers, with any remainder into a final 16-bit register */ if ((tvb_get_guint8(tvb, offset+4) % 16) == 0) { soe_num_reg = (tvb_get_guint8(tvb, offset+4) / 16); } else { soe_num_reg = (tvb_get_guint8(tvb, offset+4) / 16) + 1; } fastmsg_soeblk_tree = proto_tree_add_subtree_format(fastmsg_tree, tvb, offset, 14 + soe_num_reg*2, ett_selfm_fastmsg_soeblk, NULL, "Data Block #%d", cnt+1); proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_orig, tvb, offset, 4, ENC_NA); proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_numbits, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_pad, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_doy, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_year, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_tod, tvb, offset+10, 4, ENC_BIG_ENDIAN); offset += 14; for (cnt1=0; cnt1<soe_num_reg; cnt1++) { proto_tree_add_item(fastmsg_soeblk_tree, hf_selfm_fastmsg_soe_resp_data, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } } break; case FAST_MSG_DEVDESC_RESP: /* 0xB0 (resp to 0x30) - Device Description Response */ /* Add FID / RID ASCII data to tree */ proto_tree_add_item(fastmsg_tree, hf_selfm_fid, tvb, offset, 50, ENC_ASCII); proto_tree_add_item(fastmsg_tree, hf_selfm_rid, tvb, offset+50, 40, ENC_ASCII); offset += 90; /* 16-bit field with number of data areas */ num_reg = tvb_get_ntohs(tvb, offset); proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_devdesc_num_region, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Maximum size of 7 regions per message, check the seq_cnt to determine if we have stepped into the next sequential message where the remaining regions would be described */ if ((num_reg >= 8) && (seq_cnt == 0)) { num_reg = 7; } else{ num_reg = num_reg - (seq_cnt * 7); } /* 16-bit field with number of control areas */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_devdesc_num_ctrl, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Each 18-byte data area description has a 10 byte region name, followed by 32-bit base, */ /* 16-bit message word count and 16-bit flag field */ for (cnt=0; cnt<num_reg; cnt++) { fastmsg_datareg_tree = proto_tree_add_subtree_format(fastmsg_tree, tvb, offset, 18, ett_selfm_fastmsg_datareg, NULL, "Fast Message Data Region #%d", cnt+1); /* 10-Byte Region description */ proto_tree_add_item(fastmsg_datareg_tree, hf_selfm_fastmsg_data_region_name, tvb, offset, 10, ENC_ASCII); offset += 10; /* 32-bit field with base address of data region */ proto_tree_add_item(fastmsg_datareg_tree, hf_selfm_fastmsg_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* 16-bit field with number of 16-bit words in region */ proto_tree_add_item(fastmsg_datareg_tree, hf_selfm_fastmsg_numwords, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* 16-bit flag field */ proto_tree_add_item(fastmsg_datareg_tree, hf_selfm_fastmsg_flags, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } /* Some relays (4xx) don't follow the standard here and include an 8-byte sequence of all 0x00's to represent */ /* 'reserved' space for the control regions. Detect these and skip if they are present */ if (tvb_reported_length_remaining(tvb, offset) > 2) { if (tvb_memeql(tvb, offset, (const guint8*)"\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) { offset += 8; } } break; case FAST_MSG_DATAFMT_RESP: /* 0xB1 (resp to 0x31) - Data Format Response */ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */ /* Add Base Address to Tree */ pi_baseaddr = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(pi_baseaddr, " [%s]", region_lookup(pinfo, base_addr)); offset += 4; /* Append Column Info w/ Base Address */ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x [%s]", base_addr, region_lookup(pinfo, base_addr)); /* 16-bit field with number of data items to follow */ proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_datafmt_resp_numitem, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; while ((tvb_reported_length_remaining(tvb, offset)) > 2) { /* Data Item record name 10 bytes */ tag_name_ptr = tvb_get_string_enc(pinfo->pool, tvb, offset, 10, ENC_ASCII); fastmsg_tag_tree = proto_tree_add_subtree_format(fastmsg_tree, tvb, offset, 14, ett_selfm_fastmsg_tag, NULL, "Data Item Record Name: %s", tag_name_ptr); /* Data item qty and type */ proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_qty, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(fastmsg_tag_tree, hf_selfm_fastmsg_dataitem_type, tvb, offset+12, 2, ENC_BIG_ENDIAN); offset += 14; } break; case FAST_MSG_BITLABEL_RESP: /* 0xB3 (resp to 0x33) - Bit Label Response */ /* The data in this response is a variable length string containing the names of 8 digital bits. */ /* Each name is max 8 chars and each is null-seperated */ cnt=1; /* find the null separators and add the bit label text strings to the tree */ for (null_offset = offset; null_offset < len; null_offset++) { if ((tvb_memeql(tvb, null_offset, (const guint8*)"\x00", 1) == 0) && (tvb_reported_length_remaining(tvb, offset) > 2)) { gchar* str = tvb_format_text(pinfo->pool, tvb, offset, (null_offset-offset)); proto_tree_add_string_format(fastmsg_tree, hf_selfm_fastmsg_bit_label_name, tvb, offset, (null_offset-offset), str, "Bit Label #%d Name: %s", cnt, str); offset = null_offset+1; /* skip the null */ cnt++; } } break; default: break; } /* func_code */ /* Add CRC16 to Tree */ fastmsg_crc16_item = proto_tree_add_item(fastmsg_tree, hf_selfm_fastmsg_crc16, tvb, offset, 2, ENC_BIG_ENDIAN); crc16 = tvb_get_ntohs(tvb, offset); offset += 2; /* If option is enabled, validate the CRC16 */ if (selfm_crc16) { crc16_calc = crc16_plain_tvb_offset_seed(tvb, 0, len-2, 0xFFFF); if (crc16_calc != crc16) { expert_add_info_format(pinfo, fastmsg_crc16_item, &ei_selfm_crc16_incorrect, "Incorrect CRC - should be 0x%04x", crc16_calc); } else { proto_item_append_text(fastmsg_crc16_item, " [OK]"); } } return offset; } /******************************************************************************************************/ /* Code to dissect SEL Fast Message Protocol packets */ /* Will call other sub-dissectors, as needed */ /******************************************************************************************************/ static int dissect_selfm(tvbuff_t *selfm_tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *selfm_item=NULL; proto_tree *selfm_tree=NULL; int offset=0, cnt=0, consumed_bytes=0; guint32 base_addr; guint16 msg_type, len, num_items; guint8 seq, seq_cnt; gchar **uns_ser_split_str; /* Make entries in Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SEL Protocol"); col_clear(pinfo->cinfo, COL_INFO); len = tvb_reported_length(selfm_tvb); msg_type = tvb_get_ntohs(selfm_tvb, offset); /* On first pass through the packets we have 4 tasks to complete - they are each noted below */ if (!pinfo->fd->visited) { conversation_t *conversation; fm_conversation *fm_conv_data; /* Find a conversation, create a new if no one exists */ conversation = find_or_create_conversation(pinfo); fm_conv_data = (fm_conversation *)conversation_get_proto_data(conversation, proto_selfm); if (fm_conv_data == NULL) { fm_conv_data = wmem_new(wmem_file_scope(), fm_conversation); fm_conv_data->fm_config_frames = wmem_list_new(wmem_file_scope()); fm_conv_data->fastmsg_dataitems = wmem_list_new(wmem_file_scope()); fm_conv_data->fastmsg_dataregions = wmem_tree_new(wmem_file_scope()); fm_conv_data->fastser_uns_wordbits = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(conversation, proto_selfm, (void *)fm_conv_data); uns_ser_split_str = wmem_strsplit(pinfo->pool, selfm_ser_list, ",", -1); for (cnt = 0; (uns_ser_split_str[cnt] != NULL); cnt++) { fastser_uns_wordbit *wordbit_ptr = fastser_uns_wordbit_save(cnt, uns_ser_split_str[cnt]); wmem_tree_insert32(fm_conv_data->fastser_uns_wordbits, cnt, wordbit_ptr); } /* Power Up (254) and Settings Changed (255) Indexes */ for (cnt = 254; (cnt <= 255); cnt++) { fastser_uns_wordbit *wordbit_ptr = fastser_uns_wordbit_save(cnt, "unused"); wmem_tree_insert32(fm_conv_data->fastser_uns_wordbits, cnt, wordbit_ptr); } } p_add_proto_data(wmem_file_scope(), pinfo, proto_selfm, 0, fm_conv_data); /* 1. Configuration frames (0xA5C1, 0xA5C2, 0xA5C3) need special treatment during the first run */ /* For each Fast Meter Configuration frame (0xA5Cx), a 'fm_config_frame' struct is created to hold the */ /* information necessary to decode subsequent matching Fast Meter Data frames (0xA5Dx). A pointer to */ /* this struct is saved in the conversation and is copied to the per-packet information if a */ /* Fast Meter Data frame is dissected. */ if ((CMD_FM_CONFIG == msg_type) || (CMD_DFM_CONFIG == msg_type) || (CMD_PDFM_CONFIG == msg_type)) { /* Fill the fm_config_frame */ fm_config_frame *frame_ptr = fmconfig_frame_fast(selfm_tvb); frame_ptr->fnum = pinfo->num; wmem_list_prepend(fm_conv_data->fm_config_frames, frame_ptr); } /* 2. Fill conversation data array with Fast Msg Data Item info from Data Format Response Messages. */ /* These format definitions will later be retrieved to decode Read Response messages. */ if ((CMD_FAST_MSG == msg_type) && (tvb_get_guint8(selfm_tvb, offset+9) == FAST_MSG_DATAFMT_RESP)) { seq = tvb_get_guint8(selfm_tvb, offset+10); seq_cnt = seq & FAST_MSG_SEQ_CNT; base_addr = tvb_get_ntohl(selfm_tvb, offset+12); /* 32-bit field with base address to read */ num_items = tvb_get_ntohs(selfm_tvb, offset+16); /* When dealing with Data Format Response messages, there are a maximum of 16 items per frame */ /* Use the sequence count if we have more 16 items to determine how many to expect in each frame */ if ((num_items > 16) && (seq_cnt == 0)) { num_items = 16; } else { num_items = num_items - (seq_cnt * 16); } /* Set offset to start of data items */ offset = 18; /* Enter the single frame multiple times, retrieving a single dataitem per entry */ for (cnt = 1; (cnt <= num_items); cnt++) { fastmsg_dataitem *dataitem_ptr = fastmsg_dataitem_save(selfm_tvb, offset); dataitem_ptr->fnum = pinfo->num; dataitem_ptr->base_address = base_addr; dataitem_ptr->index_pos = cnt; /* Store the data item configuration info in the fastmsg_dataitems list */ wmem_list_append(fm_conv_data->fastmsg_dataitems, dataitem_ptr); offset += 14; } } /* 3. Attempt re-assembly during first pass with Read Response Messages data payloads that span multiple */ /* packets. The final data payload will be assembled on the packet with the seq_fin bit set. */ if ((CMD_FAST_MSG == msg_type) && (tvb_get_guint8(selfm_tvb, offset+9) == FAST_MSG_READ_RESP)) { seq = tvb_get_guint8(selfm_tvb, offset+10); /* Set offset to where the dissect_fastmsg_readresp_frame function would normally be called, */ /* right before base address & num_items */ offset = 12; /* Call the same read response function that will be called during GUI dissection */ offset = dissect_fastmsg_readresp_frame( selfm_tvb, tree, pinfo, offset, seq); /* Skip CRC16 */ offset += 2; } /* 4. Fill conversation data array with Fast Message Data Region info from Device Desc Response Messages. This */ /* will retrieve a data region name (associated to an address) that can later be displayed in the tree. */ if ((CMD_FAST_MSG == msg_type) && (tvb_get_guint8(selfm_tvb, offset+9) == FAST_MSG_DEVDESC_RESP)) { seq = tvb_get_guint8(selfm_tvb, offset+10); seq_cnt = seq & FAST_MSG_SEQ_CNT; num_items = tvb_get_ntohs(selfm_tvb, offset+102); /* When dealing with Device Description Response messages, there are a maximum of 7 regions per frame */ /* Use the sequence count if we have more 7 items to determine how many to expect in each frame */ if ((num_items >= 8) && (seq_cnt == 0)) { num_items = 7; } else{ num_items = num_items - (seq_cnt * 7); } /* Set offset to start of data regions */ offset = 106; /* Enter the single frame multiple times, retrieving a single data region per entry */ for (cnt = 1; (cnt <= num_items); cnt++) { guint32 base_address = tvb_get_ntohl(selfm_tvb, offset+10); fastmsg_dataregion *dataregion_ptr = fastmsg_dataregion_save(selfm_tvb, offset); /* Store the data region info in the fastmsg_dataregions tree */ wmem_tree_insert32(fm_conv_data->fastmsg_dataregions, base_address, dataregion_ptr); offset += 18; } offset = len; } } /* if (!visited) */ { selfm_item = proto_tree_add_protocol_format(tree, proto_selfm, selfm_tvb, 0, len, "SEL Protocol"); selfm_tree = proto_item_add_subtree(selfm_item, ett_selfm); /* Set INFO column with SEL Protocol Message Type */ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(msg_type, &selfm_msgtype_vals_ext, "Unknown Message Type")); /* Add Message Type to Protocol Tree */ proto_tree_add_item(selfm_tree, hf_selfm_msgtype, selfm_tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; consumed_bytes += 2; /* Determine correct message type and call appropriate dissector */ if (tvb_reported_length_remaining(selfm_tvb, offset) > 0) { switch (msg_type) { case CMD_RELAY_DEF: consumed_bytes = dissect_relaydef_frame(selfm_tvb, selfm_tree, offset); break; case CMD_FM_CONFIG: case CMD_DFM_CONFIG: case CMD_PDFM_CONFIG: consumed_bytes = dissect_fmconfig_frame(selfm_tvb, selfm_tree, pinfo, offset); break; case CMD_FM_DATA: consumed_bytes = dissect_fmdata_frame(selfm_tvb, selfm_tree, pinfo, offset, CMD_FM_CONFIG); break; case CMD_DFM_DATA: consumed_bytes = dissect_fmdata_frame(selfm_tvb, selfm_tree, pinfo, offset, CMD_DFM_CONFIG); break; case CMD_PDFM_DATA: consumed_bytes = dissect_fmdata_frame(selfm_tvb, selfm_tree, pinfo, offset, CMD_PDFM_CONFIG); break; case CMD_FASTOP_CONFIG: consumed_bytes = dissect_foconfig_frame(selfm_tvb, selfm_tree, offset); break; case CMD_FAST_MSG: consumed_bytes = dissect_fastmsg_frame(selfm_tvb, selfm_tree, pinfo, offset); break; case CMD_FASTOP_RB_CTRL: case CMD_FASTOP_BR_CTRL: consumed_bytes = dissect_fastop_frame(selfm_tvb, selfm_tree, pinfo, offset); break; case CMD_ALT_FASTOP_CONFIG: consumed_bytes = dissect_alt_fastop_config_frame(selfm_tvb, selfm_tree, offset); break; case CMD_ALT_FASTOP_OPEN: case CMD_ALT_FASTOP_CLOSE: case CMD_ALT_FASTOP_SET: case CMD_ALT_FASTOP_CLEAR: case CMD_ALT_FASTOP_PULSE: consumed_bytes = dissect_alt_fastop_frame(selfm_tvb, selfm_tree, pinfo, offset); break; default: break; } /* msg_type */ } /* remaining length > 0 */ } return consumed_bytes; } /******************************************************************************************************/ /* Dissect (and possibly re-assemble) SEL protocol payload data */ /******************************************************************************************************/ /* Since we are dealing with (usually) Telnet-encapsulated data with possible extra IAC bytes present,*/ /* we cannot know the 'true' length of re-assembled TCP messages by just looking at the protocol PDU */ /* header and it's included length byte. This precludes the use of tcp_dissect_pdus() and requires */ /* us to do the reassembly efforts here. */ /* The tvb structure is as follows: */ /* tvb = original data tvb from TCP dissector */ /* selfm_tvb = 'IAC-sanitized' (0xFF) version of tvb */ /* selfm_pdu_tvb = with multiple PDUs in a single selfm_tvb, split them out for separate dissection */ /* */ /* tvb -> selfm_tvb -> selfm_pdu_tvb */ /* -> selfm_pdu_tvb */ /******************************************************************************************************/ static int dissect_selfm_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tvbuff_t *selfm_tvb, *selfm_pdu_tvb; int skip_byte = 0, selfm_tvb_len, offset = 0; guint8 selfm_PDU_len=0, new_selfm_PDU_len=0; gint length = tvb_reported_length(tvb); /* Check for a SEL Protocol packet. It should begin with 0xA5 */ if(length < 2 || tvb_get_guint8(tvb, 0) != 0xA5) { /* Not a SEL Protocol packet, just happened to use the same port */ return 0; } /* If the length of this packet is only 2 bytes, it's a scan message so just do a simple dissection */ if (length == 2) { return dissect_selfm(tvb, pinfo, tree, data); } selfm_PDU_len = tvb_get_guint8(tvb,2); /* If the reported selfm PDU length is greater than the present tvb length, request more data */ if (length < selfm_PDU_len) { pinfo->desegment_offset = 0; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; return tvb_captured_length(tvb); } /* If this is a Telnet-encapsulated Ethernet packet, let's clean out the IAC 0xFF instances */ /* before we attempt any kind of re-assembly of the message */ if ((pinfo->srcport) && selfm_telnet_clean) { selfm_tvb = clean_telnet_iac(pinfo, tvb, 0, length, &skip_byte); } else { selfm_tvb = tvb_new_subset_length( tvb, 0, length); } selfm_tvb_len = tvb_reported_length(selfm_tvb); /* If sanitized selfm_tvb length is still less than the reported selfm PDU length, there is more segment data to follow */ if (selfm_tvb_len < selfm_PDU_len) { pinfo->desegment_offset = 0; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; return tvb_captured_length(tvb); } /* If the available selfm_tvb length is greater than the reported selfm PDU length, */ /* there is possibly a second PDU to follow so let's dig deeper... */ if (selfm_tvb_len > selfm_PDU_len) { /* Check if additional data is actually selfm PDU data */ if (tvb_get_guint8(selfm_tvb, selfm_PDU_len) == 0xA5) { new_selfm_PDU_len = tvb_get_guint8(selfm_tvb, selfm_PDU_len+2); /* If we still don't have enough data to accomodate the 2 PDUs... */ if (selfm_tvb_len < (selfm_PDU_len + new_selfm_PDU_len)) { #if 0 fprintf(stderr, "On Packet: %d, continuing to desegment. PDU: %d NewPDU: %d Still need %d bytes.. \n", pinfo->fd->num, selfm_PDU_len, new_selfm_PDU_len, (selfm_PDU_len + new_selfm_PDU_len) - selfm_tvb_len); #endif /* If the current selfm_tvb length is less than the combined reported selfm length of the 2 PDUs, continue TCP desegmentation */ /* The desegment_len field will be used to report how many additional bytes remain to be reassembled */ pinfo->desegment_offset = 0; pinfo->desegment_len = (selfm_PDU_len + new_selfm_PDU_len) - selfm_tvb_len; return tvb_captured_length(tvb); } } } /* If multiple SEL protocol PDUs exist within a single tvb, dissect each of them sequentially */ while (offset < selfm_tvb_len) { /* If random ASCII data makes its way onto the end of an SEL protocol PDU, ignore it */ if (tvb_get_guint8(selfm_tvb, offset) != 0xA5) { #if 0 fprintf(stderr, "On Packet: %d, extraneous data (starts with: %x).. \n", pinfo->fd->num, tvb_get_guint8(selfm_tvb, offset)); #endif break; } /* Create new selfm_pdu_tvb that contains only a single PDU worth of data */ selfm_pdu_tvb = tvb_new_subset_length( selfm_tvb, offset, tvb_get_guint8(selfm_tvb, offset+2)); offset += dissect_selfm(selfm_pdu_tvb, pinfo, tree, data); } /* Return the completed selfm_tvb dissected length + the count of any IAC skip bytes that were removed from the tvb payload */ return selfm_tvb_len + skip_byte; } /******************************************************************************************************/ /* Register the protocol with Wireshark */ /******************************************************************************************************/ void proto_reg_handoff_selfm(void); void proto_register_selfm(void) { /* SEL Protocol header fields */ static hf_register_info selfm_hf[] = { { &hf_selfm_msgtype, { "Message Type", "selfm.msgtype", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &selfm_msgtype_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_padbyte, { "Pad Byte", "selfm.padbyte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_checksum, { "Checksum", "selfm.checksum", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* "Relay Definition" specific fields */ { &hf_selfm_relaydef_len, { "Length", "selfm.relaydef.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_numproto, { "Number of Protocols", "selfm.relaydef.numproto", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_numfm, { "Number of Fast Meter Messages", "selfm.relaydef.numfm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_numflags, { "Number of Status Flags", "selfm.relaydef.numflags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_fmcfg_cmd, { "Fast Meter Config Command", "selfm.relaydef.fmcfg_cmd", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_fmdata_cmd, { "Fast Meter Data Command", "selfm.relaydef.fmdata_cmd", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_statbit, { "Status Flag Bit", "selfm.relaydef.status_bit", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_statbit_cmd, { "Status Flag Bit Response Command", "selfm.relaydef.status_bit_cmd", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_relaydef_proto, { "Supported Protocol", "selfm.relaydef.proto", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &selfm_relaydef_proto_vals_ext, 0x0, NULL, HFILL }}, /* "Fast Meter Configuration" specific fields */ { &hf_selfm_fmconfig_len, { "Length", "selfm.fmconfig.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_numflags, { "Number of Status Flags", "selfm.fmconfig.numflags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_loc_sf, { "Location of Scale Factor", "selfm.fmconfig.loc_sf", FT_UINT8, BASE_DEC, VALS(selfm_fmconfig_sfloc_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_num_sf, { "Number of Scale Factors", "selfm.fmconfig.num_sf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_num_ai, { "Number of Analog Input Channels", "selfm.fmconfig.num_ai", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_num_samp, { "Number of Samples per AI Channel", "selfm.fmconfig.num_samp", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_num_dig, { "Number of Digital Banks", "selfm.fmconfig.num_dig", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_num_calc, { "Number of Calculation Blocks", "selfm.fmconfig.num_calc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ofs_ai, { "First Analog Channel Offset", "selfm.fmconfig.ofs_ai", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ofs_ts, { "Timestamp Offset", "selfm.fmconfig.ofs_ts", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ofs_dig, { "First Digital Bank Offset", "selfm.fmconfig.ofs_dig", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ai_type, { "Analog Channel Type", "selfm.fmconfig.ai_type", FT_UINT8, BASE_DEC, VALS(selfm_fmconfig_ai_chtype_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ai_sf_type, { "Analog Channel Scale Factor Type", "selfm.fmconfig.ai_sf_type", FT_UINT8, BASE_DEC, VALS(selfm_fmconfig_ai_sftype_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ai_sf_ofs, { "Analog Channel Scale Factor Offset", "selfm.fmconfig.ai_sf_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_rot, { "Rotation", "selfm.fmconfig.cblk_rot", FT_UINT8, BASE_HEX, VALS(selfm_fmconfig_cblk_rot_vals), 0x01, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_vconn, { "Voltage Connection", "selfm.fmconfig.cblk_vconn", FT_UINT8, BASE_HEX, VALS(selfm_fmconfig_cblk_vconn_vals), 0x06, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_iconn, { "Current Connection", "selfm.fmconfig.cblk_iconn", FT_UINT8, BASE_HEX, VALS(selfm_fmconfig_cblk_iconn_vals), 0x18, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_ctype, { "Calculation Type", "selfm.fmconfig.cblk_ctype", FT_UINT8, BASE_DEC, VALS(selfm_fmconfig_cblk_ctype_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_deskew_ofs, { "Skew Correction Offset", "selfm.fmconfig.cblk_deskew_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_rs_ofs, { "Rs Offset", "selfm.fmconfig.cblk_rs_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_xs_ofs, { "Xs Offset", "selfm.fmconfig.cblk_xs_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_ia_idx, { "Analog Record Ia Index Position", "selfm.fmconfig.cblk_ia_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_ib_idx, { "Analog Record Ib Index Position", "selfm.fmconfig.cblk_ib_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_ic_idx, { "Analog Record Ic Index Position", "selfm.fmconfig.cblk_ic_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_va_idx, { "Analog Record Va/Vab Index Position", "selfm.fmconfig.cblk_va_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_vb_idx, { "Analog Record Vb/Vbc Index Position", "selfm.fmconfig.cblk_vb_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_cblk_vc_idx, { "Analog Record Vc/Vca Index Position", "selfm.fmconfig.cblk_vc_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmconfig_ai_sf_float, { "AI Scale Factor (float)", "selfm.fmconfig.ai_sf_float", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* "Fast Meter Data" specific fields */ { &hf_selfm_fmdata_len, { "Length", "selfm.fmdata.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_flagbyte, { "Status Flags Byte", "selfm.fmdata.flagbyte", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_ai_sf_fp, { "Using IEEE FP Format Scale Factor", "selfm.fmdata.ai.sf_fp",FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b0, { "Bit 0", "selfm.fmdata.dig_b0", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b1, { "Bit 1", "selfm.fmdata.dig_b1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b2, { "Bit 2", "selfm.fmdata.dig_b2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b3, { "Bit 3", "selfm.fmdata.dig_b3", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b4, { "Bit 4", "selfm.fmdata.dig_b4", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b5, { "Bit 5", "selfm.fmdata.dig_b5", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b6, { "Bit 6", "selfm.fmdata.dig_b6", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_selfm_fmdata_dig_b7, { "Bit 7", "selfm.fmdata.dig_b7", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, /* "Fast Operate Configuration" specific fields */ { &hf_selfm_foconfig_len, { "Length", "selfm.foconfig.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_num_brkr, { "Number of Breaker Bits", "selfm.foconfig.num_brkr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_num_rb, { "Number of Remote Bits", "selfm.foconfig.num_rb", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_prb_supp, { "Remote Bit Pulse Supported", "selfm.foconfig.prb_supp", FT_UINT8, BASE_DEC, VALS(selfm_foconfig_prb_supp_vals), 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_reserved, { "Reserved Bit (Future)", "selfm.foconfig.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_brkr_open, { "Breaker Bit Open Command", "selfm.foconfig.brkr_open", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fo_br_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_brkr_close, { "Breaker Bit Close Command", "selfm.foconfig.brkr_close", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fo_br_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_foconfig_rb_cmd, { "Remote Bit Command", "selfm.foconfig.rb_cmd", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fo_rb_vals_ext, 0x0, NULL, HFILL }}, /* "Alternate Fast Operate Configuration" specific fields */ { &hf_selfm_alt_foconfig_len, { "Length", "selfm.alt_foconfig.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_alt_foconfig_num_ports, { "Number of Ports Available", "selfm.alt_foconfig.num_ports", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_alt_foconfig_num_brkr, { "Number of Breaker Bits per Port", "selfm.alt_foconfig.num_brkr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_alt_foconfig_num_rb, { "Number of Remote Bits per Port", "selfm.alt_foconfig.num_rb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_alt_foconfig_funccode, { "Supported Function Code", "selfm.alt_foconfig.funccode", FT_UINT8, BASE_HEX, VALS(selfm_foconfig_alt_funccode_vals), 0x0, NULL, HFILL }}, /* "Fast Operate Command" specific fields */ { &hf_selfm_fastop_len, { "Length", "selfm.fastop.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastop_rb_code, { "Remote Bit Operate Code", "selfm.fastop.rb_code", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fo_rb_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastop_br_code, { "Breaker Bit Operate Code", "selfm.fastop.br_code", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fo_br_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastop_valid, { "Operate Code Validation", "selfm.fastop.valid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* "Alternate Fast Operate Command" specific fields */ { &hf_selfm_alt_fastop_len, { "Length", "selfm.alt_fastop.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_alt_fastop_code, { "Operate Code", "selfm.alt_fastop.code", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_alt_fastop_valid, { "Operate Code Validation", "selfm.alt_fastop.valid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* "Fast Message" specific fields */ { &hf_selfm_fastmsg_len, { "Length", "selfm.fastmsg.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_routing_addr, { "Routing Address (future)", "selfm.fastmsg.routing_addr", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_status, { "Status Byte", "selfm.fastmsg.status", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_funccode, { "Function Code", "selfm.fastmsg.funccode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_func_code_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_response_code, { "Response Code", "selfm.fastmsg.responsecode", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_ack_responsecode_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_seq, { "Sequence Byte", "selfm.fastmsg.seq", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_seq_fir, { "FIR", "selfm.fastmsg.seq_fir", FT_BOOLEAN, 8, NULL, FAST_MSG_SEQ_FIR, NULL, HFILL }}, { &hf_selfm_fastmsg_seq_fin, { "FIN", "selfm.fastmsg.seq_fin", FT_BOOLEAN, 8, NULL, FAST_MSG_SEQ_FIN, NULL, HFILL }}, { &hf_selfm_fastmsg_seq_cnt, { "Count", "selfm.fastmsg.seq_cnt", FT_UINT8, BASE_DEC, NULL, FAST_MSG_SEQ_CNT, "Frame Count Number", HFILL }}, { &hf_selfm_fastmsg_resp_num, { "Response Number", "selfm.fastmsg.resp_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_crc16, { "CRC-16", "selfm.fastmsg.crc16", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_route_sup, { "Routing Support", "selfm.fastmsg.def_route_sup", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_rx_stat, { "Status RX", "selfm.fastmsg.def_rx_stat", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_tx_stat, { "Status TX", "selfm.fastmsg.def_tx_stat", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_rx_maxfr, { "Max Frames RX", "selfm.fastmsg.def_rx_maxfr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_tx_maxfr, { "Max Frames TX", "selfm.fastmsg.def_tx_maxfr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_rx_num_fc, { "Number of Supported RX Function Codes", "selfm.fastmsg.def_rx_num_fc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_rx_fc, { "Receive Function Code", "selfm.fastmsg.def_rx_fc", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_func_code_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_tx_num_fc, { "Number of Supported TX Function Codes", "selfm.fastmsg.def_tx_num_fc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_def_tx_fc, { "Transmit Function Code", "selfm.fastmsg.def_tx_fc", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_func_code_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_uns_en_fc, { "Function Code to Enable", "selfm.fastmsg.uns_en_fc", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_func_code_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_uns_en_fc_data, { "Function Code Data", "selfm.fastmsg.uns_en_fc_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_uns_dis_fc, { "Function Code to Disable", "selfm.fastmsg.uns_dis_fc", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_func_code_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_uns_dis_fc_data, { "Function Code Data", "selfm.fastmsg.uns_dis_fc_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_orig, { "Origination path", "selfm.fastmsg.unsresp_orig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_doy, { "Day of Year", "selfm.fastmsg.unsresp_doy", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_year, { "Year", "selfm.fastmsg.unsresp_year", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_todms, { "Time of Day (in ms)", "selfm.fastmsg.unsresp_todms", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_num_elmt, { "Number of SER Elements", "selfm.fastmsg.unsresp_num_elmt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_elmt_idx, { "SER Element Index", "selfm.fastmsg.unsresp_elmt_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_elmt_ts_ofs, { "SER Element Timestamp Offset (us)", "selfm.fastmsg.unsresp_elmt_ts_ofs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_elmt_status, { "SER Element Status", "selfm.fastmsg.unsresp_elmt_status", FT_UINT8, BASE_DEC, VALS(selfm_ser_status_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_eor, { "End of Record Indicator", "selfm.fastmsg.unsresp_eor", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_elmt_statword, { "SER Element Status Word", "selfm.fastmsg.unsresp_elmt_statword", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unswrite_addr1, { "Write Address Region #1", "selfm.fastmsg.unswrite_addr1", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &selfm_fastmsg_unswrite_com_vals_ext, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unswrite_addr2, { "Write Address Region #2", "selfm.fastmsg.unswrite_addr2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unswrite_num_reg, { "Number of Registers", "selfm.fastmsg.unswrite_num_reg", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unswrite_reg_val, { "Register Value", "selfm.fastmsg.unswrite_reg_val", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_baseaddr, { "Base Address", "selfm.fastmsg.baseaddr", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_numwords, { "Number of 16-bit Words", "selfm.fastmsg.numwords", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_flags, { "Flag Word", "selfm.fastmsg.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_datafmt_resp_numitem, { "Number of Data Items Records", "selfm.fastmsg.datafmt_resp_numitem", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_qty, { "Data Item Quantity", "selfm.fastmsg.dataitem_qty", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_type, { "Data Item Type", "selfm.fastmsg.dataitem_type", FT_UINT16, BASE_HEX, VALS(selfm_fastmsg_tagtype_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_uint16, { "(uint16)", "selfm.fastmsg.dataitem_uint16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_int16, { "(int16)", "selfm.fastmsg.dataitem_int16", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_uint32, { "(uint32)", "selfm.fastmsg.dataitem_uint32", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_int32, { "(int32)", "selfm.fastmsg.dataitem_int32", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_dataitem_float, { "(float)", "selfm.fastmsg.dataitem_float", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_devdesc_num_region, { "Number of Data Regions", "selfm.fastmsg.devdesc_num_region", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_devdesc_num_ctrl, { "Number of Control Regions", "selfm.fastmsg.devdesc_num_ctrl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_req_orig, { "Origination path", "selfm.fastmsg.soe_req_orig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_numblks, { "Number of Blocks", "selfm.fastmsg.soe_resp_numblks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_orig, { "Origination path", "selfm.fastmsg.soe_resp_orig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_numbits, { "Number of Bits", "selfm.fastmsg.soe_resp_numbits", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_pad, { "Pad Byte", "selfm.fastmsg.soe_resp_pad", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_doy, { "Day of Year", "selfm.fastmsg.soe_resp_doy", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_year, { "Year", "selfm.fastmsg.soe_resp_year", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_tod, { "Time of Day (ms)", "selfm.fastmsg.soe_resp_tod", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_soe_resp_data, { "Packed Binary State Data", "selfm.fastmsg.soe_resp_data", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* "Fast Message" Re-assembly header fields */ { &hf_selfm_fragment, { "SEL Fast Msg Response Data Fragment", "selfm.respdata.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "SEL Fast Message Response Data Fragment", HFILL }}, { &hf_selfm_fragments, { "SEL Fast Msg Response Data Fragments", "selfm.respdata.fragments", FT_NONE, BASE_NONE, NULL, 0x0, "SEL Fast Message Response Data Fragments", HFILL }}, { &hf_selfm_fragment_overlap, { "Fragment overlap", "selfm.respdata.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL }}, { &hf_selfm_fragment_overlap_conflict, { "Conflicting data in fragment overlap", "selfm.respdata.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL }}, { &hf_selfm_fragment_multiple_tails, { "Multiple tail fragments found", "selfm.respdata.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL }}, { &hf_selfm_fragment_too_long_fragment, { "Fragment too long", "selfm.respdata.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL }}, { &hf_selfm_fragment_error, { "Defragmentation error", "selfm.respdata.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL }}, { &hf_selfm_fragment_count, { "Fragment count", "selfm.respdata.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fragment_reassembled_in, { "Reassembled PDU In Frame", "selfm.respdata.fragment.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This PDU is reassembled in this frame", HFILL }}, { &hf_selfm_fragment_reassembled_length, { "Reassembled SEL Fast Msg length", "selfm.respdata.fragment.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL }}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_selfm_fmconfig_ai_channel, { "Analog Channel Name", "selfm.fmconfig.ai_channel", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_ai_value16, { "Value (Raw)", "selfm.fmdata.ai.value16", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_ai_scale_factor, { "Value (w/ Scale Factor)", "selfm.fmdata.ai.value_scale_factor", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_ai_value_float, { "Value", "selfm.fmdata.ai.value_float", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_ai_value_double, { "Value", "selfm.fmdata.ai.value_double", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_data_type, { "Data_Type", "selfm.fmdata.data_type", FT_UINT32, BASE_DEC, VALS(selfm_fastmsg_tagtype_vals), 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_quantity, { "Quantity", "selfm.fmdata.quantity", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_ai_value_string, { "Value", "selfm.fmdata.ai.value_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_unsresp_elmt_ts_ofs_decoded, { "SER Element Timestamp Offset (decoded)", "selfm.fastmsg.unsresp_elmt_ts_ofs.decoded", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fid, { "FID", "selfm.fid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_rid, { "RID", "selfm.rid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_data_region_name, { "Data Region Name", "selfm.fastmsg.data_region_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_timestamp, { "Timestamp", "selfm.fmdata.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fmdata_frame_data_format_reference, { "Frame Data Format Reference", "selfm.fmdata.frame_data_format_reference", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_selfm_fastmsg_bit_label_name, { "Bit Label Name", "selfm.fastmsg.bit_label_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Register expert fields */ static ei_register_info selfm_ei[] = { { &ei_selfm_crc16_incorrect, { "selfm.crc16.incorrect", PI_CHECKSUM, PI_WARN, "Incorrect CRC", EXPFILL }} }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_selfm, &ett_selfm_relaydef, &ett_selfm_relaydef_fm, &ett_selfm_relaydef_proto, &ett_selfm_relaydef_flags, &ett_selfm_fmconfig, &ett_selfm_fmconfig_ai, &ett_selfm_fmconfig_calc, &ett_selfm_foconfig, &ett_selfm_foconfig_brkr, &ett_selfm_foconfig_rb, &ett_selfm_fastop, &ett_selfm_fmdata, &ett_selfm_fmdata_ai, &ett_selfm_fmdata_dig, &ett_selfm_fmdata_ai_ch, &ett_selfm_fmdata_dig_ch, &ett_selfm_fastmsg, &ett_selfm_fastmsg_seq, &ett_selfm_fastmsg_def_fc, &ett_selfm_fastmsg_tag, &ett_selfm_fastmsg_element_list, &ett_selfm_fastmsg_element, &ett_selfm_fastmsg_datareg, &ett_selfm_fastmsg_soeblk, &ett_selfm_fragment, &ett_selfm_fragments }; module_t *selfm_module; expert_module_t* expert_selfm; reassembly_table_register(&selfm_reassembly_table, &addresses_reassembly_table_functions); /* Register the protocol name and description */ proto_selfm = proto_register_protocol("SEL Protocol", "SEL Protocol", "selfm"); /* Registering protocol to be called by another dissector */ selfm_handle = register_dissector("selfm", dissect_selfm_tcp, proto_selfm); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_selfm, selfm_hf, array_length(selfm_hf)); proto_register_subtree_array(ett, array_length(ett)); expert_selfm = expert_register_protocol(proto_selfm); expert_register_field_array(expert_selfm, selfm_ei, array_length(selfm_ei)); /* Register required preferences for SEL Protocol register decoding */ selfm_module = prefs_register_protocol(proto_selfm, NULL); /* SEL Protocol - Desegmentmentation; defaults to TRUE for TCP desegmentation*/ prefs_register_bool_preference(selfm_module, "desegment", "Desegment packets spanning multiple TCP segments", "Whether the SEL Protocol dissector should desegment all messages spanning multiple TCP segments", &selfm_desegment); /* SEL Protocol - Telnet protocol IAC (0xFF) processing; defaults to TRUE to allow Telnet Encapsulated Data */ prefs_register_bool_preference(selfm_module, "telnetclean", "Remove extra 0xFF (Telnet IAC) bytes", "Whether the SEL Protocol dissector should automatically pre-process Telnet data to remove duplicate 0xFF IAC bytes", &selfm_telnet_clean); /* SEL Protocol Preference - Disable/Enable CRC verification, */ prefs_register_bool_preference(selfm_module, "crc_verification", "Validate Fast Message CRC16", "Perform CRC16 validation on Fast Messages", &selfm_crc16); prefs_register_string_preference(selfm_module, "ser_list", "SER Index List", "List of word bits contained in SER equations (Comma-separated, no Quotes or Checksums)", &selfm_ser_list); } /******************************************************************************************************/ /* If this dissector uses sub-dissector registration add a registration routine. This format is required because a script is used to find these routines and create the code that calls these routines. */ /******************************************************************************************************/ void proto_reg_handoff_selfm(void) { dissector_add_for_decode_as_with_preference("tcp.port", selfm_handle); dissector_add_for_decode_as("rtacser.data", selfm_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sercosiii.c
/* packet-sercosiii.c * Routines for SERCOS III dissection * * Initial plugin code by, * Bosch Rexroth * Hilscher * * Hans-Peter Bock <[email protected]> * * Convert to built-in dissector * Michael Mann * Copyright 2011 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/etypes.h> #define MAX_SERCOS_DEVICES (512) #define MAX_SERCOS_ADDRESS (511) #define SERCOS_SLAVE_GROUP_SIZE (128) #define COMMUNICATION_PHASE_0 (0x0) #define COMMUNICATION_PHASE_1 (0x1) #define COMMUNICATION_PHASE_2 (0x2) #define COMMUNICATION_PHASE_3 (0x3) #define COMMUNICATION_PHASE_4 (0x4) void proto_register_sercosiii(void); void proto_reg_handoff_sercosiii(void); /* Initialize the protocol and registered fields */ static gint proto_siii = -1; /* Initialize the subtree pointers */ static gint ett_siii = -1; static gint ett_siii_header = -1; static gint ett_siii_mst = -1; static gint ett_siii_mst_teltype = -1; static gint ett_siii_mst_phase = -1; static gint ett_siii_mdt = -1; static gint ett_siii_mdt_svc = -1; static gint ett_siii_mdt_devctrls = -1; static gint ett_siii_mdt_version = -1; static gint ett_siii_mdt_svc_channel = -1; static gint ett_siii_mdt_dev_control = -1; static gint ett_siii_mdt_devctrl = -1; static gint ett_siii_mdt_svcctrl = -1; static gint ett_siii_mdt_svcinfo = -1; static gint ett_siii_at_svcstat = -1; static gint ett_siii_at_svcinfo = -1; static gint ett_siii_mdt_svch_data_error_info = -1; static gint ett_siii_mdt_svch_data = -1; static gint ett_siii_at_devstatus = -1; static gint ett_siii_at_sercosaddress = -1; static gint ett_siii_at = -1; static gint ett_siii_at_svc = -1; static gint ett_siii_at_sercos_address = -1; static gint ett_siii_at_devstats = -1; static gint ett_siii_at_svc_channel = -1; static gint ett_siii_at_dev_status = -1; static gint ett_siii_mdt_hp = -1; static gint ett_siii_at_hp = -1; static gint ett_siii_mdt_hp_ctrl = -1; static gint ett_siii_mdt_hp_info = -1; static gint ett_siii_at_hp_stat = -1; static gint ett_siii_at_hp_info = -1; static gint ett_siii_recognized_devices = -1; static gint hf_siii_mdt_version = -1; static gint hf_siii_mdt_version_initprocvers = -1; static gint hf_siii_mdt_version_num_mdt_at_cp1_2 = -1; static gint hf_siii_mdt_version_switch_off_sercos_telegrams = -1; static gint hf_siii_mdt_version_fast_cp_switch = -1; static gint hf_siii_mdt_version_transmission_of_communication_parameters_mdt0_cp0 = -1; static gint hf_siii_mdt_dev_control_top_control = -1; static gint hf_siii_at_dev_control_ident = -1; static gint hf_siii_mdt_dev_control_change_topology = -1; static gint hf_siii_mdt_dev_control = -1; static gint hf_siii_mst_channel = -1; static gint hf_siii_mst_type = -1; static gint hf_siii_mst_cyclecntvalid = -1; static gint hf_siii_mst_telno = -1; static gint hf_siii_mst_phase = -1; static gint hf_siii_mst_cyclecnt = -1; static gint hf_siii_mst_crc32 = -1; static gint hf_siii_mdt_svch_dbe = -1; static gint hf_siii_mdt_svch_eot = -1; static gint hf_siii_mdt_svch_rw = -1; static gint hf_siii_mdt_svch_mhs = -1; static gint hf_siii_mdt_svch_info = -1; static gint hf_siii_at_svch_valid = -1; static gint hf_siii_at_svch_error = -1; static gint hf_siii_at_svch_busy = -1; static gint hf_siii_at_svch_ahs = -1; static gint hf_siii_at_svch_info = -1; static gint hf_siii_mdt_svch_idn = -1; static gint hf_siii_mdt_svch_ctrl = -1; static gint hf_siii_at_svch_stat = -1; /* static gint hf_siii_svch_data_telofs_telno = -1; */ /* static gint hf_siii_svch_data_telofs_mdt_at = -1; */ /* static gint hf_siii_svch_data_telofs_offset = -1; */ /* static gint hf_siii_svch_data_proccmd_proccmdexec = -1; */ /* static gint hf_siii_svch_data_proccmd_proccmd = -1; */ static gint hf_siii_at_cp0_support_functions = -1; static gint hf_siii_at_cp0_device_address = -1; static gint hf_siii_at_dev_status = -1; static gint hf_siii_at_dev_status_commwarning = -1; static gint hf_siii_at_dev_status_change_topology = -1; static gint hf_siii_at_dev_status_top_status = -1; static gint hf_siii_at_dev_status_inactive_port_status = -1; static gint hf_siii_at_dev_status_errorconnection = -1; static gint hf_siii_at_dev_status_slave_valid = -1; static gint hf_siii_at_dev_status_proc_command_change = -1; static gint hf_siii_at_dev_status_parameterization_level_active = -1; static gint hf_siii_mdt_hotplug_address = -1; static gint hf_siii_mdt_hp_ctrl = -1; static gint hf_siii_mdt_hp_info = -1; static gint hf_siii_at_hotplug_address = -1; static gint hf_siii_at_hp_stat = -1; static gint hf_siii_at_hp_info = -1; static gint hf_siii_mdt_hotplug_control_param = -1; static gint hf_siii_mdt_hotplug_control_svc_switch = -1; static gint hf_siii_at_hotplug_status_param = -1; static gint hf_siii_at_hotplug_status_hp0_finished = -1; static gint hf_siii_at_hotplug_status_error = -1; static gint hf_siii_service_channels = -1; static gint hf_siii_device_controls = -1; static gint hf_siii_device_status = -1; static gint hf_siii_idn_code = -1; static gint hf_siii_at_cp0_num_devices = -1; static gint hf_siii_at_cp0_sercos_address = -1; static expert_field ei_siii_cp_unknown = EI_INIT; /* Allow heuristic dissection */ static heur_dissector_list_t heur_subdissector_list; static const value_string siii_mdt_version_num_mdtat_cp1_2_text[]= { {0x00, "2 MDTs/ATs in CP1/2"}, {0x01, "4 MDTs/ATs in CP1/2"}, {0, NULL} }; static const true_false_string siii_mdt_version_fast_cp_switch_text = { "Transmission of MST (MDT0) interrupted during CP switch for CPS delay time (120ms)", "CPS delay time reduce to the re-configuration time of the master" }; static const true_false_string siii_switch_off_sercos_telegram_text = { "Industrial Ethernet devices not used by application", "Industrial Ethernet devices used by application" }; static const true_false_string siii_mdt_version_initprocvers_text = { "No remote address allocation", "Remote address allocation" }; #if 0 static const value_string siii_svch_data_proccmd_proccmdexec_text[]= { {0, "Interrupt procedure command execution"}, {1, "Enable procedure command execution"}, {0, NULL} }; static const value_string siii_svch_data_proccmd_proccmd_text[]= { {0, "Cancel procedure command"}, {1, "Set procedure command"}, {0, NULL} }; static const value_string siii_svch_data_mdt_at_text[]= { {0, "AT-telegram"}, {1, "MDT-telegram"}, {0, NULL} }; #endif #define IDN(SI, SE, type, paramset, datablock) ((SI<<24)|(SE<<16)|(type<<15)|(paramset<<12)|(datablock)) static const value_string siii_mdt_idn_text[]= { {IDN(0,0,0,0, 0), "Dummy-Parameter"}, {IDN(0,0,0,0, 1), "Control unit cycle time (tNcyc)"}, {IDN(0,0,0,0, 2), "Communication cycle time (tScyc)"}, {IDN(0,0,0,0, 11), "Class 1 diagnostic"}, {IDN(0,0,0,0, 12), "Class 2 diagnostic"}, {IDN(0,0,0,0, 14), "Interface status"}, {IDN(0,0,0,0, 15), "Telegram Type"}, {IDN(0,0,0,0, 16), "Configuration list of AT"}, {IDN(0,0,0,0, 17), "IDN-list of all operation data"}, {IDN(0,0,0,0, 18), "IDN-list of operation data for CP2"}, {IDN(0,0,0,0, 19), "IDN-list of operation data for CP3"}, {IDN(0,0,0,0, 21), "IDN-list of invalid operation data for CP2"}, {IDN(0,0,0,0, 22), "IDN-list of invalid operation data for CP3"}, {IDN(0,0,0,0, 24), "Configuration list of MDT"}, {IDN(0,0,0,0, 25), "IDN-list of all procedure commands"}, {IDN(0,0,0,0, 26), "Configuration list for signal status word"}, {IDN(0,0,0,0, 27), "Configuration list for signal control word"}, {IDN(0,0,0,0, 28), "MST error counter"}, {IDN(0,0,0,0, 29), "MDT error counter"}, {IDN(0,0,0,0, 32), "Primary operation mode"}, {IDN(0,0,0,0, 36), "Velocity command value"}, {IDN(0,0,0,0, 37), "Additive velocity command value"}, {IDN(0,0,0,0, 38), "Positive velocity limit value"}, {IDN(0,0,0,0, 39), "Negative velocity limit value"}, {IDN(0,0,0,0, 40), "Velocity feedback value 1"}, {IDN(0,0,0,0, 41), "Homing velocity"}, {IDN(0,0,0,0, 42), "Homing acceleration"}, {IDN(0,0,0,0, 43), "Velocity polarity parameter"}, {IDN(0,0,0,0, 44), "Velocity data scaling type"}, {IDN(0,0,0,0, 45), "Velocity data scaling factor"}, {IDN(0,0,0,0, 46), "Velocity data scaling exponent"}, {IDN(0,0,0,0, 47), "Position command value"}, {IDN(0,0,0,0, 48), "Additive position command value"}, {IDN(0,0,0,0, 49), "Positive position limit value"}, {IDN(0,0,0,0, 50), "Negative position limit value"}, {IDN(0,0,0,0, 51), "Position feedback value 1 (motor feedback)"}, {IDN(0,0,0,0, 52), "Reference distance 1"}, {IDN(0,0,0,0, 53), "Position feedback value 2 (external feedback)"}, {IDN(0,0,0,0, 54), "Reference distance 2"}, {IDN(0,0,0,0, 55), "Position polarity parameter"}, {IDN(0,0,0,0, 57), "Position window"}, {IDN(0,0,0,0, 58), "Reversal clearance"}, {IDN(0,0,0,0, 59), "Position switch flag parameter"}, {IDN(0,0,0,0, 60), "Position switches (position switch points on 1-16)"}, {IDN(0,0,0,0, 76), "Position data scaling type"}, {IDN(0,0,0,0, 77), "Linear position data scaling factor"}, {IDN(0,0,0,0, 78), "Linear position data scaling exponent"}, {IDN(0,0,0,0, 79), "Rotational position resolution"}, {IDN(0,0,0,0, 80), "Torque command value"}, {IDN(0,0,0,0, 81), "Additive torque command value"}, {IDN(0,0,0,0, 82), "Positive torque limit value"}, {IDN(0,0,0,0, 83), "Negative torque limit value"}, {IDN(0,0,0,0, 84), "Torque feedback value"}, {IDN(0,0,0,0, 85), "Torque polarity parameter"}, {IDN(0,0,0,0, 86), "Torque/force data scaling type"}, {IDN(0,0,0,0, 91), "Bipolar velocity limit value"}, {IDN(0,0,0,0, 92), "Bipolar torque limit value"}, {IDN(0,0,0,0, 93), "Torque/force scaling data factor"}, {IDN(0,0,0,0, 94), "Torque/force scaling data exponent"}, {IDN(0,0,0,0, 95), "Diagnostic message"}, {IDN(0,0,0,0, 96), "Slave arrangement (SLKN)"}, {IDN(0,0,0,0, 97), "Mask class 2 diagnostic"}, {IDN(0,0,0,0, 98), "Mask class 3 diagnostic"}, {IDN(0,0,0,0, 99), "Reset class 1 diagnostic"}, {IDN(0,0,0,0, 100), "Velocity loop proportional gain"}, {IDN(0,0,0,0, 101), "Velocity loop integral action time"}, {IDN(0,0,0,0, 102), "Velocity loop differential time"}, {IDN(0,0,0,0, 103), "Modulo value"}, {IDN(0,0,0,0, 104), "Position loop KV-factor"}, {IDN(0,0,0,0, 105), "Position loop integral action time"}, {IDN(0,0,0,0, 106), "Current loop proportional gain 1"}, {IDN(0,0,0,0, 107), "Current loop integral action time 1"}, {IDN(0,0,0,0, 108), "Feedrate override"}, {IDN(0,0,0,0, 109), "Motor peak current"}, {IDN(0,0,0,0, 110), "Amplifier peak current"}, {IDN(0,0,0,0, 111), "Motor continuous stall current"}, {IDN(0,0,0,0, 112), "Amplifier rated current"}, {IDN(0,0,0,0, 113), "Maximum motor speed"}, {IDN(0,0,0,0, 114), "Load limit of the motor"}, {IDN(0,0,0,0, 115), "Position feedback 2 type"}, {IDN(0,0,0,0, 116), "Resolution of feedback 1"}, {IDN(0,0,0,0, 117), "Resolution of feedback 2"}, {IDN(0,0,0,0, 118), "Resolution of linear feedback"}, {IDN(0,0,0,0, 119), "Current loop proportional gain 2"}, {IDN(0,0,0,0, 120), "Current loop integral action time 2"}, {IDN(0,0,0,0, 121), "Input revolutions of load gear"}, {IDN(0,0,0,0, 122), "Output revolutions of load gear"}, {IDN(0,0,0,0, 123), "Feed constant"}, {IDN(0,0,0,0, 124), "Standstill window"}, {IDN(0,0,0,0, 125), "Velocity threshold (nx)"}, {IDN(0,0,0,0, 126), "Torque threshold (Tx)"}, {IDN(0,0,0,0, 127), "CP3 transition check"}, {IDN(0,0,0,0, 128), "CP4 transition check"}, {IDN(0,0,0,0, 129), "Manufacturer class 1 diagnostic"}, {IDN(0,0,0,0, 130), "Probe value 1 positive edge"}, {IDN(0,0,0,0, 131), "Probe value 1 negative edge"}, {IDN(0,0,0,0, 132), "Probe value 2 positive edge"}, {IDN(0,0,0,0, 133), "Probe value 2 negative edge"}, {IDN(0,0,0,0, 134), "Drive control"}, {IDN(0,0,0,0, 135), "Drive status"}, {IDN(0,0,0,0, 136), "Positive acceleration limit value"}, {IDN(0,0,0,0, 137), "Negative acceleration limit value"}, {IDN(0,0,0,0, 138), "Bipolar acceleration limit value"}, {IDN(0,0,0,0, 139), "Park axis procedure command"}, {IDN(0,0,0,0, 143), "SERCOS Interface version"}, {IDN(0,0,0,0, 144), "Signal status word"}, {IDN(0,0,0,0, 145), "Signal control word"}, {IDN(0,0,0,0, 146), "Control unit controlled homing procedure command"}, {IDN(0,0,0,0, 147), "Homing parameter"}, {IDN(0,0,0,0, 148), "Drive controlled homing procedure command"}, {IDN(0,0,0,0, 149), "Position drive stop procedure command"}, {IDN(0,0,0,0, 150), "Reference offset 1"}, {IDN(0,0,0,0, 151), "Reference offset 2"}, {IDN(0,0,0,0, 152), "Position spindle procedure command"}, {IDN(0,0,0,0, 153), "Spindle angle position"}, {IDN(0,0,0,0, 154), "Spindle positioning parameter"}, {IDN(0,0,0,0, 155), "Friction torque compensation"}, {IDN(0,0,0,0, 156), "Velocity feedback value 2"}, {IDN(0,0,0,0, 157), "Velocity window"}, {IDN(0,0,0,0, 158), "Power threshold (Px)"}, {IDN(0,0,0,0, 159), "Monitoring window"}, {IDN(0,0,0,0, 161), "Acceleration data scaling factor"}, {IDN(0,0,0,0, 162), "Acceleration data scaling exponent"}, {IDN(0,0,0,0, 163), "Weight counterbalance"}, {IDN(0,0,0,0, 164), "Acceleration feedback value 1"}, {IDN(0,0,0,0, 165), "Distance-coded reference marks A"}, {IDN(0,0,0,0, 166), "Distance-coded reference marks B"}, {IDN(0,0,0,0, 167), "Frequency limit of feedback 1"}, {IDN(0,0,0,0, 169), "Probe control"}, {IDN(0,0,0,0, 170), "Probing cycle procedure command"}, {IDN(0,0,0,0, 171), "Calculate displacement procedure command"}, {IDN(0,0,0,0, 172), "Displacement to the referenced system procedure command"}, {IDN(0,0,0,0, 173), "Marker position A"}, {IDN(0,0,0,0, 174), "Marker position B"}, {IDN(0,0,0,0, 175), "Displacement parameter 1"}, {IDN(0,0,0,0, 176), "Displacement parameter 2"}, {IDN(0,0,0,0, 177), "Absolute distance 1"}, {IDN(0,0,0,0, 178), "Absolute distance 2"}, {IDN(0,0,0,0, 179), "Probe status"}, {IDN(0,0,0,0, 180), "Spindle relative offset"}, {IDN(0,0,0,0, 181), "Manufacturer class 2 diagnostic"}, {IDN(0,0,0,0, 183), "Synchronization velocity window"}, {IDN(0,0,0,0, 184), "Synchronization velocity error limit"}, {IDN(0,0,0,0, 185), "Length of the configurable data record in the AT"}, {IDN(0,0,0,0, 186), "Length of the configurable data record in the MDT"}, {IDN(0,0,0,0, 187), "IDN list of configurable data in the AT"}, {IDN(0,0,0,0, 188), "IDN list of configurable data in the MDT"}, {IDN(0,0,0,0, 189), "Following distance"}, {IDN(0,0,0,0, 190), "Drive controlled gear engaging procedure command"}, {IDN(0,0,0,0, 191), "Cancel reference point procedure command"}, {IDN(0,0,0,0, 192), "IDN-list of all backup operation data"}, {IDN(0,0,0,0, 193), "Positioning jerk"}, {IDN(0,0,0,0, 194), "Acceleration command time"}, {IDN(0,0,0,0, 195), "Acceleration feedback value 2"}, {IDN(0,0,0,0, 196), "Motor rated current"}, {IDN(0,0,0,0, 197), "Set coordinate system procedure command"}, {IDN(0,0,0,0, 198), "Initial coordinate value"}, {IDN(0,0,0,0, 199), "Shift coordinate system procedure command"}, {IDN(0,0,0,0, 200), "Amplifier warning temperature"}, {IDN(0,0,0,0, 201), "Motor warning temperature"}, {IDN(0,0,0,0, 202), "Cooling error warning temperature"}, {IDN(0,0,0,0, 203), "Amplifier shut-down temperature"}, {IDN(0,0,0,0, 204), "Motor shut-down temperature"}, {IDN(0,0,0,0, 205), "Cooling error shut-down temperature"}, {IDN(0,0,0,0, 206), "Drive on delay time"}, {IDN(0,0,0,0, 207), "Drive off delay time"}, {IDN(0,0,0,0, 208), "Temperature data scaling type"}, {IDN(0,0,0,0, 209), "Lower adaptation limit"}, {IDN(0,0,0,0, 210), "Upper adaptation limit"}, {IDN(0,0,0,0, 211), "Adaptation proportional gain"}, {IDN(0,0,0,0, 212), "Adaptation integral action time"}, {IDN(0,0,0,0, 213), "Engaging dither amplitude"}, {IDN(0,0,0,0, 214), "Average engaging speed"}, {IDN(0,0,0,0, 215), "Engaging dither period"}, {IDN(0,0,0,0, 216), "Switch parameter set procedure command"}, {IDN(0,0,0,0, 217), "Parameter set preselection"}, {IDN(0,0,0,0, 218), "Gear-ration preselection"}, {IDN(0,0,0,0, 219), "IDN-list of parameter set"}, {IDN(0,0,0,0, 220), "Minimum spindle speed"}, {IDN(0,0,0,0, 221), "Maximum spindle speed"}, {IDN(0,0,0,0, 222), "Spindle positioning speed"}, {IDN(0,0,0,0, 223), "Drive controlled synchronous operation procedure command"}, {IDN(0,0,0,0, 224), "Lead Spindle Address"}, {IDN(0,0,0,0, 225), "Synchronous spindle revolutions"}, {IDN(0,0,0,0, 226), "Lead spindle revolutions"}, {IDN(0,0,0,0, 227), "Synchronous spindle revolutions"}, {IDN(0,0,0,0, 228), "Synchronization position window"}, {IDN(0,0,0,0, 229), "Synchronization position error limit"}, {IDN(0,0,0,0, 230), "Synchronization position offset"}, {IDN(0,0,0,0, 254), "Actual parameter set"}, {IDN(0,0,0,0, 255), "Actual gear ration"}, {IDN(0,0,0,0, 256), "Multiplication factor 1"}, {IDN(0,0,0,0, 257), "Multiplication factor 2"}, {IDN(0,0,0,0, 258), "Target position"}, {IDN(0,0,0,0, 259), "Positioning velocity"}, {IDN(0,0,0,0, 260), "Positioning acceleration"}, {IDN(0,0,0,0, 261), "Coarse position window"}, {IDN(0,0,0,0, 262), "Load defaults procedure command"}, {IDN(0,0,0,0, 263), "Load working memory procedure command"}, {IDN(0,0,0,0, 264), "Backup working memory procedure command"}, {IDN(0,0,0,0, 265), "Language selection"}, {IDN(0,0,0,0, 266), "List of available languages"}, {IDN(0,0,0,0, 267), "Password"}, {IDN(0,0,0,0, 268), "Angular setting"}, {IDN(0,0,0,0, 269), "Storage mode"}, {IDN(0,0,0,0, 270), "IDN-list of selected backup operation data"}, {IDN(0,0,0,0, 272), "Velocity window percentage"}, {IDN(0,0,0,0, 273), "Maximum drive off delay time"}, {IDN(0,0,0,0, 275), "Coordinate offset value"}, {IDN(0,0,0,0, 276), "Return to Modulo range procedure command"}, {IDN(0,0,0,0, 277), "Position feedback 1 type"}, {IDN(0,0,0,0, 278), "Maximum travel range"}, {IDN(0,0,0,0, 279), "IDN list of password protected data"}, {IDN(0,0,0,0, 280), "Underflow threshold"}, {IDN(0,0,0,0, 282), "Positioning command value"}, {IDN(0,0,0,0, 283), "Current coordinate offset"}, {IDN(0,0,0,0, 292), "List of supported operation modes"}, {IDN(0,0,0,0, 293), "Selectively backup working memory procedure command"}, {IDN(0,0,0,0, 294), "Divider modulo value"}, {IDN(0,0,0,0, 295), "Drive enable delay time"}, {IDN(0,0,0,0, 296), "Velocity feed forward gain"}, {IDN(0,0,0,0, 297), "Homing distance"}, {IDN(0,0,0,0, 298), "Suggest home switch distance"}, {IDN(0,0,0,0, 299), "Home switch offset 1"}, {IDN(0,0,0,0, 300), "Real-time control bit 1"}, {IDN(0,0,0,0, 301), "Allocation of real-time control bit 1",}, {IDN(0,0,0,0, 302), "Real-time control bit 2"}, {IDN(0,0,0,0, 303), "Allocation of real-time control bit 2"}, {IDN(0,0,0,0, 304), "Real-time status bit 1"}, {IDN(0,0,0,0, 305), "Allocation of real-time status bit 1"}, {IDN(0,0,0,0, 306), "Real-time status-bit 2"}, {IDN(0,0,0,0, 307), "Allocation of real-time status bit 2"}, {IDN(0,0,0,0, 308), "Synchronization operation status"}, {IDN(0,0,0,0, 309), "Synchronization error status"}, {IDN(0,0,0,0, 310), "Overload warning"}, {IDN(0,0,0,0, 311), "Amplifier overtemperature warning"}, {IDN(0,0,0,0, 312), "Motor overtemperature warning"}, {IDN(0,0,0,0, 313), "Cooling error warning"}, {IDN(0,0,0,0, 315), "Positioning velocity higher than n Limit"}, {IDN(0,0,0,0, 323), "Target position outside of travel range"}, {IDN(0,0,0,0, 326), "Parameter checksum"}, {IDN(0,0,0,0, 327), "IDN list of checksum parameter"}, {IDN(0,0,0,0, 328), "Bit number allocation list for signal status word"}, {IDN(0,0,0,0, 329), "Bit number allocation list for signal control word"}, {IDN(0,0,0,0, 330), "Status 'nfeedback = ncommand'"}, {IDN(0,0,0,0, 331), "Status 'nfeedback = 0'"}, {IDN(0,0,0,0, 332), "Status 'nfeedback less then nx'"}, {IDN(0,0,0,0, 333), "Status 'T higher than Tx'"}, {IDN(0,0,0,0, 334), "Status 'T greater than Tlimit '"}, {IDN(0,0,0,0, 335), "Status 'ncommand greater than nlimit'"}, {IDN(0,0,0,0, 336), "Status 'In position'"}, {IDN(0,0,0,0, 337), "Status 'P greater Px'"}, {IDN(0,0,0,0, 338), "Status 'Position feedback = active target position'"}, {IDN(0,0,0,0, 339), "Status 'nfeedback less than minimum spindle speed'"}, {IDN(0,0,0,0, 340), "Status 'nfeedback exceeds maximum spindle speed'"}, {IDN(0,0,0,0, 341), "Status 'In Coarse position'"}, {IDN(0,0,0,0, 342), "Status 'Target position attained'"}, {IDN(0,0,0,0, 343), "Status 'Interpolator halted'"}, {IDN(0,0,0,0, 346), "Positioning control"}, {IDN(0,0,0,0, 347), "Velocity error"}, {IDN(0,0,0,0, 348), "Acceleration feed forward gain"}, {IDN(0,0,0,0, 349), "Bipolar jerk limit"}, {IDN(0,0,0,0, 356), "Distance home switch - marker puls"}, {IDN(0,0,0,0, 357), "Marker pulse distance"}, {IDN(0,0,0,0, 358), "Home switch offset 2"}, {IDN(0,0,0,0, 359), "Positioning deceleration"}, {IDN(0,0,0,0, 360), "MDT data container"}, {IDN(0,0,0,0, 362), "MDT data container A list index"}, {IDN(0,0,0,0, 364), "AT data container A1"}, {IDN(0,0,0,0, 366), "AT data container A list index"}, {IDN(0,0,0,0, 368), "Data container A pointer"}, {IDN(0,0,0,0, 370), "MDT data container A/B configuration list"}, {IDN(0,0,0,0, 371), "AT data container A/B configuration list"}, {IDN(0,0,0,0, 372), "Drive Halt acceleration bipolar"}, {IDN(0,0,0,0, 377), "Velocity feedback monitoring window"}, {IDN(0,0,0,0, 378), "Absolute encoder range 1"}, {IDN(0,0,0,0, 379), "Absolute encoder range 2"}, {IDN(0,0,0,0, 380), "DC bus voltage"}, {IDN(0,0,0,0, 381), "DC bus current"}, {IDN(0,0,0,0, 382), "DC bus power"}, {IDN(0,0,0,0, 383), "Motor temperature"}, {IDN(0,0,0,0, 384), "Amplifier temperature"}, {IDN(0,0,0,0, 385), "Active power"}, {IDN(0,0,0,0, 386), "Active position feedback value"}, {IDN(0,0,0,0, 387), "Power overload"}, {IDN(0,0,0,0, 388), "Braking current limit"}, {IDN(0,0,0,0, 389), "Effective current"}, {IDN(0,0,0,0, 390), "DiagnosticNumber"}, {IDN(0,0,0,0, 391), "Position feedback monitoring window"}, {IDN(0,0,0,0, 392), "Velocity feedback filter"}, {IDN(0,0,0,0, 393), "Command value mode"}, {IDN(0,0,0,0, 398), "IDN list of configurable real-time/status bits"}, {IDN(0,0,0,0, 399), "IDN list of configurable real-time/control bits"}, {IDN(0,0,0,0, 400), "Home switch"}, {IDN(0,0,0,0, 401), "Probe 1"}, {IDN(0,0,0,0, 402), "Probe 2"}, {IDN(0,0,0,0, 403), "Position feedback value status"}, {IDN(0,0,0,0, 404), "Position command value status"}, {IDN(0,0,0,0, 405), "Probe 1 enable"}, {IDN(0,0,0,0, 406), "Probe 2 enable"}, {IDN(0,0,0,0, 407), "Homing enable"}, {IDN(0,0,0,0, 408), "Reference marker pulse registered"}, {IDN(0,0,0,0, 409), "Probe 1 positive latched"}, {IDN(0,0,0,0, 410), "Probe 1 negative latched"}, {IDN(0,0,0,0, 411), "Probe 2 positive latched"}, {IDN(0,0,0,0, 412), "Probe 2 negative latched"}, {IDN(0,0,0,0, 413), "Bit number allocation of real-time control bit 1"}, {IDN(0,0,0,0, 414), "Bit number allocation of real-time control bit 2"}, {IDN(0,0,0,0, 415), "Bit number allocation of real-time status bit 1"}, {IDN(0,0,0,0, 416), "Bit number allocation of real-time status bit 2"}, {IDN(0,0,0,0, 417), "Positioning velocity threshold in modulo mode"}, {IDN(0,0,0,0, 418), "Target position window in modulo mode"}, {IDN(0,0,0,0, 419), "Positioning acknowledge"}, {IDN(0,0,0,0, 420), "Activate parameterization level procedure command (PL)"}, {IDN(0,0,0,0, 422), "Exit parameterization level procedure command"}, {IDN(0,0,0,0, 423), "IDN-list of invalid data for parameterization level"}, {IDN(0,0,0,0, 426), "Measuring data allocation 1"}, {IDN(0,0,0,0, 427), "Measuring data allocation 2"}, {IDN(0,0,0,0, 428), "IDN list of configurable measuring data"}, {IDN(0,0,0,0, 429), "Emergency stop deceleration"}, {IDN(0,0,0,0, 430), "Active target position"}, {IDN(0,0,0,0, 431), "Spindle positioning acceleration bipolar"}, {IDN(0,0,0,0, 437), "Positioning status"}, {IDN(0,0,0,0, 446), "Ramp reference velocity"}, {IDN(0,0,0,0, 447), "Set absolute position procedure command"}, {IDN(0,0,0,0, 448), "Set absolute position control word"}, {IDN(0,0,0,0, 460), "Position switches (position switch points off 1-16)"}, {IDN(0,0,0,0, 476), "Position switch control"}, {IDN(0,0,0,0, 477), "Position switch hysteresis"}, {IDN(0,0,0,0, 478), "Limit switch status"}, {IDN(0,0,0,0, 509), "Extended probe control"}, {IDN(0,0,0,0, 510), "Difference value probe 1"}, {IDN(0,0,0,0, 511), "Difference value probe 2"}, {IDN(0,0,0,0, 512), "Start position probing window 1"}, {IDN(0,0,0,0, 513), "End position probing window 1"}, {IDN(0,0,0,0, 514), "Start position probing window 2"}, {IDN(0,0,0,0, 515), "End position probing window 2"}, {IDN(0,0,0,0, 516), "Marker losses probe 1"}, {IDN(0,0,0,0, 517), "Marker losses probe 2"}, {IDN(0,0,0,0, 518), "Maximum marker losses probe 1"}, {IDN(0,0,0,0, 519), "Maximum marker losses probe 2"}, {IDN(0,0,0,0, 520), "Axis control word"}, {IDN(0,0,0,0, 521), "Axis status word"}, {IDN(0,0,0,0, 522), "Difference value 1 latched"}, {IDN(0,0,0,0, 523), "Difference value 2 latched"}, {IDN(0,0,0,0, 524), "Probe 1 delay positive"}, {IDN(0,0,0,0, 525), "Delay Negative Edge, Probe 1"}, {IDN(0,0,0,0, 526), "Delay positive Edge, Probe 2"}, {IDN(0,0,0,0, 527), "Delay Negative Edge, Probe 2"}, {IDN(0,0,0,0, 530), "Clamping torque"}, {IDN(0,0,0,0, 531), "Checksum for backup operation data"}, {IDN(0,0,0,0, 532), "Limit switch control"}, {IDN(0,0,0,0, 533), "Motor continuous stall torque/force"}, {IDN(0,0,0,0,1000), "SCP Type & Version"}, {IDN(0,0,0,0,1001), "SERCOS III: Control unit cycle time (tNcyc)"}, {IDN(0,0,0,0,1002), "SERCOS III: Communication cycle time (tScyc)"}, {IDN(0,0,0,0,1003), "SERCOS III: Number of successive MDT errors"}, {IDN(0,0,0,0,1005), "SERCOS III: Feedback value computation time (t5)"}, {IDN(0,0,0,0,1006), "SERCOS III: AT transmission starting time (t1)"}, {IDN(0,0,0,0,1007), "SERCOS III: Synchronization time (t8)"}, {IDN(0,0,0,0,1008), "SERCOS III: Command value valid time (t3)"}, {IDN(0,0,0,0,1009), "SERCOS III: Device Control offset in MDT"}, {IDN(0,0,0,0,1010), "SERCOS III: Length of MDT"}, {IDN(0,0,0,0,1011), "SERCOS III: Device Status offset in AT"}, {IDN(0,0,0,0,1012), "SERCOS III: Length of AT"}, {IDN(0,0,0,0,1013), "SERCOS III: SVC offset in MDT"}, {IDN(0,0,0,0,1014), "SERCOS III: SVC offset in AT"}, {IDN(0,0,0,0,1015), "SERCOS III: Ring delay"}, {IDN(0,0,0,0,1016), "SERCOS III: Slave delay"}, {IDN(0,0,0,0,1017), "SERCOS III: Transmission starting time IP channel"}, {IDN(0,0,0,0,1018), "SERCOS III: SYNC delay"}, {IDN(0,0,0,0,1019), "SERCOS III: MAC address"}, {IDN(0,0,0,0,1020), "SERCOS III: IP address"}, {IDN(0,0,0,0,1021), "SERCOS III: Network mask"}, {IDN(0,0,0,0,1022), "SERCOS III: Gateway address"}, {IDN(0,0,0,0,1023), "SERCOS III: Sync jitter"}, {IDN(0,0,0,0,1024), "SERCOS III: Ring control - node control"}, {IDN(0,0,0,0,1025), "SERCOS III: Ring status - node status"}, {IDN(0,0,0,0,1026), "SERCOS III: Hardware identification"}, {IDN(0,0,0,0,1028), "SERCOS III: Error counter MDT0 MST"}, {IDN(0,0,0,0,1029), "SERCOS III: Error counter MDT0-3"}, {IDN(0,0,0,0,1030), "SERCOS III: Error counter AT0-3"}, {IDN(0,0,0,0,1031), "Signal assignment Port 1 & Port 2"}, {IDN(0,0,0,0,1035), "Error counter Port1 and Port2"}, {IDN(0,0,0,0,1040), "SERCOSAddress"}, {IDN(0,0,0,0,1041), "AT Command value valid time (t9)"}, {IDN(0,0,0,0,1044), "Device Control"}, {IDN(0,0,0,0,1045), "Device Status"}, {IDN(0,0,0,0,1046), "IDN-list of SERCOS addresses in device"}, {IDN(0,0,0,0,1134), "SERCOS III: Device control"}, {IDN(0,0,0,0,1135), "SERCOS III: Device status"}, {IDN(1,0,0,0,1027), "Requested MTU"}, {IDN(2,0,0,0,1027), "Effective MTU"}, {0, NULL} }; static value_string_ext siii_mdt_idn_text_ext = VALUE_STRING_EXT_INIT(siii_mdt_idn_text); static const value_string siii_mdt_svch_dbe_text[]= { {0x00, "Element 0: Closed SVC"}, {0x01, "Element 1: Opening IDN"}, {0x02, "Element 2: Name of operation data"}, {0x03, "Element 3: Attribute of operation data"}, {0x04, "Element 4: Unit of operation data"}, {0x05, "Element 5: Minimum value of operation data"}, {0x06, "Element 6: Maximum value of operation data"}, {0x07, "Element 7: Operation data"}, {0, NULL} }; static const true_false_string siii_mdt_svch_eot_text = { "Transmission in progress", "Last transmission" }; static const true_false_string siii_mdt_svch_rw_text = { "Read SVC INFO", "Write SVC INFO" }; static const value_string siii_mdt_devcontrol_topcontrol_text[]= { {0x00, "Fast Forward on P/S-Channel"}, {0x01, "Loopback on P-Channel and Fast Forward"}, {0x02, "Loopback on S-Channel and Fast Forward"}, {0, NULL} }; static const true_false_string siii_at_svch_error_text = { "No error", "Error in SVC" }; static const true_false_string siii_at_svch_busy_text = { "Step finished, slave ready for new step", "Step in process, new step not allowed" }; static const value_string siii_mst_phase_text[]= { {0x00, "CP0"}, {0x01, "CP1"}, {0x02, "CP2"}, {0x03, "CP3"}, {0x04, "CP4"}, {0x80, "CP0 (Phase Change)"}, {0x81, "CP1 (Phase Change)"}, {0x82, "CP2 (Phase Change)"}, {0x83, "CP3 (Phase Change)"}, {0x84, "CP4 (Phase Change)"}, {0, NULL} }; #if 0 static const value_string siii_mst_teltype_text[]= { {0x00, "CP0"}, {0x01, "CP1"}, {0x02, "CP2"}, {0x03, "CP3"}, {0x04, "CP4"}, {0x80, "CP0 (Phase Change)"}, {0x81, "CP1 (Phase Change)"}, {0x82, "CP2 (Phase Change)"}, {0x83, "CP3 (Phase Change)"}, {0x84, "CP4 (Phase Change)"}, {0, NULL} }; #endif static const value_string siii_mst_channel_text[]= { {0x00, "P-Telegram"}, {0x01, "S-Telegram"}, {0, NULL} }; static const value_string siii_mst_type_text[]= { {0x00, "MDT"}, {0x01, "AT"}, {0, NULL} }; static const value_string siii_at_devstatus_errorconnection_text[]= { {0x00, "Error-free connection"}, {0x01, "Error in the connection occurs"}, {0, NULL} }; static const value_string siii_at_devstatus_topstatus_text[]= { {0x00, "Fast Forward on P/S-Channel"}, {0x01, "Loopback on P-Channel and Fast Forward"}, {0x02, "Loopback on S-Channel and Fast Forward"}, {0, NULL} }; static const true_false_string siii_at_cp0_support_functions_text = { "Slave doesn't support one or more of the requested functions", "Slave supports all requested functions" }; static const value_string siii_at_devstatus_inactiveportstatus_text[]= { {0x00, "No link on port"}, {0x01, "Link on port"}, {0x02, "S III P-Telegram on port"}, {0x03, "S III S-Telegram on port"}, {0, NULL} }; static const value_string siii_at_dev_status_proc_command_change_text[]= { {0x00, "No change in procedure command acknowledgement"}, {0x01, "Changing procedure command acknowledgement"}, {0, NULL} }; static const value_string siii_mdt_hotplug_control_functioncode_text[]= { {0x00, "No data"}, {0x01, "tScyc"}, {0x02, "t1"}, {0x03, "t6"}, {0x04, "t7"}, {0x05, "Communication Version"}, {0x06, "Communication timeout"}, {0x10, "MDT0 Length"}, {0x11, "MDT1 Length"}, {0x12, "MDT2 Length"}, {0x13, "MDT3 Length"}, {0x20, "AT0 Length"}, {0x21, "AT1 Length"}, {0x22, "AT2 Length"}, {0x23, "AT3 Length"}, {0x80, "MDT-SVC pointer"}, {0x81, "MDT-RTD pointer"}, {0x82, "AT-SVC pointer"}, {0x83, "AT-RTD pointer"}, {0, NULL} }; static value_string_ext siii_mdt_hotplug_control_functioncode_text_ext = VALUE_STRING_EXT_INIT(siii_mdt_hotplug_control_functioncode_text); static const value_string siii_mdt_hotplug_control_svc_switch_text[]= { {0, "Transmission via HP-field"}, {1, "Switch to SVC"}, {0, NULL} }; static const value_string siii_mdt_hotplug_status_ackcode_text[]= { {0x80, "MDT-SVC pointer"}, {0x81, "MDT-RTD pointer"}, {0x82, "AT-SVC pointer"}, {0x83, "AT-RTD pointer"}, {255, "Next Sercos Slave has same address"}, {0, NULL} }; static const value_string siii_at_hotplug_status_error_text[]= { {0, "Acknowledgement in HP-1"}, {1, "Error in HP-1"}, {0, NULL} }; static void dissect_siii_mst(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree *subtree; proto_tree *subtree2; subtree = proto_tree_add_subtree(tree, tvb, 0, 6, ett_siii_mst, NULL, "MST"); subtree2 = proto_tree_add_subtree(subtree, tvb, 0, 1, ett_siii_mst_teltype, NULL, "Telegram Type"); proto_tree_add_item(subtree2, hf_siii_mst_channel, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree2, hf_siii_mst_type, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree2, hf_siii_mst_cyclecntvalid, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree2, hf_siii_mst_telno, tvb, 0, 1, ENC_LITTLE_ENDIAN); subtree2 = proto_tree_add_subtree(subtree, tvb, 1, 1, ett_siii_mst_phase, NULL, "Phase Field"); proto_tree_add_item(subtree2, hf_siii_mst_phase, tvb, 1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree2, hf_siii_mst_cyclecnt, tvb, 1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_siii_mst_crc32, tvb, 2, 4, ENC_LITTLE_ENDIAN); } static void dissect_siii_mdt_hp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree *subtree; static int * const ctrl_fields[] = { &hf_siii_mdt_hotplug_control_svc_switch, &hf_siii_mdt_hotplug_control_param, NULL }; subtree = proto_tree_add_subtree(tree, tvb, 0, 8, ett_siii_mdt_hp, NULL, "Hot-Plug"); proto_tree_add_item(subtree, hf_siii_mdt_hotplug_address, tvb, 0, 2, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(subtree, tvb, 2, hf_siii_mdt_hp_ctrl, ett_siii_mdt_hp_ctrl, ctrl_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_siii_mdt_hp_info, tvb, 4, 4, ENC_NA); } static void dissect_siii_mdt_devctrl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { static int * const ctrl_fields[] = { &hf_siii_at_dev_control_ident, &hf_siii_mdt_dev_control_change_topology, &hf_siii_mdt_dev_control_top_control, NULL }; proto_tree_add_bitmask(tree, tvb, 0, hf_siii_mdt_dev_control, ett_siii_mdt_devctrl, ctrl_fields, ENC_LITTLE_ENDIAN); } static void dissect_siii_mdt_svc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint devno _U_) /* devno will be needed in later versions */ { proto_tree *subtree; proto_item *ti; static int * const svch_fields[] = { &hf_siii_mdt_svch_dbe, /* data block element */ &hf_siii_mdt_svch_eot, /* end of transmission */ &hf_siii_mdt_svch_rw, /* read or write */ &hf_siii_mdt_svch_mhs, /* master hand shake */ NULL }; guint16 svc_ctrl = tvb_get_letohs(tvb, 0); /* service channel header */ guint8 svc_dbe = (svc_ctrl>>3) & 7; /* accessed data block element */ proto_tree_add_bitmask(tree, tvb, 0, hf_siii_mdt_svch_ctrl, ett_siii_mdt_svcctrl, svch_fields, ENC_LITTLE_ENDIAN); ti = proto_tree_add_item(tree, hf_siii_mdt_svch_info, tvb, 2, 4, ENC_NA); if (1 == svc_dbe) { subtree = proto_item_add_subtree(ti, ett_siii_mdt_svcinfo); proto_tree_add_item(subtree, hf_siii_idn_code, tvb, 2, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_siii_mdt_svch_idn, tvb, 2, 4, ENC_LITTLE_ENDIAN); } } static void dissect_siii_mdt_cp0(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { static int * const version_fields[] = { &hf_siii_mdt_version_switch_off_sercos_telegrams, &hf_siii_mdt_version_fast_cp_switch, &hf_siii_mdt_version_transmission_of_communication_parameters_mdt0_cp0, &hf_siii_mdt_version_num_mdt_at_cp1_2, &hf_siii_mdt_version_initprocvers, NULL }; proto_tree_add_bitmask(tree, tvb, 0, hf_siii_mdt_version, ett_siii_mdt_version, version_fields, ENC_LITTLE_ENDIAN); } static void dissect_siii_mdt_cp1_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno) { guint devstart = telno * SERCOS_SLAVE_GROUP_SIZE; /* MDT0: slaves 0-127; MDT1: slaves 128-255; ... */ tvbuff_t *tvb_n; guint idx; proto_tree *subtree; proto_tree *subtree_svc; proto_tree *subtree_devctrl; subtree_svc = proto_tree_add_subtree(tree, tvb, 0, SERCOS_SLAVE_GROUP_SIZE * 6, ett_siii_mdt_svc, NULL, "Service Channels"); subtree_devctrl = proto_tree_add_subtree(tree, tvb, SERCOS_SLAVE_GROUP_SIZE * 6, 512, ett_siii_mdt_svc, NULL, "Device Control"); for (idx = 0; idx < SERCOS_SLAVE_GROUP_SIZE; ++idx) /* each MDT of CP1/2 has data for 128 different slaves */ { tvb_n = tvb_new_subset_length(tvb, 6 * idx, 6); /* subset for service channel data */ subtree = proto_tree_add_subtree_format(subtree_svc, tvb_n, 0, 6, ett_siii_mdt_svc_channel, NULL, "Device %u", idx + devstart); dissect_siii_mdt_svc(tvb_n, pinfo, subtree, idx + devstart); tvb_n = tvb_new_subset_length(tvb, SERCOS_SLAVE_GROUP_SIZE * 6 + 4 * idx, 2); /* subset for device control information */ subtree = proto_tree_add_subtree_format(subtree_devctrl, tvb_n, 0, 2, ett_siii_mdt_dev_control, NULL, "Device %u", idx + devstart); dissect_siii_mdt_devctrl(tvb_n, pinfo, subtree); } } static void dissect_siii_mdt_cp3_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno) { /* guint devstart _U_ = telno * SERCOS_SLAVE_GROUP_SIZE; */ if (0 == telno) /* dissect hotplug field in MDT0 only */ dissect_siii_mdt_hp(tvb, pinfo, tree); /* offsets of service channel, device status and connections are unknown * this data could be extracted from svc communication during CP2 */ proto_tree_add_item(tree, hf_siii_service_channels, tvb, 0, 0, ENC_NA); proto_tree_add_item(tree, hf_siii_device_controls, tvb, 0, 0, ENC_NA); } static void dissect_siii_mdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *subtree; tvbuff_t *tvb_n; guint t_phase; guint telno; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIII MDT"); t_phase = (tvb_get_guint8(tvb, 1)&0x8F); /* read communication phase out of SERCOS III header */ telno = (tvb_get_guint8(tvb, 0) & 0xF); /* read number of MDT out of SERCOS III header */ if (t_phase & 0x80) /* communication phase switching in progress */ { col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP?s -> CP%u", (t_phase&0x0f)); } else /* communication as usual */ { col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP%u", (t_phase&0x0f)); } subtree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_siii_mdt, NULL, "MDT%u", telno); dissect_siii_mst(tvb, pinfo, subtree); /* dissect SERCOS III header */ switch (t_phase) /* call the MDT dissector depending on the current communication phase */ { case COMMUNICATION_PHASE_0: /* CP0 */ tvb_n = tvb_new_subset_length(tvb, 6, 40); dissect_siii_mdt_cp0(tvb_n, pinfo, subtree); break; case COMMUNICATION_PHASE_1: /* CP1 */ case COMMUNICATION_PHASE_2: /* CP2 */ tvb_n = tvb_new_subset_length(tvb, 6, 1280); dissect_siii_mdt_cp1_2(tvb_n, pinfo, subtree, telno); break; case COMMUNICATION_PHASE_3: /* CP3 */ case COMMUNICATION_PHASE_4: /* CP4 */ tvb_n = tvb_new_subset_remaining(tvb, 6); dissect_siii_mdt_cp3_4(tvb_n, pinfo, subtree, telno); break; default: proto_tree_add_expert(tree, pinfo, &ei_siii_cp_unknown, tvb, 6, -1); } } static void dissect_siii_at_svc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint devno _U_) /* devno will be used in later versions */ { static int * const svch_fields[] = { &hf_siii_at_svch_valid, &hf_siii_at_svch_error, &hf_siii_at_svch_busy, &hf_siii_at_svch_ahs, NULL }; proto_tree_add_bitmask(tree, tvb, 0, hf_siii_at_svch_stat, ett_siii_at_svcstat, svch_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_siii_at_svch_info, tvb, 2, 4, ENC_NA); } static void dissect_siii_at_devstat(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { static int * const status[] = { &hf_siii_at_dev_status_commwarning, &hf_siii_at_dev_status_change_topology, &hf_siii_at_dev_status_top_status, &hf_siii_at_dev_status_inactive_port_status, &hf_siii_at_dev_status_errorconnection, &hf_siii_at_dev_status_slave_valid, &hf_siii_at_dev_status_proc_command_change, &hf_siii_at_dev_status_parameterization_level_active, NULL }; proto_tree_add_bitmask(tree, tvb, 0, hf_siii_at_dev_status, ett_siii_at_devstatus, status, ENC_LITTLE_ENDIAN); } static void dissect_siii_at_hp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree *subtree; static int * const status[] = { &hf_siii_at_hotplug_status_error, &hf_siii_at_hotplug_status_hp0_finished, &hf_siii_at_hotplug_status_param, NULL }; subtree = proto_tree_add_subtree(tree, tvb, 0, 8, ett_siii_at_hp, NULL, "Hot-Plug"); proto_tree_add_item(subtree, hf_siii_at_hotplug_address, tvb, 0, 2, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(subtree, tvb, 2, hf_siii_at_hp_stat, ett_siii_at_hp_stat, status, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_siii_at_hp_info, tvb, 4, 4, ENC_NA); } static void dissect_siii_at_cp0(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { guint16 seqcnt; /* sequence counter */ guint16 tfield; /* topology field for sercos addresses */ guint16 i; proto_tree *subtree, *subtree2; proto_item* ti; subtree = proto_tree_add_subtree(tree, tvb, 0, 1024, ett_siii_recognized_devices, NULL, "Recognized Devices"); /* check sequence count field */ seqcnt = tvb_get_letohs(tvb, 0); proto_tree_add_uint(subtree, hf_siii_at_cp0_num_devices, tvb, 0, 2, (MAX_SERCOS_ADDRESS & seqcnt)-1); /* check SERCOS address of each topology field */ for (i = 1; i < MAX_SERCOS_DEVICES; ++i) { tfield = tvb_get_letohs(tvb, i*2); if (tfield == 0xFFFF) { proto_tree_add_uint_format(subtree, hf_siii_at_cp0_sercos_address, tvb, i*2, 2, 0xFFFF, "Sercos Address %u: No Device", i); } else { ti = proto_tree_add_uint_format(subtree, hf_siii_at_cp0_sercos_address, tvb, i*2, 2, (tfield & MAX_SERCOS_ADDRESS), "Sercos Address %u: %u", i, (tfield & MAX_SERCOS_ADDRESS)); subtree2 = proto_item_add_subtree(ti, ett_siii_at_sercos_address); proto_tree_add_item(subtree2, hf_siii_at_cp0_support_functions, tvb, i*2, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree2, hf_siii_at_cp0_device_address, tvb, i*2, 2, ENC_LITTLE_ENDIAN); } } } static void dissect_siii_at_cp1_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno) { guint devstart = telno * SERCOS_SLAVE_GROUP_SIZE; /* AT0: slaves 0-127; AT1: slaves 128-255; ... */ tvbuff_t *tvb_n; guint idx; proto_tree *subtree; proto_tree *subtree_svc; proto_tree *subtree_devstat; subtree_svc = proto_tree_add_subtree(tree, tvb, 0, SERCOS_SLAVE_GROUP_SIZE * 6, ett_siii_at_svc, NULL, "Service Channel"); subtree_devstat = proto_tree_add_subtree(tree, tvb, SERCOS_SLAVE_GROUP_SIZE * 6, 512, ett_siii_at_devstats, NULL, "Device Status"); for (idx = 0; idx < SERCOS_SLAVE_GROUP_SIZE; ++idx) /* each AT of CP1/2 has data of 128 different slaves */ { tvb_n = tvb_new_subset_length(tvb, 6 * idx, 6); /* subset for service channel data */ subtree = proto_tree_add_subtree_format(subtree_svc, tvb_n, 0, 6, ett_siii_at_svc_channel, NULL, "Device %u", idx + devstart); dissect_siii_at_svc(tvb_n, pinfo, subtree, idx + devstart); tvb_n = tvb_new_subset_length(tvb, SERCOS_SLAVE_GROUP_SIZE * 6 + 4 * idx, 2); /* subset for device status information */ subtree = proto_tree_add_subtree_format(subtree_devstat, tvb_n, 0, 2, ett_siii_at_dev_status, NULL, "Device %u", idx + devstart); dissect_siii_at_devstat(tvb_n, pinfo, subtree); } } static void dissect_siii_at_cp3_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno) { if (0 == telno) /* dissect hotplug field in AT0 only */ dissect_siii_at_hp(tvb, pinfo, tree); /* offsets of service channel, device status and connections are unknown * this data could be extracted from svc communication during CP2 */ proto_tree_add_item(tree, hf_siii_service_channels, tvb, 0, 0, ENC_NA); proto_tree_add_item(tree, hf_siii_device_status, tvb, 0, 0, ENC_NA); } static void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *subtree; tvbuff_t *tvb_n; guint8 phase; guint telno; phase = (tvb_get_guint8(tvb, 1)&0x8F); /* read communication phase out of SERCOS III header*/ telno = (tvb_get_guint8(tvb, 0) & 0xF); /* read number of AT out of SERCOS III header */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIII AT"); if (phase & 0x80) /* communication phase switching in progress */ { col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP?s -> CP%u", (phase&0x0f)); } else /* communication as usual */ { col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP%u", (phase&0x0f)); } subtree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_siii_at, NULL, "AT%u", telno); dissect_siii_mst(tvb, pinfo, subtree); /* dissect SERCOS III header */ switch (phase) /* call the AT dissector depending on the current communication phase */ { case COMMUNICATION_PHASE_0: /* CP0 */ tvb_n = tvb_new_subset_length(tvb, 6, 1024); dissect_siii_at_cp0(tvb_n, pinfo, subtree); break; case COMMUNICATION_PHASE_1: /* CP1 */ case COMMUNICATION_PHASE_2: /* CP2 */ tvb_n = tvb_new_subset_length(tvb, 6, 1280); dissect_siii_at_cp1_2(tvb_n, pinfo, subtree, telno); break; case COMMUNICATION_PHASE_3: /* CP3 */ case COMMUNICATION_PHASE_4: /* CP4 */ tvb_n = tvb_new_subset_remaining(tvb, 6); dissect_siii_at_cp3_4(tvb_n, pinfo, subtree, telno); break; default: proto_tree_add_expert(tree, pinfo, &ei_siii_cp_unknown, tvb, 6, -1); break; } } /* Main dissector entry */ static int dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *siii_tree; guint type; const char *tel_ch = "?"; const char *tel_type = "?"; guint tel_no = 0; heur_dtbl_entry_t *hdtbl_entry; /* setup columns */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SERCOS III V1.1"); col_clear(pinfo->cinfo, COL_INFO); /* * In case the packet is a protocol encoded in the basic SercosIII transport stream, * give that protocol a chance to make a heuristic dissection, before we continue * to dissect it as a normal SercosIII packet. */ if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) return tvb_captured_length(tvb); /* check what we got on our hand */ type = tvb_get_guint8(tvb, 0); if (type & 0x80) /* primary or secondary channel */ tel_ch = "S"; else tel_ch = "P"; if (type & 0x40) /* master data telegram (mdt) or slave telegram (at) */ tel_type = "AT "; else tel_type = "MDT"; tel_no = type &0xF; /* even though it's reserved (the V1.1 spec states that it is reserved for additional MDT/AT) */ col_append_fstr(pinfo->cinfo, COL_INFO, "%s%u Channel=%s", tel_type, tel_no, tel_ch); ti = proto_tree_add_item(tree, proto_siii, tvb, 0, -1, ENC_NA); siii_tree = proto_item_add_subtree(ti, ett_siii); /* enter the specific dissector for AT or MDT */ if (type & 0x40) dissect_siii_at(tvb, pinfo, siii_tree); else dissect_siii_mdt(tvb, pinfo, siii_tree); return tvb_captured_length(tvb); } static void sercosiii_idn_code_format( gchar *result, guint32 svc_info ) { snprintf( result, ITEM_LABEL_LENGTH, "%c-%u-%04d.%d.%d", ((0xFFFF & svc_info)>>15)?'P':'S', /* private or sercos IDN */ (svc_info>>12)&7, /* parameter record */ (svc_info&4095), /* IDN */ (svc_info>>24) & 0xFF, /* structure index */ (svc_info>>16) & 0xFF); /* structure element */ } void proto_register_sercosiii(void) { static hf_register_info hf[] = { { &hf_siii_mdt_version, { "Communication Version", "siii.mdt.version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_version_num_mdt_at_cp1_2, { "Number of MDTs and ATS in CP1 and CP2", "siii.mdt.version.num_mdt_at_cp1_2", FT_UINT32, BASE_HEX, VALS(siii_mdt_version_num_mdtat_cp1_2_text), 0x00030000, NULL, HFILL } }, { &hf_siii_mdt_version_transmission_of_communication_parameters_mdt0_cp0, { "Transmission of Communication parameters", "siii.mdt.version.mdt0_cp0_transm_comm_parameter", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00100000, NULL, HFILL } }, { &hf_siii_mdt_version_fast_cp_switch, { "Fast CP switch", "siii.mdt.version.mdt0_cp0_fast_cp_switch", FT_BOOLEAN, 32, TFS(&siii_mdt_version_fast_cp_switch_text), 0x00200000, NULL, HFILL } }, { &hf_siii_mdt_version_switch_off_sercos_telegrams, { "Switch off Sercos III telegrams", "siii.mdt.version.mdt0_cp0_switch_off_sercos_telegram", FT_BOOLEAN, 32, TFS(&siii_switch_off_sercos_telegram_text), 0x00400000, NULL, HFILL } }, { &hf_siii_mdt_version_initprocvers, { "Initialization Procedure Version Number", "siii.mdt.version.initprocvers", FT_BOOLEAN, 32, TFS(&siii_mdt_version_initprocvers_text), 0x0000FF00, NULL, HFILL } }, { &hf_siii_mdt_dev_control_top_control, { "Topology Control", "siii.mdt.devcontrol.topcontrol", FT_UINT16, BASE_DEC, VALS(siii_mdt_devcontrol_topcontrol_text), 3<<(12), NULL, HFILL } }, { &hf_siii_at_dev_control_ident, { "Identification", "siii.mdt.devcontrol.identrequest", FT_UINT16, BASE_DEC, NULL, 0x8000, NULL, HFILL } }, { &hf_siii_mdt_dev_control_change_topology, { "Changing Topology", "siii.mdt.devcontrol.topologychange", FT_UINT16, BASE_DEC, NULL, 1<<14, NULL, HFILL } }, { &hf_siii_mdt_dev_control, { "Word", "siii.mdt.devcontrol", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_siii_at_dev_status, { "Word", "siii.at.devstatus", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_at_dev_status_commwarning, { "Communication Warning", "siii.at.devstatus.commwarning", FT_UINT16, BASE_DEC, NULL, 1<<15, NULL, HFILL } }, { &hf_siii_at_cp0_support_functions, { "Support of requested functions", "siii.at.supfunctions", FT_BOOLEAN, 16, TFS(&siii_at_cp0_support_functions_text), 1<<15, NULL, HFILL } }, { &hf_siii_at_cp0_device_address, { "Sercos Address", "siii.at.sercosaddress", FT_UINT16, BASE_DEC, NULL, MAX_SERCOS_ADDRESS, NULL, HFILL } }, { &hf_siii_at_dev_status_change_topology, { "Topology Change", "siii.at.devstatus.topologychanged", FT_UINT16, BASE_DEC, NULL, 1<<14, NULL, HFILL } }, { &hf_siii_at_dev_status_top_status, { "Topology Status", "siii.at.devstatus.topstatus", FT_UINT16, BASE_DEC, VALS(siii_at_devstatus_topstatus_text), 0x3<<(12), NULL, HFILL } }, { &hf_siii_at_dev_status_inactive_port_status, { "Port 1 Status", "siii.at.devstatus.inactportstatus", FT_UINT16, BASE_DEC, VALS(siii_at_devstatus_inactiveportstatus_text), 0x3<<(10), NULL, HFILL } }, { &hf_siii_at_dev_status_errorconnection, { "Topology Status", "siii.at.devstatus.errorconnection", FT_UINT16, BASE_DEC, VALS(siii_at_devstatus_errorconnection_text), 1<<9, NULL, HFILL } }, { &hf_siii_at_dev_status_slave_valid, { "Slave data valid", "siii.at.devstatus.slavevalid", FT_UINT16, BASE_DEC, NULL, 1<<8, NULL, HFILL } }, { &hf_siii_at_dev_status_proc_command_change, { "Procedure Command Change", "siii.at.devstatus.proccmdchange", FT_UINT16, BASE_DEC, VALS(siii_at_dev_status_proc_command_change_text), 1<<5, NULL, HFILL } }, { &hf_siii_at_dev_status_parameterization_level_active, { "Parameterization level active", "siii.at.devstatus.paralevelactive", FT_UINT16, BASE_DEC, NULL, 1<<4, NULL, HFILL } }, { &hf_siii_mdt_svch_ctrl, {"SvcCtrl", "siii.mdt.svch.ctrl", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_at_svch_stat, {"SvcStat", "siii.mdt.svch.stat", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_svch_info, {"Svc Info", "siii.mdt.svch.info", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_siii_at_svch_info, {"Svc Info", "siii.at.svch.info", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_svch_idn, {"IDN", "siii.mdt.svch.idn", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &siii_mdt_idn_text_ext, 0, NULL, HFILL } }, { &hf_siii_mdt_svch_dbe, { "Data block element", "siii.mdt.svch.dbe", FT_UINT16, BASE_DEC, VALS(siii_mdt_svch_dbe_text), 0x0038, NULL, HFILL } }, { &hf_siii_mdt_svch_eot, {"End of element transmission", "siii.mdt.svch.eot", FT_BOOLEAN, 16, TFS(&siii_mdt_svch_eot_text), 0x0004, NULL, HFILL } }, { &hf_siii_mdt_svch_rw, {"Read/Write", "siii.mdt.svch.rw", FT_BOOLEAN, 16, TFS(&siii_mdt_svch_rw_text), 0x0002, NULL, HFILL } }, { &hf_siii_mdt_svch_mhs, {"Master Handshake", "siii.mdt.svch.mhs", FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL } }, { &hf_siii_at_svch_valid, { "SVC process", "siii.mdt.svch.proc", FT_BOOLEAN, 16, TFS(&tfs_valid_not_valid), 0x0008, NULL, HFILL } }, { &hf_siii_at_svch_error, {"SVC Error", "siii.mdt.svch.error", FT_BOOLEAN, 16, TFS(&siii_at_svch_error_text), 0x0004, NULL, HFILL } }, { &hf_siii_at_svch_busy, {"Busy", "siii.mdt.svch.busy", FT_BOOLEAN, 16, TFS(&siii_at_svch_busy_text), 0x0002, NULL, HFILL } }, { &hf_siii_at_svch_ahs, {"Handshake", "siii.at.svch.ahs", FT_UINT16, BASE_DEC, NULL, 0x01, NULL, HFILL } }, #if 0 { &hf_siii_svch_data_telofs_telno, {"Telegram Number", "siii.mdt.svch.data.telassign.telno", FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL } }, #endif #if 0 { &hf_siii_svch_data_telofs_mdt_at, {"Telegram Type", "siii.mdt.svch.data.telassign.mdt_at", FT_UINT16, BASE_DEC, VALS(siii_svch_data_mdt_at_text), 0x0800, NULL, HFILL } }, #endif #if 0 { &hf_siii_svch_data_telofs_offset, {"Telegram Offset", "siii.mdt.svch.data.telassign.offset", FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL } }, #endif #if 0 { &hf_siii_svch_data_proccmd_proccmdexec, {"Procedure Command Execution", "siii.mdt.svch.data.proccmd.interrupt", FT_UINT16, BASE_DEC, VALS(siii_svch_data_proccmd_proccmdexec_text), 0x0002, NULL, HFILL } }, #endif #if 0 { &hf_siii_svch_data_proccmd_proccmd, {"Procedure Command", "siii.mdt.svch.data.proccmd.set", FT_UINT16, BASE_DEC, VALS(siii_svch_data_proccmd_proccmd_text), 0x0001, NULL, HFILL } }, #endif { &hf_siii_mst_channel, { "Channel", "siii.channel", FT_UINT8, BASE_DEC, VALS(siii_mst_channel_text), 0x80, NULL, HFILL } }, { &hf_siii_mst_type, { "Telegram Type", "siii.type", FT_UINT8, BASE_DEC, VALS(siii_mst_type_text), 0x40, NULL, HFILL } }, { &hf_siii_mst_cyclecntvalid, { "Cycle Count Valid", "siii.cyclecntvalid", FT_BOOLEAN, 8, TFS(&tfs_valid_invalid), 0x20, NULL, HFILL } }, { &hf_siii_mst_telno, { "Telegram Number", "siii.telno", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_siii_mst_phase, { "Phase", "siii.mst.phase", FT_UINT8, BASE_HEX, VALS(siii_mst_phase_text), 0x8F, /* CHANGED: SB: new value is 0x8F for masking out phase */ NULL, HFILL } }, { &hf_siii_mst_cyclecnt, { "Cycle Cnt", "siii.mst.cyclecnt", FT_UINT8, BASE_DEC, NULL, 0x70, /* CHANGED: SB: new value is 0x70 for masking out cycle cnt */ NULL, HFILL } }, { &hf_siii_mst_crc32, { "CRC32", "siii.mst.crc32", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_hotplug_address, {"Sercos address", "siii.mdt.hp.sercosaddress", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_hp_ctrl, {"HP control", "siii.mdt.hp.ctrl", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_hp_info, {"HP info", "siii.mdt.hp.info", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_siii_at_hotplug_address, {"Sercos address", "siii.at.hp.sercosaddress", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_at_hp_stat, {"HP status", "siii.mdt.hp.stat", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_siii_at_hp_info, {"HP info", "siii.at.hp.info", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_siii_mdt_hotplug_control_param, {"Parameter", "siii.mdt.hp.parameter", FT_UINT16, BASE_DEC | BASE_EXT_STRING, &siii_mdt_hotplug_control_functioncode_text_ext, 0xFF, NULL, HFILL } }, { &hf_siii_mdt_hotplug_control_svc_switch, {"Switch to SVC", "siii.mdt.hp.switch", FT_UINT16, BASE_DEC, VALS(siii_mdt_hotplug_control_svc_switch_text), 0x0100, NULL, HFILL } }, { &hf_siii_at_hotplug_status_param, {"Parameter Received", "siii.at.hp.parameter", FT_UINT16, BASE_DEC, VALS(siii_mdt_hotplug_status_ackcode_text), 0x00FF, NULL, HFILL } }, { &hf_siii_at_hotplug_status_hp0_finished, {"HP/SVC", "siii.at.hp.hp0_finished", FT_UINT16, BASE_DEC, NULL, 0x0100, NULL, HFILL } }, { &hf_siii_at_hotplug_status_error, {"Error", "siii.at.hp.error", FT_UINT16, BASE_DEC, VALS(siii_at_hotplug_status_error_text), 0x0200, NULL, HFILL } }, { &hf_siii_service_channels, {"Service Channels", "siii.service_channels", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_siii_device_controls, {"Device Controls", "siii.device_controls", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_siii_device_status, {"Device Status", "siii.device_status", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_siii_idn_code, {"IDN code", "siii.idn_code", FT_UINT32, BASE_CUSTOM, CF_FUNC(sercosiii_idn_code_format), 0x0, NULL, HFILL } }, { &hf_siii_at_cp0_num_devices, {"Number of Devices", "siii.at.cp0.num_devices", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_siii_at_cp0_sercos_address, {"Sercos Address", "siii.at.cp0.sercos_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_siii, &ett_siii_header, &ett_siii_mdt, &ett_siii_mdt_version, &ett_siii_mdt_svc, &ett_siii_mdt_devctrls, &ett_siii_mdt_svc_channel, &ett_siii_mdt_dev_control, &ett_siii_at, &ett_siii_at_svc, &ett_siii_at_sercos_address, &ett_siii_at_devstats, &ett_siii_at_svc_channel, &ett_siii_at_dev_status, &ett_siii_mdt_devctrl, &ett_siii_at_devstatus, &ett_siii_at_sercosaddress, &ett_siii_mdt_svcctrl, &ett_siii_mdt_svcinfo, &ett_siii_at_svcstat, &ett_siii_at_svcinfo, &ett_siii_mdt_svch_data_error_info, &ett_siii_mdt_svch_data, &ett_siii_mst, &ett_siii_mst_teltype, &ett_siii_mst_phase, &ett_siii_mdt_hp, &ett_siii_at_hp, &ett_siii_mdt_hp_ctrl, &ett_siii_mdt_hp_info, &ett_siii_at_hp_stat, &ett_siii_at_hp_info, &ett_siii_recognized_devices }; static ei_register_info ei[] = { { &ei_siii_cp_unknown, { "siii.cp_unknown", PI_PROTOCOL, PI_WARN, "CP is unknown", EXPFILL }}, }; expert_module_t* expert_siii; /* Register the protocol name and description */ proto_siii = proto_register_protocol("SERCOS III V1.1", "SERCOS III V1.1", "siii"); register_dissector("sercosiii", dissect_siii, proto_siii); /* subdissector code */ heur_subdissector_list = register_heur_dissector_list("sercosiii", proto_siii); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_siii, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_siii = expert_register_protocol(proto_siii); expert_register_field_array(expert_siii, ei, array_length(ei)); } void proto_reg_handoff_sercosiii(void) { dissector_handle_t siii_handle; siii_handle = create_dissector_handle(dissect_siii, proto_siii); dissector_add_uint("ethertype", ETHERTYPE_SERCOS, siii_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-ses.c
/* packet-ses.c * * Routine to dissect ITU-T Rec. X.225 (1995 E)/ISO 8327-1 OSI Session Protocol packets * * Yuriy Sidelnikov <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/reassemble.h> #include <epan/proto_data.h> #include <wsutil/str_util.h> #include "packet-ber.h" #include "packet-ses.h" void proto_register_ses(void); void proto_reg_handoff_ses(void); void proto_register_clses(void); void proto_reg_handoff_clses(void); /* ses header fields */ static int proto_ses = -1; static int hf_ses_type = -1; static int hf_ses_type_0 = -1; static int hf_ses_length = -1; /* static int hf_ses_version = -1; */ /* static int hf_ses_reserved = -1; */ static int hf_ses_segment_data = -1; static int hf_ses_segments = -1; static int hf_ses_segment = -1; static int hf_ses_segment_overlap = -1; static int hf_ses_segment_overlap_conflicts = -1; static int hf_ses_segment_multiple_tails = -1; static int hf_ses_segment_too_long_segment = -1; static int hf_ses_segment_error = -1; static int hf_ses_segment_count = -1; static int hf_ses_reassembled_in = -1; static int hf_ses_reassembled_length = -1; /* ses fields defining a sub tree */ static gint ett_ses = -1; static gint ett_ses_param = -1; static gint ett_ses_segment = -1; static gint ett_ses_segments = -1; /* flags */ static int hf_connect_protocol_options_flags = -1; static int hf_version_number_options_flags = -1; static int hf_enclosure_item_options_flags = -1; static int hf_token_item_options_flags = -1; static gint ett_connect_protocol_options_flags = -1; static gint ett_transport_options_flags = -1; static gint ett_protocol_version_flags = -1; static gint ett_enclosure_item_flags = -1; static gint ett_token_item_flags = -1; static gint ett_ses_req_options_flags = -1; /* called SS user reference */ static int hf_called_ss_user_reference = -1; /* calling SS user reference */ static int hf_calling_ss_user_reference = -1; /* common reference */ static int hf_common_reference = -1; /* additional reference information */ static int hf_additional_reference_information = -1; /* token item */ static int hf_release_token = -1; static int hf_major_activity_token = -1; static int hf_synchronize_minor_token = -1; static int hf_data_token = -1; /* protocol options */ static int hf_able_to_receive_extended_concatenated_SPDU = -1; /* session requirement */ static int hf_session_user_req_flags = -1; static int hf_session_exception_report= -1; static int hf_data_separation_function_unit= -1; static int hf_symmetric_synchronize_function_unit= -1; static int hf_typed_data_function_unit= -1; static int hf_exception_function_unit= -1; static int hf_capability_function_unit=-1; static int hf_negotiated_release_function_unit= -1; static int hf_activity_management_function_unit= -1; static int hf_resynchronize_function_unit= -1; static int hf_major_resynchronize_function_unit= -1; static int hf_minor_resynchronize_function_unit= -1; static int hf_expedited_data_resynchronize_function_unit= -1; static int hf_duplex_function_unit= -1; static int hf_half_duplex_function_unit = -1; /* TSDU maximum size */ static int hf_proposed_tsdu_maximum_size_i2r = -1; static int hf_proposed_tsdu_maximum_size_r2i = -1; /* protocol version */ static int hf_protocol_version_1 = -1; static int hf_protocol_version_2 = -1; /* initial serial number */ static int hf_initial_serial_number = -1; /* enclosure item */ static int hf_beginning_of_SSDU = -1; static int hf_end_of_SSDU = -1; /* token setting item */ static const value_string token_setting_vals[] = { { 0x00, "initiator's side" }, { 0x01, "responder's side" }, { 0x02, "called SS user's choice" }, { 0x03, "reserved" }, { 0, NULL } }; static const true_false_string tfs_released_kept = { "Released", "Kept" }; static int hf_release_token_setting = -1; static int hf_major_activity_token_setting = -1; static int hf_synchronize_minor_token_setting = -1; static int hf_data_token_setting = -1; /* calling session selector */ static int hf_calling_session_selector = -1; /* called session selector */ static int hf_called_session_selector = -1; /* activity id */ static int hf_activity_identifier = -1; /* serial number */ static int hf_serial_number = -1; /* second serial number */ static int hf_second_serial_number = -1; /* second initial serial number */ static int hf_second_initial_serial_number = -1; /* large initial serial number */ static int hf_large_initial_serial_number = -1; /* large second initial serial number */ static int hf_large_second_initial_serial_number = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_ses_reason_code = -1; static int hf_ses_transport_implementation_restriction = -1; static int hf_ses_transport_no_reason = -1; static int hf_ses_parameter_group_inside_parameter_group = -1; static int hf_ses_user_data = -1; static int hf_ses_parameter_type = -1; static int hf_ses_transport_protocol_error = -1; static int hf_ses_transport_user_abort = -1; static int hf_ses_parameter_length = -1; static int hf_ses_transport_connection = -1; static int hf_ses_transport_option_flags = -1; /* clses header fields */ static int proto_clses = -1; static expert_field ei_ses_bad_length = EI_INIT; static expert_field ei_ses_bad_parameter_length = EI_INIT; #define PROTO_STRING_CLSES "ISO 9548-1 OSI Connectionless Session Protocol" static dissector_handle_t pres_handle = NULL; static reassembly_table ses_reassembly_table; static const fragment_items ses_frag_items = { /* Segment subtrees */ &ett_ses_segment, &ett_ses_segments, /* Segment fields */ &hf_ses_segments, &hf_ses_segment, &hf_ses_segment_overlap, &hf_ses_segment_overlap_conflicts, &hf_ses_segment_multiple_tails, &hf_ses_segment_too_long_segment, &hf_ses_segment_error, &hf_ses_segment_count, /* Reassembled in field */ &hf_ses_reassembled_in, /* Reassembled length field */ &hf_ses_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "SES segments" }; static const value_string ses_vals[] = { {SES_DATA_TRANSFER, "DATA TRANSFER (DT) SPDU" }, /* 1 */ {SES_PLEASE_TOKENS, "PLEASE TOKENS (PT) SPDU" }, /* 2 */ {SES_EXPEDITED, "EXPEDITED (EX) SPDU" }, /* 5 */ {SES_PREPARE, "PREPARE (PR) SPDU" }, /* 7 */ {SES_NOT_FINISHED, "NOT FINISHED (NF) SPDU" }, /* 8 */ {SES_FINISH, "FINISH (FN) SPDU" }, /* 9 */ {SES_DISCONNECT, "DISCONNECT (DN) SPDU" }, /* 10 */ {SES_REFUSE, "REFUSE (RF) SPDU" }, /* 12 */ {SES_CONNECTION_REQUEST, "CONNECT (CN) SPDU" }, /* 13 */ {SES_CONNECTION_ACCEPT, "ACCEPT (AC) SPDU" }, /* 14 */ {SES_CONNECTION_DATA_OVERFLOW, "CONNECT DATA OVERFLOW (CDO) SPDU"}, /* 15 */ {SES_OVERFLOW_ACCEPT, "OVERFLOW ACCEPT (OA) SPDU" }, /* 16 */ {SES_GIVE_TOKENS_CONFIRM, "GIVE TOKENS CONFIRM (GTC) SPDU"}, /* 21 */ {SES_GIVE_TOKENS_ACK, "GIVE TOKENS ACK (GTA) SPDU" }, /* 22 */ {SES_ABORT, "ABORT (AB) SPDU" }, /* 25 */ {SES_ABORT_ACCEPT, "ABORT ACCEPT (AA) SPDU" }, /* 26 */ {SES_ACTIVITY_RESUME, "ACTIVITY RESUME (AR) SPDU" }, /* 29 */ {SES_TYPED_DATA, "TYPED DATA (TD) SPDU" }, /* 33 */ {SES_RESYNCHRONIZE_ACK, "RESYNCHRONIZE ACK (RA) SPDU" }, /* 34 */ {SES_MAJOR_SYNC_POINT, "MAJOR SYNC POINT (MAP) SPDU" }, /* 41 */ {SES_MAJOR_SYNC_ACK, "MAJOR SYNC ACK (MAA) SPDU" }, /* 42 */ {SES_ACTIVITY_START, "ACTIVITY START (AS) SPDU" }, /* 45 */ {SES_EXCEPTION_DATA, "EXCEPTION DATA (ED) SPDU" }, /* 48 */ {SES_MINOR_SYNC_POINT, "MINOR SYNC POINT (MIP) SPDU" }, /* 49 */ {SES_MINOR_SYNC_ACK, "MINOR SYNC ACK (MIA) SPDU" }, /* 50 */ {SES_RESYNCHRONIZE, "RESYNCHRONIZE (RS) SPDU" }, /* 53 */ {SES_ACTIVITY_DISCARD, "ACTIVITY DISCARD (AD) SPDU" }, /* 57 */ {SES_ACTIVITY_DISCARD_ACK, "ACTIVITY DISCARD ACK (ADA) SPDU" }, /* 58 */ {SES_CAPABILITY, "CAPABILITY DATA (CD) SPDU" }, /* 61 */ {SES_CAPABILITY_DATA_ACK, "CAPABILITY DATA ACK (CDA) SPDU" }, /* 62 */ {CLSES_UNIT_DATA, "UNIT DATA (UD) SPDU" }, /* 64 */ {SES_EXCEPTION_REPORT, "EXCEPTION REPORT (ER) SPDU" }, /* 0x2000 */ {0, NULL } }; value_string_ext ses_vals_ext = VALUE_STRING_EXT_INIT(ses_vals); static const value_string ses_category0_vals[] = { {SES_PLEASE_TOKENS, "Please tokens PDU" }, {SES_GIVE_TOKENS, "Give tokens PDU" }, {0, NULL } }; static const value_string param_vals[] = { {Connection_Identifier, "Connection Identifier"}, /* 1 */ {Connect_Accept_Item, "Connect Accept Item"}, /* 5 */ {Called_SS_user_Reference, "Called SS user Reference"}, /* 9 */ {Calling_SS_user_Reference, "Calling SS user Reference"}, /* 10 */ {Common_Reference, "Common Reference"}, /* 11 */ {Additional_Reference_Information, "Additional Reference Information"}, /* 12 */ {Sync_Type_Item, "Sync Type Item"}, /* 15 */ {Token_Item, "Token Item"}, /* 16 */ {Transport_Disconnect, "Transport_Disconnect"}, /* 17 */ {Protocol_Options, "Protocol Options"}, /* 19 */ {Session_Requirement, "Session Requirement"}, /* 20 */ {TSDU_Maximum_Size, "TSDU Maximum Size"}, /* 21 */ {Version_Number, "Version Number"}, /* 22 */ {Initial_Serial_Number, "Initial Serial Number"}, /* 23 */ {Prepare_Type, "Prepare Type"}, /* 24 */ {EnclosureItem, "Enclosure Item"}, /* 25 */ {Token_Setting_Item, "Token Setting Item"}, /* 26 */ {Resync_Type, "Resync Type"}, /* 27 */ {Linking_Information, "Linking Information"}, /* 33 */ {Activity_Identifier, "Activity Identifier"}, /* 41 */ {Serial_Number, "Serial Number"}, /* 42 */ {Reflect_Parameter, "Reflect Parameter"}, /* 49 */ {Reason_Code, "Reason Code"}, /* 50 */ {Calling_Session_Selector, "Calling Session Selector"}, /* 51 */ {Called_Session_Selector, "Called Session Selector"}, /* 52 */ {Second_Resync_Type, "Second Resync Type"}, /* 53 */ {Second_Serial_Number, "Second Serial Number"}, /* 54 */ {Second_Initial_Serial_Number, "Second Initial Serial Number"}, /* 55 */ {Upper_Limit_Serial_Number, "Upper Limit Serial Number"}, /* 56 */ {Large_Initial_Serial_Number, "Large Initial Serial Number"}, /* 57 */ {Large_Second_Initial_Serial_Number, "Large Second Initial Serial Number"}, /* 58 */ {Data_Overflow, "Data Overflow"}, /* 60 */ {User_Data, "Session user data"}, /* 193 */ {Extended_User_Data, "Session extended user data"}, /* 194 */ {0, NULL} }; static value_string_ext param_vals_ext = VALUE_STRING_EXT_INIT(param_vals); static const value_string reason_vals[] = { {reason_not_specified, "Rejection by called SS-user; reason not specified" }, {temporary_congestion, "Rejection by called SS-user due to temporary congestion" }, {Subsequent, "Rejection by called SS-user." }, {SES_DISCONNECT, "Rejection by the SPM; implementation restriction stated in the PICS" }, {Session_Selector_unknown, "Session Selector unknown" }, {SS_user_not_attached_to_SSAP, "SS-user not attached to SSAP" }, {SPM_congestion_at_connect_time, "SPM congestion at connect time" }, {versions_not_supported, "Proposed protocol versions not supported" }, {SPM_reason_not_specified, "Rejection by the SPM; reason not specified" }, {SPM_implementation_restriction, "Finish PDU" }, {0, NULL } }; static value_string_ext reason_vals_ext = VALUE_STRING_EXT_INIT(reason_vals); /* desegmentation of OSI over ses */ static gboolean ses_desegment = TRUE; /* RTSE reassembly data */ static guint ses_pres_ctx_id = 0; static gboolean ses_rtse_reassemble = FALSE; static void call_pres_dissector(tvbuff_t *tvb, int offset, guint16 param_len, packet_info *pinfo, proto_tree *tree, proto_tree *param_tree, struct SESSION_DATA_STRUCTURE *session) { /* do we have OSI presentation packet dissector ? */ if(!pres_handle) { /* No - display as data */ if (tree) { proto_tree_add_item(param_tree, hf_ses_user_data, tvb, offset, param_len, ENC_NA); } } else { /* Yes - call presentation dissector */ tvbuff_t *next_tvb; next_tvb = tvb_new_subset_length(tvb, offset, param_len); /* Pass the session pdu to the presentation dissector */ call_dissector_with_data(pres_handle, next_tvb, pinfo, tree, session); } } /* this routine returns length of parameter field, parameter group, or parameter */ static int get_item_len(tvbuff_t *tvb, int offset, int *len_len) { guint16 len; len = tvb_get_guint8(tvb, offset); if(len == TWO_BYTE_LEN) { len = tvb_get_ntohs(tvb, offset+1); *len_len = 3; } else *len_len = 1; return len; } static gboolean dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree, proto_tree *param_tree, packet_info *pinfo, guint8 param_type, guint16 param_len, proto_item *param_len_item, guint8 *enclosure_item_flags, struct SESSION_DATA_STRUCTURE *session) { gboolean has_user_information = TRUE; guint16 flags; asn1_ctx_t asn1_ctx; static int * const item_option_flags[] = { &hf_release_token, &hf_major_activity_token, &hf_synchronize_minor_token, &hf_data_token, NULL }; static int * const transport_option_flags[] = { &hf_ses_transport_connection, &hf_ses_transport_user_abort, &hf_ses_transport_protocol_error, &hf_ses_transport_no_reason, &hf_ses_transport_implementation_restriction, NULL }; static int * const protocol_options_flags[] = { &hf_able_to_receive_extended_concatenated_SPDU, NULL }; static int * const req_options_flags[] = { &hf_session_exception_report, &hf_data_separation_function_unit, &hf_symmetric_synchronize_function_unit, &hf_typed_data_function_unit, &hf_exception_function_unit, &hf_capability_function_unit, &hf_negotiated_release_function_unit, &hf_activity_management_function_unit, &hf_resynchronize_function_unit, &hf_major_resynchronize_function_unit, &hf_minor_resynchronize_function_unit, &hf_expedited_data_resynchronize_function_unit, &hf_duplex_function_unit, &hf_half_duplex_function_unit, NULL }; static int * const version_flags[] = { &hf_protocol_version_2, &hf_protocol_version_1, NULL }; static int * const enclosure_flags[] = { &hf_end_of_SSDU, &hf_beginning_of_SSDU, NULL }; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); switch (param_type) { case Called_SS_user_Reference: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_called_ss_user_reference, tvb, offset, param_len, ENC_NA); break; case Calling_SS_user_Reference: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_calling_ss_user_reference, tvb, offset, param_len, ENC_NA); break; case Common_Reference: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_common_reference, tvb, offset, param_len, ENC_NA); break; case Additional_Reference_Information: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_additional_reference_information, tvb, offset, param_len, ENC_NA); break; case Token_Item: if (param_len != 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 1", param_len); break; } proto_tree_add_bitmask(param_tree, tvb, offset, hf_token_item_options_flags, ett_token_item_flags, item_option_flags, ENC_NA); break; case Transport_Disconnect: if (param_len != 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 1", param_len); break; } proto_tree_add_bitmask(param_tree, tvb, offset, hf_ses_transport_option_flags, ett_transport_options_flags, transport_option_flags, ENC_NA); if(tvb_get_guint8(tvb, offset) & user_abort ) { session->abort_type = SESSION_USER_ABORT; } else { session->abort_type = SESSION_PROVIDER_ABORT; } break; case Protocol_Options: if (param_len != 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 1", param_len); break; } proto_tree_add_bitmask(param_tree, tvb, offset, hf_connect_protocol_options_flags, ett_connect_protocol_options_flags, protocol_options_flags, ENC_NA); break; case Session_Requirement: if (param_len != 2) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 2", param_len); break; } proto_tree_add_bitmask(param_tree, tvb, offset, hf_session_user_req_flags, ett_ses_req_options_flags, req_options_flags, ENC_BIG_ENDIAN); break; case TSDU_Maximum_Size: if (param_len != 4) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 4", param_len); break; } if (tree) { proto_tree_add_item(param_tree, hf_proposed_tsdu_maximum_size_i2r, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(param_tree, hf_proposed_tsdu_maximum_size_r2i, tvb, offset+2, 2, ENC_BIG_ENDIAN); } break; case Version_Number: if (param_len != 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 1", param_len); break; } proto_tree_add_bitmask(param_tree, tvb, offset, hf_version_number_options_flags, ett_protocol_version_flags, version_flags, ENC_BIG_ENDIAN); break; case Initial_Serial_Number: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_initial_serial_number, tvb, offset, param_len, ENC_ASCII); break; case EnclosureItem: if (param_len != 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 1", param_len); break; } flags = tvb_get_guint8(tvb, offset); *enclosure_item_flags = (guint8) flags; proto_tree_add_bitmask(param_tree, tvb, offset, hf_enclosure_item_options_flags, ett_enclosure_item_flags, enclosure_flags, ENC_BIG_ENDIAN); if (flags & END_SPDU) { /* * In Data Transfer and Typed Data SPDUs, (X.225: 8.3.{11,13}.4) * "The User Information Field shall be present * if the Enclosure Item is not present, or has * bit 2 = 0", which presumably means it shall * *not* be present if the Enclosure item *is* * present and has bit 2 = 1. */ if(!(flags & BEGINNING_SPDU)) { /* X.225 7.11.2 also states: * "All DATA TRANSFER SPDUs, except the last DATA TRANSFER SPDU in a sequence greater than one, must have user information" * So if BEGINNING_SPDU and END_SPDU are set in the enclosure item, then this is presumably a sequence of one and * consequently there must be user information. * * So, there is only no user information if *only* END_SPDU is set. */ has_user_information = FALSE; } } break; case Token_Setting_Item: if (param_len != 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be 1", param_len); break; } if (tree) { proto_tree_add_item(param_tree, hf_release_token_setting, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(param_tree, hf_major_activity_token_setting, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(param_tree, hf_synchronize_minor_token_setting, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(param_tree, hf_data_token_setting, tvb, offset, 1, ENC_BIG_ENDIAN); } break; case Activity_Identifier: if (param_len == 0) break; /* 8.3.29.2 The parameter fields shall be as specified in Table 37. * Activity Identifier m 41 6 octets maximum */ proto_tree_add_item(param_tree, hf_activity_identifier, tvb, offset, param_len, ENC_NA); break; case Serial_Number: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_serial_number, tvb, offset, param_len, ENC_ASCII); break; case Reason_Code: /* 0: Rejection by called SS-user; reason not specified. 1: Rejection by called SS-user due to temporary congestion. 2: Rejection by called SS-user. Subsequent octets may be used for user data up to a length of 512 octets if Protocol Version 1 has been selected, and up to a length such that the total length (including SI and LI) of the SPDU does not exceed 65 539 octets if Protocol Version 2 has been selected. 128 + 1: Session Selector unknown. 128 + 2: SS-user not attached to SSAP. 128 + 3: SPM congestion at connect time. 128 + 4: Proposed protocol versions not supported. 128 + 5: Rejection by the SPM; reason not specified. 128 + 6: Rejection by the SPM; implementation restriction stated in the PICS. */ if (param_len < 1) { expert_add_info_format(pinfo, param_len_item, &ei_ses_bad_length, "Length is %u, should be >= 1", param_len); break; } proto_tree_add_item(param_tree, hf_ses_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; param_len--; if (param_len != 0) { call_pres_dissector(tvb, offset, param_len, pinfo, tree, param_tree, session); } break; case Calling_Session_Selector: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_calling_session_selector, tvb, offset, param_len, ENC_NA); break; case Called_Session_Selector: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_called_session_selector, tvb, offset, param_len, ENC_NA); break; case Second_Serial_Number: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_second_serial_number, tvb, offset, param_len, ENC_ASCII); break; case Second_Initial_Serial_Number: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_second_initial_serial_number, tvb, offset, param_len, ENC_ASCII); break; case Large_Initial_Serial_Number: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_large_initial_serial_number, tvb, offset, param_len, ENC_ASCII); break; case Large_Second_Initial_Serial_Number: if (param_len == 0) break; proto_tree_add_item(param_tree, hf_large_second_initial_serial_number, tvb, offset, param_len, ENC_ASCII); break; default: break; } return has_user_information; } static gboolean dissect_parameter_group(tvbuff_t *tvb, int offset, proto_tree *tree, proto_tree *pg_tree, packet_info *pinfo, guint16 pg_len, guint8 *enclosure_item_flags, struct SESSION_DATA_STRUCTURE *session) { gboolean has_user_information = TRUE; proto_item *ti, *param_len_item; proto_tree *param_tree; guint8 param_type; const char *param_str; int len_len; guint16 param_len; while(pg_len != 0) { param_type = tvb_get_guint8(tvb, offset); param_tree = proto_tree_add_subtree(pg_tree, tvb, offset, -1, ett_ses_param, &ti, val_to_str_ext(param_type, &param_vals_ext, "Unknown parameter type (0x%02x)")); param_str = val_to_str_ext_const(param_type, &param_vals_ext, "Unknown"); proto_tree_add_item(param_tree, hf_ses_parameter_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; pg_len--; param_len = get_item_len(tvb, offset, &len_len); if (len_len > pg_len) { proto_item_set_len(ti, pg_len + 1); proto_tree_add_expert_format(param_tree, pinfo, &ei_ses_bad_parameter_length, tvb, offset, pg_len, "Parameter length doesn't fit in parameter"); return has_user_information; } pg_len -= len_len; if (param_len > pg_len) { proto_item_set_len(ti, pg_len + 1 + len_len); proto_tree_add_expert_format(param_tree, pinfo, &ei_ses_bad_parameter_length, tvb, offset, pg_len, "Parameter length: %u, should be <= %u", param_len, pg_len); return has_user_information; } proto_item_set_len(ti, 1 + len_len + param_len); param_len_item = proto_tree_add_uint(param_tree, hf_ses_parameter_length, tvb, offset, len_len, param_len); offset += len_len; if (param_str != NULL) { switch(param_type) { /* PG's in PG's are invalid, presumably */ case Extended_User_Data: case User_Data: case Connect_Accept_Item: case Connection_Identifier: case Linking_Information: proto_tree_add_item(param_tree, hf_ses_parameter_group_inside_parameter_group, tvb, offset, param_len, ENC_NA); break; default: if (!dissect_parameter(tvb, offset, tree, param_tree, pinfo, param_type, param_len, param_len_item, enclosure_item_flags, session)) has_user_information = FALSE; break; } } offset += param_len; pg_len -= param_len; } return has_user_information; } /* * Returns TRUE if there's a User Information field in this SPDU, FALSE * otherwise. */ static gboolean dissect_parameters(tvbuff_t *tvb, int offset, guint16 len, proto_tree *tree, proto_tree *ses_tree, packet_info *pinfo, guint8 *enclosure_item_flags, struct SESSION_DATA_STRUCTURE *session) { gboolean has_user_information = TRUE; proto_item *ti, *param_len_item; proto_tree *param_tree; guint8 param_type; const char *param_str; int len_len; guint16 param_len; while (len != 0) { param_type = tvb_get_guint8(tvb, offset); param_tree = proto_tree_add_subtree(ses_tree, tvb, offset, -1, ett_ses_param, &ti, val_to_str_ext(param_type, &param_vals_ext, "Unknown parameter type (0x%02x)")); param_str = val_to_str_ext_const(param_type, &param_vals_ext, "Unknown"); proto_tree_add_item(param_tree, hf_ses_parameter_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; len--; param_len = get_item_len(tvb, offset, &len_len); if (len_len > len) { proto_item_set_len(ti, len + 1 ); proto_tree_add_expert_format(param_tree, pinfo, &ei_ses_bad_parameter_length, tvb, offset, len, "Parameter length doesn't fit in parameter"); return has_user_information; } len -= len_len; if (param_len > len) { proto_item_set_len(ti, len + 1 + len_len); proto_tree_add_expert_format(param_tree, pinfo, &ei_ses_bad_parameter_length, tvb, offset, len, "Parameter length: %u, should be <= %u", param_len, len); return has_user_information; } proto_item_set_len(ti, 1 + len_len + param_len); param_len_item = proto_tree_add_uint(param_tree, hf_ses_parameter_length, tvb, offset, len_len, param_len); offset += len_len; if (param_str != NULL) { switch(param_type) { case Extended_User_Data: call_pres_dissector(tvb, offset, param_len, pinfo, tree, param_tree, session); break; case User_Data: call_pres_dissector(tvb, offset, param_len, pinfo, tree, param_tree, session); break; /* handle PGI's */ case Connect_Accept_Item: case Connection_Identifier: case Linking_Information: /* Yes. */ if (!dissect_parameter_group(tvb, offset, tree, param_tree, pinfo, param_len, enclosure_item_flags, session)) has_user_information = FALSE; break; /* everything else is a PI */ default: if (!dissect_parameter(tvb, offset, tree, param_tree, pinfo, param_type, param_len, param_len_item, enclosure_item_flags, session)) has_user_information = FALSE; break; } } offset += param_len; len -= param_len; } return has_user_information; } /* * Dissect an SPDU. */ static int dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, gboolean tokens, gboolean connectionless) { gboolean has_user_information = FALSE; guint8 type; proto_item *ti = NULL; proto_tree *ses_tree = NULL; int len_len; guint16 parameters_len; tvbuff_t *next_tvb = NULL; guint32 *pres_ctx_id = NULL; guint8 enclosure_item_flags = BEGINNING_SPDU|END_SPDU; struct SESSION_DATA_STRUCTURE session; /* * Get SPDU type. */ type = tvb_get_guint8(tvb, offset); session.spdu_type = type; session.abort_type = SESSION_NO_ABORT; session.pres_ctx_id = 0; session.ros_op = 0; session.rtse_reassemble = FALSE; if(connectionless) { col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext(type, &ses_vals_ext, "Unknown SPDU type (0x%02x)")); if (tree) { ti = proto_tree_add_item(tree, proto_clses, tvb, offset, -1, ENC_NA); ses_tree = proto_item_add_subtree(ti, ett_ses); proto_tree_add_uint(ses_tree, hf_ses_type, tvb, offset, 1, type); } has_user_information = TRUE; } else if (tokens) { col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, ses_category0_vals, "Unknown SPDU type (0x%02x)")); if (tree) { ti = proto_tree_add_item(tree, proto_ses, tvb, offset, -1, ENC_NA); ses_tree = proto_item_add_subtree(ti, ett_ses); proto_tree_add_uint(ses_tree, hf_ses_type_0, tvb, offset, 1, type); } } else { col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext(type, &ses_vals_ext, "Unknown SPDU type (0x%02x)")); if (tree) { ti = proto_tree_add_item(tree, proto_ses, tvb, offset, -1, ENC_NA); ses_tree = proto_item_add_subtree(ti, ett_ses); proto_tree_add_uint(ses_tree, hf_ses_type, tvb, offset, 1, type); } /* * Might this SPDU have a User Information field? */ switch (type) { case SES_DATA_TRANSFER: case SES_EXPEDITED: case SES_TYPED_DATA: has_user_information = TRUE; break; case SES_MAJOR_SYNC_POINT: pres_ctx_id = (guint32 *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ses, 0); if (ses_rtse_reassemble != 0 && !pres_ctx_id) { /* First time visited - save pres_ctx_id */ pres_ctx_id = wmem_new(wmem_file_scope(), guint32); *pres_ctx_id = ses_pres_ctx_id; p_add_proto_data(wmem_file_scope(), pinfo, proto_ses, 0, pres_ctx_id); } if (pres_ctx_id) { session.pres_ctx_id = *pres_ctx_id; session.rtse_reassemble = TRUE; has_user_information = TRUE; } ses_rtse_reassemble = FALSE; break; } } offset++; /* get length of SPDU parameter field */ parameters_len = get_item_len(tvb, offset, &len_len); if (tree) proto_tree_add_uint(ses_tree, hf_ses_length, tvb, offset, len_len, parameters_len); offset += len_len; /* Dissect parameters. */ if (!dissect_parameters(tvb, offset, parameters_len, tree, ses_tree, pinfo, &enclosure_item_flags, &session)) has_user_information = FALSE; offset += parameters_len; proto_item_set_end(ti, tvb, offset); /* Dissect user information, if present */ if (!ses_desegment || enclosure_item_flags == (BEGINNING_SPDU|END_SPDU)) { if (has_user_information) { /* Not desegment or only one segment */ if (tvb_reported_length_remaining(tvb, offset) > 0 || type == SES_MAJOR_SYNC_POINT) { next_tvb = tvb_new_subset_remaining(tvb, offset); } } } else { conversation_t *conversation = NULL; fragment_head *frag_msg = NULL; gint fragment_len; guint32 ses_id = 0; /* Use conversation index as segment id */ conversation = find_conversation_pinfo(pinfo, 0); if (conversation != NULL) { ses_id = conversation->conv_index; } fragment_len = tvb_reported_length_remaining (tvb, offset); ti = proto_tree_add_item (ses_tree, hf_ses_segment_data, tvb, offset, fragment_len, ENC_NA); proto_item_append_text (ti, " (%d byte%s)", fragment_len, plurality (fragment_len, "", "s")); frag_msg = fragment_add_seq_next (&ses_reassembly_table, tvb, offset, pinfo, ses_id, NULL, fragment_len, (enclosure_item_flags & END_SPDU) ? FALSE : TRUE); next_tvb = process_reassembled_data (tvb, offset, pinfo, "Reassembled SES", frag_msg, &ses_frag_items, NULL, (enclosure_item_flags & END_SPDU) ? tree : ses_tree); has_user_information = TRUE; offset += fragment_len; } if (has_user_information && next_tvb) { if (!pres_handle) { call_data_dissector(next_tvb, pinfo, tree); } else { /* Pass the session pdu to the presentation dissector */ call_dissector_with_data(pres_handle, next_tvb, pinfo, tree, &session); } /* * No more SPDUs to dissect. Set the offset to the * end of the tvbuff. */ offset = tvb_captured_length(tvb); if (session.rtse_reassemble && type == SES_DATA_TRANSFER) { ses_pres_ctx_id = session.pres_ctx_id; ses_rtse_reassemble = TRUE; } } return offset; } /* * Dissect SPDUs inside a TSDU. */ static int dissect_ses(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint8 type; gboolean is_clsp = FALSE; type = tvb_get_guint8(tvb, offset); if(type == CLSES_UNIT_DATA) is_clsp = TRUE; col_set_str(pinfo->cinfo, COL_PROTOCOL, is_clsp ? "CLSES" : "SES"); col_clear(pinfo->cinfo, COL_INFO); /* * Do we have a category 0 SPDU (GIVE_TOKENS/PLEASE_TOKENS) as * the first SPDU? * * If so, dissect it as such (GIVE_TOKENS and DATA_TRANSFER have * the same SPDU type value). */ if ((type == SES_PLEASE_TOKENS) || (type == SES_GIVE_TOKENS)) offset = dissect_spdu(tvb, offset, pinfo, tree, TOKENS_SPDU, FALSE); /* Dissect the remaining SPDUs. */ while (tvb_reported_length_remaining(tvb, offset) > 0) offset = dissect_spdu(tvb, offset, pinfo, tree, NON_TOKENS_SPDU, is_clsp); return tvb_captured_length(tvb); } static gboolean dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { /* must check that this really is a ses packet */ int offset = 0; guint8 type; int len_len; guint16 len; /* first, check do we have at least 4 bytes (type+length) */ if (tvb_captured_length(tvb) < 2) return FALSE; /* no */ /* can we recognize session PDU ? Return FALSE if not */ /* get SPDU type */ type = tvb_get_guint8(tvb, offset); /* check SPDU type */ if (try_val_to_str_ext(type, &ses_vals_ext) == NULL) { return FALSE; /* no, it isn't a session PDU */ } /* can we recognize the second session PDU if the first one was * a Give Tokens PDU? Return FALSE if not */ if(tvb_bytes_exist(tvb, 2, 2) && type == SES_GIVE_TOKENS) { /* get SPDU type */ type = tvb_get_guint8(tvb, offset+2); /* check SPDU type */ if (try_val_to_str_ext(type, &ses_vals_ext) == NULL) { return FALSE; /* no, it isn't a session PDU */ } } /* some Siemens SIMATIC protocols also use COTP, and shouldn't be * misinterpreted as SES. * the starter in this case is fixed to 0x32 (SES_MINOR_SYNC_ACK for SES), * so if the parameter type is unknown, it's probably SIMATIC */ if(type == 0x32 && tvb_captured_length(tvb) >= 3) { type = tvb_get_guint8(tvb, offset+2); if (try_val_to_str_ext(type, &param_vals_ext) == NULL) { return FALSE; /* it's probably a SIMATIC protocol */ } } /* OK,let's check SPDU length */ /* get length of SPDU */ len = get_item_len(tvb, offset+1, &len_len); /* add header length */ len+=len_len; /* do we have enough bytes ? */ if (tvb_reported_length(tvb) < len) return FALSE; /* no */ /* final check to see if the next SPDU, if present, is also valid */ if (tvb_captured_length(tvb) > 1+(guint) len) { type = tvb_get_guint8(tvb, offset + len + 1); /* check SPDU type */ if (try_val_to_str_ext(type, &ses_vals_ext) == NULL) { return FALSE; /* no, it isn't a session PDU */ } } dissect_ses(tvb, pinfo, parent_tree, data); return TRUE; } void proto_register_ses(void) { static hf_register_info hf[] = { { &hf_ses_type, { "SPDU Type", "ses.type", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ses_vals_ext, 0x0, NULL, HFILL } }, { &hf_ses_type_0, { "SPDU Type", "ses.type", FT_UINT8, BASE_DEC, VALS(ses_category0_vals), 0x0, NULL, HFILL } }, { &hf_ses_length, { "Length", "ses.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ses_version, { "Version", "ses.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif #if 0 { &hf_ses_reserved, { "Reserved", "ses.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_called_ss_user_reference, { "Called SS User Reference", "ses.called_ss_user_reference", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_calling_ss_user_reference, { "Calling SS User Reference", "ses.calling_ss_user_reference", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_common_reference, { "Common Reference", "ses.common_reference", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_additional_reference_information, { "Additional Reference Information", "ses.additional_reference_information", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_release_token, { "release token", "ses.release_token", FT_BOOLEAN, 8, NULL, RELEASE_TOKEN, NULL, HFILL } }, { &hf_major_activity_token, { "major/activity token", "ses.major.token", FT_BOOLEAN, 8, NULL, MAJOR_ACTIVITY_TOKEN, NULL, HFILL } }, { &hf_synchronize_minor_token, { "synchronize minor token", "ses.synchronize_token", FT_BOOLEAN, 8, NULL, SYNCHRONIZE_MINOR_TOKEN, NULL, HFILL } }, { &hf_data_token, { "data token", "ses.data_token", FT_BOOLEAN, 8, NULL, DATA_TOKEN, "data token", HFILL } }, { &hf_able_to_receive_extended_concatenated_SPDU, { "Able to receive extended concatenated SPDU", "ses.connect.f1", FT_BOOLEAN, 8, NULL, SES_EXT_CONT, NULL, HFILL } }, { &hf_session_user_req_flags, { "Flags", "ses.req.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_session_exception_report, { "Session exception report", "ses.exception_report", FT_BOOLEAN, 16, NULL, SES_EXCEPTION_REPORT, NULL, HFILL } }, { &hf_data_separation_function_unit, { "Data separation function unit", "ses.data_sep", FT_BOOLEAN, 16, NULL, DATA_SEPARATION_FUNCTION_UNIT, NULL, HFILL } }, { &hf_symmetric_synchronize_function_unit, { "Symmetric synchronize function unit", "ses.symm_sync", FT_BOOLEAN, 16, NULL, SYMMETRIC_SYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_typed_data_function_unit, { "Typed data function unit", "ses.typed_data", FT_BOOLEAN, 16, NULL, TYPED_DATA_FUNCTION_UNIT, NULL, HFILL } }, { &hf_exception_function_unit, { "Exception function unit", "ses.exception_data", FT_BOOLEAN, 16, NULL, EXCEPTION_FUNCTION_UNIT, NULL, HFILL } }, { &hf_capability_function_unit, { "Capability function unit", "ses.capability_data", FT_BOOLEAN, 16, NULL, CAPABILITY_DATA_FUNCTION_UNIT, NULL, HFILL } }, { &hf_negotiated_release_function_unit, { "Negotiated release function unit", "ses.negotiated_release", FT_BOOLEAN, 16, NULL, NEGOTIATED_RELEASE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_activity_management_function_unit, { "Activity management function unit", "ses.activity_management", FT_BOOLEAN, 16, NULL, ACTIVITY_MANAGEMENT_FUNCTION_UNIT, NULL, HFILL } }, { &hf_resynchronize_function_unit, { "Resynchronize function unit", "ses.resynchronize", FT_BOOLEAN, 16, NULL, RESYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_major_resynchronize_function_unit, { "Major resynchronize function unit", "ses.major_resynchronize", FT_BOOLEAN, 16, NULL, MAJOR_SYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_minor_resynchronize_function_unit, { "Minor resynchronize function unit", "ses.minor_resynchronize", FT_BOOLEAN, 16, NULL, MINOR_SYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_expedited_data_resynchronize_function_unit, { "Expedited data function unit", "ses.expedited_data", FT_BOOLEAN, 16, NULL, EXPEDITED_DATA_FUNCTION_UNIT, NULL, HFILL } }, { &hf_duplex_function_unit, { "Duplex functional unit", "ses.duplex", FT_BOOLEAN, 16, NULL, DUPLEX_FUNCTION_UNIT, NULL, HFILL } }, { &hf_half_duplex_function_unit, { "Half-duplex functional unit", "ses.half_duplex", FT_BOOLEAN, 16, NULL, HALF_DUPLEX_FUNCTION_UNIT, NULL, HFILL } }, { &hf_proposed_tsdu_maximum_size_i2r, { "Proposed TSDU Maximum Size, Initiator to Responder", "ses.proposed_tsdu_maximum_size_i2r", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_proposed_tsdu_maximum_size_r2i, { "Proposed TSDU Maximum Size, Responder to Initiator", "ses.proposed_tsdu_maximum_size_r2i", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_protocol_version_1, { "Protocol Version 1", "ses.protocol_version1", FT_BOOLEAN, 8, NULL, PROTOCOL_VERSION_1, NULL, HFILL } }, { &hf_protocol_version_2, { "Protocol Version 2", "ses.protocol_version2", FT_BOOLEAN, 8, NULL, PROTOCOL_VERSION_2, NULL, HFILL } }, { &hf_initial_serial_number, { "Initial Serial Number", "ses.initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_beginning_of_SSDU, { "beginning of SSDU", "ses.beginning_of_SSDU", FT_BOOLEAN, 8, NULL, BEGINNING_SPDU, NULL, HFILL } }, { &hf_end_of_SSDU, { "end of SSDU", "ses.end_of_SSDU", FT_BOOLEAN, 8, NULL, END_SPDU, NULL, HFILL } }, { &hf_release_token_setting, { "release token setting", "ses.release_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0xC0, NULL, HFILL } }, { &hf_major_activity_token_setting, { "major/activity setting", "ses.major_activity_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0x30, "major/activity token setting", HFILL } }, { &hf_synchronize_minor_token_setting, { "synchronize-minor token setting", "ses.synchronize_minor_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0x0C, NULL, HFILL } }, { &hf_data_token_setting, { "data token setting", "ses.data_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0x03, NULL, HFILL } }, { &hf_activity_identifier, { "Activity Identifier", "ses.activity_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_serial_number, { "Serial Number", "ses.serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_calling_session_selector, { "Calling Session Selector", "ses.calling_session_selector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_called_session_selector, { "Called Session Selector", "ses.called_session_selector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_second_serial_number, { "Second Serial Number", "ses.second_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_second_initial_serial_number, { "Second Initial Serial Number", "ses.second_initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_large_initial_serial_number, { "Large Initial Serial Number", "ses.large_initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_large_second_initial_serial_number, { "Large Second Initial Serial Number", "ses.large_second_initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connect_protocol_options_flags, { "Flags", "ses.connect.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_version_number_options_flags, { "Flags", "ses.version.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_token_item_options_flags, { "Flags", "ses.tken_item.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_enclosure_item_options_flags, { "Flags", "ses.enclosure.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ses_segment_data, { "SES segment data", "ses.segment.data", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_ses_segments, { "SES segments", "ses.segments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_ses_segment, { "SES segment", "ses.segment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_ses_segment_overlap, { "SES segment overlap", "ses.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ses_segment_overlap_conflicts, { "SES segment overlapping with conflicting data", "ses.segment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ses_segment_multiple_tails, { "SES has multiple tail segments", "ses.segment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ses_segment_too_long_segment, { "SES segment too long", "ses.segment.too_long_segment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ses_segment_error, { "SES desegmentation error", "ses.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_ses_segment_count, { "SES segment count", "ses.segment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_ses_reassembled_in, { "Reassembled SES in frame", "ses.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, "This SES packet is reassembled in this frame", HFILL } }, { &hf_ses_reassembled_length, { "Reassembled SES length", "ses.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, "The total length of the reassembled payload", HFILL } }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_ses_user_data, { "User data", "ses.user_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ses_transport_option_flags, { "Flags", "ses.transport_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_ses_transport_connection, { "Transport connection", "ses.transport_flags.connection", FT_BOOLEAN, 8, TFS(&tfs_released_kept), transport_connection_is_released, NULL, HFILL }}, { &hf_ses_transport_user_abort, { "User abort", "ses.transport_flags.user_abort", FT_BOOLEAN, 8, TFS(&tfs_yes_no), user_abort, NULL, HFILL }}, { &hf_ses_transport_protocol_error, { "Protocol error", "ses.transport_flags.protocol_error", FT_BOOLEAN, 8, TFS(&tfs_yes_no), protocol_error, NULL, HFILL }}, { &hf_ses_transport_no_reason, { "No reason", "ses.transport_flags.no_reason", FT_BOOLEAN, 8, TFS(&tfs_yes_no), no_reason, NULL, HFILL }}, { &hf_ses_transport_implementation_restriction, { "Implementation restriction", "ses.transport_flags.implementation_restriction", FT_BOOLEAN, 8, TFS(&tfs_yes_no), implementation_restriction, NULL, HFILL }}, { &hf_ses_reason_code, { "Reason Code", "ses.reason_code", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &reason_vals_ext, 0x0, NULL, HFILL }}, { &hf_ses_parameter_type, { "Parameter type", "ses.parameter_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &param_vals_ext, 0x0, NULL, HFILL }}, { &hf_ses_parameter_length, { "Parameter length", "ses.parameter_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ses_parameter_group_inside_parameter_group, { "Parameter group inside parameter group", "ses.parameter_group_inside_parameter_group", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_ses, &ett_ses_param, &ett_connect_protocol_options_flags, &ett_transport_options_flags, &ett_protocol_version_flags, &ett_enclosure_item_flags, &ett_token_item_flags, &ett_ses_req_options_flags, &ett_ses_segment, &ett_ses_segments }; static ei_register_info ei[] = { { &ei_ses_bad_length, { "ses.bad_length", PI_MALFORMED, PI_ERROR, "Bad length", EXPFILL }}, { &ei_ses_bad_parameter_length, { "ses.bad_parameter_length", PI_MALFORMED, PI_ERROR, "Bad parameter length", EXPFILL }}, }; module_t *ses_module; expert_module_t* expert_ses; proto_ses = proto_register_protocol(PROTO_STRING_SES, "SES", "ses"); proto_register_field_array(proto_ses, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_ses = expert_register_protocol(proto_ses); expert_register_field_array(expert_ses, ei, array_length(ei)); reassembly_table_register (&ses_reassembly_table, &addresses_reassembly_table_functions); ses_module = prefs_register_protocol(proto_ses, NULL); prefs_register_bool_preference(ses_module, "desegment", "Reassemble session packets ", "Whether the session dissector should reassemble messages spanning multiple SES segments", &ses_desegment); /* * Register the dissector by name, so other dissectors can * grab it by name rather than just referring to it directly * (you can't refer to it directly from a plugin dissector * on Windows without stuffing it into the Big Transfer Vector). */ register_dissector("ses", dissect_ses, proto_ses); } void proto_reg_handoff_ses(void) { /* define sub dissector */ pres_handle = find_dissector_add_dependency("pres", proto_ses); /* add our session dissector to cotp dissector list * and cotp_is dissector list*/ heur_dissector_add("cotp", dissect_ses_heur, "SES over COTP", "ses_cotp", proto_ses, HEURISTIC_ENABLE); heur_dissector_add("cotp_is", dissect_ses_heur, "SES over COTP (inactive subset)", "ses_cotp_is", proto_ses, HEURISTIC_ENABLE); } void proto_register_clses(void) { proto_clses = proto_register_protocol(PROTO_STRING_CLSES, "CLSP", "clsp"); } void proto_reg_handoff_clses(void) { /* add our session dissector to cltp dissector list */ heur_dissector_add("cltp", dissect_ses_heur, "CLSP over COTP", "clses_cotp", proto_clses, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-ses.h
/* packet-ses.h * * Routine to dissect ISO 8327-1 OSI Session Protocol packets * * Yuriy Sidelnikov <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_SES_H #define PACKET_SES_H #define PROTO_STRING_SES "ISO 8327-1 OSI Session Protocol" #define PROTO_STRING_SES_INFO "ISO 8327-1 OSI Session Protocol." /* * Dissect ses-encapsulated data in a TCP stream. */ /* session parms */ #define SES_EXT_CONT 0x01 /* protocol versions */ #define PROTOCOL_VERSION_1 0x01 #define PROTOCOL_VERSION_2 0x02 /* enclosure item */ #define BEGINNING_SPDU 0x01 #define END_SPDU 0x02 #define DATA_TOKEN 0x01 #define RELEASE_TOKEN 0x40 #define SYNCHRONIZE_MINOR_TOKEN 0x04 #define MAJOR_ACTIVITY_TOKEN 0x10 /* session user req flag */ #define HALF_DUPLEX_FUNCTION_UNIT 0x0001 #define DUPLEX_FUNCTION_UNIT 0x0002 #define EXPEDITED_DATA_FUNCTION_UNIT 0x0004 #define MINOR_SYNCHRONIZE_FUNCTION_UNIT 0x0008 #define MAJOR_SYNCHRONIZE_FUNCTION_UNIT 0x0010 #define RESYNCHRONIZE_FUNCTION_UNIT 0x0020 #define ACTIVITY_MANAGEMENT_FUNCTION_UNIT 0x0040 #define NEGOTIATED_RELEASE_FUNCTION_UNIT 0x0080 #define CAPABILITY_DATA_FUNCTION_UNIT 0x0100 #define EXCEPTION_FUNCTION_UNIT 0x0200 #define TYPED_DATA_FUNCTION_UNIT 0x0400 #define SYMMETRIC_SYNCHRONIZE_FUNCTION_UNIT 0x0800 #define DATA_SEPARATION_FUNCTION_UNIT 0x1000 #define SES_EXCEPTION_REPORT 0x2000 /*define SES_EXCEPTION_REPORT 0 */ #define SES_DATA_TRANSFER 1 #define SES_GIVE_TOKENS 1 #define SES_PLEASE_TOKENS 2 #define SES_EXPEDITED 5 #define SES_PREPARE 7 #define SES_NOT_FINISHED 8 #define SES_FINISH 9 #define SES_DISCONNECT 10 #define SES_REFUSE 12 #define SES_CONNECTION_REQUEST 13 #define SES_CONNECTION_ACCEPT 14 #define SES_CONNECTION_DATA_OVERFLOW 15 #define SES_OVERFLOW_ACCEPT 16 #define SES_GIVE_TOKENS_CONFIRM 21 #define SES_GIVE_TOKENS_ACK 22 #define SES_ABORT 25 #define SES_ABORT_ACCEPT 26 /*#define SES_ACTIVITY_INTERRUPT 25 #define SES_ACTIVITY_INTERRUPT_ACK 26 */ #define SES_ACTIVITY_RESUME 29 #define SES_TYPED_DATA 33 #define SES_RESYNCHRONIZE_ACK 34 #define SES_MAJOR_SYNC_POINT 41 /*#define SES_MAJOR_SYNC_POINT 41 #define SES_ACTIVITY_END 41 */ #define SES_MAJOR_SYNC_ACK 42 #define SES_ACTIVITY_START 45 #define SES_EXCEPTION_DATA 48 #define SES_MINOR_SYNC_POINT 49 #define SES_MINOR_SYNC_ACK 50 #define SES_RESYNCHRONIZE 53 #define SES_ACTIVITY_DISCARD 57 #define SES_ACTIVITY_DISCARD_ACK 58 #define SES_CAPABILITY 61 #define SES_CAPABILITY_DATA_ACK 62 #define CLSES_UNIT_DATA 64 /* reason code 0: Rejection by called SS-user; reason not specified. 1: Rejection by called SS-user due to temporary congestion. 2: Rejection by called SS-user. Subsequent octets may be used for user data up to a length of 512 octets if Protocol Version 1 has been selected, and up to a length such that the total length (including SI and LI) of the SPDU does not exceed 65 539 octets if Protocol Version 2 has been selected. 128 + 1: Session Selector unknown. 128 + 2: SS-user not attached to SSAP. 128 + 3: SPM congestion at connect time. 128 + 4: Proposed protocol versions not supported. 128 + 5: Rejection by the SPM; reason not specified. 128 + 6: Rejection by the SPM; implementation restriction stated in the PICS. */ #define reason_not_specified 0 #define temporary_congestion 1 #define Subsequent 2 #define Session_Selector_unknown 128+1 #define SS_user_not_attached_to_SSAP 128+2 #define SPM_congestion_at_connect_time 128+3 #define versions_not_supported 128+4 #define SPM_reason_not_specified 128+5 #define SPM_implementation_restriction 128+6 #define NON_TOKENS_SPDU FALSE #define TOKENS_SPDU TRUE #define TWO_BYTE_LEN 0xff /* PGI's */ #define Connection_Identifier 1 #define Connect_Accept_Item 5 #define Linking_Information 33 #define User_Data 193 #define Extended_User_Data 194 /* PI's */ #define Called_SS_user_Reference 9 #define Calling_SS_user_Reference 10 #define Common_Reference 11 #define Additional_Reference_Information 12 #define Sync_Type_Item 15 #define Token_Item 16 #define Transport_Disconnect 17 #define Protocol_Options 19 #define Session_Requirement 20 #define TSDU_Maximum_Size 21 #define Version_Number 22 #define Initial_Serial_Number 23 #define Prepare_Type 24 #define EnclosureItem 25 #define Token_Setting_Item 26 #define Resync_Type 27 #define Activity_Identifier 41 #define Serial_Number 42 #define Reflect_Parameter 49 #define Reason_Code 50 #define Calling_Session_Selector 51 #define Called_Session_Selector 52 #define Second_Resync_Type 53 #define Second_Serial_Number 54 #define Second_Initial_Serial_Number 55 #define Upper_Limit_Serial_Number 56 #define Large_Initial_Serial_Number 57 #define Large_Second_Initial_Serial_Number 58 #define Data_Overflow 60 /* transport disconnect values */ #define transport_connection_is_released 0x01 #define user_abort 0x02 #define protocol_error 0x04 #define no_reason 0x08 #define implementation_restriction 0x10 #define SESSION_NO_ABORT 0 #define SESSION_USER_ABORT 1 #define SESSION_PROVIDER_ABORT 2 /* data for presentation selector */ struct SESSION_DATA_STRUCTURE { guint8 spdu_type; guint8 abort_type; guint8 pres_ctx_id; guint32 ros_op; gboolean rtse_reassemble; }; extern value_string_ext ses_vals_ext; #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-sflow.c
/* packet-sflow.c * Routines for sFlow v5 dissection implemented according to the specifications * at http://www.sflow.org/sflow_version_5.txt * * Additional 802.11 structures support implemented according to the * specifications at http://www.sflow.org/sflow_80211.txt * * By Yi Yu <[email protected]> * * TODO: * 802.11 aggregation data dissection (sFlow v5) * * * Based on Jeff Rizzo's <[email protected]> dissector for sFlow v2/4 * in Wireshark 1.0.8 public release. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * * This file (mostly) implements a dissector for sFlow (RFC3176), * from the version 4 spec at http://www.sflow.org/SFLOW-DATAGRAM.txt . * * TODO: * Fix the highlighting of the datastream when bits are selected * split things out into packet-sflow.h ? * make routines more consistent as to whether they return * 'offset' or bytes consumed ('len') (sFlow v2/4) * implement sampled_ipv4 and sampled_ipv6 packet data types (sFlow v2/4) * implement extended_user (sFlow v2/4) * implement extended_url (sFlow v2/4) * implement non-generic counters sampling (sFlow v2/4) */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/to_str.h> #include <epan/ipproto.h> #include "packet-sflow.h" #define SFLOW_UDP_PORTS "6343" void proto_register_sflow(void); static dissector_handle_t sflow_handle; /* * sflow_245_ports : holds the currently used range of ports for sflow */ static gboolean global_dissect_samp_headers = TRUE; static gboolean global_analyze_samp_ip_headers = FALSE; #define ENTERPRISE_DEFAULT 0 #define ADDR_TYPE_UNKNOWN 0 #define ADDR_TYPE_IPV4 1 #define ADDR_TYPE_IPV6 2 #define FLOWSAMPLE 1 #define COUNTERSSAMPLE 2 #define EXPANDED_FLOWSAMPLE 3 #define EXPANDED_COUNTERSSAMPLE 4 #define LAG_PORT_STATS 7 static const value_string sflow_agent_address_types[] = { { ADDR_TYPE_IPV4, "IPv4" }, { ADDR_TYPE_IPV6, "IPv6" }, { 0, NULL } }; static const value_string sflow_245_sampletype[] = { { FLOWSAMPLE, "Flow sample"}, { COUNTERSSAMPLE, "Counters sample"}, { EXPANDED_FLOWSAMPLE, "Expanded flow sample"}, { EXPANDED_COUNTERSSAMPLE, "Expanded counters sample"}, { LAG_PORT_STATS, "Lag Port stats"}, { 0, NULL} }; #define SFLOW_5_IEEE80211_VERSION_A 1 #define SFLOW_5_IEEE80211_VERSION_B 2 #define SFLOW_5_IEEE80211_VERSION_G 3 #define SFLOW_5_IEEE80211_VERSION_N 4 static const value_string sflow_5_ieee80211_versions [] = { { SFLOW_5_IEEE80211_VERSION_A, "802.11a"}, { SFLOW_5_IEEE80211_VERSION_B, "802.11b"}, { SFLOW_5_IEEE80211_VERSION_G, "802.11g"}, { SFLOW_5_IEEE80211_VERSION_N, "802.11n"}, { 0, NULL} }; /* interface counter types */ #define SFLOW_245_COUNTERS_GENERIC 1 #define SFLOW_245_COUNTERS_ETHERNET 2 #define SFLOW_245_COUNTERS_TOKENRING 3 #define SFLOW_245_COUNTERS_FDDI 4 #define SFLOW_245_COUNTERS_VG 5 #define SFLOW_245_COUNTERS_WAN 6 #define SFLOW_245_COUNTERS_VLAN 7 static const value_string sflow_245_counterstype[] = { { SFLOW_245_COUNTERS_GENERIC, "Generic counters"}, { SFLOW_245_COUNTERS_ETHERNET, "Ethernet counters"}, { SFLOW_245_COUNTERS_TOKENRING,"Token Ring counters"}, { SFLOW_245_COUNTERS_FDDI, "FDDI counters"}, { SFLOW_245_COUNTERS_VG, "100baseVG counters"}, { SFLOW_245_COUNTERS_WAN, "WAN counters"}, { SFLOW_245_COUNTERS_VLAN, "VLAN counters"}, { 0, NULL} }; #define MAX_HEADER_SIZE 256 #define SFLOW_245_PACKET_DATA_TYPE_HEADER 1 #define SFLOW_245_PACKET_DATA_TYPE_IPV4 2 #define SFLOW_245_PACKET_DATA_TYPE_IPV6 3 static const value_string sflow_245_packet_information_type[] = { { SFLOW_245_PACKET_DATA_TYPE_HEADER, "Packet headers are sampled"}, { SFLOW_245_PACKET_DATA_TYPE_IPV4, "IP Version 4 data"}, { SFLOW_245_PACKET_DATA_TYPE_IPV6, "IP Version 6 data"}, { 0, NULL} }; static const value_string extended_80211_suite_type_vals[] = { { 0, "Use group cipher suite"}, { 1, "WEP-40"}, { 2, "TKIP"}, { 4, "CCMP"}, { 5, "WEP-104"}, { 0, NULL} }; static const value_string sflow_ifdirection_vals[] = { { 1, "Full-Duplex"}, { 2, "Half-Duplex"}, { 3, "In"}, { 4, "Out"}, { 0, NULL} }; static const true_false_string tfs_minimize_monetary_normal = { "Minimize Monetary", "Normal" }; static const value_string sflow_245_header_protocol[] = { { SFLOW_245_HEADER_ETHERNET, "Ethernet"}, { SFLOW_245_HEADER_TOKENBUS, "Token Bus"}, { SFLOW_245_HEADER_TOKENRING, "Token Ring"}, { SFLOW_245_HEADER_FDDI, "FDDI"}, { SFLOW_245_HEADER_FRAME_RELAY, "Frame Relay"}, { SFLOW_245_HEADER_X25, "X.25"}, { SFLOW_245_HEADER_PPP, "PPP"}, { SFLOW_245_HEADER_SMDS, "SMDS"}, { SFLOW_245_HEADER_AAL5, "ATM AAL5"}, { SFLOW_245_HEADER_AAL5_IP, "ATM AAL5-IP (e.g., Cisco AAL5 mux)"}, { SFLOW_245_HEADER_IPv4, "IPv4"}, { SFLOW_245_HEADER_IPv6, "IPv6"}, { SFLOW_245_HEADER_MPLS, "MPLS"}, { SFLOW_5_HEADER_POS, "PPP over SONET/SDH (RFC 1662, 2615)"}, { SFLOW_5_HEADER_80211_MAC, "802.11 MAC"}, { SFLOW_5_HEADER_80211_AMPDU, "802.11n Aggregated MPDU"}, { SFLOW_5_HEADER_80211_AMSDU_SUBFRAME, "A-MSDU Subframe"}, { 0, NULL} }; static value_string_ext sflow_245_header_protocol_ext = VALUE_STRING_EXT_INIT(sflow_245_header_protocol); /* extended packet data types */ #define SFLOW_245_EXTENDED_SWITCH 1 #define SFLOW_245_EXTENDED_ROUTER 2 #define SFLOW_245_EXTENDED_GATEWAY 3 #define SFLOW_245_EXTENDED_USER 4 #define SFLOW_245_EXTENDED_URL 5 static const value_string sflow_245_extended_data_types[] = { { SFLOW_245_EXTENDED_SWITCH, "Extended switch information"}, { SFLOW_245_EXTENDED_ROUTER, "Extended router information"}, { SFLOW_245_EXTENDED_GATEWAY, "Extended gateway information"}, { SFLOW_245_EXTENDED_USER, "Extended user information"}, { SFLOW_245_EXTENDED_URL, "Extended URL information"}, { 0, NULL} }; #define SFLOW_245_AS_SET 1 #define SFLOW_245_AS_SEQUENCE 2 static const value_string sflow_245_as_types[] = { { SFLOW_245_AS_SET, "AS Set"}, { SFLOW_245_AS_SEQUENCE, "AS Sequence"}, { 0, NULL} }; #define SFLOW_245_IPV4_PRECEDENCE_ROUTINE 0 #define SFLOW_245_IPV4_PRECEDENCE_PRIORITY 1 #define SFLOW_245_IPV4_PRECEDENCE_IMMEDIATE 2 #define SFLOW_245_IPV4_PRECEDENCE_FLASH 3 #define SFLOW_245_IPV4_PRECEDENCE_FLASH_OVERRIDE 4 #define SFLOW_245_IPV4_PRECEDENCE_CRITIC_ECP 5 #define SFLOW_245_IPV4_PRECEDENCE_INTERNETWORK_CONTROL 6 #define SFLOW_245_IPV4_PRECEDENCE_NETWORK_CONTROL 7 static const value_string sflow_245_ipv4_precedence_types[] = { { SFLOW_245_IPV4_PRECEDENCE_ROUTINE, "Routine"}, { SFLOW_245_IPV4_PRECEDENCE_PRIORITY, "Priority"}, { SFLOW_245_IPV4_PRECEDENCE_IMMEDIATE, "Immediate"}, { SFLOW_245_IPV4_PRECEDENCE_FLASH, "Flash"}, { SFLOW_245_IPV4_PRECEDENCE_FLASH_OVERRIDE, "Flash Override"}, { SFLOW_245_IPV4_PRECEDENCE_CRITIC_ECP, "CRITIC/ECP"}, { SFLOW_245_IPV4_PRECEDENCE_INTERNETWORK_CONTROL, "Internetwork Control"}, { SFLOW_245_IPV4_PRECEDENCE_NETWORK_CONTROL, "Network Control"}, { 0, NULL} }; /* sFlow v5 flow record formats */ #define SFLOW_5_RAW_PACKET_HEADER 1 #define SFLOW_5_ETHERNET_FRAME 2 #define SFLOW_5_IPV4 3 #define SFLOW_5_IPV6 4 #define SFLOW_5_SWITCH 1001 #define SFLOW_5_ROUTER 1002 #define SFLOW_5_GATEWAY 1003 #define SFLOW_5_USER 1004 #define SFLOW_5_URL 1005 #define SFLOW_5_MPLS_DATA 1006 #define SFLOW_5_NAT 1007 #define SFLOW_5_MPLS_TUNNEL 1008 #define SFLOW_5_MPLS_VC 1009 #define SFLOW_5_MPLS_FEC 1010 #define SFLOW_5_MPLS_LVP_FEC 1011 #define SFLOW_5_VLAN_TUNNEL 1012 #define SFLOW_5_80211_PAYLOAD 1013 #define SFLOW_5_80211_RX 1014 #define SFLOW_5_80211_TX 1015 #define SFLOW_5_80211_AGGREGATION 1016 static const value_string sflow_5_flow_record_type[] = { { SFLOW_5_RAW_PACKET_HEADER, "Raw packet header"}, { SFLOW_5_ETHERNET_FRAME, "Ethernet frame data"}, { SFLOW_5_IPV4, "IPv4 data"}, { SFLOW_5_IPV6, "IPv6 data"}, { SFLOW_5_SWITCH, "Extended switch data"}, { SFLOW_5_ROUTER, "Extended router data"}, { SFLOW_5_GATEWAY, "Extended gateway data"}, { SFLOW_5_USER, "Extended user data"}, { SFLOW_5_URL, "Extended URL data"}, { SFLOW_5_MPLS_DATA, "Extended MPLS data"}, { SFLOW_5_NAT, "Extended NAT data"}, { SFLOW_5_MPLS_TUNNEL, "Extended MPLS tunnel data"}, { SFLOW_5_MPLS_VC, "Extended MPLS VC data"}, { SFLOW_5_MPLS_FEC, "Extended MPLS FEC data"}, { SFLOW_5_MPLS_LVP_FEC, "Extended MPLS LVP FEC data"}, { SFLOW_5_VLAN_TUNNEL, "Extended VLAN tunnel"}, { SFLOW_5_80211_PAYLOAD, "Extended 802.11 payload"}, { SFLOW_5_80211_RX, "Extended 802.11 RX"}, { SFLOW_5_80211_TX, "Extended 802.11 TX"}, { SFLOW_5_80211_AGGREGATION, "Extended 802.11 aggregation"}, { 0, NULL} }; static value_string_ext sflow_5_flow_record_type_ext = VALUE_STRING_EXT_INIT(sflow_5_flow_record_type); /* sFlow v5 counters record formats */ #define SFLOW_5_GENERIC_INTERFACE 1 #define SFLOW_5_ETHERNET_INTERFACE 2 #define SFLOW_5_TOKEN_RING 3 #define SFLOW_5_100BASE_VG_INTERFACE 4 #define SFLOW_5_VLAN 5 #define SFLOW_5_80211_COUNTERS 6 #define SFLOW_5_LAG 7 #define SFLOW_5_PROCESSOR 1001 #define SFLOW_5_RADIO_UTILIZATION 1002 static const value_string sflow_5_counters_record_type[] = { { SFLOW_5_GENERIC_INTERFACE, "Generic interface counters"}, { SFLOW_5_ETHERNET_INTERFACE, "Ethernet interface counters"}, { SFLOW_5_TOKEN_RING, "Token ring counters"}, { SFLOW_5_100BASE_VG_INTERFACE, "100 Base VG interface counters"}, { SFLOW_5_VLAN, "VLAN counters"}, { SFLOW_5_LAG, "LAG counters"}, { SFLOW_5_80211_COUNTERS, "IEEE 802.11 counters"}, { SFLOW_5_PROCESSOR, "Processor information"}, { SFLOW_5_RADIO_UTILIZATION, "Radio utilization"}, { 0, NULL} }; /* sFlow v5 interface formats */ #define SFLOW_5_INT_FORMAT 0xC0000000 #define SFLOW_5_INT_VALUE 0x3FFFFFFF #define SFLOW_5_INT_FORMAT_IFINDEX 0 #define SFLOW_5_INT_FORMAT_DISCARD 1 #define SFLOW_5_INT_FORMAT_MULTIPLE 2 static const value_string interface_format[] = { { SFLOW_5_INT_FORMAT_IFINDEX, "ifindex"}, { SFLOW_5_INT_FORMAT_DISCARD, "packet discarded"}, { SFLOW_5_INT_FORMAT_MULTIPLE, "multiple interfaces"}, { 0, NULL} }; static const value_string interface_discard[] = { { 0, "Net Unreachable"}, { 1, "Host Unreachable"}, { 2, "Protocol Unreachable"}, { 3, "Port Unreachable"}, { 4, "Fragmentation Needed and Don't Fragment was Set"}, { 5, "Source Route Failed"}, { 6, "Destination Network Unknown"}, { 7, "Destination Host Unknown"}, { 8, "Source Host Isolated"}, { 9, "Communication with Destination Network is Administratively Prohibited"}, { 10, "Communication with Destination Host is Administratively Prohibited"}, { 11, "Destination Network Unreachable for Type of Service"}, { 12, "Destination Host Unreachable for Type of Service"}, { 13, "Communication Administratively Prohibited"}, { 14, "Host Precedence Violation"}, { 15, "Precedence cutoff in effect"}, { 256, "unknown"}, { 257, "ttl exceeded"}, { 258, "ACL"}, { 259, "no buffer space"}, { 260, "RED"}, { 261, "traffic shaping/rate limiting"}, { 262, "packet too big (for protocols that don't support fragmentation)"}, { 0, NULL} }; /* ethernet counters. These will be preceded by generic counters. */ struct ethernet_counters { guint32 dot3StatsAlignmentErrors; guint32 dot3StatsFCSErrors; guint32 dot3StatsSingleCollisionFrames; guint32 dot3StatsMultipleCollisionFrames; guint32 dot3StatsSQETestErrors; guint32 dot3StatsDeferredTransmissions; guint32 dot3StatsLateCollisions; guint32 dot3StatsExcessiveCollisions; guint32 dot3StatsInternalMacTransmitErrors; guint32 dot3StatsCarrierSenseErrors; guint32 dot3StatsFrameTooLongs; guint32 dot3StatsInternalMacReceiveErrors; guint32 dot3StatsSymbolErrors; }; struct sflow_address_type { int hf_addr_v4; int hf_addr_v6; }; /* Initialize the protocol and registered fields */ static int proto_sflow = -1; static int hf_sflow_version = -1; static int hf_sflow_agent_address_type = -1; static int hf_sflow_agent_address_v4 = -1; static int hf_sflow_agent_address_v6 = -1; static int hf_sflow_5_sub_agent_id = -1; static int hf_sflow_5_sample_length = -1; static int hf_sflow_5_flow_data_length = -1; /* static int hf_sflow_5_counters_data_length = -1; */ static int hf_sflow_245_seqnum = -1; static int hf_sflow_245_sysuptime = -1; static int hf_sflow_245_numsamples = -1; static int hf_sflow_245_header_protocol = -1; static int hf_sflow_245_sampletype = -1; static int hf_sflow_245_sampletype12 = -1; static int hf_sflow_245_ipv4_precedence_type = -1; static int hf_sflow_5_flow_record_format = -1; static int hf_sflow_5_counters_record_format = -1; static int hf_sflow_245_header = -1; static int hf_sflow_245_packet_information_type = -1; static int hf_sflow_245_extended_information_type = -1; static int hf_sflow_245_vlan_in = -1; /* incoming 802.1Q VLAN ID */ static int hf_sflow_245_vlan_out = -1; /* outgoing 802.1Q VLAN ID */ static int hf_sflow_245_pri_in = -1; /* incominging 802.1p priority */ static int hf_sflow_245_pri_out = -1; /* outgoing 802.1p priority */ static int hf_sflow_245_nexthop_v4 = -1; /* nexthop address */ static int hf_sflow_245_nexthop_v6 = -1; /* nexthop address */ static int hf_sflow_245_ipv4_src = -1; static int hf_sflow_245_ipv4_dst = -1; static int hf_sflow_245_ipv6_src = -1; static int hf_sflow_245_ipv6_dst = -1; static int hf_sflow_245_nexthop_src_mask = -1; static int hf_sflow_245_nexthop_dst_mask = -1; /* extended gateway (all versions) */ static int hf_sflow_245_as = -1; static int hf_sflow_245_src_as = -1; static int hf_sflow_245_src_peer_as = -1; static int hf_sflow_245_dst_as_entries = -1; /* aka length */ static int hf_sflow_245_dst_as = -1; /* extended gateway (>= version 4) */ static int hf_sflow_245_community_entries = -1; /* static int hf_sflow_245_community = -1; */ static int hf_sflow_245_localpref = -1; /* generic interface counter */ static int hf_sflow_245_ifindex = -1; static int hf_sflow_245_iftype = -1; static int hf_sflow_245_ifspeed = -1; static int hf_sflow_245_ifdirection = -1; static int hf_sflow_245_ifadmin_status = -1; static int hf_sflow_245_ifoper_status = -1; static int hf_sflow_245_ifinoct = -1; static int hf_sflow_245_ifinpkt = -1; static int hf_sflow_245_ifinmcast = -1; static int hf_sflow_245_ifinbcast = -1; static int hf_sflow_245_ifinerr = -1; static int hf_sflow_245_ifindisc = -1; static int hf_sflow_245_ifinunk = -1; static int hf_sflow_245_ifoutoct = -1; static int hf_sflow_245_ifoutpkt = -1; static int hf_sflow_245_ifoutmcast = -1; static int hf_sflow_245_ifoutbcast = -1; static int hf_sflow_245_ifoutdisc = -1; static int hf_sflow_245_ifouterr = -1; static int hf_sflow_245_ifpromisc = -1; /* ethernet interface counter */ static int hf_sflow_245_dot3StatsAlignmentErrors = -1; static int hf_sflow_245_dot3StatsFCSErrors = -1; static int hf_sflow_245_dot3StatsSingleCollisionFrames = -1; static int hf_sflow_245_dot3StatsMultipleCollisionFrames = -1; static int hf_sflow_245_dot3StatsSQETestErrors = -1; static int hf_sflow_245_dot3StatsDeferredTransmissions = -1; static int hf_sflow_245_dot3StatsLateCollisions = -1; static int hf_sflow_245_dot3StatsExcessiveCollisions = -1; static int hf_sflow_245_dot3StatsInternalMacTransmitErrors = -1; static int hf_sflow_245_dot3StatsCarrierSenseErrors = -1; static int hf_sflow_245_dot3StatsFrameTooLongs = -1; static int hf_sflow_245_dot3StatsInternalMacReceiveErrors = -1; static int hf_sflow_245_dot3StatsSymbolErrors = -1; /* token ring counter */ static int hf_sflow_245_dot5StatsLineErrors = -1; static int hf_sflow_245_dot5StatsBurstErrors = -1; static int hf_sflow_245_dot5StatsACErrors = -1; static int hf_sflow_245_dot5StatsAbortTransErrors = -1; static int hf_sflow_245_dot5StatsInternalErrors = -1; static int hf_sflow_245_dot5StatsLostFrameErrors = -1; static int hf_sflow_245_dot5StatsReceiveCongestions = -1; static int hf_sflow_245_dot5StatsFrameCopiedErrors = -1; static int hf_sflow_245_dot5StatsTokenErrors = -1; static int hf_sflow_245_dot5StatsSoftErrors = -1; static int hf_sflow_245_dot5StatsHardErrors = -1; static int hf_sflow_245_dot5StatsSignalLoss = -1; static int hf_sflow_245_dot5StatsTransmitBeacons = -1; static int hf_sflow_245_dot5StatsRecoveries = -1; static int hf_sflow_245_dot5StatsLobeWires = -1; static int hf_sflow_245_dot5StatsRemoves = -1; static int hf_sflow_245_dot5StatsSingles = -1; static int hf_sflow_245_dot5StatsFreqErrors = -1; /* 100 BaseVG interface counters */ static int hf_sflow_245_dot12InHighPriorityFrames = -1; static int hf_sflow_245_dot12InHighPriorityOctets = -1; static int hf_sflow_245_dot12InNormPriorityFrames = -1; static int hf_sflow_245_dot12InNormPriorityOctets = -1; static int hf_sflow_245_dot12InIPMErrors = -1; static int hf_sflow_245_dot12InOversizeFrameErrors = -1; static int hf_sflow_245_dot12InDataErrors = -1; static int hf_sflow_245_dot12InNullAddressedFrames = -1; static int hf_sflow_245_dot12OutHighPriorityFrames = -1; static int hf_sflow_245_dot12OutHighPriorityOctets = -1; static int hf_sflow_245_dot12TransitionIntoTrainings = -1; static int hf_sflow_245_dot12HCInHighPriorityOctets = -1; static int hf_sflow_245_dot12HCInNormPriorityOctets = -1; static int hf_sflow_245_dot12HCOutHighPriorityOctets = -1; /* VLAN counters */ static int hf_sflow_245_vlan_id = -1; static int hf_sflow_245_octets = -1; static int hf_sflow_245_ucastPkts = -1; static int hf_sflow_245_multicastPkts = -1; static int hf_sflow_245_broadcastPkts = -1; static int hf_sflow_245_discards = -1; /* 802.11 interface counters */ static int hf_sflow_5_dot11TransmittedFragmentCount = -1; static int hf_sflow_5_dot11MulticastTransmittedFrameCount = -1; static int hf_sflow_5_dot11FailedCount = -1; static int hf_sflow_5_dot11RetryCount = -1; static int hf_sflow_5_dot11MultipleRetryCount = -1; static int hf_sflow_5_dot11FrameDuplicateCount = -1; static int hf_sflow_5_dot11RTSSuccessCount = -1; static int hf_sflow_5_dot11RTSFailureCount = -1; static int hf_sflow_5_dot11ACKFailureCount = -1; static int hf_sflow_5_dot11ReceivedFragmentCount = -1; static int hf_sflow_5_dot11MulticastReceivedFrameCount = -1; static int hf_sflow_5_dot11FCSErrorCount = -1; static int hf_sflow_5_dot11TransmittedFrameCount = -1; static int hf_sflow_5_dot11WEPUndecryptableCount = -1; static int hf_sflow_5_dot11QoSDiscardedFragmentCount = -1; static int hf_sflow_5_dot11AssociatedStationCount = -1; static int hf_sflow_5_dot11QoSCFPollsReceivedCount = -1; static int hf_sflow_5_dot11QoSCFPollsUnusedCount = -1; static int hf_sflow_5_dot11QoSCFPollsUnusableCount = -1; static int hf_sflow_5_dot11QoSCFPollsLostCount = -1; /* static int hf_sflow_5_ieee80211_version = -1; */ /* processor information */ static int hf_sflow_5_cpu_5s = -1; static int hf_sflow_5_cpu_1m = -1; static int hf_sflow_5_cpu_5m = -1; static int hf_sflow_5_total_memory = -1; static int hf_sflow_5_free_memory = -1; /* radio utilisation */ static int hf_sflow_5_elapsed_time = -1; static int hf_sflow_5_on_channel_time = -1; static int hf_sflow_5_on_channel_busy_time = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_sflow_5_extended_80211_suite_type = -1; static int hf_sflow_5_extended_80211_rx_channel = -1; static int hf_sflow_flow_sample_input_interface = -1; static int hf_sflow_counters_sample_sampling_interval = -1; static int hf_sflow_5_extended_url_host_length = -1; static int hf_sflow_245_ip_tcp_flag_syn = -1; static int hf_sflow_24_flow_sample_output_interface = -1; static int hf_sflow_5_flow_sample_output_interface = -1; static int hf_sflow_5_flow_sample_output_interface_form = -1; static int hf_sflow_5_flow_sample_output_interface_val = -1; static int hf_sflow_5_flow_sample_output_interface_val_discard = -1; static int hf_sflow_245_length_of_ip_packet = -1; static int hf_sflow_counters_sample_counters_type = -1; static int hf_sflow_5_extended_mpls_tunnel_id = -1; static int hf_sflow_flow_sample_sample_pool = -1; static int hf_sflow_5_extended_80211_tx_speed = -1; static int hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair = -1; static int hf_sflow_245_extended_mpls_out_label_stack_entries = -1; static int hf_sflow_flow_sample_input_interface_value = -1; static int hf_sflow_flow_sample_sampling_rate = -1; static int hf_sflow_5_extended_80211_rx_rcpi = -1; static int hf_sflow_enterprise = -1; static int hf_sflow_enterprise_length = -1; static int hf_sflow_enterprise_data = -1; static int hf_sflow_245_header_frame_length = -1; static int hf_sflow_5_extended_user_destination_character_set = -1; static int hf_sflow_5_extended_80211_rx_bssid = -1; static int hf_sflow_5_extended_80211_tx_retransmission_duration = -1; static int hf_sflow_245_ethernet_length_of_mac_packet = -1; static int hf_sflow_245_ip_tcp_flag_psh = -1; static int hf_sflow_flow_sample_flow_record = -1; static int hf_sflow_245_extended_mpls_in_label = -1; static int hf_sflow_5_extended_user_source_character_set = -1; static int hf_sflow_5_extended_user_destination_user_string_length = -1; static int hf_sflow_counters_sample_sequence_number = -1; static int hf_sflow_5_extended_80211_rx_speed = -1; static int hf_sflow_5_extended_80211_rx_rsni = -1; static int hf_sflow_flow_sample_source_id_index = -1; static int hf_sflow_245_ip_tcp_flag_ece = -1; static int hf_sflow_245_ipv4_throughput = -1; static int hf_sflow_5_extended_80211_oui = -1; static int hf_sflow_counters_sample_source_id_type = -1; static int hf_sflow_flow_sample_input_interface_format = -1; static int hf_sflow_5_extended_80211_tx_channel = -1; static int hf_sflow_245_ip_tcp_flag_urg = -1; static int hf_sflow_5_extended_mpls_tunnel_name_length = -1; static int hf_sflow_5_extended_80211_tx_version = -1; static int hf_sflow_245_ipv4_delay = -1; static int hf_sflow_flow_sample_source_id_class = -1; static int hf_sflow_245_ethernet_source_mac_address = -1; static int hf_sflow_5_extended_mpls_ftn_mask = -1; static int hf_sflow_245_extended_mpls_out_label = -1; static int hf_sflow_245_ipv6_priority = -1; static int hf_sflow_245_ip_tcp_flag_fin = -1; static int hf_sflow_245_ip_destination_port = -1; static int hf_sflow_5_extended_mpls_vc_label_cos_value = -1; static int hf_sflow_5_extended_80211_rx_packet_duration = -1; static int hf_sflow_5_extended_80211_tx_packet_duration = -1; static int hf_sflow_245_ipv4_reliability = -1; static int hf_sflow_5_extended_80211_tx_power = -1; static int hf_sflow_24_flow_sample_multiple_outputs = -1; static int hf_sflow_5_extended_user_source_user_string_length = -1; static int hf_sflow_5_extended_80211_payload_length = -1; static int hf_sflow_24_flow_sample_output_interface_format = -1; static int hf_sflow_245_ethernet_packet_type = -1; static int hf_sflow_counters_sample_expanded_source_id_type = -1; static int hf_sflow_245_ip_source_port = -1; static int hf_sflow_245_extended_mpls_in_label_stack_entries = -1; static int hf_sflow_5_extended_mpls_vc_instance_name_length = -1; static int hf_sflow_245_ipv4_cost = -1; static int hf_sflow_5_extended_mpls_ftn_description_length = -1; static int hf_sflow_5_extended_vlan_tunnel_number_of_layers = -1; static int hf_sflow_5_extended_80211_tx_bssid = -1; static int hf_sflow_245_ip_tcp_flag_rst = -1; static int hf_sflow_245_ip_tcp_flag_ack = -1; static int hf_sflow_245_ip_tcp_flag_cwr = -1; static int hf_sflow_5_extended_80211_tx_retransmissions = -1; static int hf_sflow_5_extended_80211_rx_version = -1; static int hf_sflow_flow_sample_dropped_packets = -1; static int hf_sflow_counters_sample_expanded_source_id_index = -1; static int hf_sflow_245_header_payload_stripped = -1; static int hf_sflow_245_sampled_header_length = -1; static int hf_sflow_245_ethernet_destination_mac_address = -1; static int hf_sflow_counters_sample_source_id_class = -1; static int hf_sflow_5_extended_url_url_length = -1; static int hf_sflow_flow_sample_source_id_type = -1; static int hf_sflow_5_extended_mpls_fec_address_prefix_length = -1; static int hf_sflow_flow_sample_sequence_number = -1; static int hf_sflow_counters_sample_source_id_index = -1; static int hf_sflow_counters_sample_counters_records = -1; static int hf_sflow_5_extended_mpls_tunnel_cos_value = -1; static int hf_sflow_5_extended_mpls_vc_id = -1; static int hf_sflow_24_flow_sample_output_interface_value = -1; static int hf_sflow_5_extended_user_destination_user = -1; static int hf_sflow_245_as_type = -1; static int hf_sflow_counters_sample_index = -1; static int hf_sflow_5_extended_url_url = -1; static int hf_sflow_flow_sample_index = -1; static int hf_sflow_5_extended_80211_rx_ssid = -1; static int hf_sflow_5_extended_mpls_vc_instance_name = -1; static int hf_sflow_5_extended_mpls_tunnel_name = -1; static int hf_sflow_5_extended_80211_payload = -1; static int hf_sflow_5_extended_user_source_user = -1; static int hf_sflow_5_extended_url_host = -1; static int hf_sflow_5_extended_80211_tx_ssid = -1; static int hf_sflow_5_extended_url_direction = -1; static int hf_sflow_5_extended_mpls_ftn_description = -1; static int hf_sflow_245_ip_protocol = -1; static int hf_sflow_lag_port_padding = -1; static int hf_sflow_lag_port_actorsystemid = -1; static int hf_sflow_lag_port_partneropersystemid = -1; static int hf_sflow_lag_port_attachedaggid = -1; static int hf_sflow_lag_port_state = -1; static int hf_sflow_lag_port_actoradminstate = -1; static int hf_sflow_lag_port_actoroperstate = -1; static int hf_sflow_lag_port_partneradminstate = -1; static int hf_sflow_lag_port_partneroperstate = -1; static int hf_sflow_lag_port_reserved = -1; static int hf_sflow_5_lag_port_actoradminstate = -1; static int hf_sflow_5_lag_port_actoroperstate = -1; static int hf_sflow_5_lag_port_partneradminstate = -1; static int hf_sflow_5_lag_port_partneroperstate = -1; static int hf_sflow_lag_port_stats_lacpdusrx = -1; static int hf_sflow_lag_port_stats_markerpdusrx = -1; static int hf_sflow_lag_port_stats_markerresponsepdusrx = -1; static int hf_sflow_lag_port_stats_unknownrx = -1; static int hf_sflow_lag_port_stats_illegalrx = -1; static int hf_sflow_lag_port_stats_lacpdustx = -1; static int hf_sflow_lag_port_stats_markerpdustx = -1; static int hf_sflow_lag_port_stats_markerresponsepdustx = -1; /* Initialize the subtree pointers */ static gint ett_sflow_245 = -1; static gint ett_sflow_245_sample = -1; static gint ett_sflow_5_flow_record = -1; static gint ett_sflow_5_counters_record = -1; static gint ett_sflow_5_mpls_in_label_stack = -1; static gint ett_sflow_5_mpls_out_label_stack = -1; static gint ett_sflow_245_extended_data = -1; static gint ett_sflow_245_gw_as_dst = -1; static gint ett_sflow_245_gw_as_dst_seg = -1; static gint ett_sflow_245_gw_community = -1; static gint ett_sflow_245_sampled_header = -1; static gint ett_sflow_lag_port_state_flags = -1; static gint ett_sflow_5_output_interface = -1; static expert_field ei_sflow_invalid_address_type = EI_INIT; static dissector_table_t header_subdissector_table; static const unit_name_string units_total_packets = { " total packet", " total packets" }; void proto_reg_handoff_sflow_245(void); /* dissect a sampled header - layer 2 protocols */ static gint dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, volatile gint offset) { guint32 version, header_proto, frame_length; guint32 header_length; tvbuff_t *next_tvb; proto_tree *sflow_245_header_tree; proto_item *ti; /* stuff for saving column state before calling other dissectors. * Thanks to Guy Harris for the tip. */ gboolean save_writable; gboolean save_in_error_pkt; address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst; version = tvb_get_ntohl(tvb, 0); header_proto = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_245_header_protocol, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; frame_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_245_header_frame_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (version == 5) { proto_tree_add_item(tree, hf_sflow_245_header_payload_stripped, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } proto_tree_add_item_ret_uint(tree, hf_sflow_245_sampled_header_length, tvb, offset, 4, ENC_BIG_ENDIAN, &header_length); offset += 4; if (header_length % 4) /* XDR requires 4-byte alignment */ header_length += (4 - (header_length % 4)); ti = proto_tree_add_item(tree, hf_sflow_245_header, tvb, offset, header_length, ENC_NA); sflow_245_header_tree = proto_item_add_subtree(ti, ett_sflow_245_sampled_header); /* hand the header off to the appropriate dissector. It's probably * a short frame, so ignore any exceptions. */ next_tvb = tvb_new_subset_length_caplen(tvb, offset, header_length, frame_length); /* save some state */ save_writable = col_get_writable(pinfo->cinfo, -1); /* If sFlow samples a TCP packet it is very likely that the TCP analysis will flag the packet as having some error with the sequence numbers. sFlow only report on a "sample" of traffic so many packets will not be reported on. This is most obvious if the colorizing rules are on, but will also cause confusion if you attempt to filter on "tcp.analysis.flags". The following only works to suppress IP/TCP errors, but it is a start anyway. Other protocols carried as payloads may exhibit similar issues. I think what is really needed is a more general "protocol_as_payload" flag. Of course then someone has to play whack-a-mole and add code to implement it to any protocols that could be carried as a payload. In the case of sFlow that pretty much means anything on your network. */ save_in_error_pkt = pinfo->flags.in_error_pkt; if (!global_analyze_samp_ip_headers) { pinfo->flags.in_error_pkt = TRUE; } col_set_writable(pinfo->cinfo, -1, FALSE); copy_address_shallow(&save_dl_src, &pinfo->dl_src); copy_address_shallow(&save_dl_dst, &pinfo->dl_dst); copy_address_shallow(&save_net_src, &pinfo->net_src); copy_address_shallow(&save_net_dst, &pinfo->net_dst); copy_address_shallow(&save_src, &pinfo->src); copy_address_shallow(&save_dst, &pinfo->dst); TRY { if ((global_dissect_samp_headers == FALSE) || !dissector_try_uint(header_subdissector_table, header_proto, next_tvb, pinfo, sflow_245_header_tree)) { call_data_dissector(next_tvb, pinfo, sflow_245_header_tree); } } CATCH_BOUNDS_ERRORS { } ENDTRY; /* restore saved state */ col_set_writable(pinfo->cinfo, -1, save_writable); pinfo->flags.in_error_pkt = save_in_error_pkt; copy_address_shallow(&pinfo->dl_src, &save_dl_src); copy_address_shallow(&pinfo->dl_dst, &save_dl_dst); copy_address_shallow(&pinfo->net_src, &save_net_src); copy_address_shallow(&pinfo->net_dst, &save_net_dst); copy_address_shallow(&pinfo->src, &save_src); copy_address_shallow(&pinfo->dst, &save_dst); offset += header_length; return offset; } static gint dissect_sflow_245_address_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, struct sflow_address_type *hf_type, address *addr) { guint32 addr_type; int len; addr_type = tvb_get_ntohl(tvb, offset); offset += 4; switch (addr_type) { case ADDR_TYPE_UNKNOWN: len = 0; break; case ADDR_TYPE_IPV4: len = 4; proto_tree_add_item(tree, hf_type->hf_addr_v4, tvb, offset, 4, ENC_BIG_ENDIAN); break; case ADDR_TYPE_IPV6: len = 16; proto_tree_add_item(tree, hf_type->hf_addr_v6, tvb, offset, 16, ENC_NA); break; default: /* Invalid address type, or a type we don't understand; we don't know the length. We treat it as having no contents; that doesn't trap us in an endless loop, as we at least include the address type and thus at least advance the offset by 4. Note that we have a problem, though. */ len = 0; proto_tree_add_expert_format(tree, pinfo, &ei_sflow_invalid_address_type, tvb, offset - 4, 4, "Unknown address type (%u)", addr_type); } if (addr) { switch (len) { default: clear_address(addr); break; case 4: set_address_tvb(addr, AT_IPv4, len, tvb, offset); break; case 16: set_address_tvb(addr, AT_IPv6, len, tvb, offset); break; } } return offset + len; } /* extended switch data, after the packet data */ static gint dissect_sflow_245_extended_switch(tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree_add_item(tree, hf_sflow_245_vlan_in, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_pri_in, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_vlan_out, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_pri_out, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* extended router data, after the packet data */ static gint dissect_sflow_245_extended_router(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { struct sflow_address_type addr_type; addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4; addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); proto_tree_add_item(tree, hf_sflow_245_nexthop_src_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_nexthop_dst_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* extended MPLS data */ static gint dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { guint32 in_label_count, out_label_count, label, i, j; proto_tree *in_stack; proto_tree *out_stack; struct sflow_address_type addr_type; addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4; addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); in_label_count = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_245_extended_mpls_in_label_stack_entries, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; in_stack = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_mpls_in_label_stack, NULL, "In Label Stack"); /* by applying the mask, we avoid possible corrupted data that causes huge number of loops * 255 is a sensible limit of label count */ for (i = 0, j = 0; i < (in_label_count & 0x000000ff); i++, j += 4) { label = tvb_get_ntohl(tvb, offset + j); proto_tree_add_uint_format(in_stack, hf_sflow_245_extended_mpls_in_label, tvb, offset, 4, label, "Label %u: %u", i + 1, label); } offset += (in_label_count * 4); out_label_count = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_245_extended_mpls_out_label_stack_entries, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; out_stack = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_mpls_in_label_stack, NULL, "Out Label Stack"); /* by applying the mask, we avoid possible corrupted data that causes huge number of loops * 255 is a sensible limit of label count */ for (i = 0, j = 0; i < (out_label_count & 0x000000ff); i++, j += 4) { label = tvb_get_ntohl(tvb, offset + j); proto_tree_add_uint_format(out_stack, hf_sflow_245_extended_mpls_out_label, tvb, offset, 4, label, "Label %u: %u", i + 1, label); } offset = offset + out_label_count * 4; return offset; } /* extended NAT data */ static gint dissect_sflow_5_extended_nat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { struct sflow_address_type addr_type; addr_type.hf_addr_v4 = hf_sflow_245_ipv4_src; addr_type.hf_addr_v6 = hf_sflow_245_ipv6_src; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); addr_type.hf_addr_v4 = hf_sflow_245_ipv4_dst; addr_type.hf_addr_v6 = hf_sflow_245_ipv6_dst; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); return offset; } /* extended gateway data, after the packet data */ static gint dissect_sflow_245_extended_gateway(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { gint32 len = 0; gint32 i, j, comm_len, dst_len, dst_seg_len; guint32 path_type; gint32 kludge; guint32 version = tvb_get_ntohl(tvb, 0); /* get sFlow version */ proto_item *ti; proto_tree *sflow_245_dst_as_tree; proto_tree *sflow_245_comm_tree; proto_tree *sflow_245_dst_as_seg_tree; /* sFlow v5 contains next hop router IP address */ if (version == 5) { struct sflow_address_type addr_type; addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4; addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); } proto_tree_add_item(tree, hf_sflow_245_as, tvb, offset + len, 4, ENC_BIG_ENDIAN); len += 4; proto_tree_add_item(tree, hf_sflow_245_src_as, tvb, offset + len, 4, ENC_BIG_ENDIAN); len += 4; proto_tree_add_item(tree, hf_sflow_245_src_peer_as, tvb, offset + len, 4, ENC_BIG_ENDIAN); len += 4; dst_len = tvb_get_ntohl(tvb, offset + len); ti = proto_tree_add_uint(tree, hf_sflow_245_dst_as_entries, tvb, offset + len, 4, dst_len); sflow_245_dst_as_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_as_dst); len += 4; for (i = 0; i < dst_len; i++) { if (version < 4) { /* Version 2 AS paths are different than versions >= 4 as follows: There is no type encoded in the packet. The destination ASs are encoded as an array of integers rather as an array of arrays of integers. I just pretended they were encoded as an array of arrays with an implicit length of 1 to not have to do two completely separate blocks for the different versions. Having a subtree for "arrays" guaranteed to have only a single element proved cumbersome to navigate so I moved the creation of the subtree to only happen for versions >= 4. */ dst_seg_len = 1; sflow_245_dst_as_seg_tree = sflow_245_dst_as_tree; } else { path_type = tvb_get_ntohl(tvb, offset + len); len += 4; dst_seg_len = tvb_get_ntohl(tvb, offset + len); len += 4; kludge = 8; ti = proto_tree_add_uint_format(tree, hf_sflow_245_as_type, tvb, offset + len - kludge, kludge, path_type, "%s, (%u entries)", val_to_str_const(path_type, sflow_245_as_types, "Unknown AS type"), dst_seg_len); sflow_245_dst_as_seg_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_as_dst_seg); } for (j = 0; j < dst_seg_len; j++) { proto_tree_add_item(sflow_245_dst_as_seg_tree, hf_sflow_245_dst_as, tvb, offset + len, 4, ENC_BIG_ENDIAN); len += 4; } } if (version >= 4) { comm_len = tvb_get_ntohl(tvb, offset + len); ti = proto_tree_add_uint(tree, hf_sflow_245_community_entries, tvb, offset + len, 4, comm_len); sflow_245_comm_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_community); len += 4; for (i = 0; i < comm_len; i++) { proto_tree_add_item(sflow_245_comm_tree, hf_sflow_245_dst_as, tvb, offset + len, 4, ENC_BIG_ENDIAN); len += 4; } proto_tree_add_item(tree, hf_sflow_245_localpref, tvb, offset + len, 4, ENC_BIG_ENDIAN); len += 4; } return offset + len; } /* sflow v5 ethernet frame data */ static gint dissect_sflow_5_ethernet_frame(tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree_add_item(tree, hf_sflow_245_ethernet_length_of_mac_packet, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ethernet_source_mac_address, tvb, offset, 6, ENC_NA); /* Padded to 4 byte offset */ offset += 8; proto_tree_add_item(tree, hf_sflow_245_ethernet_destination_mac_address, tvb, offset, 6, ENC_NA); /* Padded to 4 byte offset */ offset += 8; proto_tree_add_item(tree, hf_sflow_245_ethernet_packet_type, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 IPv4 data */ static gint dissect_sflow_5_ipv4(tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree_add_item(tree, hf_sflow_245_length_of_ip_packet, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_protocol, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_source_port, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_destination_port, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_cwr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ece, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_urg, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ack, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_psh, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_rst, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_syn, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_fin, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* 7 bits for type of service, plus 1 reserved bit */ proto_tree_add_item(tree, hf_sflow_245_ipv4_precedence_type, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ipv4_delay, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ipv4_throughput, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ipv4_reliability, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ipv4_cost, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 IPv6 data */ static gint dissect_sflow_5_ipv6(tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree_add_item(tree, hf_sflow_245_length_of_ip_packet, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_protocol, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ipv6_src, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(tree, hf_sflow_245_ipv6_dst, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(tree, hf_sflow_245_ip_source_port, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_destination_port, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_cwr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ece, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_urg, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ack, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_psh, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_rst, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_syn, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_fin, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Priority -- Traffic class field enables a source to identify the desired delivery priority of the packets. Priority values are divided into ranges: traffic where the source provides congestion control and non-congestion control traffic. It is displayed as unsigned integer here according to sFlow specification */ proto_tree_add_item(tree, hf_sflow_245_ipv6_priority, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 user data */ static gint dissect_sflow_5_extended_user(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 src_length, dest_length; /* charset is not processed here, all chars are assumed to be ASCII */ proto_tree_add_item(tree, hf_sflow_5_extended_user_source_character_set, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; src_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_user_source_user_string_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract source user info char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_user_source_user, tvb, offset, src_length, ENC_NA|ENC_ASCII); offset += src_length; /* get the correct offset by adding padding byte count */ if (src_length % 4) offset += (4 - src_length % 4); /* charset is not processed here, all chars are assumed to be ASCII */ proto_tree_add_item(tree, hf_sflow_5_extended_user_destination_character_set, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; dest_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_user_destination_user_string_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract destination user info char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_user_destination_user, tvb, offset, dest_length, ENC_NA|ENC_ASCII); offset += dest_length; /* get the correct offset by adding padding byte count */ if (dest_length % 4) offset += (4 - dest_length % 4); return offset; } /* sflow v5 URL data */ static gint dissect_sflow_5_extended_url(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 direction, url_length, host_length; direction = tvb_get_ntohl(tvb, offset); switch (direction) { case 1: proto_tree_add_uint_format(tree, hf_sflow_5_extended_url_direction, tvb, offset, 4, direction, "Source Address is Server(%u)", direction); break; case 2: proto_tree_add_uint_format(tree, hf_sflow_5_extended_url_direction, tvb, offset, 4, direction, "Destination Address is Server (%u)", direction); break; default: proto_tree_add_uint_format(tree, hf_sflow_5_extended_url_direction, tvb, offset, 4, direction, "Server Unspecified (%u)", direction); break; } offset += 4; url_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_url_url_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract URL char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_url_url, tvb, offset, url_length, ENC_NA|ENC_ASCII); offset += url_length; /* get the correct offset by adding padding byte count */ if (url_length % 4) offset += (4 - url_length % 4); host_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_url_host_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract host info char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_url_host, tvb, offset, host_length, ENC_NA|ENC_ASCII); offset += host_length; /* get the correct offset by adding padding byte count */ if (host_length % 4) offset += (4 - host_length % 4); return offset; } /* sflow v5 MPLS tunnel */ static gint dissect_sflow_5_extended_mpls_tunnel(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 name_length; name_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_name_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract tunnel name char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_name, tvb, offset, name_length, ENC_NA|ENC_ASCII); offset += name_length; /* get the correct offset by adding padding byte count */ if (name_length % 4) offset += (4 - name_length % 4); proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_cos_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 MPLS VC */ static gint dissect_sflow_5_extended_mpls_vc(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 name_length; name_length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_instance_name_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract source user info char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_instance_name, tvb, offset, name_length, ENC_NA|ENC_ASCII); offset += name_length; /* get the correct offset by adding padding byte count */ if (name_length % 4) offset += (4 - name_length % 4); proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_label_cos_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 MPLS FEC */ static gint dissect_sflow_5_extended_mpls_fec(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 length; length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_mpls_ftn_description_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract MPLS FTN description char by char */ proto_tree_add_item(tree, hf_sflow_5_extended_mpls_ftn_description, tvb, offset, length, ENC_NA|ENC_ASCII); offset += length; /* get the correct offset by adding padding byte count */ if (length % 4) offset += (4 - length % 4); proto_tree_add_item(tree, hf_sflow_5_extended_mpls_ftn_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 MPLS LVP FEC */ static gint dissect_sflow_5_extended_mpls_lvp_fec(tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree_add_item(tree, hf_sflow_5_extended_mpls_fec_address_prefix_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 extended VLAN tunnel */ static gint dissect_sflow_5_extended_vlan_tunnel(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 num, i; num = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_vlan_tunnel_number_of_layers, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* loop strip 802.1Q TPID/TCI layers. each TPID/TCI pair is represented as a single 32 bit integer layers listed from outermost to innermost */ for (i = 0; i < num; i++) { proto_tree_add_item(tree, hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } return offset; } /* sflow v5 extended 802.11 payload */ static gint dissect_sflow_5_extended_80211_payload(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 cipher_suite, OUI, suite_type, length; cipher_suite = tvb_get_ntohl(tvb, offset); OUI = cipher_suite >> 8; suite_type = cipher_suite & 0x000000ff; if (OUI == 0x000FAC) { proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_oui, tvb, offset, 3, OUI, "Default (0x%X)", OUI); offset += 3; proto_tree_add_item(tree, hf_sflow_5_extended_80211_suite_type, tvb, offset, 1, ENC_BIG_ENDIAN); } else { proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_oui, tvb, offset, 3, OUI, "Other vendor (0x%X)", OUI); offset += 3; proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_suite_type, tvb, offset, 1, suite_type, "vendor specific (%u)", suite_type); } offset++; length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_5_extended_80211_payload_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* extract data byte by byte */ proto_tree_add_item(tree, hf_sflow_5_extended_80211_payload, tvb, offset, length, ENC_NA); offset += length; /* get the correct offset by adding padding byte count */ if (length % 4) offset += (4 - length % 4); return offset; } /* sflow v5 extended 802.11 rx */ static gint dissect_sflow_5_extended_80211_rx(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 ssid_length, duration; /* extract SSID char by char. max char count = 32 */ ssid_length = tvb_get_ntohl(tvb, offset); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_ssid, tvb, offset, ssid_length, ENC_NA|ENC_ASCII); offset += ssid_length; /* get the correct offset by adding padding byte count */ if (ssid_length % 4) offset += (4 - ssid_length % 4); proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_bssid, tvb, offset, 6, ENC_NA); /* Padded to 4 byte offset */ offset += 8; proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_channel, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_speed, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_rsni, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_rcpi, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; duration = tvb_get_ntohl(tvb, offset); if (duration == 0) { proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_rx_packet_duration, tvb, offset, 4, duration, "Unknown"); } else { proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_packet_duration, tvb, offset, 4, ENC_BIG_ENDIAN); } offset += 4; return offset; } /* sflow v5 extended 802.11 tx */ static gint dissect_sflow_5_extended_80211_tx(tvbuff_t *tvb, proto_tree *tree, gint offset) { guint32 ssid_length, transmissions, packet_duration, retrans_duration; /* extract SSID char by char. max char count = 32 */ ssid_length = tvb_get_ntohl(tvb, offset); if (ssid_length > 32) ssid_length = 32; offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_ssid, tvb, offset, ssid_length, ENC_NA|ENC_ASCII); offset += ssid_length; /* get the correct offset by adding padding byte count */ if (ssid_length % 4) offset += (4 - ssid_length % 4); proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_bssid, tvb, offset, 6, ENC_NA); /* Padded to 4 byte offset */ offset += 8; proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; transmissions = tvb_get_ntohl(tvb, offset); switch (transmissions) { case 0: proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_retransmissions, tvb, offset, 4, 0, "Unknown"); break; case 1: proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_retransmissions, tvb, offset, 4, 1, "Packet transmitted successfully on first attempt"); break; default: proto_tree_add_uint(tree, hf_sflow_5_extended_80211_tx_retransmissions, tvb, offset, 4, transmissions - 1); break; } offset += 4; packet_duration = tvb_get_ntohl(tvb, offset); if (packet_duration == 0) { proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_packet_duration, tvb, offset, 4, packet_duration, "Unknown"); } else { proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_packet_duration, tvb, offset, 4, ENC_BIG_ENDIAN); } offset += 4; retrans_duration = tvb_get_ntohl(tvb, offset); if (retrans_duration == 0) { proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_retransmission_duration, tvb, offset, 4, retrans_duration, "Unknown"); } else { proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_retransmission_duration, tvb, offset, 4, ENC_BIG_ENDIAN); } offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_channel, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_speed, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_power, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* sflow v5 extended 802.11 aggregation */ static gint dissect_sflow_5_extended_80211_aggregation(tvbuff_t *tvb _U_, proto_tree *tree _U_, gint offset) { return offset; } /* dissect an sflow v2/4 flow sample */ static gint dissect_sflow_24_flow_sample(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, proto_item *parent) { guint32 sequence_number, sampling_rate, output; proto_tree *extended_data_tree; proto_item *ti; guint32 packet_type, extended_data, ext_type, i; sequence_number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_flow_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(parent, ", seq %u", sequence_number); proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_class, tvb, offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_flow_sample_index, tvb, offset + 4, 4, ENC_BIG_ENDIAN); sampling_rate = tvb_get_ntohl(tvb, offset + 8); proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sampling_rate, tvb, offset + 8, 4, sampling_rate, "1 out of %u packets", sampling_rate); proto_tree_add_item(tree, hf_sflow_flow_sample_sample_pool, tvb, offset + 12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_flow_sample_dropped_packets, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface, tvb, offset + 20, 4, ENC_BIG_ENDIAN); output = tvb_get_ntohl(tvb, offset + 24); if (output & 0x80000000) { output & 0x7fffffff ? proto_tree_add_uint_format_value(tree, hf_sflow_24_flow_sample_multiple_outputs, tvb, offset + 24, 4, output & 0x7fffffff, "%u interfaces", output & 0x7fffffff) : proto_tree_add_uint_format_value(tree, hf_sflow_24_flow_sample_multiple_outputs, tvb, offset + 24, 4, 0x80000000, "unknown number"); } else { proto_tree_add_item(tree, hf_sflow_24_flow_sample_output_interface, tvb, offset + 24, 4, ENC_BIG_ENDIAN); } offset += 28; /* what kind of flow sample is it? */ packet_type = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_245_packet_information_type, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch (packet_type) { case SFLOW_245_PACKET_DATA_TYPE_HEADER: offset = dissect_sflow_245_sampled_header(tvb, pinfo, tree, offset); break; case SFLOW_245_PACKET_DATA_TYPE_IPV4: case SFLOW_245_PACKET_DATA_TYPE_IPV6: default: break; } /* still need to dissect extended data */ extended_data = tvb_get_ntohl(tvb, offset); offset += 4; for (i = 0; i < extended_data; i++) { /* figure out what kind of extended data it is */ ext_type = tvb_get_ntohl(tvb, offset); /* create a subtree. Might want to move this to * the end, so more info can be correct. */ ti = proto_tree_add_uint(tree, hf_sflow_245_extended_information_type, tvb, offset, 4, ext_type); extended_data_tree = proto_item_add_subtree(ti, ett_sflow_245_extended_data); offset += 4; switch (ext_type) { case SFLOW_245_EXTENDED_SWITCH: offset = dissect_sflow_245_extended_switch(tvb, extended_data_tree, offset); break; case SFLOW_245_EXTENDED_ROUTER: offset = dissect_sflow_245_extended_router(tvb, pinfo, extended_data_tree, offset); break; case SFLOW_245_EXTENDED_GATEWAY: offset = dissect_sflow_245_extended_gateway(tvb, pinfo, extended_data_tree, offset); break; case SFLOW_245_EXTENDED_USER: break; case SFLOW_245_EXTENDED_URL: break; default: break; } proto_item_set_end(ti, tvb, offset); } return offset; } /* dissect an sflow v5 flow record */ static gint dissect_sflow_5_flow_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { proto_tree *flow_data_tree; proto_item *ti; guint32 enterprise_format, enterprise, format; /* what kind of flow sample is it? */ enterprise_format = tvb_get_ntohl(tvb, offset); enterprise = enterprise_format >> 12; format = enterprise_format & 0x00000fff; /* only accept default enterprise 0 (InMon sFlow) */ if (enterprise == ENTERPRISE_DEFAULT) { flow_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_flow_record, &ti, val_to_str_ext_const(format, &sflow_5_flow_record_type_ext, "Unknown sample format")); proto_tree_add_uint_format_value(flow_data_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "standard sFlow (%u)", enterprise); proto_tree_add_item(flow_data_tree, hf_sflow_5_flow_record_format, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(flow_data_tree, hf_sflow_5_flow_data_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch (format) { case SFLOW_5_RAW_PACKET_HEADER: offset = dissect_sflow_245_sampled_header(tvb, pinfo, flow_data_tree, offset); break; case SFLOW_5_ETHERNET_FRAME: offset = dissect_sflow_5_ethernet_frame(tvb, flow_data_tree, offset); break; case SFLOW_5_IPV4: offset = dissect_sflow_5_ipv4(tvb, flow_data_tree, offset); break; case SFLOW_5_IPV6: offset = dissect_sflow_5_ipv6(tvb, flow_data_tree, offset); break; case SFLOW_5_SWITCH: offset = dissect_sflow_245_extended_switch(tvb, flow_data_tree, offset); break; case SFLOW_5_ROUTER: offset = dissect_sflow_245_extended_router(tvb, pinfo, flow_data_tree, offset); break; case SFLOW_5_GATEWAY: offset = dissect_sflow_245_extended_gateway(tvb, pinfo, flow_data_tree, offset); break; case SFLOW_5_USER: offset = dissect_sflow_5_extended_user(tvb, flow_data_tree, offset); break; case SFLOW_5_URL: offset = dissect_sflow_5_extended_url(tvb, flow_data_tree, offset); break; case SFLOW_5_MPLS_DATA: offset = dissect_sflow_5_extended_mpls_data(tvb, pinfo, flow_data_tree, offset); break; case SFLOW_5_NAT: offset = dissect_sflow_5_extended_nat(tvb, pinfo, flow_data_tree, offset); break; case SFLOW_5_MPLS_TUNNEL: offset = dissect_sflow_5_extended_mpls_tunnel(tvb, flow_data_tree, offset); break; case SFLOW_5_MPLS_VC: offset = dissect_sflow_5_extended_mpls_vc(tvb, flow_data_tree, offset); break; case SFLOW_5_MPLS_FEC: offset = dissect_sflow_5_extended_mpls_fec(tvb, flow_data_tree, offset); break; case SFLOW_5_MPLS_LVP_FEC: offset = dissect_sflow_5_extended_mpls_lvp_fec(tvb, flow_data_tree, offset); break; case SFLOW_5_VLAN_TUNNEL: offset = dissect_sflow_5_extended_vlan_tunnel(tvb, flow_data_tree, offset); break; case SFLOW_5_80211_PAYLOAD: offset = dissect_sflow_5_extended_80211_payload(tvb, flow_data_tree, offset); break; case SFLOW_5_80211_RX: offset = dissect_sflow_5_extended_80211_rx(tvb, flow_data_tree, offset); break; case SFLOW_5_80211_TX: offset = dissect_sflow_5_extended_80211_tx(tvb, flow_data_tree, offset); break; case SFLOW_5_80211_AGGREGATION: offset = dissect_sflow_5_extended_80211_aggregation(tvb, flow_data_tree, offset); break; default: break; } } else { /* unknown enterprise format, what to do?? */ guint32 length; flow_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_flow_record, &ti, "Unknown enterprise format"); proto_tree_add_uint_format_value(flow_data_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "Non-standard sFlow (%u)", enterprise); offset += 4; /* get length */ proto_tree_add_item_ret_uint(flow_data_tree, hf_sflow_enterprise_length, tvb, offset, 4, ENC_BIG_ENDIAN, &length); offset += 4; /* show data as bytes */ proto_tree_add_item(flow_data_tree, hf_sflow_enterprise_data, tvb, offset, length, ENC_NA); offset += length; /* get the correct offset by adding padding byte count */ if (length % 4) offset += (4 - length % 4); } proto_item_set_end(ti, tvb, offset); return offset; } /* dissect generic interface counters */ static gint dissect_sflow_5_generic_interface(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_245_ifindex, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_iftype, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifspeed, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifdirection, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifadmin_status, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoper_status, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinoct, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinpkt, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinmcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinbcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifindisc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinerr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinunk, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutoct, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutpkt, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutmcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutbcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutdisc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifouterr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_ifpromisc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* dissect ethernet interface counters */ static gint dissect_sflow_5_ethernet_interface(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsAlignmentErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsFCSErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsSingleCollisionFrames, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsMultipleCollisionFrames, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsSQETestErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsDeferredTransmissions, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsLateCollisions, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsExcessiveCollisions, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsInternalMacTransmitErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsCarrierSenseErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsFrameTooLongs, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsInternalMacReceiveErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsSymbolErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* dissect token ring counters */ static gint dissect_sflow_5_token_ring(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsLineErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsBurstErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsACErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsAbortTransErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsInternalErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsLostFrameErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsReceiveCongestions, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsFrameCopiedErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsTokenErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsSoftErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsHardErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsSignalLoss, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsTransmitBeacons, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsRecoveries, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsLobeWires, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsRemoves, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsSingles, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsFreqErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* dissect 100 BaseVG interface counters */ static gint dissect_sflow_5_vg_interface(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InHighPriorityFrames, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InNormPriorityFrames, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InNormPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InIPMErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InOversizeFrameErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InDataErrors, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InNullAddressedFrames, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12OutHighPriorityFrames, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12OutHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12TransitionIntoTrainings, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12HCInHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12HCInNormPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12HCOutHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; return offset; } /* dissect VLAN counters */ static gint dissect_sflow_5_vlan(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_245_vlan_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_octets, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_245_ucastPkts, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_multicastPkts, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_broadcastPkts, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_245_discards, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } static int * const sflow_5_lag_port_state_flags[] = { &hf_sflow_5_lag_port_actoradminstate, &hf_sflow_5_lag_port_actoroperstate, &hf_sflow_5_lag_port_partneradminstate, &hf_sflow_5_lag_port_partneroperstate, NULL }; static gint dissect_sflow_5_lag(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_actorsystemid, tvb, offset, 6, ENC_NA); offset += 6; /* XDR requires 4-byte alignment */ proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_padding, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_partneropersystemid, tvb, offset, 6, ENC_NA); offset += 6; /* XDR requires 4-byte alignment */ proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_padding, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_attachedaggid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_bitmask(counter_data_tree, tvb, offset, hf_sflow_lag_port_state, ett_sflow_lag_port_state_flags, sflow_5_lag_port_state_flags, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_lacpdusrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_markerpdusrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_markerresponsepdusrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_unknownrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_illegalrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_lacpdustx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_markerpdustx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_lag_port_stats_markerresponsepdustx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* dissect 802.11 counters */ static gint dissect_sflow_5_80211_counters(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11TransmittedFragmentCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11MulticastTransmittedFrameCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11FailedCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11RetryCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11MultipleRetryCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11FrameDuplicateCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11RTSSuccessCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11RTSFailureCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11ACKFailureCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11ReceivedFragmentCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11MulticastReceivedFrameCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11FCSErrorCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11TransmittedFrameCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11WEPUndecryptableCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSDiscardedFragmentCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11AssociatedStationCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsReceivedCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsUnusedCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsUnusableCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsLostCount, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* dissect processor information */ static gint dissect_sflow_5_processor_information(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_5_cpu_5s, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_cpu_1m, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_cpu_5m, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_total_memory, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(counter_data_tree, hf_sflow_5_free_memory, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; return offset; } /* dissect radio utilization */ static gint dissect_sflow_5_radio_utilization(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) { proto_tree_add_item(counter_data_tree, hf_sflow_5_elapsed_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_on_channel_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_on_channel_busy_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } /* dissect an sflow v5 counters record */ static gint dissect_sflow_5_counters_record(tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree *counter_data_tree; proto_item *ti; guint32 enterprise_format, enterprise, format; /* what kind of flow sample is it? */ enterprise_format = tvb_get_ntohl(tvb, offset); enterprise = enterprise_format >> 12; format = enterprise_format & 0x00000fff; if (enterprise == ENTERPRISE_DEFAULT) { /* only accept default enterprise 0 (InMon sFlow) */ counter_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_counters_record, &ti, val_to_str_const(format, sflow_5_counters_record_type, "Unknown sample format")); proto_tree_add_uint_format_value(counter_data_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "standard sFlow (%u)", enterprise); proto_tree_add_item(counter_data_tree, hf_sflow_5_counters_record_format, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(counter_data_tree, hf_sflow_5_flow_data_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch (format) { case SFLOW_5_GENERIC_INTERFACE: offset = dissect_sflow_5_generic_interface(counter_data_tree, tvb, offset); break; case SFLOW_5_ETHERNET_INTERFACE: offset = dissect_sflow_5_ethernet_interface(counter_data_tree, tvb, offset); break; case SFLOW_5_TOKEN_RING: offset = dissect_sflow_5_token_ring(counter_data_tree, tvb, offset); break; case SFLOW_5_100BASE_VG_INTERFACE: offset = dissect_sflow_5_vg_interface(counter_data_tree, tvb, offset); break; case SFLOW_5_VLAN: offset = dissect_sflow_5_vlan(counter_data_tree, tvb, offset); break; case SFLOW_5_LAG: offset = dissect_sflow_5_lag(counter_data_tree, tvb, offset); break; case SFLOW_5_80211_COUNTERS: offset = dissect_sflow_5_80211_counters(counter_data_tree, tvb, offset); break; case SFLOW_5_PROCESSOR: offset = dissect_sflow_5_processor_information(counter_data_tree, tvb, offset); break; case SFLOW_5_RADIO_UTILIZATION: offset = dissect_sflow_5_radio_utilization(counter_data_tree, tvb, offset); break; default: break; } } else { /* unknown enterprise format, what to do?? */ guint32 length; counter_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_counters_record, &ti, "Unknown enterprise format"); proto_tree_add_uint_format_value(counter_data_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "Non-standard sFlow (%u)", enterprise); offset += 4; /* get length */ proto_tree_add_item_ret_uint(counter_data_tree, hf_sflow_enterprise_length, tvb, offset, 4, ENC_BIG_ENDIAN, &length); offset += 4; /* show data as bytes */ proto_tree_add_item(counter_data_tree, hf_sflow_enterprise_data, tvb, offset, length, ENC_NA); offset += length; /* get the correct offset by adding padding byte count */ if (length % 4) offset += (4 - length % 4); } proto_item_set_end(ti, tvb, offset); return offset; } /* dissect an sflow v5 flow sample */ static void dissect_sflow_5_flow_sample(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, proto_item *parent) { guint32 sequence_number, sampling_rate, output, records, i, output_format; proto_item *ti; proto_tree *output_interface_tree; sequence_number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_flow_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_item_append_text(parent, ", seq %u", sequence_number); proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_class, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_flow_sample_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sampling_rate = tvb_get_ntohl(tvb, offset); proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sampling_rate, tvb, offset, 4, sampling_rate, "1 out of %u packets", sampling_rate); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_sample_pool, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_dropped_packets, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; ti = proto_tree_add_item_ret_uint(tree, hf_sflow_5_flow_sample_output_interface, tvb, offset, 4, ENC_BIG_ENDIAN, &output); output_interface_tree = proto_item_add_subtree(ti, ett_sflow_5_output_interface); output_format = output >> 30; proto_tree_add_item(output_interface_tree, hf_sflow_5_flow_sample_output_interface_form, tvb, offset, 4, ENC_BIG_ENDIAN); switch(output_format) { case SFLOW_5_INT_FORMAT_DISCARD: proto_tree_add_item(output_interface_tree, hf_sflow_5_flow_sample_output_interface_val_discard, tvb, offset, 4, ENC_BIG_ENDIAN); break; case SFLOW_5_INT_FORMAT_MULTIPLE: ti =proto_tree_add_item(output_interface_tree, hf_sflow_5_flow_sample_output_interface_val, tvb, offset, 4, ENC_BIG_ENDIAN); if (output == 0x80000000) { proto_item_append_text(ti, " unknown number of interfaces greater than 1"); } break; case SFLOW_5_INT_FORMAT_IFINDEX: default: proto_tree_add_item(output_interface_tree, hf_sflow_5_flow_sample_output_interface_val, tvb, offset, 4, ENC_BIG_ENDIAN); break; } offset += 4; records = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_flow_sample_flow_record, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* start loop processing flow records */ /* we set an upper records limit to 255 in case corrupted data causes * huge number of loops! */ for (i = 0; i < (records&0x000000ff); i++) { offset = dissect_sflow_5_flow_record(tvb, pinfo, tree, offset); } } /* dissect an expanded flow sample */ static void dissect_sflow_5_expanded_flow_sample(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, proto_item *parent) { guint32 sequence_number, sampling_rate, records, i; sequence_number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_flow_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_item_append_text(parent, ", seq %u", sequence_number); proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_type, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sampling_rate = tvb_get_ntohl(tvb, offset); proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sampling_rate, tvb, offset, 4, sampling_rate, "1 out of %u packets", sampling_rate); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_sample_pool, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_dropped_packets, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface_format, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_24_flow_sample_output_interface_format, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_24_flow_sample_output_interface_value, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; records = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_flow_sample_flow_record, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* start loop processing flow records * we limit record count to 255 in case corrupted data may cause huge number of loops */ for (i = 0; i < (records&0x000000ff); i++) { offset = dissect_sflow_5_flow_record(tvb, pinfo, tree, offset); } } /* dissect an sflow v2/4 counters sample */ static gint dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) { guint32 sequence_number, counters_type; sequence_number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_counters_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(parent, ", seq %u", sequence_number); proto_tree_add_item(tree, hf_sflow_counters_sample_source_id_class, tvb, offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_counters_sample_index, tvb, offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_counters_sample_sampling_interval, tvb, offset + 8, 4, ENC_BIG_ENDIAN); counters_type = tvb_get_ntohl(tvb, offset + 12); proto_tree_add_item(tree, hf_sflow_counters_sample_counters_type, tvb, offset + 12, 4, ENC_BIG_ENDIAN); offset += 16; /* most counters types have the "generic" counters first */ switch (counters_type) { case SFLOW_245_COUNTERS_GENERIC: case SFLOW_245_COUNTERS_ETHERNET: case SFLOW_245_COUNTERS_TOKENRING: case SFLOW_245_COUNTERS_FDDI: case SFLOW_245_COUNTERS_VG: case SFLOW_245_COUNTERS_WAN: proto_tree_add_item(tree, hf_sflow_245_ifindex, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(parent, ", ifIndex %u", tvb_get_ntohl(tvb, offset)); offset += 4; proto_tree_add_item(tree, hf_sflow_245_iftype, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifspeed, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_sflow_245_ifdirection, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifadmin_status, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_245_ifoper_status, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifinoct, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_sflow_245_ifinpkt, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifinmcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifinbcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifindisc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifinerr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifinunk, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifoutoct, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(tree, hf_sflow_245_ifoutpkt, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifoutmcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifoutbcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifoutdisc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifouterr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_ifpromisc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; } /* Some counter types have other info to gather */ switch (counters_type) { case SFLOW_245_COUNTERS_ETHERNET: offset += (int)sizeof (struct ethernet_counters); break; case SFLOW_245_COUNTERS_TOKENRING: offset = dissect_sflow_5_token_ring(tree, tvb, offset); break; case SFLOW_245_COUNTERS_VG: offset = dissect_sflow_5_vg_interface(tree, tvb, offset); break; case SFLOW_245_COUNTERS_VLAN: offset = dissect_sflow_5_vlan(tree, tvb, offset); break; default: break; } return offset; } /* dissect an sflow v5 counters sample */ static void dissect_sflow_5_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) { guint32 sequence_number, records, i; /* grab the flow header. This will remain in network byte order, so must convert each item before use */ sequence_number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_counters_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(parent, ", seq %u", sequence_number); offset += 4; proto_tree_add_item(tree, hf_sflow_counters_sample_source_id_type, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sflow_counters_sample_source_id_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; records = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_counters_sample_counters_records, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* start loop processing counters records * limit record count to 255 in case corrupted data may cause huge number of loops */ for (i = 0; i < (records&0x000000ff); i++) { offset = dissect_sflow_5_counters_record(tvb, tree, offset); } } /* dissect an expanded counters sample */ static void dissect_sflow_5_expanded_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) { guint32 sequence_number, records, i; sequence_number = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_counters_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(parent, ", seq %u", sequence_number); offset += 4; proto_tree_add_item(tree, hf_sflow_counters_sample_expanded_source_id_type, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_counters_sample_expanded_source_id_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; records = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_sflow_counters_sample_counters_records, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* start loop processing counters records * limit record count to 255 in case corrupted data may cause huge number of loops */ for (i = 0; i < (records&0x000000ff); i++) { offset = dissect_sflow_5_counters_record(tvb, tree, offset); } } static int * const sflow_lag_port_state_flags[] = { &hf_sflow_lag_port_actoradminstate, &hf_sflow_lag_port_actoroperstate, &hf_sflow_lag_port_partneradminstate, &hf_sflow_lag_port_partneroperstate, &hf_sflow_lag_port_reserved, NULL }; /* dissect an LAG Port Stats ( http://www.sflow.org/sflow_lag.txt ) */ static void dissect_sflow_5_lag_port_stats(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent _U_) { proto_tree_add_item(tree, hf_sflow_lag_port_actorsystemid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(tree, hf_sflow_lag_port_partneropersystemid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(tree, hf_sflow_lag_port_attachedaggid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_bitmask(tree, tvb, offset, hf_sflow_lag_port_state, ett_sflow_lag_port_state_flags, sflow_lag_port_state_flags, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_lacpdusrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerpdusrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerresponsepdusrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_unknownrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_illegalrx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_lacpdustx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerpdustx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerresponsepdustx, tvb, offset, 4, ENC_BIG_ENDIAN); /*offset += 4;*/ } /* Code to dissect the sflow v2/4/5 samples */ static gint dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, guint32 version) { proto_tree *sflow_245_sample_tree; proto_item *ti; /* tree item */ guint32 sample_type, enterprise, format, length; /* decide what kind of sample it is. */ sample_type = tvb_get_ntohl(tvb, offset); if (version == 5) { enterprise = sample_type >> 12; format = sample_type & 0x00000fff; if (enterprise == ENTERPRISE_DEFAULT) { /* only accept default enterprise 0 (InMon sFlow) */ sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_245_sample, &ti, val_to_str_const(format, sflow_245_sampletype, "Unknown sample format")); proto_tree_add_uint_format_value(sflow_245_sample_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "standard sFlow (%u)", enterprise); proto_tree_add_item(sflow_245_sample_tree, hf_sflow_245_sampletype12, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sflow_245_sample_tree, hf_sflow_5_sample_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch (format) { case FLOWSAMPLE: dissect_sflow_5_flow_sample(tvb, pinfo, sflow_245_sample_tree, offset, ti); break; case COUNTERSSAMPLE: dissect_sflow_5_counters_sample(tvb, sflow_245_sample_tree, offset, ti); break; case EXPANDED_FLOWSAMPLE: dissect_sflow_5_expanded_flow_sample(tvb, pinfo, sflow_245_sample_tree, offset, ti); break; case EXPANDED_COUNTERSSAMPLE: dissect_sflow_5_expanded_counters_sample(tvb, sflow_245_sample_tree, offset, ti); break; case LAG_PORT_STATS: dissect_sflow_5_lag_port_stats(tvb, sflow_245_sample_tree, offset, ti); break; default: break; } /* Make sure the length doesn't run past the end of the packet */ tvb_ensure_bytes_exist(tvb, offset, length); /* current offset points to sample length field, which is 4 bytes from the beginning of the packet*/ offset += length; } else { /* unknown enterprise format, what to do?? */ sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_245_sample, &ti, "Unknown enterprise format"); proto_tree_add_uint_format_value(sflow_245_sample_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "Non-standard sFlow (%u)", enterprise); offset = tvb_captured_length(tvb); } } else { /* version 2 or 4 */ sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_245_sample, &ti, val_to_str_const(sample_type, sflow_245_sampletype, "Unknown sample type")); proto_tree_add_item(sflow_245_sample_tree, hf_sflow_245_sampletype, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; switch (sample_type) { case FLOWSAMPLE: offset = dissect_sflow_24_flow_sample(tvb, pinfo, sflow_245_sample_tree, offset, ti); break; case COUNTERSSAMPLE: offset = dissect_sflow_24_counters_sample(tvb, sflow_245_sample_tree, offset, ti); break; default: break; } } proto_item_set_end(ti, tvb, offset); return offset; } /* Code to actually dissect the packets */ static int dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *sflow_245_tree; guint32 version, sub_agent_id, seqnum; address addr_details; int sflow_addr_type; struct sflow_address_type addr_type; guint32 uptime; guint32 numsamples; guint offset = 0; guint i = 0; addr_type.hf_addr_v4 = hf_sflow_agent_address_v4; addr_type.hf_addr_v6 = hf_sflow_agent_address_v6; /* * We fetch the version and address type so that we can determine, * ahead of time, whether this is an sFlow packet or not, before * we do *anything* to the columns or the protocol tree. * * XXX - we might want to deem this "not sFlow" if we don't have at * least 8 bytes worth of data. */ version = tvb_get_ntohl(tvb, offset); if (version != 2 && version != 4 && version != 5) { /* Unknown version; assume it's not an sFlow packet. */ return 0; } sflow_addr_type = tvb_get_ntohl(tvb, offset + 4); switch (sflow_addr_type) { case ADDR_TYPE_UNKNOWN: case ADDR_TYPE_IPV4: case ADDR_TYPE_IPV6: break; default: /* * Address type we don't know about; assume it's not an sFlow * packet. */ return 0; } /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "sFlow"); /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_sflow, tvb, 0, -1, ENC_NA); sflow_245_tree = proto_item_add_subtree(ti, ett_sflow_245); col_add_fstr(pinfo->cinfo, COL_INFO, "V%u", version); proto_tree_add_item(sflow_245_tree, hf_sflow_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sflow_245_tree, hf_sflow_agent_address_type, tvb, offset, 4, ENC_BIG_ENDIAN); offset = dissect_sflow_245_address_type(tvb, pinfo, sflow_245_tree, offset, &addr_type, &addr_details); switch (sflow_addr_type) { case ADDR_TYPE_UNKNOWN: break; case ADDR_TYPE_IPV4: case ADDR_TYPE_IPV6: col_append_fstr(pinfo->cinfo, COL_INFO, ", agent %s", address_to_str(pinfo->pool, &addr_details)); break; } if (version == 5) { sub_agent_id = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, ", sub-agent ID %u", sub_agent_id); proto_tree_add_uint(sflow_245_tree, hf_sflow_5_sub_agent_id, tvb, offset, 4, sub_agent_id); offset += 4; } seqnum = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, ", seq %u", seqnum); proto_tree_add_uint(sflow_245_tree, hf_sflow_245_seqnum, tvb, offset, 4, seqnum); offset += 4; uptime = tvb_get_ntohl(tvb, offset); proto_tree_add_uint_format_value(sflow_245_tree, hf_sflow_245_sysuptime, tvb, offset, 4, uptime, "%s (%ums)", unsigned_time_secs_to_str(pinfo->pool, uptime / 1000), uptime); offset += 4; numsamples = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, ", %u samples", numsamples); proto_tree_add_uint(sflow_245_tree, hf_sflow_245_numsamples, tvb, offset, 4, numsamples); offset += 4; /* Ok, we're now at the end of the sflow_245 datagram header; * everything from here out should be samples. Loop over * the expected number of samples, and pass them to the appropriate * dissectors. */ /* limit number of samples to 255 to avoid huge number of loops * caused by corrupted data */ for (i = 0; i < (numsamples & 0x000000ff); i++) { offset = dissect_sflow_245_samples(tvb, pinfo, sflow_245_tree, offset, version); } return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ void proto_register_sflow(void) { module_t *sflow_245_module; /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_sflow_version, { "Datagram version", "sflow_245.version", FT_UINT32, BASE_DEC, NULL, 0x0, "sFlow datagram version", HFILL}}, { &hf_sflow_agent_address_type, { "Agent address type", "sflow_245.agenttype", FT_UINT32, BASE_DEC, VALS(sflow_agent_address_types), 0x0, "sFlow agent address type", HFILL}}, { &hf_sflow_agent_address_v4, { "Agent address", "sflow_245.agent", FT_IPv4, BASE_NONE, NULL, 0x0, "sFlow Agent IP address", HFILL}}, { &hf_sflow_agent_address_v6, { "Agent address", "sflow_245.agent.v6", FT_IPv6, BASE_NONE, NULL, 0x0, "sFlow Agent IPv6 address", HFILL}}, { &hf_sflow_5_sub_agent_id, { "Sub-agent ID", "sflow_245.sub_agent_id", FT_UINT32, BASE_DEC, NULL, 0x0, "sFlow sub-agent ID", HFILL}}, { &hf_sflow_5_sample_length, { "Sample length (byte)", "sflow_5.sample_length", FT_UINT32, BASE_DEC, NULL, 0x0, "sFlow sample length", HFILL}}, { &hf_sflow_5_flow_data_length, { "Flow data length (byte)", "sflow_5.flow_data_length", FT_UINT32, BASE_DEC, NULL, 0x0, "sFlow flow data length", HFILL}}, #if 0 { &hf_sflow_5_counters_data_length, { "Counters data length (byte)", "sflow_5.counter_data_length", FT_UINT32, BASE_DEC, NULL, 0x0, "sFlow counters data length", HFILL}}, #endif { &hf_sflow_245_seqnum, { "Sequence number", "sflow_245.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, "sFlow datagram sequence number", HFILL}}, { &hf_sflow_245_sysuptime, { "SysUptime", "sflow_245.sysuptime", FT_UINT32, BASE_DEC, NULL, 0x0, "System Uptime", HFILL}}, { &hf_sflow_245_numsamples, { "NumSamples", "sflow_245.numsamples", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of samples in sFlow datagram", HFILL}}, { &hf_sflow_245_sampletype, { "sFlow sample type", "sflow_245.sampletype", FT_UINT32, BASE_DEC, VALS(sflow_245_sampletype), 0x0, "Type of sFlow sample", HFILL}}, { &hf_sflow_245_sampletype12, { "sFlow sample type", "sflow_245.sampletype", FT_UINT32, BASE_DEC, VALS(sflow_245_sampletype), 0x00000FFF, "Type of sFlow sample", HFILL}}, #if 0 { &hf_sflow_5_ieee80211_version, { "Version", "sflow_245.ieee80211_version", FT_UINT32, BASE_DEC, VALS(sflow_5_ieee80211_versions), 0x0, "IEEE 802.11 Version", HFILL}}, #endif { &hf_sflow_245_ipv4_precedence_type, { "Precedence", "sflow_245.ipv4_precedence_type", FT_UINT32, BASE_DEC, VALS(sflow_245_ipv4_precedence_types), 0xE0, "IPv4 Precedence Type", HFILL}}, { &hf_sflow_5_flow_record_format, { "Format", "sflow_245.flow_record_format", FT_UINT32, BASE_DEC | BASE_EXT_STRING, &sflow_5_flow_record_type_ext, 0x0, "Format of sFlow flow record", HFILL}}, { &hf_sflow_5_counters_record_format, { "Format", "sflow_245.counters_record_format", FT_UINT32, BASE_DEC, VALS(sflow_5_counters_record_type), 0x00000FFF, "Format of sFlow counters record", HFILL}}, { &hf_sflow_245_header_protocol, { "Header protocol", "sflow_245.header_protocol", FT_UINT32, BASE_DEC | BASE_EXT_STRING, &sflow_245_header_protocol_ext, 0x0, "Protocol of sampled header", HFILL}}, { &hf_sflow_245_header, { "Header of sampled packet", "sflow_245.header", FT_BYTES, BASE_NONE, NULL, 0x0, "Data from sampled header", HFILL}}, { &hf_sflow_245_packet_information_type, { "Sample type", "sflow_245.packet_information_type", FT_UINT32, BASE_DEC, VALS(sflow_245_packet_information_type), 0x0, "Type of sampled information", HFILL}}, { &hf_sflow_245_extended_information_type, { "Extended information type", "sflow_245.extended_information_type", FT_UINT32, BASE_DEC, VALS(sflow_245_extended_data_types), 0x0, "Type of extended information", HFILL}}, { &hf_sflow_245_vlan_in, { "Incoming 802.1Q VLAN", "sflow_245.vlan.in", FT_UINT32, BASE_DEC, NULL, 0x0, "Incoming VLAN ID", HFILL}}, { &hf_sflow_245_vlan_out, { "Outgoing 802.1Q VLAN", "sflow_245.vlan.out", FT_UINT32, BASE_DEC, NULL, 0x0, "Outgoing VLAN ID", HFILL}}, { &hf_sflow_245_pri_in, { "Incoming 802.1p priority", "sflow_245.pri.in", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_pri_out, { "Outgoing 802.1p priority", "sflow_245.pri.out", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_nexthop_v4, { "Next hop", "sflow_245.nexthop", FT_IPv4, BASE_NONE, NULL, 0x0, "Next hop address", HFILL}}, { &hf_sflow_245_ipv4_src, { "Source IP address", "sflow_245.ipv4_src", FT_IPv4, BASE_NONE, NULL, 0x0, "Source IPv4 address", HFILL}}, { &hf_sflow_245_ipv4_dst, { "Destination IP address", "sflow_245.ipv4_dst", FT_IPv4, BASE_NONE, NULL, 0x0, "Destination IPv4 address", HFILL}}, { &hf_sflow_245_nexthop_v6, { "Next hop", "sflow_245.nexthop.v6", FT_IPv6, BASE_NONE, NULL, 0x0, "Next hop address", HFILL}}, { &hf_sflow_245_ipv6_src, { "Source IP address", "sflow_245.ipv6_src", FT_IPv6, BASE_NONE, NULL, 0x0, "Source IPv6 address", HFILL}}, { &hf_sflow_245_ipv6_dst, { "Destination IP address", "sflow_245.ipv6_dst", FT_IPv6, BASE_NONE, NULL, 0x0, "Destination IPv6 address", HFILL}}, { &hf_sflow_245_nexthop_src_mask, { "Next hop source mask", "sflow_245.nexthop.src_mask", FT_UINT32, BASE_DEC, NULL, 0x0, "Next hop source mask bits", HFILL}}, { &hf_sflow_245_nexthop_dst_mask, { "Next hop destination mask", "sflow_245.nexthop.dst_mask", FT_UINT32, BASE_DEC, NULL, 0x0, "Next hop destination mask bits", HFILL}}, { &hf_sflow_245_ifindex, { "Interface index", "sflow_245.ifindex", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_as, { "AS Router", "sflow_245.as", FT_UINT32, BASE_DEC, NULL, 0x0, "Autonomous System of Router", HFILL}}, { &hf_sflow_245_src_as, { "AS Source", "sflow_245.srcAS", FT_UINT32, BASE_DEC, NULL, 0x0, "Autonomous System of Source", HFILL}}, { &hf_sflow_245_src_peer_as, { "AS Peer", "sflow_245.peerAS", FT_UINT32, BASE_DEC, NULL, 0x0, "Autonomous System of Peer", HFILL}}, { &hf_sflow_245_dst_as_entries, { "AS Destinations", "sflow_245.dstASentries", FT_UINT32, BASE_DEC, NULL, 0x0, "Autonomous System destinations", HFILL}}, { &hf_sflow_245_dst_as, { "AS Destination", "sflow_245.dstAS", FT_UINT32, BASE_DEC, NULL, 0x0, "Autonomous System destination", HFILL}}, /* Needed for sFlow >= 4. If I had a capture to test... */ { &hf_sflow_245_community_entries, { "Gateway Communities", "sflow_245.communityEntries", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, #if 0 { &hf_sflow_245_community, { "Gateway Community", "sflow_245.community", FT_UINT32, BASE_DEC, NULL, 0x0, "Gateway Communities", HFILL}}, #endif { &hf_sflow_245_localpref, { "localpref", "sflow_245.localpref", FT_UINT32, BASE_DEC, NULL, 0x0, "Local preferences of AS route", HFILL}}, /**/ { &hf_sflow_245_iftype, { "Interface Type", "sflow_245.iftype", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifspeed, { "Interface Speed", "sflow_245.ifspeed", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifdirection, { "Interface Direction", "sflow_245.ifdirection", FT_UINT32, BASE_DEC, VALS(sflow_ifdirection_vals), 0x0, NULL, HFILL}}, { &hf_sflow_245_ifadmin_status, { "IfAdminStatus", "sflow_245.ifadmin_status", FT_BOOLEAN, 32, TFS(&tfs_up_down), 0x00000001, NULL, HFILL}}, { &hf_sflow_245_ifoper_status, { "IfOperStatus", "sflow_245.ifoper_status", FT_BOOLEAN, 32, TFS(&tfs_up_down), 0x00000002, NULL, HFILL}}, { &hf_sflow_245_ifinoct, { "Input Octets", "sflow_245.ifinoct", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifinpkt, { "Input Packets", "sflow_245.ifinpkt", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifinmcast, { "Input Multicast Packets", "sflow_245.ifinmcast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifinbcast, { "Input Broadcast Packets", "sflow_245.ifinbcast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifindisc, { "Input Discarded Packets", "sflow_245.ifindisc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifinerr, { "Input Errors", "sflow_245.ifinerr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifinunk, { "Input Unknown Protocol Packets", "sflow_245.ifinunk", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifoutoct, { "Output Octets", "sflow_245.ifoutoct", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifoutpkt, { "Output Packets", "sflow_245.ifoutpkt", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifoutmcast, { "Output Multicast Packets", "sflow_245.ifoutmcast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifoutbcast, { "Output Broadcast Packets", "sflow_245.ifoutbcast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifoutdisc, { "Output Discarded Packets", "sflow_245.ifoutdisc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifouterr, { "Output Errors", "sflow_245.ifouterr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ifpromisc, { "Promiscuous Mode", "sflow_245.ifpromisc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_dot3StatsAlignmentErrors, { "Alignment Errors", "sflow_245.dot3StatsAlignmentErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Alignment Errors", HFILL}}, { &hf_sflow_245_dot3StatsFCSErrors, { "FCS Errors", "sflow_245.dot3StatsFCSErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats FCS Errors", HFILL}}, { &hf_sflow_245_dot3StatsSingleCollisionFrames, { "Single Collision Frames", "sflow_245.dot3StatsSingleCollisionFrames", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Single Collision Frames", HFILL}}, { &hf_sflow_245_dot3StatsMultipleCollisionFrames, { "Multiple Collision Frames", "sflow_245.dot3StatsMultipleCollisionFrames", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Multiple Collision Frames", HFILL}}, { &hf_sflow_245_dot3StatsSQETestErrors, { "SQE Test Errors", "sflow_245.dot3StatsSQETestErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats SQE Test Errors", HFILL}}, { &hf_sflow_245_dot3StatsDeferredTransmissions, { "Deferred Transmissions", "sflow_245.dot3StatsDeferredTransmissions", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Deferred Transmissions", HFILL}}, { &hf_sflow_245_dot3StatsLateCollisions, { "Late Collisions", "sflow_245.dot3StatsLateCollisions", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Late Collisions", HFILL}}, { &hf_sflow_245_dot3StatsExcessiveCollisions, { "Excessive Collisions", "sflow_245.dot3StatsExcessiveCollisions", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Excessive Collisions", HFILL}}, { &hf_sflow_245_dot3StatsInternalMacTransmitErrors, { "Internal Mac Transmit Errors", "sflow_245.dot3StatsInternalMacTransmitErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Internal Mac Transmit Errors", HFILL}}, { &hf_sflow_245_dot3StatsCarrierSenseErrors, { "Carrier Sense Errors", "sflow_245.dot3StatsCarrierSenseErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Carrier Sense Errors", HFILL}}, { &hf_sflow_245_dot3StatsFrameTooLongs, { "Frame Too Longs", "sflow_245.dot3StatsFrameTooLongs", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Frame Too Longs", HFILL}}, { &hf_sflow_245_dot3StatsInternalMacReceiveErrors, { "Internal Mac Receive Errors", "sflow_245.dot3StatsInternalMacReceiveErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Internal Mac Receive Errors", HFILL}}, { &hf_sflow_245_dot3StatsSymbolErrors, { "Symbol Errors", "sflow_245.dot3StatsSymbolErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot3 Stats Symbol Errors", HFILL}}, { &hf_sflow_245_dot5StatsLineErrors, { "Line Errors", "sflow_245.dot5StatsLineErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Line Errors", HFILL}}, { &hf_sflow_245_dot5StatsBurstErrors, { "Burst Errors", "sflow_245.dot5StatsBurstErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Burst Errors", HFILL}}, { &hf_sflow_245_dot5StatsACErrors, { "AC Errors", "sflow_245.dot5StatsACErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats AC Errors", HFILL}}, { &hf_sflow_245_dot5StatsAbortTransErrors, { "Abort Trans Errors", "sflow_245.dot5StatsAbortTransErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Abort Trans Errors", HFILL}}, { &hf_sflow_245_dot5StatsInternalErrors, { "Internal Errors", "sflow_245.dot5StatsInternalErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Internal Errors", HFILL}}, { &hf_sflow_245_dot5StatsLostFrameErrors, { "Lost Frame Errors", "sflow_245.dot5StatsLostFrameErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Lost Frame Errors", HFILL}}, { &hf_sflow_245_dot5StatsReceiveCongestions, { "Receive Congestions", "sflow_245.dot5StatsReceiveCongestions", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Receive Congestions", HFILL}}, { &hf_sflow_245_dot5StatsFrameCopiedErrors, { "Frame Copied Errors", "sflow_245.dot5StatsFrameCopiedErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Frame Copied Errors", HFILL}}, { &hf_sflow_245_dot5StatsTokenErrors, { "Token Errors", "sflow_245.dot5StatsTokenErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Token Errors", HFILL}}, { &hf_sflow_245_dot5StatsSoftErrors, { "Soft Errors", "sflow_245.dot5StatsSoftErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Soft Errors", HFILL}}, { &hf_sflow_245_dot5StatsHardErrors, { "Hard Errors", "sflow_245.dot5StatsHardErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Hard Errors", HFILL}}, { &hf_sflow_245_dot5StatsSignalLoss, { "Signal Loss", "sflow_245.dot5StatsSignalLoss", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Signal Loss", HFILL}}, { &hf_sflow_245_dot5StatsTransmitBeacons, { "Transmit Beacons", "sflow_245.dot5StatsTransmitBeacons", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Transmit Beacons", HFILL}}, { &hf_sflow_245_dot5StatsRecoveries, { "Recoveries", "sflow_245.dot5StatsRecoveries", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Recoveries", HFILL}}, { &hf_sflow_245_dot5StatsLobeWires, { "Lobe Wires", "sflow_245.dot5StatsLobeWires", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Lobe Wires", HFILL}}, { &hf_sflow_245_dot5StatsRemoves, { "Removes", "sflow_245.dot5StatsRemoves", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Removes", HFILL}}, { &hf_sflow_245_dot5StatsSingles, { "Singles", "sflow_245.dot5StatsSingles", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Singles", HFILL}}, { &hf_sflow_245_dot5StatsFreqErrors, { "Freq Errors", "sflow_245.dot5StatsFreqErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot5 Stats Freq Errors", HFILL}}, { &hf_sflow_245_dot12InHighPriorityFrames, { "In High Priority Frames", "sflow_245.dot12InHighPriorityFrames", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Input High Priority Frames", HFILL}}, { &hf_sflow_245_dot12InHighPriorityOctets, { "In High Priority Octets", "sflow_245.dot12InHighPriorityOctets", FT_UINT64, BASE_DEC, NULL, 0x0, "dot12 Input High Priority Octets", HFILL}}, { &hf_sflow_245_dot12InNormPriorityFrames, { "In Normal Priority Frames", "sflow_245.dot12InNormPriorityFrames", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Input Normal Priority Frames", HFILL}}, { &hf_sflow_245_dot12InNormPriorityOctets, { "In Normal Priority Octets", "sflow_245.dot12InNormPriorityOctets", FT_UINT64, BASE_DEC, NULL, 0x0, "dot12 Input Normal Priority Octets", HFILL}}, { &hf_sflow_245_dot12InIPMErrors, { "In IPM Errors", "sflow_245.dot12InIPMErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Input IPM Errors", HFILL}}, { &hf_sflow_245_dot12InOversizeFrameErrors, { "In Oversize Frame Errors", "sflow_245.dot12InOversizeFrameErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Input Oversize Frame Errors", HFILL}}, { &hf_sflow_245_dot12InDataErrors, { "In Data Errors", "sflow_245.dot12InDataErrors", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Input Data Errors", HFILL}}, { &hf_sflow_245_dot12InNullAddressedFrames, { "In Null Addressed Frames", "sflow_245.dot12InNullAddressedFrames", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Input Null Addressed Frames", HFILL}}, { &hf_sflow_245_dot12OutHighPriorityFrames, { "Out High Priority Frames", "sflow_245.dot12OutHighPriorityFrames", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Output High Priority Frames", HFILL}}, { &hf_sflow_245_dot12OutHighPriorityOctets, { "Out High Priority Octets", "sflow_245.dot12OutHighPriorityOctets", FT_UINT64, BASE_DEC, NULL, 0x0, "dot12 Out High Priority Octets", HFILL}}, { &hf_sflow_245_dot12TransitionIntoTrainings, { "Transition Into Trainings", "sflow_245.dot12TransitionIntoTrainings", FT_UINT32, BASE_DEC, NULL, 0x0, "dot12 Transition Into Trainings", HFILL}}, { &hf_sflow_245_dot12HCInHighPriorityOctets, { "HC In High Priority Octets", "sflow_245.dot12HCInHighPriorityOctets", FT_UINT64, BASE_DEC, NULL, 0x0, "dot12 HC Input High Priority Octets", HFILL}}, { &hf_sflow_245_dot12HCInNormPriorityOctets, { "HC In Normal Priority Octets", "sflow_245.dot12HCInNormPriorityOctets", FT_UINT64, BASE_DEC, NULL, 0x0, "dot12 HC Input Normal Priority Octets", HFILL}}, { &hf_sflow_245_dot12HCOutHighPriorityOctets, { "HC Out High Priority Octets", "sflow_245.dot12HCOutHighPriorityOctets", FT_UINT64, BASE_DEC, NULL, 0x0, "dot12 HC Output High Priority Octets", HFILL}}, { &hf_sflow_245_vlan_id, { "VLAN ID", "sflow_245.vlan_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_octets, { "Octets", "sflow_245.octets", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_ucastPkts, { "Unicast Packets", "sflow_245.ucastPkts", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_multicastPkts, { "Multicast Packets", "sflow_245.multicastPkts", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_broadcastPkts, { "Broadcast Packets", "sflow_245.broadcastPkts", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_245_discards, { "Discards", "sflow_245.discards", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11TransmittedFragmentCount, { "Transmitted Fragment Count", "sflow_5.dot11TransmittedFragmentCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11MulticastTransmittedFrameCount, { "Multicast Transmitted Frame Count", "sflow_5.dot11MulticastTransmittedFrameCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11FailedCount, { "Failed Count", "sflow_5.dot11FailedCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11RetryCount, { "Retry Count", "sflow_5.dot11RetryCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11MultipleRetryCount, { "Multiple Retry Count", "sflow_5.dot11MultipleRetryCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11FrameDuplicateCount, { "Frame Duplicate Count", "sflow_5.dot11FrameDuplicateCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11RTSSuccessCount, { "RTS Success Count", "sflow_5.dot11RTSSuccessCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11RTSFailureCount, { "Failure Count", "sflow_5.dot11RTSFailureCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11ACKFailureCount, { "ACK Failure Count", "sflow_5.dot11ACKFailureCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11ReceivedFragmentCount, { "Received Fragment Count", "sflow_5.dot11ReceivedFragmentCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11MulticastReceivedFrameCount, { "Multicast Received Frame Count", "sflow_5.dot11MulticastReceivedFrameCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11FCSErrorCount, { "FCS Error Count", "sflow_5.dot11FCSErrorCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11TransmittedFrameCount, { "Transmitted Frame Count", "sflow_5.dot11TransmittedFrameCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11WEPUndecryptableCount, { "WEP Undecryptable Count", "sflow_5.dot11WEPUndecryptableCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11QoSDiscardedFragmentCount, { "QoS Discarded Fragment Count", "sflow_5.dot11QoSDiscardedFragmentCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11AssociatedStationCount, { "Associated Station Count", "sflow_5.dot11AssociatedStationCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11QoSCFPollsReceivedCount, { "QoS CF Polls Received Count", "sflow_5.dot11QoSCFPollsReceivedCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11QoSCFPollsUnusedCount, { "QoS CF Polls Unused Count", "sflow_5.dot11QoSCFPollsUnusedCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11QoSCFPollsUnusableCount, { "QoS CF Polls Unusable Count", "sflow_5.dot11QoSCFPollsUnusableCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_dot11QoSCFPollsLostCount, { "QoS CF Polls Lost Count", "sflow_5.dot11QoSCFPollsLostCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_cpu_5s, { "5s CPU Load (100 = 1%)", "sflow_5.cpu_5s", FT_UINT32, BASE_DEC, NULL, 0x0, "Average CPU Load Over 5 Seconds (100 = 1%)", HFILL}}, { &hf_sflow_5_cpu_1m, { "1m CPU Load (100 = 1%)", "sflow_5.cpu_1m", FT_UINT32, BASE_DEC, NULL, 0x0, "Average CPU Load Over 1 Minute (100 = 1%)", HFILL}}, { &hf_sflow_5_cpu_5m, { "5m CPU Load (100 = 1%)", "sflow_5.cpu_5m", FT_UINT32, BASE_DEC, NULL, 0x0, "Average CPU Load Over 5 Minutes (100 = 1%)", HFILL}}, { &hf_sflow_5_total_memory, { "Total Memory", "sflow_5.total_memory", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_free_memory, { "Free Memory", "sflow_5.free_memory", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_sflow_5_elapsed_time, { "Elapsed Time (ms)", "sflow_5.elapsed_time", FT_UINT32, BASE_DEC, NULL, 0x0, "Elapsed Time in ms", HFILL}}, { &hf_sflow_5_on_channel_time, { "On Channel (ms)", "sflow_5.on_channel_time", FT_UINT32, BASE_DEC, NULL, 0x0, "Time in ms Spent on Channel", HFILL}}, { &hf_sflow_5_on_channel_busy_time, { "On Channel Busy (ms)", "sflow_5.channel_busy_time", FT_UINT32, BASE_DEC, NULL, 0x0, "Time in ms Spent on Channel and Busy", HFILL}}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_sflow_245_header_frame_length, { "Frame Length", "sflow_245.header.frame_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_header_payload_stripped, { "Payload stripped", "sflow_245.header.payload_stripped", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_sampled_header_length, { "Sampled header length", "sflow_245.header.sampled_header_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_extended_mpls_in_label_stack_entries, { "In Label Stack Entries", "sflow_245.extended_mpls.in_label_stack_entries", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_extended_mpls_in_label, { "Label", "sflow_245.extended_mpls.in_label", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_extended_mpls_out_label_stack_entries, { "Out Label Stack Entries", "sflow_245.extended_mpls.out_label_stack_entries", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_extended_mpls_out_label, { "Label", "sflow_245.extended_mpls.out_label", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ethernet_length_of_mac_packet, { "Length of MAC Packet", "sflow_245.ethernet.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ethernet_source_mac_address, { "Source MAC Address", "sflow_245.ethernet.source_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ethernet_destination_mac_address, { "Destination MAC Address", "sflow_245.ethernet.destination_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ethernet_packet_type, { "Ethernet Packet Type", "sflow_245.ethernet.packet_type", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_length_of_ip_packet, { "Length of IP Packet", "sflow_245.ip.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ip_source_port, { "Source Port", "sflow_245.ip.source_port", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ip_destination_port, { "Destination Port", "sflow.ip.destination_port", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_cwr, { "TCP Flag (CWR)", "sflow_245.ip.tcp_flag.cwr", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_ece, { "TCP Flag (ECE)", "sflow_245.ip.tcp_flag.ece", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_urg, { "TCP Flag (URG)", "sflow_245.ip.tcp_flag.urg", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_ack, { "TCP Flag (ACK)", "sflow_245.ip.tcp_flag.ack", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_psh, { "TCP Flag (PSH)", "sflow_245.ip.tcp_flag.psh", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_rst, { "TCP Flag (RST)", "sflow_245.ip.tcp_flag.rst", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_syn, { "TCP Flag (SYN)", "sflow_245.ip.tcp_flag.syn", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL } }, { &hf_sflow_245_ip_tcp_flag_fin, { "TCP Flag (FIN)", "sflow_245.ip.tcp_flag.fin", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL } }, { &hf_sflow_245_ipv4_delay, { "Delay", "sflow_245.ipv4_delay", FT_BOOLEAN, 32, TFS(&tfs_low_normal), 0x00000010, NULL, HFILL } }, { &hf_sflow_245_ipv4_throughput, { "Throughput", "sflow_245.ipv4_throughput", FT_BOOLEAN, 32, TFS(&tfs_high_normal), 0x00000008, NULL, HFILL } }, { &hf_sflow_245_ipv4_reliability, { "Reliability", "sflow_245.ipv4_reliability", FT_BOOLEAN, 32, TFS(&tfs_high_normal), 0x00000004, NULL, HFILL } }, { &hf_sflow_245_ipv4_cost, { "Cost (RFC1349)", "sflow_245.ipv4_cost", FT_BOOLEAN, 32, TFS(&tfs_minimize_monetary_normal), 0x00000002, NULL, HFILL } }, { &hf_sflow_245_ipv6_priority, { "Priority", "sflow_245.ipv6_priority", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_user_source_character_set, { "Source Character Set", "sflow_5.extended_user.source_character_set", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_user_source_user_string_length, { "Source User String Length (bytes)", "sflow_5.extended_user.source_user_string_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_user_destination_character_set, { "Destination Character Set", "sflow_5.extended_user.destination_character_set", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_user_destination_user_string_length, { "Destination User String Length (bytes)", "sflow_5.extended_user.destination_user_string_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_url_url_length, { "URL Length (bytes)", "sflow_5.extended_url.url_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_url_host_length, { "Host Length (bytes)", "sflow_5.extended_url.host_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_tunnel_name_length, { "Tunnel Name Length (bytes)", "sflow_5.extended_mpls_tunnel.name_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_tunnel_id, { "Tunnel ID", "sflow_5.extended_mpls_tunnel.id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_tunnel_cos_value, { "Tunnel COS Value", "sflow_5.extended_mpls_tunnel.cos_value", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_vc_instance_name_length, { "VC Instance Name Length (bytes)", "sflow_5.extended_mpls_vc.instance_name_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_vc_id, { "VLL/VC ID", "sflow_5.extended_mpls_vc.id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_vc_label_cos_value, { "VC Label COS Value", "sflow_5.extended_mpls_vc.label_cos_value", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_ftn_description_length, { "MPLS FTN Description Length (bytes)", "sflow_5.extended_mpls.ftn_description_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_ftn_mask, { "MPLS FTN Mask", "sflow_5.extended_mpls.ftn_mask", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_fec_address_prefix_length, { "MPLS FEC Address Prefix Length (bytes)", "sflow_5.extended_mpls.fec_address_prefix_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_vlan_tunnel_number_of_layers, { "Number of Layers", "sflow_5.extended_vlan_tunnel.number_of_layers", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair, { "TPID/TCI Pair as Integer", "sflow_5.extended_vlan_tunnel.tpid_tci_pair", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_oui, { "OUI", "sflow_5.extended_80211.oui", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_suite_type, { "Suite Type", "sflow_5.extended_80211.suite_type", FT_UINT8, BASE_DEC, VALS(extended_80211_suite_type_vals), 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_payload_length, { "Payload Length", "sflow_5.extended_80211.payload_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_bssid, { "BSSID", "sflow_5.extended_80211.rx.bssid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_version, { "Version", "sflow_5.extended_80211.rx.version", FT_UINT32, BASE_DEC, VALS(sflow_5_ieee80211_versions), 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_channel, { "Channel", "sflow_5.extended_80211.rx.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_speed, { "Speed", "sflow_5.extended_80211.rx.speed", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_rsni, { "RSNI", "sflow_5.extended_80211.rx.rsni", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_rcpi, { "RCPI", "sflow_5.extended_80211.rx.rcpi", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_packet_duration, { "Packet Duration (ms)", "sflow_5.extended_80211.rx.packet_duration", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_bssid, { "BSSID", "sflow_5.extended_80211.tx.bssid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_version, { "Version", "sflow_5.extended_80211.tx.version", FT_UINT32, BASE_DEC, VALS(sflow_5_ieee80211_versions), 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_retransmissions, { "Retransmissions", "sflow_5.extended_80211.tx.retransmissions", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_packet_duration, { "Packet Duration (ms)", "sflow_5.extended_80211.tx.packet_duration", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_retransmission_duration, { "Retransmission Duration (ms)", "sflow_5.extended_80211.tx.retransmission_duration", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_channel, { "Channel", "sflow_5.extended_80211.tx.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_speed, { "Speed", "sflow_5.extended_80211.tx.speed", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_power, { "Power", "sflow_5.extended_80211.tx.power", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_sequence_number, { "Sequence number", "sflow.flow_sample.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_source_id_class, { "Source ID class", "sflow.flow_sample.source_id_class", FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL } }, { &hf_sflow_flow_sample_sampling_rate, { "Sampling rate", "sflow.flow_sample.sampling_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_sample_pool, { "Sample pool", "sflow.flow_sample.sample_pool", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_total_packets, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_dropped_packets, { "Dropped packets", "sflow.flow_sample.dropped_packets", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_input_interface, { "Input interface (ifIndex)", "sflow.flow_sample.input_interface", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_24_flow_sample_multiple_outputs, { "Multiple outputs", "sflow.flow_sample.multiple_outputs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_24_flow_sample_output_interface_format, { "Output interface format", "sflow.flow_sample.output_interface.format", FT_UINT32, BASE_DEC, NULL, 0x7fffffff, NULL, HFILL } }, { &hf_sflow_24_flow_sample_output_interface, { "Output interface (ifIndex)", "sflow.flow_sample.output_interface", FT_UINT32, BASE_DEC, NULL, 0x7fffffff, NULL, HFILL } }, { &hf_sflow_5_flow_sample_output_interface, { "Output interface", "sflow.flow_sample.output_interface", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_flow_sample_output_interface_form, { "Output interface format", "sflow.flow_sample.output_interface_format", FT_UINT32, BASE_DEC, VALS(interface_format), SFLOW_5_INT_FORMAT, NULL, HFILL } }, { &hf_sflow_5_flow_sample_output_interface_val, { "Output interface value", "sflow.flow_sample.output_interface_value", FT_UINT32, BASE_DEC, NULL, SFLOW_5_INT_VALUE, NULL, HFILL } }, { &hf_sflow_5_flow_sample_output_interface_val_discard, { "Output interface value", "sflow.flow_sample.output_interface_value", FT_UINT32, BASE_DEC, VALS(interface_discard), SFLOW_5_INT_VALUE, NULL, HFILL } }, { &hf_sflow_enterprise, { "Enterprise", "sflow.enterprise", FT_UINT32, BASE_DEC, NULL, 0xFFFFF000, NULL, HFILL } }, { &hf_sflow_enterprise_length, { "Length", "sflow.enterprise.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_enterprise_data, { "Data", "sflow.enterprise.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_flow_record, { "Flow record", "sflow.flow_sample.flow_record", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_source_id_type, { "Source ID type", "sflow.flow_sample.source_id_type", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_source_id_index, { "Source ID index", "sflow.flow_sample.source_id_index", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_input_interface_format, { "Input interface format", "sflow.flow_sample.input_interface_format", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_input_interface_value, { "Input interface value", "sflow.flow_sample.input_interface_value", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_24_flow_sample_output_interface_value, { "Output interface value", "sflow.flow_sample.output_interface_value", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_counters_sample_sequence_number, { "Sequence number", "sflow.counters_sample.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_counters_sample_source_id_class, { "Source ID class", "sflow.counters_sample.source_id_class", FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL } }, { &hf_sflow_counters_sample_sampling_interval, { "Sampling Interval", "sflow.counters_sample.sampling_interval", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_counters_sample_counters_type, { "Counters type", "sflow.counters_sample.counters_type", FT_UINT32, BASE_DEC, VALS(sflow_245_counterstype), 0x0, NULL, HFILL } }, { &hf_sflow_counters_sample_source_id_type, { "Source ID type", "sflow.counters_sample.source_id_type", FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL } }, { &hf_sflow_counters_sample_source_id_index, { "Source ID index", "sflow.counters_sample.source_id_index", FT_UINT32, BASE_DEC, NULL, 0x00FFFFFF, NULL, HFILL } }, { &hf_sflow_counters_sample_counters_records, { "Counters records", "sflow.counters_sample.counters_records", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_counters_sample_expanded_source_id_type, { "Source ID type", "sflow.counters_sample.source_id_type", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_counters_sample_expanded_source_id_index, { "Source ID index", "sflow.counters_sample.source_id_index", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_padding, { "Padding", "sflow.lag_port.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_actorsystemid, { "Actor System ID", "sflow.lag_port.actor_system_id", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_partneropersystemid, { "Partner Oper System ID", "sflow.lag_port.partner_oper_system_id", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_attachedaggid, { "Port Attached Agg ID", "sflow.lag_port.attached_agg_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_state, { "State", "sflow.lag_port.state", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_actoradminstate, { "Actor Admin State", "sflow.lag_port.actor_admin_state", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL } }, { &hf_sflow_lag_port_actoroperstate, { "Actor Oper State", "sflow.lag_port.actor_oper_state", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL } }, { &hf_sflow_lag_port_partneradminstate, { "Partner Admin State", "sflow.lag_port.partner_admin_state", FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL } }, { &hf_sflow_lag_port_partneroperstate, { "Partner Oper State", "sflow.lag_port.partner_oper_state", FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL } }, { &hf_sflow_lag_port_reserved, { "Reserved", "sflow.lag_port.reserved", FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0, NULL, HFILL } }, { &hf_sflow_5_lag_port_actoradminstate, { "Actor Admin State", "sflow.lag_port.actor_admin_state", FT_BOOLEAN, 32, NULL, 0x000000FF, NULL, HFILL } }, { &hf_sflow_5_lag_port_actoroperstate, { "Actor Oper State", "sflow.lag_port.actor_oper_state", FT_BOOLEAN, 32, NULL, 0x0000FF00, NULL, HFILL } }, { &hf_sflow_5_lag_port_partneradminstate, { "Partner Admin State", "sflow.lag_port.partner_admin_state", FT_BOOLEAN, 32, NULL, 0x00FF0000, NULL, HFILL } }, { &hf_sflow_5_lag_port_partneroperstate, { "Partner Oper State", "sflow.lag_port.partner_oper_state", FT_BOOLEAN, 32, NULL, 0xFF000000, NULL, HFILL } }, { &hf_sflow_lag_port_stats_lacpdusrx, { "LACPDUs Rx", "sflow.lag_port.lacpdus.rx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_markerpdusrx, { "Marker PDUs Rx", "sflow.lag_port.marker_pdus.rx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_markerresponsepdusrx, { "Marker Response PDUs Rx", "sflow.lag_port.marker_response_pdus.rx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_unknownrx, { "Unknown Rx", "sflow.lag_port.unknown.rx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_illegalrx, { "Illegal Rx", "sflow.lag_port.illegal.rx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_lacpdustx, { "LACPDUs Tx", "sflow.lag_port.lacpdus.tx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_markerpdustx, { "Marker PDUs Tx", "sflow.lag_port.marker_pdus.tx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_lag_port_stats_markerresponsepdustx, { "Marker Response PDUs Tx", "sflow.lag_port.marker_response_pdus.tx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_245_as_type, { "AS Type", "sflow.as_type", FT_UINT32, BASE_DEC, VALS(sflow_245_as_types), 0x0, NULL, HFILL } }, { &hf_sflow_245_ip_protocol, { "IP Protocol", "sflow.ip_protocol", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &ipproto_val_ext, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_user_source_user, { "Source User", "sflow_5.extended_user.source_user", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_user_destination_user, { "Destination User", "sflow_5.extended_user.destination_user", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_url_direction, { "Direction", "sflow_5.extended_url.direction", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_url_url, { "URL", "sflow_5.extended_url.url", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_url_host, { "Host", "sflow_5.extended_url.host", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_tunnel_name, { "Tunnel Name", "sflow_5.extended_mpls_tunnel.tunnel_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_vc_instance_name, { "VC Instance Name", "sflow_5.extended_mpls_vc.vc_instance_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_mpls_ftn_description, { "MPLS FTN Description", "sflow_5.extended_mpls.ftn_description", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_payload, { "Payload", "sflow_5.extended_80211.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_rx_ssid, { "SSID", "sflow_5.extended_80211.rx.ssid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_5_extended_80211_tx_ssid, { "SSID", "sflow_5.extended_80211.tx.ssid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sflow_flow_sample_index, { "Index", "sflow.flow_sample.index", FT_UINT32, BASE_DEC, NULL, 0x00FFFFFF, NULL, HFILL } }, { &hf_sflow_counters_sample_index, { "Index", "sflow.counters_sample.index", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint * ett[] = { &ett_sflow_245, &ett_sflow_245_sample, &ett_sflow_5_flow_record, &ett_sflow_5_counters_record, &ett_sflow_5_mpls_in_label_stack, &ett_sflow_5_mpls_out_label_stack, &ett_sflow_245_extended_data, &ett_sflow_245_gw_as_dst, &ett_sflow_245_gw_as_dst_seg, &ett_sflow_245_gw_community, &ett_sflow_245_sampled_header, &ett_sflow_lag_port_state_flags, &ett_sflow_5_output_interface, }; static ei_register_info ei[] = { { &ei_sflow_invalid_address_type, { "sflow.invalid_address_type", PI_MALFORMED, PI_ERROR, "Unknown/invalid address type", EXPFILL }}, }; expert_module_t* expert_sflow; /* Register the protocol name and description */ proto_sflow = proto_register_protocol("InMon sFlow", "sFlow", "sflow"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sflow, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sflow = expert_register_protocol(proto_sflow); expert_register_field_array(expert_sflow, ei, array_length(ei)); header_subdissector_table = register_dissector_table("sflow_245.header_protocol", "SFLOW header protocol", proto_sflow, FT_UINT32, BASE_DEC); /* Register our configuration options for sFlow */ sflow_245_module = prefs_register_protocol(proto_sflow, NULL); /* If I use a filter like "ip.src == 10.1.1.1" this will, in addition to the usual suspects, find every sFlow packet where *any* of the payload headers contain 10.1.1.1 as a src addr. I think this may not be the desired behavior. It can certainly be confusing since the ip.src being found is buried about 3 subtrees deep and the subtrees might be under any one of the sampled (payload) header trees. It is certainly not quickly obvious why the filter matched. */ prefs_register_bool_preference(sflow_245_module, "enable_dissection", "Dissect data in sampled headers", "Enabling dissection makes it easy to view protocol details in each of the sampled headers." " Disabling dissection may reduce noise caused when display filters match the contents of" " any sampled header(s).", &global_dissect_samp_headers); /* It is not clear to me that it *ever* makes sense to enable this option. However, it was previously the default behavior so I'll leave it as an option if someone thinks they have a use for it. */ prefs_register_bool_preference(sflow_245_module, "enable_analysis", "Analyze data in sampled IP headers", "This option only makes sense if dissection of sampled headers is enabled and probably not even then.", &global_analyze_samp_ip_headers); } void proto_reg_handoff_sflow_245(void) { sflow_handle = create_dissector_handle(dissect_sflow_245, proto_sflow); dissector_add_uint_range_with_preference("udp.port", SFLOW_UDP_PORTS, sflow_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-sflow.h
/* packet-sflow.h * sFlow v5 dissection implemented according to the specifications * at http://www.sflow.org/sflow_version_5.txt * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_SFLOW_H__ #define __PACKET_SFLOW_H__ #define SFLOW_245_HEADER_ETHERNET 1 #define SFLOW_245_HEADER_TOKENBUS 2 #define SFLOW_245_HEADER_TOKENRING 3 #define SFLOW_245_HEADER_FDDI 4 #define SFLOW_245_HEADER_FRAME_RELAY 5 #define SFLOW_245_HEADER_X25 6 #define SFLOW_245_HEADER_PPP 7 /* We don't have an SMDS dissector yet * * Switched multimegabit data service (SMDS) was a connectionless service * used to connect LANs, MANs and WANs to exchange data. SMDS was based on * the IEEE 802.6 DQDB standard. SMDS fragmented its datagrams into smaller * "cells" for transport, and can be viewed as a technological precursor of ATM. */ #define SFLOW_245_HEADER_SMDS 8 /* * No AAL5 (ATM Adaptation Layer 5) dissector available. * What does the packet look like? An AAL5 PDU? Where * do the VPI/VCI pair appear, if anywhere? */ #define SFLOW_245_HEADER_AAL5 9 #define SFLOW_245_HEADER_AAL5_IP 10 #define SFLOW_245_HEADER_IPv4 11 #define SFLOW_245_HEADER_IPv6 12 #define SFLOW_245_HEADER_MPLS 13 /* wireshark does not have POS dissector yet */ #define SFLOW_5_HEADER_POS 14 #define SFLOW_5_HEADER_80211_MAC 15 /* XXX - No handles for these, need to be converted into "dissectors" */ #define SFLOW_5_HEADER_80211_AMPDU 16 /* "wlan_aggregate" */ #define SFLOW_5_HEADER_80211_AMSDU_SUBFRAME 17 #endif
C
wireshark/epan/dissectors/packet-sftp.c
/* packet-sftp.c * Routines for ssh packet dissection * * Jérôme Hamm * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * Copied from packet-ssh.c * * SPDX-License-Identifier: GPL-2.0-or-later * * * Note: support for SFTP. * */ /* SFTP is defined in: * * draft-ietf-secsh-filexfer-02 - SSH File Transfer Protocol * */ #include "config.h" /* Start with WIRESHARK_LOG_DOMAINS=sftp and WIRESHARK_LOG_LEVEL=debug to see messages. */ #define WS_LOG_DOMAIN "sftp" #include <epan/packet.h> #include <epan/expert.h> void proto_register_sftp(void); static int proto_sftp = -1; static int hf_ssh_sftp_len = -1; static int hf_ssh_sftp_type = -1; static int hf_ssh_sftp_version = -1; static int hf_ssh_sftp_id = -1; static int hf_ssh_sftp_path_len = -1; static int hf_ssh_sftp_path = -1; static int hf_ssh_sftp_pflags = -1; static int hf_ssh_sftp_name_count = -1; static int hf_ssh_sftp_name_fn_len = -1; static int hf_ssh_sftp_name_fn = -1; static int hf_ssh_sftp_name_ln_len = -1; static int hf_ssh_sftp_name_ln = -1; static int hf_ssh_sftp_attrs_flags = -1; static int hf_ssh_sftp_attrs_size = -1; static int hf_ssh_sftp_attrs_uid = -1; static int hf_ssh_sftp_attrs_gid = -1; static int hf_ssh_sftp_attrs_permissions = -1; static int hf_ssh_sftp_attrs_atime = -1; static int hf_ssh_sftp_attrs_mtime = -1; static int hf_ssh_sftp_attrs_extended_count = -1; static int hf_ssh_sftp_handle_len = -1; static int hf_ssh_sftp_handle = -1; static int hf_ssh_sftp_status = -1; static int hf_ssh_sftp_error_message_len = -1; static int hf_ssh_sftp_error_message = -1; static int hf_ssh_sftp_offset = -1; static int hf_ssh_sftp_length = -1; static int hf_ssh_sftp_data_len = -1; static int hf_ssh_sftp_data = -1; static int hf_ssh_lang_tag_length = -1; static int hf_ssh_lang_tag = -1; static gint ett_sftp = -1; static gint ett_sftp_attrs = -1; static dissector_handle_t sftp_handle; #define SSH_FXP_INIT 1 #define SSH_FXP_VERSION 2 #define SSH_FXP_OPEN 3 #define SSH_FXP_CLOSE 4 #define SSH_FXP_READ 5 #define SSH_FXP_WRITE 6 #define SSH_FXP_LSTAT 7 #define SSH_FXP_FSTAT 8 #define SSH_FXP_SETSTAT 9 #define SSH_FXP_FSETSTAT 10 #define SSH_FXP_OPENDIR 11 #define SSH_FXP_READDIR 12 #define SSH_FXP_REMOVE 13 #define SSH_FXP_MKDIR 14 #define SSH_FXP_RMDIR 15 #define SSH_FXP_REALPATH 16 #define SSH_FXP_STAT 17 #define SSH_FXP_RENAME 18 #define SSH_FXP_READLINK 19 #define SSH_FXP_LINK 21 #define SSH_FXP_BLOCK 22 #define SSH_FXP_UNBLOCK 23 #define SSH_FXP_STATUS 101 #define SSH_FXP_HANDLE 102 #define SSH_FXP_DATA 103 #define SSH_FXP_NAME 104 #define SSH_FXP_ATTRS 105 #define SSH_FXP_EXTENDED 200 #define SSH_FXP_EXTENDED_REPLY 201 #define SSH_FILEXFER_ATTR_SIZE 0x00000001 #define SSH_FILEXFER_ATTR_UIDGID 0x00000002 #define SSH_FILEXFER_ATTR_PERMISSIONS 0x00000004 #define SSH_FILEXFER_ATTR_ACMODTIME 0x00000008 #define SSH_FILEXFER_ATTR_EXTENDED 0x80000000 static const value_string ssh2_sftp_vals[] = { {SSH_FXP_INIT, "SSH_FXP_INIT"}, {SSH_FXP_VERSION, "SSH_FXP_VERSION"}, {SSH_FXP_OPEN, "SSH_FXP_OPEN"}, {SSH_FXP_CLOSE, "SSH_FXP_CLOSE"}, {SSH_FXP_READ, "SSH_FXP_READ"}, {SSH_FXP_WRITE, "SSH_FXP_WRITE"}, {SSH_FXP_LSTAT, "SSH_FXP_LSTAT"}, {SSH_FXP_FSTAT, "SSH_FXP_FSTAT"}, {SSH_FXP_SETSTAT, "SSH_FXP_SETSTAT"}, {SSH_FXP_FSETSTAT, "SSH_FXP_FSETSTAT"}, {SSH_FXP_OPENDIR, "SSH_FXP_OPENDIR"}, {SSH_FXP_READDIR, "SSH_FXP_READDIR"}, {SSH_FXP_REMOVE, "SSH_FXP_REMOVE"}, {SSH_FXP_MKDIR, "SSH_FXP_MKDIR"}, {SSH_FXP_RMDIR, "SSH_FXP_RMDIR"}, {SSH_FXP_REALPATH, "SSH_FXP_REALPATH"}, {SSH_FXP_STAT, "SSH_FXP_STAT"}, {SSH_FXP_RENAME, "SSH_FXP_RENAME"}, {SSH_FXP_READLINK, "SSH_FXP_READLINK"}, {SSH_FXP_LINK, "SSH_FXP_LINK"}, {SSH_FXP_BLOCK, "SSH_FXP_BLOCK"}, {SSH_FXP_UNBLOCK, "SSH_FXP_UNBLOCK"}, {SSH_FXP_STATUS, "SSH_FXP_STATUS"}, {SSH_FXP_HANDLE, "SSH_FXP_HANDLE"}, {SSH_FXP_DATA, "SSH_FXP_DATA"}, {SSH_FXP_NAME, "SSH_FXP_NAME"}, {SSH_FXP_ATTRS, "SSH_FXP_ATTRS"}, {SSH_FXP_EXTENDED, "SSH_FXP_EXTENDED"}, {SSH_FXP_EXTENDED_REPLY, "SSH_FXP_EXTENDED_REPLY"}, {0, NULL} }; static int dissect_sftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_); static int dissect_sftp_attrs(tvbuff_t *packet_tvb, packet_info *pinfo, int offset, proto_item *msg_type_tree); //static int dissect_sftp(tvbuff_t *packet_tvb, packet_info *pinfo, // int offset, proto_item *msg_type_tree) static int dissect_sftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint plen; guint slen; plen = tvb_get_ntohl(tvb, offset) ; wmem_strbuf_t *title = wmem_strbuf_new(wmem_packet_scope(), "SFTP"); proto_item * sftp_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sftp, NULL, NULL); proto_tree_add_item(sftp_tree, hf_ssh_sftp_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 typ; typ = tvb_get_guint8(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, val_to_str(typ, ssh2_sftp_vals, "Unknown (%u)")); switch(typ){ case SSH_FXP_INIT:{ int ver = tvb_get_ntohl(tvb, offset) ; wmem_strbuf_append_printf(title, " SSH_FXP_INIT (%d) version %d", typ, ver); proto_tree_add_item(sftp_tree, hf_ssh_sftp_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; } case SSH_FXP_VERSION:{ int ver = tvb_get_ntohl(tvb, offset) ; wmem_strbuf_append_printf(title, " SSH_FXP_VERSION (%d) version %d", typ, ver); proto_tree_add_item(sftp_tree, hf_ssh_sftp_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; } case SSH_FXP_OPEN:{ int id = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; // int pflags = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_pflags, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = dissect_sftp_attrs(tvb, pinfo, offset, sftp_tree); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_OPEN (%d) id=%d [%s]", typ, id, path); break; } case SSH_FXP_CLOSE:{ int id = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; gchar * handle = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, slen); proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle, tvb, offset, slen, ENC_NA); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_CLOSE (%d) id=%d {%s}", typ, id, handle); break; } case SSH_FXP_READ:{ int id = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; gchar * handle = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, slen); proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle, tvb, offset, slen, ENC_NA); offset += slen; proto_tree_add_item(sftp_tree, hf_ssh_sftp_offset, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(sftp_tree, hf_ssh_sftp_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; wmem_strbuf_append_printf(title, " SSH_FXP_READ (%d) id=%d {%s}", typ, id, handle); break; } case SSH_FXP_WRITE:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; gchar * handle = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, slen); proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle, tvb, offset, slen, ENC_NA); offset += slen; proto_tree_add_item(sftp_tree, hf_ssh_sftp_offset, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; int dlen = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_data_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sftp_tree, hf_ssh_sftp_data, tvb, offset, dlen, ENC_NA); offset += dlen; wmem_strbuf_append_printf(title, " SSH_FXP_WRITE (%d) id=%d {%s} len=%d", typ, id, handle, dlen); break; } case SSH_FXP_LSTAT:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); wmem_strbuf_append_printf(title, " SSH_FXP_LSTAT (%d) id=%d [%s]", typ, id, path); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; break; } case SSH_FXP_FSTAT:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; gchar * handle = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, slen); proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle, tvb, offset, slen, ENC_NA); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_FSTAT (%d) id=%d {%s}", typ, id, handle); break; } case SSH_FXP_SETSTAT:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; slen = dissect_sftp_attrs(tvb, pinfo, offset, sftp_tree); proto_item_set_len(sftp_tree, slen); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_SETSTAT (%d) id=%d [%s]", typ, id, path); break; } // case SSH_FXP_FSETSTAT):{ // break; // } case SSH_FXP_OPENDIR:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_OPENDIR (%d) id=%d [%s]", typ, id, path); break; } case SSH_FXP_READDIR:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; gchar * handle = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, slen); proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle, tvb, offset, slen, ENC_NA); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_READDIR (%d) id=%d {%s}", typ, id, handle); break; } case SSH_FXP_REMOVE:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); wmem_strbuf_append_printf(title, " SSH_FXP_REMOVE (%d) id=%d [%s]", typ, id, path); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; break; } // case SSH_FXP_MKDIR:{ // break; // } // case SSH_FXP_RMDIR:{ // break; // } case SSH_FXP_REALPATH:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); wmem_strbuf_append_printf(title, " SSH_FXP_REALPATH (%d) id=%d [%s]", typ, id, path); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; break; } case SSH_FXP_STAT:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * path = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); wmem_strbuf_append_printf(title, " SSH_FXP_STAT (%d) id=%d [%s]", typ, id, path); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; break; } case SSH_FXP_RENAME:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * oldpath = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_path_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * newpath = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); proto_tree_add_item(sftp_tree, hf_ssh_sftp_path, tvb, offset, slen, ENC_UTF_8); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_STAT (%d) id=%d [%s] > [%s]", typ, id, oldpath, newpath); break; } // case SSH_FXP_READLINK:{ // break; // } // case SSH_FXP_SYMLINK:{ // break; // } case SSH_FXP_STATUS:{ int id = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; int code = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_status, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_error_message_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint8 * err_msg = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, slen, ENC_UTF_8); proto_tree_add_item(sftp_tree, hf_ssh_sftp_error_message, tvb, offset, slen, ENC_UTF_8); offset += slen; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_lang_tag_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sftp_tree, hf_ssh_lang_tag, tvb, offset, slen, ENC_UTF_8); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_STATUS (%d) id=%d code=%d [%s]", typ, id, code, err_msg); break; } case SSH_FXP_HANDLE:{ int id = tvb_get_ntohl(tvb, offset); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; gchar * handle = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, slen); proto_tree_add_item(sftp_tree, hf_ssh_sftp_handle, tvb, offset, slen, ENC_NA); offset += slen; wmem_strbuf_append_printf(title, " SSH_FXP_HANDLE (%d) id=%d {%s}", typ, id, handle); break; } case SSH_FXP_DATA:{ int id = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; int dlen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_data_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sftp_tree, hf_ssh_sftp_data, tvb, offset, dlen, ENC_NA); offset += dlen; wmem_strbuf_append_printf(title, " SSH_FXP_DATA (%d) id=%d len=%d", typ, id, dlen); break; } case SSH_FXP_NAME:{ wmem_strbuf_append_printf(title, " SSH_FXP_NAME (%d)", typ); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint count = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_name_count, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; guint cnt; for(cnt=0;cnt<count;cnt++){ slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_name_fn_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sftp_tree, hf_ssh_sftp_name_fn, tvb, offset, slen, ENC_UTF_8); offset += slen; slen = tvb_get_ntohl(tvb, offset) ; proto_tree_add_item(sftp_tree, hf_ssh_sftp_name_ln_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(sftp_tree, hf_ssh_sftp_name_ln, tvb, offset, slen, ENC_UTF_8); offset += slen; slen = dissect_sftp_attrs(tvb, pinfo, offset, sftp_tree); offset += slen; } break; } case SSH_FXP_ATTRS:{ int id = tvb_get_ntohl(tvb, offset); wmem_strbuf_append_printf(title, " SSH_FXP_ATTRS (%d) id=%d", typ, id); proto_tree_add_item(sftp_tree, hf_ssh_sftp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; slen = dissect_sftp_attrs(tvb, pinfo, offset, sftp_tree); proto_item_set_len(sftp_tree, slen); offset += slen; break; } // case SSH_FXP_EXTENDED:{ // break; // } // case SSH_FXP_EXTENDED_REPLY:{ // break; // } default:{ wmem_strbuf_append_printf(title, " unknown (%d)", typ); offset += plen; break; } } proto_item_set_text(sftp_tree, "%s", wmem_strbuf_get_str(title)); proto_item_set_len(sftp_tree, plen+4); return offset; } static int dissect_sftp_attrs(tvbuff_t *packet_tvb, packet_info *pinfo _U_, int offset, proto_item *msg_type_tree) { wmem_strbuf_t *title = wmem_strbuf_new(wmem_packet_scope(), "SFTP attributes"); proto_item * sftp_attrs_tree = proto_tree_add_subtree(msg_type_tree, packet_tvb, offset, -1, ett_sftp_attrs, NULL, NULL); int offset0 = offset; guint flags = tvb_get_ntohl(packet_tvb, offset) ; proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_flags, packet_tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if(flags & SSH_FILEXFER_ATTR_SIZE){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_size, packet_tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; } if(flags & SSH_FILEXFER_ATTR_UIDGID){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_uid, packet_tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if(flags & SSH_FILEXFER_ATTR_UIDGID){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_gid, packet_tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if(flags & SSH_FILEXFER_ATTR_PERMISSIONS){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_permissions, packet_tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if(flags & SSH_FILEXFER_ATTR_ACMODTIME){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_atime, packet_tvb, offset, 4, ENC_TIME_SECS); offset += 4; } if(flags & SSH_FILEXFER_ATTR_ACMODTIME){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_mtime, packet_tvb, offset, 4, ENC_TIME_SECS); offset += 4; } if(flags & SSH_FILEXFER_ATTR_EXTENDED){ proto_tree_add_item(sftp_attrs_tree, hf_ssh_sftp_attrs_extended_count, packet_tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } proto_item_set_text(sftp_attrs_tree, "%s", wmem_strbuf_get_str(title)); proto_item_set_len(sftp_attrs_tree, offset - offset0); return offset - offset0; } void proto_register_sftp(void) { static hf_register_info hf[] = { { &hf_ssh_sftp_len, { "SFTP packet length", "sftp.packet_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_type, { "SFTP packet type", "sftp.packet_type", FT_UINT8, BASE_DEC, VALS(ssh2_sftp_vals), 0x0, NULL, HFILL }}, { &hf_ssh_sftp_version, { "SFTP version", "sftp.version", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_id, { "SFTP id", "sftp.id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_path_len, { "SFTP path length", "sftp.path_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_path, { "SFTP path", "sftp.path", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_pflags, { "SFTP pflags", "sftp.pflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_name_count, { "SFTP count", "sftp.name_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_name_fn_len, { "SFTP name file name length", "sftp.name_fn_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_name_fn, { "SFTP name file name", "sftp.name_fn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_name_ln_len, { "SFTP name long name length", "sftp.name_ln_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_name_ln, { "SFTP name long name", "sftp.name_ln", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_flags, { "SFTP attributes flags", "sftp.attrs.flags", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_size, { "SFTP attributes file size", "sftp.attrs.size", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_uid, { "SFTP attributes uid", "sftp.attrs.uid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_gid, { "SFTP attributes gid", "sftp.attrs.gid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_permissions, { "SFTP attributes permissions", "sftp.attrs.permissions", FT_UINT32, BASE_OCT, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_atime, { "SFTP attributes access time", "sftp.attrs.atime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_mtime, { "SFTP attributes modification time", "sftp.attrs.mtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_attrs_extended_count, { "SFTP attributes extended count", "sftp.attrs.extended_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_offset, { "SFTP offset", "sftp.offset", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_length, { "SFTP length", "sftp.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_handle_len, { "SFTP handle length", "sftp.handle_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_handle, { "SFTP handle", "sftp.handle", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_status, { "SFTP error/status code", "sftp.status", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_error_message_len, { "SFTP error message length", "sftp.error_message_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_error_message, { "SFTP error message", "sftp.error_message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_data_len, { "SFTP data length", "sftp.data_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_sftp_data, { "SFTP data", "sftp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_lang_tag_length, { "Language tag length", "sftp.lang_tag_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ssh_lang_tag, { "Language tag", "sftp.lang_tag", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_sftp, &ett_sftp_attrs, }; proto_sftp = proto_register_protocol("SSH File Transfer Protocol", "SFTP", "sftp"); proto_register_field_array(proto_sftp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); sftp_handle = register_dissector("sftp", dissect_sftp, proto_sftp); }
C
wireshark/epan/dissectors/packet-sgsap.c
/* packet-sgsap.c * Routines for SGs Application Part (SGsAP) protocol dissection * * Copyright 2010 - 2017, Anders Broman <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * References: 3GPP TS 29.118 V10.2.0 (2010-12) */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/exceptions.h> #include <epan/show_exception.h> #include "packet-gsm_a_common.h" #include "packet-e212.h" #define PNAME "SGs Application Part (SGsAP)" #define PSNAME "SGSAP" #define PFNAME "sgsap" void proto_register_sgsap(void); void proto_reg_handoff_sgsap(void); /* Global variables */ static dissector_handle_t gsm_a_dtap_handle; /* The registered SCTP port number for SGsAP is 29118. * The payload protocol identifier to be used for SGsAP is 0. */ #define SGSAP_SCTP_PORT_RANGE "29118" /* Initialize the protocol and registered fields */ static int proto_sgsap = -1; static int hf_sgsap_msg_type = -1; int hf_sgsap_elem_id = -1; static int hf_sgsap_eps_location_update_type = -1; static int hf_sgsap_service_indicator_value = -1; static int hf_sgsap_sgs_cause = -1; static int hf_sgsap_ue_emm_mode = -1; static int hf_sgsap_eci = -1; static int hf_sgsap_cn_id = -1; static int hf_sgsap_imsi_det_eps = -1; static int hf_sgsap_imsi_det_non_eps = -1; static int hf_sgsap_lcs_indic = -1; static int hf_sgsap_mme_name = -1; static int hf_sgsap_vlr_name = -1; static int hf_sgsap_imeisv = -1; static int hf_sgsap_unknown_msg = -1; static int hf_sgsap_message_elements = -1; static int hf_sgsap_csri = -1; static int hf_sgsap_sel_cs_dmn_op = -1; static int ett_sgsap = -1; static int ett_sgsap_sel_cs_dmn_op = -1; static expert_field ei_sgsap_extraneous_data = EI_INIT; static expert_field ei_sgsap_missing_mandatory_element = EI_INIT; static dissector_handle_t sgsap_handle; static void get_sgsap_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p); /* * 9.4 Information elements */ /* * 9.4.1 CLI */ /* * Octets 3 to 14 contain the value part of the Calling party BCD number information element * defined in subclause 10.5.4.9 of 3GPP TS 24.008 [8] (octets 3 to 14, i.e. not including * 3GPP TS 24.008 IEI and 3GPP TS 24.008 length indicator) * ( packet-gsm_a_dtap.c ) */ /* * 9.4.2 EPS location update type */ /* EPS location update type value (octet 3) */ static const value_string sgsap_eps_location_update_type_values[] = { { 0x00, "Shall not be sent in this version of the protocol" }, { 0x01, "IMSI attach" }, { 0x02, "Normal location update" }, { 0, NULL } }; static guint16 de_sgsap_eps_loc_upd_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; guint8 oct; curr_offset = offset; /* Octet 3 EPS location update type value */ proto_tree_add_item(tree, hf_sgsap_eps_location_update_type, tvb, offset, 1, ENC_BIG_ENDIAN); if (add_string) { oct = tvb_get_guint8(tvb, curr_offset); snprintf(add_string, string_len, " - %s", val_to_str_const(oct, sgsap_eps_location_update_type_values, "Reserved")); } curr_offset++; return(curr_offset - offset); } /* * 9.4.3 Erroneous message * * See subclause 18.4.5 in 3GPP TS 29.018 [16]. */ static guint16 de_sgsap_err_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string , int string_len) { const gchar *msg_str; gint ett_tree; int hf_idx; void(*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len); guint8 oct; /* 18.4.5 Erroneous message * The Erroneous message IE is a TLV IE that encapsulates the message in error. * Octet 3 - Octet n * Erroneous message including the message type. */ /* Messge type IE*/ oct = tvb_get_guint8(tvb, offset); msg_fcn_p = NULL; ett_tree = -1; hf_idx = -1; msg_str = NULL; proto_tree_add_item(tree, hf_sgsap_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN); get_sgsap_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p); if (msg_str) { if (add_string) snprintf(add_string, string_len, " - %s", msg_str); } if (msg_fcn_p){ volatile guint32 curr_offset = offset + 1; TRY { /*let's try to decode erroneous message and catch exceptions as it could be malformed */ (*msg_fcn_p)(tvb, tree, pinfo, curr_offset, len - 1); } CATCH_BOUNDS_ERRORS { show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY } return(len); } /* * 9.4.3a E-UTRAN Cell Global Identity * * The coding of the E-UTRAN Cell Global Identity value is according to ECGI field information element * as specified in subclause 8.21.5 of 3GPP TS 29.274 [17A] (GTPv2-C) */ guint16 de_sgsap_ecgi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_ECGI, TRUE); curr_offset += 3; proto_tree_add_item(tree, hf_sgsap_eci, tvb, curr_offset, 4, ENC_BIG_ENDIAN); curr_offset += 4; return(curr_offset-offset); } /* * 9.4.4 Global CN-Id * * See subclause 18.4.27 in 3GPP TS 29.018 [16]. * 18.4.27 Global CN-Id * The Global CN-Id consists of a PLMN-Id and a CN-Id, see 3GPP TS 23.003. The PLMN-Id consists of MCC and MNC * coded according to Location Area Identification in 3GPP TS 24.008. The CN-Id is an integer defined by O&M. The * least significant bit of the CN-Id field is bit 1 of octet 7 and the most significant bit is bit 8 of octet 6. If the CN-Id does * not fill the field reserved for it, the rest of the bits are set to '0'. */ static guint16 de_sgsap_g_cn_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, TRUE); curr_offset += 3; proto_tree_add_item(tree, hf_sgsap_cn_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN); curr_offset += 2; return(curr_offset-offset); } /* * 9.4.5 IMEISV * See subclause 18.4.9 in 3GPP TS 29.018 [16]. * The IMEISV is coded as a sequence of BCD digits, compressed two into each octet. * The IMEISV consists of 16 digits * (see 3GPP TS 23.003). */ static guint16 de_sgsap_imeisv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { char *imeisv_str; guint32 curr_offset; curr_offset = offset; proto_tree_add_item_ret_display_string(tree, hf_sgsap_imeisv, tvb, curr_offset, len, ENC_BCD_DIGITS_0_9, pinfo->pool, &imeisv_str); if (add_string) { /* (len<<2)+4 = the maximum number of bytes to produce (including the terminating nul character). */ snprintf(add_string, (len<<2)+4, " - %s", imeisv_str); } return(len); } /* * 9.4.6 IMSI * See subclause 18.4.10 in 3GPP TS 29.018 [16]. */ /* The IMSI is coded as a sequence of BCD digits, compressed two into each octet. * This is a variable length element, and includes a length indicator. * The IMSI is defined in 3GPP TS 23.003. It shall not exceed 15 digits (see 3GPP TS 23.003). */ /* * 9.4.7 IMSI detach from EPS service type */ /* IMSI detach from EPS service type value (octet 3) */ static const value_string sgsap_imsi_det_from_eps_serv_type_values[] = { { 0x00, "Interpreted as reserved in this version of the protocol" }, { 0x01, "Network initiated IMSI detach from EPS services" }, { 0x02, "UE initiated IMSI detach from EPS services" }, { 0x03, "EPS services not allowed" }, { 0, NULL } }; static guint16 de_sgsap_imsi_det_eps(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; proto_tree_add_item(tree, hf_sgsap_imsi_det_eps, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset += 1; return(curr_offset-offset); } /* * 9.4.8 IMSI detach from non-EPS service type */ /* IMSI detach from non-EPS service type value (octet 3)*/ static const value_string sgsap_imsi_det_from_non_eps_serv_type_values[] = { { 0x00, "Interpreted as reserved in this version of the protocol" }, { 0x01, "Explicit UE initiated IMSI detach from non-EPS services" }, { 0x02, "Combined UE initiated IMSI detach from EPS and non-EPS services" }, { 0x03, "Implicit network initiated IMSI detach from non-EPS services" }, { 0, NULL } }; static guint16 de_sgsap_imsi_det_non_eps(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; proto_tree_add_item(tree, hf_sgsap_imsi_det_non_eps, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset += 1; return(curr_offset-offset); } /* * 9.4.9 LCS client identity * The coding of the LCS client identity value is according to LCS-ClientID * as specified in subclause 17.7.13 of 3GPP TS 29.002 [15] * (packet-nas_eps.c) */ /* * 9.4.10 LCS indicator */ static const value_string sgsap_lcs_indic_values[] = { { 0x00, "Normal, unspecified in this version of the protocol" }, { 0x01, "MT-LR" }, { 0, NULL } }; static guint16 de_sgsap_lcs_indic(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; proto_tree_add_item(tree, hf_sgsap_lcs_indic, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset += 1; return(curr_offset-offset); } /* * 9.4.11 Location area identifier * * Octets 3 to 7 contain the value part of the Location area identification information element * defined in 3GPP TS 24.008 [8] (starting with octet 2, i.e. not including 3GPP TS 24.008 IEI) *(packet-gsm_a_common.c) */ /* * 9.4.12 MM information * For the coding see subclause 18.4.16 in 3GPP TS 29.018 [16]. * User information: This field is composed of one or more of the * information elements of the MM information message as defined in * 3GPP TS 24.008, excluding the Protocol discriminator, Skip * indicator and Message type. This field includes the IEI and length * indicatior of the other information elements. */ static guint16 de_sgsap_mm_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; dtap_mm_mm_info(tvb, tree, pinfo, curr_offset, len); return(len); } /* * 9.4.13 MME name */ static guint16 de_sgsap_mme_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint name_len; guint8 *fqdn = NULL; /* The MME name information element specifies the MME name and is coded as shown in figure 9.4.13.1. Octets 3 * through n contain the name in the form of a fully qualified domain name (FQDN) as specified in 3GPP TS 23.003 [3]. * The value part of the MME name information element (not including IEI and length indicator) shall have a length of 55 * octets. */ if (len > 0) { name_len = tvb_get_guint8(tvb, offset); if (name_len < 0x20) { fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_APN_STR); } else{ fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); } proto_tree_add_string(tree, hf_sgsap_mme_name, tvb, offset, len, fqdn); if (add_string) snprintf(add_string, string_len, " - %s", fqdn); } return(len); } /* * 9.4.14 Mobile identity * See subclause 18.4.17 in 3GPP TS 29.018 [16]. * (packet-gsm_a_common.c) */ /* * 9.4.14a Mobile Station Classmark 2 * With the exception of the IEI, the contents are specified in subclause 10.5.1.6 in 3GPP TS 24.008 [8]. * (packet-gsm_a_common.c) */ /* * 9.4.15 NAS message container * Octets 3 to 253 contain the SMS message (i.e. CP DATA, CP ACK or CP ERROR) * as defined in subclause 7.2 of 3GPP TS 24.011 [10] */ static guint16 de_sgsap_nas_msg_container(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { tvbuff_t *new_tvb; guint32 curr_offset; curr_offset = offset; /* Octets 3 to 253 contain the SMS message (i.e. CP DATA, CP ACK or CP ERROR) * as defined in subclause 7.2 of 3GPP TS 24.011 [10] */ new_tvb = tvb_new_subset_length(tvb, curr_offset, len); if (gsm_a_dtap_handle) { call_dissector(gsm_a_dtap_handle, new_tvb, pinfo, tree); } return(len); } /* * 9.4.16 Reject cause * See subclause 18.4.21 in 3GPP TS 29.018 [16]. * The rest of the information element is coded as the value part of * the reject cause IE defined in 3GPP TS 24.008, not including * 3GPP TS 24.008 IEI. * (packet-gsm_a_dtap.c) */ /* * 9.4.17 Service indicator */ /* Octet 3 Service indicator value */ static const value_string sgsap_service_indicator_values[] = { { 0x00, "Shall not be sent in this version of the protocol" }, { 0x01, "CS call indicator" }, { 0x02, "SMS indicator" }, { 0, NULL } }; static guint16 de_sgsap_serv_indic(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; guint8 oct; curr_offset = offset; /* Octet 3 Service indicator value */ proto_tree_add_item(tree, hf_sgsap_service_indicator_value, tvb, offset, 1, ENC_BIG_ENDIAN); if (add_string) { oct = tvb_get_guint8(tvb, curr_offset); snprintf(add_string, string_len, " - %s", val_to_str_const(oct, sgsap_service_indicator_values, "Reserved")); } curr_offset++; return(curr_offset - offset); } /* * 9.4.18 SGs cause */ /* SGs cause value (octet 3) */ static const value_string sgsap_sgs_cause_values[] = { { 0x00, "Normal, unspecified in this version of the protocol" }, { 0x01, "IMSI detached for EPS services" }, { 0x02, "IMSI detached for EPS and non-EPS services" }, { 0x03, "IMSI unknown" }, { 0x04, "IMSI detached for non-EPS services" }, { 0x05, "IMSI implicitly detached for non-EPS services" }, { 0x06, "UE unreachable" }, { 0x07, "Message not compatible with the protocol state" }, { 0x08, "Missing mandatory information element" }, { 0x09, "Invalid mandatory information" }, { 0x0a, "Conditional information element error" }, { 0x0b, "Semantically incorrect message" }, { 0x0c, "Message unknown" }, { 0x0d, "Mobile terminating CS fallback call rejected by the user" }, { 0x0e, "UE temporarily unreachable" }, { 0, NULL } }; static value_string_ext sgsap_sgs_cause_values_ext = VALUE_STRING_EXT_INIT(sgsap_sgs_cause_values); static guint16 de_sgsap_sgs_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; guint8 oct; curr_offset = offset; proto_tree_add_item(tree, hf_sgsap_sgs_cause, tvb, offset, 1, ENC_BIG_ENDIAN); if (add_string) { oct = tvb_get_guint8(tvb, curr_offset); snprintf(add_string, string_len, " - %s", val_to_str_ext_const(oct, &sgsap_sgs_cause_values_ext, "Reserved")); } curr_offset++; return(curr_offset - offset); } /* * 9.4.19 SS code * The coding of the SS code value is according to SS-Code as specified in * subclause 17.7.5 of 3GPP TS 29.002 [15] * ( packet-nas_eps.c) */ /* * 9.4.20 TMSI * See subclause 18.4.23 in 3GPP TS 29.018 [16]. * (packet-gsm_a_bssmap.c) */ /* * 9.4.21 TMSI status * * See subclause 18.4.24 in 3GPP TS 29.018 [16]. * (packet-gsm_a_gm.c) */ /* * 9.4.21a Tracking Area Identity * Octets 3 to 7 contain the value part of the Tracking Area Identity information element defined in 3GPP TS 24.301 [14] * (starting with octet 2, i.e. not including 3GPP TS 24.301 IEI) * (packet-nas_eps.c) */ /* * 9.4.21b UE Time Zone * The coding of the UE Time Zone value is according to value part of the Time Zone information element as specified * in subclause 10.5.3.8 of 3GPP TS 24.008 [8] (i.e. not including 3GPP TS 24.008 IEI) * (packet-gsm_a_dtap.c) */ /* * 9.4.21c UE EMM mode */ static const value_string sgsap_ue_emm_mode_values[] = { { 0x00, "EMM-IDLE" }, { 0x01, "EMM-CONNECTED" }, { 0, NULL } }; static guint16 de_sgsap_ue_emm_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; curr_offset = offset; proto_tree_add_item(tree, hf_sgsap_ue_emm_mode, tvb, offset, 1, ENC_BIG_ENDIAN); curr_offset += 1; return(curr_offset - offset); } /* * 9.4.22 VLR name */ static guint16 de_sgsap_vlr_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { guint name_len; guint8 *fqdn = NULL; /* The VLR name information element specifies the VLR name and is coded as shown in figure 9.4.22.1. * Octets 3 through n contain the VLR name in the form of a fully qualified domain name (FQDN) * as specified in IETF RFC 1035 [21]. */ if (len > 0) { name_len = tvb_get_guint8(tvb, offset); if (name_len < 0x20) { fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_APN_STR); } else{ fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); } proto_tree_add_string(tree, hf_sgsap_vlr_name, tvb, offset, len, fqdn); if (add_string) snprintf(add_string, string_len, " - %s", fqdn); } return(len); } /* * 9.4.23 Channel needed * See subclause 18.4.2 in 3GPP TS 29.018 [16]. * The rest of the information element is coded as the IEI part and the * value part of the Channel Needed IE defined in 3GPP TS 44.018 * (packet-gsm_a_bssmap.c) */ /* * 9.4.24 eMLPP priority * See subclause 18.4.4 in 3GPP TS 29.018 [16]. * The rest of the information element is coded as the value part of * the eMLPP-Priority IE defined in 3GPP TS 48.008 (not including * 3GPP TS 48.008 IEI and 3GPP TS 48.008 length indicator). * (packet-gsm_a_bssmap.c) */ /* * */ static guint16 de_sgsap_add_paging_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { /* Octet 3 0 0 0 0 0 0 0 CSRI */ proto_tree_add_item(tree, hf_sgsap_csri, tvb, offset, 1, ENC_BIG_ENDIAN); return(len); } #if 0 Reuse GSM_A_PDU_TYPE_GM, DE_NET_RES_ID_CONT /* * 9.4.26 TMSI based NRI container */ static guint16 de_sgsap_tmsi_based_nri_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { /* See subclause 18.4.28 in 3GPP TS 29.018 [16]. * Which says The TMSI based NRI container value value consists of 10 bits which correspond to bits 23 to 14 of the valid TMSI * (3GPP TS 23.236 and * Octet 3 and Octet 4 The rest of the information element is coded as the value part of the Network resource identifier container IE * defined in 3GPP TS 24.008. */ return(len); } #endif /* * 9.4.27 Selected CS domain operator */ static guint16 de_sgsap_selected_cs_dmn_op(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { proto_item *item; proto_tree *sub_tree; /* Coded as octets 2 to 4 of the Location Area Identification IE, * defined in 3GPP TS 24.008 [8] (not including 3GPP TS 24.008 IEI * and LAC).(10.5.1.3 Location Area Identification) * MCC digit 2 MCC digit 1 octet 2 * MNC digit 3 MCC digit 3 octet 3 * MNC digit 2 MNC digit 1 octet 4 */ item = proto_tree_add_item(tree, hf_sgsap_sel_cs_dmn_op, tvb, offset, 1, ENC_NA); sub_tree = proto_item_add_subtree(item, ett_sgsap_sel_cs_dmn_op); dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, sub_tree, offset, E212_LAI, TRUE); return(len); } static const value_string sgsap_elem_strings[] = { { DE_SGSAP_IMSI, "IMSI" }, /* 9.4.6 */ { DE_SGSAP_VLR_NAME, "VLR name" }, /* 9.4.22 */ { DE_SGSAP_TMSI, "TMSI" }, /* 9.4.20 */ { DE_SGSAP_LOC_AREA_ID, "Location area identifier" }, /* 9.4.11 */ { DE_SGSAP_CH_NEEDED, "Channel Needed" }, /* 9.4.23 */ { DE_SGSAP_EMLPP_PRIO, "eMLPP Priority" }, /* 9.4.24 */ { DE_SGSAP_TMSI_STATUS, "TMSI status" }, /* 9.4.21 */ { DE_SGSAP_SGS_CAUSE, "SGs cause" }, /* 9.4.18 */ { DE_SGSAP_MME_NAME, "MME name" }, /* 9.4.13 */ { DE_SGSAP_EPS_LOC_UPD_TYPE, "EPS location update type" }, /* 9.4.2 */ { DE_SGSAP_GLOBAL_CN_ID, "Global CN-Id" }, /* 9.4.4 */ { DE_SGSAP_UDEF_11, "Undefined" }, /* */ { DE_SGSAP_UDEF_12, "Undefined" }, /* */ { DE_SGSAP_MID, "Mobile identity" }, /* 9.4.14 */ { DE_SGSAP_REJ_CAUSE, "Reject cause" }, /* 9.4.16 */ { DE_SGSAP_IMSI_DET_EPS, "IMSI detach from EPS service type" }, /* 9.4.7 */ { DE_SGSAP_IMSI_DET_NON_EPS, "IMSI detach from non-EPS service type" }, /* 9.4.8 */ { DE_SGSAP_IMEISV, "IMEISV" }, /* 9.4.5 */ { DE_SGSAP_NAS_MSG_CONTAINER, "NAS message container" }, /* 9.4.15 */ { DE_SGSAP_MM_INFO, "MM information" }, /* 9.4.12 */ { DE_SGSAP_UDEF_20, "Undefined" }, /* */ { DE_SGSAP_UDEF_21, "Undefined" }, /* */ { DE_SGSAP_UDEF_22, "Undefined" }, /* */ { DE_SGSAP_ERR_MSG, "Erroneous message" }, /* 9.4.3 */ { DE_SGSAP_CLI, "CLI" }, /* 9.4.1 */ { DE_SGSAP_LCS_CLIENT_ID, "LCS client identity" }, /* 9.4.9 */ { DE_SGSAP_LCS_INDIC, "LCS indicator" }, /* 9.4.10 */ { DE_SGSAP_SS_CODE, "SS code" }, /* 9.4.19 */ { DE_SGSAP_SERV_INDIC, "Service indicator" }, /* 9.4.17 */ { DE_SGSAP_UE_TZ, "UE Time Zone" }, /* 9.4.21b */ { DE_SGSAP_MSC_2, "Mobile Station Classmark 2" }, /* 9.4.14a */ { DE_SGSAP_TAID, "Tracking Area Identity" }, /* 9.4.21a */ { DE_SGSAP_ECGI, "E-UTRAN Cell Global Identity" }, /* 9.4.3a */ { DE_SGSAP_UE_EMM_MODE, "UE EMM mode" }, /* 9.4.21c */ { DE_SGSAP_ADD_PAGING_IND, "Additional paging indicators" }, /* 9.4.25 */ { DE_SGSAP_TMSI_BASED_NRI_CONT, "TMSI based NRI container" }, /* 9.4.26 */ { DE_SGSAP_SELECTED_CS_DMN_OP, "Selected CS domain operator" }, /* 9.4.27 */ { 0, NULL } }; value_string_ext sgsap_elem_strings_ext = VALUE_STRING_EXT_INIT(sgsap_elem_strings); #define NUM_SGSAP_ELEM (sizeof(sgsap_elem_strings)/sizeof(value_string)) gint ett_sgsap_elem[NUM_SGSAP_ELEM]; #if 0 This enum has been moved to packet-gsm_a_common to make it possible to use element dissecton from this dissector in other dissectors. It is left here as a comment for easier reference. Note this enum must be of the same size as the element decoding list typedef enum { DE_SGSAP_IMSI, /. 9.4.6 IMSI./ DE_SGSAP_VLR_NAME, /. 9.4.22 VLR name./ DE_SGSAP_TMSI, /. 9.4.20 TMSI ./ DE_SGSAP_LOC_AREA_ID, /. 9.4.11 Location area identifier ./ DE_SGSAP_CH_NEEDED, /. 9.4.23 Channel Needed ./ DE_SGSAP_EMLPP_PRIO, /. 9.4.24 eMLPP Priority./ DE_SGSAP_TMSI_STATUS, /. 9.4.21 TMSI status ./ DE_SGSAP_SGS_CAUSE, /. 9.4.18 SGs cause./ DE_SGSAP_MME_NAME, /. 9.4.13 MME name./ DE_SGSAP_EPS_LOC_UPD_TYPE, /. 9.4.2 EPS location update type./ DE_SGSAP_GLOBAL_CN_ID, /. 9.4.4 Global CN-Id./ DE_SGSAP_UDEF_11, /. Undefined ./ DE_SGSAP_UDEF_12, /. Undefined ./ DE_SGSAP_MID, /. 9.4.14 Mobile identity./ DE_SGSAP_REJ_CAUSE, /. 9.4.16 Reject cause ./ DE_SGSAP_IMSI_DET_EPS, /. 9.4.7 IMSI detach from EPS service type ./ DE_SGSAP_IMSI_DET_NON_EPS, /. 9.4.8 IMSI detach from non-EPS service type ./ DE_SGSAP_IMEISV, /. 9.4.5 IMEISV ./ DE_SGSAP_NAS_MSG_CONTAINER, /. 9.4.15 NAS message container./ DE_SGSAP_MM_INFO, /. 9.4.12 MM information./ DE_SGSAP_UDEF_20, /. Undefined ./ DE_SGSAP_UDEF_21, /. Undefined ./ DE_SGSAP_UDEF_22, /. Undefined ./ DE_SGSAP_ERR_MSG, /. 9.4.3 Erroneous message./ DE_SGSAP_CLI, /. 9.4.1 CLI ./ DE_SGSAP_LCS_CLIENT_ID, /. 9.4.9 LCS client identity ./ DE_SGSAP_LCS_INDIC, /. 9.4.10 LCS indicator ./ DE_SGSAP_SS_CODE, /. 9.4.19 SS code ./ DE_SGSAP_SERV_INDIC, /. 9.4.17 Service indicator ./ DE_SGSAP_UE_TZ, /. 9.4.21b UE Time Zone ./ DE_SGSAP_MSC_2, /. 9.4.14a Mobile Station Classmark 2 ./ DE_SGSAP_TAID, /. 9.4.21a Tracking Area Identity ./ DE_SGSAP_ECGI, /. 9.4.3a E-UTRAN Cell Global Identity ./ DE_SGSAP_UE_EMM_MODE, /. 9.4.21c UE EMM mode./ DE_SGSAP_ADD_PAGING_IND, /. 9.4.25 Additional paging indicators ./ DE_SGSAP_TMSI_BASED_NRI_CONT, /. 9.4.26 TMSI based NRI container ./ DE_SGSAP_SELECTED_CS_DMN_OP, /. 9.4.27 Selected CS domain operator ./ DE_SGAP_NONE /. NONE ./ } sgsap_elem_idx_t; #endif /* 0 */ guint16 (*sgsap_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = { NULL/*DE_SGSAP_IMSI*/, /* 9.4.6 IMSI*/ de_sgsap_vlr_name, /* 9.4.22 VLR name*/ NULL/*DE_SGSAP_TMSI*/, /* 9.4.20 TMSI */ NULL/*DE_SGSAP_LOC_AREA_ID*/, /* 9.4.11 Location area identifier */ NULL/*DE_SGSAP_CH_NEEDED*/, /* 9.4.23 Channel Needed */ NULL/*DE_SGSAP_EMLPP_PRIO*/, /* 9.4.24 eMLPP Priority*/ NULL/*DE_SGSAP_TMSI_STATUS*/, /* 9.4.21 TMSI status */ de_sgsap_sgs_cause, /* 9.4.18 SGs cause*/ de_sgsap_mme_name, /* 9.4.13 MME name*/ de_sgsap_eps_loc_upd_type, /* 9.4.2 EPS location update type*/ de_sgsap_g_cn_id, /* 9.4.4 Global CN-Id*/ NULL/*DE_SGSAP_UDEF_11*/, /* Undefined */ NULL/*DE_SGSAP_UDEF_12*/, /* Undefined */ NULL/*DE_SGSAP_MID*/, /* 9.4.14 Mobile identity*/ NULL/*DE_SGSAP_REJ_CAUSE*/, /* 9.4.16 Reject cause */ de_sgsap_imsi_det_eps, /* 9.4.7 IMSI detach from EPS service type */ de_sgsap_imsi_det_non_eps, /* 9.4.8 IMSI detach from non-EPS service type */ de_sgsap_imeisv, /* 9.4.5 IMEISV */ de_sgsap_nas_msg_container, /* 9.4.15 NAS message container*/ de_sgsap_mm_info, /* 9.4.12 MM information*/ NULL/*DE_SGSAP_UDEF_20*/, /* Undefined */ NULL/*DE_SGSAP_UDEF_21*/, /* Undefined */ NULL/*DE_SGSAP_UDEF_22*/, /* Undefined */ de_sgsap_err_msg, /* 9.4.3 Erroneous message*/ NULL/*DE_SGSAP_CLI*/, /* 9.4.1 CLI */ NULL/*DE_SGSAP_LCS_CLIENT_ID*/, /* 9.4.9 LCS client identity */ de_sgsap_lcs_indic, /* 9.4.10 LCS indicator */ NULL/*DE_SGSAP_SS_CODE*/, /* 9.4.19 SS code */ de_sgsap_serv_indic, /* 9.4.17 Service indicator */ NULL/*DE_SGSAP_UE_TZ*/, /* 9.4.21b UE Time Zone */ NULL/*DE_SGSAP_MSC_2*/, /* 9.4.14a Mobile Station Classmark 2 */ NULL/*DE_SGSAP_TAID*/, /* 9.4.21a Tracking Area Identity */ de_sgsap_ecgi, /* 9.4.3a E-UTRAN Cell Global Identity */ de_sgsap_ue_emm_mode, /* 9.4.21c UE EMM mode*/ de_sgsap_add_paging_ind, /* 9.4.25 Additional paging indicators */ NULL/*DE_SGSAP_TMSI_BASED_NRI_CONT */, /* 9.4.26 TMSI based NRI container (Reuse GSM_A_PDU_TYPE_GM, DE_NET_RES_ID_CONT */ de_sgsap_selected_cs_dmn_op, /* 9.4.27 Selected CS domain operator */ NULL, /* NONE */ }; /* MESSAGE FUNCTIONS */ /* * 8.1 SGsAP-ALERT-ACK message */ static void sgsap_alert_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.2 SGsAP-ALERT-REJECT message */ static void sgsap_alert_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* SGs Cause SGs cause 9.4.18 M TLV 3 */ ELEM_MAND_TLV(0x08, SGSAP_PDU_TYPE, DE_SGSAP_SGS_CAUSE, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.3 SGsAP-ALERT-REQUEST message */ static void sgsap_alert_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.4 SGsAP-DOWNLINK-UNITDATA message */ static void sgsap_dl_unitdata(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* NAS message container NAS message container 9.4.15 M TLV 4-253 */ ELEM_MAND_TLV(0x16, SGSAP_PDU_TYPE, DE_SGSAP_NAS_MSG_CONTAINER, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.5 SGsAP-EPS-DETACH-ACK message */ static void sgsap_eps_det_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.6 SGsAP-EPS-DETACH-INDICATION message */ static void sgsap_eps_det_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* MME name MME name 9.4.13 M TLV 57 */ ELEM_MAND_TLV(0x09, SGSAP_PDU_TYPE, DE_SGSAP_MME_NAME, NULL, ei_sgsap_missing_mandatory_element); /* IMSI detach from EPS service type IMSI detach from EPS service type 9.4.7 M TLV 3 */ ELEM_MAND_TLV(0x10, SGSAP_PDU_TYPE, DE_SGSAP_IMSI_DET_EPS, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.7 SGsAP-IMSI-DETACH-ACK message */ static void sgsap_imsi_det_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.8 SGsAP-IMSI-DETACH-INDICATION message */ static void sgsap_imsi_det_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* MME name MME name 9.4.13 M TLV 57 */ ELEM_MAND_TLV(0x09, SGSAP_PDU_TYPE, DE_SGSAP_MME_NAME, NULL, ei_sgsap_missing_mandatory_element); /* IMSI Detach from non-EPS service type IMSI detach from non-EPS service type 9.4.8 M TLV 3 */ ELEM_MAND_TLV(0x11, SGSAP_PDU_TYPE, DE_SGSAP_IMSI_DET_NON_EPS, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.9 SGsAP-LOCATION-UPDATE-ACCEPT message */ static void sgsap_imsi_loc_update_acc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* Location area identifier Location area identifier 9.4.11 M TLV 7 */ ELEM_MAND_TLV(0x04, GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_sgsap_missing_mandatory_element); /* New TMSI, or IMSI Mobile identity 9.4.14 O TLV 6-10 */ ELEM_OPT_TLV(0x0e, GSM_A_PDU_TYPE_COMMON, DE_MID, " - New TMSI, or IMSI"); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.10 SGsAP-LOCATION-UPDATE-REJECT message */ static void sgsap_imsi_loc_update_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* Reject cause Reject cause 9.4.16 M TLV 3 */ ELEM_MAND_TLV(0x0f, GSM_A_PDU_TYPE_DTAP, DE_REJ_CAUSE, NULL, ei_sgsap_missing_mandatory_element); /* Location area identifier Location area identifier 9.4.11 O TLV 7 */ ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.11 SGsAP-LOCATION-UPDATE-REQUEST message */ static void sgsap_imsi_loc_update_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* MME name MME name 9.4.13 M TLV 57 */ ELEM_MAND_TLV(0x09, SGSAP_PDU_TYPE, DE_SGSAP_MME_NAME, NULL, ei_sgsap_missing_mandatory_element); /* EPS location update type EPS location update type 9.4.2 M TLV 3 */ ELEM_MAND_TLV(0x0a, SGSAP_PDU_TYPE, DE_SGSAP_EPS_LOC_UPD_TYPE, NULL, ei_sgsap_missing_mandatory_element); /* New location area identifier Location area identifier 9.4.11 M TLV 7 */ ELEM_MAND_TLV(0x04, GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL, ei_sgsap_missing_mandatory_element); /* Old location area identifier Location area identifier 9.4.11 O TLV 7 */ ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_COMMON, DE_LAI, " - Old location area identifier"); /* TMSI status TMSI status 9.4.21 O TLV 3 */ ELEM_OPT_TLV( 0x07 , GSM_A_PDU_TYPE_GM, DE_TMSI_STAT , NULL ); /* IMEISV IMEISV 9.4.5 O TLV 10 */ ELEM_OPT_TLV(0x15, SGSAP_PDU_TYPE, DE_SGSAP_IMEISV, NULL); /* TAI Tracking Area Identity 9.4.21a O TLV 7 */ ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, NULL); /* E-CGI E-UTRAN Cell Global Identity 9.4.3a O TLV 9 */ ELEM_OPT_TLV(0x24, SGSAP_PDU_TYPE, DE_SGSAP_ECGI, NULL); /* TMSI based NRI container TMSI based NRI container 9.4.26 O TLV 4 */ ELEM_OPT_TLV(0x27, GSM_A_PDU_TYPE_GM, DE_NET_RES_ID_CONT, " - TMSI based NRI container"); /* Selected CS domain operator Selected CS domain operator 9.4.27 O TLV 5 */ ELEM_OPT_TLV(0x28, SGSAP_PDU_TYPE, DE_SGSAP_SELECTED_CS_DMN_OP, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.12 SGsAP-MM-INFORMATION-REQUEST */ static void sgsap_mm_info_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* MM information MM information 9.4.12 M TLV 3-n */ ELEM_MAND_TLV(0x17, SGSAP_PDU_TYPE, DE_SGSAP_MM_INFO, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.13 SGsAP-PAGING-REJECT message */ static void sgsap_paging_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* SGs Cause SGs Cause 9.4.18 M TLV 3 */ ELEM_MAND_TLV(0x08, SGSAP_PDU_TYPE, DE_SGSAP_SGS_CAUSE, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.14 SGsAP-PAGING-REQUEST message */ static void sgsap_paging_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* VLR name VLR name 9.4.22 M TLV 3-n */ ELEM_MAND_TLV(0x02, SGSAP_PDU_TYPE, DE_SGSAP_VLR_NAME, NULL, ei_sgsap_missing_mandatory_element); /* Service indicator Service indicator 9.4.17 M TLV 3 */ ELEM_MAND_TLV(0x20, SGSAP_PDU_TYPE, DE_SGSAP_SERV_INDIC, NULL, ei_sgsap_missing_mandatory_element); /* TMSI TMSI 9.4.20 O TLV 6 */ ELEM_OPT_TLV(0x03, GSM_A_PDU_TYPE_BSSMAP, BE_TMSI, NULL); /* CLI CLI 9.4.1 O TLV 3-14 */ ELEM_OPT_TLV(0x1c, GSM_A_PDU_TYPE_DTAP, DE_CLG_PARTY_BCD_NUM, " - CLI"); /* Location area identifier Location area identifier 9.4.11 O TLV 7 */ ELEM_OPT_TLV(0x04, GSM_A_PDU_TYPE_COMMON, DE_LAI, NULL); /* Global CN-Id Global CN-Id 9.4.4 O TLV 7 */ ELEM_OPT_TLV(0x0b, SGSAP_PDU_TYPE, DE_SGSAP_GLOBAL_CN_ID, NULL); /* SS code SS code 9.4.19 O TLV 3 */ ELEM_OPT_TLV(0x1f, NAS_PDU_TYPE_EMM, DE_EMM_SS_CODE, NULL); /* LCS indicator LCS indicator 9.4.10 O TLV 3 */ ELEM_OPT_TLV(0x1e, SGSAP_PDU_TYPE, DE_SGSAP_LCS_INDIC, NULL); /* LCS client identity LCS client identity 9.4.9 O TLV 3-n */ ELEM_OPT_TLV(0x1d, NAS_PDU_TYPE_EMM, DE_EMM_LCS_CLIENT_ID, NULL); /* Channel needed Channel needed 9.4.23 O TLV 3 */ ELEM_OPT_TLV(0x05, GSM_A_PDU_TYPE_BSSMAP, BE_CHAN_NEEDED, NULL); /* eMLPP Priority eMLPP Priority 9.4.24 O TLV 3 */ ELEM_OPT_TLV(0x06, GSM_A_PDU_TYPE_BSSMAP, BE_EMLPP_PRIO, NULL); /* Additional paging indicators Additional paging indicators 9.4.25 O TLV 3 */ ELEM_OPT_TLV(0x26, SGSAP_PDU_TYPE, DE_SGSAP_ADD_PAGING_IND, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.15 SGsAP-RESET-ACK message */ static void sgsap_reset_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* MME name MME name 9.4.13 C TLV 57 */ ELEM_OPT_TLV(0x09, SGSAP_PDU_TYPE, DE_SGSAP_MME_NAME, NULL); /* VLR name VLR name 9.4.22 C TLV 3-n */ ELEM_OPT_TLV(0x02, SGSAP_PDU_TYPE, DE_SGSAP_VLR_NAME, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.16 SGsAP-RESET-INDICATION message */ static void sgsap_reset_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* MME name MME name 9.4.13 C TLV 57 */ ELEM_OPT_TLV(0x09, SGSAP_PDU_TYPE, DE_SGSAP_MME_NAME, NULL); /* VLR name VLR name 9.4.22 C TLV 3-n */ ELEM_OPT_TLV(0x02, SGSAP_PDU_TYPE, DE_SGSAP_VLR_NAME, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.17 SGsAP-SERVICE-REQUEST message */ static void sgsap_service_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /*IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* Service indicator Service indicator 9.4.17 M TLV 3 */ ELEM_MAND_TLV(0x20, SGSAP_PDU_TYPE, DE_SGSAP_SERV_INDIC, NULL, ei_sgsap_missing_mandatory_element); /* IMEISV IMEISV 9.4.5 O TLV 10 */ ELEM_OPT_TLV(0x15, SGSAP_PDU_TYPE, DE_SGSAP_IMEISV, NULL); /* UE Time Zone UE Time Zone 9.4.21b O TLV 3 */ ELEM_OPT_TLV(0x21, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - UE Time Zone"); /* Mobile Station Classmark 2 Mobile Station Classmark 2 9.4.14a O TLV 5 */ ELEM_OPT_TLV(0x22 , GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL); /* TAI Tracking Area Identity 9.4.21a O TLV 7 */ ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, NULL); /* E-CGI E-UTRAN Cell Global Identity 9.4.3a O TLV 9 */ ELEM_OPT_TLV(0x24, SGSAP_PDU_TYPE, DE_SGSAP_ECGI, NULL); /* UE EMM Mode UE EMM mode 9.4.21c O TLV 3 */ ELEM_OPT_TLV(0x25, SGSAP_PDU_TYPE, DE_SGSAP_UE_EMM_MODE, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.18 SGsAP-STATUS message */ static void sgsap_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 O TLV 6-10 */ ELEM_OPT_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL); /* SGs cause SGs cause 9.4.18 M TLV 3 */ ELEM_MAND_TLV(0x08, SGSAP_PDU_TYPE, DE_SGSAP_SGS_CAUSE, NULL, ei_sgsap_missing_mandatory_element); /* Erroneous message Erroneous message 9.4.3 M TLV 3-n */ ELEM_OPT_TLV(0x1b, SGSAP_PDU_TYPE, DE_SGSAP_ERR_MSG, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.19 SGsAP-TMSI-REALLOCATION-COMPLETE message */ static void sgsap_tmsi_realloc_comp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /*IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.20 SGsAP-UE-ACTIVITY-INDICATION message */ static void sgsap_ue_act_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.21 SGsAP-UE-UNREACHABLE message */ static void sgsap_ue_unreachable(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* SGs cause SGs cause 9.4.18 M TLV 3 */ ELEM_MAND_TLV(0x08, SGSAP_PDU_TYPE, DE_SGSAP_SGS_CAUSE, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.22 SGsAP-UPLINK-UNITDATA message */ static void sgsap_ue_ul_unitdata(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* NAS message container NAS message container 9.4.15 M TLV 4-253 */ ELEM_MAND_TLV(0x16, SGSAP_PDU_TYPE, DE_SGSAP_NAS_MSG_CONTAINER, NULL, ei_sgsap_missing_mandatory_element); /* IMEISV IMEISV 9.4.5 O TLV 10 */ ELEM_OPT_TLV(0x15, SGSAP_PDU_TYPE, DE_SGSAP_IMEISV, NULL); /* UE Time Zone UE Time Zone 9.4.21b O TLV 3 */ ELEM_OPT_TLV(0x21, GSM_A_PDU_TYPE_DTAP, DE_TIME_ZONE, " - UE Time Zone"); /* Mobile Station Classmark 2 Mobile Station Classmark 2 9.4.14a O TLV 5 */ ELEM_OPT_TLV(0x22 , GSM_A_PDU_TYPE_COMMON, DE_MS_CM_2, NULL); /* TAI Tracking Area Identity 9.4.21a O TLV 7 */ ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, NULL); /* E-CGI E-UTRAN Cell Global Identity 9.4.3a O TLV 9 */ ELEM_OPT_TLV(0x24, SGSAP_PDU_TYPE, DE_SGSAP_ECGI, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.23 SGsAP-RELEASE-REQUEST message */ static void sgsap_release_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* SGs cause SGs cause 9.4.18 O TLV 3 */ ELEM_OPT_TLV(0x08, SGSAP_PDU_TYPE, DE_SGSAP_SGS_CAUSE, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.24 SGsAP-SERVICE-ABORT-REQUEST message */ static void sgsap_service_abort_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 8.25 SGsAP-MO-CSFB-INDICATION message */ static void sgsap_mo_csfb_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) { guint32 curr_offset; guint32 consumed; guint curr_len; curr_offset = offset; curr_len = len; /* IMSI IMSI 9.4.6 M TLV 6-10 */ ELEM_MAND_TLV(0x01, GSM_A_PDU_TYPE_BSSMAP, BE_IMSI, NULL, ei_sgsap_missing_mandatory_element); /* TAI Tracking Area Identity 9.4.21a O TLV 7 */ ELEM_OPT_TLV(0x23, NAS_PDU_TYPE_EMM, DE_EMM_TRAC_AREA_ID, NULL); /* E-CGI E-UTRAN Cell Global Identity 9.4.3a O TLV 9 */ ELEM_OPT_TLV(0x24, SGSAP_PDU_TYPE, DE_SGSAP_ECGI, NULL); EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_sgsap_extraneous_data); } /* * 9.2 Message type */ static const value_string sgsap_msg_strings[] = { { 0x01, "SGsAP-PAGING-REQUEST"}, /* 8.14 */ { 0x02, "SGsAP-PAGING-REJECT"}, /* 8.13 */ /* * 0 0 0 0 0 0 1 1 * to * 0 0 0 0 0 1 0 1 * Unassigned: treated as an unknown Message type */ { 0x03, "Unassigned"}, /* 7 */ { 0x04, "Unassigned"}, /* 7 */ { 0x05, "Unassigned"}, /* 7 */ { 0x06, "SGsAP-SERVICE-REQUEST"}, /* 8.17 */ { 0x07, "SGsAP-DOWNLINK-UNITDATA"}, /* 8.4 */ { 0x08, "SGsAP-UPLINK-UNITDATA"}, /* 8.22 */ { 0x09, "SGsAP-LOCATION-UPDATE-REQUEST"}, /* 8.11 */ { 0x0a, "SGsAP-LOCATION-UPDATE-ACCEPT"}, /* 8.9 */ { 0x0b, "SGsAP-LOCATION-UPDATE-REJECT"}, /* 8.10 */ { 0x0c, "SGsAP-TMSI-REALLOCATION-COMPLETE"}, /* 8.19 */ { 0x0d, "SGsAP-ALERT-REQUEST"}, /* 8.3 */ { 0x0e, "SGsAP-ALERT-ACK"}, /* 8.1 */ { 0x0f, "SGsAP-ALERT-REJECT"}, /* 8.2 */ { 0x10, "SGsAP-UE-ACTIVITY-INDICATION"}, /* 8.20 */ { 0x11, "SGsAP-EPS-DETACH-INDICATION"}, /* 8.6 */ { 0x12, "SGsAP-EPS-DETACH-ACK"}, /* 8.5 */ { 0x13, "SGsAP-IMSI-DETACH-INDICATION"}, /* 8.8 */ { 0x14, "SGsAP-IMSI-DETACH-ACK"}, /* 8.7 */ { 0x15, "SGsAP-RESET-INDICATION"}, /* 8.16 */ { 0x16, "SGsAP-RESET-ACK"}, /* 8.15 */ { 0x17, "SGsAP-SERVICE-ABORT-REQUEST"}, /* 8.24 */ { 0x18, "SGsAP-MO-CSFB-INDICATION"}, /* 8.25 */ /* * 0 0 0 1 1 0 0 0 * to * 0 0 0 1 1 0 0 1 * Unassigned: treated as an unknown Message type */ { 0x19, "Unassigned"}, { 0x1a, "SGsAP-MM-INFORMATION-REQUEST"}, /* 8.12 */ { 0x1b, "SGsAP-RELEASE-REQUEST"}, /* 8.23 */ /* * 0 0 0 1 1 1 0 0 Unassigned: treated as an unknown Message type 7 */ { 0x1c, "Unassigned"}, /* 7 */ { 0x1d, "SGsAP-STATUS"}, /* 8.18 */ { 0x1e, "Unassigned"}, /* 7 */ { 0x1f, "SGsAP-UE-UNREACHABLE"}, /* 8.21 */ { 0, NULL } }; static value_string_ext sgsap_msg_strings_ext = VALUE_STRING_EXT_INIT(sgsap_msg_strings); #define NUM_SGSAP_MSG (sizeof(sgsap_msg_strings)/sizeof(value_string)) static gint ett_sgsap_msg[NUM_SGSAP_MSG]; static void (*sgsap_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len) = { sgsap_paging_req, /* 0x01, "SGsAP-PAGING-REQUEST" 8.14 */ sgsap_paging_rej, /* 0x02, "SGsAP-PAGING-REJECT" 8.13 */ /* * 0 0 0 0 0 0 1 1 * to * 0 0 0 0 0 1 0 1 * Unassigned: treated as an unknown Message type */ NULL, /* 0x03, "Unassigned" 7 */ NULL, /* 0x04, "Unassigned" 7 */ NULL, /* 0x05, "Unassigned" 7 */ sgsap_service_req, /* 0x06, "SGsAP-SERVICE-REQUEST" 8.17 */ sgsap_dl_unitdata, /* 0x07, "SGsAP-DOWNLINK-UNITDATA" 8.4 */ sgsap_ue_ul_unitdata, /* 0x08, "SGsAP-UPLINK-UNITDATA" 8.22 */ sgsap_imsi_loc_update_req, /* 0x09, "SGsAP-LOCATION-UPDATE-REQUEST" 8.11 */ sgsap_imsi_loc_update_acc, /* 0x0a, "SGsAP-LOCATION-UPDATE-ACCEPT" 8.9 */ sgsap_imsi_loc_update_rej, /* 0x0b, "SGsAP-LOCATION-UPDATE-REJECT" 8.10 */ sgsap_tmsi_realloc_comp, /* 0x0c, "SGsAP-TMSI-REALLOCATION-COMPLETE" 8.19 */ sgsap_alert_req, /* 0x0d, "SGsAP-ALERT-REQUEST" 8.3 */ sgsap_alert_ack, /* 0x0e, "SGsAP-ALERT-ACK" 8.1 */ sgsap_alert_rej, /* 0x0f, "SGsAP-ALERT-REJECT" 8.2 */ sgsap_ue_act_ind, /* 0x10, "SGsAP-UE-ACTIVITY-INDICATION" 8.20 */ sgsap_eps_det_ind, /* 0x11, "SGsAP-EPS-DETACH-INDICATION" 8.6 */ sgsap_eps_det_ack, /* 0x12, "SGsAP-EPS-DETACH-ACK" 8.5 */ sgsap_imsi_det_ind, /* 0x13, "SGsAP-IMSI-DETACH-INDICATION" 8.8 */ sgsap_imsi_det_ack, /* 0x14, "SGsAP-IMSI-DETACH-ACK" 8.7 */ sgsap_reset_ind, /* 0x15, "SGsAP-RESET-INDICATION" 8.16 */ sgsap_reset_ack, /* 0x16, "SGsAP-RESET-ACK" 8.15 */ sgsap_service_abort_req, /* 0x17, "SGsAP-SERVICE-ABORT-REQUEST" 8.24 */ sgsap_mo_csfb_ind, /* 0x18, "SGsAP-MO-CSFB-INDICATION" 8.25 */ /* * 0 0 0 1 1 0 0 1 * to * 0 0 0 1 1 0 0 1 * Unassigned: treated as an unknown Message type */ NULL, /* 0x19, "Unassigned" */ sgsap_mm_info_req, /* 0x1a, "SGsAP-MM-INFORMATION-REQUEST" 8.12 */ sgsap_release_req, /* 0x1b, "SGsAP-RELEASE-REQUEST" 8.23 */ /* * 0 0 0 1 1 1 0 0 Unassigned: treated as an unknown Message type 7 */ NULL, /* 0x1c, "Unassigned" */ sgsap_status, /* 0x1d, "SGsAP-STATUS" 8.18 */ NULL, /* 0x1e, "Unassigned" */ sgsap_ue_unreachable, /* 0x1f, "SGsAP-UE-UNREACHABLE" 8.21 */ NULL, /* NONE */ }; static void get_sgsap_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p) { gint idx; *msg_str = try_val_to_str_idx_ext((guint32) (oct & 0xff), &sgsap_msg_strings_ext, &idx); *hf_idx = hf_sgsap_msg_type; if (*msg_str != NULL) { *ett_tree = ett_sgsap_msg[idx]; *msg_fcn_p = sgsap_msg_fcn[idx]; } return; } static int dissect_sgsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *item; proto_tree *sgsap_tree; int offset = 0; guint32 len; const gchar *msg_str; gint ett_tree; int hf_idx; void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len); guint8 oct; len = tvb_reported_length(tvb); /* Make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); item = proto_tree_add_item(tree, proto_sgsap, tvb, 0, -1, ENC_NA); sgsap_tree = proto_item_add_subtree(item, ett_sgsap); /* Messge type IE*/ oct = tvb_get_guint8(tvb, offset); msg_fcn_p = NULL; ett_tree = -1; hf_idx = -1; msg_str = NULL; get_sgsap_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p); if (msg_str) { col_add_fstr(pinfo->cinfo, COL_INFO, "%s", msg_str); }else{ proto_tree_add_item(tree, hf_sgsap_unknown_msg, tvb, offset, 1, ENC_BIG_ENDIAN); return tvb_captured_length(tvb); } /* * Add SGSAP message name */ proto_tree_add_item(sgsap_tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* * decode elements */ if (msg_fcn_p == NULL) { proto_tree_add_item(sgsap_tree, hf_sgsap_message_elements, tvb, offset, len - offset, ENC_NA); } else { (*msg_fcn_p)(tvb, sgsap_tree, pinfo, offset, len - offset); } return tvb_captured_length(tvb); } void proto_register_sgsap(void) { guint i; guint last_offset; /* List of fields */ static hf_register_info hf[] = { { &hf_sgsap_msg_type, { "SGSAP Message Type", "sgsap.msg_type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &sgsap_msg_strings_ext, 0x0, NULL, HFILL } }, { &hf_sgsap_elem_id, { "Element ID", "sgsap.elem_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sgsap_eps_location_update_type, { "EPS location update type", "sgsap.eps_location_update_type", FT_UINT8, BASE_DEC, VALS(sgsap_eps_location_update_type_values), 0x0, NULL, HFILL } }, { &hf_sgsap_service_indicator_value, { "Service indicator", "sgsap.service_indicator", FT_UINT8, BASE_DEC, VALS(sgsap_service_indicator_values), 0x0, NULL, HFILL } }, { &hf_sgsap_sgs_cause, { "SGs cause", "sgsap.sgs_cause", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &sgsap_sgs_cause_values_ext, 0x0, NULL, HFILL } }, { &hf_sgsap_ue_emm_mode, { "UE EMM mode", "sgsap.ue_emm_mode", FT_UINT8, BASE_DEC, VALS(sgsap_ue_emm_mode_values), 0x0, NULL, HFILL } }, { &hf_sgsap_eci, {"ECI (E-UTRAN Cell Identifier)", "sgsap.eci", FT_UINT32, BASE_DEC, NULL, 0x0fffffff, NULL, HFILL} }, { &hf_sgsap_cn_id, {"CN_ID", "sgsap.cn_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_sgsap_imsi_det_eps, { "IMSI detach from EPS service type", "sgsap.imsi_det_eps", FT_UINT8, BASE_DEC, VALS(sgsap_imsi_det_from_eps_serv_type_values), 0x0, NULL, HFILL } }, { &hf_sgsap_imsi_det_non_eps, { "IMSI detach from non-EPS service type", "sgsap.imsi_det_non_eps", FT_UINT8, BASE_DEC, VALS(sgsap_imsi_det_from_non_eps_serv_type_values), 0x0, NULL, HFILL } }, { &hf_sgsap_lcs_indic, { "LCS indicator", "sgsap.lcs_indicator", FT_UINT8, BASE_DEC, VALS(sgsap_lcs_indic_values), 0x0, NULL, HFILL } }, { &hf_sgsap_mme_name, {"MME name", "sgsap.mme_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sgsap_vlr_name, {"VLR name", "sgsap.vlr_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sgsap_imeisv, {"IMEISV", "sgsap.imeisv", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sgsap_unknown_msg, { "Unknown message", "sgsap.unknown_msg", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_sgsap_message_elements, {"Message Elements", "sgsap.message_elements", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_sgsap_csri, {"CS restoration indicator (CSRI)", "sgsap.csri", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL } }, { &hf_sgsap_sel_cs_dmn_op, { "Selected CS domain operator", "sgsap.sel_cs_dmn_op", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static ei_register_info ei[] = { { &ei_sgsap_extraneous_data, { "sgsap.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }}, { &ei_sgsap_missing_mandatory_element, { "sgsap.missing_mandatory_element", PI_PROTOCOL, PI_WARN, "Missing Mandatory element, rest of dissection is suspect", EXPFILL }}, }; expert_module_t* expert_sgsap; /* Setup protocol subtree array */ #define NUM_INDIVIDUAL_ELEMS 2 gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_SGSAP_ELEM + NUM_SGSAP_MSG]; ett[0] = &ett_sgsap; ett[1] = &ett_sgsap_sel_cs_dmn_op; last_offset = NUM_INDIVIDUAL_ELEMS; for (i=0; i < NUM_SGSAP_ELEM; i++, last_offset++) { ett_sgsap_elem[i] = -1; ett[last_offset] = &ett_sgsap_elem[i]; } for (i=0; i < NUM_SGSAP_MSG; i++, last_offset++) { ett_sgsap_msg[i] = -1; ett[last_offset] = &ett_sgsap_msg[i]; } /* Register protocol */ proto_sgsap = proto_register_protocol(PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array(proto_sgsap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_sgsap = expert_register_protocol(proto_sgsap); expert_register_field_array(expert_sgsap, ei, array_length(ei)); /* Register dissector */ sgsap_handle = register_dissector(PFNAME, dissect_sgsap, proto_sgsap); /* sgsap_module = prefs_register_protocol(proto_sgsap, NULL); */ } void proto_reg_handoff_sgsap(void) { /* The registered SCTP port number for SGsAP is 29118. * The payload protocol identifier to be used for SGsAP is 0. */ gsm_a_dtap_handle = find_dissector_add_dependency("gsm_a_dtap", proto_sgsap); dissector_add_uint_range_with_preference("sctp.port", SGSAP_SCTP_PORT_RANGE, sgsap_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-shicp.c
/* packet-shicp.c * Routines for Secure Host IP Configuration Protocol dissection * Copyright 2021, Filip KÃ¥gesson <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include <config.h> #include <epan/packet.h> #include <epan/expert.h> #include <epan/addr_resolv.h> #include "packet-udp.h" void proto_reg_handoff_shicp(void); void proto_register_shicp(void); /* Protocols and header fields */ static int proto_shicp = -1; static int hf_shicp_header = -1; static int hf_shicp_protocol_version = -1; static int hf_shicp_dst = -1; static int hf_shicp_src = -1; static int hf_shicp_flags = -1; static int hf_shicp_msgclass_flag = -1; static int hf_shicp_error_flag = -1; static int hf_shicp_reserved_flag = -1; static int hf_shicp_msgtype = -1; static int hf_shicp_error = -1; static int hf_shicp_error_string = -1; static int hf_shicp_auth_req = -1; static int hf_shicp_module_version = -1; static int hf_shicp_module_desc = -1; static int hf_shicp_supported_msg = -1; static int hf_shicp_ip = -1; static int hf_shicp_sn = -1; static int hf_shicp_gw = -1; static int hf_shicp_dns1 = -1; static int hf_shicp_dns2 = -1; static int hf_shicp_dhcp = -1; static int hf_shicp_hn = -1; static int hf_shicp_hn_max_len = -1; static int hf_shicp_pswd_max_len = -1; static int hf_shicp_challenge = -1; static int hf_shicp_validity_period = -1; static int hf_shicp_token = -1; static int hf_shicp_pswd = -1; static int hf_shicp_wink_type = -1; static int hf_shicp_restart_mode = -1; static gint ett_shicp = -1; static gint ett_shicp_flags = -1; static expert_field ei_shicp_error = EI_INIT; static expert_field ei_shicp_malformed = EI_INIT; #define SHICP_UDP_PORT 3250 #define SHICP_MIN_LENGTH 2 #define SHICP_MAX_LENGTH 548 #define SHICP_HEADER_SIZE 2 #define SHICP_ADDRESS_SIZE 6 #define SHICP_FLAGS_SIZE 1 #define SHICP_MSG_TYPE_SIZE 1 #define SHICP_ERROR_SIZE 1 #define SHICP_CHALLENGE_SIZE 4 #define SHICP_VALIDITY_PERIOD_SIZE 1 #define SHICP_TOKEN_SIZE 36 #define SHICP_WINK_TYPE_SIZE 1 #define SHICP_RESTART_MODE_SIZE 1 #define SHICP_FIXED_LEN 18 #define SHICP_MSG_CLASS_FLAG 0x01 #define SHICP_ERROR_FLAG 0x02 #define SHICP_RESERVED_FLAG 0xFC /* Values of the supported message types. */ #define SHICP_DISCOVER_MSG_TYPE 0x00 #define SHICP_AUTH_CHALLENGE_MSG_TYPE 0x01 #define SHICP_CONFIG_MSG_TYPE 0x02 #define SHICP_WINK_MSG_TYPE 0x03 #define SHICP_RESTART_MSG_TYPE 0x04 #define SHICP_MASS_RESTART_MSG_TYPE 0x05 /* Keys of the parameters associated with discover messages. */ #define SHICP_DISCOVER_AUTH_REQ_KEY 0x00 #define SHICP_DISCOVER_MODULE_VERSION_KEY 0x01 #define SHICP_DISCOVER_MODULE_DESC_KEY 0x02 #define SHICP_DISCOVER_SUPPORTED_MSG_KEY 0x03 #define SHICP_DISCOVER_IP_KEY 0x04 #define SHICP_DISCOVER_SN_KEY 0x05 #define SHICP_DISCOVER_GW_KEY 0x06 #define SHICP_DISCOVER_DNS1_KEY 0x07 #define SHICP_DISCOVER_DNS2_KEY 0x08 #define SHICP_DISCOVER_DHCP_KEY 0x09 #define SHICP_DISCOVER_HN_KEY 0x0A #define SHICP_DISCOVER_HN_MAX_LEN_KEY 0x0B #define SHICP_DISCOVER_PSWD_MAX_LEN_KEY 0x0C /* Keys of the parameters associated with configuration messages. */ #define SHICP_CONFIG_IP_KEY 0x00 #define SHICP_CONFIG_SN_KEY 0x01 #define SHICP_CONFIG_GW_KEY 0x02 #define SHICP_CONFIG_DNS1_KEY 0x03 #define SHICP_CONFIG_DNS2_KEY 0x04 #define SHICP_CONFIG_DHCP_KEY 0x05 #define SHICP_CONFIG_HN_KEY 0x06 #define SHICP_CONFIG_PSWD_KEY 0x07 /* The types of messages supported. */ static const value_string message_types[] = { {SHICP_DISCOVER_MSG_TYPE, "Discover"}, {SHICP_AUTH_CHALLENGE_MSG_TYPE, "Authentication challenge"}, {SHICP_CONFIG_MSG_TYPE, "Configuration"}, {SHICP_WINK_MSG_TYPE, "Wink"}, {SHICP_RESTART_MSG_TYPE, "Restart"}, {SHICP_MASS_RESTART_MSG_TYPE, "Mass-restart"}, {0, NULL} }; /* The error codes that are supported. */ static const value_string error_types[] = { {0x00, "Request was rejected"}, {0x01, "Authentication failed"}, {0x02, "Authentication required"}, {0x03, "Unsupported message type"}, {0x1F, "Hostname too long"}, {0x20, "Password too long"}, {0x21, "Bad config"}, {0, NULL} }; /* The types of restart mode that are supported. */ static const value_string restart_mode_types[] = { {0x00, "Immediate restart"}, {0x01, "Delayed restart"}, {0, NULL} }; static gboolean test_shicp(packet_info* pinfo, tvbuff_t* tvb, int offset, void* data _U_) { /* Check that the port matches the port used by SHICP. */ if (pinfo->destport != SHICP_UDP_PORT) { return FALSE; } /* Check that the length of the message is within allowed boundaries. */ if (tvb_reported_length(tvb) < SHICP_MIN_LENGTH || tvb_reported_length(tvb) > SHICP_MAX_LENGTH) { return FALSE; } /* Check that the header tag starts with 0xABC0. */ if ((tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN) & 0xFFF8) != 0xABC0) { return FALSE; } return TRUE; } static int dissect_shicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item* ti; proto_item* flags_pi; proto_item* error_pi; proto_tree* shicp_tree; guint offset = 0; guint payload_end; guint keyvalue_key = 0; guint keyvalue_length = 0; guint keyvalue_offset = 0; guint keyvalue_end = 0; guint8 supported_message_value = 0; guint16 payload_length = 0; guint32 version = 0; guint32 msgtype_value = 0; guint32 error_value = 0; guint64 flags_value = 0; wmem_strbuf_t* supported_messages = wmem_strbuf_new(pinfo->pool, ""); wmem_strbuf_t* module_addr_strbuf = wmem_strbuf_new(pinfo->pool, ""); static int* flags[] = { &hf_shicp_reserved_flag, &hf_shicp_error_flag, &hf_shicp_msgclass_flag, NULL }; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SHICP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_shicp, tvb, offset, -1, ENC_NA); shicp_tree = proto_item_add_subtree(ti, ett_shicp); proto_item_append_text(ti, ", Src:%s, Dst:%s", address_with_resolution_to_str(pinfo->pool, &pinfo->dl_src), address_with_resolution_to_str(pinfo->pool, &pinfo->dl_dst)); proto_tree_add_item_ret_uint(shicp_tree, hf_shicp_header, tvb, offset, SHICP_HEADER_SIZE, ENC_LITTLE_ENDIAN, &version); proto_tree_add_uint(shicp_tree, hf_shicp_protocol_version, tvb, offset, SHICP_HEADER_SIZE, version & 0x07); offset += SHICP_HEADER_SIZE; proto_tree_add_item(shicp_tree, hf_shicp_dst, tvb, offset, SHICP_ADDRESS_SIZE, ENC_NA); gchar* dst = tvb_address_to_str(pinfo->pool, tvb, AT_ETHER, offset); offset += SHICP_ADDRESS_SIZE; proto_tree_add_item(shicp_tree, hf_shicp_src, tvb, offset, SHICP_ADDRESS_SIZE, ENC_NA); gchar* src = tvb_address_to_str(pinfo->pool, tvb, AT_ETHER, offset); offset += SHICP_ADDRESS_SIZE; flags_pi = proto_tree_add_bitmask_ret_uint64(shicp_tree, tvb, offset, hf_shicp_flags, ett_shicp_flags, flags, ENC_LITTLE_ENDIAN, &flags_value); offset += SHICP_FLAGS_SIZE; proto_tree_add_item_ret_uint(shicp_tree, hf_shicp_msgtype, tvb, offset, SHICP_MSG_TYPE_SIZE, ENC_LITTLE_ENDIAN, &msgtype_value); offset += SHICP_MSG_TYPE_SIZE; payload_length = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); offset += 1; if (flags_value & SHICP_ERROR_FLAG) { proto_item_set_text(flags_pi, "Message flags: 0x%02x (%s, %s)", (guint)flags_value, tfs_get_string(flags_value & SHICP_MSG_CLASS_FLAG, &tfs_response_request), "Error"); if (payload_length != 1) { error_pi = proto_tree_add_string(shicp_tree, hf_shicp_error_string, tvb, offset, 0, "Malformed message"); expert_add_info(pinfo, error_pi, &ei_shicp_malformed); col_append_str(pinfo->cinfo, COL_INFO, "Error: Malformed message"); } else { error_pi = proto_tree_add_item_ret_uint(shicp_tree, hf_shicp_error, tvb, offset, SHICP_ERROR_SIZE, ENC_LITTLE_ENDIAN, &error_value); expert_add_info(pinfo, error_pi, &ei_shicp_error); col_append_fstr(pinfo->cinfo, COL_INFO, "Error: %s", val_to_str(error_value, error_types, "%d")); } } else { proto_item_set_text(flags_pi, "Message flags: 0x%02x (%s)", (guint)flags_value, tfs_get_string(flags_value & SHICP_MSG_CLASS_FLAG, &tfs_response_request)); col_append_fstr(pinfo->cinfo, COL_INFO, "%s, Type: %s", tfs_get_string(flags_value & SHICP_MSG_CLASS_FLAG, &tfs_response_request), val_to_str(msgtype_value, message_types, "%d")); payload_end = offset + payload_length; switch (msgtype_value) { case SHICP_DISCOVER_MSG_TYPE: while (offset < payload_end) { keyvalue_key = tvb_get_guint8(tvb, offset); offset += 1; keyvalue_length = tvb_get_guint8(tvb, offset); offset += 1; switch (keyvalue_key) { case SHICP_DISCOVER_AUTH_REQ_KEY: proto_tree_add_item(shicp_tree, hf_shicp_auth_req, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_MODULE_VERSION_KEY: proto_tree_add_item(shicp_tree, hf_shicp_module_version, tvb, offset, keyvalue_length, ENC_ASCII | ENC_NA); break; case SHICP_DISCOVER_MODULE_DESC_KEY: proto_tree_add_item(shicp_tree, hf_shicp_module_desc, tvb, offset, keyvalue_length, ENC_ASCII | ENC_NA); break; case SHICP_DISCOVER_SUPPORTED_MSG_KEY: keyvalue_end = offset + keyvalue_length; keyvalue_offset = offset; supported_message_value = tvb_get_guint8(tvb, keyvalue_offset); wmem_strbuf_append(supported_messages, val_to_str(supported_message_value, message_types, "%d")); keyvalue_offset += 1; while (keyvalue_offset < keyvalue_end) { supported_message_value = tvb_get_guint8(tvb, keyvalue_offset); wmem_strbuf_append_printf(supported_messages, ", %s", val_to_str(supported_message_value, message_types, "%d")); keyvalue_offset += 1; } proto_tree_add_string(shicp_tree, hf_shicp_supported_msg, tvb, offset, keyvalue_length, wmem_strbuf_get_str(supported_messages)); break; case SHICP_DISCOVER_IP_KEY: proto_tree_add_item(shicp_tree, hf_shicp_ip, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_SN_KEY: proto_tree_add_item(shicp_tree, hf_shicp_sn, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_GW_KEY: proto_tree_add_item(shicp_tree, hf_shicp_gw, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_DNS1_KEY: proto_tree_add_item(shicp_tree, hf_shicp_dns1, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_DNS2_KEY: proto_tree_add_item(shicp_tree, hf_shicp_dns2, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_DHCP_KEY: proto_tree_add_item(shicp_tree, hf_shicp_dhcp, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_HN_KEY: proto_tree_add_item(shicp_tree, hf_shicp_hn, tvb, offset, keyvalue_length, ENC_ASCII | ENC_NA); break; case SHICP_DISCOVER_HN_MAX_LEN_KEY: proto_tree_add_item(shicp_tree, hf_shicp_hn_max_len, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_DISCOVER_PSWD_MAX_LEN_KEY: proto_tree_add_item(shicp_tree, hf_shicp_pswd_max_len, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; default: break; } offset += keyvalue_length; } break; case SHICP_AUTH_CHALLENGE_MSG_TYPE: if (payload_length >= 5) { proto_tree_add_item(shicp_tree, hf_shicp_challenge, tvb, offset, SHICP_CHALLENGE_SIZE, ENC_LITTLE_ENDIAN); offset += SHICP_CHALLENGE_SIZE; proto_tree_add_item(shicp_tree, hf_shicp_validity_period, tvb, offset, SHICP_VALIDITY_PERIOD_SIZE, ENC_LITTLE_ENDIAN); } break; case SHICP_CONFIG_MSG_TYPE: if (payload_length >= SHICP_TOKEN_SIZE) { proto_tree_add_item(shicp_tree, hf_shicp_token, tvb, offset, SHICP_TOKEN_SIZE, ENC_NA); offset += SHICP_TOKEN_SIZE; } else if (payload_length == SHICP_ERROR_SIZE) { proto_tree_add_item(shicp_tree, hf_shicp_error, tvb, offset, SHICP_ERROR_SIZE, ENC_ASCII | ENC_NA); break; } while (offset < payload_end) { keyvalue_key = tvb_get_guint8(tvb, offset); offset += 1; keyvalue_length = tvb_get_guint8(tvb, offset); offset += 1; switch (keyvalue_key) { case SHICP_CONFIG_IP_KEY: proto_tree_add_item(shicp_tree, hf_shicp_ip, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_CONFIG_SN_KEY: proto_tree_add_item(shicp_tree, hf_shicp_sn, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_CONFIG_GW_KEY: proto_tree_add_item(shicp_tree, hf_shicp_gw, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_CONFIG_DNS1_KEY: proto_tree_add_item(shicp_tree, hf_shicp_dns1, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_CONFIG_DNS2_KEY: proto_tree_add_item(shicp_tree, hf_shicp_dns2, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_CONFIG_DHCP_KEY: proto_tree_add_item(shicp_tree, hf_shicp_dhcp, tvb, offset, keyvalue_length, ENC_LITTLE_ENDIAN); break; case SHICP_CONFIG_HN_KEY: proto_tree_add_item(shicp_tree, hf_shicp_hn, tvb, offset, keyvalue_length, ENC_ASCII | ENC_NA); break; case SHICP_CONFIG_PSWD_KEY: proto_tree_add_item(shicp_tree, hf_shicp_pswd, tvb, offset, keyvalue_length, ENC_ASCII | ENC_NA); break; default: break; } offset += keyvalue_length; } break; case SHICP_WINK_MSG_TYPE: if (payload_length >= SHICP_TOKEN_SIZE + SHICP_WINK_TYPE_SIZE) { proto_tree_add_item(shicp_tree, hf_shicp_token, tvb, offset, SHICP_TOKEN_SIZE, ENC_NA); offset += SHICP_TOKEN_SIZE; proto_tree_add_item(shicp_tree, hf_shicp_wink_type, tvb, offset, SHICP_WINK_TYPE_SIZE, ENC_LITTLE_ENDIAN); } break; case SHICP_RESTART_MSG_TYPE: if (payload_length >= SHICP_TOKEN_SIZE + SHICP_RESTART_MODE_SIZE) { proto_tree_add_item(shicp_tree, hf_shicp_token, tvb, offset, SHICP_TOKEN_SIZE, ENC_NA); offset += SHICP_TOKEN_SIZE; proto_tree_add_item(shicp_tree, hf_shicp_restart_mode, tvb, offset, SHICP_RESTART_MODE_SIZE, ENC_LITTLE_ENDIAN); } break; default: break; } } wmem_strbuf_append(module_addr_strbuf, (flags_value & SHICP_MSG_CLASS_FLAG) ? src : dst); if (strcmp(wmem_strbuf_get_str(module_addr_strbuf), "ff:ff:ff:ff:ff:ff") != 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ", Module MAC address: %s", wmem_strbuf_get_str(module_addr_strbuf)); } return tvb_captured_length(tvb); } static guint get_shicp_len(packet_info* pinfo _U_, tvbuff_t* tvb, int offset _U_, void* data _U_) { return (guint)tvb_reported_length(tvb); } static gboolean dissect_shicp_heur_udp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data) { return (udp_dissect_pdus(tvb, pinfo, tree, SHICP_FIXED_LEN, test_shicp, get_shicp_len, dissect_shicp, data) != 0); } void proto_register_shicp(void) { expert_module_t* expert_shicp; static hf_register_info hf[] = { { &hf_shicp_header, { "Header", "shicp.header", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_protocol_version, { "Protocol version", "shicp.protocolversion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_dst, { "Destination", "shicp.dst", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_src, { "Source", "shicp.src", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_flags, { "Message flags", "shicp.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_reserved_flag, { "Reserved", "shicp.flags.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0xFC, NULL, HFILL } }, { &hf_shicp_error_flag, { "Error", "shicp.flags.error", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL } }, { &hf_shicp_msgclass_flag, { "Class", "shicp.flags.msgclass", FT_BOOLEAN, 8, TFS(&tfs_response_request), 0x01, NULL, HFILL } }, { &hf_shicp_msgtype, { "Message type", "shicp.msgtype", FT_UINT8, BASE_HEX, VALS(message_types), 0x0, NULL, HFILL } }, { &hf_shicp_error, { "Error", "shicp.error", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_error_string, { "Error", "shicp.error.string", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_auth_req, { "Authentication required", "shicp.authreq", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x0, NULL, HFILL } }, { &hf_shicp_module_version, { "Module version", "shicp.moduleversion", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_module_desc, { "Module description", "shicp.moduledesc", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_supported_msg, { "Supported messages", "shicp.supportedmsg", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_ip, { "IP address", "shicp.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_sn, { "Subnet mask", "shicp.sn", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_gw, { "Gateway address", "shicp.gw", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_dns1, { "Primary DNS address", "shicp.dns1", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_dns2, { "Secondary DNS address", "shicp.dns2", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_dhcp, { "DHCP", "shicp.dhcp", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x0, NULL, HFILL } }, { &hf_shicp_hn, { "Hostname", "shicp.hn", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_hn_max_len, { "Hostname max length", "shicp.hnmaxlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_pswd_max_len, { "Password max length", "shicp.pswdmaxlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_challenge, { "Challenge", "shicp.challenge", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_validity_period, { "Validity period (seconds)", "shicp.validityperiod", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_token, { "Authentication token", "shicp.token", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_pswd, { "Password", "shicp.pswd", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_wink_type, { "Wink type", "shicp.winktype", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shicp_restart_mode, { "Restart mode", "shicp.restartmode", FT_UINT8, BASE_HEX, VALS(restart_mode_types), 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_shicp, &ett_shicp_flags }; /* Setup protocol expert items */ static ei_register_info ei[] = { { &ei_shicp_error, { "shicp.expert.error", PI_RESPONSE_CODE, PI_NOTE, "Message contains an error code", EXPFILL } }, { &ei_shicp_malformed, { "shicp.malformed", PI_MALFORMED, PI_WARN, "Malformed message", EXPFILL } } }; proto_shicp = proto_register_protocol( "Secure Host IP Configuration Protocol", "SHICP", "shicp"); proto_register_field_array(proto_shicp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_shicp = expert_register_protocol(proto_shicp); expert_register_field_array(expert_shicp, ei, array_length(ei)); } void proto_reg_handoff_shicp(void) { heur_dissector_add("udp", dissect_shicp_heur_udp, "SHICP over UDP", "shicp_udp", proto_shicp, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-shim6.c
/* packet-shim6.c * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * RFC 5533 * * SHIM6 support added by Matthijs Mekking <[email protected]> */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/proto_data.h> #include <epan/in_cksum.h> #include <epan/ipproto.h> #include "packet-ip.h" void proto_register_shim6(void); void proto_reg_handoff_shim6(void); /* SHIM6 header */ struct ip6_shim { guint8 ip6s_nxt; /* next header */ guint8 ip6s_len; /* header extension length */ guint8 ip6s_p; /* P field and first 7 bits of remainder */ /* followed by shim6 specific data*/ }; /* SHIM6 control message types */ #define SHIM6_TYPE_I1 0x01 /* 0 000 0001 */ #define SHIM6_TYPE_R1 0x02 /* 0 000 0010 */ #define SHIM6_TYPE_I2 0x03 /* 0 000 0011 */ #define SHIM6_TYPE_R2 0x04 /* 0 000 0100 */ #define SHIM6_TYPE_R1BIS 0x05 /* 0 000 0101 */ #define SHIM6_TYPE_I2BIS 0x06 /* 0 000 0110 */ #define SHIM6_TYPE_UPD_REQ 0x40 /* 0 100 0000 = 64 */ #define SHIM6_TYPE_UPD_ACK 0x41 /* 0 100 0001 = 65 */ #define SHIM6_TYPE_KEEPALIVE 0x42 /* 0 100 0010 = 66 */ #define SHIM6_TYPE_PROBE 0x43 /* 0 100 0011 = 67 */ /* SHIM6 Options */ #define SHIM6_OPT_RESPVAL 0x01 /* 0 000 0001 */ #define SHIM6_OPT_LOCLIST 0x02 /* 0 000 0010 */ #define SHIM6_OPT_LOCPREF 0x03 /* 0 000 0011 */ #define SHIM6_OPT_CGAPDM 0x04 /* 0 000 0100 */ #define SHIM6_OPT_CGASIG 0x05 /* 0 000 0101 */ #define SHIM6_OPT_ULIDPAIR 0x06 /* 0 000 0110 */ #define SHIM6_OPT_FII 0x07 /* 0 000 0111 */ /* SHIM6 Bitmasks */ #define SHIM6_BITMASK_P 0x80 /* 1 000 0000 */ #define SHIM6_BITMASK_TYPE 0x7F /* 0 111 1111 */ #define SHIM6_BITMASK_PROTOCOL 0x01 /* 0 000 0001 */ #define SHIM6_BITMASK_SPECIFIC 0xFE /* 1 111 1110 */ #define SHIM6_BITMASK_R 0x80 /* 1 000 0000 */ #define SHIM6_BITMASK_CT 0x7F /* 0 111 1111 */ #define SHIM6_BITMASK_OPT_TYPE 0xFFFE /* 1 111 1111 1 111 1110 */ #define SHIM6_BITMASK_CRITICAL 0x01 /* 0 000 0001 */ #define SHIM6_BITMASK_PRECVD 0xF0 /* 1 111 0000 */ #define SHIM6_BITMASK_PSENT 0x0F /* 0 000 1111 */ #define SHIM6_BITMASK_STA 0xC0 /* 1 100 0000 */ /* SHIM6 Verification Methods */ #define SHIM6_VERIF_HBA 0x01 /* 0 000 0001 */ #define SHIM6_VERIF_CGA 0x02 /* 0 000 0010 */ /* SHIM6 Flags */ #define SHIM6_FLAG_BROKEN 0x01 /* 0 000 0001 */ #define SHIM6_FLAG_TEMPORARY 0x02 /* 0 000 0010 */ /* SHIM6 REAP States */ #define SHIM6_REAP_OPERATIONAL 0x00 /* 0 000 0000 */ #define SHIM6_REAP_EXPLORING 0x01 /* 0 000 0001 */ #define SHIM6_REAP_INBOUNDOK 0x02 /* 0 000 0010 */ static int proto_shim6 = -1; static int hf_shim6_nxt = -1; static int hf_shim6_len = -1; static int hf_shim6_len_oct = -1; static int hf_shim6_p = -1; /* context tag is 49 bits, cannot be used for filter yet */ static int hf_shim6_ct = -1; static int hf_shim6_type = -1; static int hf_shim6_proto = -1; static int hf_shim6_checksum = -1; static int hf_shim6_checksum_status= -1; static int hf_shim6_inonce = -1; /* also for request nonce */ static int hf_shim6_rnonce = -1; static int hf_shim6_reserved = -1; static int hf_shim6_reserved2 = -1; static int hf_shim6_precvd = -1; static int hf_shim6_psent = -1; static int hf_shim6_psrc = -1; static int hf_shim6_pdst = -1; static int hf_shim6_pnonce = -1; static int hf_shim6_pdata = -1; static int hf_shim6_sulid = -1; static int hf_shim6_rulid = -1; static int hf_shim6_reap = -1; static int hf_shim6_opt_type = -1; static int hf_shim6_opt_len = -1; static int hf_shim6_opt_total_len = -1; static int hf_shim6_opt_loc_verif_methods = -1; static int hf_shim6_opt_critical = -1; static int hf_shim6_opt_loclist = -1; static int hf_shim6_locator = -1; static int hf_shim6_loc_flag = -1; static int hf_shim6_loc_prio = -1; static int hf_shim6_loc_weight = -1; static int hf_shim6_opt_locnum = -1; static int hf_shim6_opt_elemlen = -1; static int hf_shim6_opt_fii = -1; static int hf_shim6_validator = -1; static int hf_shim6_cga_parameter_data_structure = -1; static int hf_shim6_cga_signature = -1; static int hf_shim6_padding = -1; static gint ett_shim6_proto = -1; static gint ett_shim6_option = -1; static gint ett_shim6_locators = -1; static gint ett_shim6_verif_methods = -1; static gint ett_shim6_loc_pref = -1; static gint ett_shim6_probes_sent = -1; static gint ett_shim6_probe_sent = -1; static gint ett_shim6_probes_rcvd = -1; static gint ett_shim6_probe_rcvd = -1; static gint ett_shim6_cksum = -1; static expert_field ei_shim6_opt_elemlen_invalid = EI_INIT; static expert_field ei_shim6_checksum_bad = EI_INIT; static const value_string shimoptvals[] = { { SHIM6_OPT_RESPVAL, "Responder Validator Option" }, { SHIM6_OPT_LOCLIST, "Locator List Option" }, { SHIM6_OPT_LOCPREF, "Locator Preferences Option" }, { SHIM6_OPT_CGAPDM, "CGA Parameter Data Structure Option" }, { SHIM6_OPT_CGASIG, "CGA Signature Option" }, { SHIM6_OPT_ULIDPAIR, "ULID Pair Option" }, { SHIM6_OPT_FII, "Forked Instance Identifier Option" }, { 0, NULL } }; static const value_string shimverifmethods[] = { { SHIM6_VERIF_HBA, "HBA" }, { SHIM6_VERIF_CGA, "CGA" }, { 0, NULL } }; static const value_string shimflags[] _U_ = { { SHIM6_FLAG_BROKEN, "BROKEN" }, { SHIM6_FLAG_TEMPORARY, "TEMPORARY" }, { 0, NULL } }; static const value_string shimreapstates[] = { { SHIM6_REAP_OPERATIONAL, "Operational" }, { SHIM6_REAP_EXPLORING, "Exploring" }, { SHIM6_REAP_INBOUNDOK, "InboundOK" }, { 0, NULL } }; static const value_string shim6_protocol[] = { { 0, "SHIM6" }, { 1, "HIP" }, { 0, NULL } }; static void dissect_shim6_opt_loclist(proto_tree * opt_tree, tvbuff_t * tvb, gint *offset) { proto_tree *subtree; guint count; guint optlen; proto_tree_add_item(opt_tree, hf_shim6_opt_loclist, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; optlen = tvb_get_guint8(tvb, *offset); proto_tree_add_item(opt_tree, hf_shim6_opt_locnum, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; /* Verification Methods */ subtree = proto_tree_add_subtree(opt_tree, tvb, *offset, optlen, ett_shim6_verif_methods, NULL, "Locator Verification Methods"); for (count=0; count < optlen; count++) proto_tree_add_item(subtree, hf_shim6_opt_loc_verif_methods, tvb, *offset+count, 1, ENC_BIG_ENDIAN); *offset += optlen; /* Padding, included in length field */ if ((7 - optlen % 8) > 0) { proto_tree_add_item(opt_tree, hf_shim6_padding, tvb, *offset, (7 - optlen % 8), ENC_NA); *offset += (7 - optlen % 8); } /* Locators */ subtree = proto_tree_add_subtree(opt_tree, tvb, *offset, 16 * optlen, ett_shim6_locators, NULL, "Locators"); for (count=0; count < optlen; count++) { proto_tree_add_item(subtree, hf_shim6_locator, tvb, *offset, 16, ENC_NA); *offset += 16; } } static void dissect_shim6_opt_loc_pref(proto_tree * opt_tree, tvbuff_t * tvb, gint *offset, gint len, packet_info *pinfo) { proto_tree *subtree; gint optlen; gint count; proto_tree_add_item(opt_tree, hf_shim6_opt_loclist, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; optlen = tvb_get_guint8(tvb, *offset); proto_tree_add_item(opt_tree, hf_shim6_opt_elemlen, tvb, *offset, 1, ENC_BIG_ENDIAN); if (optlen < 1 || optlen > 3) { proto_tree_add_expert_format(opt_tree, pinfo, &ei_shim6_opt_elemlen_invalid, tvb, *offset, 1, "Invalid element length: %u", optlen); return; } *offset += 1; /* Locator Preferences */ count = 1; while (*offset < len) { subtree = proto_tree_add_subtree_format(opt_tree, tvb, *offset, optlen, ett_shim6_loc_pref, NULL, "Locator Preferences %u", count); /* Flags */ if (optlen >= 1) proto_tree_add_item(subtree, hf_shim6_loc_flag, tvb, *offset, 1, ENC_BIG_ENDIAN); /* Priority */ if (optlen >= 2) proto_tree_add_item(subtree, hf_shim6_loc_prio, tvb, *offset+1, 1, ENC_BIG_ENDIAN); /* Weight */ if (optlen >= 3) proto_tree_add_item(subtree, hf_shim6_loc_weight, tvb, *offset+2, 1, ENC_BIG_ENDIAN); /* * Shim6 Draft 08 doesn't specify the format when the Element length is * more than three, except that any such formats MUST be defined so that * the first three octets are the same as in the above case, that is, a * of a 1 octet flags field followed by a 1 octet priority field, and a * 1 octet weight field. */ *offset += optlen; count++; } } static int dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo) { int len, total_len; gint padding; proto_tree *opt_tree; proto_item *ti; offset += 4; len = tvb_get_ntohs(tvb, offset+2); padding = 7 - ((len + 3) % 8); total_len = 4 + len + padding; if (tree) { /* Option Type */ opt_tree = proto_tree_add_subtree(tree, tvb, offset, total_len, ett_shim6_option, NULL, val_to_str_const( (tvb_get_ntohs(tvb, offset) & SHIM6_BITMASK_OPT_TYPE) >> 1, shimoptvals, "Unknown Option Type")); proto_tree_add_item(opt_tree, hf_shim6_opt_type, tvb, offset, 2, ENC_BIG_ENDIAN); /* Critical */ proto_tree_add_item(opt_tree, hf_shim6_opt_critical, tvb, offset+1, 1, ENC_BIG_ENDIAN); /* Content Length */ proto_tree_add_item(opt_tree, hf_shim6_opt_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN); ti = proto_tree_add_uint(opt_tree, hf_shim6_opt_total_len, tvb, offset+2, 2, total_len); proto_item_set_generated(ti); /* Option Type Specific */ switch (tvb_get_ntohs(tvb, offset) >> 1) { case SHIM6_OPT_RESPVAL: proto_tree_add_item(opt_tree, hf_shim6_validator, tvb, offset, len, ENC_NA); offset += len; if (total_len-(len+4) > 0) proto_tree_add_item(opt_tree, hf_shim6_padding, tvb, offset, total_len-(len+4), ENC_NA); break; case SHIM6_OPT_LOCLIST: dissect_shim6_opt_loclist(opt_tree, tvb, &offset); break; case SHIM6_OPT_LOCPREF: dissect_shim6_opt_loc_pref(opt_tree, tvb, &offset, offset+len+4, pinfo); if (total_len-(len+4) > 0) proto_tree_add_item(opt_tree, hf_shim6_padding, tvb, offset, total_len-(len+4), ENC_NA); break; case SHIM6_OPT_CGAPDM: proto_tree_add_item(opt_tree, hf_shim6_cga_parameter_data_structure, tvb, offset, len, ENC_NA); offset += len; if (total_len-(len+4) > 0) proto_tree_add_item(opt_tree, hf_shim6_padding, tvb, offset, total_len-(len+4), ENC_NA); break; case SHIM6_OPT_CGASIG: proto_tree_add_item(opt_tree, hf_shim6_cga_signature, tvb, offset, len, ENC_NA); offset += len; if (total_len-(len+4) > 0) proto_tree_add_item(opt_tree, hf_shim6_padding, tvb, offset, total_len-(len+4), ENC_NA); break; case SHIM6_OPT_ULIDPAIR: proto_tree_add_item(opt_tree, hf_shim6_reserved, tvb, offset, 4, ENC_NA); offset += 4; proto_tree_add_item(opt_tree, hf_shim6_sulid, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(opt_tree, hf_shim6_rulid, tvb, offset, 16, ENC_NA); offset += 16; break; case SHIM6_OPT_FII: proto_tree_add_item(opt_tree, hf_shim6_opt_fii, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; default: break; } } return total_len; } static void dissect_shim6_ct(packet_info *pinfo, proto_tree * shim_tree, gint hf_item, tvbuff_t * tvb, gint offset, const guchar * label) { guint8 tmp[6]; guchar *ct_str; tmp[0] = tvb_get_guint8(tvb, offset++); tmp[1] = tvb_get_guint8(tvb, offset++); tmp[2] = tvb_get_guint8(tvb, offset++); tmp[3] = tvb_get_guint8(tvb, offset++); tmp[4] = tvb_get_guint8(tvb, offset++); tmp[5] = tvb_get_guint8(tvb, offset++); ct_str = wmem_strdup_printf(pinfo->pool, "%s: %02X %02X %02X %02X %02X %02X", label, tmp[0] & SHIM6_BITMASK_CT, tmp[1], tmp[2], tmp[3], tmp[4], tmp[5] ); proto_tree_add_none_format(shim_tree, hf_item, tvb, offset - 6, 6, "%s", ct_str); } static void dissect_shim6_probes(proto_tree * shim_tree, tvbuff_t * tvb, gint offset, const guchar * label, guint nbr_probe, gboolean probes_rcvd) { proto_tree *probes_tree; proto_tree *probe_tree; gint ett_probes; gint ett_probe; guint count; if (probes_rcvd) { ett_probes = ett_shim6_probes_rcvd; ett_probe = ett_shim6_probe_rcvd; } else { ett_probes = ett_shim6_probes_sent; ett_probe = ett_shim6_probe_sent; } probes_tree = proto_tree_add_subtree(shim_tree, tvb, offset, 40 * nbr_probe, ett_probes, NULL, label); for (count=0; count < nbr_probe; count++) { probe_tree = proto_tree_add_subtree_format(probes_tree, tvb, offset, 40, ett_probe, NULL, "Probe %u", count+1); proto_tree_add_item(probe_tree, hf_shim6_psrc, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(probe_tree, hf_shim6_pdst, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(probe_tree, hf_shim6_pnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(probe_tree, hf_shim6_pdata, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } /* Dissect SHIM6 data: control messages */ static int dissect_shimctrl(packet_info *pinfo, tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) { guint8 tmp; const gchar *sta; guint probes_sent; guint probes_rcvd; switch (type) { case SHIM6_TYPE_I1: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_R1: proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_I2: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 4, ENC_NA); offset += 4; break; case SHIM6_TYPE_R2: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Responder Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_R1BIS: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Packet Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_I2BIS: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 6, ENC_NA); offset += 6; dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; break; case SHIM6_TYPE_UPD_REQ: case SHIM6_TYPE_UPD_ACK: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_KEEPALIVE: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 4, ENC_NA); offset += 4; break; case SHIM6_TYPE_PROBE: dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); offset += 6; tmp = tvb_get_guint8(tvb, offset); probes_sent = tmp & SHIM6_BITMASK_PSENT; probes_rcvd = (tmp & SHIM6_BITMASK_PRECVD) >> 4; proto_tree_add_item(shim_tree, hf_shim6_psent, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(shim_tree, hf_shim6_precvd, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; sta = val_to_str_const((tvb_get_guint8(tvb, offset) & SHIM6_BITMASK_STA) >> 6, shimreapstates, "Unknown REAP State"); proto_tree_add_uint_format_value(shim_tree, hf_shim6_reap, tvb, offset, 1, (tvb_get_guint8(tvb, offset) & SHIM6_BITMASK_STA) >> 6, "%s", sta); proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 3, ENC_NA); offset += 3; /* Probes Sent */ if (probes_sent) { dissect_shim6_probes(shim_tree, tvb, offset, "Probes Sent", probes_sent, FALSE); offset += 40 * probes_sent; } /* Probes Received */ if (probes_rcvd) { dissect_shim6_probes(shim_tree, tvb, offset, "Probes Received", probes_rcvd, TRUE); offset += 40 * probes_rcvd; } break; default: break; } return offset; } /* Dissect SHIM6 data: payload, common part, options */ static const value_string shimctrlvals[] = { { SHIM6_TYPE_I1, "I1" }, { SHIM6_TYPE_R1, "R1" }, { SHIM6_TYPE_I2, "I2" }, { SHIM6_TYPE_R2, "R2" }, { SHIM6_TYPE_R1BIS, "R1bis" }, { SHIM6_TYPE_I2BIS, "I2bis" }, { SHIM6_TYPE_UPD_REQ, "Update Request" }, { SHIM6_TYPE_UPD_ACK, "Update Acknowledgment" }, { SHIM6_TYPE_KEEPALIVE, "Keepalive" }, { SHIM6_TYPE_PROBE, "Probe" }, { 0, NULL } }; static int dissect_shim6(tvbuff_t *tvb, packet_info * pinfo, proto_tree *tree, void* data) { struct ip6_shim shim; int offset = 0, len; proto_tree *shim_tree, *root_tree; proto_item *ti, *ti_len; guint8 tmp[5]; tvbuff_t *next_tvb; tvb_memcpy(tvb, (guint8 *)&shim, offset, sizeof(shim)); len = (shim.ip6s_len + 1) << 3; if (shim.ip6s_p & SHIM6_BITMASK_P) { col_append_sep_str(pinfo->cinfo, COL_INFO, " , ", "Shim6 (Payload)"); } else { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " , ", "Shim6 (%s)", val_to_str_const(shim.ip6s_p & SHIM6_BITMASK_TYPE, shimctrlvals, "Unknown")); } root_tree = p_ipv6_pinfo_select_root(pinfo, tree); p_ipv6_pinfo_add_len(pinfo, len); ti = proto_tree_add_item(root_tree, proto_shim6, tvb, offset, len, ENC_NA); shim_tree = proto_item_add_subtree(ti, ett_shim6_proto); /* Next Header */ proto_tree_add_uint_format_value(shim_tree, hf_shim6_nxt, tvb, offset, 1, shim.ip6s_nxt, "%s (%u)", ipprotostr(shim.ip6s_nxt), shim.ip6s_nxt); offset += 1; /* Header Extension Length */ ti_len = proto_tree_add_item(shim_tree, hf_shim6_len, tvb, offset, 1, ENC_BIG_ENDIAN); ti = proto_tree_add_uint(shim_tree, hf_shim6_len_oct, tvb, offset, 1, len); proto_item_append_text(ti, " bytes"); proto_item_set_generated(ti); proto_item_set_hidden(ti); proto_item_append_text(ti_len, " (%d bytes)", len); offset += 1; /* P Field */ proto_tree_add_item(shim_tree, hf_shim6_p, tvb, offset, 1, ENC_BIG_ENDIAN); if (shim.ip6s_p & SHIM6_BITMASK_P) { tmp[0] = tvb_get_guint8(tvb, offset+1); tmp[1] = tvb_get_guint8(tvb, offset+2); tmp[2] = tvb_get_guint8(tvb, offset+3); tmp[3] = tvb_get_guint8(tvb, offset+4); tmp[4] = tvb_get_guint8(tvb, offset+5); /* Payload Extension Header */ proto_tree_add_none_format(shim_tree, hf_shim6_ct, tvb, offset, 6, "Receiver Context Tag: %02x %02x %02x %02x %02x %02x", shim.ip6s_p & SHIM6_BITMASK_CT, tmp[0], tmp[1], tmp[2], tmp[3], tmp[4]); } else { /* Control Message */ guint16 csum; int advance; /* Message Type */ proto_tree_add_item(shim_tree, hf_shim6_type, tvb, offset, 1, ENC_BIG_ENDIAN); /* Protocol bit (Must be zero for SHIM6) */ proto_tree_add_item(shim_tree, hf_shim6_proto, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Checksum */ csum = ip_checksum_tvb(tvb, 0, len); proto_tree_add_checksum(shim_tree, tvb, offset, hf_shim6_checksum, hf_shim6_checksum_status, &ei_shim6_checksum_bad, pinfo, csum, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM); if (csum != 0) col_append_str(pinfo->cinfo, COL_INFO, " [Shim6 CHECKSUM INCORRECT]"); offset += 2; /* Type specific data */ advance = dissect_shimctrl(pinfo, tvb, offset, shim.ip6s_p & SHIM6_BITMASK_TYPE, shim_tree); offset += advance; /* Options */ while (offset < len) { offset += dissect_shimopts(tvb, offset, shim_tree, pinfo); } } next_tvb = tvb_new_subset_remaining(tvb, len); ipv6_dissect_next(shim.ip6s_nxt, next_tvb, pinfo, tree, (ws_ip6 *)data); return tvb_captured_length(tvb); } void proto_register_shim6(void) { static hf_register_info hf_shim6[] = { { &hf_shim6_nxt, { "Next Header", "shim6.nxt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_len, { "Length", "shim6.len", FT_UINT8, BASE_DEC, NULL, 0x0, "Extension header length in 8-octet words (minus 1)", HFILL } }, { &hf_shim6_len_oct, { "Length", "shim6.len_oct", FT_UINT16, BASE_DEC, NULL, 0x0, "Extension header length in octets", HFILL } }, { &hf_shim6_p, { "P Bit", "shim6.p", FT_BOOLEAN, 8, NULL, SHIM6_BITMASK_P, NULL, HFILL } }, { &hf_shim6_ct, { "Context Tag", "shim6.ct", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_type, { "Message Type", "shim6.type", FT_UINT8, BASE_DEC, VALS(shimctrlvals), SHIM6_BITMASK_TYPE, NULL, HFILL } }, { &hf_shim6_proto, { "Protocol", "shim6.proto", FT_UINT8, BASE_DEC, VALS(shim6_protocol), SHIM6_BITMASK_PROTOCOL, NULL, HFILL } }, { &hf_shim6_checksum, { "Checksum", "shim6.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "Shim6 Checksum", HFILL } }, { &hf_shim6_checksum_status, { "Checksum Status", "shim6.checksum.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL } }, { &hf_shim6_inonce, { "Initiator Nonce", "shim6.inonce", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_rnonce, { "Responder Nonce", "shim6.rnonce", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_reserved, { "Reserved", "shim6.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_reserved2, { "Reserved2", "shim6.reserved2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_precvd, { "Probes Received", "shim6.precvd", FT_UINT8, BASE_DEC, NULL, SHIM6_BITMASK_PRECVD, NULL, HFILL } }, { &hf_shim6_psent, { "Probes Sent", "shim6.psent", FT_UINT8, BASE_DEC, NULL, SHIM6_BITMASK_PSENT, NULL, HFILL } }, { &hf_shim6_psrc, { "Source Address", "shim6.psrc", FT_IPv6, BASE_NONE, NULL, 0x0, "Shim6 Probe Source Address", HFILL } }, { &hf_shim6_pdst, { "Destination Address", "shim6.pdst", FT_IPv6, BASE_NONE, NULL, 0x0, "Shim6 Probe Destination Address", HFILL } }, { &hf_shim6_pnonce, { "Nonce", "shim6.pnonce", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Shim6 Probe Nonce", HFILL } }, { &hf_shim6_pdata, { "Data", "shim6.pdata", FT_UINT32, BASE_HEX, NULL, 0x0, "Shim6 Probe Data", HFILL } }, { &hf_shim6_sulid, { "Sender ULID", "shim6.sulid", FT_IPv6, BASE_NONE, NULL, 0x0, "Shim6 Sender ULID", HFILL } }, { &hf_shim6_rulid, { "Receiver ULID", "shim6.rulid", FT_IPv6, BASE_NONE, NULL, 0x0, "Shim6 Receiver ULID", HFILL } }, { &hf_shim6_reap, { "REAP State", "shim6.reap", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_opt_type, { "Option Type", "shim6.opt.type", FT_UINT16, BASE_DEC, VALS(shimoptvals), SHIM6_BITMASK_OPT_TYPE, "Shim6 Option Type", HFILL } }, { &hf_shim6_opt_critical, { "Option Critical Bit", "shim6.opt.critical", FT_BOOLEAN, 8, TFS(&tfs_yes_no), SHIM6_BITMASK_CRITICAL, "TRUE: option is critical, FALSE: option is not critical", HFILL } }, { &hf_shim6_opt_len, { "Content Length", "shim6.opt.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Content Length Option", HFILL } }, { &hf_shim6_opt_total_len, { "Total Length", "shim6.opt.total_len", FT_UINT16, BASE_DEC, NULL, 0x0, "Total Option Length", HFILL } }, { &hf_shim6_opt_loc_verif_methods, { "Verification Method", "shim6.opt.verif_method", FT_UINT8, BASE_DEC, VALS(shimverifmethods), 0x0, "Locator Verification Method", HFILL } }, { &hf_shim6_opt_loclist, { "Locator List Generation", "shim6.opt.loclist", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_locator, { "Locator", "shim6.locator", FT_IPv6, BASE_NONE, NULL, 0x0, "Shim6 Locator", HFILL } }, { &hf_shim6_opt_locnum, { "Num Locators", "shim6.opt.locnum", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of locators in Locator List", HFILL } }, { &hf_shim6_opt_elemlen, { "Element Length", "shim6.opt.elemlen", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of Elements in Locator Preferences Option", HFILL } }, { &hf_shim6_loc_flag, { "Flags", "shim6.loc.flags", FT_UINT8, BASE_DEC, NULL, 0x0, "Locator Preferences Flags", HFILL } }, { &hf_shim6_loc_prio, { "Priority", "shim6.loc.prio", FT_UINT8, BASE_DEC, NULL, 0x0, "Locator Preferences Priority", HFILL } }, { &hf_shim6_loc_weight, { "Weight", "shim6.loc.weight", FT_UINT8, BASE_DEC, NULL, 0x0, "Locator Preferences Weight", HFILL } }, { &hf_shim6_opt_fii, { "Forked Instance Identifier", "shim6.opt.fii", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_validator, { "Validator", "shim6.validator", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_cga_parameter_data_structure, { "CGA Parameter Data Structure", "shim6.cga_parameter_data_structure", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_cga_signature, { "CGA Signature", "shim6.cga_signature", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_shim6_padding, { "Padding", "shim6.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; static gint *ett_shim6[] = { &ett_shim6_proto, &ett_shim6_option, &ett_shim6_locators, &ett_shim6_verif_methods, &ett_shim6_loc_pref, &ett_shim6_probes_sent, &ett_shim6_probes_rcvd, &ett_shim6_probe_sent, &ett_shim6_probe_rcvd, &ett_shim6_cksum }; static ei_register_info ei_shim6[] = { { &ei_shim6_opt_elemlen_invalid, { "shim6.opt.elemlen.invalid", PI_MALFORMED, PI_ERROR, "Invalid element length", EXPFILL } }, { &ei_shim6_checksum_bad, { "shim6.checksum_bad.expert", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL } } }; expert_module_t* expert_shim6; proto_shim6 = proto_register_protocol("Shim6 Protocol", "Shim6", "shim6"); proto_register_field_array(proto_shim6, hf_shim6, array_length(hf_shim6)); proto_register_subtree_array(ett_shim6, array_length(ett_shim6)); expert_shim6 = expert_register_protocol(proto_shim6); expert_register_field_array(expert_shim6, ei_shim6, array_length(ei_shim6)); } void proto_reg_handoff_shim6(void) { dissector_handle_t shim6_handle; shim6_handle = create_dissector_handle(dissect_shim6, proto_shim6); dissector_add_uint("ip.proto", IP_PROTO_SHIM6, shim6_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-sigcomp.c
/* packet-sigcomp.c * Routines for Signaling Compression (SigComp) dissection. * Copyright 2004-2005, Anders Broman <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * References: * https://www.ietf.org/rfc/rfc3320 * https://www.ietf.org/rfc/rfc3321 * https://www.ietf.org/rfc/rfc4077 * Useful links : * https://tools.ietf.org/html/draft-ietf-rohc-sigcomp-impl-guide-10 * https://tools.ietf.org/html/draft-ietf-rohc-sigcomp-sip-01 */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/to_str.h> #include <epan/strutil.h> #include <epan/exceptions.h> #include <wsutil/wsgcrypt.h> #include <wsutil/crc16.h> #include <wsutil/pow2.h> void proto_register_sigcomp(void); void proto_reg_handoff_sigcomp(void); /* Initialize the protocol and registered fields */ static int proto_sigcomp = -1; static int proto_raw_sigcomp = -1; static int hf_sigcomp_t_bit = -1; static int hf_sigcomp_len = -1; static int hf_sigcomp_returned_feedback_item = -1; static int hf_sigcomp_returned_feedback_item_len = -1; static int hf_sigcomp_code_len = -1; static int hf_sigcomp_destination = -1; static int hf_sigcomp_partial_state = -1; static int hf_sigcomp_remaining_message_bytes = -1; static int hf_sigcomp_compression_ratio = -1; static int hf_sigcomp_udvm_bytecode = -1; static int hf_sigcomp_udvm_instr = -1; static int hf_udvm_multitype_bytecode = -1; static int hf_udvm_reference_bytecode = -1; static int hf_udvm_literal_bytecode = -1; /* static int hf_udvm_operand = -1; */ static int hf_udvm_length = -1; static int hf_udvm_addr_length = -1; static int hf_udvm_destination = -1; static int hf_udvm_addr_destination = -1; static int hf_udvm_at_address = -1; static int hf_udvm_address = -1; static int hf_udvm_literal_num = -1; static int hf_udvm_value = -1; static int hf_udvm_addr_value = -1; static int hf_partial_identifier_start = -1; static int hf_partial_identifier_length = -1; static int hf_state_begin = -1; static int hf_udvm_state_length = -1; static int hf_udvm_state_length_addr = -1; static int hf_udvm_state_address = -1; static int hf_udvm_state_address_addr = -1; static int hf_udvm_state_instr = -1; static int hf_udvm_operand_1 = -1; static int hf_udvm_operand_2 = -1; static int hf_udvm_operand_2_addr = -1; static int hf_udvm_j = -1; static int hf_udvm_addr_j = -1; static int hf_udvm_output_start = -1; static int hf_udvm_addr_output_start = -1; static int hf_udvm_output_length = -1; static int hf_udvm_output_length_addr = -1; static int hf_udvm_req_feedback_loc = -1; static int hf_udvm_min_acc_len = -1; static int hf_udvm_state_ret_pri = -1; static int hf_udvm_ret_param_loc = -1; static int hf_udvm_position = -1; static int hf_udvm_ref_dest = -1; static int hf_udvm_bits = -1; static int hf_udvm_lower_bound = -1; static int hf_udvm_upper_bound = -1; static int hf_udvm_uncompressed = -1; static int hf_udvm_offset = -1; static int hf_udvm_addr_offset = -1; static int hf_udvm_start_value = -1; static int hf_udvm_execution_trace = -1; static int hf_sigcomp_nack_ver = -1; static int hf_sigcomp_nack_reason_code = -1; static int hf_sigcomp_nack_failed_op_code = -1; static int hf_sigcomp_nack_pc = -1; static int hf_sigcomp_nack_sha1 = -1; static int hf_sigcomp_nack_state_id = -1; static int hf_sigcomp_nack_memory_size = -1; static int hf_sigcomp_nack_cycles_per_bit = -1; static int hf_sigcomp_decompress_instruction = -1; static int hf_sigcomp_loading_result = -1; static int hf_sigcomp_byte_copy = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_sigcomp_accessing_state = -1; static int hf_sigcomp_getting_value = -1; static int hf_sigcomp_load_bytecode_into_udvm_start = -1; static int hf_sigcomp_instruction_code = -1; static int hf_sigcomp_current_instruction = -1; static int hf_sigcomp_decompression_failure = -1; static int hf_sigcomp_wireshark_udvm_diagnostic = -1; static int hf_sigcomp_calculated_sha_1 = -1; static int hf_sigcomp_copying_value = -1; static int hf_sigcomp_storing_value = -1; static int hf_sigcomp_loading_value = -1; static int hf_sigcomp_set_hu = -1; static int hf_sigcomp_loading_h = -1; static int hf_sigcomp_state_value = -1; static int hf_sigcomp_output_value = -1; static int hf_sigcomp_num_state_create = -1; static int hf_sigcomp_sha1_digest = -1; static int hf_sigcomp_creating_state = -1; static int hf_sigcomp_sigcomp_message_decompressed = -1; static int hf_sigcomp_starting_to_remove_escape_digits = -1; static int hf_sigcomp_escape_digit_found = -1; static int hf_sigcomp_illegal_escape_code = -1; static int hf_sigcomp_end_of_sigcomp_message_indication_found = -1; static int hf_sigcomp_addr_value = -1; static int hf_sigcomp_copying_bytes_literally = -1; static int hf_sigcomp_data_for_sigcomp_dissector = -1; static int hf_sigcomp_remaining_sigcomp_message = -1; static int hf_sigcomp_sha1buff = -1; static int hf_sigcomp_udvm_instruction = -1; static int hf_sigcomp_remaining_bytes = -1; static int hf_sigcomp_max_udvm_cycles = -1; static int hf_sigcomp_used_udvm_cycles = -1; static int hf_sigcomp_udvm_execution_stated = -1; static int hf_sigcomp_message_length = -1; static int hf_sigcomp_byte_code_length = -1; /* Initialize the subtree pointers */ static gint ett_sigcomp = -1; static gint ett_sigcomp_udvm = -1; static gint ett_sigcomp_udvm_exe = -1; static gint ett_raw_text = -1; static expert_field ei_sigcomp_nack_failed_op_code = EI_INIT; static expert_field ei_sigcomp_invalid_instruction = EI_INIT; static expert_field ei_sigcomp_invalid_shift_value = EI_INIT; /* Generated from convert_proto_tree_add_text.pl */ static expert_field ei_sigcomp_tcp_fragment = EI_INIT; static expert_field ei_sigcomp_decompression_failure = EI_INIT; static expert_field ei_sigcomp_failed_to_access_state_wireshark_udvm_diagnostic = EI_INIT; static expert_field ei_sigcomp_all_remaining_parameters_zero = EI_INIT; static expert_field ei_sigcomp_sigcomp_message_decompression_failure = EI_INIT; static expert_field ei_sigcomp_execution_of_this_instruction_is_not_implemented = EI_INIT; static dissector_handle_t sip_handle; static dissector_handle_t sigcomp_handle; static dissector_handle_t sigcomp_tcp_handle; /* set the tcp ports */ #define SIGCOMP_TCP_PORT_RANGE "5555,6666" /* Not IANA registered */ /* Default preference whether to display the bytecode in UDVM operands or not */ static gboolean display_udvm_bytecode = FALSE; /* Default preference whether to dissect the UDVM code or not */ /* WARNING: Setting this to true might result in the entire dissector being disabled by default or removed completely. */ static gboolean dissect_udvm_code = FALSE; static gboolean display_raw_txt = FALSE; /* Default preference whether to decompress the message or not */ /* WARNING: Setting this to true might result in the entire dissector being disabled by default or removed completely. */ static gboolean decompress = FALSE; /* Default preference whether to print debug info at execution of UDVM * 0 = No printout * 1 = details level 1 * 2 = details level 2 * 3 = details level 3 * 4 = details level 4 */ static gint udvm_print_detail_level = 0; /* Value strings */ static const value_string length_encoding_vals[] = { { 0x00, "No partial state (Message type 2)" }, { 0x01, "(6 bytes)" }, { 0x02, "(9 bytes)" }, { 0x03, "(12 bytes)" }, { 0, NULL } }; static const value_string destination_address_encoding_vals[] = { { 0x00, "Reserved" }, { 0x01, "128" }, { 0x02, "192" }, { 0x03, "256" }, { 0x04, "320" }, { 0x05, "384" }, { 0x06, "448" }, { 0x07, "512" }, { 0x08, "576" }, { 0x09, "640" }, { 0x0a, "704" }, { 0x0b, "768" }, { 0x0c, "832" }, { 0x0d, "896" }, { 0x0e, "960" }, { 0x0F, "1024" }, { 0, NULL } }; static value_string_ext destination_address_encoding_vals_ext = VALUE_STRING_EXT_INIT(destination_address_encoding_vals); /* RFC3320 * Figure 10: Bytecode for a multitype (%) operand * Bytecode: Operand value: Range: HEX val * 00nnnnnn N 0 - 63 0x00 * 01nnnnnn memory[2 * N] 0 - 65535 0x40 * 1000011n 2 ^ (N + 6) 64 , 128 0x86 * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 * 111nnnnn N + 65504 65504 - 65535 0xe0 * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 */ static const value_string display_bytecode_vals[] = { { 0x00, "00nnnnnn, N, 0 - 63" }, { 0x40, "01nnnnnn, memory[2 * N],0 - 65535" }, { 0x86, "1000011n, 2 ^ (N + 6), 64 , 128" }, { 0x88, "10001nnn, 2 ^ (N + 8), 256,..., 32768" }, { 0xe0, "111nnnnn N + 65504, 65504 - 65535" }, { 0x90, "1001nnnn nnnnnnnn, N + 61440, 61440 - 65535" }, { 0xa0, "101nnnnn nnnnnnnn, N, 0 - 8191" }, { 0xc0, "110nnnnn nnnnnnnn, memory[N], 0 - 65535" }, { 0x80, "10000000 nnnnnnnn nnnnnnnn, N, 0 - 65535" }, { 0x81, "10000001 nnnnnnnn nnnnnnnn, memory[N], 0 - 65535" }, { 0, NULL } }; /* RFC3320 * 0nnnnnnn memory[2 * N] 0 - 65535 * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 */ static const value_string display_ref_bytecode_vals[] = { { 0x00, "0nnnnnnn memory[2 * N] 0 - 65535" }, { 0x80, "10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535" }, { 0xc0, "11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535" }, { 0, NULL } }; /* The simplest operand type is the literal (#), which encodes a * constant integer from 0 to 65535 inclusive. A literal operand may * require between 1 and 3 bytes depending on its value. * Bytecode: Operand value: Range: * 0nnnnnnn N 0 - 127 * 10nnnnnn nnnnnnnn N 0 - 16383 * 11000000 nnnnnnnn nnnnnnnn N 0 - 65535 * * Figure 8: Bytecode for a literal (#) operand * */ static const value_string display_lit_bytecode_vals[] = { { 0x00, "0nnnnnnn N 0 - 127" }, { 0x80, "10nnnnnn nnnnnnnn N 0 - 16383" }, { 0xc0, "11000000 nnnnnnnn nnnnnnnn N 0 - 65535" }, { 0, NULL } }; #define SIGCOMP_NACK_STATE_NOT_FOUND 1 #define SIGCOMP_NACK_CYCLES_EXHAUSTED 2 #define SIGCOMP_NACK_BYTECODES_TOO_LARGE 18 #define SIGCOMP_NACK_ID_NOT_UNIQUE 21 #define SIGCOMP_NACK_STATE_TOO_SHORT 23 static const value_string sigcomp_nack_reason_code_vals[] = { { 1, "STATE_NOT_FOUND" }, /*1 State ID (6 - 20 bytes) */ { 2, "CYCLES_EXHAUSTED" }, /*2 Cycles Per Bit (1 byte) */ { 3, "USER_REQUESTED" }, { 4, "SEGFAULT" }, { 5, "TOO_MANY_STATE_REQUESTS" }, { 6, "INVALID_STATE_ID_LENGTH" }, { 7, "INVALID_STATE_PRIORITY" }, { 8, "OUTPUT_OVERFLOW" }, { 9, "STACK_UNDERFLOW" }, { 10, "BAD_INPUT_BITORDER" }, { 11, "DIV_BY_ZERO" }, { 12, "SWITCH_VALUE_TOO_HIGH" }, { 13, "TOO_MANY_BITS_REQUESTED" }, { 14, "INVALID_OPERAND" }, { 15, "HUFFMAN_NO_MATCH" }, { 16, "MESSAGE_TOO_SHORT" }, { 17, "INVALID_CODE_LOCATION" }, { 18, "BYTECODES_TOO_LARGE" }, /*18 Memory size (2 bytes) */ { 19, "INVALID_OPCODE" }, { 20, "INVALID_STATE_PROBE" }, { 21, "ID_NOT_UNIQUE" }, /*21 State ID (6 - 20 bytes) */ { 22, "MULTILOAD_OVERWRITTEN" }, { 23, "STATE_TOO_SHORT" }, /*23 State ID (6 - 20 bytes) */ { 24, "INTERNAL_ERROR" }, { 25, "FRAMING_ERROR" }, { 0, NULL } }; static value_string_ext sigcomp_nack_reason_code_vals_ext = VALUE_STRING_EXT_INIT(sigcomp_nack_reason_code_vals); static void dissect_udvm_bytecode(tvbuff_t *udvm_tvb, packet_info* pinfo, proto_tree *sigcomp_udvm_tree, guint destination); static int dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, gint offset,gboolean is_addr,gint *start_offset, guint16 *value, gboolean *is_memory_address ); static int dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, gint offset, gint *start_offset, guint16 *value); static int dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, gint offset, gint *start_offset, guint16 *value); static void tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree); static int dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static proto_tree *top_tree; #define UDVM_MEMORY_SIZE 65536 /********************************************************************************************** * * SIGCOMP STATE HANDLER * **********************************************************************************************/ #define STATE_BUFFER_SIZE 20 #define STATE_MIN_ACCESS_LEN 6 /* * Defenitions for: * The Session Initiation Protocol (SIP) and Session Description Protocol * (SDP) Static Dictionary for Signaling Compression (SigComp) * https://www.ietf.org/rfc/rfc3485 */ #define SIP_SDP_STATE_LENGTH 0x12e4 static const guint8 sip_sdp_state_identifier[STATE_BUFFER_SIZE] = { /* -0000, */ 0xfb, 0xe5, 0x07, 0xdf, 0xe5, 0xe6, 0xaa, 0x5a, 0xf2, 0xab, 0xb9, 0x14, 0xce, 0xaa, 0x05, 0xf9, /* -0010, */ 0x9c, 0xe6, 0x1b, 0xa5 }; static const guint8 sip_sdp_static_dictionaty_for_sigcomp[0x12e4] = { /* -0000, */ 0x0d, 0x0a, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, /* -0010, */ 0x3a, 0x20, 0x0d, 0x0a, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x49, 0x6e, 0x66, 0x6f, 0x3a, 0x20, /* -0020, */ 0x0d, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a, 0x20, 0x0d, 0x0a, 0x43, /* -0030, */ 0x61, 0x6c, 0x6c, 0x2d, 0x49, 0x6e, 0x66, 0x6f, 0x3a, 0x20, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, /* -0040, */ 0x79, 0x2d, 0x54, 0x6f, 0x3a, 0x20, 0x0d, 0x0a, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x3a, /* -0050, */ 0x20, 0x0d, 0x0a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x3b, 0x68, 0x61, 0x6e, /* -0060, */ 0x64, 0x6c, 0x69, 0x6e, 0x67, 0x3d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x3b, 0x70, 0x75, 0x72, 0x70, /* -0070, */ 0x6f, 0x73, 0x65, 0x3d, 0x3b, 0x63, 0x61, 0x75, 0x73, 0x65, 0x3d, 0x3b, 0x74, 0x65, 0x78, 0x74, /* -0080, */ 0x3d, 0x63, 0x61, 0x72, 0x64, 0x33, 0x30, 0x30, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* -0090, */ 0x65, 0x20, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x6d, 0x69, 0x6d, 0x65, 0x73, 0x73, 0x61, /* -00A0, */ 0x67, 0x65, 0x2f, 0x73, 0x69, 0x70, 0x66, 0x72, 0x61, 0x67, 0x34, 0x30, 0x37, 0x20, 0x50, 0x72, /* -00B0, */ 0x6f, 0x78, 0x79, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, /* -00C0, */ 0x6f, 0x6e, 0x20, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, /* -00D0, */ 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x34, 0x38, 0x34, 0x20, 0x41, 0x64, /* -00E0, */ 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, /* -00F0, */ 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x34, 0x39, /* -0100, */ 0x34, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x41, 0x67, 0x72, 0x65, 0x65, /* -0110, */ 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x65, 0x61, 0x63, /* -0120, */ 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x34, 0x38, 0x31, 0x20, 0x43, 0x61, 0x6c, 0x6c, 0x2f, /* -0130, */ 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x6f, 0x65, 0x73, /* -0140, */ 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x45, 0x78, 0x69, 0x73, 0x74, 0x61, 0x6c, 0x65, 0x3d, 0x35, 0x30, /* -0150, */ 0x30, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, /* -0160, */ 0x6c, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x6f, 0x62, 0x75, 0x73, 0x74, 0x2d, 0x73, 0x6f, 0x72, /* -0170, */ 0x74, 0x69, 0x6e, 0x67, 0x3d, 0x34, 0x31, 0x36, 0x20, 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, /* -0180, */ 0x72, 0x74, 0x65, 0x64, 0x20, 0x55, 0x52, 0x49, 0x20, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x72, /* -0190, */ 0x67, 0x65, 0x6e, 0x63, 0x79, 0x34, 0x31, 0x35, 0x20, 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, /* -01A0, */ 0x72, 0x74, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x20, 0x54, 0x79, 0x70, 0x65, 0x6e, /* -01B0, */ 0x64, 0x69, 0x6e, 0x67, 0x34, 0x38, 0x38, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x41, 0x63, 0x63, 0x65, /* -01C0, */ 0x70, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x48, 0x65, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, /* -01D0, */ 0x64, 0x34, 0x32, 0x33, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x54, 0x6f, /* -01E0, */ 0x6f, 0x20, 0x42, 0x72, 0x69, 0x65, 0x66, 0x72, 0x6f, 0x6d, 0x2d, 0x74, 0x61, 0x67, 0x51, 0x2e, /* -01F0, */ 0x38, 0x35, 0x30, 0x35, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x6f, 0x74, /* -0200, */ 0x20, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x34, 0x30, 0x33, 0x20, 0x46, 0x6f, /* -0210, */ 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x6f, 0x6e, 0x2d, 0x75, 0x72, 0x67, 0x65, 0x6e, 0x74, /* -0220, */ 0x34, 0x32, 0x39, 0x20, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x52, 0x65, 0x66, 0x65, /* -0230, */ 0x72, 0x72, 0x6f, 0x72, 0x20, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x34, 0x32, 0x30, /* -0240, */ 0x20, 0x42, 0x61, 0x64, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x6f, 0x72, /* -0250, */ 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x0d, 0x0a, 0x61, 0x3d, 0x6b, 0x65, 0x79, 0x2d, 0x6d, /* -0260, */ 0x67, 0x6d, 0x74, 0x3a, 0x6d, 0x69, 0x6b, 0x65, 0x79, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, /* -0270, */ 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x35, 0x30, 0x34, 0x20, 0x53, /* -0280, */ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x2d, 0x6f, 0x75, 0x74, 0x6f, 0x2d, /* -0290, */ 0x74, 0x61, 0x67, 0x0d, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, /* -02A0, */ 0x69, 0x6f, 0x6e, 0x2d, 0x49, 0x6e, 0x66, 0x6f, 0x3a, 0x20, 0x44, 0x65, 0x63, 0x20, 0x33, 0x38, /* -02B0, */ 0x30, 0x20, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x53, 0x65, /* -02C0, */ 0x72, 0x76, 0x69, 0x63, 0x65, 0x35, 0x30, 0x33, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, /* -02D0, */ 0x20, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x34, 0x32, 0x31, 0x20, /* -02E0, */ 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, /* -02F0, */ 0x65, 0x64, 0x34, 0x30, 0x35, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x4e, 0x6f, 0x74, /* -0300, */ 0x20, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x34, 0x38, 0x37, 0x20, 0x52, 0x65, 0x71, 0x75, /* -0310, */ 0x65, 0x73, 0x74, 0x20, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x61, 0x75, /* -0320, */ 0x74, 0x68, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x65, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x3d, /* -0330, */ 0x0d, 0x0a, 0x6d, 0x3d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, /* -0340, */ 0x41, 0x75, 0x67, 0x20, 0x35, 0x31, 0x33, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, /* -0350, */ 0x54, 0x6f, 0x6f, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x36, 0x38, 0x37, 0x20, 0x44, 0x69, 0x61, /* -0360, */ 0x6c, 0x6f, 0x67, 0x20, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x33, 0x30, /* -0370, */ 0x32, 0x20, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, /* -0380, */ 0x69, 0x6c, 0x79, 0x33, 0x30, 0x31, 0x20, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, /* -0390, */ 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, /* -03A0, */ 0x74, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x0d, 0x0a, 0x52, 0x65, 0x74, 0x72, 0x79, 0x2d, /* -03B0, */ 0x41, 0x66, 0x74, 0x65, 0x72, 0x3a, 0x20, 0x47, 0x4d, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x34, 0x30, /* -03C0, */ 0x32, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, /* -03D0, */ 0x65, 0x64, 0x0d, 0x0a, 0x61, 0x3d, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x6c, 0x61, 0x6e, /* -03E0, */ 0x64, 0x73, 0x63, 0x61, 0x70, 0x65, 0x34, 0x30, 0x30, 0x20, 0x42, 0x61, 0x64, 0x20, 0x52, 0x65, /* -03F0, */ 0x71, 0x75, 0x65, 0x73, 0x74, 0x72, 0x75, 0x65, 0x34, 0x39, 0x31, 0x20, 0x52, 0x65, 0x71, 0x75, /* -0400, */ 0x65, 0x73, 0x74, 0x20, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x35, 0x30, 0x31, 0x20, 0x4e, /* -0410, */ 0x6f, 0x74, 0x20, 0x49, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x34, 0x30, /* -0420, */ 0x36, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x61, 0x62, 0x6c, 0x65, /* -0430, */ 0x36, 0x30, 0x36, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x61, 0x62, /* -0440, */ 0x6c, 0x65, 0x0d, 0x0a, 0x61, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x62, 0x72, 0x6f, 0x61, 0x64, /* -0450, */ 0x63, 0x61, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x34, 0x39, 0x33, 0x20, 0x55, 0x6e, 0x64, 0x65, 0x63, /* -0460, */ 0x69, 0x70, 0x68, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x0d, 0x0a, 0x4d, 0x49, 0x4d, 0x45, 0x2d, /* -0470, */ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x4d, 0x61, 0x79, 0x20, 0x34, 0x38, 0x32, /* -0480, */ 0x20, 0x4c, 0x6f, 0x6f, 0x70, 0x20, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x0d, 0x0a, /* -0490, */ 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x4a, 0x75, /* -04A0, */ 0x6e, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2d, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2d, 0x6e, 0x65, /* -04B0, */ 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x3d, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x65, /* -04C0, */ 0x72, 0x74, 0x63, 0x70, 0x2d, 0x66, 0x62, 0x34, 0x38, 0x39, 0x20, 0x42, 0x61, 0x64, 0x20, 0x45, /* -04D0, */ 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x73, 0x0d, 0x0a, 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, /* -04E0, */ 0x74, 0x65, 0x64, 0x3a, 0x20, 0x4a, 0x61, 0x6e, 0x20, 0x35, 0x30, 0x32, 0x20, 0x42, 0x61, 0x64, /* -04F0, */ 0x20, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x6d, 0x6f, 0x64, 0x65, 0x2d, 0x63, 0x68, 0x61, /* -0500, */ 0x6e, 0x67, 0x65, 0x2d, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3d, 0x0d, 0x0a, 0x61, 0x3d, 0x6f, /* -0510, */ 0x72, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x73, 0x65, 0x61, 0x73, 0x63, 0x61, 0x70, 0x65, 0x0d, 0x0a, /* -0520, */ 0x61, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, /* -0530, */ 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x33, 0x30, 0x35, /* -0540, */ 0x20, 0x55, 0x73, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x0d, 0x0a, 0x61, 0x3d, 0x74, 0x79, /* -0550, */ 0x70, 0x65, 0x3a, 0x72, 0x65, 0x63, 0x76, 0x6f, 0x6e, 0x6c, 0x79, 0x0d, 0x0a, 0x61, 0x3d, 0x74, /* -0560, */ 0x79, 0x70, 0x65, 0x3a, 0x6d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x0d, 0x0a, 0x6b, 0x3d, 0x70, /* -0570, */ 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x3a, 0x0d, 0x0a, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, /* -0580, */ 0x2d, 0x42, 0x79, 0x3a, 0x20, 0x0d, 0x0a, 0x49, 0x6e, 0x2d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2d, /* -0590, */ 0x54, 0x6f, 0x3a, 0x20, 0x54, 0x52, 0x55, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3a, /* -05A0, */ 0x20, 0x31, 0x38, 0x32, 0x20, 0x51, 0x75, 0x65, 0x75, 0x65, 0x64, 0x41, 0x75, 0x74, 0x68, 0x65, /* -05B0, */ 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, /* -05C0, */ 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x66, 0x72, 0x61, 0x6d, 0x65, /* -05D0, */ 0x72, 0x61, 0x74, 0x65, 0x3a, 0x0d, 0x0a, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x2d, 0x49, 0x6e, 0x66, /* -05E0, */ 0x6f, 0x3a, 0x20, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x6d, 0x61, /* -05F0, */ 0x78, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x3b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x2d, 0x61, 0x66, /* -0600, */ 0x74, 0x65, 0x72, 0x3d, 0x75, 0x61, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x3d, 0x34, /* -0610, */ 0x31, 0x30, 0x20, 0x47, 0x6f, 0x6e, 0x65, 0x0d, 0x0a, 0x52, 0x65, 0x66, 0x65, 0x72, 0x2d, 0x54, /* -0620, */ 0x6f, 0x3a, 0x20, 0x0d, 0x0a, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x0d, /* -0630, */ 0x0a, 0x6d, 0x3d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x71, /* -0640, */ 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x3a, 0x0d, 0x0a, 0x61, 0x3d, 0x73, 0x64, 0x70, 0x6c, 0x61, /* -0650, */ 0x6e, 0x67, 0x3a, 0x0d, 0x0a, 0x61, 0x3d, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3a, 0x0d, /* -0660, */ 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x20, 0x52, 0x45, 0x46, 0x45, 0x52, /* -0670, */ 0x20, 0x69, 0x70, 0x73, 0x65, 0x63, 0x2d, 0x69, 0x6b, 0x65, 0x3b, 0x74, 0x72, 0x61, 0x6e, 0x73, /* -0680, */ 0x70, 0x6f, 0x72, 0x74, 0x3d, 0x0d, 0x0a, 0x61, 0x3d, 0x6b, 0x65, 0x79, 0x77, 0x64, 0x73, 0x3a, /* -0690, */ 0x0d, 0x0a, 0x6b, 0x3d, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34, 0x3a, 0x3b, 0x72, 0x65, 0x66, 0x72, /* -06A0, */ 0x65, 0x73, 0x68, 0x65, 0x72, 0x3d, 0x0d, 0x0a, 0x61, 0x3d, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x3a, /* -06B0, */ 0x0d, 0x0a, 0x6b, 0x3d, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x3a, 0x3b, 0x72, 0x65, 0x63, 0x65, 0x69, /* -06C0, */ 0x76, 0x65, 0x64, 0x3d, 0x3b, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x0d, 0x0a, /* -06D0, */ 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x67, 0x72, 0x6f, 0x75, /* -06E0, */ 0x70, 0x3a, 0x46, 0x41, 0x4c, 0x53, 0x45, 0x3a, 0x20, 0x49, 0x4e, 0x46, 0x4f, 0x20, 0x0d, 0x0a, /* -06F0, */ 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x0d, 0x0a, 0x61, 0x3d, 0x6c, 0x61, 0x6e, 0x67, 0x3a, /* -0700, */ 0x0d, 0x0a, 0x6d, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2d, 0x73, 0x65, /* -0710, */ 0x74, 0x3d, 0x0d, 0x0a, 0x61, 0x3d, 0x74, 0x6f, 0x6f, 0x6c, 0x3a, 0x54, 0x4c, 0x53, 0x75, 0x6e, /* -0720, */ 0x2c, 0x20, 0x0d, 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x63, 0x61, /* -0730, */ 0x74, 0x3a, 0x0d, 0x0a, 0x6b, 0x3d, 0x75, 0x72, 0x69, 0x3a, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, /* -0740, */ 0x79, 0x2d, 0x3b, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x3d, 0x3b, 0x6d, 0x65, 0x74, 0x68, 0x6f, /* -0750, */ 0x64, 0x3d, 0x0d, 0x0a, 0x61, 0x3d, 0x6d, 0x69, 0x64, 0x3a, 0x3b, 0x6d, 0x61, 0x64, 0x64, 0x72, /* -0760, */ 0x3d, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x3d, 0x0d, 0x0a, 0x4d, 0x69, 0x6e, 0x2d, 0x3b, 0x61, /* -0770, */ 0x6c, 0x67, 0x3d, 0x4d, 0x6f, 0x6e, 0x2c, 0x20, 0x54, 0x75, 0x65, 0x2c, 0x20, 0x57, 0x65, 0x64, /* -0780, */ 0x2c, 0x20, 0x46, 0x72, 0x69, 0x2c, 0x20, 0x53, 0x61, 0x74, 0x2c, 0x20, 0x3b, 0x74, 0x74, 0x6c, /* -0790, */ 0x3d, 0x61, 0x75, 0x74, 0x73, 0x3d, 0x0d, 0x0a, 0x72, 0x3d, 0x0d, 0x0a, 0x7a, 0x3d, 0x0d, 0x0a, /* -07A0, */ 0x65, 0x3d, 0x3b, 0x69, 0x64, 0x3d, 0x0d, 0x0a, 0x69, 0x3d, 0x63, 0x72, 0x63, 0x3d, 0x0d, 0x0a, /* -07B0, */ 0x75, 0x3d, 0x3b, 0x71, 0x3d, 0x75, 0x61, 0x73, 0x34, 0x31, 0x34, 0x20, 0x52, 0x65, 0x71, 0x75, /* -07C0, */ 0x65, 0x73, 0x74, 0x2d, 0x55, 0x52, 0x49, 0x20, 0x54, 0x6f, 0x6f, 0x20, 0x4c, 0x6f, 0x6e, 0x67, /* -07D0, */ 0x69, 0x76, 0x65, 0x75, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x75, 0x64, 0x70, 0x72, 0x65, /* -07E0, */ 0x66, 0x65, 0x72, 0x36, 0x30, 0x30, 0x20, 0x42, 0x75, 0x73, 0x79, 0x20, 0x45, 0x76, 0x65, 0x72, /* -07F0, */ 0x79, 0x77, 0x68, 0x65, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x34, 0x38, 0x30, 0x20, /* -0800, */ 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x69, 0x6c, 0x79, 0x20, 0x55, 0x6e, 0x61, 0x76, /* -0810, */ 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x0d, 0x0a, 0x61, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x3a, /* -0820, */ 0x48, 0x2e, 0x33, 0x33, 0x32, 0x30, 0x32, 0x20, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, /* -0830, */ 0x0d, 0x0a, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, /* -0840, */ 0x73, 0x3a, 0x20, 0x0d, 0x0a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, /* -0850, */ 0x6e, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x0d, 0x0a, 0x53, /* -0860, */ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x3a, 0x20, 0x53, 0x65, /* -0870, */ 0x70, 0x20, 0x0d, 0x0a, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x2d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, /* -0880, */ 0x3a, 0x20, 0x46, 0x65, 0x62, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, /* -0890, */ 0x76, 0x65, 0x52, 0x54, 0x50, 0x2f, 0x53, 0x41, 0x56, 0x50, 0x20, 0x52, 0x54, 0x50, 0x2f, 0x41, /* -08A0, */ 0x56, 0x50, 0x46, 0x20, 0x41, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x6f, 0x75, 0x73, 0x69, 0x70, 0x73, /* -08B0, */ 0x3a, 0x0d, 0x0a, 0x61, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x65, 0x6c, /* -08C0, */ 0x3a, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x72, 0x65, 0x63, /* -08D0, */ 0x76, 0x6f, 0x6e, 0x6c, 0x79, 0x0d, 0x0a, 0x61, 0x3d, 0x73, 0x65, 0x6e, 0x64, 0x6f, 0x6e, 0x6c, /* -08E0, */ 0x79, 0x0d, 0x0a, 0x63, 0x3d, 0x49, 0x4e, 0x20, 0x49, 0x50, 0x34, 0x20, 0x0d, 0x0a, 0x52, 0x65, /* -08F0, */ 0x61, 0x73, 0x6f, 0x6e, 0x3a, 0x20, 0x0d, 0x0a, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, 0x20, 0x0d, /* -0900, */ 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x0d, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x3a, 0x20, /* -0910, */ 0x3b, 0x75, 0x73, 0x65, 0x72, 0x3d, 0x0d, 0x0a, 0x62, 0x3d, 0x41, 0x53, 0x20, 0x43, 0x54, 0x20, /* -0920, */ 0x0d, 0x0a, 0x57, 0x57, 0x57, 0x2d, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, /* -0930, */ 0x74, 0x65, 0x3a, 0x20, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x73, /* -0940, */ 0x65, 0x6e, 0x64, 0x72, 0x65, 0x63, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, /* -0950, */ 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* -0960, */ 0x6e, 0x2f, 0x73, 0x64, 0x70, 0x61, 0x74, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x70, 0x61, /* -0970, */ 0x75, 0x74, 0x68, 0x3d, 0x0d, 0x0a, 0x61, 0x3d, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x70, /* -0980, */ 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x74, 0x72, 0x2d, /* -0990, */ 0x69, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x63, 0x3d, 0x34, 0x38, 0x33, 0x20, 0x54, 0x6f, 0x6f, /* -09A0, */ 0x20, 0x4d, 0x61, 0x6e, 0x79, 0x20, 0x48, 0x6f, 0x70, 0x73, 0x6c, 0x69, 0x6e, 0x66, 0x6f, 0x70, /* -09B0, */ 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x3d, 0x36, 0x30, /* -09C0, */ 0x34, 0x20, 0x44, 0x6f, 0x65, 0x73, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x45, 0x78, 0x69, 0x73, 0x74, /* -09D0, */ 0x20, 0x41, 0x6e, 0x79, 0x77, 0x68, 0x65, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3d, /* -09E0, */ 0x0d, 0x0a, 0x0d, 0x0a, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* -09F0, */ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x4d, 0x44, 0x35, 0x38, 0x30, 0x20, 0x50, /* -0A00, */ 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x61, 0x69, 0x6c, /* -0A10, */ 0x75, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x34, 0x32, 0x32, 0x20, 0x53, 0x65, 0x73, /* -0A20, */ 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x54, 0x6f, /* -0A30, */ 0x6f, 0x20, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x31, 0x38, 0x31, 0x20, 0x43, /* -0A40, */ 0x61, 0x6c, 0x6c, 0x20, 0x49, 0x73, 0x20, 0x42, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x6f, 0x72, /* -0A50, */ 0x77, 0x61, 0x72, 0x64, 0x65, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x66, 0x61, 0x69, 0x6c, /* -0A60, */ 0x75, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x3d, 0x53, 0x55, 0x42, 0x53, /* -0A70, */ 0x43, 0x52, 0x49, 0x42, 0x45, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, /* -0A80, */ 0x6f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x70, 0x73, 0x65, 0x63, 0x2d, 0x6d, 0x61, 0x6e, /* -0A90, */ 0x64, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x34, 0x31, 0x33, 0x20, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, /* -0AA0, */ 0x74, 0x20, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x20, 0x54, 0x6f, 0x6f, 0x20, 0x4c, 0x61, 0x72, /* -0AB0, */ 0x67, 0x65, 0x32, 0x65, 0x31, 0x38, 0x33, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, /* -0AC0, */ 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x63, 0x74, 0x70, 0x34, 0x38, 0x36, 0x20, 0x42, /* -0AD0, */ 0x75, 0x73, 0x79, 0x20, 0x48, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, /* -0AE0, */ 0x61, 0x74, 0x65, 0x64, 0x41, 0x4b, 0x41, 0x76, 0x31, 0x2d, 0x4d, 0x44, 0x35, 0x2d, 0x73, 0x65, /* -0AF0, */ 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x6f, 0x6e, 0x65, 0x0d, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, /* -0B00, */ 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x36, 0x30, 0x33, 0x20, 0x44, 0x65, 0x63, /* -0B10, */ 0x6c, 0x69, 0x6e, 0x65, 0x78, 0x74, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x3d, 0x34, 0x38, 0x35, 0x20, /* -0B20, */ 0x41, 0x6d, 0x62, 0x69, 0x67, 0x75, 0x6f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x3d, /* -0B30, */ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* -0B40, */ 0x79, 0x70, 0x65, 0x3a, 0x20, 0x4d, 0x61, 0x72, 0x20, 0x0d, 0x0a, 0x52, 0x65, 0x63, 0x6f, 0x72, /* -0B50, */ 0x64, 0x2d, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x3a, 0x20, 0x4a, 0x75, 0x6c, 0x20, 0x34, 0x30, 0x31, /* -0B60, */ 0x20, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x0d, 0x0a, 0x52, /* -0B70, */ 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x3a, 0x20, 0x0d, 0x0a, 0x74, 0x3d, 0x30, 0x20, 0x30, 0x2e, /* -0B80, */ 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x0d, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x52, /* -0B90, */ 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x20, 0x0d, 0x0a, 0x63, 0x3d, 0x49, 0x4e, 0x20, 0x49, /* -0BA0, */ 0x50, 0x36, 0x20, 0x31, 0x38, 0x30, 0x20, 0x52, 0x69, 0x6e, 0x67, 0x69, 0x6e, 0x67, 0x31, 0x30, /* -0BB0, */ 0x30, 0x20, 0x54, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x76, 0x3d, 0x30, 0x0d, 0x0a, 0x6f, 0x3d, 0x55, /* -0BC0, */ 0x50, 0x44, 0x41, 0x54, 0x45, 0x20, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x20, 0x0d, 0x0a, 0x53, /* -0BD0, */ 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, /* -0BE0, */ 0x6e, 0x41, 0x4d, 0x52, 0x54, 0x50, 0x2f, 0x41, 0x56, 0x50, 0x20, 0x0d, 0x0a, 0x50, 0x72, 0x69, /* -0BF0, */ 0x76, 0x61, 0x63, 0x79, 0x3a, 0x20, 0x0d, 0x0a, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, /* -0C00, */ 0x2d, 0x0d, 0x0a, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x3a, 0x20, 0x0d, 0x0a, 0x61, 0x3d, /* -0C10, */ 0x72, 0x74, 0x70, 0x6d, 0x61, 0x70, 0x3a, 0x0d, 0x0a, 0x6d, 0x3d, 0x76, 0x69, 0x64, 0x65, 0x6f, /* -0C20, */ 0x20, 0x0d, 0x0a, 0x6d, 0x3d, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x20, 0x0d, 0x0a, 0x73, 0x3d, 0x20, /* -0C30, */ 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x3d, 0x63, 0x6f, 0x6e, 0x66, 0x3a, 0x3b, 0x65, /* -0C40, */ 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x3d, 0x0d, 0x0a, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x3a, 0x20, /* -0C50, */ 0x0d, 0x0a, 0x61, 0x3d, 0x66, 0x6d, 0x74, 0x70, 0x3a, 0x0d, 0x0a, 0x61, 0x3d, 0x63, 0x75, 0x72, /* -0C60, */ 0x72, 0x3a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, /* -0C70, */ 0x3a, 0x20, 0x0d, 0x0a, 0x61, 0x3d, 0x64, 0x65, 0x73, 0x3a, 0x0d, 0x0a, 0x52, 0x41, 0x63, 0x6b, /* -0C80, */ 0x3a, 0x20, 0x0d, 0x0a, 0x52, 0x53, 0x65, 0x71, 0x3a, 0x20, 0x42, 0x59, 0x45, 0x20, 0x63, 0x6e, /* -0C90, */ 0x6f, 0x6e, 0x63, 0x65, 0x3d, 0x31, 0x30, 0x30, 0x72, 0x65, 0x6c, 0x75, 0x72, 0x69, 0x3d, 0x71, /* -0CA0, */ 0x6f, 0x70, 0x3d, 0x54, 0x43, 0x50, 0x55, 0x44, 0x50, 0x71, 0x6f, 0x73, 0x78, 0x6d, 0x6c, 0x3b, /* -0CB0, */ 0x6c, 0x72, 0x0d, 0x0a, 0x56, 0x69, 0x61, 0x3a, 0x20, 0x53, 0x49, 0x50, 0x2f, 0x32, 0x2e, 0x30, /* -0CC0, */ 0x2f, 0x54, 0x43, 0x50, 0x20, 0x34, 0x30, 0x38, 0x20, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, /* -0CD0, */ 0x20, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x70, 0x73, 0x69, 0x70, /* -0CE0, */ 0x3a, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, /* -0CF0, */ 0x68, 0x3a, 0x20, 0x4f, 0x63, 0x74, 0x20, 0x0d, 0x0a, 0x56, 0x69, 0x61, 0x3a, 0x20, 0x53, 0x49, /* -0D00, */ 0x50, 0x2f, 0x32, 0x2e, 0x30, 0x2f, 0x55, 0x44, 0x50, 0x20, 0x3b, 0x63, 0x6f, 0x6d, 0x70, 0x3d, /* -0D10, */ 0x73, 0x69, 0x67, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, /* -0D20, */ 0x63, 0x6b, 0x3b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x3d, 0x7a, 0x39, 0x68, 0x47, 0x34, 0x62, /* -0D30, */ 0x4b, 0x0d, 0x0a, 0x4d, 0x61, 0x78, 0x2d, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x73, 0x3a, /* -0D40, */ 0x20, 0x41, 0x70, 0x72, 0x20, 0x53, 0x43, 0x54, 0x50, 0x52, 0x41, 0x43, 0x4b, 0x20, 0x49, 0x4e, /* -0D50, */ 0x56, 0x49, 0x54, 0x45, 0x20, 0x0d, 0x0a, 0x43, 0x61, 0x6c, 0x6c, 0x2d, 0x49, 0x44, 0x3a, 0x20, /* -0D60, */ 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, /* -0D70, */ 0x4b, 0x0d, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x3a, 0x20, 0x0d, 0x0a, 0x43, 0x53, 0x65, 0x71, 0x3a, /* -0D80, */ 0x20, 0x0d, 0x0a, 0x54, 0x6f, 0x3a, 0x20, 0x3b, 0x74, 0x61, 0x67, 0x3d, 0x04, 0x10, 0xdd, 0x10, /* -0D90, */ 0x11, 0x31, 0x0d, 0x11, 0x0a, 0x07, 0x10, 0xb9, 0x0c, 0x10, 0xfe, 0x12, 0x10, 0xe1, 0x06, 0x11, /* -0DA0, */ 0x4e, 0x07, 0x11, 0x4e, 0x03, 0x11, 0x4a, 0x04, 0x11, 0x4a, 0x07, 0x10, 0xb2, 0x08, 0x11, 0x79, /* -0DB0, */ 0x06, 0x11, 0x81, 0x0f, 0x11, 0x22, 0x0b, 0x11, 0x55, 0x06, 0x11, 0x6b, 0x0b, 0x11, 0x60, 0x13, /* -0DC0, */ 0x10, 0xb2, 0x08, 0x11, 0x71, 0x05, 0x11, 0x87, 0x13, 0x10, 0xf7, 0x09, 0x0e, 0x8d, 0x08, 0x0d, /* -0DD0, */ 0xae, 0x0c, 0x10, 0xb9, 0x07, 0x10, 0x8e, 0x03, 0x0d, 0x96, 0x03, 0x10, 0x8a, 0x04, 0x10, 0x8a, /* -0DE0, */ 0x09, 0x0d, 0xd7, 0x0a, 0x0f, 0x12, 0x08, 0x0f, 0x8f, 0x09, 0x0f, 0x8f, 0x08, 0x0d, 0x6c, 0x06, /* -0DF0, */ 0x0e, 0x66, 0x09, 0x0e, 0x6c, 0x0a, 0x0e, 0x6c, 0x06, 0x0f, 0xc6, 0x07, 0x0f, 0xc6, 0x05, 0x11, /* -0E00, */ 0x48, 0x06, 0x11, 0x48, 0x06, 0x0f, 0xbf, 0x07, 0x0f, 0xbf, 0x07, 0x0e, 0x55, 0x06, 0x0f, 0x16, /* -0E10, */ 0x04, 0x0e, 0xf4, 0x03, 0x0e, 0xb1, 0x03, 0x10, 0xa6, 0x09, 0x10, 0x50, 0x03, 0x10, 0xa3, 0x0a, /* -0E20, */ 0x0d, 0xb4, 0x05, 0x0e, 0x36, 0x06, 0x0e, 0xd6, 0x03, 0x0d, 0xf9, 0x11, 0x0e, 0xf8, 0x04, 0x0c, /* -0E30, */ 0xd9, 0x08, 0x0e, 0xea, 0x04, 0x09, 0x53, 0x03, 0x0a, 0x4b, 0x04, 0x0e, 0xe4, 0x10, 0x0f, 0x35, /* -0E40, */ 0x09, 0x0e, 0xe4, 0x08, 0x0d, 0x3f, 0x03, 0x0f, 0xe1, 0x0b, 0x10, 0x01, 0x03, 0x10, 0xac, 0x06, /* -0E50, */ 0x10, 0x95, 0x0c, 0x0e, 0x76, 0x0b, 0x0f, 0xeb, 0x0a, 0x0f, 0xae, 0x05, 0x10, 0x2b, 0x04, 0x10, /* -0E60, */ 0x2b, 0x08, 0x10, 0x7a, 0x10, 0x0f, 0x49, 0x07, 0x0f, 0xb8, 0x09, 0x10, 0x3e, 0x0b, 0x10, 0x0c, /* -0E70, */ 0x07, 0x0f, 0x78, 0x0b, 0x0f, 0x6d, 0x09, 0x10, 0x47, 0x08, 0x10, 0x82, 0x0b, 0x0f, 0xf6, 0x08, /* -0E80, */ 0x10, 0x62, 0x08, 0x0f, 0x87, 0x08, 0x10, 0x6a, 0x04, 0x0f, 0x78, 0x0d, 0x0f, 0xcd, 0x08, 0x0d, /* -0E90, */ 0xae, 0x10, 0x0f, 0x5d, 0x0b, 0x0f, 0x98, 0x14, 0x0d, 0x20, 0x1b, 0x0d, 0x20, 0x04, 0x0d, 0xe0, /* -0EA0, */ 0x14, 0x0e, 0xb4, 0x0b, 0x0f, 0xa3, 0x0b, 0x07, 0x34, 0x0f, 0x0d, 0x56, 0x04, 0x0e, 0xf4, 0x03, /* -0EB0, */ 0x10, 0xaf, 0x07, 0x0d, 0x34, 0x09, 0x0f, 0x27, 0x04, 0x10, 0x9b, 0x04, 0x10, 0x9f, 0x09, 0x10, /* -0EC0, */ 0x59, 0x08, 0x10, 0x72, 0x09, 0x10, 0x35, 0x0a, 0x10, 0x21, 0x0a, 0x10, 0x17, 0x08, 0x0f, 0xe3, /* -0ED0, */ 0x03, 0x10, 0xa9, 0x05, 0x0c, 0xac, 0x04, 0x0c, 0xbd, 0x07, 0x0c, 0xc1, 0x08, 0x0c, 0xc1, 0x09, /* -0EE0, */ 0x0c, 0xf6, 0x10, 0x0c, 0x72, 0x0c, 0x0c, 0x86, 0x04, 0x0d, 0x64, 0x0c, 0x0c, 0xd5, 0x09, 0x0c, /* -0EF0, */ 0xff, 0x1b, 0x0b, 0xfc, 0x11, 0x0c, 0x5d, 0x13, 0x0c, 0x30, 0x09, 0x0c, 0xa4, 0x0c, 0x0c, 0x24, /* -0F00, */ 0x0c, 0x0d, 0x3b, 0x03, 0x0d, 0x1a, 0x03, 0x0d, 0x1d, 0x16, 0x0c, 0x43, 0x09, 0x0c, 0x92, 0x09, /* -0F10, */ 0x0c, 0x9b, 0x0d, 0x0e, 0xcb, 0x04, 0x0d, 0x16, 0x06, 0x0d, 0x10, 0x05, 0x04, 0xf2, 0x0b, 0x0c, /* -0F20, */ 0xe1, 0x05, 0x0b, 0xde, 0x0a, 0x0c, 0xec, 0x13, 0x0b, 0xe3, 0x07, 0x0b, 0xd4, 0x08, 0x0d, 0x08, /* -0F30, */ 0x0c, 0x0c, 0xc9, 0x09, 0x0c, 0x3a, 0x04, 0x0a, 0xe5, 0x0c, 0x0a, 0x23, 0x08, 0x0b, 0x3a, 0x0e, /* -0F40, */ 0x09, 0xab, 0x0f, 0x0e, 0xfa, 0x09, 0x0f, 0x6f, 0x0c, 0x0a, 0x17, 0x0f, 0x09, 0x76, 0x0c, 0x0a, /* -0F50, */ 0x5f, 0x17, 0x0d, 0xe2, 0x0f, 0x07, 0xa8, 0x0a, 0x0f, 0x85, 0x0f, 0x08, 0xd6, 0x0e, 0x09, 0xb9, /* -0F60, */ 0x0b, 0x0a, 0x7a, 0x03, 0x0b, 0xdb, 0x03, 0x08, 0xc1, 0x04, 0x0e, 0xc7, 0x03, 0x08, 0xd3, 0x02, /* -0F70, */ 0x04, 0x8d, 0x08, 0x0b, 0x4a, 0x05, 0x0b, 0x8c, 0x07, 0x0b, 0x61, 0x06, 0x05, 0x48, 0x04, 0x07, /* -0F80, */ 0xf4, 0x05, 0x10, 0x30, 0x04, 0x07, 0x1e, 0x08, 0x07, 0x1e, 0x05, 0x0b, 0x91, 0x10, 0x04, 0xca, /* -0F90, */ 0x09, 0x0a, 0x71, 0x09, 0x0e, 0x87, 0x05, 0x04, 0x98, 0x05, 0x0b, 0x6e, 0x0b, 0x04, 0x9b, 0x0f, /* -0FA0, */ 0x04, 0x9b, 0x07, 0x04, 0x9b, 0x03, 0x04, 0xa3, 0x07, 0x04, 0xa3, 0x10, 0x07, 0x98, 0x09, 0x07, /* -0FB0, */ 0x98, 0x05, 0x0b, 0x73, 0x05, 0x0b, 0x78, 0x05, 0x0b, 0x7d, 0x05, 0x07, 0xb9, 0x05, 0x0b, 0x82, /* -0FC0, */ 0x05, 0x0b, 0x87, 0x05, 0x0b, 0x1d, 0x05, 0x08, 0xe4, 0x05, 0x0c, 0x81, 0x05, 0x0f, 0x44, 0x05, /* -0FD0, */ 0x11, 0x40, 0x05, 0x08, 0x78, 0x05, 0x08, 0x9d, 0x05, 0x0f, 0x58, 0x05, 0x07, 0x3f, 0x05, 0x0c, /* -0FE0, */ 0x6d, 0x05, 0x10, 0xf2, 0x05, 0x0c, 0x58, 0x05, 0x06, 0xa9, 0x04, 0x07, 0xb6, 0x09, 0x05, 0x8c, /* -0FF0, */ 0x06, 0x06, 0x1a, 0x06, 0x0e, 0x81, 0x0a, 0x06, 0x16, 0x0a, 0x0a, 0xc4, 0x07, 0x0b, 0x5a, 0x0a, /* -1000, */ 0x0a, 0xba, 0x03, 0x0b, 0x1b, 0x04, 0x11, 0x45, 0x06, 0x0c, 0x8c, 0x07, 0x05, 0xad, 0x0a, 0x0e, /* -1010, */ 0xda, 0x08, 0x0b, 0x42, 0x0d, 0x09, 0xf7, 0x0b, 0x05, 0x1c, 0x09, 0x11, 0x16, 0x08, 0x05, 0xc9, /* -1020, */ 0x07, 0x0d, 0x86, 0x06, 0x0b, 0xcf, 0x0a, 0x06, 0x4d, 0x04, 0x0b, 0xa2, 0x06, 0x06, 0x8d, 0x08, /* -1030, */ 0x05, 0xe6, 0x08, 0x0e, 0x11, 0x0b, 0x0a, 0x9b, 0x03, 0x0a, 0x04, 0x03, 0x0b, 0xb5, 0x05, 0x10, /* -1040, */ 0xd7, 0x04, 0x09, 0x94, 0x05, 0x0a, 0xe2, 0x03, 0x0b, 0xb2, 0x06, 0x0d, 0x67, 0x04, 0x0d, 0x11, /* -1050, */ 0x08, 0x08, 0xb7, 0x1b, 0x0e, 0x3b, 0x0a, 0x09, 0xa1, 0x14, 0x04, 0x85, 0x15, 0x07, 0x83, 0x15, /* -1060, */ 0x07, 0x6e, 0x0d, 0x09, 0x3d, 0x17, 0x06, 0xae, 0x0f, 0x07, 0xe6, 0x14, 0x07, 0xbe, 0x0d, 0x06, /* -1070, */ 0x0a, 0x0d, 0x09, 0x30, 0x16, 0x06, 0xf2, 0x12, 0x08, 0x1e, 0x21, 0x04, 0xaa, 0x13, 0x10, 0xc5, /* -1080, */ 0x08, 0x0a, 0x0f, 0x1c, 0x0e, 0x96, 0x18, 0x0b, 0xb8, 0x1a, 0x05, 0x95, 0x1a, 0x05, 0x75, 0x11, /* -1090, */ 0x06, 0x3d, 0x16, 0x06, 0xdc, 0x1e, 0x0e, 0x19, 0x16, 0x05, 0xd1, 0x1d, 0x06, 0x20, 0x23, 0x05, /* -10A0, */ 0x27, 0x11, 0x08, 0x7d, 0x11, 0x0d, 0x99, 0x16, 0x04, 0xda, 0x0d, 0x0f, 0x1c, 0x16, 0x07, 0x08, /* -10B0, */ 0x17, 0x05, 0xb4, 0x0d, 0x08, 0xc7, 0x13, 0x07, 0xf8, 0x12, 0x08, 0x57, 0x1f, 0x04, 0xfe, 0x19, /* -10C0, */ 0x05, 0x4e, 0x13, 0x08, 0x0b, 0x0f, 0x08, 0xe9, 0x17, 0x06, 0xc5, 0x13, 0x06, 0x7b, 0x19, 0x05, /* -10D0, */ 0xf1, 0x15, 0x07, 0x44, 0x18, 0x0d, 0xfb, 0x0b, 0x0f, 0x09, 0x1b, 0x0d, 0xbe, 0x12, 0x08, 0x30, /* -10E0, */ 0x15, 0x07, 0x59, 0x04, 0x0b, 0xa6, 0x04, 0x0b, 0xae, 0x04, 0x0b, 0x9e, 0x04, 0x0b, 0x96, 0x04, /* -10F0, */ 0x0b, 0x9a, 0x0a, 0x0a, 0xb0, 0x0b, 0x0a, 0x90, 0x08, 0x0b, 0x32, 0x0b, 0x09, 0x6b, 0x08, 0x0b, /* -1100, */ 0x2a, 0x0b, 0x0a, 0x85, 0x09, 0x0b, 0x12, 0x0a, 0x0a, 0xa6, 0x0d, 0x09, 0xea, 0x13, 0x0d, 0x74, /* -1110, */ 0x14, 0x07, 0xd2, 0x13, 0x09, 0x0b, 0x12, 0x08, 0x42, 0x10, 0x09, 0x5b, 0x12, 0x09, 0x1e, 0x0d, /* -1120, */ 0x0c, 0xb1, 0x0e, 0x0c, 0x17, 0x11, 0x09, 0x4a, 0x0c, 0x0a, 0x53, 0x0c, 0x0a, 0x47, 0x09, 0x0a, /* -1130, */ 0xf7, 0x0e, 0x09, 0xc7, 0x0c, 0x0a, 0x3b, 0x07, 0x06, 0x69, 0x08, 0x06, 0x69, 0x06, 0x09, 0xe3, /* -1140, */ 0x08, 0x0b, 0x52, 0x0a, 0x0a, 0xd8, 0x12, 0x06, 0x57, 0x0d, 0x06, 0x57, 0x07, 0x09, 0xe3, 0x04, /* -1150, */ 0x0a, 0xe9, 0x10, 0x07, 0x30, 0x09, 0x0b, 0x00, 0x0c, 0x0a, 0x2f, 0x05, 0x0a, 0xe9, 0x05, 0x0a, /* -1160, */ 0x6b, 0x06, 0x0a, 0x6b, 0x0a, 0x0a, 0xce, 0x09, 0x0a, 0xee, 0x03, 0x0b, 0xdb, 0x07, 0x0f, 0x7e, /* -1170, */ 0x0a, 0x09, 0x97, 0x0a, 0x06, 0x71, 0x0e, 0x09, 0xd5, 0x17, 0x06, 0x93, 0x07, 0x0e, 0x5c, 0x07, /* -1180, */ 0x0f, 0xda, 0x0a, 0x0f, 0x35, 0x0d, 0x0d, 0xec, 0x0a, 0x09, 0x97, 0x0a, 0x06, 0x71, 0x08, 0x0b, /* -1190, */ 0x22, 0x0f, 0x09, 0x85, 0x06, 0x0b, 0x68, 0x0c, 0x0d, 0x4a, 0x09, 0x0b, 0x09, 0x13, 0x08, 0xf8, /* -11A0, */ 0x15, 0x08, 0xa2, 0x04, 0x0b, 0xaa, 0x0f, 0x05, 0x66, 0x0d, 0x07, 0x23, 0x09, 0x0a, 0x06, 0x0b, /* -11B0, */ 0x0d, 0x4a, 0x0f, 0x04, 0xee, 0x06, 0x04, 0xf8, 0x04, 0x09, 0x2b, 0x04, 0x08, 0x53, 0x07, 0x08, /* -11C0, */ 0xc0, 0x03, 0x11, 0x1f, 0x04, 0x11, 0x1e, 0x07, 0x0d, 0x8c, 0x03, 0x07, 0x34, 0x04, 0x10, 0xdb, /* -11D0, */ 0x03, 0x07, 0x36, 0x03, 0x0d, 0xa9, 0x0d, 0x04, 0x20, 0x0b, 0x04, 0x51, 0x0c, 0x04, 0x3a, 0x04, /* -11E0, */ 0x0b, 0xb8, 0x04, 0x0c, 0x24, 0x04, 0x05, 0x95, 0x04, 0x04, 0x7c, 0x04, 0x05, 0x75, 0x04, 0x04, /* -11F0, */ 0x85, 0x04, 0x09, 0x6b, 0x04, 0x06, 0x3d, 0x06, 0x04, 0x7b, 0x04, 0x06, 0xdc, 0x04, 0x07, 0x83, /* -1200, */ 0x04, 0x0e, 0x19, 0x12, 0x04, 0x00, 0x10, 0x08, 0x8e, 0x10, 0x08, 0x69, 0x0e, 0x04, 0x12, 0x0d, /* -1210, */ 0x04, 0x2d, 0x03, 0x10, 0xb9, 0x04, 0x05, 0xd1, 0x04, 0x07, 0x6e, 0x04, 0x06, 0x20, 0x07, 0x04, /* -1220, */ 0x74, 0x04, 0x0b, 0xfc, 0x0a, 0x04, 0x5c, 0x04, 0x05, 0x27, 0x04, 0x09, 0x3d, 0x04, 0x08, 0x7d, /* -1230, */ 0x04, 0x0f, 0xae, 0x04, 0x0d, 0x99, 0x04, 0x06, 0xae, 0x04, 0x04, 0xda, 0x09, 0x04, 0x09, 0x08, /* -1240, */ 0x11, 0x22, 0x04, 0x0f, 0x1c, 0x04, 0x07, 0xe6, 0x04, 0x0e, 0xcb, 0x05, 0x08, 0xbd, 0x04, 0x07, /* -1250, */ 0x08, 0x04, 0x0f, 0xa3, 0x04, 0x06, 0x57, 0x04, 0x05, 0xb4, 0x04, 0x0f, 0x5d, 0x04, 0x08, 0xc7, /* -1260, */ 0x08, 0x0b, 0xf4, 0x04, 0x07, 0xf8, 0x04, 0x07, 0x30, 0x04, 0x07, 0xbe, 0x04, 0x08, 0x57, 0x05, /* -1270, */ 0x0d, 0x46, 0x04, 0x04, 0xfe, 0x04, 0x06, 0x0a, 0x04, 0x05, 0x4e, 0x04, 0x0e, 0x3b, 0x04, 0x08, /* -1280, */ 0x0b, 0x04, 0x09, 0x30, 0x04, 0x08, 0xe9, 0x05, 0x05, 0xee, 0x04, 0x06, 0xc5, 0x04, 0x06, 0xf2, /* -1290, */ 0x04, 0x06, 0x7b, 0x04, 0x09, 0xa1, 0x04, 0x05, 0xf1, 0x04, 0x08, 0x1e, 0x04, 0x07, 0x44, 0x04, /* -12A0, */ 0x0b, 0xdd, 0x04, 0x0d, 0xfb, 0x04, 0x04, 0xaa, 0x04, 0x0b, 0xe3, 0x07, 0x0e, 0xee, 0x04, 0x0f, /* -12B0, */ 0x09, 0x04, 0x0e, 0xb4, 0x04, 0x0d, 0xbe, 0x04, 0x10, 0xc5, 0x04, 0x08, 0x30, 0x05, 0x0f, 0x30, /* -12C0, */ 0x04, 0x07, 0x59, 0x04, 0x0a, 0x0f, 0x06, 0x0e, 0x61, 0x04, 0x04, 0x81, 0x04, 0x0d, 0xab, 0x04, /* -12D0, */ 0x0d, 0x93, 0x04, 0x11, 0x6b, 0x04, 0x0e, 0x96, 0x05, 0x04, 0x66, 0x09, 0x04, 0x6b, 0x0b, 0x04, /* -12E0, */ 0x46, 0x04, 0x0c, 0xe1 }; /* * Definitions for: * The Presence-Specific Static Dictionary for Signaling * https://www.ietf.org/rfc/rfc5112 */ #define PRESENCE_STATE_LENGTH 0x0d93 static const guint8 presence_state_identifier[STATE_BUFFER_SIZE] = { /* -0000, */ 0xd9, 0x42, 0x29, 0x7d, 0x0b, 0xb3, 0x8f, 0xc0, 0x1d, 0x67, 0x41, 0xd6, 0xb3, 0xb4, 0x81, 0x57, /* -0010, */ 0xac, 0x8e, 0x1b, 0xe0 }; static const guint8 presence_static_dictionary_for_sigcomp[PRESENCE_STATE_LENGTH] = { /* -0000, */ 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x63, 0x65, 0x6e, 0x74, 0x65, /* -0010, */ 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x65, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, /* -0020, */ 0x69, 0x73, 0x67, 0x75, 0x73, 0x74, 0x65, 0x64, 0x69, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, /* -0030, */ 0x61, 0x6c, 0x61, 0x73, 0x74, 0x2d, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3d, 0x68, 0x75, 0x6d, 0x69, /* -0040, */ 0x6c, 0x69, 0x61, 0x74, 0x65, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x61, 0x75, 0x74, 0x6f, /* -0050, */ 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x63, 0x75, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x70, 0x69, 0x72, /* -0060, */ 0x69, 0x74, 0x73, 0x2d, 0x49, 0x4e, 0x44, 0x50, 0x73, 0x65, 0x6e, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, /* -0070, */ 0x79, 0x70, 0x61, 0x74, 0x68, 0x65, 0x61, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x6c, 0x65, 0x73, /* -0080, */ 0x73, 0x6c, 0x65, 0x65, 0x70, 0x79, 0x69, 0x6e, 0x2d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, /* -0090, */ 0x6c, 0x6f, 0x6e, 0x65, 0x6c, 0x79, 0x70, 0x6c, 0x61, 0x79, 0x66, 0x75, 0x6c, 0x6f, 0x77, 0x65, /* -00A0, */ 0x72, 0x74, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x79, 0x65, 0x64, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x66, /* -00B0, */ 0x6f, 0x72, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x3d, 0x63, 0x6f, /* -00C0, */ 0x6e, 0x66, 0x75, 0x73, 0x65, 0x64, 0x76, 0x61, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x63, 0x6c, /* -00D0, */ 0x75, 0x62, 0x75, 0x73, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x69, 0x72, 0x63, /* -00E0, */ 0x72, 0x61, 0x66, 0x74, 0x68, 0x69, 0x72, 0x73, 0x74, 0x79, 0x63, 0x6f, 0x75, 0x72, 0x69, 0x65, /* -00F0, */ 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x68, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, /* -0100, */ 0x66, 0x66, 0x69, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3d, 0x61, 0x72, 0x65, 0x6e, /* -0110, */ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3d, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, /* -0120, */ 0x45, 0x52, 0x77, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x72, 0x75, 0x6d, 0x70, 0x79, 0x70, 0x72, /* -0130, */ 0x65, 0x66, 0x69, 0x78, 0x3d, 0x68, 0x61, 0x6c, 0x66, 0x72, 0x65, 0x69, 0x67, 0x68, 0x74, 0x6d, /* -0140, */ 0x65, 0x61, 0x6e, 0x67, 0x72, 0x79, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x70, /* -0150, */ 0x72, 0x6f, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x3d, /* -0160, */ 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x68, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x79, 0x75, /* -0170, */ 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x70, 0x61, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4d, 0x45, 0x53, /* -0180, */ 0x53, 0x41, 0x47, 0x45, 0x77, 0x6f, 0x72, 0x72, 0x69, 0x65, 0x64, 0x68, 0x75, 0x6d, 0x62, 0x6c, /* -0190, */ 0x65, 0x64, 0x61, 0x69, 0x72, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x73, 0x68, 0x61, 0x6d, 0x65, 0x64, /* -01A0, */ 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x68, 0x75, /* -01B0, */ 0x6e, 0x67, 0x72, 0x79, 0x63, 0x72, 0x61, 0x6e, 0x6b, 0x79, 0x61, 0x6d, 0x61, 0x7a, 0x65, 0x64, /* -01C0, */ 0x61, 0x66, 0x72, 0x61, 0x69, 0x64, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x4e, 0x4f, 0x54, 0x49, /* -01D0, */ 0x46, 0x59, 0x49, 0x4e, 0x56, 0x49, 0x54, 0x45, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x66, 0x72, /* -01E0, */ 0x69, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x73, 0x74, 0x61, 0x6c, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, /* -01F0, */ 0x70, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x5f, 0x61, 0x77, 0x65, 0x62, 0x72, 0x61, 0x76, /* -0200, */ 0x65, 0x71, 0x75, 0x69, 0x65, 0x74, 0x62, 0x6f, 0x72, 0x65, 0x64, 0x50, 0x52, 0x41, 0x43, 0x4b, /* -0210, */ 0x70, 0x72, 0x6f, 0x75, 0x64, 0x66, 0x69, 0x78, 0x65, 0x64, 0x68, 0x6f, 0x74, 0x65, 0x6c, 0x68, /* -0220, */ 0x61, 0x70, 0x70, 0x79, 0x63, 0x61, 0x66, 0x65, 0x63, 0x69, 0x64, 0x3d, 0x62, 0x61, 0x6e, 0x6b, /* -0230, */ 0x6d, 0x69, 0x6e, 0x3d, 0x61, 0x77, 0x61, 0x79, 0x6d, 0x61, 0x78, 0x3d, 0x6d, 0x65, 0x61, 0x6c, /* -0240, */ 0x62, 0x75, 0x73, 0x79, 0x77, 0x6f, 0x72, 0x6b, 0x75, 0x72, 0x6e, 0x3d, 0x63, 0x6f, 0x6c, 0x64, /* -0250, */ 0x68, 0x75, 0x72, 0x74, 0x6a, 0x65, 0x61, 0x6c, 0x6f, 0x75, 0x73, 0x70, 0x69, 0x72, 0x69, 0x74, /* -0260, */ 0x73, 0x2d, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x70, 0x72, 0x6f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, /* -0270, */ 0x6d, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* -0280, */ 0x6f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x66, /* -0290, */ 0x6f, 0x72, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2d, /* -02A0, */ 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x73, /* -02B0, */ 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x3d, 0x68, 0x69, 0x67, 0x68, 0x65, 0x72, /* -02C0, */ 0x74, 0x68, 0x61, 0x6e, 0x78, 0x69, 0x6f, 0x75, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, /* -02D0, */ 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x62, 0x72, 0x65, 0x61, /* -02E0, */ 0x6b, 0x66, 0x61, 0x73, 0x74, 0x61, 0x64, 0x69, 0x75, 0x6d, 0x73, 0x67, 0x2d, 0x74, 0x61, 0x6b, /* -02F0, */ 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x6c, 0x3a, 0x63, 0x69, 0x76, /* -0300, */ 0x69, 0x63, 0x4c, 0x6f, 0x63, 0x6f, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x71, 0x75, /* -0310, */ 0x61, 0x6c, 0x73, 0x74, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x77, 0x61, 0x74, 0x65, 0x72, 0x63, /* -0320, */ 0x72, 0x61, 0x66, 0x74, 0x65, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3a, 0x62, 0x61, 0x73, 0x69, 0x63, /* -0330, */ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, /* -0340, */ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x3d, 0x61, 0x64, 0x64, /* -0350, */ 0x65, 0x64, 0x75, 0x72, 0x69, 0x3d, 0x77, 0x68, 0x61, 0x74, 0x70, 0x65, 0x72, 0x6d, 0x61, 0x6e, /* -0360, */ 0x65, 0x6e, 0x74, 0x2d, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x72, /* -0370, */ 0x61, 0x73, 0x73, 0x65, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x69, /* -0380, */ 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x65, 0x64, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x76, 0x6f, 0x75, /* -0390, */ 0x73, 0x65, 0x6c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x6c, 0x69, 0x65, 0x76, 0x65, 0x64, /* -03A0, */ 0x66, 0x6c, 0x69, 0x72, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x72, /* -03B0, */ 0x75, 0x6c, 0x65, 0x73, 0x65, 0x72, 0x76, 0x63, 0x61, 0x70, 0x73, 0x70, 0x68, 0x65, 0x72, 0x65, /* -03C0, */ 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, /* -03D0, */ 0x3d, 0x62, 0x61, 0x72, 0x72, 0x69, 0x6e, 0x67, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x78, 0x74, /* -03E0, */ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2d, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x69, 0x6d, 0x65, /* -03F0, */ 0x2d, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, /* -0400, */ 0x6c, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x77, 0x69, 0x6c, 0x6c, /* -0410, */ 0x69, 0x6e, 0x67, 0x6e, 0x65, 0x73, 0x73, 0x70, 0x65, 0x63, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x65, /* -0420, */ 0x73, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2d, 0x70, 0x61, 0x63, 0x6b, /* -0430, */ 0x61, 0x67, 0x65, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x65, 0x73, 0x74, /* -0440, */ 0x61, 0x75, 0x72, 0x61, 0x6e, 0x74, 0x72, 0x75, 0x63, 0x6b, 0x70, 0x6c, 0x6d, 0x6f, 0x62, 0x69, /* -0450, */ 0x6c, 0x69, 0x74, 0x79, 0x6a, 0x6f, 0x69, 0x6e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, /* -0460, */ 0x61, 0x74, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, /* -0470, */ 0x67, 0x69, 0x76, 0x65, 0x75, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x61, 0x6e, /* -0480, */ 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, /* -0490, */ 0x2d, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2d, 0x6f, 0x66, /* -04A0, */ 0x2d, 0x77, 0x6f, 0x72, 0x73, 0x68, 0x69, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2d, 0x74, 0x79, 0x70, /* -04B0, */ 0x65, 0x3d, 0x3a, 0x74, 0x69, 0x6d, 0x65, 0x64, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2d, /* -04C0, */ 0x69, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x75, 0x74, /* -04D0, */ 0x72, 0x61, 0x6c, 0x49, 0x4e, 0x46, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x69, 0x65, 0x6d, /* -04E0, */ 0x65, 0x6e, 0x73, 0x2d, 0x52, 0x54, 0x50, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x73, 0x65, 0x72, 0x76, /* -04F0, */ 0x69, 0x63, 0x65, 0x2d, 0x69, 0x64, 0x6c, 0x65, 0x2d, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, /* -0500, */ 0x6c, 0x64, 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, /* -0510, */ 0x6f, 0x72, 0x74, 0x6f, 0x6f, 0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, /* -0520, */ 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x3a, 0x67, 0x65, 0x6f, 0x70, 0x72, 0x69, /* -0530, */ 0x76, 0x31, 0x30, 0x30, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, /* -0540, */ 0x6f, 0x63, 0x2d, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x75, 0x72, 0x70, 0x72, 0x69, /* -0550, */ 0x73, 0x65, 0x64, 0x61, 0x72, 0x6b, 0x75, 0x72, 0x6e, 0x3a, 0x6f, 0x6d, 0x61, 0x3a, 0x78, 0x6d, /* -0560, */ 0x6c, 0x3a, 0x70, 0x72, 0x73, 0x3a, 0x70, 0x69, 0x64, 0x66, 0x3a, 0x6f, 0x6d, 0x61, 0x2d, 0x70, /* -0570, */ 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6f, 0x69, 0x73, 0x79, 0x3a, /* -0580, */ 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2d, 0x73, 0x65, /* -0590, */ 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x64, 0x6f, 0x6f, 0x72, 0x73, 0x63, 0x68, 0x6f, 0x6f, /* -05A0, */ 0x6c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, /* -05B0, */ 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6d, 0x65, 0x65, 0x74, /* -05C0, */ 0x69, 0x6e, 0x67, 0x63, 0x61, 0x6c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x74, 0x6f, 0x72, /* -05D0, */ 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x3a, /* -05E0, */ 0x77, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x66, 0x66, 0x65, 0x6e, 0x64, /* -05F0, */ 0x65, 0x64, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x2d, /* -0600, */ 0x66, 0x6f, 0x72, 0x2d, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x77, 0x61, 0x74, 0x63, 0x68, /* -0610, */ 0x65, 0x72, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63, 0x65, /* -0620, */ 0x2d, 0x69, 0x73, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x77, 0x61, /* -0630, */ 0x79, 0x68, 0x6f, 0x6d, 0x65, 0x70, 0x61, 0x67, 0x65, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, /* -0640, */ 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x70, 0x75, 0x74, /* -0650, */ 0x72, 0x61, 0x76, 0x65, 0x6c, 0x62, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, /* -0660, */ 0x65, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x72, 0x6c, 0x6d, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x75, /* -0670, */ 0x65, 0x3d, 0x3a, 0x63, 0x61, 0x70, 0x73, 0x6c, 0x65, 0x65, 0x70, 0x69, 0x6e, 0x67, 0x75, 0x69, /* -0680, */ 0x6c, 0x74, 0x79, 0x69, 0x6e, 0x76, 0x69, 0x6e, 0x63, 0x69, 0x62, 0x6c, 0x65, 0x76, 0x65, 0x6e, /* -0690, */ 0x74, 0x3d, 0x6d, 0x6f, 0x6f, 0x64, 0x79, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x3d, 0x70, /* -06A0, */ 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x66, 0x72, 0x6f, 0x6d, /* -06B0, */ 0x3d, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x63, 0x61, 0x72, 0x64, 0x70, 0x6f, 0x73, 0x3d, 0x61, 0x75, /* -06C0, */ 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* -06D0, */ 0x6f, 0x74, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, /* -06E0, */ 0x49, 0x44, 0x69, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x69, 0x73, 0x61, 0x70, 0x70, /* -06F0, */ 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x64, 0x6e, 0x6f, 0x74, 0x65, 0x2d, 0x77, 0x65, 0x6c, 0x6c, 0x69, /* -0700, */ 0x62, 0x72, 0x61, 0x72, 0x79, 0x3a, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, /* -0710, */ 0x65, 0x63, 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x63, 0x69, 0x76, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, /* -0720, */ 0x65, 0x73, 0x73, 0x61, 0x72, 0x63, 0x61, 0x73, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* -0730, */ 0x74, 0x65, 0x64, 0x69, 0x6e, 0x64, 0x69, 0x67, 0x6e, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x72, /* -0740, */ 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x68, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x63, 0x6c, 0x61, /* -0750, */ 0x73, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, /* -0760, */ 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x2d, 0x62, 0x79, 0x3a, 0x63, 0x69, 0x70, 0x69, 0x64, /* -0770, */ 0x66, 0x2d, 0x66, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3d, 0x61, 0x63, 0x74, 0x6f, /* -0780, */ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x65, /* -0790, */ 0x72, 0x69, 0x6f, 0x75, 0x73, 0x65, 0x6c, 0x3d, 0x3a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x78, /* -07A0, */ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x3a, 0x72, 0x70, 0x69, 0x64, 0x75, 0x72, 0x6e, 0x3a, 0x69, /* -07B0, */ 0x65, 0x74, 0x66, 0x3a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x78, 0x6d, 0x6c, 0x2d, 0x70, /* -07C0, */ 0x61, 0x74, 0x63, 0x68, 0x2d, 0x6f, 0x70, 0x73, 0x65, 0x63, 0x2d, 0x61, 0x67, 0x72, 0x65, 0x65, /* -07D0, */ 0x61, 0x72, 0x6c, 0x79, 0x2d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x70, 0x61, 0x74, /* -07E0, */ 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x74, 0x68, 0x65, 0x2d, 0x70, 0x68, /* -07F0, */ 0x6f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, /* -0800, */ 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, /* -0810, */ 0x78, 0x63, 0x69, 0x74, 0x65, 0x64, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, /* -0820, */ 0x6f, 0x6e, 0x6f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x70, 0x72, 0x69, 0x6f, /* -0830, */ 0x72, 0x69, 0x74, 0x79, 0x3d, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, /* -0840, */ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x72, 0x6f, 0x6f, 0x6d, 0x75, 0x73, 0x74, 0x55, 0x6e, 0x64, 0x65, /* -0850, */ 0x72, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x2d, 0x6e, 0x61, 0x6d, /* -0860, */ 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, /* -0870, */ 0x6f, 0x6e, 0x73, 0x2d, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x64, 0x70, 0x2d, 0x61, /* -0880, */ 0x6e, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x72, 0x75, 0x65, 0x3a, 0x70, 0x69, /* -0890, */ 0x64, 0x66, 0x2d, 0x64, 0x69, 0x66, 0x66, 0x72, 0x75, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x64, /* -08A0, */ 0x75, 0x70, 0x6c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x63, 0x6f, /* -08B0, */ 0x6e, 0x74, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x68, 0x6f, 0x70, 0x70, /* -08C0, */ 0x69, 0x6e, 0x67, 0x2d, 0x61, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x3d, 0x61, 0x70, 0x70, 0x6f, /* -08D0, */ 0x69, 0x6e, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x3d, 0x61, 0x73, 0x73, 0x6f, 0x63, /* -08E0, */ 0x69, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x69, 0x6e, 0x74, 0x65, /* -08F0, */ 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x65, 0x76, 0x63, 0x61, 0x70, 0x73, 0x74, 0x61, 0x74, 0x75, /* -0900, */ 0x73, 0x3d, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x77, 0x69, /* -0910, */ 0x6e, 0x66, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x72, 0x61, /* -0920, */ 0x6e, 0x73, 0x69, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x68, 0x6f, 0x73, 0x70, 0x69, 0x74, 0x61, 0x6c, /* -0930, */ 0x61, 0x6e, 0x67, 0x3d, 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3d, 0x73, 0x69, 0x63, 0x6b, /* -0940, */ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x3f, 0x3e, 0x63, /* -0950, */ 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x05, 0x0d, 0x34, 0x08, 0x0d, 0x06, 0x09, 0x0c, 0xe3, 0x07, 0x0d, /* -0960, */ 0x48, 0x06, 0x0d, 0x36, 0x13, 0x0b, 0xab, 0x05, 0x09, 0x65, 0x07, 0x0c, 0xd4, 0x08, 0x0d, 0x40, /* -0970, */ 0x05, 0x0d, 0x23, 0x05, 0x0c, 0x35, 0x07, 0x0c, 0xae, 0x05, 0x0d, 0x2f, 0x06, 0x08, 0xb9, 0x05, /* -0980, */ 0x07, 0x2b, 0x04, 0x0d, 0x12, 0x06, 0x0d, 0x4f, 0x09, 0x0c, 0x2c, 0x04, 0x0c, 0x89, 0x04, 0x0a, /* -0990, */ 0xf6, 0x09, 0x0b, 0x57, 0x0b, 0x0b, 0x05, 0x08, 0x0a, 0xda, 0x06, 0x0a, 0xda, 0x06, 0x04, 0x89, /* -09A0, */ 0x05, 0x0b, 0xa6, 0x04, 0x0b, 0x94, 0x06, 0x05, 0x05, 0x07, 0x0b, 0x3f, 0x0e, 0x0b, 0xba, 0x07, /* -09B0, */ 0x0b, 0x98, 0x0a, 0x0c, 0x8d, 0x09, 0x0b, 0x6d, 0x09, 0x0c, 0x8e, 0x0e, 0x0c, 0x48, 0x0a, 0x0c, /* -09C0, */ 0xb2, 0x1d, 0x09, 0x56, 0x0d, 0x0c, 0x38, 0x06, 0x07, 0xba, 0x0b, 0x08, 0xb9, 0x0b, 0x07, 0xec, /* -09D0, */ 0x06, 0x0d, 0x02, 0x0a, 0x0a, 0x46, 0x04, 0x08, 0xf4, 0x06, 0x0b, 0x6a, 0x04, 0x0a, 0xb6, 0x0c, /* -09E0, */ 0x0c, 0x55, 0x08, 0x0a, 0x31, 0x04, 0x0a, 0x92, 0x08, 0x0a, 0x1b, 0x05, 0x0a, 0xb1, 0x04, 0x08, /* -09F0, */ 0xc0, 0x05, 0x0a, 0x27, 0x05, 0x0a, 0xa7, 0x05, 0x0a, 0xac, 0x04, 0x0a, 0xba, 0x04, 0x07, 0xdc, /* -0A00, */ 0x05, 0x08, 0xad, 0x0a, 0x09, 0x29, 0x0a, 0x08, 0xa7, 0x05, 0x0a, 0x56, 0x05, 0x0b, 0x4d, 0x07, /* -0A10, */ 0x09, 0x2a, 0x0d, 0x09, 0xa7, 0x0b, 0x07, 0xa9, 0x06, 0x09, 0xc6, 0x0b, 0x0b, 0x5f, 0x0c, 0x09, /* -0A20, */ 0xdf, 0x0b, 0x09, 0xe0, 0x06, 0x07, 0xcb, 0x0c, 0x0a, 0x0b, 0x09, 0x09, 0x20, 0x08, 0x0a, 0x97, /* -0A30, */ 0x07, 0x09, 0xe0, 0x07, 0x0c, 0xfb, 0x06, 0x0a, 0x8c, 0x0e, 0x09, 0x7f, 0x0a, 0x09, 0x87, 0x0b, /* -0A40, */ 0x0c, 0x71, 0x0a, 0x0c, 0x71, 0x06, 0x07, 0x93, 0x05, 0x0a, 0x66, 0x04, 0x08, 0x67, 0x04, 0x09, /* -0A50, */ 0xba, 0x08, 0x09, 0x20, 0x0a, 0x0b, 0x72, 0x05, 0x0a, 0x72, 0x08, 0x07, 0xb3, 0x0b, 0x0a, 0xc5, /* -0A60, */ 0x07, 0x09, 0xf2, 0x07, 0x08, 0x89, 0x04, 0x08, 0xad, 0x08, 0x0a, 0xbe, 0x06, 0x0c, 0x9f, 0x0b, /* -0A70, */ 0x06, 0xd0, 0x0e, 0x08, 0x26, 0x08, 0x0a, 0x9f, 0x07, 0x09, 0xc6, 0x0a, 0x0c, 0x69, 0x07, 0x08, /* -0A80, */ 0x85, 0x05, 0x0b, 0x7c, 0x07, 0x0a, 0x39, 0x0c, 0x09, 0x34, 0x07, 0x0a, 0x21, 0x09, 0x08, 0x7d, /* -0A90, */ 0x07, 0x0c, 0xf5, 0x0b, 0x0c, 0xa3, 0x14, 0x06, 0xa6, 0x0d, 0x08, 0xb2, 0x0c, 0x07, 0x2a, 0x0c, /* -0AA0, */ 0x08, 0xb3, 0x04, 0x07, 0x56, 0x07, 0x09, 0x1a, 0x04, 0x07, 0x52, 0x07, 0x07, 0x40, 0x05, 0x07, /* -0AB0, */ 0x4d, 0x07, 0x0b, 0x80, 0x06, 0x07, 0x47, 0x16, 0x06, 0x91, 0x08, 0x0c, 0x62, 0x10, 0x09, 0xcf, /* -0AC0, */ 0x10, 0x07, 0xdd, 0x09, 0x0a, 0xf6, 0x09, 0x06, 0xfc, 0x0c, 0x0b, 0x17, 0x07, 0x07, 0x39, 0x04, /* -0AD0, */ 0x06, 0xf8, 0x07, 0x09, 0xa1, 0x06, 0x06, 0x8d, 0x05, 0x07, 0x21, 0x04, 0x0a, 0x55, 0x09, 0x0a, /* -0AE0, */ 0xd2, 0x0c, 0x0a, 0xcf, 0x13, 0x06, 0xc8, 0x0a, 0x08, 0xec, 0x07, 0x0d, 0x06, 0x0b, 0x08, 0x0c, /* -0AF0, */ 0x14, 0x0b, 0xd5, 0x12, 0x07, 0xbe, 0x0d, 0x07, 0xd1, 0x16, 0x08, 0x01, 0x14, 0x0b, 0xf1, 0x06, /* -0B00, */ 0x05, 0xb4, 0x07, 0x04, 0x56, 0x09, 0x04, 0x17, 0x0c, 0x0a, 0xea, 0x09, 0x04, 0x1f, 0x0a, 0x07, /* -0B10, */ 0x7e, 0x0b, 0x07, 0x6a, 0x07, 0x0c, 0x0f, 0x0b, 0x07, 0xa0, 0x0a, 0x0c, 0x96, 0x06, 0x05, 0x28, /* -0B20, */ 0x06, 0x0a, 0x7d, 0x05, 0x06, 0x1f, 0x07, 0x05, 0x8b, 0x0a, 0x04, 0x3c, 0x06, 0x05, 0xae, 0x04, /* -0B30, */ 0x06, 0x50, 0x09, 0x0a, 0xe2, 0x06, 0x05, 0xf6, 0x07, 0x07, 0xfd, 0x09, 0x0b, 0x33, 0x0a, 0x0c, /* -0B40, */ 0xec, 0x0a, 0x0a, 0x83, 0x07, 0x06, 0x54, 0x06, 0x04, 0x90, 0x04, 0x05, 0x3f, 0x05, 0x0a, 0x92, /* -0B50, */ 0x07, 0x07, 0x8a, 0x07, 0x08, 0xcc, 0x08, 0x09, 0xea, 0x07, 0x04, 0x96, 0x05, 0x06, 0x10, 0x08, /* -0B60, */ 0x07, 0x98, 0x0a, 0x06, 0xf1, 0x08, 0x04, 0x79, 0x09, 0x0b, 0x22, 0x07, 0x0b, 0x8e, 0x07, 0x0b, /* -0B70, */ 0x46, 0x04, 0x0d, 0x3c, 0x06, 0x04, 0x80, 0x08, 0x07, 0x12, 0x09, 0x09, 0x4a, 0x07, 0x04, 0xe3, /* -0B80, */ 0x07, 0x05, 0x84, 0x05, 0x09, 0x7a, 0x05, 0x06, 0x01, 0x09, 0x09, 0x12, 0x04, 0x09, 0x52, 0x0d, /* -0B90, */ 0x04, 0xaa, 0x0d, 0x08, 0x56, 0x08, 0x04, 0xdc, 0x07, 0x05, 0x92, 0x05, 0x05, 0x0c, 0x0a, 0x04, /* -0BA0, */ 0x4c, 0x04, 0x06, 0x2c, 0x0b, 0x04, 0xd1, 0x04, 0x06, 0x24, 0x09, 0x0c, 0x40, 0x04, 0x04, 0xce, /* -0BB0, */ 0x0c, 0x08, 0xc1, 0x11, 0x04, 0x00, 0x05, 0x07, 0x34, 0x0a, 0x06, 0x6a, 0x08, 0x0d, 0x28, 0x05, /* -0BC0, */ 0x06, 0x1a, 0x0a, 0x04, 0x28, 0x07, 0x0a, 0xfe, 0x06, 0x04, 0xff, 0x08, 0x09, 0x94, 0x07, 0x05, /* -0BD0, */ 0x76, 0x10, 0x08, 0x98, 0x06, 0x05, 0xf0, 0x06, 0x09, 0x03, 0x10, 0x09, 0x03, 0x09, 0x08, 0x1e, /* -0BE0, */ 0x0a, 0x08, 0x3c, 0x06, 0x09, 0x9b, 0x0d, 0x0c, 0xbb, 0x07, 0x06, 0xe3, 0x05, 0x09, 0xcc, 0x06, /* -0BF0, */ 0x0a, 0x15, 0x07, 0x04, 0x73, 0x05, 0x06, 0x73, 0x0d, 0x06, 0x73, 0x05, 0x08, 0x45, 0x08, 0x0a, /* -0C00, */ 0x29, 0x09, 0x0a, 0x40, 0x05, 0x07, 0x1a, 0x0a, 0x07, 0x1a, 0x09, 0x0b, 0x4f, 0x09, 0x0c, 0xdb, /* -0C10, */ 0x06, 0x05, 0xea, 0x06, 0x05, 0xde, 0x0a, 0x04, 0x0e, 0x0a, 0x0b, 0x0e, 0x09, 0x06, 0x86, 0x08, /* -0C20, */ 0x05, 0x60, 0x0b, 0x07, 0x74, 0x09, 0x05, 0x4f, 0x08, 0x04, 0xf0, 0x07, 0x09, 0x90, 0x06, 0x08, /* -0C30, */ 0x70, 0x0a, 0x0c, 0x21, 0x07, 0x05, 0x6f, 0x0b, 0x0c, 0xcc, 0x04, 0x07, 0x90, 0x07, 0x04, 0xea, /* -0C40, */ 0x0a, 0x08, 0x33, 0x04, 0x06, 0x34, 0x09, 0x06, 0xdc, 0x04, 0x06, 0x40, 0x07, 0x05, 0x2e, 0x04, /* -0C50, */ 0x06, 0x48, 0x06, 0x07, 0x87, 0x07, 0x05, 0x68, 0x0a, 0x0d, 0x1a, 0x07, 0x04, 0x45, 0x07, 0x05, /* -0C60, */ 0x05, 0x08, 0x05, 0x0e, 0x08, 0x05, 0x58, 0x08, 0x04, 0xb6, 0x10, 0x09, 0xf8, 0x04, 0x06, 0x3c, /* -0C70, */ 0x07, 0x09, 0xbc, 0x0c, 0x06, 0xd0, 0x0c, 0x0b, 0xe7, 0x04, 0x06, 0x44, 0x04, 0x0a, 0x31, 0x0b, /* -0C80, */ 0x0c, 0x05, 0x04, 0x06, 0x28, 0x11, 0x07, 0x5a, 0x07, 0x0c, 0xc5, 0x07, 0x05, 0xa0, 0x0c, 0x09, /* -0C90, */ 0x6f, 0x08, 0x0c, 0xbb, 0x08, 0x0a, 0x76, 0x09, 0x08, 0x16, 0x08, 0x08, 0x69, 0x06, 0x05, 0xe4, /* -0CA0, */ 0x09, 0x04, 0x86, 0x07, 0x05, 0x38, 0x06, 0x0a, 0x4f, 0x08, 0x04, 0xc6, 0x0f, 0x08, 0xf4, 0x0b, /* -0CB0, */ 0x04, 0x31, 0x07, 0x0a, 0x04, 0x07, 0x08, 0xa1, 0x0d, 0x0c, 0x55, 0x06, 0x05, 0xc0, 0x06, 0x05, /* -0CC0, */ 0xba, 0x05, 0x05, 0x41, 0x08, 0x0b, 0x87, 0x08, 0x04, 0x89, 0x04, 0x05, 0x35, 0x0c, 0x0a, 0x5a, /* -0CD0, */ 0x09, 0x04, 0x68, 0x09, 0x04, 0x9c, 0x0a, 0x06, 0xba, 0x06, 0x07, 0x0d, 0x05, 0x07, 0x25, 0x09, /* -0CE0, */ 0x0b, 0x9d, 0x09, 0x0a, 0x69, 0x06, 0x0a, 0x6c, 0x04, 0x06, 0x38, 0x04, 0x06, 0x30, 0x07, 0x0d, /* -0CF0, */ 0x13, 0x08, 0x08, 0x4c, 0x05, 0x06, 0x15, 0x06, 0x04, 0x50, 0x0a, 0x07, 0x04, 0x06, 0x07, 0xf7, /* -0D00, */ 0x04, 0x08, 0x49, 0x0f, 0x08, 0x89, 0x0c, 0x09, 0x3f, 0x05, 0x06, 0x81, 0x11, 0x08, 0xdc, 0x0d, /* -0D10, */ 0x04, 0x5c, 0x11, 0x06, 0x5a, 0x05, 0x0d, 0x0e, 0x06, 0x05, 0xd8, 0x04, 0x08, 0xd3, 0x06, 0x05, /* -0D20, */ 0xd2, 0x07, 0x05, 0x7d, 0x06, 0x05, 0xcc, 0x07, 0x08, 0xd6, 0x05, 0x06, 0x0b, 0x07, 0x05, 0xa7, /* -0D30, */ 0x05, 0x05, 0x16, 0x08, 0x05, 0x1a, 0x09, 0x05, 0x46, 0x06, 0x05, 0xc6, 0x06, 0x09, 0x31, 0x0d, /* -0D40, */ 0x0b, 0xcf, 0x09, 0x08, 0x62, 0x08, 0x04, 0xf8, 0x04, 0x08, 0x54, 0x0a, 0x06, 0x7f, 0x04, 0x04, /* -0D50, */ 0x71, 0x0c, 0x0c, 0x16, 0x04, 0x05, 0x2e, 0x08, 0x0b, 0x3f, 0x11, 0x0c, 0x23, 0x08, 0x0c, 0x7b, /* -0D60, */ 0x09, 0x0b, 0xc7, 0x07, 0x07, 0xf6, 0x05, 0x0b, 0x3b, 0x09, 0x08, 0x75, 0x09, 0x0c, 0x81, 0x09, /* -0D70, */ 0x06, 0xe9, 0x0b, 0x09, 0xb0, 0x07, 0x05, 0x22, 0x07, 0x04, 0xa3, 0x07, 0x06, 0xc2, 0x07, 0x05, /* -0D80, */ 0x99, 0x05, 0x06, 0x06, 0x05, 0x05, 0xfc, 0x04, 0x09, 0xc3, 0x04, 0x06, 0x4c, 0x08, 0x04, 0xbe, /* -0D90, */ 0x09, 0x0b, 0x2a }; static GHashTable *state_buffer_table=NULL; static void sigcomp_init_udvm(void) { gchar *partial_state_str; guint8 *sip_sdp_buff, *presence_buff; state_buffer_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, /* key_destroy_func */ g_free); /* value_destroy_func */ /* * Store static dictionaries in hash table */ sip_sdp_buff = (guint8 *)g_malloc(SIP_SDP_STATE_LENGTH + 8); partial_state_str = bytes_to_str(NULL, sip_sdp_state_identifier, 6); memset(sip_sdp_buff, 0, 8); sip_sdp_buff[0] = SIP_SDP_STATE_LENGTH >> 8; sip_sdp_buff[1] = SIP_SDP_STATE_LENGTH & 0xff; memcpy(sip_sdp_buff+8, sip_sdp_static_dictionaty_for_sigcomp, SIP_SDP_STATE_LENGTH); g_hash_table_insert(state_buffer_table, g_strdup(partial_state_str), sip_sdp_buff); wmem_free(NULL, partial_state_str); presence_buff = (guint8 *)g_malloc(PRESENCE_STATE_LENGTH + 8); partial_state_str = bytes_to_str(NULL, presence_state_identifier, 6); memset(presence_buff, 0, 8); presence_buff[0] = PRESENCE_STATE_LENGTH >> 8; presence_buff[1] = PRESENCE_STATE_LENGTH & 0xff; memcpy(presence_buff+8, presence_static_dictionary_for_sigcomp, PRESENCE_STATE_LENGTH); g_hash_table_insert(state_buffer_table, g_strdup(partial_state_str), presence_buff); wmem_free(NULL, partial_state_str); } static void sigcomp_cleanup_udvm(void) { g_hash_table_destroy(state_buffer_table); } static int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_start, guint16 p_id_length, guint16 state_begin, guint16 *state_length, guint16 *state_address, guint16 *state_instruction, gint hf_id) { int result_code = 0; guint32 n; guint16 k; guint16 buf_size_real; guint16 byte_copy_right; guint16 byte_copy_left; char partial_state[STATE_BUFFER_SIZE]; /* Size is 6 - 20 */ guint8 *state_buff; gchar *partial_state_str; /* * Perform initial checks on validity of data * RFC 3320 : * 9.4.5. STATE-ACCESS * : * Decompression failure occurs if partial_identifier_length does not * lie between 6 and 20 inclusive. Decompression failure also occurs if * no state item matching the partial state identifier can be found, if * more than one state item matches the partial identifier, or if * partial_identifier_length is less than the minimum_access_length of * the matched state item. Otherwise, a state item is returned from the * state handler. */ if (( p_id_length < STATE_MIN_ACCESS_LEN ) || ( p_id_length > STATE_BUFFER_SIZE )) { result_code = 1; return result_code; } n = 0; while ( n < p_id_length && n < STATE_BUFFER_SIZE && p_id_start + n < UDVM_MEMORY_SIZE ) { partial_state[n] = buff[p_id_start + n]; n++; } partial_state_str = bytes_to_str(wmem_packet_scope(), partial_state, p_id_length); proto_tree_add_item(tree, hf_sigcomp_accessing_state, tvb, 0, -1, ENC_NA); proto_tree_add_string(tree,hf_id, tvb, 0, 0, partial_state_str); /* Debug * ws_warning("State Access: partial state =%s",partial_state_str); * ws_warning("g_hash_table_lookup = 0x%x",state_buff); * ws_warning("State Access: partial state =%s",partial_state_str); */ state_buff = (guint8 *)g_hash_table_lookup(state_buffer_table, partial_state_str); if ( state_buff == NULL ) { result_code = 2; /* No state match */ return result_code; } /* * sip_sdp_static_dictionaty * * 8.4. Byte copying * : * The string of bytes is copied in ascending order of memory address, * respecting the bounds set by byte_copy_left and byte_copy_right. * More precisely, if a byte is copied from/to Address m then the next * byte is copied from/to Address n where n is calculated as follows: * * Set k := m + 1 (modulo 2^16) * If k = byte_copy_right then set n := byte_copy_left, else set n := k * */ /* * buff = Where "state" will be stored * p_id_start = Partial state identifier start pos in the buffer(buff) * p-id_length = Partial state identifier length * state_begin = Where to start to read state from * state_length = Length of state * state_address = Address where to store the state in the buffer(buff) * state_instruction = * FALSE = Indicates that state_* is in the stored state */ buf_size_real = (state_buff[0] << 8) | state_buff[1]; /* * The value of * state_length MUST be taken from the returned item of state in the * case that the state_length operand is set to 0. * * The same is true of state_address, state_instruction. */ if (*state_length == 0) { *state_length = buf_size_real; } if ( *state_address == 0 ) { *state_address = state_buff[2] << 8; *state_address = *state_address | state_buff[3]; } if ( *state_instruction == 0 ) { *state_instruction = state_buff[4] << 8; *state_instruction = *state_instruction | state_buff[5]; } /* * Decompression failure occurs if bytes are copied from beyond the end of * the state_value. */ if ((state_begin + *state_length) > buf_size_real) { return 3; } /* * Note that decompression failure will always occur if the state_length * operand is set to 0 but the state_begin operand is non-zero. */ if (*state_length == 0 && state_begin != 0) { return 17; } n = state_begin + 8; k = *state_address; /* * NOTE: Strictly speaking, byte_copy_left and byte_copy_right should * not be used if this has been called for bytecode referenced in * the message header. However, since the memory is initialised * to zero, the code works OK. */ byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; /* debug *ws_warning(" state_begin %u state_address %u",state_begin , *state_address); */ while ( (gint32) n < (state_begin + *state_length + 8) && n < UDVM_MEMORY_SIZE ) { buff[k] = state_buff[n]; /* debug ws_warning(" Loading 0x%x at address %u",buff[k] , k); */ k = ( k + 1 ) & 0xffff; if ( k == byte_copy_right ) { k = byte_copy_left; } n++; } return 0; /* * End SIP */ } static void udvm_state_create(guint8 *state_buff,guint8 *state_identifier,guint16 p_id_length) { char partial_state[STATE_BUFFER_SIZE]; guint i; gchar *partial_state_str; gchar *dummy_buff; /* * Debug ws_warning("Received items of state,state_length_buff[0]= %u, state_length_buff[1]= %u", state_length_buff[0],state_length_buff[1]); */ i = 0; while ( i < p_id_length && i < STATE_BUFFER_SIZE ) { partial_state[i] = state_identifier[i]; i++; } partial_state_str = bytes_to_str(NULL, partial_state, p_id_length); dummy_buff = (gchar *)g_hash_table_lookup(state_buffer_table, partial_state_str); if ( dummy_buff == NULL ) { g_hash_table_insert(state_buffer_table, g_strdup(partial_state_str), state_buff); } else { /* The buffer allocated by sigcomp-udvm.c wasn't needed so free it */ g_free(state_buff); } wmem_free(NULL, partial_state_str); } #if 1 static void udvm_state_free(guint8 buff[] _U_,guint16 p_id_start _U_,guint16 p_id_length _U_) { } #else void udvm_state_free(guint8 buff[],guint16 p_id_start,guint16 p_id_length) { char partial_state[STATE_BUFFER_SIZE]; guint i; gchar *partial_state_str; gchar *dummy_buff; i = 0; while ( i < p_id_length && i < STATE_BUFFER_SIZE && p_id_start + i < UDVM_MEMORY_SIZE ) { partial_state[i] = buff[p_id_start + i]; i++; } partial_state_str = bytes_to_str(NULL, partial_state, p_id_length); /* TODO Implement a state create counter before actually freeing states * Hmm is it a good idea to free the buffer at all? * ws_warning("State-free on %s ",partial_state_str); */ dummy_buff = g_hash_table_lookup(state_buffer_table, partial_state_str); if ( dummy_buff != NULL ) { g_hash_table_remove (state_buffer_table, partial_state_str); g_free(dummy_buff); } wmem_free(NULL, partial_state_str); } #endif /********************************************************************************************** * * SIGCOMP DECOMPRESSION * **********************************************************************************************/ #define SIGCOMP_INSTR_DECOMPRESSION_FAILURE 0 #define SIGCOMP_INSTR_AND 1 #define SIGCOMP_INSTR_OR 2 #define SIGCOMP_INSTR_NOT 3 #define SIGCOMP_INSTR_LSHIFT 4 #define SIGCOMP_INSTR_RSHIFT 5 #define SIGCOMP_INSTR_ADD 6 #define SIGCOMP_INSTR_SUBTRACT 7 #define SIGCOMP_INSTR_MULTIPLY 8 #define SIGCOMP_INSTR_DIVIDE 9 #define SIGCOMP_INSTR_REMAINDER 10 #define SIGCOMP_INSTR_SORT_ASCENDING 11 #define SIGCOMP_INSTR_SORT_DESCENDING 12 #define SIGCOMP_INSTR_SHA_1 13 #define SIGCOMP_INSTR_LOAD 14 #define SIGCOMP_INSTR_MULTILOAD 15 #define SIGCOMP_INSTR_PUSH 16 #define SIGCOMP_INSTR_POP 17 #define SIGCOMP_INSTR_COPY 18 #define SIGCOMP_INSTR_COPY_LITERAL 19 #define SIGCOMP_INSTR_COPY_OFFSET 20 #define SIGCOMP_INSTR_MEMSET 21 #define SIGCOMP_INSTR_JUMP 22 #define SIGCOMP_INSTR_COMPARE 23 #define SIGCOMP_INSTR_CALL 24 #define SIGCOMP_INSTR_RETURN 25 #define SIGCOMP_INSTR_SWITCH 26 #define SIGCOMP_INSTR_CRC 27 #define SIGCOMP_INSTR_INPUT_BYTES 28 #define SIGCOMP_INSTR_INPUT_BITS 29 #define SIGCOMP_INSTR_INPUT_HUFFMAN 30 #define SIGCOMP_INSTR_STATE_ACCESS 31 #define SIGCOMP_INSTR_STATE_CREATE 32 #define SIGCOMP_INSTR_STATE_FREE 33 #define SIGCOMP_INSTR_OUTPUT 34 #define SIGCOMP_INSTR_END_MESSAGE 35 static const value_string udvm_instruction_code_vals[] = { { SIGCOMP_INSTR_DECOMPRESSION_FAILURE, "DECOMPRESSION-FAILURE" }, { SIGCOMP_INSTR_AND, "AND" }, { SIGCOMP_INSTR_OR, "OR" }, { SIGCOMP_INSTR_NOT, "NOT" }, { SIGCOMP_INSTR_LSHIFT, "LSHIFT" }, { SIGCOMP_INSTR_RSHIFT, "RSHIFT" }, { SIGCOMP_INSTR_ADD, "ADD" }, { SIGCOMP_INSTR_SUBTRACT, "SUBTRACT" }, { SIGCOMP_INSTR_MULTIPLY, "MULTIPLY" }, { SIGCOMP_INSTR_DIVIDE, "DIVIDE" }, { SIGCOMP_INSTR_REMAINDER, "REMAINDER" }, { SIGCOMP_INSTR_SORT_ASCENDING, "SORT-ASCENDING" }, { SIGCOMP_INSTR_SORT_DESCENDING, "SORT-DESCENDING" }, { SIGCOMP_INSTR_SHA_1, "SHA-1" }, { SIGCOMP_INSTR_LOAD, "LOAD" }, { SIGCOMP_INSTR_MULTILOAD, "MULTILOAD" }, { SIGCOMP_INSTR_PUSH, "PUSH" }, { SIGCOMP_INSTR_POP, "POP" }, { SIGCOMP_INSTR_COPY, "COPY" }, { SIGCOMP_INSTR_COPY_LITERAL, "COPY-LITERAL" }, { SIGCOMP_INSTR_COPY_OFFSET, "COPY-OFFSET" }, { SIGCOMP_INSTR_MEMSET, "MEMSET" }, { SIGCOMP_INSTR_JUMP, "JUMP" }, { SIGCOMP_INSTR_COMPARE, "COMPARE" }, { SIGCOMP_INSTR_CALL, "CALL" }, { SIGCOMP_INSTR_RETURN, "RETURN" }, { SIGCOMP_INSTR_SWITCH, "SWITCH" }, { SIGCOMP_INSTR_CRC, "CRC" }, { SIGCOMP_INSTR_INPUT_BYTES, "INPUT-BYTES" }, { SIGCOMP_INSTR_INPUT_BITS, "INPUT-BITS" }, { SIGCOMP_INSTR_INPUT_HUFFMAN, "INPUT-HUFFMAN" }, { SIGCOMP_INSTR_STATE_ACCESS, "STATE-ACCESS" }, { SIGCOMP_INSTR_STATE_CREATE, "STATE-CREATE" }, { SIGCOMP_INSTR_STATE_FREE, "STATE-FREE" }, { SIGCOMP_INSTR_OUTPUT, "OUTPUT" }, { SIGCOMP_INSTR_END_MESSAGE, "END-MESSAGE" }, { 0, NULL } }; static value_string_ext udvm_instruction_code_vals_ext = VALUE_STRING_EXT_INIT(udvm_instruction_code_vals); /* Internal result code values of decompression failures */ static const value_string result_code_vals[] = { { 0, "No decompression failure" }, { 1, "Partial state length less than 6 or greater than 20 bytes long" }, { 2, "No state match" }, { 3, "state_begin + state_length > size of state" }, { 4, "Operand_2 is Zero" }, { 5, "Switch statement failed j >= n" }, { 6, "Attempt to jump outside of UDVM memory" }, { 7, "L in input-bits > 16" }, { 8, "input_bit_order > 7" }, { 9, "Instruction Decompression failure encountered" }, { 10, "Input huffman failed j > n" }, { 11, "Input bits requested beyond end of message" }, { 12, "more than four state creation requests are made before the END-MESSAGE instruction" }, { 13, "state_retention_priority is 65535" }, { 14, "Input bytes requested beyond end of message" }, { 15, "Maximum number of UDVM cycles reached" }, { 16, "UDVM stack underflow" }, { 17, "state_length is 0, but state_begin is non-zero" }, {255, "This branch isn't coded yet" }, { 0, NULL } }; /* The simplest operand type is the literal (#), which encodes a * constant integer from 0 to 65535 inclusive. A literal operand may * require between 1 and 3 bytes depending on its value. * Bytecode: Operand value: Range: * 0nnnnnnn N 0 - 127 * 10nnnnnn nnnnnnnn N 0 - 16383 * 11000000 nnnnnnnn nnnnnnnn N 0 - 65535 * * Figure 8: Bytecode for a literal (#) operand * */ static int decode_udvm_literal_operand(guint8 *buff,guint operand_address, guint16 *value) { guint bytecode; guint16 operand; guint test_bits; guint offset = operand_address; guint8 temp_data; if (operand_address >= UDVM_MEMORY_SIZE) return -1; bytecode = buff[operand_address]; test_bits = bytecode >> 7; if (test_bits == 1) { test_bits = bytecode >> 6; if (test_bits == 2) { /* * 10nnnnnn nnnnnnnn N 0 - 16383 */ temp_data = buff[operand_address] & 0x1f; operand = temp_data << 8; temp_data = buff[(operand_address + 1) & 0xffff]; operand = operand | temp_data; *value = operand; offset = offset + 2; } else { /* * 111000000 nnnnnnnn nnnnnnnn N 0 - 65535 */ offset ++; temp_data = buff[operand_address] & 0x1f; operand = temp_data << 8; temp_data = buff[(operand_address + 1) & 0xffff]; operand = operand | temp_data; *value = operand; offset = offset + 2; } } else { /* * 0nnnnnnn N 0 - 127 */ operand = ( bytecode & 0x7f); *value = operand; offset ++; } return offset; } /* * The second operand type is the reference ($), which is always used to * access a 2-byte value located elsewhere in the UDVM memory. The * bytecode for a reference operand is decoded to be a constant integer * from 0 to 65535 inclusive, which is interpreted as the memory address * containing the actual value of the operand. * Bytecode: Operand value: Range: * * 0nnnnnnn memory[2 * N] 0 - 65535 * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 * * Figure 9: Bytecode for a reference ($) operand */ static int dissect_udvm_reference_operand_memory(guint8 *buff,guint operand_address, guint16 *value,guint *result_dest) { guint bytecode; guint16 operand; guint offset = operand_address; guint test_bits; guint8 temp_data; guint16 temp_data16; if (operand_address >= UDVM_MEMORY_SIZE) return -1; bytecode = buff[operand_address]; test_bits = bytecode >> 7; if (test_bits == 1) { test_bits = bytecode >> 6; if (test_bits == 2) { /* * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 */ temp_data = buff[operand_address] & 0x3f; operand = temp_data << 8; temp_data = buff[(operand_address + 1) & 0xffff]; operand = operand | temp_data; operand = (operand * 2); *result_dest = operand; temp_data16 = buff[operand] << 8; temp_data16 = temp_data16 | buff[(operand+1) & 0xffff]; *value = temp_data16; offset = offset + 2; } else { /* * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 */ operand_address++; operand = buff[operand_address] << 8; operand = operand | buff[(operand_address + 1) & 0xffff]; *result_dest = operand; temp_data16 = buff[operand] << 8; temp_data16 = temp_data16 | buff[(operand+1) & 0xffff]; *value = temp_data16; offset = offset + 3; } } else { /* * 0nnnnnnn memory[2 * N] 0 - 65535 */ operand = ( bytecode & 0x7f); operand = (operand * 2); *result_dest = operand; temp_data16 = buff[operand] << 8; temp_data16 = temp_data16 | buff[(operand+1) & 0xffff]; *value = temp_data16; offset ++; } if (offset >= UDVM_MEMORY_SIZE || *result_dest >= UDVM_MEMORY_SIZE - 1 ) return -1; return offset; } /* RFC3320 * Figure 10: Bytecode for a multitype (%) operand * Bytecode: Operand value: Range: HEX val * 00nnnnnn N 0 - 63 0x00 * 01nnnnnn memory[2 * N] 0 - 65535 0x40 * 1000011n 2 ^ (N + 6) 64 , 128 0x86 * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 * 111nnnnn N + 65504 65504 - 65535 0xe0 * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 */ static int decode_udvm_multitype_operand(guint8 *buff,guint operand_address, guint16 *value) { guint test_bits; guint bytecode; guint offset = operand_address; guint16 operand; guint32 result; guint8 temp_data; guint16 temp_data16; guint16 memmory_addr = 0; *value = 0; if (operand_address >= UDVM_MEMORY_SIZE) return -1; bytecode = buff[operand_address]; test_bits = ( bytecode & 0xc0 ) >> 6; switch (test_bits ) { case 0: /* * 00nnnnnn N 0 - 63 */ operand = buff[operand_address]; /* debug *ws_warning("Reading 0x%x From address %u",operand,offset); */ *value = operand; offset ++; break; case 1: /* * 01nnnnnn memory[2 * N] 0 - 65535 */ memmory_addr = ( bytecode & 0x3f) * 2; temp_data16 = buff[memmory_addr] << 8; temp_data16 = temp_data16 | buff[(memmory_addr+1) & 0xffff]; *value = temp_data16; offset ++; break; case 2: /* Check tree most significant bits */ test_bits = ( bytecode & 0xe0 ) >> 5; if ( test_bits == 5 ) { /* * 101nnnnn nnnnnnnn N 0 - 8191 */ temp_data = buff[operand_address] & 0x1f; operand = temp_data << 8; temp_data = buff[(operand_address + 1) & 0xffff]; operand = operand | temp_data; *value = operand; offset = offset + 2; } else { test_bits = ( bytecode & 0xf0 ) >> 4; if ( test_bits == 9 ) { /* * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 */ temp_data = buff[operand_address] & 0x0f; operand = temp_data << 8; temp_data = buff[(operand_address + 1) & 0xffff]; operand = operand | temp_data; operand = operand + 61440; *value = operand; offset = offset + 2; } else { test_bits = ( bytecode & 0x08 ) >> 3; if ( test_bits == 1) { /* * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 */ result = 1 << ((buff[operand_address] & 0x07) + 8); operand = result & 0xffff; *value = operand; offset ++; } else { test_bits = ( bytecode & 0x0e ) >> 1; if ( test_bits == 3 ) { /* * 1000 011n 2 ^ (N + 6) 64 , 128 */ result = 1 << ((buff[operand_address] & 0x01) + 6); operand = result & 0xffff; *value = operand; offset ++; } else { /* * 1000 0000 nnnnnnnn nnnnnnnn N 0 - 65535 * 1000 0001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 */ offset ++; temp_data16 = buff[(operand_address + 1) & 0xffff] << 8; temp_data16 = temp_data16 | buff[(operand_address + 2) & 0xffff]; /* debug * ws_warning("Reading 0x%x From address %u",temp_data16,operand_address); */ if ( (bytecode & 0x01) == 1 ) { memmory_addr = temp_data16; temp_data16 = buff[memmory_addr] << 8; temp_data16 = temp_data16 | buff[(memmory_addr+1) & 0xffff]; } *value = temp_data16; offset = offset +2; } } } } break; case 3: test_bits = ( bytecode & 0x20 ) >> 5; if ( test_bits == 1 ) { /* * 111nnnnn N + 65504 65504 - 65535 */ operand = ( buff[operand_address] & 0x1f) + 65504; *value = operand; offset ++; } else { /* * 110nnnnn nnnnnnnn memory[N] 0 - 65535 */ memmory_addr = buff[operand_address] & 0x1f; memmory_addr = memmory_addr << 8; memmory_addr = memmory_addr | buff[(operand_address + 1) & 0xffff]; temp_data16 = buff[memmory_addr] << 8; temp_data16 = temp_data16 | buff[(memmory_addr+1) & 0xffff]; *value = temp_data16; /* debug * ws_warning("Reading 0x%x From address %u",temp_data16,memmory_addr); */ offset = offset +2; } default : break; } return offset; } /* * * The fourth operand type is the address (@). This operand is decoded * as a multitype operand followed by a further step: the memory address * of the UDVM instruction containing the address operand is added to * obtain the correct operand value. So if the operand value from * Figure 10 is D then the actual operand value of an address is * calculated as follows: * * operand_value = (memory_address_of_instruction + D) modulo 2^16 * * Address operands are always used in instructions that control program * flow, because they ensure that the UDVM bytecode is position- * independent code (i.e., it will run independently of where it is * placed in the UDVM memory). */ static int decode_udvm_address_operand(guint8 *buff,guint operand_address, guint16 *value,guint current_address) { guint32 result; guint16 value1; gint next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value1); result = value1 & 0xffff; result = result + current_address; *value = result & 0xffff; return next_operand_address; } /* * This is a lookup table used to reverse the bits in a byte. */ static guint8 reverse [] = { 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF }; static int decomp_dispatch_get_bits( tvbuff_t *message_tvb, proto_tree *udvm_tree, guint8 bit_order, guint8 *buff, guint16 *old_input_bit_order, guint16 *remaining_bits, guint16 *input_bits, guint *input_address, guint16 length, guint16 *result_code, guint msg_end, gboolean print_level_1) { guint16 input_bit_order; guint16 bits_still_required = length; guint16 value = 0; guint8 octet; gint extra_bytes_available = msg_end - *input_address; gint p_bit; gint prev_p_bit = *old_input_bit_order & 0x0001; gint bits_to_use = 0; input_bit_order = buff[68] << 8; input_bit_order = input_bit_order | buff[69]; *result_code = 0; p_bit = (input_bit_order & 0x0001) != 0; /* * Discard any spare bits. * Note: We take care to avoid remaining_bits having the value of 8. */ if (prev_p_bit != p_bit) { *remaining_bits = 0; *old_input_bit_order = input_bit_order; } /* * Check we can supply the required number of bits now, before we alter * the input buffer's state. */ if (*remaining_bits + extra_bytes_available * 8 < length) { *result_code = 11; return 0xfbad; } /* Note: This is never called with length > 16, so the following loop * never loops more than three time. */ while (bits_still_required > 0) { /* * We only put anything into input_bits if we know we will remove * at least one bit. That ensures we can simply discard the spare * bits if the P-bit changes. */ if (*remaining_bits == 0) { octet = tvb_get_guint8(message_tvb, *input_address); if (print_level_1 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_getting_value, message_tvb, *input_address, 1, octet, " Getting value: %u (0x%x) From Addr: %u", octet, octet, *input_address); } *input_address = *input_address + 1; if (p_bit != 0) { octet = reverse[octet]; } *input_bits = octet; *remaining_bits = 8; } /* Add some more bits to the accumulated value. */ bits_to_use = bits_still_required < *remaining_bits ? bits_still_required : *remaining_bits; bits_still_required -= bits_to_use; *input_bits <<= bits_to_use; /* Shift bits into MSByte */ value = (value << bits_to_use) /* Then add to the accumulated value */ | ((*input_bits >> 8) & 0xFF); *remaining_bits -= bits_to_use; *input_bits &= 0x00FF; /* Leave just the remaining bits */ } if ((bit_order != 0) && (length <= 16)) { /* Bit reverse the entire word. */ guint16 lsb = reverse[(value >> 8) & 0xFF]; guint16 msb = reverse[value & 0xFF]; value = ((msb << 8) | lsb) >> (16 - length); } return value; } static tvbuff_t* decompress_sigcomp_message(tvbuff_t *bytecode_tvb, tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *udvm_tree, gint udvm_mem_dest, gint print_flags, gint hf_id, gint header_len, gint byte_code_state_len, gint byte_code_id_len, gint udvm_start_ip) { tvbuff_t *decomp_tvb; /* UDVM memory must be initialised to zero */ guint8 *buff = (guint8 *)wmem_alloc0(wmem_packet_scope(), UDVM_MEMORY_SIZE); char string[2]; guint8 *out_buff; /* Largest allowed size for a message is UDVM_MEMORY_SIZE = 65536 */ guint32 i = 0; guint16 n = 0; guint16 m = 0; guint16 x; guint k = 0; guint16 H; guint16 oldH; guint offset = 0; guint start_offset; guint result_dest; guint code_length = 0; guint8 current_instruction; guint current_address; guint operand_address; guint input_address; guint16 output_address = 0; gint next_operand_address; guint8 octet; guint8 msb; guint8 lsb; guint16 byte_copy_right; guint16 byte_copy_left; guint16 input_bit_order; guint16 stack_location; guint16 stack_fill; guint16 result; guint msg_end = tvb_reported_length_remaining(message_tvb, 0); guint16 result_code = 0; guint16 old_input_bit_order = 0; guint16 remaining_bits = 0; guint16 input_bits = 0; guint8 bit_order = 0; gboolean outside_huffman_boundaries = TRUE; gboolean print_in_loop = FALSE; guint16 instruction_address; guint8 no_of_state_create = 0; guint16 state_length_buff[5]; guint16 state_address_buff[5]; guint16 state_instruction_buff[5]; guint16 state_minimum_access_length_buff[5]; /* guint16 state_state_retention_priority_buff[5]; */ guint32 used_udvm_cycles = 0; guint cycles_per_bit; guint maximum_UDVM_cycles; guint8 *sha1buff; unsigned char sha1_digest_buf[STATE_BUFFER_SIZE]; gcry_md_hd_t sha1_handle; proto_item *addr_item = NULL, *ti = NULL; /* UDVM operand variables */ guint16 length; guint16 at_address; guint16 destination; guint16 addr; guint16 value; guint16 p_id_start; guint16 p_id_length; guint16 state_begin; guint16 state_length; guint16 state_address; guint16 state_instruction; guint16 operand_1; guint16 operand_2; guint16 value_1; guint16 value_2; guint16 at_address_1; guint16 at_address_2; guint16 at_address_3; guint16 j; guint16 bits_n; guint16 lower_bound_n; guint16 upper_bound_n; guint16 uncompressed_n; guint16 position; guint16 ref_destination; /* could I have used $destination ? */ guint16 multy_offset; guint16 output_start; guint16 output_length; guint16 minimum_access_length; guint16 state_retention_priority; guint16 requested_feedback_location; guint16 returned_parameters_location; guint16 start_value; /* Set print parameters */ gboolean print_level_1 = FALSE; gboolean print_level_2 = FALSE; gboolean print_level_3 = FALSE; gint show_instr_detail_level = 0; switch ( print_flags ) { case 0: break; case 1: print_level_1 = TRUE; show_instr_detail_level = 1; break; case 2: print_level_1 = TRUE; print_level_2 = TRUE; show_instr_detail_level = 1; break; case 3: print_level_1 = TRUE; print_level_2 = TRUE; print_level_3 = TRUE; show_instr_detail_level = 2; break; default: print_level_1 = TRUE; show_instr_detail_level = 1; break; } /* Set initial UDVM data * The first 32 bytes of UDVM memory are then initialized to special * values as illustrated in Figure 5. * * 0 7 8 15 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | UDVM_memory_size | 0 - 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | cycles_per_bit | 2 - 3 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | SigComp_version | 4 - 5 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | partial_state_ID_length | 6 - 7 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | state_length | 8 - 9 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | * : reserved : 10 - 31 * | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * Figure 5: Initializing Useful Values in UDVM memory */ /* UDVM_memory_size */ buff[0] = (UDVM_MEMORY_SIZE >> 8) & 0x00FF; buff[1] = UDVM_MEMORY_SIZE & 0x00FF; /* cycles_per_bit */ buff[2] = 0; buff[3] = 16; /* SigComp_version */ buff[4] = 0; buff[5] = 1; /* partial_state_ID_length */ buff[6] = (byte_code_id_len >> 8) & 0x00FF; buff[7] = byte_code_id_len & 0x00FF; /* state_length */ buff[8] = (byte_code_state_len >> 8) & 0x00FF; buff[9] = byte_code_state_len & 0x00FF; code_length = tvb_reported_length_remaining(bytecode_tvb, 0); cycles_per_bit = buff[2] << 8; cycles_per_bit = cycles_per_bit | buff[3]; /* * maximum_UDVM_cycles = (8 * n + 1000) * cycles_per_bit */ maximum_UDVM_cycles = (( 8 * (header_len + msg_end) ) + 1000) * cycles_per_bit; proto_tree_add_uint(udvm_tree, hf_sigcomp_message_length, bytecode_tvb, offset, 1, msg_end); proto_tree_add_uint(udvm_tree, hf_sigcomp_byte_code_length, bytecode_tvb, offset, 1, code_length); proto_tree_add_uint(udvm_tree, hf_sigcomp_max_udvm_cycles, bytecode_tvb, offset, 1, maximum_UDVM_cycles); /* Load bytecode into UDVM starting at "udvm_mem_dest" */ i = udvm_mem_dest; if ( print_level_3 ) proto_tree_add_uint(udvm_tree, hf_sigcomp_load_bytecode_into_udvm_start, bytecode_tvb, offset, 1, i); while ( code_length > offset && i < UDVM_MEMORY_SIZE ) { buff[i] = tvb_get_guint8(bytecode_tvb, offset); if ( print_level_3 ) proto_tree_add_uint_format(udvm_tree, hf_sigcomp_instruction_code, bytecode_tvb, offset, 1, buff[i], " Addr: %u Instruction code(0x%02x) ", i, buff[i]); i++; offset++; } /* Start executing code */ current_address = udvm_start_ip; input_address = 0; proto_tree_add_uint_format(udvm_tree, hf_sigcomp_udvm_execution_stated, bytecode_tvb, offset, 1, current_address, "UDVM EXECUTION STARTED at Address: %u Message size %u", current_address, msg_end); /* Largest allowed size for a message is UDVM_MEMORY_SIZE = 65536 */ out_buff = (guint8 *)wmem_alloc(pinfo->pool, UDVM_MEMORY_SIZE); /* Reset offset so proto_tree_add_xxx items below accurately reflect the bytes they represent */ offset = 0; execute_next_instruction: if ( used_udvm_cycles > maximum_UDVM_cycles ) { result_code = 15; goto decompression_failure; } used_udvm_cycles++; current_instruction = buff[current_address & 0xffff]; if (show_instr_detail_level == 2 ) { addr_item = proto_tree_add_uint_format(udvm_tree, hf_sigcomp_current_instruction, bytecode_tvb, offset, 1, current_instruction, "Addr: %u ## %s(%d)", current_address, val_to_str_ext_const(current_instruction, &udvm_instruction_code_vals_ext, "INVALID INSTRUCTION"), current_instruction); } offset++; switch ( current_instruction ) { case SIGCOMP_INSTR_DECOMPRESSION_FAILURE: if ( result_code == 0 ) result_code = 9; proto_tree_add_uint_format(udvm_tree, hf_sigcomp_decompression_failure, NULL, 0, 0, current_address, "Addr: %u ## DECOMPRESSION-FAILURE(0)", current_address); proto_tree_add_uint(udvm_tree, hf_sigcomp_wireshark_udvm_diagnostic, NULL, 0, 0, result_code); if ( output_address > 0 ) { /* At least something got decompressed, show it */ decomp_tvb = tvb_new_child_real_data(message_tvb, out_buff,output_address,output_address); /* Add the tvbuff to the list of tvbuffs to which the tvbuff we * were handed refers, so it'll get cleaned up when that tvbuff * is cleaned up. */ add_new_data_source(pinfo, decomp_tvb, "Decompressed SigComp message(Incomplete)"); proto_tree_add_expert(udvm_tree, pinfo, &ei_sigcomp_sigcomp_message_decompression_failure, decomp_tvb, 0, -1); return decomp_tvb; } return NULL; break; case SIGCOMP_INSTR_AND: /* 1 AND ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## AND (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* execute the instruction */ result = operand_1 & operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_OR: /* 2 OR ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## OR (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* execute the instruction */ result = operand_1 | operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_NOT: /* 3 NOT ($operand_1) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " ($operand_1)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## NOT (operand_1=%u)", current_address, operand_1); } /* execute the instruction */ result = operand_1 ^ 0xffff; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_LSHIFT: /* 4 LSHIFT ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " ($operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { ti = proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } if (operand_2 > 15) { expert_add_info(pinfo, ti, &ei_sigcomp_invalid_shift_value); break; } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## LSHIFT (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* execute the instruction */ result = operand_1 << operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_RSHIFT: /* 5 RSHIFT ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { ti = proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } if (operand_2 > 15) { expert_add_info(pinfo, ti, &ei_sigcomp_invalid_shift_value); break; } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## RSHIFT (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* execute the instruction */ result = operand_1 >> operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_ADD: /* 6 ADD ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## ADD (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* execute the instruction */ result = operand_1 + operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; case SIGCOMP_INSTR_SUBTRACT: /* 7 SUBTRACT ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## SUBTRACT (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* execute the instruction */ result = operand_1 - operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_MULTIPLY: /* 8 MULTIPLY ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## MULTIPLY (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* * execute the instruction * MULTIPLY (m, n) := m * n (modulo 2^16) */ if ( operand_2 == 0) { result_code = 4; goto decompression_failure; } result = operand_1 * operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_DIVIDE: /* 9 DIVIDE ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## DIVIDE (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* * execute the instruction * DIVIDE (m, n) := floor(m / n) * Decompression failure occurs if a DIVIDE or REMAINDER instruction * encounters an operand_2 that is zero. */ if ( operand_2 == 0) { result_code = 4; goto decompression_failure; } result = operand_1 / operand_2; lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_REMAINDER: /* 10 REMAINDER ($operand_1, %operand_2) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (operand_1, operand_2)"); } start_offset = offset; /* $operand_1*/ operand_address = current_address + 1; next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &operand_1, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_1, bytecode_tvb, offset, (next_operand_address-operand_address), operand_1, "Addr: %u operand_1 %u", operand_address, operand_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %operand_2*/ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &operand_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_operand_2, bytecode_tvb, offset, (next_operand_address-operand_address), operand_2, "Addr: %u operand_2 %u", operand_address, operand_2); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## REMAINDER (operand_1=%u, operand_2=%u)", current_address, operand_1, operand_2); } /* * execute the instruction * REMAINDER (m, n) := m - n * floor(m / n) * Decompression failure occurs if a DIVIDE or REMAINDER instruction * encounters an operand_2 that is zero. */ if ( operand_2 == 0) { result_code = 4; goto decompression_failure; } result = operand_1 - operand_2 * (operand_1 / operand_2); lsb = result & 0xff; msb = result >> 8; buff[result_dest] = msb; buff[(result_dest+1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading result %u at %u", result, result_dest); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_SORT_ASCENDING: /* 11 SORT-ASCENDING (%start, %n, %k) */ /* * used_udvm_cycles = 1 + k * (ceiling(log2(k)) + n) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (start, n, k))"); } proto_tree_add_expert(udvm_tree, pinfo, &ei_sigcomp_execution_of_this_instruction_is_not_implemented, bytecode_tvb, 0, -1); /* * used_udvm_cycles = 1 + k * (ceiling(log2(k)) + n) */ break; case SIGCOMP_INSTR_SORT_DESCENDING: /* 12 SORT-DESCENDING (%start, %n, %k) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (start, n, k))"); } proto_tree_add_expert(udvm_tree, pinfo, &ei_sigcomp_execution_of_this_instruction_is_not_implemented, bytecode_tvb, 0, -1); /* * used_udvm_cycles = 1 + k * (ceiling(log2(k)) + n) */ break; case SIGCOMP_INSTR_SHA_1: /* 13 SHA-1 (%position, %length, %destination) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (position, length, destination)"); } operand_address = current_address + 1; /* %position */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &position); if (next_operand_address < 0) goto decompression_failure; if (print_level_1 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_position, bytecode_tvb, offset, (next_operand_address-operand_address), position, "Addr: %u position %u", operand_address, position); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (print_level_1 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* $destination */ next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &ref_destination, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (print_level_1 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_ref_dest, bytecode_tvb, offset, (next_operand_address-operand_address), ref_destination, "Addr: %u $destination %u", operand_address, ref_destination); } offset += (next_operand_address-operand_address); used_udvm_cycles = used_udvm_cycles + length; n = 0; k = position; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, 0, -1, NULL, "byte_copy_right = %u", byte_copy_right); } if (gcry_md_open(&sha1_handle, GCRY_MD_SHA1, 0)) { goto decompression_failure; } while (n<length) { guint16 handle_now = length; if ( k < byte_copy_right && byte_copy_right <= k + (length-n) ) { handle_now = byte_copy_right - position; } if ((k + handle_now >= UDVM_MEMORY_SIZE) || (n + handle_now >= UDVM_MEMORY_SIZE)) { gcry_md_close(sha1_handle); goto decompression_failure; } gcry_md_write(sha1_handle, &buff[k], handle_now); k = ( k + handle_now ) & 0xffff; n = ( n + handle_now ) & 0xffff; if ( k >= byte_copy_right ) { k = byte_copy_left; } } memcpy(sha1_digest_buf, gcry_md_read(sha1_handle, 0), HASH_SHA1_LENGTH); gcry_md_close(sha1_handle); k = ref_destination; for ( n=0; n< STATE_BUFFER_SIZE; n++ ) { buff[k] = sha1_digest_buf[n]; k = ( k + 1 ) & 0xffff; n++; if ( k == byte_copy_right ) { k = byte_copy_left; } } if (print_level_2 ) { proto_tree_add_bytes_with_length(udvm_tree, hf_sigcomp_calculated_sha_1, message_tvb, 0, -1, sha1_digest_buf, STATE_BUFFER_SIZE); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_LOAD: /* 14 LOAD (%address, %value) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (%%address, %%value)"); } start_offset = offset; operand_address = current_address + 1; /* %address */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &addr); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_address, bytecode_tvb, offset, (next_operand_address-operand_address), addr, "Addr: %u Address %u", operand_address, addr); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %value */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2) { proto_tree_add_uint_format(udvm_tree, hf_udvm_value, bytecode_tvb, offset, (next_operand_address-operand_address), value, "Addr: %u Value %u", operand_address, value); } offset += (next_operand_address-operand_address); lsb = value & 0xff; msb = value >> 8; buff[addr] = msb; buff[(addr + 1) & 0xffff] = lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## LOAD (%%address=%u, %%value=%u)", current_address, addr, value); proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, " Loading bytes at %u Value %u 0x%x", addr, value, value); } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_MULTILOAD: /* 15 MULTILOAD (%address, #n, %value_0, ..., %value_n-1) */ /* RFC 3320: * The MULTILOAD instruction sets a contiguous block of 2-byte words in * the UDVM memory to specified values. * Hmm what if the value to load only takes one byte ? Chose to always load two bytes. */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (%%address, #n, value_0, ..., value_n-1)"); } start_offset = offset; operand_address = current_address + 1; /* %address */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &addr); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_address, bytecode_tvb, offset, (next_operand_address-operand_address), addr, "Addr: %u Address %u", operand_address, addr); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* #n */ next_operand_address = decode_udvm_literal_operand(buff,operand_address, &n); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_literal_num, bytecode_tvb, offset, (next_operand_address-operand_address), n, "Addr: %u n %u", operand_address, n); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## MULTILOAD (%%address=%u, #n=%u, value_0, ..., value_%d)", current_address, addr, n, n-1); } operand_address = next_operand_address; used_udvm_cycles = used_udvm_cycles + n; while ( n > 0) { n = n - 1; /* %value */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value); if (next_operand_address < 0) goto decompression_failure; lsb = value & 0xff; msb = value >> 8; if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[addr] = msb; buff[(addr + 1) & 0xffff] = lsb; /* debug */ length = next_operand_address - operand_address; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, bytecode_tvb, 0, -1, "Addr: %u Value %5u - Loading bytes at %5u Value %5u 0x%x", operand_address, value, addr, value, value); } addr = addr + 2; operand_address = next_operand_address; } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_PUSH: /* 16 PUSH (%value) */ if (show_instr_detail_level == 2) { proto_item_append_text(addr_item, " (value)"); } start_offset = offset; operand_address = current_address + 1; /* %value */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2) { proto_tree_add_uint_format(udvm_tree, hf_udvm_value, bytecode_tvb, offset, (next_operand_address-operand_address), value, "Addr: %u Value %u", operand_address, value); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## PUSH (value=%u)", current_address, value); } current_address = next_operand_address; /* Push the value address onto the stack */ stack_location = (buff[70] << 8) | buff[71]; stack_fill = (buff[stack_location] << 8) | buff[(stack_location+1) & 0xFFFF]; addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[addr] = (value >> 8) & 0x00FF; buff[(addr+1) & 0xFFFF] = value & 0x00FF; if (stack_location >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; stack_fill = (stack_fill + 1) & 0xFFFF; buff[stack_location] = (stack_fill >> 8) & 0x00FF; buff[(stack_location+1) & 0xFFFF] = stack_fill & 0x00FF; goto execute_next_instruction; break; case SIGCOMP_INSTR_POP: /* 17 POP (%address) */ if (show_instr_detail_level == 2) { proto_item_append_text(addr_item, " (value)"); } start_offset = offset; operand_address = current_address + 1; /* %value */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &destination); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2) { proto_tree_add_uint_format(udvm_tree, hf_udvm_address, bytecode_tvb, offset, (next_operand_address-operand_address), destination, "Addr: %u Value %u", operand_address, destination); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## POP (address=%u)", current_address, destination); } current_address = next_operand_address; /* Pop value from the top of the stack */ stack_location = (buff[70] << 8) | buff[71]; stack_fill = (buff[stack_location] << 8) | buff[(stack_location+1) & 0xFFFF]; if (stack_fill == 0) { result_code = 16; goto decompression_failure; } if (stack_location >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; stack_fill = (stack_fill - 1) & 0xFFFF; buff[stack_location] = (stack_fill >> 8) & 0x00FF; buff[(stack_location+1) & 0xFFFF] = stack_fill & 0x00FF; addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; value = (buff[addr] << 8) | buff[(addr+1) & 0xFFFF]; /* ... and store the popped value. */ if (destination >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[destination] = (value >> 8) & 0x00FF; buff[(destination+1) & 0xFFFF] = value & 0x00FF; goto execute_next_instruction; break; case SIGCOMP_INSTR_COPY: /* 18 COPY (%position, %length, %destination) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (position, length, destination)"); } start_offset = offset; operand_address = current_address + 1; /* %position */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &position); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_position, bytecode_tvb, offset, (next_operand_address-operand_address), position, "Addr: %u position %u", operand_address, position); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %destination */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &destination); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_ref_dest, bytecode_tvb, offset, (next_operand_address-operand_address), destination, "Addr: %u Destination %u", operand_address, destination); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## COPY (position=%u, length=%u, destination=%u)", current_address, position, length, destination); } current_address = next_operand_address; /* * 8.4. Byte copying * : * The string of bytes is copied in ascending order of memory address, * respecting the bounds set by byte_copy_left and byte_copy_right. * More precisely, if a byte is copied from/to Address m then the next * byte is copied from/to Address n where n is calculated as follows: * * Set k := m + 1 (modulo 2^16) * If k = byte_copy_right then set n := byte_copy_left, else set n := k * */ n = 0; k = destination; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_right = %u", byte_copy_right); } while ( n < length ) { buff[k] = buff[position]; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_copying_value, message_tvb, input_address, 1, buff[position], " Copying value: %u (0x%x) to Addr: %u", buff[position], buff[position], k); } position = ( position + 1 ) & 0xffff; k = ( k + 1 ) & 0xffff; n++; /* * Check for circular buffer wrapping after the positions are * incremented. If either started at BCR then they should continue * to increment beyond BCR. */ if ( k == byte_copy_right ) { k = byte_copy_left; } if ( position == byte_copy_right ) { position = byte_copy_left; } } used_udvm_cycles = used_udvm_cycles + length; goto execute_next_instruction; break; case SIGCOMP_INSTR_COPY_LITERAL: /* 19 COPY-LITERAL (%position, %length, $destination) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (position, length, $destination)"); } start_offset = offset; operand_address = current_address + 1; /* %position */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &position); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_position, bytecode_tvb, offset, (next_operand_address-operand_address), position, "Addr: %u position %u", operand_address, position); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* $destination */ next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &ref_destination, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_ref_dest, bytecode_tvb, offset, (next_operand_address-operand_address), ref_destination, "Addr: %u destination %u", operand_address, ref_destination); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## COPY-LITERAL (position=%u, length=%u, $destination=%u)", current_address, position, length, ref_destination); } current_address = next_operand_address; /* * 8.4. Byte copying * : * The string of bytes is copied in ascending order of memory address, * respecting the bounds set by byte_copy_left and byte_copy_right. * More precisely, if a byte is copied from/to Address m then the next * byte is copied from/to Address n where n is calculated as follows: * * Set k := m + 1 (modulo 2^16) * If k = byte_copy_right then set n := byte_copy_left, else set n := k * */ n = 0; k = ref_destination; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_right = %u", byte_copy_right); } while ( n < length ) { buff[k] = buff[position]; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_copying_value, message_tvb, input_address, 1, buff[position], " Copying value: %u (0x%x) to Addr: %u", buff[position], buff[position], k); } position = ( position + 1 ) & 0xffff; k = ( k + 1 ) & 0xffff; n++; /* * Check for circular buffer wrapping after the positions are * incremented. It is important that k cannot be left set * to BCR. Also, if either started at BCR then they should continue * to increment beyond BCR. */ if ( k == byte_copy_right ) { k = byte_copy_left; } if ( position == byte_copy_right ) { position = byte_copy_left; } } buff[result_dest] = k >> 8; buff[(result_dest + 1) & 0xffff] = k & 0x00ff; used_udvm_cycles = used_udvm_cycles + length; goto execute_next_instruction; break; case SIGCOMP_INSTR_COPY_OFFSET: /* 20 COPY-OFFSET (%offset, %length, $destination) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (offset, length, $destination)"); } start_offset = offset; operand_address = current_address + 1; /* %offset */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &multy_offset); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_offset, bytecode_tvb, offset, (next_operand_address-operand_address), multy_offset, "Addr: %u offset %u", operand_address, multy_offset); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* $destination */ next_operand_address = dissect_udvm_reference_operand_memory(buff, operand_address, &ref_destination, &result_dest); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_ref_dest, bytecode_tvb, offset, (next_operand_address-operand_address), ref_destination, "Addr: %u $destination %u", operand_address, ref_destination); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## COPY-OFFSET (offset=%u, length=%u, $destination=%u)", current_address, multy_offset, length, result_dest); } current_address = next_operand_address; /* Execute the instruction: * To derive the value of the position operand, starting at the memory * address specified by destination, the UDVM counts backwards a total * of offset memory addresses. * * If the memory address specified in byte_copy_left is reached, the * next memory address is taken to be (byte_copy_right - 1) modulo 2^16. */ byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; /* * In order to work out the position, simple arithmetic is tricky * to apply because there some nasty corner cases. A simple loop * is inefficient but the logic is simple. * * FUTURE: This could be optimised. */ for (position = ref_destination, i = 0; i < multy_offset; i++) { if ( position == byte_copy_left ) { position = (byte_copy_right - 1) & 0xffff; } else { position = (position - 1) & 0xffff; } } if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_left = %u byte_copy_right = %u position= %u", byte_copy_left, byte_copy_right, position); } /* The COPY-OFFSET instruction then behaves as a COPY-LITERAL * instruction, taking the value of the position operand to be the last * memory address reached in the above step. */ /* * 8.4. Byte copying * : * The string of bytes is copied in ascending order of memory address, * respecting the bounds set by byte_copy_left and byte_copy_right. * More precisely, if a byte is copied from/to Address m then the next * byte is copied from/to Address n where n is calculated as follows: * * Set k := m + 1 (modulo 2^16) * If k = byte_copy_right then set n := byte_copy_left, else set n := k * */ n = 0; k = ref_destination; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_left = %u byte_copy_right = %u", byte_copy_left, byte_copy_right); } while ( n < length ) { buff[k] = buff[position]; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_copying_value, message_tvb, input_address, 1, buff[position], " Copying value: %5u (0x%x) from Addr: %u to Addr: %u", buff[position], buff[position],(position), k); } n++; k = ( k + 1 ) & 0xffff; position = ( position + 1 ) & 0xffff; /* * Check for circular buffer wrapping after the positions are * incremented. It is important that k cannot be left set * to BCR. Also, if either started at BCR then they should continue * to increment beyond BCR. */ if ( k == byte_copy_right ) { k = byte_copy_left; } if ( position == byte_copy_right ) { position = byte_copy_left; } } buff[result_dest] = k >> 8; buff[result_dest + 1] = k & 0x00ff; used_udvm_cycles = used_udvm_cycles + length; goto execute_next_instruction; break; case SIGCOMP_INSTR_MEMSET: /* 21 MEMSET (%address, %length, %start_value, %offset) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (address, length, start_value, offset)"); } start_offset = offset; operand_address = current_address + 1; /* %address */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &addr); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_address, bytecode_tvb, offset, (next_operand_address-operand_address), addr, "Addr: %u Address %u", operand_address, addr); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %length, */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %start_value */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &start_value); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_start_value, bytecode_tvb, offset, (next_operand_address-operand_address), start_value, "Addr: %u start_value %u", operand_address, start_value); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %offset */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &multy_offset); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_offset, bytecode_tvb, offset, (next_operand_address-operand_address), multy_offset, "Addr: %u offset %u", operand_address, multy_offset); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## MEMSET (address=%u, length=%u, start_value=%u, offset=%u)", current_address, addr, length, start_value, multy_offset); } current_address = next_operand_address; /* execute the instruction * The sequence of values used by the MEMSET instruction is specified by * the following formula: * * Seq[n] := (start_value + n * offset) modulo 256 */ n = 0; k = addr; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_left = %u byte_copy_right = %u", byte_copy_left, byte_copy_right); } while ( n < length ) { if ( k == byte_copy_right ) { k = byte_copy_left; } buff[k] = (start_value + ( n * multy_offset)) & 0xff; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_storing_value, message_tvb, input_address, 1, buff[k], " Storing value: %u (0x%x) at Addr: %u", buff[k], buff[k], k); } k = ( k + 1 ) & 0xffff; n++; }/* end while */ used_udvm_cycles = used_udvm_cycles + length; goto execute_next_instruction; break; case SIGCOMP_INSTR_JUMP: /* 22 JUMP (@address) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (@address)"); } start_offset = offset; operand_address = current_address + 1; /* @address */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_address_operand(buff,operand_address, &at_address, current_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address, "Addr: %u @Address %u", operand_address, at_address); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## JUMP (@address=%u)", current_address, at_address); } current_address = at_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_COMPARE: /* 23 */ /* COMPARE (%value_1, %value_2, @address_1, @address_2, @address_3) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (value_1, value_2, @address_1, @address_2, @address_3)"); } start_offset = offset; operand_address = current_address + 1; /* %value_1 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value_1); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_value, bytecode_tvb, offset, (next_operand_address-operand_address), value_1, "Addr: %u Value %u", operand_address, value_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %value_2 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value_2); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_value, bytecode_tvb, offset, (next_operand_address-operand_address), value_2, "Addr: %u Value %u", operand_address, value_2); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address_1 */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &at_address_1); if (next_operand_address < 0) goto decompression_failure; at_address_1 = ( current_address + at_address_1) & 0xffff; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address_1, "Addr: %u @Address %u", operand_address, at_address_1); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address_2 */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &at_address_2); if (next_operand_address < 0) goto decompression_failure; at_address_2 = ( current_address + at_address_2) & 0xffff; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address_2, "Addr: %u @Address %u", operand_address, at_address_2); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address_3 */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &at_address_3); if (next_operand_address < 0) goto decompression_failure; at_address_3 = ( current_address + at_address_3) & 0xffff; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address_3, "Addr: %u @Address %u", operand_address, at_address_3); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## COMPARE (value_1=%u, value_2=%u, @address_1=%u, @address_2=%u, @address_3=%u)", current_address, value_1, value_2, at_address_1, at_address_2, at_address_3); } /* execute the instruction * If value_1 < value_2 then the UDVM continues instruction execution at * the memory address specified by address 1. If value_1 = value_2 then * it jumps to the address specified by address_2. If value_1 > value_2 * then it jumps to the address specified by address_3. */ if ( value_1 < value_2 ) current_address = at_address_1; if ( value_1 == value_2 ) current_address = at_address_2; if ( value_1 > value_2 ) current_address = at_address_3; goto execute_next_instruction; break; case SIGCOMP_INSTR_CALL: /* 24 CALL (@address) (PUSH addr )*/ if (show_instr_detail_level == 2) { proto_item_append_text(addr_item, " (@address) (PUSH addr )"); } start_offset = offset; operand_address = current_address + 1; /* @address */ next_operand_address = decode_udvm_address_operand(buff,operand_address, &at_address, current_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address, "Addr: %u @Address %u", operand_address, at_address); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## CALL (@address=%u)", current_address, at_address); } current_address = next_operand_address; /* Push the current address onto the stack */ stack_location = (buff[70] << 8) | buff[71]; stack_fill = (buff[stack_location] << 8) | buff[(stack_location+1) & 0xFFFF]; addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[addr] = (current_address >> 8) & 0x00FF; buff[(addr+1) & 0xFFFF] = current_address & 0x00FF; stack_fill = (stack_fill + 1) & 0xFFFF; if (stack_location >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[stack_location] = (stack_fill >> 8) & 0x00FF; buff[(stack_location+1) & 0xFFFF] = stack_fill & 0x00FF; /* ... and jump to the destination address */ current_address = at_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_RETURN: /* 25 POP and return */ /* Pop value from the top of the stack */ stack_location = (buff[70] << 8) | buff[71]; stack_fill = (buff[stack_location] << 8) | buff[(stack_location+1) & 0xFFFF]; if (stack_fill == 0) { result_code = 16; goto decompression_failure; } stack_fill = (stack_fill - 1) & 0xFFFF; if (stack_location >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[stack_location] = (stack_fill >> 8) & 0x00FF; buff[(stack_location+1) & 0xFFFF] = stack_fill & 0x00FF; addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; at_address = (buff[addr] << 8) | buff[(addr+1) & 0xFFFF]; /* ... and set the PC to the popped value */ current_address = at_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_SWITCH: /* 26 SWITCH (#n, %j, @address_0, @address_1, ... , @address_n-1) */ /* * When a SWITCH instruction is encountered the UDVM reads the value of * j. It then continues instruction execution at the address specified * by address j. * * Decompression failure occurs if j specifies a value of n or more, or * if the address lies beyond the overall UDVM memory size. */ instruction_address = current_address; if (show_instr_detail_level == 2) { proto_item_append_text(addr_item, " (#n, j, @address_0, @address_1, ... , @address_n-1))"); } operand_address = current_address + 1; /* #n * Number of addresses in the instruction */ next_operand_address = decode_udvm_literal_operand(buff,operand_address, &n); if (next_operand_address < 0) goto decompression_failure; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_literal_num, bytecode_tvb, offset, (next_operand_address-operand_address), n, "Addr: %u n %u", operand_address, n); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %j */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &j); if (next_operand_address < 0) goto decompression_failure; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_j, bytecode_tvb, offset, (next_operand_address-operand_address), j, "Addr: %u j %u", operand_address, j); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; m = 0; while ( m < n ) { /* @address_n-1 */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &at_address_1); if (next_operand_address < 0) goto decompression_failure; at_address_1 = ( instruction_address + at_address_1) & 0xffff; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address_1, "Addr: %u @Address %u", operand_address, at_address_1); } offset += (next_operand_address-operand_address); if ( j == m ) { current_address = at_address_1; } operand_address = next_operand_address; m++; } /* Check decompression failure */ if ( ( j == n ) || ( j > n )) { result_code = 5; goto decompression_failure; } if ( current_address > UDVM_MEMORY_SIZE ) { result_code = 6; goto decompression_failure; } used_udvm_cycles = used_udvm_cycles + n; goto execute_next_instruction; break; case SIGCOMP_INSTR_CRC: /* 27 CRC (%value, %position, %length, @address) */ if (show_instr_detail_level == 2) { proto_item_append_text(addr_item, " (value, position, length, @address)"); } start_offset = offset; operand_address = current_address + 1; /* %value */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &value); if (next_operand_address < 0) goto decompression_failure; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_value, bytecode_tvb, offset, (next_operand_address-operand_address), value, "Addr: %u Value %u", operand_address, value); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %position */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &position); if (next_operand_address < 0) goto decompression_failure; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_position, bytecode_tvb, offset, (next_operand_address-operand_address), position, "Addr: %u position %u", operand_address, position); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &at_address); if (next_operand_address < 0) goto decompression_failure; at_address = ( current_address + at_address) & 0xffff; if (print_level_2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address, "Addr: %u @Address %u", operand_address, at_address); } offset += (next_operand_address-operand_address); /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ used_udvm_cycles = used_udvm_cycles + length; n = 0; k = position; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; result = 0; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, 0, -1, NULL, "byte_copy_right = %u", byte_copy_right); } while (n<length) { guint16 handle_now = length - n; if ( k < byte_copy_right && byte_copy_right <= k + (length-n) ) { handle_now = byte_copy_right - k; } if (k + handle_now >= UDVM_MEMORY_SIZE) goto decompression_failure; result = crc16_ccitt_seed(&buff[k], handle_now, (guint16) (result ^ 0xffff)); k = ( k + handle_now ) & 0xffff; n = ( n + handle_now ) & 0xffff; if ( k >= byte_copy_right ) { k = byte_copy_left; } } result = result ^ 0xffff; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Calculated CRC %u", result); } if (result != value) { current_address = at_address; } else { current_address = next_operand_address; } goto execute_next_instruction; break; case SIGCOMP_INSTR_INPUT_BYTES: /* 28 INPUT-BYTES (%length, %destination, @address) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " length, destination, @address)"); } start_offset = offset; operand_address = current_address + 1; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u Length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %destination */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &destination); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_destination, bytecode_tvb, offset, (next_operand_address-operand_address), destination, "Addr: %u Destination %u", operand_address, destination); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &at_address); if (next_operand_address < 0) goto decompression_failure; at_address = ( current_address + at_address) & 0xffff; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address, "Addr: %u @Address %u", operand_address, at_address); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## INPUT-BYTES length=%u, destination=%u, @address=%u)", current_address, length, destination, at_address); } /* execute the instruction TODO insert checks * RFC 3320 : * * 0 7 8 15 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | byte_copy_left | 64 - 65 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | byte_copy_right | 66 - 67 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | input_bit_order | 68 - 69 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | stack_location | 70 - 71 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * Figure 7: Memory addresses of the UDVM registers * : * 8.4. Byte copying * : * The string of bytes is copied in ascending order of memory address, * respecting the bounds set by byte_copy_left and byte_copy_right. * More precisely, if a byte is copied from/to Address m then the next * byte is copied from/to Address n where n is calculated as follows: * * Set k := m + 1 (modulo 2^16) * If k = byte_copy_right then set n := byte_copy_left, else set n := k * */ n = 0; k = destination; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_1 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_right = %u", byte_copy_right); } /* clear out remaining bits if any */ remaining_bits = 0; input_bits=0; /* operand_address used as dummy */ while ( n < length ) { if (input_address > ( msg_end - 1)) { current_address = at_address; result_code = 14; goto execute_next_instruction; } if ( k == byte_copy_right ) { k = byte_copy_left; } octet = tvb_get_guint8(message_tvb, input_address); buff[k] = octet; if (print_level_1 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_loading_value, message_tvb, input_address, 1, octet, " Loading value: %u (0x%x) at Addr: %u", octet, octet, k); } input_address++; /* * If the instruction requests data that lies beyond the end of the * SigComp message, no data is returned. Instead the UDVM moves program * execution to the address specified by the address operand. */ k = ( k + 1 ) & 0xffff; n++; } used_udvm_cycles = used_udvm_cycles + length; current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_INPUT_BITS:/* 29 INPUT-BITS (%length, %destination, @address) */ /* * The length operand indicates the requested number of bits. * Decompression failure occurs if this operand does not lie between 0 * and 16 inclusive. * * The destination operand specifies the memory address to which the * compressed data should be copied. Note that the requested bits are * interpreted as a 2-byte integer ranging from 0 to 2^length - 1, as * explained in Section 8.2. * * If the instruction requests data that lies beyond the end of the * SigComp message, no data is returned. Instead the UDVM moves program * execution to the address specified by the address operand. */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (length, destination, @address)"); } start_offset = offset; operand_address = current_address + 1; /* %length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_length, bytecode_tvb, offset, (next_operand_address-operand_address), length, "Addr: %u length %u", operand_address, length); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %destination */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &destination); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_destination, bytecode_tvb, offset, (next_operand_address-operand_address), destination, "Addr: %u Destination %u", operand_address, destination); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_address_operand(buff,operand_address, &at_address, current_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address, "Addr: %u @Address %u", operand_address, at_address); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## INPUT-BITS length=%u, destination=%u, @address=%u)", current_address, length, destination, at_address); } current_address = next_operand_address; /* * Execute actual instr. * The input_bit_order register contains the following three flags: * * 0 7 8 15 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | reserved |F|H|P| 68 - 69 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ input_bit_order = buff[68] << 8; input_bit_order = input_bit_order | buff[69]; /* * If the instruction requests data that lies beyond the end of the * SigComp message, no data is returned. Instead the UDVM moves program * execution to the address specified by the address operand. */ if ( length > 16 ) { result_code = 7; goto decompression_failure; } if ( input_bit_order > 7 ) { result_code = 8; goto decompression_failure; } /* * Transfer F bit to bit_order to tell decomp dispatcher which bit order to use */ bit_order = ( input_bit_order & 0x0004 ) >> 2; value = decomp_dispatch_get_bits( message_tvb, udvm_tree, bit_order, buff, &old_input_bit_order, &remaining_bits, &input_bits, &input_address, length, &result_code, msg_end, print_level_1); if ( result_code == 11 ) { current_address = at_address; goto execute_next_instruction; } msb = value >> 8; lsb = value & 0x00ff; if (destination >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[destination] = msb; buff[(destination + 1) & 0xffff]=lsb; if (print_level_1 ) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_loading_result, message_tvb, input_address, 1, " Loading value: %u (0x%x) at Addr: %u, remaining_bits: %u", value, value, destination, remaining_bits); } goto execute_next_instruction; break; case SIGCOMP_INSTR_INPUT_HUFFMAN: /* 30 */ /* * INPUT-HUFFMAN (%destination, @address, #n, %bits_1, %lower_bound_1, * %upper_bound_1, %uncompressed_1, ... , %bits_n, %lower_bound_n, * %upper_bound_n, %uncompressed_n) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (destination, @address, #n, bits_1, lower_bound_1,upper_bound_1, uncompressed_1, ... , bits_n, lower_bound_n,upper_bound_n, uncompressed_n)"); } start_offset = offset; operand_address = current_address + 1; /* %destination */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &destination); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_destination, bytecode_tvb, offset, (next_operand_address-operand_address), destination, "Addr: %u Destination %u", operand_address, destination); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* @address */ /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ next_operand_address = decode_udvm_address_operand(buff,operand_address, &at_address, current_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_at_address, bytecode_tvb, offset, (next_operand_address-operand_address), at_address, "Addr: %u @Address %u", operand_address, at_address); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* #n */ next_operand_address = decode_udvm_literal_operand(buff,operand_address, &n); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_literal_num, bytecode_tvb, offset, (next_operand_address-operand_address), n, "Addr: %u n %u", operand_address, n); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## INPUT-HUFFMAN (destination=%u, @address=%u, #n=%u, bits_1, lower_1,upper_1, unc_1, ... , bits_%d, lower_%d,upper_%d, unc_%d)", current_address, destination, at_address, n, n, n, n, n); } used_udvm_cycles = used_udvm_cycles + n; /* * Note that if n = 0 then the INPUT-HUFFMAN instruction is ignored and * program execution resumes at the following instruction. * Decompression failure occurs if (bits_1 + ... + bits_n) > 16. * * In all other cases, the behavior of the INPUT-HUFFMAN instruction is * defined below: * * 1. Set j := 1 and set H := 0. * * 2. Request bits_j compressed bits. Interpret the returned bits as an * integer k from 0 to 2^bits_j - 1, as explained in Section 8.2. * * 3. Set H := H * 2^bits_j + k. * * 4. If data is requested that lies beyond the end of the SigComp * message, terminate the INPUT-HUFFMAN instruction and move program * execution to the memory address specified by the address operand. * * 5. If (H < lower_bound_j) or (H > upper_bound_j) then set j := j + 1. * Then go back to Step 2, unless j > n in which case decompression * failure occurs. * * 6. Copy (H + uncompressed_j - lower_bound_j) modulo 2^16 to the * memory address specified by the destination operand. * */ /* * The input_bit_order register contains the following three flags: * * 0 7 8 15 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | reserved |F|H|P| 68 - 69 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * Transfer H bit to bit_order to tell decomp dispatcher which bit order to use */ input_bit_order = buff[68] << 8; input_bit_order = input_bit_order | buff[69]; bit_order = ( input_bit_order & 0x0002 ) >> 1; j = 1; H = 0; m = n; outside_huffman_boundaries = TRUE; print_in_loop = print_level_3; while ( m > 0 ) { /* %bits_n */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &bits_n); if (next_operand_address < 0) goto decompression_failure; if (print_in_loop ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_bits, bytecode_tvb, offset, (next_operand_address-operand_address), bits_n, "Addr: %u bits_n %u", operand_address, bits_n); } if (bits_n > 31) break; offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %lower_bound_n */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &lower_bound_n); if (next_operand_address < 0) goto decompression_failure; if (print_in_loop ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_lower_bound, bytecode_tvb, offset, (next_operand_address-operand_address), lower_bound_n, "Addr: %u lower_bound_n %u", operand_address, lower_bound_n); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %upper_bound_n */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &upper_bound_n); if (next_operand_address < 0) goto decompression_failure; if (print_in_loop ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_upper_bound, bytecode_tvb, offset, (next_operand_address-operand_address), upper_bound_n, "Addr: %u upper_bound_n %u", operand_address, upper_bound_n); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* %uncompressed_n */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &uncompressed_n); if (next_operand_address < 0) goto decompression_failure; if (print_in_loop ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_uncompressed, bytecode_tvb, offset, (next_operand_address-operand_address), uncompressed_n, "Addr: %u uncompressed_n %u", operand_address, uncompressed_n); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* execute instruction */ if ( outside_huffman_boundaries ) { /* * 2. Request bits_j compressed bits. Interpret the returned bits as an * integer k from 0 to 2^bits_j - 1, as explained in Section 8.2. */ k = decomp_dispatch_get_bits( message_tvb, udvm_tree, bit_order, buff, &old_input_bit_order, &remaining_bits, &input_bits, &input_address, bits_n, &result_code, msg_end, print_level_1); if ( result_code == 11 ) { /* * 4. If data is requested that lies beyond the end of the SigComp * message, terminate the INPUT-HUFFMAN instruction and move program * execution to the memory address specified by the address operand. */ current_address = at_address; goto execute_next_instruction; } /* * 3. Set H := H * 2^bits_j + k. * [In practice is a shift+OR operation.] */ oldH = H; H = (H << bits_n) | k; if (print_level_3 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_set_hu, bytecode_tvb, 0, -1, NULL, " Set H(%u) := H(%u) * 2^bits_j(%u) + k(%u)", H ,oldH, 1<<bits_n,k); } /* * 5. If (H < lower_bound_j) or (H > upper_bound_j) then set j := j + 1. * Then go back to Step 2, unless j > n in which case decompression * failure occurs. */ if ((H < lower_bound_n) || (H > upper_bound_n)) { outside_huffman_boundaries = TRUE; } else { outside_huffman_boundaries = FALSE; print_in_loop = FALSE; /* * 6. Copy (H + uncompressed_j - lower_bound_j) modulo 2^16 to the * memory address specified by the destination operand. */ if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_set_hu, bytecode_tvb, 0, -1, NULL, " H(%u) = H(%u) + uncompressed_n(%u) - lower_bound_n(%u)", (H + uncompressed_n - lower_bound_n ),H, uncompressed_n, lower_bound_n); } H = H + uncompressed_n - lower_bound_n; msb = H >> 8; lsb = H & 0x00ff; if (destination >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; buff[destination] = msb; buff[(destination + 1) & 0xffff]=lsb; if (print_level_1 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_loading_h, message_tvb, input_address, 1, H, " Loading H: %u (0x%x) at Addr: %u,j = %u remaining_bits: %u", H, H, destination,( n - m + 1 ), remaining_bits); } } } m = m - 1; } if ( outside_huffman_boundaries ) { result_code = 10; goto decompression_failure; } current_address = next_operand_address; goto execute_next_instruction; break; case SIGCOMP_INSTR_STATE_ACCESS: /* 31 */ /* STATE-ACCESS (%partial_identifier_start, %partial_identifier_length, * %state_begin, %state_length, %state_address, %state_instruction) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (partial_identifier_start, partial_identifier_length,state_begin, state_length, state_address, state_instruction)"); } start_offset = offset; operand_address = current_address + 1; /* * %partial_identifier_start */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &p_id_start); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_partial_identifier_start, bytecode_tvb, offset, (next_operand_address-operand_address), p_id_start, "Addr: %u partial_identifier_start %u", operand_address, p_id_start); } offset += (next_operand_address-operand_address); /* * %partial_identifier_length */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &p_id_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_partial_identifier_length, bytecode_tvb, offset, (next_operand_address-operand_address), p_id_length, "Addr: %u partial_identifier_length %u", operand_address, p_id_length); } offset += (next_operand_address-operand_address); /* * %state_begin */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_begin); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_state_begin, bytecode_tvb, offset, (next_operand_address-operand_address), state_begin, "Addr: %u state_begin %u", operand_address, state_begin); } offset += (next_operand_address-operand_address); /* * %state_length */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_length, bytecode_tvb, offset, (next_operand_address-operand_address), state_length, "Addr: %u state_length %u", operand_address, state_length); } offset += (next_operand_address-operand_address); /* * %state_address */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_address, bytecode_tvb, offset, (next_operand_address-operand_address), state_address, "Addr: %u state_address %u", operand_address, state_address); } offset += (next_operand_address-operand_address); /* * %state_instruction */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_instruction); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_instr, bytecode_tvb, offset, (next_operand_address-operand_address), state_instruction, "Addr: %u state_instruction %u", operand_address, state_instruction); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## STATE-ACCESS(31) (partial_identifier_start=%u, partial_identifier_length=%u,state_begin=%u, state_length=%u, state_address=%u, state_instruction=%u)", current_address, p_id_start, p_id_length, state_begin, state_length, state_address, state_instruction); } current_address = next_operand_address; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_2 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, message_tvb, input_address, 1, NULL, " byte_copy_right = %u, byte_copy_left = %u", byte_copy_right,byte_copy_left); } result_code = udvm_state_access(message_tvb, udvm_tree, buff, p_id_start, p_id_length, state_begin, &state_length, &state_address, &state_instruction, hf_id); if ( result_code != 0 ) { goto decompression_failure; } used_udvm_cycles = used_udvm_cycles + state_length; goto execute_next_instruction; break; case SIGCOMP_INSTR_STATE_CREATE: /* 32 */ /* * STATE-CREATE (%state_length, %state_address, %state_instruction, * %minimum_access_length, %state_retention_priority) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (state_length, state_address, state_instruction,minimum_access_length, state_retention_priority)"); } start_offset = offset; operand_address = current_address + 1; /* * %state_length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_length, bytecode_tvb, offset, (next_operand_address-operand_address), state_length, "Addr: %u state_length %u", operand_address, state_length); } offset += (next_operand_address-operand_address); /* * %state_address */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_address, bytecode_tvb, offset, (next_operand_address-operand_address), state_address, "Addr: %u state_address %u", operand_address, state_address); } offset += (next_operand_address-operand_address); /* * %state_instruction */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_instruction); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_instr, bytecode_tvb, offset, (next_operand_address-operand_address), state_instruction, "Addr: %u state_instruction %u", operand_address, state_instruction); } offset += (next_operand_address-operand_address); /* * %minimum_access_length */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &minimum_access_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_min_acc_len, bytecode_tvb, offset, (next_operand_address-operand_address), minimum_access_length, "Addr: %u minimum_access_length %u", operand_address, minimum_access_length); } offset += (next_operand_address-operand_address); /* * %state_retention_priority */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_retention_priority); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_ret_pri, bytecode_tvb, offset, (next_operand_address-operand_address), state_retention_priority, "Addr: %u state_retention_priority %u", operand_address, state_retention_priority); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## STATE-CREATE(32) (state_length=%u, state_address=%u, state_instruction=%u,minimum_access_length=%u, state_retention_priority=%u)", current_address, state_length, state_address, state_instruction,minimum_access_length, state_retention_priority); } current_address = next_operand_address; /* Execute the instruction * TODO Implement the instruction * RFC3320: * Note that the new state item cannot be created until a valid * compartment identifier has been returned by the application. * Consequently, when a STATE-CREATE instruction is encountered the UDVM * simply buffers the five supplied operands until the END-MESSAGE * instruction is reached. The steps taken at this point are described * in Section 9.4.9. * * Decompression failure MUST occur if more than four state creation * requests are made before the END-MESSAGE instruction is encountered. * Decompression failure also occurs if the minimum_access_length does * not lie between 6 and 20 inclusive, or if the * state_retention_priority is 65535. */ no_of_state_create++; if ( no_of_state_create > 4 ) { result_code = 12; goto decompression_failure; } if (( minimum_access_length < 6 ) || ( minimum_access_length > STATE_BUFFER_SIZE )) { result_code = 1; goto decompression_failure; } if ( state_retention_priority == 65535 ) { result_code = 13; goto decompression_failure; } state_length_buff[no_of_state_create] = state_length; state_address_buff[no_of_state_create] = state_address; state_instruction_buff[no_of_state_create] = state_instruction; state_minimum_access_length_buff[no_of_state_create] = minimum_access_length; /* state_state_retention_priority_buff[no_of_state_create] = state_retention_priority; */ used_udvm_cycles = used_udvm_cycles + state_length; /* Debug */ byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; n = 0; k = state_address; while ( n < state_length ) { if ( k == byte_copy_right ) { k = byte_copy_left; } string[0]= buff[k]; string[1]= '\0'; if (print_level_3 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_state_value, bytecode_tvb, 0, 0, buff[k], " Addr: %5u State value: %u (0x%x) ASCII(%s)", k,buff[k],buff[k],format_text(wmem_packet_scope(), string, 1)); } k = ( k + 1 ) & 0xffff; n++; } /* End debug */ goto execute_next_instruction; break; case SIGCOMP_INSTR_STATE_FREE: /* 33 */ /* * STATE-FREE (%partial_identifier_start, %partial_identifier_length) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (partial_identifier_start, partial_identifier_length)"); } start_offset = offset; operand_address = current_address + 1; /* * %partial_identifier_start */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &p_id_start); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_partial_identifier_start, bytecode_tvb, offset, (next_operand_address-operand_address), p_id_start, "Addr: %u partial_identifier_start %u", operand_address, p_id_start); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* * %partial_identifier_length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &p_id_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_partial_identifier_length, bytecode_tvb, offset, (next_operand_address-operand_address), p_id_length, "Addr: %u partial_identifier_length %u", operand_address, p_id_length); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## STATE-FREE (partial_identifier_start=%u, partial_identifier_length=%u)", current_address, p_id_start, p_id_length); } current_address = next_operand_address; /* Execute the instruction: * TODO implement it */ udvm_state_free(buff,p_id_start,p_id_length); goto execute_next_instruction; break; case SIGCOMP_INSTR_OUTPUT: /* 34 OUTPUT (%output_start, %output_length) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (output_start, output_length)"); } start_offset = offset; operand_address = current_address + 1; /* * %output_start */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &output_start); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_output_start, bytecode_tvb, offset, (next_operand_address-operand_address), output_start, "Addr: %u output_start %u", operand_address, output_start); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* * %output_length */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &output_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_output_length, bytecode_tvb, offset, (next_operand_address-operand_address), output_length, "Addr: %u output_length %u", operand_address, output_length); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## OUTPUT (output_start=%u, output_length=%u)", current_address, output_start, output_length); } current_address = next_operand_address; /* * Execute instruction * 8.4. Byte copying * : * The string of bytes is copied in ascending order of memory address, * respecting the bounds set by byte_copy_left and byte_copy_right. * More precisely, if a byte is copied from/to Address m then the next * byte is copied from/to Address n where n is calculated as follows: * * Set k := m + 1 (modulo 2^16) * If k = byte_copy_right then set n := byte_copy_left, else set n := k * */ n = 0; k = output_start; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; if (print_level_3 ) { proto_tree_add_bytes_format(udvm_tree, hf_sigcomp_byte_copy, bytecode_tvb, 0, -1, NULL, " byte_copy_right = %u", byte_copy_right); } while ( n < output_length ) { if ( k == byte_copy_right ) { k = byte_copy_left; } out_buff[output_address] = buff[k]; string[0]= buff[k]; string[1]= '\0'; if (print_level_3 ) { proto_tree_add_uint_format(udvm_tree, hf_sigcomp_output_value, bytecode_tvb, 0, -1, buff[k], " Output value: %u (0x%x) ASCII(%s) from Addr: %u ,output to dispatcher position %u", buff[k],buff[k],format_text(wmem_packet_scope(), string,1), k,output_address); } k = ( k + 1 ) & 0xffff; output_address ++; n++; } used_udvm_cycles = used_udvm_cycles + output_length; goto execute_next_instruction; break; case SIGCOMP_INSTR_END_MESSAGE: /* 35 */ /* * END-MESSAGE (%requested_feedback_location, * %returned_parameters_location, %state_length, %state_address, * %state_instruction, %minimum_access_length, * %state_retention_priority) */ if (show_instr_detail_level == 2 ) { proto_item_append_text(addr_item, " (requested_feedback_location,state_instruction, minimum_access_length,state_retention_priority)"); } start_offset = offset; operand_address = current_address + 1; /* %requested_feedback_location */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &requested_feedback_location); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_req_feedback_loc, bytecode_tvb, offset, (next_operand_address-operand_address), requested_feedback_location, "Addr: %u requested_feedback_location %u", operand_address, requested_feedback_location); } offset += (next_operand_address-operand_address); operand_address = next_operand_address; /* returned_parameters_location */ next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &returned_parameters_location); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_ret_param_loc, bytecode_tvb, offset, (next_operand_address-operand_address), returned_parameters_location, "Addr: %u returned_parameters_location %u", operand_address, returned_parameters_location); } offset += (next_operand_address-operand_address); /* * %state_length */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_length, bytecode_tvb, offset, (next_operand_address-operand_address), state_length, "Addr: %u state_length %u", operand_address, state_length); } offset += (next_operand_address-operand_address); /* * %state_address */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_address); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_address, bytecode_tvb, offset, (next_operand_address-operand_address), state_address, "Addr: %u state_address %u", operand_address, state_address); } offset += (next_operand_address-operand_address); /* * %state_instruction */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_instruction); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_instr, bytecode_tvb, offset, (next_operand_address-operand_address), state_instruction, "Addr: %u state_instruction %u", operand_address, state_instruction); } offset += (next_operand_address-operand_address); /* * %minimum_access_length */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &minimum_access_length); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_min_acc_len, bytecode_tvb, offset, (next_operand_address-operand_address), minimum_access_length, "Addr: %u minimum_access_length %u", operand_address, minimum_access_length); } offset += (next_operand_address-operand_address); /* * %state_retention_priority */ operand_address = next_operand_address; next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &state_retention_priority); if (next_operand_address < 0) goto decompression_failure; if (show_instr_detail_level == 2 ) { proto_tree_add_uint_format(udvm_tree, hf_udvm_state_ret_pri, bytecode_tvb, offset, (next_operand_address-operand_address), state_retention_priority, "Addr: %u state_retention_priority %u", operand_address, state_retention_priority); } offset += (next_operand_address-operand_address); if (show_instr_detail_level == 1) { proto_tree_add_none_format(udvm_tree, hf_sigcomp_decompress_instruction, bytecode_tvb, start_offset, offset-start_offset, "Addr: %u ## END-MESSAGE (requested_feedback_location=%u, returned_parameters_location=%u, state_length=%u, state_address=%u, state_instruction=%u, minimum_access_length=%u, state_retention_priority=%u)", current_address, requested_feedback_location, returned_parameters_location, state_length, state_address, state_instruction, minimum_access_length,state_retention_priority); } /* TODO: This isn't currently totally correct as END_INSTRUCTION might not create state */ no_of_state_create++; if ( no_of_state_create > 4 ) { result_code = 12; goto decompression_failure; } state_length_buff[no_of_state_create] = state_length; state_address_buff[no_of_state_create] = state_address; state_instruction_buff[no_of_state_create] = state_instruction; /* Not used ? */ state_minimum_access_length_buff[no_of_state_create] = minimum_access_length; /* state_state_retention_priority_buff[no_of_state_create] = state_retention_priority; */ /* Execute the instruction */ proto_tree_add_uint(udvm_tree, hf_sigcomp_num_state_create, bytecode_tvb, 0, 0, no_of_state_create); if ( no_of_state_create != 0 ) { memset(sha1_digest_buf, 0, STATE_BUFFER_SIZE); n = 1; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; byte_copy_left = byte_copy_left | buff[65]; while ( n < no_of_state_create + 1 ) { sha1buff = (guint8 *)g_malloc(state_length_buff[n]+8); sha1buff[0] = state_length_buff[n] >> 8; sha1buff[1] = state_length_buff[n] & 0xff; sha1buff[2] = state_address_buff[n] >> 8; sha1buff[3] = state_address_buff[n] & 0xff; sha1buff[4] = state_instruction_buff[n] >> 8; sha1buff[5] = state_instruction_buff[n] & 0xff; sha1buff[6] = state_minimum_access_length_buff[n] >> 8; sha1buff[7] = state_minimum_access_length_buff[n] & 0xff; if (print_level_3 ) { proto_tree_add_bytes_with_length(udvm_tree, hf_sigcomp_sha1buff, bytecode_tvb, 0, -1, sha1buff, 8); } k = state_address_buff[n]; for ( x=0; x < state_length_buff[n]; x++) { if ( k == byte_copy_right ) { k = byte_copy_left; } sha1buff[8+x] = buff[k]; k = ( k + 1 ) & 0xffff; } gcry_md_hash_buffer(GCRY_MD_SHA1, sha1_digest_buf, (guint8 *) sha1buff, state_length_buff[n] + 8); if (print_level_3 ) { proto_tree_add_bytes_with_length(udvm_tree, hf_sigcomp_sha1_digest, bytecode_tvb, 0, -1, sha1_digest_buf, STATE_BUFFER_SIZE); } /* begin partial state-id change [email protected] */ #if 0 udvm_state_create(sha1buff, sha1_digest_buf, state_minimum_access_length_buff[n]); #endif udvm_state_create(sha1buff, sha1_digest_buf, STATE_MIN_ACCESS_LEN); /* end partial state-id change [email protected] */ proto_tree_add_item(udvm_tree, hf_sigcomp_creating_state, bytecode_tvb, 0, -1, ENC_NA); proto_tree_add_string(udvm_tree,hf_id, bytecode_tvb, 0, 0, bytes_to_str(wmem_packet_scope(), sha1_digest_buf, STATE_MIN_ACCESS_LEN)); n++; } } /* At least something got decompressed, show it */ decomp_tvb = tvb_new_child_real_data(message_tvb, out_buff,output_address,output_address); add_new_data_source(pinfo, decomp_tvb, "Decompressed SigComp message"); proto_tree_add_item(udvm_tree, hf_sigcomp_sigcomp_message_decompressed, decomp_tvb, 0, -1, ENC_NA); used_udvm_cycles += state_length; proto_tree_add_uint(udvm_tree, hf_sigcomp_max_udvm_cycles, bytecode_tvb, 0, 0, maximum_UDVM_cycles); proto_tree_add_uint(udvm_tree, hf_sigcomp_used_udvm_cycles, bytecode_tvb, 0, 0, used_udvm_cycles); return decomp_tvb; break; default: expert_add_info_format(pinfo, addr_item, &ei_sigcomp_invalid_instruction, "Addr %u Invalid instruction: %u (0x%x)", current_address,current_instruction,current_instruction); break; } return NULL; decompression_failure: proto_tree_add_expert_format(udvm_tree, pinfo, &ei_sigcomp_decompression_failure, bytecode_tvb, 0, -1, "DECOMPRESSION FAILURE: %s", val_to_str(result_code, result_code_vals,"Unknown (%u)")); return NULL; } /********************************************************************************************** * * SIGCOMP DISSECTOR * **********************************************************************************************/ /* Sigcomp over TCP record marking used * RFC 3320 * 4.2.2. Record Marking * * For a stream-based transport, the dispatcher delimits messages by * parsing the compressed data stream for instances of 0xFF and taking * the following actions: * Occurs in data stream: Action: * * 0xFF 00 one 0xFF byte in the data stream * 0xFF 01 same, but the next byte is quoted (could * be another 0xFF) * : : * 0xFF 7F same, but the next 127 bytes are quoted * 0xFF 80 to 0xFF FE (reserved for future standardization) * 0xFF FF end of SigComp message * : * In UDVM version 0x01, any occurrence of the combinations 0xFF80 to * 0xFFFE that are not protected by quoting causes decompression * failure; the decompressor SHOULD close the stream-based transport in * this case. */ /* * TODO: Reassembly, handle more than one message in a tcp segment. */ static int dissect_sigcomp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *_data _U_) { proto_item *ti; proto_tree *sigcomp_tree; tvbuff_t *unescaped_tvb; guint8 *buff; int offset = 0; int length; guint8 octet; guint16 data; int i; int n; gboolean end_off_message; top_tree = tree; /* Is this SIGCOMP ? */ data = tvb_get_ntohs(tvb, offset); if (data == 0xffff) { /* delimiter */ offset = offset + 2; octet = tvb_get_guint8(tvb,offset); } else { octet = tvb_get_guint8(tvb,offset); } if ((octet & 0xf8) != 0xf8) return offset; /* Search for delimiter 0xffff in the remain tvb buffer */ length = tvb_reported_length_remaining(tvb, offset); for (i=0; i<(length-1); ++i) { /* Loop end criteria is (length-1) because we take 2 bytes each loop */ data = tvb_get_ntohs(tvb, offset+i); if (0xffff == data) break; } if (i >= (length-1)) { /* SIGCOMP may be subdissector of SIP, so we use * pinfo->saved_can_desegment to determine whether do desegment * as well as pinfo->can_desegment */ if (pinfo->can_desegment || pinfo->saved_can_desegment) { /* Delimiter oxffff was not found, not a complete SIGCOMP PDU */ pinfo->desegment_offset = offset; pinfo->desegment_len=DESEGMENT_ONE_MORE_SEGMENT; return -1; } } /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIGCOMP"); col_clear(pinfo->cinfo, COL_INFO); length = tvb_reported_length(tvb); try_again: /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, ENC_NA); sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp); i=0; end_off_message = FALSE; buff = (guint8 *)wmem_alloc(pinfo->pool, length-offset); if (udvm_print_detail_level>2) proto_tree_add_item(sigcomp_tree, hf_sigcomp_starting_to_remove_escape_digits, tvb, offset, -1, ENC_NA); while ((offset < length) && (end_off_message == FALSE)) { octet = tvb_get_guint8(tvb,offset); if ( octet == 0xff ) { if ( offset +1 >= length ) { /* if the tvb is short don't check for the second escape digit */ offset++; continue; } if (udvm_print_detail_level>2) proto_tree_add_none_format(sigcomp_tree, hf_sigcomp_escape_digit_found, tvb, offset, 2, " Escape digit found (0xFF)"); octet = tvb_get_guint8(tvb, offset+1); if ( octet == 0) { buff[i] = 0xff; offset = offset +2; i++; continue; } if ((octet > 0x7f) && (octet < 0xff )) { if (udvm_print_detail_level>2) proto_tree_add_none_format(sigcomp_tree, hf_sigcomp_illegal_escape_code, tvb, offset, 2, " Illegal escape code"); offset += tvb_captured_length_remaining(tvb,offset); return offset; } if ( octet == 0xff) { if (udvm_print_detail_level>2) proto_tree_add_none_format(sigcomp_tree, hf_sigcomp_end_of_sigcomp_message_indication_found, tvb, offset, 2, " End of SigComp message indication found (0xFFFF)"); end_off_message = TRUE; offset = offset+2; continue; } buff[i] = 0xff; if (udvm_print_detail_level>2) proto_tree_add_uint_format(sigcomp_tree, hf_sigcomp_addr_value, tvb, offset, 1, buff[i], " Addr: %u tvb value(0x%0x) ", i, buff[i]); i++; offset = offset+2; if (udvm_print_detail_level>2) proto_tree_add_bytes_format(sigcomp_tree, hf_sigcomp_copying_bytes_literally, tvb, offset, octet, NULL, " Copying %u bytes literally",octet); if ( offset+octet >= length) /* if the tvb is short don't copy further than the end */ octet = length - offset; for ( n=0; n < octet; n++ ) { buff[i] = tvb_get_guint8(tvb, offset); if (udvm_print_detail_level>2) proto_tree_add_uint_format(sigcomp_tree, hf_sigcomp_addr_value, tvb, offset, 1, buff[i], " Addr: %u tvb value(0x%0x) ", i, buff[i]); i++; offset++; } continue; } buff[i] = octet; if (udvm_print_detail_level>2) proto_tree_add_uint_format(sigcomp_tree, hf_sigcomp_addr_value, tvb, offset, 1, buff[i], " Addr: %u tvb value(0x%0x) ", i, buff[i]); i++; offset++; } unescaped_tvb = tvb_new_child_real_data(tvb, buff,i,i); add_new_data_source(pinfo, unescaped_tvb, "Unescaped Data handed to the SigComp dissector"); proto_tree_add_item(sigcomp_tree, hf_sigcomp_data_for_sigcomp_dissector, unescaped_tvb, 0, -1, ENC_NA); if (end_off_message == TRUE) { dissect_sigcomp_common(unescaped_tvb, pinfo, sigcomp_tree); } else { proto_tree_add_expert(sigcomp_tree, pinfo, &ei_sigcomp_tcp_fragment, unescaped_tvb, 0, -1); } if ( offset < length) { goto try_again; } return offset; } /* Code to actually dissect the packets */ static int dissect_sigcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti; proto_tree *sigcomp_tree; gint offset = 0; gint8 octet; /* If we got called from SIP this might be over TCP */ if ( pinfo->ptype == PT_TCP ) return dissect_sigcomp_tcp(tvb, pinfo, tree, NULL); /* Is this a SigComp message or not ? */ octet = tvb_get_guint8(tvb, offset); if ((octet & 0xf8) != 0xf8) return 0; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIGCOMP"); col_clear(pinfo->cinfo, COL_INFO); top_tree = tree; /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, ENC_NA); sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp); return dissect_sigcomp_common(tvb, pinfo, sigcomp_tree); } /* Code to actually dissect the packets */ static int dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tree) { /* Set up structures needed to add the protocol subtree and manage it */ tvbuff_t *udvm_tvb, *msg_tvb, *udvm2_tvb; tvbuff_t *decomp_tvb = NULL; proto_item *udvm_bytecode_item, *udvm_exe_item; proto_tree *sigcomp_udvm_tree, *sigcomp_udvm_exe_tree; gint offset = 0; gint bytecode_offset; guint16 partial_state_len; guint octet; guint8 returned_feedback_field[128]; guint8 partial_state[12]; guint tbit; guint16 len = 0; guint16 bytecode_len = 0; guint destination; gint msg_len = 0; guint8 *buff; guint16 p_id_start; guint8 i; guint16 state_begin; guint16 state_length; guint16 state_address; guint16 state_instruction; guint16 result_code; gchar *partial_state_str; guint8 nack_version; /* add an item to the subtree, see section 1.6 for more information */ octet = tvb_get_guint8(tvb, offset); /* A SigComp message takes one of two forms depending on whether it * accesses a state item at the receiving endpoint. The two variants of * a SigComp message are given in Figure 3. (The T-bit controls the * format of the returned feedback item and is defined in Section 7.1.) * * 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | 1 1 1 1 1 | T | len | | 1 1 1 1 1 | T | 0 | * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | | | | * : returned feedback item : : returned feedback item : * | | | | * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | | | code_len | * : partial state identifier : +---+---+---+---+---+---+---+---+ * * | | | code_len | destination | * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | | | | * : remaining SigComp message : : uploaded UDVM bytecode : * | | | | * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | | * : remaining SigComp message : * | | * +---+---+---+---+---+---+---+---+ * * RFC 4077: * The format of the NACK message and the use of the fields within it * are shown in Figure 1. * * 0 1 2 3 4 5 6 7 * +---+---+---+---+---+---+---+---+ * | 1 1 1 1 1 | T | 0 | * +---+---+---+---+---+---+---+---+ * | | * : returned feedback item : * | | * +---+---+---+---+---+---+---+---+ * | code_len = 0 | * +---+---+---+---+---+---+---+---+ * | code_len = 0 | version = 1 | * +---+---+---+---+---+---+---+---+ * | Reason Code | * +---+---+---+---+---+---+---+---+ * | OPCODE of failed instruction | * +---+---+---+---+---+---+---+---+ * | PC of failed instruction | * | | * +---+---+---+---+---+---+---+---+ * | | * : SHA-1 Hash of failed message : * | | * +---+---+---+---+---+---+---+---+ * | | * : Error Details : * | | * +---+---+---+---+---+---+---+---+ * Figure 1: SigComp NACK Message Format */ proto_tree_add_item(sigcomp_tree,hf_sigcomp_t_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(sigcomp_tree,hf_sigcomp_len, tvb, offset, 1, ENC_BIG_ENDIAN); tbit = ( octet & 0x04)>>2; partial_state_len = octet & 0x03; offset ++; if ( partial_state_len != 0 ) { /* * The len field encodes the number of transmitted bytes as follows: * * Encoding: Length of partial state identifier * * 01 6 bytes * 10 9 bytes * 11 12 bytes * */ partial_state_len = partial_state_len * 3 + 3; /* * Message format 1 */ col_set_str(pinfo->cinfo, COL_INFO, "Msg format 1"); if ( tbit == 1 ) { /* * Returned feedback item exists */ len = 1; octet = tvb_get_guint8(tvb, offset); /* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | 0 | returned_feedback_field | | 1 | returned_feedback_length | * +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+ * | | * : returned_feedback_field : * | | * +---+---+---+---+---+---+---+---+ * Figure 4: Format of returned feedback item */ if ( (octet & 0x80) != 0 ) { len = octet & 0x7f; proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; tvb_memcpy(tvb,returned_feedback_field,offset, len); } else { returned_feedback_field[0] = tvb_get_guint8(tvb, offset) & 0x7f; } proto_tree_add_bytes(sigcomp_tree,hf_sigcomp_returned_feedback_item, tvb, offset, len, returned_feedback_field); offset = offset + len; } tvb_memcpy(tvb, partial_state, offset, partial_state_len); partial_state_str = bytes_to_str(wmem_packet_scope(), partial_state, partial_state_len); proto_tree_add_string(sigcomp_tree,hf_sigcomp_partial_state, tvb, offset, partial_state_len, partial_state_str); offset = offset + partial_state_len; msg_len = tvb_reported_length_remaining(tvb, offset); if (msg_len>0) { proto_item *ti; ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_remaining_message_bytes, tvb, offset, 0, msg_len); proto_item_set_generated(ti); } if ( decompress ) { msg_tvb = tvb_new_subset_length(tvb, offset, msg_len); /* * buff = Where "state" will be stored * p_id_start = Partial state identifier start pos in the buffer(buff) * partial_state_len = Partial state identifier length * state_begin = Where to start to read state from * state_length = Length of state * state_address = Address where to store the state in the buffer(buff) * state_instruction = * TRUE = Indicates that state_* is in the stored state */ /* * Note: The allocated buffer must be zeroed or some strange effects might occur. */ buff = (guint8 *)wmem_alloc0(pinfo->pool, UDVM_MEMORY_SIZE); p_id_start = 0; state_begin = 0; /* These values will be loaded from the buffered state in sigcomp_state_hdlr */ state_length = 0; state_address = 0; state_instruction =0; i = 0; while ( i < partial_state_len ) { buff[i] = partial_state[i]; i++; } /* begin partial state-id change [email protected] */ #if 0 result_code = udvm_state_access(tvb, sigcomp_tree, buff, p_id_start, partial_state_len, state_begin, &state_length, &state_address, &state_instruction, hf_sigcomp_partial_state); #endif result_code = udvm_state_access(tvb, sigcomp_tree, buff, p_id_start, STATE_MIN_ACCESS_LEN, state_begin, &state_length, &state_address, &state_instruction, hf_sigcomp_partial_state); /* end partial state-id change [email protected] */ if ( result_code != 0 ) { proto_tree_add_expert_format(sigcomp_tree, pinfo, &ei_sigcomp_failed_to_access_state_wireshark_udvm_diagnostic, tvb, 0, -1, "Failed to Access state Wireshark UDVM diagnostic: %s", val_to_str(result_code, result_code_vals,"Unknown (%u)")); return tvb_captured_length(tvb); } udvm_tvb = tvb_new_child_real_data(tvb, buff,state_length+state_address,state_length+state_address); add_new_data_source(pinfo, udvm_tvb, "State/ExecutionTrace"); udvm2_tvb = tvb_new_subset_length(udvm_tvb, state_address, state_length); udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace, udvm2_tvb, 0, state_length, ENC_NA); sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe); decomp_tvb = decompress_sigcomp_message(udvm2_tvb, msg_tvb, pinfo, sigcomp_udvm_exe_tree, state_address, udvm_print_detail_level, hf_sigcomp_partial_state, offset, state_length, partial_state_len, state_instruction); if ( decomp_tvb ) { proto_item *ti; guint32 compression_ratio = (guint32)(((float)tvb_reported_length(decomp_tvb) / (float)tvb_reported_length(tvb)) * 100); /* Show compression ratio achieved */ ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_compression_ratio, decomp_tvb, 0, 0, compression_ratio); proto_item_set_generated(ti); if ( display_raw_txt ) tvb_raw_text_add(decomp_tvb, top_tree); col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); col_set_fence(pinfo->cinfo,COL_PROTOCOL); call_dissector(sip_handle, decomp_tvb, pinfo, top_tree); } }/* if decompress */ } else{ /* * Message format 2 */ col_set_str(pinfo->cinfo, COL_INFO, "Msg format 2"); if ( tbit == 1 ) { /* * Returned feedback item exists */ len = 1; octet = tvb_get_guint8(tvb, offset); if ( (octet & 0x80) != 0 ) { len = octet & 0x7f; proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; } tvb_memcpy(tvb,returned_feedback_field,offset, len); proto_tree_add_bytes(sigcomp_tree,hf_sigcomp_returned_feedback_item, tvb, offset, len, returned_feedback_field); offset = offset + len; } len = tvb_get_ntohs(tvb, offset) >> 4; nack_version = tvb_get_guint8(tvb, offset+1) & 0x0f; if ((len == 0) && (nack_version == 1)) { /* NACK MESSAGE */ proto_item *reason_ti; guint8 opcode; offset++; proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_ver, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; octet = tvb_get_guint8(tvb, offset); reason_ti = proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; opcode = tvb_get_guint8(tvb, offset); proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_failed_op_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Add expert item for NACK */ expert_add_info_format(pinfo, reason_ti, &ei_sigcomp_nack_failed_op_code, "SigComp NACK (reason=%s, opcode=%s)", val_to_str_ext_const(octet, &sigcomp_nack_reason_code_vals_ext, "Unknown"), val_to_str_ext_const(opcode, &udvm_instruction_code_vals_ext, "Unknown")); proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_pc, tvb, offset, 2, ENC_BIG_ENDIAN); offset = offset +2; proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_sha1, tvb, offset, HASH_SHA1_LENGTH, ENC_NA); offset = offset + HASH_SHA1_LENGTH; /* Add NACK info to info column */ col_append_fstr(pinfo->cinfo, COL_INFO, " NACK reason=%s, opcode=%s", val_to_str_ext_const(octet, &sigcomp_nack_reason_code_vals_ext, "Unknown"), val_to_str_ext_const(opcode, &udvm_instruction_code_vals_ext, "Unknown")); switch ( octet) { case SIGCOMP_NACK_STATE_NOT_FOUND: case SIGCOMP_NACK_ID_NOT_UNIQUE: case SIGCOMP_NACK_STATE_TOO_SHORT: /* State ID (6 - 20 bytes) */ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_state_id, tvb, offset, -1, ENC_NA); break; case SIGCOMP_NACK_CYCLES_EXHAUSTED: /* Cycles Per Bit (1 byte) */ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_cycles_per_bit, tvb, offset, 1, ENC_BIG_ENDIAN); break; case SIGCOMP_NACK_BYTECODES_TOO_LARGE: /* Memory size (2 bytes) */ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_memory_size, tvb, offset, 2, ENC_BIG_ENDIAN); break; default: break; } } else { octet = tvb_get_guint8(tvb, (offset + 1)); destination = (octet & 0x0f); if ( destination != 0 ) destination = 64 + ( destination * 64 ); proto_tree_add_item(sigcomp_tree,hf_sigcomp_code_len, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(sigcomp_tree,hf_sigcomp_destination, tvb, (offset+ 1), 1, ENC_BIG_ENDIAN); offset = offset +2; bytecode_len = len; bytecode_offset = offset; udvm_bytecode_item = proto_tree_add_item(sigcomp_tree, hf_sigcomp_udvm_bytecode, tvb, bytecode_offset, bytecode_len, ENC_NA); proto_item_append_text(udvm_bytecode_item, " %u (0x%x) bytes", bytecode_len, bytecode_len); sigcomp_udvm_tree = proto_item_add_subtree( udvm_bytecode_item, ett_sigcomp_udvm); udvm_tvb = tvb_new_subset_length(tvb, offset, len); if ( dissect_udvm_code ) dissect_udvm_bytecode(udvm_tvb, pinfo, sigcomp_udvm_tree, destination); offset = offset + len; msg_len = tvb_reported_length_remaining(tvb, offset); if (msg_len>0) { proto_item *ti = proto_tree_add_item(sigcomp_tree, hf_sigcomp_remaining_sigcomp_message, tvb, offset, -1, ENC_NA); proto_item_set_generated(ti); } if ( decompress ) { msg_tvb = tvb_new_subset_length(tvb, offset, msg_len); udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace, tvb, bytecode_offset, bytecode_len, ENC_NA); sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe); decomp_tvb = decompress_sigcomp_message(udvm_tvb, msg_tvb, pinfo, sigcomp_udvm_exe_tree, destination, udvm_print_detail_level, hf_sigcomp_partial_state, offset, 0, 0, destination); if ( decomp_tvb ) { proto_item *ti; guint32 compression_ratio = (guint32)(((float)tvb_reported_length(decomp_tvb) / (float)tvb_reported_length(tvb)) * 100); /* Show compression ratio achieved */ ti = proto_tree_add_uint(sigcomp_tree, hf_sigcomp_compression_ratio, decomp_tvb, 0, 0, compression_ratio); proto_item_set_generated(ti); if ( display_raw_txt ) tvb_raw_text_add(decomp_tvb, top_tree); col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); col_set_fence(pinfo->cinfo,COL_PROTOCOL); call_dissector(sip_handle, decomp_tvb, pinfo, top_tree); } } /* if decompress */ }/*if len==0 */ } return tvb_captured_length(tvb); } static void dissect_udvm_bytecode(tvbuff_t *udvm_tvb, packet_info* pinfo, proto_tree *sigcomp_udvm_tree,guint start_address) { guint instruction; gint offset = 0; gint start_offset = 0; gint len; gint n; guint instruction_no = 0; guint16 value = 0; proto_item *item, *item2; guint UDVM_address = start_address; gboolean is_memory_address; guint16 msg_length = tvb_reported_length_remaining(udvm_tvb, offset); while (msg_length > offset) { instruction = tvb_get_guint8(udvm_tvb, offset); instruction_no ++; UDVM_address = start_address + offset; item = proto_tree_add_uint_format(sigcomp_udvm_tree, hf_sigcomp_udvm_instruction, udvm_tvb, offset, 1, instruction_no, "######### UDVM instruction %u at UDVM-address %u (0x%x) #########", instruction_no,UDVM_address,UDVM_address); proto_item_set_generated(item); proto_tree_add_item(sigcomp_udvm_tree, hf_sigcomp_udvm_instr, udvm_tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; switch ( instruction ) { case SIGCOMP_INSTR_AND: /* 1 AND ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_OR: /* 2 OR ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_NOT: /* 3 NOT ($operand_1) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_LSHIFT: /* 4 LSHIFT ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_RSHIFT: /* 5 RSHIFT ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_ADD: /* 6 ADD ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_SUBTRACT: /* 7 SUBTRACT ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_MULTIPLY: /* 8 MULTIPLY ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_DIVIDE: /* 9 DIVIDE ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_REMAINDER: /* 10 REMAINDER ($operand_1, %operand_2) */ /* $operand_1*/ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_1, udvm_tvb, start_offset, len, value); /* %operand_2*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_operand_2, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_SORT_ASCENDING: /* 11 SORT-ASCENDING (%start, %n, %k) */ /* while programming stop while loop */ offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); break; case SIGCOMP_INSTR_SORT_DESCENDING: /* 12 SORT-DESCENDING (%start, %n, %k) */ offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); break; case SIGCOMP_INSTR_SHA_1: /* 13 SHA-1 (%position, %length, %destination) */ /* %position */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, udvm_tvb, start_offset, len, value); /* %length, */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* $destination */ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_LOAD: /* 14 LOAD (%address, %value) */ /* %address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, udvm_tvb, start_offset, len, value); /* %value */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_MULTILOAD: /* 15 MULTILOAD (%address, #n, %value_0, ..., %value_n-1) */ /* %address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, udvm_tvb, start_offset, len, value); /* #n */ offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, udvm_tvb, start_offset, len, value); n = value; while ( n > 0) { n = n -1; /* %value */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, udvm_tvb, start_offset, len, value); } } break; case SIGCOMP_INSTR_PUSH: /* 16 PUSH (%value) */ /* %value */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_POP: /* 17 POP (%address) */ /* %address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_COPY: /* 18 COPY (%position, %length, %destination) */ /* %position */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, udvm_tvb, start_offset, len, value); /* %length, */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* $destination */ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_COPY_LITERAL: /* 19 COPY-LITERAL (%position, %length, $destination) */ /* %position */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, udvm_tvb, start_offset, len, value); /* %length, */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* $destination */ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_COPY_OFFSET: /* 20 COPY-OFFSET (%offset, %length, $destination) */ /* %offset */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_offset, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_offset, udvm_tvb, start_offset, len, value); } /* %length, */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* $destination */ offset = dissect_udvm_reference_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ref_dest, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_MEMSET: /* 21 MEMSET (%address, %length, %start_value, %offset) */ /* %address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_address, udvm_tvb, start_offset, len, value); /* %length, */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* %start_value */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_start_value, udvm_tvb, start_offset, len, value); /* %offset */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_offset, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_JUMP: /* 22 JUMP (@address) */ /* @address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_COMPARE: /* 23 */ /* COMPARE (%value_1, %value_2, @address_1, @address_2, @address_3) */ /* %value_1 */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, udvm_tvb, start_offset, len, value); } /* %value_2 */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, udvm_tvb, start_offset, len, value); } /* @address_1 */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); /* @address_2 */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); /* @address_3 */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_CALL: /* 24 CALL (@address) (PUSH addr )*/ /* @address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_RETURN: /* 25 POP and return */ break; case SIGCOMP_INSTR_SWITCH: /* 26 SWITCH (#n, %j, @address_0, @address_1, ... , @address_n-1) */ /* #n */ offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, udvm_tvb, start_offset, len, value); /* Number of addresses in the instruction */ n = value; /* %j */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_j, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_j, udvm_tvb, start_offset, len, value); } while ( n > 0) { n = n -1; /* @address_n-1 */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE,&start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_CRC: /* 27 CRC (%value, %position, %length, @address) */ /* %value */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_value, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_value, udvm_tvb, start_offset, len, value); } /* %position */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_position, udvm_tvb, start_offset, len, value); /* %length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* @address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_INPUT_BYTES: /* 28 INPUT-BYTES (%length, %destination, @address) */ /* %length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* %destination */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, udvm_tvb, start_offset, len, value); } /* @address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_INPUT_BITS:/* 29 INPUT-BITS (%length, %destination, @address) */ /* %length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_length, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_length, udvm_tvb, start_offset, len, value); } /* %destination */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, udvm_tvb, start_offset, len, value); } /* @address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_INPUT_HUFFMAN: /* 30 */ /* * INPUT-HUFFMAN (%destination, @address, #n, %bits_1, %lower_bound_1, * %upper_bound_1, %uncompressed_1, ... , %bits_n, %lower_bound_n, * %upper_bound_n, %uncompressed_n) */ /* %destination */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_destination, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_destination, udvm_tvb, start_offset, len, value); } /* @address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; /* operand_value = (memory_address_of_instruction + D) modulo 2^16 */ value = ( value + UDVM_address ) & 0xffff; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_at_address, udvm_tvb, start_offset, len, value); /* #n */ offset = dissect_udvm_literal_operand(udvm_tvb, sigcomp_udvm_tree, offset, &start_offset, &value); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_num, udvm_tvb, start_offset, len, value); n = value; while ( n > 0) { n = n -1; /* %bits_n */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_bits, udvm_tvb, start_offset, len, value); /* %lower_bound_n*/ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_lower_bound, udvm_tvb, start_offset, len, value); /* %upper_bound_n */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_upper_bound, udvm_tvb, start_offset, len, value); /* %uncompressed_n */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, FALSE,&start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_uncompressed, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_STATE_ACCESS: /* 31 */ /* STATE-ACCESS (%partial_identifier_start, %partial_identifier_length, * %state_begin, %state_length, %state_address, %state_instruction) */ /* * %partial_identifier_start */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_start, udvm_tvb, start_offset, len, value); /* * %partial_identifier_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_length, udvm_tvb, start_offset, len, value); /* * %state_begin */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_state_begin, udvm_tvb, start_offset, len, value); /* * %state_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, udvm_tvb, start_offset, len, value); } /* * %state_address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value ,&is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, udvm_tvb, start_offset, len, value); } /* * %state_instruction */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_STATE_CREATE: /* 32 */ /* * STATE-CREATE (%state_length, %state_address, %state_instruction, * %minimum_access_length, %state_retention_priority) */ /* * %state_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, udvm_tvb, start_offset, len, value); } /* * %state_address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, udvm_tvb, start_offset, len, value); } /* * %state_instruction */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, udvm_tvb, start_offset, len, value); /* * %minimum_access_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_min_acc_len, udvm_tvb, start_offset, len, value); /* * %state_retention_priority */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_ret_pri, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_STATE_FREE: /* 33 */ /* * STATE-FREE (%partial_identifier_start, %partial_identifier_length) */ /* * %partial_identifier_start */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_start, udvm_tvb, start_offset, len, value); /* * %partial_identifier_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_partial_identifier_length, udvm_tvb, start_offset, len, value); break; case SIGCOMP_INSTR_OUTPUT: /* 34 OUTPUT (%output_start, %output_length) */ /* * %output_start */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_addr_output_start, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_start, udvm_tvb, start_offset, len, value); } /* * %output_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_length_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_output_length, udvm_tvb, start_offset, len, value); } break; case SIGCOMP_INSTR_END_MESSAGE: /* 35 */ /* * END-MESSAGE (%requested_feedback_location, * %returned_parameters_location, %state_length, %state_address, * %state_instruction, %minimum_access_length, * %state_retention_priority) */ /* %requested_feedback_location */ if ((msg_length-1) < offset) { proto_tree_add_expert(sigcomp_udvm_tree, pinfo, &ei_sigcomp_all_remaining_parameters_zero, udvm_tvb, 0, -1); return; } offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_req_feedback_loc, udvm_tvb, start_offset, len, value); /* returned_parameters_location */ if ((msg_length-1) < offset) { proto_tree_add_expert(sigcomp_udvm_tree, pinfo, &ei_sigcomp_all_remaining_parameters_zero, udvm_tvb, offset-1, -1); return; } offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_ret_param_loc, udvm_tvb, start_offset, len, value); /* * %state_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_length, udvm_tvb, start_offset, len, value); } /* * %state_address */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; if ( is_memory_address ) { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address_addr, udvm_tvb, start_offset, len, value); } else { proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_address, udvm_tvb, start_offset, len, value); } /* * %state_instruction */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_instr, udvm_tvb, start_offset, len, value); /* * %minimum_access_length */ offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_min_acc_len, udvm_tvb, start_offset, len, value); /* * %state_retention_priority */ if ( tvb_reported_length_remaining(udvm_tvb, offset) != 0 ) { offset = dissect_udvm_multitype_operand(udvm_tvb, sigcomp_udvm_tree, offset, TRUE, &start_offset, &value, &is_memory_address); len = offset - start_offset; proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_state_ret_pri, udvm_tvb, start_offset, len, value); } else { item2 = proto_tree_add_uint_format_value(sigcomp_udvm_tree, hf_udvm_state_ret_pri, udvm_tvb, offset, 1, 0, "0 (Not in the uploaded code as UDVM buffer initialized to Zero"); proto_item_set_generated(item2); } if ( tvb_reported_length_remaining(udvm_tvb, offset) != 0 ) { len = tvb_reported_length_remaining(udvm_tvb, offset); UDVM_address = start_address + offset; proto_tree_add_bytes_format(sigcomp_udvm_tree, hf_sigcomp_remaining_bytes, udvm_tvb, offset, len, NULL, "Remaining %u bytes starting at UDVM addr %u (0x%x)- State information ?",len, UDVM_address, UDVM_address); } offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); break; default: offset = offset + tvb_reported_length_remaining(udvm_tvb, offset); break; } } return; } /* The simplest operand type is the literal (#), which encodes a * constant integer from 0 to 65535 inclusive. A literal operand may * require between 1 and 3 bytes depending on its value. * Bytecode: Operand value: Range: * 0nnnnnnn N 0 - 127 * 10nnnnnn nnnnnnnn N 0 - 16383 * 11000000 nnnnnnnn nnnnnnnn N 0 - 65535 * * Figure 8: Bytecode for a literal (#) operand * */ static int dissect_udvm_literal_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, gint offset, gint *start_offset, guint16 *value) { guint bytecode; guint16 operand; guint test_bits; guint display_bytecode; bytecode = tvb_get_guint8(udvm_tvb, offset); test_bits = bytecode >> 7; if (test_bits == 1) { test_bits = bytecode >> 6; if (test_bits == 2) { /* * 10nnnnnn nnnnnnnn N 0 - 16383 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = tvb_get_ntohs(udvm_tvb, offset) & 0x3fff; *value = operand; *start_offset = offset; offset = offset + 2; } else { /* * 111000000 nnnnnnnn nnnnnnnn N 0 - 65535 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, udvm_tvb, offset, 1, display_bytecode); offset ++; operand = tvb_get_ntohs(udvm_tvb, offset); *value = operand; *start_offset = offset; offset = offset + 2; } } else { /* * 0nnnnnnn N 0 - 127 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_literal_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = ( bytecode & 0x7f); *value = operand; *start_offset = offset; offset ++; } return offset; } /* * The second operand type is the reference ($), which is always used to * access a 2-byte value located elsewhere in the UDVM memory. The * bytecode for a reference operand is decoded to be a constant integer * from 0 to 65535 inclusive, which is interpreted as the memory address * containing the actual value of the operand. * Bytecode: Operand value: Range: * * 0nnnnnnn memory[2 * N] 0 - 65535 * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 * * Figure 9: Bytecode for a reference ($) operand */ static int dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, gint offset, gint *start_offset, guint16 *value) { guint bytecode; guint16 operand; guint test_bits; guint display_bytecode; bytecode = tvb_get_guint8(udvm_tvb, offset); test_bits = bytecode >> 7; if (test_bits == 1) { test_bits = bytecode >> 6; if (test_bits == 2) { /* * 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = tvb_get_ntohs(udvm_tvb, offset) & 0x3fff; *value = (operand * 2); *start_offset = offset; offset = offset + 2; } else { /* * 11000000 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, udvm_tvb, offset, 1, display_bytecode); offset ++; operand = tvb_get_ntohs(udvm_tvb, offset); *value = operand; *start_offset = offset; offset = offset + 2; } } else { /* * 0nnnnnnn memory[2 * N] 0 - 65535 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_reference_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = ( bytecode & 0x7f); *value = (operand * 2); *start_offset = offset; offset ++; } return offset; } /* *The fourth operand type is the address (@). This operand is decoded * as a multitype operand followed by a further step: the memory address * of the UDVM instruction containing the address operand is added to * obtain the correct operand value. So if the operand value from * Figure 10 is D then the actual operand value of an address is * calculated as follows: * * operand_value = (is_memory_address_of_instruction + D) modulo 2^16 * TODO calculate correct value for operand in case of ADDR */ static int dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, gint offset, gboolean is_addr _U_, gint *start_offset, guint16 *value, gboolean *is_memory_address ) { guint bytecode; guint display_bytecode; guint16 operand; guint32 result; guint test_bits; /* RFC3320 * Figure 10: Bytecode for a multitype (%) operand * Bytecode: Operand value: Range: HEX val * 00nnnnnn N 0 - 63 0x00 * 01nnnnnn memory[2 * N] 0 - 65535 0x40 * 1000011n 2 ^ (N + 6) 64 , 128 0x86 * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 0x88 * 111nnnnn N + 65504 65504 - 65535 0xe0 * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 0x90 * 101nnnnn nnnnnnnn N 0 - 8191 0xa0 * 110nnnnn nnnnnnnn memory[N] 0 - 65535 0xc0 * 10000000 nnnnnnnn nnnnnnnn N 0 - 65535 0x80 * 10000001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 0x81 */ *is_memory_address = FALSE; bytecode = tvb_get_guint8(udvm_tvb, offset); test_bits = ( bytecode & 0xc0 ) >> 6; switch (test_bits ) { case 0: /* * 00nnnnnn N 0 - 63 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = ( bytecode & 0x3f); *value = operand; *start_offset = offset; offset ++; break; case 1: /* * 01nnnnnn memory[2 * N] 0 - 65535 */ display_bytecode = bytecode & 0xc0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = ( bytecode & 0x3f) * 2; *is_memory_address = TRUE; *value = operand; *start_offset = offset; offset ++; break; case 2: /* Check tree most significant bits */ test_bits = ( bytecode & 0xe0 ) >> 5; if ( test_bits == 5 ) { /* * 101nnnnn nnnnnnnn N 0 - 8191 */ display_bytecode = bytecode & 0xe0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = tvb_get_ntohs(udvm_tvb, offset) & 0x1fff; *value = operand; *start_offset = offset; offset = offset + 2; } else { test_bits = ( bytecode & 0xf0 ) >> 4; if ( test_bits == 9 ) { /* * 1001nnnn nnnnnnnn N + 61440 61440 - 65535 */ display_bytecode = bytecode & 0xf0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = (tvb_get_ntohs(udvm_tvb, offset) & 0x0fff) + 61440; *start_offset = offset; *value = operand; offset = offset + 2; } else { test_bits = ( bytecode & 0x08 ) >> 3; if ( test_bits == 1) { /* * 10001nnn 2 ^ (N + 8) 256 , ... , 32768 */ display_bytecode = bytecode & 0xf8; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); result = pow2(guint32, (bytecode & 0x07) + 8); operand = result & 0xffff; *start_offset = offset; *value = operand; offset ++; } else { test_bits = ( bytecode & 0x0e ) >> 1; if ( test_bits == 3 ) { /* * 1000 011n 2 ^ (N + 6) 64 , 128 */ display_bytecode = bytecode & 0xfe; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); result = pow2(guint32, (bytecode & 0x01) + 6); operand = result & 0xffff; *start_offset = offset; *value = operand; offset ++; } else { /* * 1000 0000 nnnnnnnn nnnnnnnn N 0 - 65535 * 1000 0001 nnnnnnnn nnnnnnnn memory[N] 0 - 65535 */ display_bytecode = bytecode; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); if ( (bytecode & 0x01) == 1 ) *is_memory_address = TRUE; offset ++; operand = tvb_get_ntohs(udvm_tvb, offset); *value = operand; *start_offset = offset; offset = offset +2; } } } } break; case 3: test_bits = ( bytecode & 0x20 ) >> 5; if ( test_bits == 1 ) { /* * 111nnnnn N + 65504 65504 - 65535 */ display_bytecode = bytecode & 0xe0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = ( bytecode & 0x1f) + 65504; *start_offset = offset; *value = operand; offset ++; } else { /* * 110nnnnn nnnnnnnn memory[N] 0 - 65535 */ display_bytecode = bytecode & 0xe0; if ( display_udvm_bytecode ) proto_tree_add_uint(sigcomp_udvm_tree, hf_udvm_multitype_bytecode, udvm_tvb, offset, 1, display_bytecode); operand = (tvb_get_ntohs(udvm_tvb, offset) & 0x1fff); *is_memory_address = TRUE; *start_offset = offset; *value = operand; offset = offset +2; } default : break; } return offset; } static void tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree) { proto_tree *raw_tree = NULL; proto_item *ti = NULL; int offset, next_offset, linelen; if (tree) { ti = proto_tree_add_item(tree, proto_raw_sigcomp, tvb, 0, -1, ENC_NA); raw_tree = proto_item_add_subtree(ti, ett_raw_text); } offset = 0; while (tvb_offset_exists(tvb, offset)) { tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); linelen = next_offset - offset; proto_tree_add_format_text(raw_tree, tvb, offset, linelen); offset = next_offset; } } /* Register the protocol with Wireshark */ void proto_register_sigcomp(void) { /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_sigcomp_t_bit, { "T bit", "sigcomp.t.bit", FT_UINT8, BASE_DEC, NULL, 0x04, "Sigcomp T bit", HFILL } }, { &hf_sigcomp_len, { "Partial state id length","sigcomp.length", FT_UINT8, BASE_HEX, VALS(length_encoding_vals), 0x03, "Sigcomp length", HFILL } }, { &hf_sigcomp_returned_feedback_item, { "Returned_feedback item", "sigcomp.returned.feedback.item", FT_BYTES, BASE_NONE, NULL, 0x0, "Returned feedback item", HFILL } }, { &hf_sigcomp_partial_state, { "Partial state identifier", "sigcomp.partial.state.identifier", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sigcomp_remaining_message_bytes, { "Remaining SigComp message bytes", "sigcomp.remaining-bytes", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of bytes remaining in message", HFILL } }, { &hf_sigcomp_compression_ratio, { "Compression ratio (%)", "sigcomp.compression-ratio", FT_UINT32, BASE_DEC, NULL, 0x0, "Compression ratio (decompressed / compressed) %", HFILL } }, { &hf_sigcomp_returned_feedback_item_len, { "Returned feedback item length", "sigcomp.returned.feedback.item.len", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, { &hf_sigcomp_code_len, { "Code length","sigcomp.code.len", FT_UINT16, BASE_HEX, NULL, 0xfff0, NULL, HFILL } }, { &hf_sigcomp_destination, { "Destination","sigcomp.destination", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &destination_address_encoding_vals_ext, 0xf, NULL, HFILL } }, { &hf_sigcomp_udvm_bytecode, { "Uploaded UDVM bytecode","sigcomp.udvm.byte-code", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sigcomp_udvm_instr, { "UDVM instruction code","sigcomp.udvm.instr", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &udvm_instruction_code_vals_ext, 0x0, NULL, HFILL } }, { &hf_udvm_execution_trace, { "UDVM execution trace","sigcomp.udvm.execution-trace", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_udvm_multitype_bytecode, { "UDVM bytecode", "sigcomp.udvm.multyt.bytecode", FT_UINT8, BASE_HEX, VALS(display_bytecode_vals), 0x0, NULL, HFILL } }, { &hf_udvm_reference_bytecode, { "UDVM bytecode", "sigcomp.udvm.ref.bytecode", FT_UINT8, BASE_HEX, VALS(display_ref_bytecode_vals), 0x0, NULL, HFILL } }, { &hf_udvm_literal_bytecode, { "UDVM bytecode", "sigcomp.udvm.lit.bytecode", FT_UINT8, BASE_HEX, VALS(display_lit_bytecode_vals), 0x0, NULL, HFILL } }, #if 0 { &hf_udvm_operand, { "UDVM operand", "sigcomp.udvm.operand", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_udvm_length, { "%Length", "sigcomp.udvm.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length", HFILL } }, { &hf_udvm_addr_length, { "%Length[memory address]", "sigcomp.udvm.addr.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length", HFILL } }, { &hf_udvm_destination, { "%Destination", "sigcomp.udvm.destination", FT_UINT16, BASE_DEC, NULL, 0x0, "Destination", HFILL } }, { &hf_udvm_addr_destination, { "%Destination[memory address]", "sigcomp.udvm.addr.destination", FT_UINT16, BASE_DEC, NULL, 0x0, "Destination", HFILL } }, { &hf_udvm_at_address, { "@Address(mem_add_of_inst + D) mod 2^16)", "sigcomp.udvm.at.address", FT_UINT16, BASE_DEC, NULL, 0x0, "Address", HFILL } }, { &hf_udvm_address, { "%Address", "sigcomp.udvm.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Address", HFILL } }, { &hf_udvm_literal_num, { "#n", "sigcomp.udvm.literal-num", FT_UINT16, BASE_DEC, NULL, 0x0, "Literal number", HFILL } }, { &hf_udvm_value, { "%Value", "sigcomp.udvm.value", FT_UINT16, BASE_DEC, NULL, 0x0, "Value", HFILL } }, { &hf_udvm_addr_value, { "%Value[memory address]", "sigcomp.udvm.value", FT_UINT16, BASE_DEC, NULL, 0x0, "Value", HFILL } }, { &hf_partial_identifier_start, { "%Partial identifier start", "sigcomp.udvm.partial.identifier.start", FT_UINT16, BASE_DEC, NULL, 0x0, "Partial identifier start", HFILL } }, { &hf_partial_identifier_length, { "%Partial identifier length", "sigcomp.udvm.partial.identifier.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Partial identifier length", HFILL } }, { &hf_state_begin, { "%State begin", "sigcomp.udvm.state.begin", FT_UINT16, BASE_DEC, NULL, 0x0, "State begin", HFILL } }, { &hf_udvm_state_length, { "%State length", "sigcomp.udvm.state.length", FT_UINT16, BASE_DEC, NULL, 0x0, "State length", HFILL } }, { &hf_udvm_state_length_addr, { "%State length[memory address]", "sigcomp.udvm.state.length.addr", FT_UINT16, BASE_DEC, NULL, 0x0, "State length", HFILL } }, { &hf_udvm_state_address, { "%State address", "sigcomp.udvm.start.address", FT_UINT16, BASE_DEC, NULL, 0x0, "State address", HFILL } }, { &hf_udvm_state_address_addr, { "%State address[memory address]", "sigcomp.udvm.start.address.addr", FT_UINT16, BASE_DEC, NULL, 0x0, "State address", HFILL } }, { &hf_udvm_state_instr, { "%State instruction", "sigcomp.udvm.start.instr", FT_UINT16, BASE_DEC, NULL, 0x0, "State instruction", HFILL } }, { &hf_udvm_operand_1, { "$Operand 1[memory address]", "sigcomp.udvm.operand.1", FT_UINT16, BASE_DEC, NULL, 0x0, "Reference $ Operand 1", HFILL } }, { &hf_udvm_operand_2, { "%Operand 2", "sigcomp.udvm.operand.2", FT_UINT16, BASE_DEC, NULL, 0x0, "Operand 2", HFILL } }, { &hf_udvm_operand_2_addr, { "%Operand 2[memory address]", "sigcomp.udvm.operand.2.addr", FT_UINT16, BASE_DEC, NULL, 0x0, "Operand 2", HFILL } }, { &hf_udvm_j, { "%j", "sigcomp.udvm.j", FT_UINT16, BASE_DEC, NULL, 0x0, "j", HFILL } }, { &hf_udvm_addr_j, { "%j[memory address]", "sigcomp.udvm.addr.j", FT_UINT16, BASE_DEC, NULL, 0x0, "j", HFILL } }, { &hf_udvm_output_start, { "%Output_start", "sigcomp.output.start", FT_UINT16, BASE_DEC, NULL, 0x0, "Output start", HFILL } }, { &hf_udvm_addr_output_start, { "%Output_start[memory address]", "sigcomp.addr.output.start", FT_UINT16, BASE_DEC, NULL, 0x0, "Output start", HFILL } }, { &hf_udvm_output_length, { "%Output_length", "sigcomp.output.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Output length", HFILL } }, { &hf_udvm_output_length_addr, { "%Output_length[memory address]", "sigcomp.output.length.addr", FT_UINT16, BASE_DEC, NULL, 0x0, "Output length", HFILL } }, { &hf_udvm_req_feedback_loc, { "%Requested feedback location", "sigcomp.req.feedback.loc", FT_UINT16, BASE_DEC, NULL, 0x0, "Requested feedback location", HFILL } }, { &hf_udvm_min_acc_len, { "%Minimum access length", "sigcomp.min.acc.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Minimum access length", HFILL } }, { &hf_udvm_state_ret_pri, { "%State retention priority", "sigcomp.udvm.state.ret.pri", FT_UINT16, BASE_DEC, NULL, 0x0, "State retention priority", HFILL } }, { &hf_udvm_ret_param_loc, { "%Returned parameters location", "sigcomp.ret.param.loc", FT_UINT16, BASE_DEC, NULL, 0x0, "Returned parameters location", HFILL } }, { &hf_udvm_position, { "%Position", "sigcomp.udvm.position", FT_UINT16, BASE_DEC, NULL, 0x0, "Position", HFILL } }, { &hf_udvm_ref_dest, { "$Destination[memory address]", "sigcomp.udvm.ref.destination", FT_UINT16, BASE_DEC, NULL, 0x0, "(reference)Destination", HFILL } }, { &hf_udvm_bits, { "%Bits", "sigcomp.udvm.bits", FT_UINT16, BASE_DEC, NULL, 0x0, "Bits", HFILL } }, { &hf_udvm_lower_bound, { "%Lower bound", "sigcomp.udvm.lower.bound", FT_UINT16, BASE_DEC, NULL, 0x0, "Lower_bound", HFILL } }, { &hf_udvm_upper_bound, { "%Upper bound", "sigcomp.udvm.upper.bound", FT_UINT16, BASE_DEC, NULL, 0x0, "Upper bound", HFILL } }, { &hf_udvm_uncompressed, { "%Uncompressed", "sigcomp.udvm.uncompressed", FT_UINT16, BASE_DEC, NULL, 0x0, "Uncompressed", HFILL } }, { &hf_udvm_start_value, { "%Start value", "sigcomp.udvm.start.value", FT_UINT16, BASE_DEC, NULL, 0x0, "Start value", HFILL } }, { &hf_udvm_offset, { "%Offset", "sigcomp.udvm.offset", FT_UINT16, BASE_DEC, NULL, 0x0, "Offset", HFILL } }, { &hf_udvm_addr_offset, { "%Offset[memory address]", "sigcomp.udvm.addr.offset", FT_UINT16, BASE_DEC, NULL, 0x0, "Offset", HFILL } }, { &hf_sigcomp_nack_ver, { "NACK Version", "sigcomp.nack.ver", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL } }, { &hf_sigcomp_nack_reason_code, { "Reason Code", "sigcomp.nack.reason", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &sigcomp_nack_reason_code_vals_ext, 0x0, "NACK Reason Code", HFILL } }, { &hf_sigcomp_nack_failed_op_code, { "OPCODE of failed instruction", "sigcomp.nack.failed_op_code", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &udvm_instruction_code_vals_ext, 0x0, "NACK OPCODE of failed instruction", HFILL } }, { &hf_sigcomp_nack_pc, { "PC of failed instruction", "sigcomp.nack.pc", FT_UINT16, BASE_DEC, NULL, 0x0, "NACK PC of failed instruction", HFILL } }, { &hf_sigcomp_nack_sha1, { "SHA-1 Hash of failed message", "sigcomp.nack.sha1", FT_BYTES, BASE_NONE, NULL, 0x0, "NACK SHA-1 Hash of failed message", HFILL } }, { &hf_sigcomp_nack_state_id, { "State ID (6 - 20 bytes)", "sigcomp.nack.state_id", FT_BYTES, BASE_NONE, NULL, 0x0, "NACK State ID (6 - 20 bytes)", HFILL } }, { &hf_sigcomp_nack_cycles_per_bit, { "Cycles Per Bit", "sigcomp.nack.cycles_per_bit", FT_UINT8, BASE_DEC, NULL, 0x0, "NACK Cycles Per Bit", HFILL } }, { &hf_sigcomp_nack_memory_size, { "Memory size", "sigcomp.memory_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_sigcomp_decompress_instruction, { "Instruction", "sigcomp.decompress_instruction", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sigcomp_loading_result, { "Loading result", "sigcomp.loading_result", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sigcomp_byte_copy, { "byte copy", "sigcomp.byte_copy", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_sigcomp_accessing_state, { "### Accessing state ###", "sigcomp.accessing_state", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_getting_value, { "Getting value", "sigcomp.getting_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_load_bytecode_into_udvm_start, { "Load bytecode into UDVM starting at", "sigcomp.load_bytecode_into_udvm_start", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_instruction_code, { "Instruction code", "sigcomp.instruction_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_current_instruction, { "Addr", "sigcomp.current_instruction", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &udvm_instruction_code_vals_ext, 0x0, NULL, HFILL }}, { &hf_sigcomp_decompression_failure, { "DECOMPRESSION-FAILURE", "sigcomp.decompression_failure", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_wireshark_udvm_diagnostic, { "Wireshark UDVM diagnostic", "sigcomp.wireshark_udvm_diagnostic", FT_UINT32, BASE_DEC, VALS(result_code_vals), 0x0, NULL, HFILL }}, { &hf_sigcomp_calculated_sha_1, { "Calculated SHA-1", "sigcomp.calculated_sha_1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_copying_value, { "Copying value", "sigcomp.copying_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_storing_value, { "Storing value", "sigcomp.storing_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_loading_value, { "Loading value", "sigcomp.loading_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_set_hu, { "Set Hu", "sigcomp.set_hu", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_loading_h, { "Loading H", "sigcomp.loading_h", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_state_value, { "Addr", "sigcomp.state_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_output_value, { "Output value", "sigcomp.output_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_num_state_create, { "no_of_state_create", "sigcomp.num_state_create", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_sha1_digest, { "SHA1 digest", "sigcomp.sha1_digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_creating_state, { "### Creating state ###", "sigcomp.creating_state", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_sigcomp_message_decompressed, { "SigComp message Decompressed", "sigcomp.message_decompressed", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_starting_to_remove_escape_digits, { "Starting to remove escape digits", "sigcomp.starting_to_remove_escape_digits", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_escape_digit_found, { "Escape digit found", "sigcomp.escape_digit_found", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_illegal_escape_code, { "Illegal escape code", "sigcomp.illegal_escape_code", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_end_of_sigcomp_message_indication_found, { "End of SigComp message indication found", "sigcomp.end_of_sigcomp_message_indication_found", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_addr_value, { "Addr", "sigcomp.addr", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_copying_bytes_literally, { "Copying bytes literally", "sigcomp.copying_bytes_literally", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_data_for_sigcomp_dissector, { "Data handed to the Sigcomp dissector", "sigcomp.data_for_sigcomp_dissector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_remaining_sigcomp_message, { "Remaining SigComp message", "sigcomp.remaining_sigcomp_message", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_sha1buff, { "sha1buff", "sigcomp.sha1buff", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_udvm_instruction, { "UDVM instruction", "sigcomp.udvm_instruction", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_remaining_bytes, { "Remaining bytes", "sigcomp.remaining_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_max_udvm_cycles, { "maximum_UDVM_cycles", "sigcomp.max_udvm_cycles", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_used_udvm_cycles, { "used_udvm_cycles", "sigcomp.used_udvm_cycles", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_udvm_execution_stated, { "UDVM EXECUTION STARTED", "sigcomp.udvm_execution_stated", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_message_length, { "Message Length", "sigcomp.message_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sigcomp_byte_code_length, { "Byte code length", "sigcomp.byte_code_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sigcomp, &ett_sigcomp_udvm, &ett_sigcomp_udvm_exe, }; static gint *ett_raw[] = { &ett_raw_text, }; static ei_register_info ei[] = { { &ei_sigcomp_nack_failed_op_code, { "sigcomp.nack.failed_op_code.expert", PI_SEQUENCE, PI_WARN, "SigComp NACK", EXPFILL }}, { &ei_sigcomp_invalid_instruction, { "sigcomp.invalid_instruction", PI_PROTOCOL, PI_WARN, "Invalid instruction", EXPFILL }}, { &ei_sigcomp_invalid_shift_value, { "sigcomp.invalid_shift_value", PI_PROTOCOL, PI_WARN, "Invalid shift value", EXPFILL }}, /* Generated from convert_proto_tree_add_text.pl */ { &ei_sigcomp_sigcomp_message_decompression_failure, { "sigcomp.message_decompression_failure", PI_PROTOCOL, PI_WARN, "SigComp message Decompression failure", EXPFILL }}, { &ei_sigcomp_execution_of_this_instruction_is_not_implemented, { "sigcomp.execution_of_this_instruction_is_not_implemented", PI_UNDECODED, PI_WARN, "Execution of this instruction is NOT implemented", EXPFILL }}, { &ei_sigcomp_decompression_failure, { "sigcomp.decompression_failure_expert", PI_PROTOCOL, PI_WARN, "DECOMPRESSION FAILURE", EXPFILL }}, { &ei_sigcomp_tcp_fragment, { "sigcomp.tcp_fragment", PI_MALFORMED, PI_ERROR, "TCP Fragment", EXPFILL }}, { &ei_sigcomp_failed_to_access_state_wireshark_udvm_diagnostic, { "sigcomp.failed_to_access_state_wireshark_udvm_diagnostic", PI_PROTOCOL, PI_WARN, "Failed to Access state Wireshark UDVM diagnostic", EXPFILL }}, { &ei_sigcomp_all_remaining_parameters_zero, { "sigcomp.all_remaining_parameters", PI_PROTOCOL, PI_NOTE, "All remaining parameters = 0(Not in the uploaded code as UDVM buffer initialized to Zero", EXPFILL }}, }; module_t *sigcomp_module; expert_module_t* expert_sigcomp; static const enum_val_t udvm_detail_vals[] = { {"no-printout", "No-Printout", 0}, {"low-detail", "Low-detail", 1}, {"medium-detail", "Medium-detail", 2}, {"high-detail", "High-detail", 3}, {NULL, NULL, -1} }; /* Register the protocol name and description */ proto_sigcomp = proto_register_protocol("Signaling Compression", "SIGCOMP", "sigcomp"); proto_raw_sigcomp = proto_register_protocol("Decompressed SigComp message as raw text", "Raw_SigComp", "raw_sigcomp"); sigcomp_handle = register_dissector("sigcomp", dissect_sigcomp, proto_sigcomp); sigcomp_tcp_handle = register_dissector("sigcomp_tcp", dissect_sigcomp_tcp,proto_sigcomp); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_sigcomp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); proto_register_subtree_array(ett_raw, array_length(ett_raw)); expert_sigcomp = expert_register_protocol(proto_sigcomp); expert_register_field_array(expert_sigcomp, ei, array_length(ei)); /* Register a configuration option for port */ sigcomp_module = prefs_register_protocol(proto_sigcomp, NULL); prefs_register_bool_preference(sigcomp_module, "display.udvm.code", "Dissect the UDVM code", "Preference whether to Dissect the UDVM code or not", &dissect_udvm_code); prefs_register_bool_preference(sigcomp_module, "display.bytecode", "Display the bytecode of operands", "preference whether to display the bytecode in " "UDVM operands or not", &display_udvm_bytecode); prefs_register_bool_preference(sigcomp_module, "decomp.msg", "Decompress message", "preference whether to decompress message or not", &decompress); prefs_register_bool_preference(sigcomp_module, "display.decomp.msg.as.txt", "Displays the decompressed message as text", "preference whether to display the decompressed message " "as raw text or not", &display_raw_txt); prefs_register_enum_preference(sigcomp_module, "show.udvm.execution", "Level of detail of UDVM execution:", "'No-Printout' = UDVM executes silently, then increasing detail " "about execution of UDVM instructions; " "Warning! CPU intense at high detail", &udvm_print_detail_level, udvm_detail_vals, FALSE); register_init_routine(&sigcomp_init_udvm); register_cleanup_routine(&sigcomp_cleanup_udvm); } void proto_reg_handoff_sigcomp(void) { sip_handle = find_dissector_add_dependency("sip",proto_sigcomp); dissector_add_uint_range_with_preference("tcp.port", SIGCOMP_TCP_PORT_RANGE, sigcomp_tcp_handle); dissector_add_uint_range_with_preference("udp.port", SIGCOMP_TCP_PORT_RANGE, sigcomp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-signal-pdu.c
/* packet-signal-pdu.c * Signal PDU dissector. * By Dr. Lars Voelker <[email protected]> * Copyright 2020-2022 Dr. Lars Voelker * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * This dissector allows Signal PDUs (e.g. CAN or FlexRay) to be dissected into signals (automotive use case). * * This feature is based on typical operations of signal messages: * - Scaling/Offset: Move the value by multiplying with scaler and moving by adding offset. (compu methods). * - Multiplexer: A signal in the PDU determines, what signals follow. * - Value names: Giving raw values names. */ #include <config.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/to_str.h> #include <epan/uat.h> #include <epan/proto_data.h> #include <wsutil/sign_ext.h> #include "packet-someip.h" #include "packet-socketcan.h" #include "packet-flexray.h" #include "packet-pdu-transport.h" #include "packet-lin.h" #include "packet-autosar-ipdu-multiplexer.h" #include "packet-dlt.h" #include "packet-uds.h" /* * Dissector for CAN, FlexRay, and other message payloads. * This includes such PDUs being transported on top of TECMP, * SOME/IP, and others. */ #define SPDU_NAME "Signal PDU" #define SPDU_NAME_LONG "Signal PDU" #define SPDU_NAME_FILTER "signal_pdu" /*** Configuration ***/ /* Define the Signal PDUs and their IDs and Names. */ #define DATAFILE_SPDU_MESSAGES "Signal_PDU_identifiers" /* Define how to parse Signal PDUs into Signals. */ #define DATAFILE_SPDU_SIGNALS "Signal_PDU_signal_list" /* Define enumeration for signal values. */ #define DATAFILE_SPDU_VALUE_NAMES "Signal_PDU_signal_values" /* Using the following config files the payloads of different protocols are mapped to Signal PDU IDs: */ #define DATAFILE_SPDU_SOMEIP_MAPPING "Signal_PDU_Binding_SOMEIP" #define DATAFILE_SPDU_CAN_MAPPING "Signal_PDU_Binding_CAN" #define DATAFILE_SPDU_FLEXRAY_MAPPING "Signal_PDU_Binding_FlexRay" #define DATAFILE_SPDU_LIN_MAPPING "Signal_PDU_Binding_LIN" #define DATAFILE_SPDU_PDU_TRANSPORT_MAPPING "Signal_PDU_Binding_PDU_Transport" #define DATAFILE_SPDU_IPDUM_MAPPING "Signal_PDU_Binding_AUTOSAR_IPduM" #define DATAFILE_SPDU_DLT_MAPPING "Signal_PDU_Binding_DLT" #define DATAFILE_SPDU_UDS_MAPPING "Signal_PDU_Binding_UDS" /* ID wireshark identifies the dissector by */ static int proto_signal_pdu = -1; static dissector_handle_t signal_pdu_handle_someip = NULL; static dissector_handle_t signal_pdu_handle_can = NULL; static dissector_handle_t signal_pdu_handle_flexray = NULL; static dissector_handle_t signal_pdu_handle_lin = NULL; static dissector_handle_t signal_pdu_handle_pdu_transport = NULL; static dissector_handle_t signal_pdu_handle_ipdum = NULL; static int hf_pdu_name = -1; static int hf_payload_unparsed = -1; static gint ett_spdu_payload = -1; static gint ett_spdu_signal = -1; static gboolean spdu_deserializer_activated = TRUE; static gboolean spdu_deserializer_show_hidden = FALSE; static gboolean spdu_deserializer_hide_raw_values = TRUE; /*** expert info items ***/ static expert_field ef_spdu_payload_truncated = EI_INIT; static expert_field ef_spdu_config_error = EI_INIT; static expert_field ef_spdu_unaligned_data = EI_INIT; /*** Data Structure for UAT based config ***/ static GHashTable *data_spdu_messages = NULL; static GHashTable *data_spdu_signal_list = NULL; static GHashTable *data_spdu_signal_value_names = NULL; static GHashTable *data_spdu_someip_mappings = NULL; static GHashTable *data_spdu_can_mappings = NULL; static GHashTable *data_spdu_flexray_mappings = NULL; static GHashTable *data_spdu_lin_mappings = NULL; static GHashTable *data_spdu_pdu_transport_mappings = NULL; static GHashTable *data_spdu_ipdum_mappings = NULL; static GHashTable *data_spdu_dlt_mappings = NULL; static GHashTable *data_spdu_uds_mappings = NULL; static hf_register_info *dynamic_hf_base_raw = NULL; static hf_register_info *dynamic_hf_agg_sum = NULL; static hf_register_info *dynamic_hf_agg_avg = NULL; static hf_register_info *dynamic_hf_agg_int = NULL; static guint dynamic_hf_number_of_entries = 0; static guint dynamic_hf_base_raw_number = 0; static guint dynamic_hf_agg_sum_number = 0; static guint dynamic_hf_agg_avg_number = 0; static guint dynamic_hf_agg_int_number = 0; #define HF_TYPE_BASE 0 #define HF_TYPE_RAW 1 #define HF_TYPE_AGG_SUM 2 #define HF_TYPE_AGG_AVG 3 #define HF_TYPE_AGG_INT 4 #define HF_TYPE_NONE 0xffff #define HF_TYPE_COUNT_BASE_RAW_TABLE 2 /*********************************************** ********* Preferences / Configuration ********* ***********************************************/ typedef struct _generic_one_id_string { guint id; gchar *name; } generic_one_id_string_t; typedef enum _spdu_data_type { SPDU_DATA_TYPE_NONE, SPDU_DATA_TYPE_UINT, SPDU_DATA_TYPE_INT, SPDU_DATA_TYPE_FLOAT, SPDU_DATA_TYPE_STRING, SPDU_DATA_TYPE_STRINGZ, SPDU_DATA_TYPE_UINT_STRING, } spdu_dt_t; typedef struct _spdu_signal_item { guint32 pos; gchar *name; spdu_dt_t data_type; gboolean big_endian; guint32 bitlength_base_type; guint32 bitlength_encoded_type; gboolean scale_or_offset; double scaler; double offset; gboolean multiplexer; gint multiplex_value_only; gboolean hidden; guint encoding; gboolean aggregate_sum; gboolean aggregate_avg; gboolean aggregate_int; gint *hf_id_effective; gint *hf_id_raw; gint *hf_id_agg_sum; gint *hf_id_agg_avg; gint *hf_id_agg_int; } spdu_signal_item_t; typedef struct _spdu_signal_list { guint32 id; guint32 num_of_items; gboolean aggregation; spdu_signal_item_t *items; } spdu_signal_list_t; typedef struct _spdu_signal_list_uat { guint32 id; guint32 num_of_params; guint32 pos; gchar *name; gchar *filter_string; gchar *data_type; gboolean big_endian; guint32 bitlength_base_type; guint32 bitlength_encoded_type; gchar *scaler; gchar *offset; gboolean multiplexer; gint multiplex_value_only; gboolean hidden; gboolean aggregate_sum; gboolean aggregate_avg; gboolean aggregate_int; } spdu_signal_list_uat_t; typedef struct _spdu_signal_value_name_item { guint64 value_start; guint64 value_end; gchar *name; } spdu_signal_value_name_item_t; #define INIT_SIGNAL_VALUE_NAME_ITEM(NAME) \ (NAME)->value_start = 0; \ (NAME)->value_end = 0; \ (NAME)->name = NULL; typedef struct _spdu_signal_value_name { guint32 id; guint32 num_of_items; guint32 pos; val64_string *vs; spdu_signal_value_name_item_t *items; } spdu_signal_value_name_t; #define INIT_SIGNAL_VALUE_NAME(NAME) \ (NAME)->id = 0; \ (NAME)->pos = 0; \ (NAME)->num_of_items = 0; \ (NAME)->vs = NULL; \ (NAME)->items = NULL; typedef struct _spdu_signal_value_name_uat { guint32 id; guint32 pos; guint32 num_of_items; guint64 value_start; guint64 value_end; gchar *value_name; } spdu_signal_value_name_uat_t; typedef struct _spdu_someip_mapping { guint32 service_id; guint32 method_id; guint32 major_version; guint32 message_type; guint32 spdu_message_id; } spdu_someip_mapping_t; #define INIT_SOMEIP_MAPPING(NAME) \ (NAME)->service_id = 0; \ (NAME)->method_id = 0; \ (NAME)->major_version = 0; \ (NAME)->message_type = 0; \ (NAME)->message_id = 0; typedef spdu_someip_mapping_t spdu_someip_mapping_uat_t; typedef struct _spdu_can_mapping { guint32 can_id; guint32 bus_id; guint32 message_id; } spdu_can_mapping_t; typedef spdu_can_mapping_t spdu_can_mapping_uat_t; typedef struct _spdu_flexray_mapping { guint32 channel; guint32 cycle; guint32 flexray_id; guint32 message_id; } spdu_flexray_mapping_t; typedef spdu_flexray_mapping_t spdu_flexray_mapping_uat_t; typedef struct _spdu_lin_mapping { guint32 frame_id; guint32 bus_id; guint32 message_id; } spdu_lin_mapping_t; typedef spdu_lin_mapping_t spdu_lin_mapping_uat_t; typedef struct _spdu_pdu_transport_mapping { guint32 pdu_id; guint32 message_id; } spdu_pdu_transport_mapping_t; typedef spdu_pdu_transport_mapping_t spdu_pdu_transport_mapping_uat_t; typedef struct _spdu_ipdum_mapping { guint32 pdu_id; guint32 message_id; } spdu_ipdum_mapping_t; typedef spdu_ipdum_mapping_t spdu_ipdum_mapping_uat_t; typedef struct _spdu_dlt_mapping { gchar *ecu_id; guint32 dlt_message_id; guint32 message_id; } spdu_dlt_mapping_t; typedef spdu_dlt_mapping_t spdu_dlt_mapping_uat_t; typedef struct _spdu_uds_mapping { guint32 uds_address; guint32 service; gboolean reply; guint32 id; guint32 message_id; } spdu_uds_mapping_t; typedef spdu_uds_mapping_t spdu_uds_mapping_uat_t; static generic_one_id_string_t *spdu_message_ident = NULL; static guint spdu_message_ident_num = 0; static spdu_signal_list_uat_t *spdu_signal_list = NULL; static guint spdu_signal_list_num = 0; static spdu_signal_value_name_uat_t *spdu_signal_value_names = NULL; static guint spdu_parameter_value_names_num = 0; static spdu_someip_mapping_t *spdu_someip_mapping = NULL; static guint spdu_someip_mapping_num = 0; static spdu_can_mapping_t *spdu_can_mapping = NULL; static guint spdu_can_mapping_num = 0; static spdu_flexray_mapping_t *spdu_flexray_mapping = NULL; static guint spdu_flexray_mapping_num = 0; static spdu_lin_mapping_t *spdu_lin_mapping = NULL; static guint spdu_lin_mapping_num = 0; static spdu_pdu_transport_mapping_t *spdu_pdu_transport_mapping = NULL; static guint spdu_pdu_transport_mapping_num = 0; static spdu_ipdum_mapping_t *spdu_ipdum_mapping = NULL; static guint spdu_ipdum_mapping_num = 0; static spdu_dlt_mapping_t *spdu_dlt_mapping = NULL; static guint spdu_dlt_mapping_num = 0; static spdu_uds_mapping_t *spdu_uds_mapping = NULL; static guint spdu_uds_mapping_num = 0; void proto_register_signal_pdu(void); void proto_reg_handoff_signal_pdu(void); static void register_signal_pdu_can(void) { if (signal_pdu_handle_can == NULL) { return; } dissector_delete_all("can.id", signal_pdu_handle_can); dissector_delete_all("can.extended_id", signal_pdu_handle_can); /* CAN: loop over all frame IDs in HT */ if (data_spdu_can_mappings != NULL) { GList *keys = g_hash_table_get_keys(data_spdu_can_mappings); GList *tmp; for (tmp = keys; tmp != NULL; tmp = tmp->next) { gint32 id = (*(gint32 *)tmp->data); if ((id & CAN_EFF_FLAG) == CAN_EFF_FLAG) { dissector_add_uint("can.extended_id", id & CAN_EFF_MASK, signal_pdu_handle_can); } else { dissector_add_uint("can.id", id & CAN_SFF_MASK, signal_pdu_handle_can); } } g_list_free(keys); } } static void register_signal_pdu_lin(void) { if (signal_pdu_handle_lin == NULL) { return; } dissector_delete_all("lin.frame_id", signal_pdu_handle_lin); /* LIN: loop over all frame IDs in HT */ if (data_spdu_lin_mappings != NULL) { GList *keys = g_hash_table_get_keys(data_spdu_lin_mappings); GList *tmp; for (tmp = keys; tmp != NULL; tmp = tmp->next) { gint32 *id = (gint32 *)tmp->data; /* we register the combination of bus and frame id */ dissector_add_uint("lin.frame_id", *id, signal_pdu_handle_lin); } g_list_free(keys); } } static void register_signal_pdu_someip(void) { if (signal_pdu_handle_someip == NULL) { return; } dissector_delete_all("someip.messageid", signal_pdu_handle_someip); /* SOME/IP: loop over all messages IDs in HT */ if (data_spdu_someip_mappings != NULL) { GList *keys = g_hash_table_get_keys(data_spdu_someip_mappings); GList *tmp; for (tmp = keys; tmp != NULL; tmp = tmp->next) { gint64 *id = (gint64 *)tmp->data; guint32 message_id = (guint32)((guint64)(*id)) & 0xffffffff; dissector_add_uint("someip.messageid", message_id, signal_pdu_handle_someip); } g_list_free(keys); } } static void register_signal_pdu_pdu_transport(void) { if (signal_pdu_handle_pdu_transport == NULL) { return; } dissector_delete_all("pdu_transport.id", signal_pdu_handle_pdu_transport); /* PDU Transport: loop over all messages IDs in HT */ if (data_spdu_pdu_transport_mappings != NULL) { GList *keys = g_hash_table_get_keys(data_spdu_pdu_transport_mappings); GList *tmp; for (tmp = keys; tmp != NULL; tmp = tmp->next) { gint64 *id = (gint64 *)tmp->data; dissector_add_uint("pdu_transport.id", ((guint32)((guint64)(*id)) & 0xffffffff), signal_pdu_handle_pdu_transport); } g_list_free(keys); } } static void register_signal_pdu_ipdum_ids(void) { if (signal_pdu_handle_ipdum == NULL) { return; } dissector_delete_all("ipdum.pdu.id", signal_pdu_handle_ipdum); /* IPduM: loop over all messages IDs in HT */ if (data_spdu_ipdum_mappings != NULL) { GList *keys = g_hash_table_get_keys(data_spdu_ipdum_mappings); GList *tmp; for (tmp = keys; tmp != NULL; tmp = tmp->next) { gint64 *id = (gint64 *)tmp->data; dissector_add_uint("ipdum.pdu.id", ((guint32)((guint64)(*id)) & 0xffffffff), signal_pdu_handle_ipdum); } g_list_free(keys); } } /*** UAT Callbacks and Helpers ***/ static void spdu_payload_free_key(gpointer key) { wmem_free(wmem_epan_scope(), key); } static void spdu_payload_free_generic_data(gpointer data _U_) { /* currently nothing to be free */ } /* ID -> Name */ static void * copy_generic_one_id_string_cb(void *n, const void *o, size_t size _U_) { generic_one_id_string_t *new_rec = (generic_one_id_string_t *)n; const generic_one_id_string_t *old_rec = (const generic_one_id_string_t *)o; if (old_rec->name == NULL) { new_rec->name = NULL; } else { new_rec->name = g_strdup(old_rec->name); } new_rec->id = old_rec->id; return new_rec; } static gboolean update_generic_one_identifier_32bit(void *r, char **err) { generic_one_id_string_t *rec = (generic_one_id_string_t *)r; if (rec->id > 0xffffffff) { *err = ws_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); return FALSE; } if (rec->name == NULL || rec->name[0] == 0) { *err = g_strdup("Name cannot be empty"); return FALSE; } guchar c = proto_check_field_name(rec->name); if (c) { if (c == '.') { *err = ws_strdup_printf("Name contains illegal chars '.' (ID: 0x%08x)", rec->id); } else if (g_ascii_isprint(c)) { *err = ws_strdup_printf("Name contains illegal chars '%c' (ID: 0x%08x)", c, rec->id); } else { *err = ws_strdup_printf("Name contains invalid byte \\%03o (ID: 0x%08x)", c, rec->id); } return FALSE; } return TRUE; } static void free_generic_one_id_string_cb(void *r) { generic_one_id_string_t *rec = (generic_one_id_string_t *)r; /* freeing result of g_strdup */ g_free(rec->name); rec->name = NULL; } static void post_update_one_id_string_template_cb(generic_one_id_string_t *data, guint data_num, GHashTable *ht) { guint i; for (i = 0; i < data_num; i++) { int *key = wmem_new(wmem_epan_scope(), int); *key = data[i].id; g_hash_table_insert(ht, key, g_strdup(data[i].name)); } } /*** Signal PDU Messages ***/ UAT_HEX_CB_DEF(spdu_message_ident, id, generic_one_id_string_t) UAT_CSTRING_CB_DEF(spdu_message_ident, name, generic_one_id_string_t) static void post_update_spdu_message_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_messages) { g_hash_table_destroy(data_spdu_messages); data_spdu_messages = NULL; } /* create new hash table */ data_spdu_messages = g_hash_table_new_full(g_int_hash, g_int_equal, &spdu_payload_free_key, &spdu_payload_free_generic_data); post_update_one_id_string_template_cb(spdu_message_ident, spdu_message_ident_num, data_spdu_messages); } static char * get_message_name(guint32 id) { guint32 tmp = id; if (data_spdu_messages == NULL) { return NULL; } return (char *)g_hash_table_lookup(data_spdu_messages, &tmp); } /* UAT: Signals */ UAT_HEX_CB_DEF(spdu_signal_list, id, spdu_signal_list_uat_t) UAT_DEC_CB_DEF(spdu_signal_list, num_of_params, spdu_signal_list_uat_t) UAT_DEC_CB_DEF(spdu_signal_list, pos, spdu_signal_list_uat_t) UAT_CSTRING_CB_DEF(spdu_signal_list, name, spdu_signal_list_uat_t) UAT_CSTRING_CB_DEF(spdu_signal_list, filter_string, spdu_signal_list_uat_t) UAT_CSTRING_CB_DEF(spdu_signal_list, data_type, spdu_signal_list_uat_t) UAT_BOOL_CB_DEF(spdu_signal_list, big_endian, spdu_signal_list_uat_t) UAT_DEC_CB_DEF(spdu_signal_list, bitlength_base_type, spdu_signal_list_uat_t) UAT_DEC_CB_DEF(spdu_signal_list, bitlength_encoded_type, spdu_signal_list_uat_t) UAT_CSTRING_CB_DEF(spdu_signal_list, scaler, spdu_signal_list_uat_t) UAT_CSTRING_CB_DEF(spdu_signal_list, offset, spdu_signal_list_uat_t) UAT_BOOL_CB_DEF(spdu_signal_list, multiplexer, spdu_signal_list_uat_t) UAT_SIGNED_DEC_CB_DEF(spdu_signal_list, multiplex_value_only, spdu_signal_list_uat_t) UAT_BOOL_CB_DEF(spdu_signal_list, hidden, spdu_signal_list_uat_t) UAT_BOOL_CB_DEF(spdu_signal_list, aggregate_sum, spdu_signal_list_uat_t) UAT_BOOL_CB_DEF(spdu_signal_list, aggregate_avg, spdu_signal_list_uat_t) UAT_BOOL_CB_DEF(spdu_signal_list, aggregate_int, spdu_signal_list_uat_t) static void * copy_spdu_signal_list_cb(void *n, const void *o, size_t size _U_) { spdu_signal_list_uat_t *new_rec = (spdu_signal_list_uat_t *)n; const spdu_signal_list_uat_t *old_rec = (const spdu_signal_list_uat_t *)o; new_rec->id = old_rec->id; new_rec->num_of_params = old_rec->num_of_params; new_rec->pos = old_rec->pos; if (old_rec->name) { new_rec->name = g_strdup(old_rec->name); } else { new_rec->name = NULL; } if (old_rec->filter_string) { new_rec->filter_string = g_strdup(old_rec->filter_string); } else { new_rec->filter_string = NULL; } if (old_rec->data_type) { new_rec->data_type = g_strdup(old_rec->data_type); } else { new_rec->data_type = NULL; } new_rec->big_endian = old_rec->big_endian; new_rec->bitlength_base_type = old_rec->bitlength_base_type; new_rec->bitlength_encoded_type = old_rec->bitlength_encoded_type; if (old_rec->scaler) { new_rec->scaler = g_strdup(old_rec->scaler); } else { new_rec->scaler = NULL; } if (old_rec->offset) { new_rec->offset = g_strdup(old_rec->offset); } else { new_rec->offset = NULL; } new_rec->multiplexer = old_rec->multiplexer; new_rec->multiplex_value_only = old_rec->multiplex_value_only; new_rec->hidden = old_rec->hidden; new_rec->aggregate_sum = old_rec->aggregate_sum; new_rec->aggregate_avg = old_rec->aggregate_avg; new_rec->aggregate_int = old_rec->aggregate_int; return new_rec; } static gboolean update_spdu_signal_list(void *r, char **err) { gchar *tmp; guchar c; gdouble scaler; gdouble offset; spdu_signal_list_uat_t *rec = (spdu_signal_list_uat_t *)r; offset = g_ascii_strtod(rec->offset, &tmp); if (!(offset == offset)) { *err = ws_strdup_printf("Offset not a double!"); return FALSE; } scaler = g_ascii_strtod(rec->scaler, &tmp); if (!(scaler == scaler)) { *err = ws_strdup_printf("Scaler not a double!"); return FALSE; } if (rec->pos >= 0xffff) { *err = ws_strdup_printf("Position too big"); return FALSE; } if (rec->num_of_params >= 0xffff) { *err = ws_strdup_printf("Number of Parameters too big"); return FALSE; } if (rec->pos >= rec->num_of_params) { *err = ws_strdup_printf("Position >= Number of Parameters"); return FALSE; } if (rec->name == NULL || rec->name[0] == 0) { *err = ws_strdup_printf("Name cannot be empty"); return FALSE; } if (rec->filter_string == NULL || rec->filter_string[0] == 0) { *err = ws_strdup_printf("Filter String cannot be empty"); return FALSE; } c = proto_check_field_name(rec->filter_string); if (c) { if (c == '.') { *err = ws_strdup_printf("Filter String contains illegal chars '.' (ID: 0x%08x)", rec->id); } else if (g_ascii_isprint(c)) { *err = ws_strdup_printf("Filter String contains illegal chars '%c' (ID: 0x%08x)", c, rec->id); } else { *err = ws_strdup_printf("Filter String contains invalid byte \\%03o (ID: 0x%08x)", c, rec->id); } return FALSE; } if (g_strcmp0(rec->data_type, "uint") != 0 && g_strcmp0(rec->data_type, "int") != 0 && g_strcmp0(rec->data_type, "float") != 0 && g_strcmp0(rec->data_type, "string") != 0 && g_strcmp0(rec->data_type, "stringz") != 0 && g_strcmp0(rec->data_type, "uint_string") != 0 && g_strcmp0(rec->data_type, "utf_string") != 0 && g_strcmp0(rec->data_type, "utf_stringz") != 0 && g_strcmp0(rec->data_type, "utf_uint_string") != 0) { *err = ws_strdup_printf("Currently the only supported data types are uint, int, float, string, stringz, uint_string, utf_string, utf_stringz, and utf_uint_string (ID: 0x%08x)", rec->id); return FALSE; } /* uint */ if (g_strcmp0(rec->data_type, "uint") == 0) { if ((rec->bitlength_base_type != 8) && (rec->bitlength_base_type != 16) && (rec->bitlength_base_type != 32) && (rec->bitlength_base_type != 64)) { *err = ws_strdup_printf("Data type uint is only supported as 8, 16, 32, or 64 bit base type (ID: 0x%08x)", rec->id); return FALSE; } } /* int */ if (g_strcmp0(rec->data_type, "int") == 0) { if (rec->bitlength_base_type != rec->bitlength_encoded_type) { *err = ws_strdup_printf("Data type int is only supported in non-shortened length (ID: 0x%08x)", rec->id); return FALSE; } if ((rec->bitlength_encoded_type != 8) && (rec->bitlength_encoded_type != 16) && (rec->bitlength_encoded_type != 32) && (rec->bitlength_encoded_type != 64)) { *err = ws_strdup_printf("Data type int is only supported in 8, 16, 32, or 64 bit (ID: 0x%08x)", rec->id); return FALSE; } } /* float */ if (g_strcmp0(rec->data_type, "float") == 0) { if (rec->bitlength_base_type != rec->bitlength_encoded_type) { *err = ws_strdup_printf("Data type float is only supported in non-shortened length (ID: 0x%08x)", rec->id); return FALSE; } if ((rec->bitlength_encoded_type != 32) && (rec->bitlength_encoded_type != 64)) { *err = ws_strdup_printf("Data type float is only supported in 32 or 64 bit (ID: 0x%08x)", rec->id); return FALSE; } if ((scaler != 1.0) || (offset != 0.0)) { *err = ws_strdup_printf("Data type float currently does not support scaling and offset (ID: 0x%08x)", rec->id); return FALSE; } if (rec->multiplexer == TRUE) { *err = ws_strdup_printf("Data type float currently cannot be used as multiplexer (ID: 0x%08x)", rec->id); return FALSE; } } /* string, stringz, uint_string, utf_string, utf_stringz, utf_uint_string */ if (g_strcmp0(rec->data_type, "string") == 0 || g_strcmp0(rec->data_type, "stringz") == 0 || g_strcmp0(rec->data_type, "uint_string") == 0 || g_strcmp0(rec->data_type, "utf_string") == 0 || g_strcmp0(rec->data_type, "utf_stringz") == 0 || g_strcmp0(rec->data_type, "utf_uint_string") == 0) { if ((scaler != 1.0) || (offset != 0.0)) { *err = ws_strdup_printf("Data types string, stringz, uint_string, utf_string, utf_stringz, and utf_uint_string currently do not support scaling and offset (ID: 0x%08x)", rec->id); return FALSE; } if (rec->multiplexer == TRUE) { *err = ws_strdup_printf("Data types string, stringz, uint_string, utf_string, utf_stringz, and utf_uint_string currently cannot be used as multiplexer (ID: 0x%08x)", rec->id);; return FALSE; } if ((g_strcmp0(rec->data_type, "string") == 0 || g_strcmp0(rec->data_type, "stringz") == 0 || g_strcmp0(rec->data_type, "uint_string") == 0) && rec->bitlength_base_type != 8) { *err = ws_strdup_printf("Data types string, stringz, and uint_string only support 8 bit Bitlength base type since they are ASCII-based (ID: 0x%08x)", rec->id); return FALSE; } if ((g_strcmp0(rec->data_type, "utf_string") == 0 || g_strcmp0(rec->data_type, "utf_stringz") == 0 || g_strcmp0(rec->data_type, "utf_uint_string") == 0) && rec->bitlength_base_type != 8 && rec->bitlength_base_type != 16) { *err = ws_strdup_printf("Data types utf_string, utf_stringz, and utf_uint_string only support Bitlength base type with 8 bit (UTF-8) or 16 bit (UTF-16) (ID: 0x%08x)", rec->id); return FALSE; } if ((g_strcmp0(rec->data_type, "stringz") == 0 || g_strcmp0(rec->data_type, "utf_stringz") == 0 ) && (rec->bitlength_encoded_type != 0)) { *err = ws_strdup_printf("Data types stringz and utf_stringz only support Bitlength encoded with 0 bit since the length is determined by zero-termination (ID: 0x%08x)", rec->id); return FALSE; } if ((g_strcmp0(rec->data_type, "uint_string") == 0 || g_strcmp0(rec->data_type, "utf_uint_string") == 0) && (rec->bitlength_encoded_type != 8) && (rec->bitlength_encoded_type != 16) && (rec->bitlength_encoded_type != 32) && (rec->bitlength_encoded_type != 64)) { *err = ws_strdup_printf("Data types uint_string and utf_uint_string only support Bitlength encoded with 8, 16, 32, or 64 bit since that defines the length of the length field (ID: 0x%08x)", rec->id); return FALSE; } } if (g_strcmp0(rec->data_type, "uint") != 0 && g_strcmp0(rec->data_type, "int") != 0 && g_strcmp0(rec->data_type, "float") != 0 && (rec->aggregate_sum || rec->aggregate_avg || rec->aggregate_int)) { *err = ws_strdup_printf("Aggregation is only allowed for uint, int, and float (ID: 0x%08x)", rec->id); return FALSE; } return TRUE; } static void free_spdu_signal_list_cb(void *r) { spdu_signal_list_uat_t *rec = (spdu_signal_list_uat_t *)r; if (rec->name) { g_free(rec->name); rec->name = NULL; } if (rec->filter_string) { g_free(rec->filter_string); rec->filter_string = NULL; } if (rec->data_type) { g_free(rec->data_type); rec->data_type = NULL; } if (rec->scaler) { g_free(rec->scaler); rec->scaler = NULL; } if (rec->offset) { g_free(rec->offset); rec->offset = NULL; } } static void deregister_user_data_hfarray(hf_register_info **hf_array, guint *number_of_entries) { if (hf_array == NULL || number_of_entries == NULL) { return; } guint dynamic_hf_size = *number_of_entries; hf_register_info *dynamic_hf = *hf_array; if (dynamic_hf != NULL) { /* Unregister all fields */ for (guint i = 0; i < dynamic_hf_size; i++) { if (dynamic_hf[i].p_id != NULL) { if (*(dynamic_hf[i].p_id) != -1) { proto_deregister_field(proto_signal_pdu, *(dynamic_hf[i].p_id)); } g_free(dynamic_hf[i].p_id); dynamic_hf[i].p_id = NULL; /* workaround since the proto.c proto_free_field_strings would double free this... */ dynamic_hf[i].hfinfo.strings = NULL; } } proto_add_deregistered_data(dynamic_hf); *hf_array = NULL; *number_of_entries = 0; } } static void deregister_user_data(void) { deregister_user_data_hfarray(&dynamic_hf_base_raw, &dynamic_hf_base_raw_number); deregister_user_data_hfarray(&dynamic_hf_agg_sum, &dynamic_hf_agg_sum_number); deregister_user_data_hfarray(&dynamic_hf_agg_avg, &dynamic_hf_agg_avg_number); deregister_user_data_hfarray(&dynamic_hf_agg_int, &dynamic_hf_agg_int_number); dynamic_hf_number_of_entries = 0; } static spdu_signal_value_name_t *get_signal_value_name_config(guint32 id, guint16 pos); static gint* create_hf_entry(hf_register_info *dynamic_hf, guint i, guint32 id, guint32 pos, gchar *name, gchar *filter_string, spdu_dt_t data_type, gboolean scale_or_offset, guint32 hf_type) { val64_string *vs = NULL; gint *hf_id = g_new(gint, 1); *hf_id = -1; spdu_signal_value_name_t *sig_val = get_signal_value_name_config(id, pos); if (sig_val != NULL) { vs = sig_val->vs; } dynamic_hf[i].p_id = hf_id; dynamic_hf[i].hfinfo.bitmask = 0x0; switch (hf_type) { case HF_TYPE_RAW: dynamic_hf[i].hfinfo.name = ws_strdup_printf("%s_raw", name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s_raw", SPDU_NAME_FILTER, filter_string); break; case HF_TYPE_AGG_SUM: dynamic_hf[i].hfinfo.name = ws_strdup_printf("%s_sum", name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s_sum", SPDU_NAME_FILTER, filter_string); break; case HF_TYPE_AGG_AVG: dynamic_hf[i].hfinfo.name = ws_strdup_printf("%s_avg", name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s_avg", SPDU_NAME_FILTER, filter_string); break; case HF_TYPE_AGG_INT: dynamic_hf[i].hfinfo.name = ws_strdup_printf("%s_int", name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s_int", SPDU_NAME_FILTER, filter_string); break; case HF_TYPE_BASE: dynamic_hf[i].hfinfo.name = ws_strdup(name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s", SPDU_NAME_FILTER, filter_string); break; case HF_TYPE_NONE: default: /* we bail out but have set hf_id to -1 before */ dynamic_hf[i].hfinfo.name = ws_strdup_printf("%s_none", name);; dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s_none", SPDU_NAME_FILTER, filter_string); return hf_id; } dynamic_hf[i].hfinfo.bitmask = 0; dynamic_hf[i].hfinfo.blurb = NULL; if ((scale_or_offset && hf_type == HF_TYPE_BASE) || hf_type == HF_TYPE_AGG_SUM || hf_type == HF_TYPE_AGG_AVG || hf_type == HF_TYPE_AGG_INT) { dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.type = FT_DOUBLE; } else { switch (data_type) { case SPDU_DATA_TYPE_UINT: dynamic_hf[i].hfinfo.display = BASE_DEC; dynamic_hf[i].hfinfo.type = FT_UINT64; break; case SPDU_DATA_TYPE_INT: dynamic_hf[i].hfinfo.display = BASE_DEC; dynamic_hf[i].hfinfo.type = FT_INT64; break; case SPDU_DATA_TYPE_FLOAT: dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.type = FT_DOUBLE; break; case SPDU_DATA_TYPE_STRING: dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.type = FT_STRING; break; case SPDU_DATA_TYPE_STRINGZ: dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.type = FT_STRINGZ; break; case SPDU_DATA_TYPE_UINT_STRING: dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.type = FT_UINT_STRING; break; case SPDU_DATA_TYPE_NONE: /* do nothing */ break; } } if (hf_type == HF_TYPE_RAW && vs != NULL) { dynamic_hf[i].hfinfo.strings = VALS64(vs); dynamic_hf[i].hfinfo.display |= BASE_VAL64_STRING | BASE_SPECIAL_VALS; } else { dynamic_hf[i].hfinfo.strings = NULL; } HFILL_INIT(dynamic_hf[i]); return hf_id; } static void post_update_spdu_signal_list_read_in_data(spdu_signal_list_uat_t *data, guint data_num, GHashTable *ht) { if (ht == NULL || data == NULL || data_num == 0) { return; } if (data_num) { dynamic_hf_number_of_entries = data_num; /* lets create the dynamic_hf array (base + raw) */ dynamic_hf_base_raw = g_new0(hf_register_info, 2 * dynamic_hf_number_of_entries); dynamic_hf_base_raw_number = 2 * dynamic_hf_number_of_entries; /* lets create the other dynamic_hf arrays */ dynamic_hf_agg_sum = g_new0(hf_register_info, dynamic_hf_number_of_entries); dynamic_hf_agg_sum_number = 0; dynamic_hf_agg_avg = g_new0(hf_register_info, dynamic_hf_number_of_entries); dynamic_hf_agg_avg_number = 0; dynamic_hf_agg_int = g_new0(hf_register_info, dynamic_hf_number_of_entries); dynamic_hf_agg_int_number = 0; guint i = 0; for (i = 0; i < data_num; i++) { /* the hash table does not know about uint64, so we use int64*/ gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = (guint32)data[i].id; spdu_signal_list_t *list = (spdu_signal_list_t *)g_hash_table_lookup(ht, key); if (list == NULL) { list = wmem_new(wmem_epan_scope(), spdu_signal_list_t); list->id = data[i].id; list->num_of_items = data[i].num_of_params; spdu_signal_item_t *items = (spdu_signal_item_t *)wmem_alloc0_array(wmem_epan_scope(), spdu_signal_item_t, data[i].num_of_params); list->items = items; /* create new entry ... */ g_hash_table_insert(ht, key, list); } else { /* already present, deleting key */ wmem_free(wmem_epan_scope(), key); } /* and now we add to item array */ if (data[i].num_of_params == list->num_of_items && data[i].pos < list->num_of_items) { spdu_signal_item_t *item = &(list->items[data[i].pos]); /* we do not care if we overwrite param */ item->name = g_strdup(data[i].name); item->pos = data[i].pos; item->encoding = ENC_ASCII; if (g_strcmp0("utf_string", data[i].data_type) == 0 || g_strcmp0("utf_stringz", data[i].data_type) == 0 || g_strcmp0("utf_uint_string", data[i].data_type) == 0) { switch (data[i].bitlength_base_type) { case 8: item->encoding = ENC_UTF_8; break; case 16: item->encoding = ENC_UTF_16; break; default: /* this should never happen, since it is validated in the update callback */ item->encoding = ENC_ASCII; break; } } if (g_strcmp0("uint", data[i].data_type) == 0) { item->data_type = SPDU_DATA_TYPE_UINT; } else if (g_strcmp0("int", data[i].data_type) == 0) { item->data_type = SPDU_DATA_TYPE_INT; } else if (g_strcmp0("float", data[i].data_type) == 0) { item->data_type = SPDU_DATA_TYPE_FLOAT; } else if (g_strcmp0("string", data[i].data_type) == 0 || g_strcmp0("utf_string", data[i].data_type) == 0) { item->data_type = SPDU_DATA_TYPE_STRING; } else if (g_strcmp0("stringz", data[i].data_type) == 0 || g_strcmp0("utf_stringz", data[i].data_type) == 0) { item->data_type = SPDU_DATA_TYPE_STRINGZ; } else if (g_strcmp0("uint_string", data[i].data_type) == 0 || g_strcmp0("utf_uint_string", data[i].data_type) == 0) { item->data_type = SPDU_DATA_TYPE_UINT_STRING; } else { item->data_type = SPDU_DATA_TYPE_NONE; } item->big_endian = data[i].big_endian; item->bitlength_base_type = data[i].bitlength_base_type; item->bitlength_encoded_type = data[i].bitlength_encoded_type; item->scaler = g_ascii_strtod(data[i].scaler, NULL); item->offset = g_ascii_strtod(data[i].offset, NULL); item->scale_or_offset = (item->scaler != 1.0 || item->offset != 0.0); item->multiplexer = data[i].multiplexer; item->multiplex_value_only = data[i].multiplex_value_only; item->hidden = data[i].hidden; item->aggregate_sum = data[i].aggregate_sum; item->aggregate_avg = data[i].aggregate_avg; item->aggregate_int = data[i].aggregate_int; /* if one signal needs aggregation, the messages needs to know */ list->aggregation |= item->aggregate_sum | item->aggregate_avg | item->aggregate_int; item->hf_id_effective = create_hf_entry(dynamic_hf_base_raw, HF_TYPE_COUNT_BASE_RAW_TABLE * i + HF_TYPE_BASE, data[i].id, data[i].pos, data[i].name, data[i].filter_string, item->data_type, item->scale_or_offset, HF_TYPE_BASE); item->hf_id_raw = create_hf_entry(dynamic_hf_base_raw, HF_TYPE_COUNT_BASE_RAW_TABLE * i + HF_TYPE_RAW, data[i].id, data[i].pos, data[i].name, data[i].filter_string, item->data_type, item->scale_or_offset, HF_TYPE_RAW); if (data[i].aggregate_sum) { item->hf_id_agg_sum = create_hf_entry(dynamic_hf_agg_sum, dynamic_hf_agg_sum_number++, data[i].id, data[i].pos, data[i].name, data[i].filter_string, item->data_type, item->scale_or_offset, HF_TYPE_AGG_SUM); } if (data[i].aggregate_avg) { item->hf_id_agg_avg = create_hf_entry(dynamic_hf_agg_avg, dynamic_hf_agg_avg_number++, data[i].id, data[i].pos, data[i].name, data[i].filter_string, item->data_type, item->scale_or_offset, HF_TYPE_AGG_AVG); } if (data[i].aggregate_int) { item->hf_id_agg_int = create_hf_entry(dynamic_hf_agg_int, dynamic_hf_agg_int_number++, data[i].id, data[i].pos, data[i].name, data[i].filter_string, item->data_type, item->scale_or_offset, HF_TYPE_AGG_INT); } } } if (dynamic_hf_base_raw_number) { proto_register_field_array(proto_signal_pdu, dynamic_hf_base_raw, dynamic_hf_base_raw_number); } if (dynamic_hf_agg_sum_number) { proto_register_field_array(proto_signal_pdu, dynamic_hf_agg_sum, dynamic_hf_agg_sum_number); } if (dynamic_hf_agg_avg_number) { proto_register_field_array(proto_signal_pdu, dynamic_hf_agg_avg, dynamic_hf_agg_avg_number); } if (dynamic_hf_agg_int_number) { proto_register_field_array(proto_signal_pdu, dynamic_hf_agg_int, dynamic_hf_agg_int_number); } } } static void post_update_spdu_signal_list_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_signal_list) { g_hash_table_destroy(data_spdu_signal_list); data_spdu_signal_list = NULL; } deregister_user_data(); data_spdu_signal_list = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, &spdu_payload_free_generic_data); post_update_spdu_signal_list_read_in_data(spdu_signal_list, spdu_signal_list_num, data_spdu_signal_list); } static void reset_spdu_signal_list(void) { deregister_user_data(); } static spdu_signal_list_t * get_parameter_config(guint64 id) { if (data_spdu_signal_list == NULL) { return NULL; } gint64 key = (gint64)id; return (spdu_signal_list_t *)g_hash_table_lookup(data_spdu_signal_list, &key); } /* UAT: Value Names */ UAT_HEX_CB_DEF(spdu_signal_value_names, id, spdu_signal_value_name_uat_t) UAT_DEC_CB_DEF(spdu_signal_value_names, pos, spdu_signal_value_name_uat_t) UAT_DEC_CB_DEF(spdu_signal_value_names, num_of_items, spdu_signal_value_name_uat_t) UAT_HEX64_CB_DEF(spdu_signal_value_names, value_start, spdu_signal_value_name_uat_t) UAT_HEX64_CB_DEF(spdu_signal_value_names, value_end, spdu_signal_value_name_uat_t) UAT_CSTRING_CB_DEF(spdu_signal_value_names, value_name, spdu_signal_value_name_uat_t) static void * copy_spdu_signal_value_name_cb(void *n, const void *o, size_t size _U_) { spdu_signal_value_name_uat_t *new_rec = (spdu_signal_value_name_uat_t *)n; const spdu_signal_value_name_uat_t *old_rec = (const spdu_signal_value_name_uat_t *)o; new_rec->id = old_rec->id; new_rec->num_of_items = old_rec->num_of_items; new_rec->pos = old_rec->pos; new_rec->value_start = old_rec->value_start; new_rec->value_end = old_rec->value_end; if (old_rec->value_name) { new_rec->value_name = g_strdup(old_rec->value_name); } else { new_rec->value_name = NULL; } return new_rec; } static gboolean update_spdu_signal_value_name(void *r, char **err) { spdu_signal_value_name_uat_t *rec = (spdu_signal_value_name_uat_t *)r; if (rec->value_name == NULL || rec->value_name[0] == 0) { *err = ws_strdup_printf("Value Name cannot be empty"); return FALSE; } if (rec->value_end < rec->value_start) { *err = ws_strdup_printf("Value Range is defined backwards (end < start)!"); return FALSE; } if (rec->pos >= 0xffff) { *err = ws_strdup_printf("Position too big"); return FALSE; } return TRUE; } static void free_spdu_signal_value_name_cb(void *r) { spdu_signal_value_name_uat_t *rec = (spdu_signal_value_name_uat_t *)r; if (rec->value_name) { g_free(rec->value_name); rec->value_name = NULL; } } static void post_update_spdu_signal_value_names_read_in_data(spdu_signal_value_name_uat_t *data, guint data_num, GHashTable *ht) { if (ht == NULL || data == NULL || data_num == 0) { return; } guint i; for (i = 0; i < data_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = (guint64)data[i].id | ((guint64)data[i].pos << 32); spdu_signal_value_name_t *list = (spdu_signal_value_name_t *)g_hash_table_lookup(ht, key); if (list == NULL) { list = wmem_new(wmem_epan_scope(), spdu_signal_value_name_t); INIT_SIGNAL_VALUE_NAME(list) list->id = data[i].id; list->pos = data[i].pos; list->num_of_items = data[i].num_of_items; list->items = (spdu_signal_value_name_item_t *)wmem_alloc0_array(wmem_epan_scope(), spdu_signal_value_name_item_t, list->num_of_items); list->vs = (val64_string *)wmem_alloc0_array(wmem_epan_scope(), val64_string, list->num_of_items + 1); /* create new entry ... */ g_hash_table_insert(ht, key, list); } else { /* do not need it anymore */ wmem_free(wmem_epan_scope(), key); } /* and now we add to item array */ if (list->num_of_items > 0 && data[i].num_of_items == list->num_of_items) { /* find first empty slot for value */ guint j; for (j = 0; j < list->num_of_items && list->items[j].name != NULL; j++); if (j < list->num_of_items) { spdu_signal_value_name_item_t *item = &(list->items[j]); INIT_SIGNAL_VALUE_NAME_ITEM(item) item->value_start = data[i].value_start; item->value_end = data[i].value_end; item->name = g_strdup(data[i].value_name); } /* find first empty slot for range_value array */ guint g; for (g = 0; g < list->num_of_items && list->vs[g].strptr != NULL; g++); if (g < list->num_of_items) { /* Limitation: range strings currently do not support guint64 min/max and do not support filtering using value names. */ /* Therefore, we currently use only val64_string. :-( */ list->vs[g].value = (guint32)data[i].value_start; list->vs[g].strptr = g_strdup(data[i].value_name); } } } } static void post_update_spdu_signal_value_names_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_signal_value_names) { g_hash_table_destroy(data_spdu_signal_value_names); data_spdu_signal_value_names = NULL; } data_spdu_signal_value_names = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, &spdu_payload_free_generic_data); post_update_spdu_signal_value_names_read_in_data(spdu_signal_value_names, spdu_parameter_value_names_num, data_spdu_signal_value_names); } static spdu_signal_value_name_t * get_signal_value_name_config(guint32 id, guint16 pos) { if (data_spdu_signal_list == NULL) { return NULL; } gint64 key = (guint64)id | (guint64)pos << 32; return (spdu_signal_value_name_t *)g_hash_table_lookup(data_spdu_signal_value_names, &key); } /* UAT: SOME/IP Mapping */ UAT_HEX_CB_DEF(spdu_someip_mapping, service_id, spdu_someip_mapping_uat_t) UAT_HEX_CB_DEF(spdu_someip_mapping, method_id, spdu_someip_mapping_uat_t) UAT_HEX_CB_DEF(spdu_someip_mapping, major_version, spdu_someip_mapping_uat_t) UAT_HEX_CB_DEF(spdu_someip_mapping, message_type, spdu_someip_mapping_uat_t) UAT_HEX_CB_DEF(spdu_someip_mapping, spdu_message_id, spdu_someip_mapping_uat_t) static gint64 spdu_someip_key(guint16 service_id, guint16 method_id, guint8 major_version, guint8 message_type) { return (gint64)method_id | ((gint64)service_id << 16) | ((gint64)major_version << 32) | ((gint64)message_type << 40); } static void * copy_spdu_someip_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_someip_mapping_uat_t *new_rec = (spdu_someip_mapping_uat_t *)n; const spdu_someip_mapping_uat_t *old_rec = (const spdu_someip_mapping_uat_t *)o; new_rec->service_id = old_rec->service_id; new_rec->method_id = old_rec->method_id; new_rec->major_version = old_rec->major_version; new_rec->message_type = old_rec->message_type; new_rec->spdu_message_id = old_rec->spdu_message_id; return new_rec; } static gboolean update_spdu_someip_mapping(void *r, char **err) { spdu_someip_mapping_uat_t *rec = (spdu_someip_mapping_uat_t *)r; if (rec->service_id > 0xffff) { *err = ws_strdup_printf("We currently only support 16 bit SOME/IP Service IDs (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", rec->service_id, rec->method_id, rec->message_type, rec->major_version); return FALSE; } if (rec->method_id > 0xffff) { *err = ws_strdup_printf("We currently only support 16 bit SOME/IP Method IDs (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", rec->service_id, rec->method_id, rec->message_type, rec->major_version); return FALSE; } if (rec->major_version > 0xff) { *err = ws_strdup_printf("We currently only support 8 bit SOME/IP major versions (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", rec->service_id, rec->method_id, rec->message_type, rec->major_version); } if (rec->message_type > 0xff) { *err = ws_strdup_printf("We currently only support 8 bit SOME/IP message types (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", rec->service_id, rec->method_id, rec->message_type, rec->major_version); } return TRUE; } static void post_update_spdu_someip_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_someip_mappings) { g_hash_table_destroy(data_spdu_someip_mappings); data_spdu_someip_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_someip_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_someip_mappings == NULL || spdu_someip_mapping == NULL) { return; } guint i; if (spdu_someip_mapping_num > 0) { for (i = 0; i < spdu_someip_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = spdu_someip_key((guint16)spdu_someip_mapping[i].service_id, (guint16)spdu_someip_mapping[i].method_id, (guint8)spdu_someip_mapping[i].major_version, (guint8)spdu_someip_mapping[i].message_type); g_hash_table_insert(data_spdu_someip_mappings, key, &spdu_someip_mapping[i]); } } /* we need to make sure we register again */ register_signal_pdu_someip(); } static spdu_someip_mapping_t * get_someip_mapping(guint16 service_id, guint16 method_id, guint8 major_version, guint8 message_type) { if (data_spdu_someip_mappings == NULL) { return NULL; } gint64 key = spdu_someip_key(service_id, method_id, major_version, message_type); return (spdu_someip_mapping_t *)g_hash_table_lookup(data_spdu_someip_mappings, &key); } /* UAT: CAN Mapping */ UAT_HEX_CB_DEF(spdu_can_mapping, can_id, spdu_can_mapping_uat_t) UAT_HEX_CB_DEF(spdu_can_mapping, bus_id, spdu_can_mapping_uat_t) UAT_HEX_CB_DEF(spdu_can_mapping, message_id, spdu_can_mapping_uat_t) static void * copy_spdu_can_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_can_mapping_uat_t *new_rec = (spdu_can_mapping_uat_t *)n; const spdu_can_mapping_uat_t *old_rec = (const spdu_can_mapping_uat_t *)o; new_rec->can_id = old_rec->can_id; new_rec->bus_id = old_rec->bus_id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_can_mapping(void *r, char **err) { spdu_can_mapping_uat_t *rec = (spdu_can_mapping_uat_t *)r; if ((rec->can_id & (CAN_RTR_FLAG | CAN_ERR_FLAG)) != 0) { *err = g_strdup_printf("We currently do not support CAN IDs with RTR or Error Flag set (CAN_ID: 0x%x)", rec->can_id); return FALSE; } if ((rec->can_id & CAN_EFF_FLAG) == 0 && rec->can_id > CAN_SFF_MASK) { *err = g_strdup_printf("Standard CAN ID (EFF flag not set) cannot be bigger than 0x7ff (CAN_ID: 0x%x)", rec->can_id); return FALSE; } return TRUE; } static void post_update_spdu_can_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_can_mappings) { g_hash_table_destroy(data_spdu_can_mappings); data_spdu_can_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_can_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_can_mappings == NULL || spdu_can_mapping == NULL) { return; } if (spdu_can_mapping_num > 0) { guint i; for (i = 0; i < spdu_can_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = spdu_can_mapping[i].can_id; *key |= ((gint64)(spdu_can_mapping[i].bus_id & 0xffff)) << 32; g_hash_table_insert(data_spdu_can_mappings, key, &spdu_can_mapping[i]); } } /* we need to make sure we register again */ register_signal_pdu_can(); } static spdu_can_mapping_t * get_can_mapping(guint32 id, guint16 bus_id) { if (data_spdu_can_mappings == NULL) { return NULL; } /* key is Bus ID, EFF Flag, CAN-ID*/ gint64 key = ((gint64)id & (CAN_EFF_MASK | CAN_EFF_FLAG)) | ((gint64)bus_id << 32); spdu_can_mapping_t *tmp = (spdu_can_mapping_t *)g_hash_table_lookup(data_spdu_can_mappings, &key); if (tmp == NULL) { /* try again without Bus ID set */ key = id & (CAN_EFF_MASK | CAN_EFF_FLAG); tmp = (spdu_can_mapping_t *)g_hash_table_lookup(data_spdu_can_mappings, &key); } return tmp; } /* UAT: FlexRay Mapping */ UAT_HEX_CB_DEF(spdu_flexray_mapping, channel, spdu_flexray_mapping_uat_t) UAT_HEX_CB_DEF(spdu_flexray_mapping, cycle, spdu_flexray_mapping_uat_t) UAT_HEX_CB_DEF(spdu_flexray_mapping, flexray_id, spdu_flexray_mapping_uat_t) UAT_HEX_CB_DEF(spdu_flexray_mapping, message_id, spdu_flexray_mapping_uat_t) static void * copy_spdu_flexray_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_flexray_mapping_uat_t *new_rec = (spdu_flexray_mapping_uat_t *)n; const spdu_flexray_mapping_uat_t *old_rec = (const spdu_flexray_mapping_uat_t *)o; new_rec->channel = old_rec->channel; new_rec->cycle = old_rec->cycle; new_rec->flexray_id = old_rec->flexray_id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_flexray_mapping(void *r, char **err) { spdu_flexray_mapping_uat_t *rec = (spdu_flexray_mapping_uat_t *)r; if (rec->cycle > 0xff) { *err = ws_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->flexray_id); return FALSE; } if (rec->flexray_id > 0xffff) { *err = ws_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->flexray_id); return FALSE; } return TRUE; } static void post_update_spdu_flexray_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_flexray_mappings) { g_hash_table_destroy(data_spdu_flexray_mappings); data_spdu_flexray_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_flexray_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_flexray_mappings == NULL || spdu_flexray_mapping == NULL) { return; } if (spdu_flexray_mapping_num > 0) { guint i; for (i = 0; i < spdu_flexray_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = spdu_flexray_mapping[i].flexray_id & 0xffff; *key |= (gint64)(spdu_flexray_mapping[i].cycle & 0xff) << 16; *key |= (gint64)(spdu_flexray_mapping[i].channel & 0xff) << 24; g_hash_table_insert(data_spdu_flexray_mappings, key, &spdu_flexray_mapping[i]); } } } static spdu_flexray_mapping_t * get_flexray_mapping(guint8 channel, guint8 cycle, guint16 flexray_id) { if (data_spdu_flexray_mappings == NULL) { return NULL; } gint64 key = (channel << 24) | (cycle << 16) | flexray_id; return (spdu_flexray_mapping_t *)g_hash_table_lookup(data_spdu_flexray_mappings, &key); } /* UAT: LIN Mapping */ UAT_HEX_CB_DEF(spdu_lin_mapping, frame_id, spdu_lin_mapping_uat_t) UAT_HEX_CB_DEF(spdu_lin_mapping, bus_id, spdu_lin_mapping_uat_t) UAT_HEX_CB_DEF(spdu_lin_mapping, message_id, spdu_lin_mapping_uat_t) static void * copy_spdu_lin_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_lin_mapping_uat_t *new_rec = (spdu_lin_mapping_uat_t *)n; const spdu_lin_mapping_uat_t *old_rec = (const spdu_lin_mapping_uat_t *)o; new_rec->frame_id = old_rec->frame_id; new_rec->bus_id = old_rec->bus_id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_lin_mapping(void *r, char **err) { spdu_lin_mapping_uat_t *rec = (spdu_lin_mapping_uat_t *)r; if (rec->frame_id > LIN_ID_MASK) { *err = ws_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id); return FALSE; } if (rec->bus_id > 0xffff) { *err = ws_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id); return FALSE; } return TRUE; } static void post_update_spdu_lin_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_lin_mappings) { g_hash_table_destroy(data_spdu_lin_mappings); data_spdu_lin_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_lin_mappings = g_hash_table_new_full(g_int_hash, g_int_equal, &spdu_payload_free_key, NULL); if (data_spdu_lin_mappings == NULL || spdu_lin_mapping == NULL) { return; } if (spdu_lin_mapping_num > 0) { guint i; for (i = 0; i < spdu_lin_mapping_num; i++) { gint *key = wmem_new(wmem_epan_scope(), gint); *key = (spdu_lin_mapping[i].frame_id) & LIN_ID_MASK; *key |= ((spdu_lin_mapping[i].bus_id) & 0xffff) << 16; g_hash_table_insert(data_spdu_lin_mappings, key, &spdu_lin_mapping[i]); } } /* we need to make sure we register again */ register_signal_pdu_lin(); } static spdu_lin_mapping_t * get_lin_mapping(lin_info_t *lininfo) { if (data_spdu_lin_mappings == NULL) { return NULL; } gint32 key = ((lininfo->id) & LIN_ID_MASK) | (((lininfo->bus_id) & 0xffff) << 16); spdu_lin_mapping_uat_t *tmp = (spdu_lin_mapping_uat_t *)g_hash_table_lookup(data_spdu_lin_mappings, &key); if (tmp == NULL) { /* try again without Bus ID set */ key = (lininfo->id) & LIN_ID_MASK; tmp = (spdu_lin_mapping_uat_t *)g_hash_table_lookup(data_spdu_lin_mappings, &key); } return tmp; } /* UAT: PDU Transport Mapping */ UAT_HEX_CB_DEF(spdu_pdu_transport_mapping, pdu_id, spdu_pdu_transport_mapping_uat_t) UAT_HEX_CB_DEF(spdu_pdu_transport_mapping, message_id, spdu_pdu_transport_mapping_uat_t) static void * copy_spdu_pdu_transport_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_pdu_transport_mapping_uat_t *new_rec = (spdu_pdu_transport_mapping_uat_t *)n; const spdu_pdu_transport_mapping_uat_t *old_rec = (const spdu_pdu_transport_mapping_uat_t *)o; new_rec->pdu_id = old_rec->pdu_id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_pdu_transport_mapping(void *r, char **err) { spdu_pdu_transport_mapping_uat_t *rec = (spdu_pdu_transport_mapping_uat_t *)r; if (rec->pdu_id > 0xffffffff) { *err = ws_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id); return FALSE; } return TRUE; } static void post_update_spdu_pdu_transport_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_pdu_transport_mappings) { g_hash_table_destroy(data_spdu_pdu_transport_mappings); data_spdu_pdu_transport_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_pdu_transport_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_pdu_transport_mappings == NULL || spdu_pdu_transport_mapping == NULL) { return; } if (spdu_pdu_transport_mapping_num > 0) { guint i; for (i = 0; i < spdu_pdu_transport_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = spdu_pdu_transport_mapping[i].pdu_id; g_hash_table_insert(data_spdu_pdu_transport_mappings, key, &spdu_pdu_transport_mapping[i]); } } /* we need to make sure we register again */ register_signal_pdu_pdu_transport(); } static spdu_pdu_transport_mapping_t * get_pdu_transport_mapping(guint32 pdu_transport_id) { if (data_spdu_pdu_transport_mappings == NULL) { return NULL; } gint64 key = pdu_transport_id; return (spdu_pdu_transport_mapping_uat_t *)g_hash_table_lookup(data_spdu_pdu_transport_mappings, &key); } /* UAT: IPduM Mapping */ UAT_HEX_CB_DEF(spdu_ipdum_mapping, pdu_id, spdu_ipdum_mapping_uat_t) UAT_HEX_CB_DEF(spdu_ipdum_mapping, message_id, spdu_ipdum_mapping_uat_t) static void * copy_spdu_ipdum_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_ipdum_mapping_uat_t *new_rec = (spdu_ipdum_mapping_uat_t *)n; const spdu_ipdum_mapping_uat_t *old_rec = (const spdu_ipdum_mapping_uat_t *)o; new_rec->pdu_id = old_rec->pdu_id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_ipdum_mapping(void *r, char **err) { spdu_ipdum_mapping_uat_t *rec = (spdu_ipdum_mapping_uat_t *)r; if (rec->pdu_id > 0xffffffff) { *err = ws_strdup_printf("IPduM IDs are only uint32 (ID: %i)", rec->pdu_id); return FALSE; } return TRUE; } static void post_update_spdu_ipdum_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_ipdum_mappings) { g_hash_table_destroy(data_spdu_ipdum_mappings); data_spdu_ipdum_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_ipdum_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_ipdum_mappings == NULL || spdu_ipdum_mapping == NULL) { return; } if (spdu_ipdum_mapping_num > 0) { guint i; for (i = 0; i < spdu_ipdum_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = spdu_ipdum_mapping[i].pdu_id; g_hash_table_insert(data_spdu_ipdum_mappings, key, &spdu_ipdum_mapping[i]); } } /* we need to make sure we register again */ register_signal_pdu_ipdum_ids(); } static spdu_ipdum_mapping_uat_t * get_ipdum_mapping(guint32 pdu_id) { if (data_spdu_ipdum_mappings == NULL) { return NULL; } gint64 key = pdu_id; return (spdu_ipdum_mapping_uat_t *)g_hash_table_lookup(data_spdu_ipdum_mappings, &key); } /* UAT: DLT Mapping */ UAT_CSTRING_CB_DEF(spdu_dlt_mapping, ecu_id, spdu_dlt_mapping_uat_t) UAT_HEX_CB_DEF(spdu_dlt_mapping, dlt_message_id, spdu_dlt_mapping_uat_t) UAT_HEX_CB_DEF(spdu_dlt_mapping, message_id, spdu_dlt_mapping_uat_t) static void * copy_spdu_dlt_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_dlt_mapping_uat_t *new_rec = (spdu_dlt_mapping_uat_t *)n; const spdu_dlt_mapping_uat_t *old_rec = (const spdu_dlt_mapping_uat_t *)o; if (old_rec->ecu_id) { new_rec->ecu_id = g_strdup(old_rec->ecu_id); } else { new_rec->ecu_id = NULL; } new_rec->dlt_message_id = old_rec->dlt_message_id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_dlt_mapping(void *r, char **err) { spdu_dlt_mapping_uat_t *rec = (spdu_dlt_mapping_uat_t *)r; if (rec->ecu_id != NULL && strlen(rec->ecu_id) > 4) { *err = ws_strdup_printf("ECU ID can only be up to 4 characters long!"); return FALSE; } return TRUE; } static void post_update_spdu_dlt_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_dlt_mappings) { g_hash_table_destroy(data_spdu_dlt_mappings); data_spdu_dlt_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_dlt_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_dlt_mappings == NULL || spdu_dlt_mapping == NULL) { return; } if (spdu_dlt_mapping_num > 0) { guint i; for (i = 0; i < spdu_dlt_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); *key = spdu_dlt_mapping[i].dlt_message_id; *key |= (gint64)(dlt_ecu_id_to_gint32(spdu_dlt_mapping[i].ecu_id)) << 32; g_hash_table_insert(data_spdu_dlt_mappings, key, &spdu_dlt_mapping[i]); } } } static spdu_dlt_mapping_uat_t * get_dlt_mapping(guint32 pdu_id, const gchar *ecu_id) { if (data_spdu_dlt_mappings == NULL) { return NULL; } gint64 key = pdu_id; key |= (gint64)dlt_ecu_id_to_gint32(ecu_id) << 32; return (spdu_dlt_mapping_uat_t *)g_hash_table_lookup(data_spdu_dlt_mappings, &key); } /* UAT: UDS Mapping */ UAT_HEX_CB_DEF(spdu_uds_mapping, uds_address, spdu_uds_mapping_uat_t) UAT_HEX_CB_DEF(spdu_uds_mapping, service, spdu_uds_mapping_uat_t) UAT_BOOL_CB_DEF(spdu_uds_mapping, reply, spdu_uds_mapping_uat_t) UAT_HEX_CB_DEF(spdu_uds_mapping, id, spdu_uds_mapping_uat_t) UAT_HEX_CB_DEF(spdu_uds_mapping, message_id, spdu_uds_mapping_uat_t) static void * copy_spdu_uds_mapping_cb(void *n, const void *o, size_t size _U_) { spdu_uds_mapping_uat_t *new_rec = (spdu_uds_mapping_uat_t *)n; const spdu_uds_mapping_uat_t *old_rec = (const spdu_uds_mapping_uat_t *)o; new_rec->uds_address = old_rec->uds_address; new_rec->service = old_rec->service; new_rec->reply = old_rec->reply; new_rec->id = old_rec->id; new_rec->message_id = old_rec->message_id; return new_rec; } static gboolean update_spdu_uds_mapping(void *r, char **err) { spdu_uds_mapping_uat_t *rec = (spdu_uds_mapping_uat_t *)r; if (rec->id > 0xffff) { *err = g_strdup_printf("UDS IDs are only uint16!"); return FALSE; } if (rec->service > 0xff) { *err = g_strdup_printf("UDS Services are only uint8!"); return FALSE; } return TRUE; } static void post_update_spdu_uds_mapping_cb(void) { /* destroy old hash table, if it exists */ if (data_spdu_uds_mappings) { g_hash_table_destroy(data_spdu_uds_mappings); data_spdu_uds_mappings = NULL; } /* we don't need to free the data as long as we don't alloc it first */ data_spdu_uds_mappings = g_hash_table_new_full(g_int64_hash, g_int64_equal, &spdu_payload_free_key, NULL); if (data_spdu_uds_mappings == NULL || spdu_uds_mapping == NULL) { return; } if (spdu_uds_mapping_num > 0) { guint i; guint32 sid; for (i = 0; i < spdu_uds_mapping_num; i++) { gint64 *key = wmem_new(wmem_epan_scope(), gint64); if (spdu_uds_mapping[i].reply) { sid = (0xff & spdu_uds_mapping[i].service) | UDS_REPLY_MASK; } else { sid = (0xff & spdu_uds_mapping[i].service); } *key = (guint64)(spdu_uds_mapping[i].uds_address) | ((guint64)(0xffff & spdu_uds_mapping[i].id) << 32) | ((guint64)sid << 48); g_hash_table_insert(data_spdu_uds_mappings, key, &spdu_uds_mapping[i]); /* Adding with 0xffffffff (ANY) as address too */ key = wmem_new(wmem_epan_scope(), gint64); *key = (guint64)(0xffffffff) | ((guint64)(0xffff & spdu_uds_mapping[i].id) << 32) | ((guint64)sid << 48); g_hash_table_insert(data_spdu_uds_mappings, key, &spdu_uds_mapping[i]); } } } static spdu_uds_mapping_uat_t * get_uds_mapping(uds_info_t *uds_info) { guint32 sid; DISSECTOR_ASSERT(uds_info); if (data_spdu_uds_mappings == NULL) { return NULL; } gint64 *key = wmem_new(wmem_epan_scope(), gint64); if (uds_info->reply) { sid = (0xff & uds_info->service) | UDS_REPLY_MASK; } else { sid = (0xff & uds_info->service); } *key = (guint64)(uds_info->uds_address) | ((guint64)(0xffff & uds_info->id) << 32) | ((guint64)sid << 48); spdu_uds_mapping_uat_t *tmp = (spdu_uds_mapping_uat_t *)g_hash_table_lookup(data_spdu_uds_mappings, key); /* if we cannot find it for the Address, lets look at MAXUINT32 */ if (tmp == NULL) { *key = (guint64)(G_MAXUINT32) | ((guint64)(0xffff & uds_info->id) << 32) | ((guint64)sid << 48); tmp = (spdu_uds_mapping_uat_t *)g_hash_table_lookup(data_spdu_uds_mappings, key); } wmem_free(wmem_epan_scope(), key); return tmp; } /************************************** ******** Expert Infos ******** **************************************/ static void expert_spdu_payload_truncated(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, gint length) { proto_tree_add_expert(tree, pinfo, &ef_spdu_payload_truncated, tvb, offset, length); col_append_str(pinfo->cinfo, COL_INFO, " [Signal PDU: Truncated payload!]"); } static void expert_spdu_config_error(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, gint length) { proto_tree_add_expert(tree, pinfo, &ef_spdu_config_error, tvb, offset, length); col_append_str(pinfo->cinfo, COL_INFO, " [Signal PDU: Config Error!]"); } static void expert_spdu_unaligned_data(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, gint length) { proto_tree_add_expert(tree, pinfo, &ef_spdu_unaligned_data, tvb, offset, length); col_append_str(pinfo->cinfo, COL_INFO, " [Signal PDU: Unaligned Data!]"); } /************************************** ******** Aggregation Feature ******** **************************************/ typedef struct _spdu_frame_data { gdouble sum; guint32 count; gdouble avg; gdouble sum_time_value_products; } spdu_frame_data_t; typedef struct _spdu_aggregation { gdouble sum; guint32 count; nstime_t start_time; nstime_t last_time; gdouble last_value; gdouble sum_time_value_products; } spdu_aggregation_t; static wmem_map_t *spdu_aggregation_data = NULL; static spdu_aggregation_t * get_or_create_aggregation_data(packet_info *pinfo, gint hf_id_effective) { DISSECTOR_ASSERT(spdu_aggregation_data != NULL); DISSECTOR_ASSERT(hf_id_effective != -1); spdu_aggregation_t *data = (spdu_aggregation_t *)wmem_map_lookup(spdu_aggregation_data, GINT_TO_POINTER(hf_id_effective)); if (data == NULL) { data = wmem_new0(wmem_file_scope(), spdu_aggregation_t); data->sum = 0; data->count = 0; data->start_time = pinfo->abs_ts; data->last_time = pinfo->abs_ts; data->sum_time_value_products = 0.0; wmem_map_insert(spdu_aggregation_data, GINT_TO_POINTER(hf_id_effective), data); } return data; } /************************************** ******** Dissector Helpers ******** **************************************/ /* There is similar code in tvbuff.c ... */ static gdouble spdu_ieee_double_from_64bits(guint64 value) { union { gdouble d; guint64 w; } ieee_fp_union; ieee_fp_union.w = value; return ieee_fp_union.d; } static gfloat spdu_ieee_float_from_32bits(guint32 value) { union { gfloat d; guint32 w; } ieee_fp_union; ieee_fp_union.w = value; return ieee_fp_union.d; } /************************************** ******** Signal PDU Dissector ******** **************************************/ static guint64 dissect_shifted_and_shortened_uint(tvbuff_t *tvb, gint offset, gint offset_bits, gint offset_end, gint offset_end_bits, gboolean big_endian) { gint32 i; guint64 value_guint64 = 0; if (!big_endian) { /* offset and offset_end need to be included */ for (i = offset_end; i >= offset; i--) { if (i != offset_end || offset_end_bits != 0) { guint8 tmp = tvb_get_guint8(tvb, i); gint tmp_bit_count = 8; if (i == offset_end) { tmp = tmp & (0xff >> (8 - offset_end_bits)); /* don't need to shift value, in the first round */ tmp_bit_count = 0; } if (i == offset) { tmp >>= offset_bits; tmp_bit_count = 8 - offset_bits; } value_guint64 <<= (guint)tmp_bit_count; value_guint64 |= tmp; } } } else { /* offset_end needs to be included. */ for (i = offset; i <= offset_end; i++) { /* Do not read the last byte, if you do not need any bit of it. Else we read behind buffer! */ if (i != offset_end || offset_end_bits != 0) { guint8 tmp = tvb_get_guint8(tvb, i); gint tmp_bit_count = 8; if (i == offset) { tmp = tmp & (0xff >> offset_bits); /* don't need to shift value, in the first round */ tmp_bit_count = 0; } if (i == offset_end) { tmp >>= 8 - offset_end_bits; tmp_bit_count = offset_end_bits; } value_guint64 <<= (guint)tmp_bit_count; value_guint64 |= tmp; } } } return value_guint64; } static int dissect_spdu_payload_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, gint offset_bits, spdu_signal_item_t *item, spdu_signal_value_name_t *value_name_config, gint *multiplexer) { DISSECTOR_ASSERT(item != NULL); DISSECTOR_ASSERT(item->hf_id_effective != NULL); proto_item *ti = NULL; proto_tree *subtree = NULL; gchar *value_name = NULL; gint hf_id_effective = -1; gint hf_id_raw = -1; gint offset_end = (gint)((8 * offset + offset_bits + item->bitlength_encoded_type) / 8); gint offset_end_bits = (gint)((8 * offset + offset_bits + item->bitlength_encoded_type) % 8); gint string_length = 0; gint signal_length = offset_end - offset; if (offset_end_bits != 0) { signal_length++; } if (item->multiplex_value_only != -1 && item->multiplex_value_only != *multiplexer) { /* multiplexer set and we are in the wrong multiplex */ return 0; } if (tvb_captured_length_remaining(tvb, offset) < signal_length) { expert_spdu_payload_truncated(tree, pinfo, tvb, offset, tvb_captured_length_remaining(tvb, offset)); return -1; } if (!spdu_deserializer_show_hidden && item->hidden) { return (gint)item->bitlength_encoded_type; } if (item != NULL && item->hf_id_effective != NULL) { hf_id_effective = *item->hf_id_effective; } else { expert_spdu_config_error(tree, pinfo, tvb, offset, signal_length); } if (item == NULL) { return tvb_captured_length_remaining(tvb, offset); } if (item->hf_id_raw != NULL) { hf_id_raw = *item->hf_id_raw; } else { expert_spdu_config_error(tree, pinfo, tvb, offset, signal_length); } guint64 value_guint64 = dissect_shifted_and_shortened_uint(tvb, offset, offset_bits, offset_end, offset_end_bits, item->big_endian); /* we need to reset this because it is reused */ ti = NULL; gdouble value_gdouble = 0.0; switch (item->data_type) { case SPDU_DATA_TYPE_UINT: { value_gdouble = (gdouble)value_guint64; if (item->multiplexer) { *multiplexer = (gint)value_guint64; } /* show names for values */ if (value_name_config != NULL) { guint32 i; for (i = 0; i < value_name_config->num_of_items; i++) { if (value_name_config->items[i].value_start <= value_guint64 && value_guint64 <= value_name_config->items[i].value_end) { value_name = value_name_config->items[i].name; } } } /* scale and output */ if (item->scale_or_offset) { value_gdouble = item->scaler * value_gdouble + item->offset; ti = proto_tree_add_double(tree, hf_id_effective, tvb, offset, signal_length, value_gdouble); } else { ti = proto_tree_add_uint64(tree, hf_id_effective, tvb, offset, signal_length, value_guint64); } if (value_name != NULL) { proto_item_append_text(ti, " [raw: 0x%" PRIx64 ": %s]", value_guint64, value_name); } else { proto_item_append_text(ti, " [raw: 0x%" PRIx64 "]", value_guint64); } subtree = proto_item_add_subtree(ti, ett_spdu_signal); ti = proto_tree_add_uint64(subtree, hf_id_raw, tvb, offset, signal_length, value_guint64); proto_item_append_text(ti, " (0x%" PRIx64 ")", value_guint64); } break; case SPDU_DATA_TYPE_INT: { gint64 value_gint64 = ws_sign_ext64(value_guint64, (gint)item->bitlength_encoded_type); value_gdouble = (gdouble)value_gint64; if (item->multiplexer) { *multiplexer = (gint)value_gint64; } /* scale and output */ if (item->scale_or_offset) { value_gdouble = item->scaler * value_gdouble + item->offset; ti = proto_tree_add_double(tree, hf_id_effective, tvb, offset, signal_length, value_gdouble); } else { ti = proto_tree_add_int64(tree, hf_id_effective, tvb, offset, signal_length, value_gint64); } if (value_name != NULL) { proto_item_append_text(ti, " [raw: %" PRIx64 ": %s]", value_gint64, value_name); } else { proto_item_append_text(ti, " [raw: %" PRIx64 "]", value_gint64); } subtree = proto_item_add_subtree(ti, ett_spdu_signal); ti = proto_tree_add_int64(subtree, hf_id_raw, tvb, offset, signal_length, value_gint64); proto_item_append_text(ti, " (0x%" PRIx64 ")", value_gint64); } break; case SPDU_DATA_TYPE_FLOAT: { value_gdouble = 0.0; switch (item->bitlength_base_type) { case 64: value_gdouble = spdu_ieee_double_from_64bits(value_guint64); break; case 32: value_gdouble = (gdouble)spdu_ieee_float_from_32bits((guint32)value_guint64); break; default: /* not supported and cannot occur since the config is checked! */ break; } /* scaler, offset, multiplexer not allowed by config checks */ ti = proto_tree_add_double(tree, hf_id_effective, tvb, offset, signal_length, value_gdouble); if (value_name != NULL) { proto_item_append_text(ti, " [raw: 0x%" PRIx64 ": %s]", value_guint64, value_name); } else { proto_item_append_text(ti, " [raw: 0x%" PRIx64 "]", value_guint64); } subtree = proto_item_add_subtree(ti, ett_spdu_signal); ti = proto_tree_add_double(subtree, hf_id_raw, tvb, offset, signal_length, value_gdouble); proto_item_append_text(ti, " [raw: 0x%" PRIx64 "]", value_guint64); } break; case SPDU_DATA_TYPE_STRING: if (offset_bits != 0) { expert_spdu_unaligned_data(tree, pinfo, tvb, offset, 0); } proto_tree_add_item(tree, hf_id_effective, tvb, offset, signal_length, item->encoding); break; case SPDU_DATA_TYPE_STRINGZ: if (offset_bits != 0) { expert_spdu_unaligned_data(tree, pinfo, tvb, offset, 0); } proto_tree_add_item_ret_length(tree, hf_id_effective, tvb, offset, -1, item->encoding, &string_length); string_length *= 8; break; case SPDU_DATA_TYPE_UINT_STRING: if (offset_bits != 0) { expert_spdu_unaligned_data(tree, pinfo, tvb, offset, 0); } if (item->big_endian) { proto_tree_add_item_ret_length(tree, hf_id_effective, tvb, offset, signal_length, item->encoding | ENC_BIG_ENDIAN, &string_length); } else { proto_tree_add_item_ret_length(tree, hf_id_effective, tvb, offset, signal_length, item->encoding | ENC_LITTLE_ENDIAN, &string_length); } string_length = string_length * 8 - (gint)item->bitlength_encoded_type; break; case SPDU_DATA_TYPE_NONE: /* do nothing */ break; } /* hide raw value per default, if effective value is present */ if (spdu_deserializer_hide_raw_values) { proto_item_set_hidden(ti); } /* Value passed in with value_gdouble, tree via subtree. */ if (item->aggregate_sum || item->aggregate_avg || item->aggregate_int) { gint hf_id_eff = *(item->hf_id_effective); spdu_aggregation_t *agg_data = get_or_create_aggregation_data(pinfo, hf_id_eff); spdu_frame_data_t *spdu_frame_data = (spdu_frame_data_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_signal_pdu, (guint32)hf_id_eff); if (!PINFO_FD_VISITED(pinfo)) { nstime_t delta; agg_data->sum += value_gdouble; agg_data->count++; nstime_delta(&delta, &(pinfo->abs_ts), &(agg_data->last_time)); gdouble delta_s = nstime_to_sec(&delta); if (delta_s > 0.0) { agg_data->sum_time_value_products += delta_s * agg_data->last_value; agg_data->last_time = pinfo->abs_ts; } agg_data->last_value = value_gdouble; if (!spdu_frame_data) { spdu_frame_data = wmem_new0(wmem_file_scope(), spdu_frame_data_t); p_add_proto_data(wmem_file_scope(), pinfo, proto_signal_pdu, (guint32)hf_id_eff, spdu_frame_data); } spdu_frame_data->sum = agg_data->sum; spdu_frame_data->count = agg_data->count; spdu_frame_data->avg = agg_data->sum / agg_data->count; spdu_frame_data->sum_time_value_products = agg_data->sum_time_value_products; } /* if frame data was not created on first pass, we cannot calculate it now */ if (spdu_frame_data != NULL) { if (item->aggregate_sum) { proto_tree_add_double(subtree, *(item->hf_id_agg_sum), tvb, offset, signal_length, spdu_frame_data->sum); } if (item->aggregate_avg) { proto_tree_add_double(subtree, *(item->hf_id_agg_avg), tvb, offset, signal_length, spdu_frame_data->avg); } if (item->aggregate_int && (spdu_frame_data->sum_time_value_products == spdu_frame_data->sum_time_value_products)) { proto_tree_add_double(subtree, *(item->hf_id_agg_int), tvb, offset, signal_length, spdu_frame_data->sum_time_value_products); } } } return (gint)item->bitlength_encoded_type + string_length; } static int dissect_spdu_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, guint32 id, gboolean update_column) { gint offset = 0; gint offset_bits = 0; gint bits_parsed = 0; gint multiplexer = -1; proto_item *ti = proto_tree_add_item(root_tree, proto_signal_pdu, tvb, offset, -1, ENC_NA); proto_tree *tree = proto_item_add_subtree(ti, ett_spdu_payload); char *name = get_message_name(id); if (name != NULL) { proto_item_append_text(ti, ": %s", name); if (update_column) { col_append_fstr(pinfo->cinfo, COL_INFO, " (PDU: %s)", name); col_set_str(pinfo->cinfo, COL_PROTOCOL, SPDU_NAME); } ti = proto_tree_add_string(tree, hf_pdu_name, tvb, offset, -1, name); proto_item_set_generated(ti); proto_item_set_hidden(ti); } spdu_signal_list_t *paramlist = get_parameter_config(id); if (name == NULL && paramlist == NULL) { /* unknown message, lets skip */ return 0; } if (paramlist == NULL || !spdu_deserializer_activated) { /* we only receive subtvbs with nothing behind us */ proto_tree_add_text_internal(tree, tvb, 0, tvb_captured_length(tvb), "Dissection of payload is disabled. It can be enabled via protocol preferences."); return tvb_captured_length(tvb); } if (root_tree == NULL && !proto_field_is_referenced(root_tree, proto_signal_pdu) && !paramlist->aggregation) { /* we only receive subtvbs with nothing behind us */ return tvb_captured_length(tvb); } gint length = tvb_captured_length_remaining(tvb, 0); guint i; for (i = 0; i < paramlist->num_of_items; i++) { spdu_signal_value_name_t *value_name_config = get_signal_value_name_config(paramlist->id, paramlist->items[i].pos); bits_parsed = dissect_spdu_payload_signal(tvb, pinfo, tree, offset, offset_bits, &(paramlist->items[i]), value_name_config, &multiplexer); if (bits_parsed == -1) { break; } offset = (8 * offset + offset_bits + bits_parsed) / 8; offset_bits = (8 * offset + offset_bits + bits_parsed) % 8; } if (bits_parsed != -1 && length > offset + 1) { if (offset_bits == 0) { proto_tree_add_item(tree, hf_payload_unparsed, tvb, offset, length - offset, ENC_NA); } else { proto_tree_add_item(tree, hf_payload_unparsed, tvb, offset + 1, length - (offset + 1), ENC_NA); } } return offset; } static int dissect_spdu_message_someip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { someip_info_t *someip_info = (someip_info_t *)data; DISSECTOR_ASSERT(someip_info); spdu_someip_mapping_t *someip_mapping = get_someip_mapping(someip_info->service_id, someip_info->method_id, someip_info->major_version, someip_info->message_type); if (someip_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, someip_mapping->spdu_message_id, FALSE); } static int dissect_spdu_message_can(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { struct can_info *can_info = (struct can_info *)data; DISSECTOR_ASSERT(can_info); if (can_info->id & (CAN_ERR_FLAG | CAN_RTR_FLAG)) { /* Error and RTR frames are not for us. */ return 0; } spdu_can_mapping_t *can_mapping = get_can_mapping(can_info->id, can_info->bus_id); if (can_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, can_mapping->message_id, TRUE); } static gboolean dissect_spdu_message_can_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { return dissect_spdu_message_can(tvb, pinfo, tree, data) != 0; } static int dissect_spdu_message_flexray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { struct flexray_info *flexray_data = (struct flexray_info *)data; DISSECTOR_ASSERT(flexray_data); spdu_flexray_mapping_t *flexray_mapping = get_flexray_mapping(flexray_data->ch, flexray_data->cc, flexray_data->id); if (flexray_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, flexray_mapping->message_id, TRUE); } static gboolean dissect_spdu_message_flexray_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { return dissect_spdu_message_flexray(tvb, pinfo, tree, data) != 0; } static int dissect_spdu_message_lin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { lin_info_t *lininfo = (lin_info_t *)data; DISSECTOR_ASSERT(lininfo); spdu_lin_mapping_t *lin_mapping = get_lin_mapping(lininfo); if (lin_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, lin_mapping->message_id, TRUE); } static int dissect_spdu_message_pdu_transport(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { pdu_transport_info_t *pdu_info = (pdu_transport_info_t *)data; DISSECTOR_ASSERT(pdu_info); spdu_pdu_transport_mapping_t *pdu_transport_mapping = get_pdu_transport_mapping(pdu_info->id); if (pdu_transport_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, pdu_transport_mapping->message_id, FALSE); } static int dissect_spdu_message_ipdum(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { autosar_ipdu_multiplexer_info_t *pdu_info = (autosar_ipdu_multiplexer_info_t *)data; DISSECTOR_ASSERT(pdu_info); spdu_ipdum_mapping_uat_t *ipdum_mapping = get_ipdum_mapping(pdu_info->pdu_id); if (ipdum_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, ipdum_mapping->message_id, TRUE); } static int dissect_spdu_message_dlt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { dlt_info_t *pdu_info = (dlt_info_t *)data; DISSECTOR_ASSERT(pdu_info); spdu_dlt_mapping_uat_t *dlt_mapping = get_dlt_mapping(pdu_info->message_id, pdu_info->ecu_id); if (dlt_mapping == NULL) { return 0; } return dissect_spdu_payload(tvb, pinfo, tree, dlt_mapping->message_id, TRUE); } static gboolean dissect_spdu_message_uds_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { uds_info_t *uds_info = (uds_info_t *)data; DISSECTOR_ASSERT(uds_info); spdu_uds_mapping_t *uds_mapping = get_uds_mapping(uds_info); if (uds_mapping == NULL) { return FALSE; } return dissect_spdu_payload(tvb, pinfo, tree, uds_mapping->message_id, FALSE) != 0; } /************************************** ******** Register Dissector ******** **************************************/ void proto_register_signal_pdu(void) { module_t *spdu_module; expert_module_t *expert_module_lpdu; /* UAT for naming */ uat_t *spdu_messages_uat; /* the UATs for parsing the message*/ uat_t *spdu_signal_list_uat; uat_t *spdu_parameter_value_names_uat; /* UATs for mapping different incoming payloads to messages*/ uat_t *spdu_someip_mapping_uat; uat_t *spdu_can_mapping_uat; uat_t *spdu_flexray_mapping_uat; uat_t *spdu_lin_mapping_uat; uat_t *spdu_pdu_transport_mapping_uat; uat_t *spdu_ipdum_mapping_uat; uat_t *spdu_dlt_mapping_uat; uat_t *spdu_uds_mapping_uat; /* data fields */ static hf_register_info hf[] = { { &hf_pdu_name, { "Signal PDU Name", "signal_pdu.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_payload_unparsed, { "Unparsed Payload", "signal_pdu.payload.unparsed", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_spdu_payload, &ett_spdu_signal, }; /* UATs for user_data fields */ static uat_field_t spdu_messages_uat_fields[] = { UAT_FLD_HEX(spdu_message_ident, id, "Signal PDU ID", "ID of the Signal PDU"), UAT_FLD_CSTRING(spdu_message_ident, name, "Name", "Name of the Signal PDU"), UAT_END_FIELDS }; static uat_field_t spdu_signal_list_uat_fields[] = { UAT_FLD_HEX(spdu_signal_list, id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_FLD_DEC(spdu_signal_list, num_of_params, "Number of Signals", "Number of signals (16bit dec)"), UAT_FLD_DEC(spdu_signal_list, pos, "Signal Position", "Position of signal (16bit dec, starting with 0)"), UAT_FLD_CSTRING(spdu_signal_list, name, "Signal Name", "Name of signal (string)"), UAT_FLD_CSTRING(spdu_signal_list, filter_string, "Filter String", "Unique filter string that will be prepended with signal_pdu. (string)"), UAT_FLD_CSTRING(spdu_signal_list, data_type, "Data Type", "Data type (string), [uint|int|float|string|stringz|uint_string|utf8_string|utf8_stringz|utf8_uint_string]"), UAT_FLD_BOOL(spdu_signal_list, big_endian, "Big Endian?", "Big Endian encoded [FALSE|TRUE]"), UAT_FLD_DEC(spdu_signal_list, bitlength_base_type, "Bitlength base type", "Bitlength base type (uint32 dec). The length of the original type or the length of a single character."), UAT_FLD_DEC(spdu_signal_list, bitlength_encoded_type, "Bitlength enc. type", "Bitlength encoded type (uint32 dec). The shortened length of uints or the total length of string/utf8_string or the length of the uint_string/utf8_uint_string length field."), UAT_FLD_CSTRING(spdu_signal_list, scaler, "Scaler", "Raw value is multiplied by this Scaler, e.g. 1.0 (double)"), UAT_FLD_CSTRING(spdu_signal_list, offset, "Offset", "Scaled raw value is shifted by this Offset, e.g. 1.0 (double)"), UAT_FLD_BOOL(spdu_signal_list, multiplexer, "Multiplexer?", "Is this used as multiplexer? [FALSE|TRUE]"), UAT_FLD_SIGNED_DEC(spdu_signal_list, multiplex_value_only, "Multiplexer value", "The multiplexer value for which this is relevant (-1 all)"), UAT_FLD_BOOL(spdu_signal_list, hidden, "Hidden?", "Should this field be hidden in the dissection? [FALSE|TRUE]"), UAT_FLD_BOOL(spdu_signal_list, aggregate_sum, "Calc Sum?", "Should this field be aggregated using sum function? [FALSE|TRUE]"), UAT_FLD_BOOL(spdu_signal_list, aggregate_avg, "Calc Avg?", "Should this field be aggregated using average function? [FALSE|TRUE]"), UAT_FLD_BOOL(spdu_signal_list, aggregate_int, "Calc Int?", "Should this field be aggregated using integrate function (sum of time value product)? [FALSE|TRUE]"), UAT_END_FIELDS }; static uat_field_t spdu_parameter_value_name_uat_fields[] = { UAT_FLD_HEX(spdu_signal_value_names, id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_FLD_DEC(spdu_signal_value_names, pos, "Signal Position", "Position of signal (16bit dec, starting with 0)"), UAT_FLD_DEC(spdu_signal_value_names, num_of_items, "Number of Names", "Number of Value Names defined (32bit dec)"), UAT_FLD_HEX64(spdu_signal_value_names, value_start, "Value Range Start", "Value Range Start (64bit uint hex)"), UAT_FLD_HEX64(spdu_signal_value_names, value_end, "Value Range End", "Value Range End (64bit uint hex)"), UAT_FLD_CSTRING(spdu_signal_value_names, value_name, "Value Name", "Name for the values in this range (string)"), UAT_END_FIELDS }; static uat_field_t spdu_someip_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_someip_mapping, service_id, "SOME/IP Service ID", "SOME/IP Service ID (16bit hex without leading 0x)"), UAT_FLD_HEX(spdu_someip_mapping, method_id, "SOME/IP Method ID", "SOME/IP Method ID (16bit hex without leading 0x)"), UAT_FLD_HEX(spdu_someip_mapping, major_version, "SOME/IP Major Version", "SOME/IP Major Version (8bit hex without leading 0x)"), UAT_FLD_HEX(spdu_someip_mapping, message_type, "SOME/IP Message Type", "SOME/IP Message Type (8bit hex without leading 0x)"), UAT_FLD_HEX(spdu_someip_mapping, spdu_message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_can_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_can_mapping, can_id, "CAN ID", "CAN ID (32bit hex without leading 0x, highest bit 1 for extended, 0 for standard ID)"), UAT_FLD_HEX(spdu_can_mapping, bus_id, "Bus ID", "Bus ID on which frame was recorded with 0=any (16bit hex without leading 0x)"), UAT_FLD_HEX(spdu_can_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_flexray_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_flexray_mapping, channel, "Channel", "Channel (8bit hex without leading 0x)"), UAT_FLD_HEX(spdu_flexray_mapping, cycle, "Cycle", "Cycle (8bit hex without leading 0x)"), UAT_FLD_HEX(spdu_flexray_mapping, flexray_id, "Frame ID", "Frame ID (16bit hex without leading 0x)"), UAT_FLD_HEX(spdu_flexray_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_lin_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_lin_mapping, frame_id, "Frame ID", "LIN Frame ID (6bit hex without leading 0x)"), UAT_FLD_HEX(spdu_lin_mapping, bus_id, "Bus ID", "Bus ID on which frame was recorded with 0=any (16bit hex without leading 0x)"), UAT_FLD_HEX(spdu_lin_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_pdu_transport_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_pdu_transport_mapping, pdu_id, "PDU ID", "PDU ID (32bit hex without leading 0x)"), UAT_FLD_HEX(spdu_pdu_transport_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_ipdum_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_ipdum_mapping, pdu_id, "PDU ID", "PDU ID (32bit hex without leading 0x)"), UAT_FLD_HEX(spdu_ipdum_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_dlt_mapping_uat_fields[] = { UAT_FLD_CSTRING(spdu_dlt_mapping, ecu_id, "ECU ID", "ECU ID (4 ASCII chars only!)"), UAT_FLD_HEX(spdu_dlt_mapping, dlt_message_id, "DLT Message ID", "Message ID (32bit hex without leading 0x)"), UAT_FLD_HEX(spdu_dlt_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static uat_field_t spdu_uds_mapping_uat_fields[] = { UAT_FLD_HEX(spdu_uds_mapping, uds_address, "ECU Address", "ECU Address (32bit hex without leading 0x, 0xffffffff means any)"), UAT_FLD_HEX(spdu_uds_mapping, service, "UDS Service", "UDS Service (8bit hex without leading 0x)"), UAT_FLD_BOOL(spdu_uds_mapping, reply, "Reply", "Reply [FALSE|TRUE]"), UAT_FLD_HEX(spdu_uds_mapping, id, "ID", "ID (16bit hex without leading 0x)"), UAT_FLD_HEX(spdu_uds_mapping, message_id, "Signal PDU ID", "ID of the Signal PDU (32bit hex without leading 0x)"), UAT_END_FIELDS }; static ei_register_info ei[] = { { &ef_spdu_payload_truncated, {"signal_pdu.payload.expert_truncated", PI_MALFORMED, PI_ERROR, "Signal PDU: Truncated payload!", EXPFILL} }, { &ef_spdu_config_error, {"signal_pdu.payload.config_error", PI_MALFORMED, PI_ERROR, "Signal PDU: Config Error (missing filter, filter duplicate, ...)!", EXPFILL} }, { &ef_spdu_unaligned_data, {"signal_pdu.payload.unaligned_data", PI_MALFORMED, PI_ERROR, "Signal PDU: Unaligned data! Strings etc. need to be aligned to bytes!", EXPFILL} }, }; /* Register ETTs */ proto_signal_pdu = proto_register_protocol(SPDU_NAME_LONG, SPDU_NAME, SPDU_NAME_FILTER); proto_register_field_array(proto_signal_pdu, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_module_lpdu = expert_register_protocol(proto_signal_pdu); expert_register_field_array(expert_module_lpdu, ei, array_length(ei)); /* Register preferences */ spdu_module = prefs_register_protocol(proto_signal_pdu, &proto_reg_handoff_signal_pdu); /* UATs */ spdu_messages_uat = uat_new("Signal PDU Messages", sizeof(generic_one_id_string_t), /* record size */ DATAFILE_SPDU_MESSAGES, /* filename */ TRUE, /* from profile */ (void **)&spdu_message_ident, /* data_ptr */ &spdu_message_ident_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_generic_one_id_string_cb, /* copy callback */ update_generic_one_identifier_32bit, /* update callback */ free_generic_one_id_string_cb, /* free callback */ post_update_spdu_message_cb, /* post update callback */ NULL, /* reset callback */ spdu_messages_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_signal_pdus", "Signal PDUs", "A table to define names of signal PDUs", spdu_messages_uat); prefs_register_static_text_preference(spdu_module, "empty1", "", NULL); prefs_register_static_text_preference(spdu_module, "dis", "PDU Dissection:", NULL); prefs_register_bool_preference(spdu_module, "payload_dissector_activated", "Dissect Payload", "Should the payload dissector be active?", &spdu_deserializer_activated); prefs_register_bool_preference(spdu_module, "payload_dissector_show_hidden", "Show hidden entries", "Should the payload dissector show entries marked as hidden in the configuration?", &spdu_deserializer_show_hidden); prefs_register_bool_preference(spdu_module, "payload_dissector_hide_raw_values", "Hide raw values", "Should the payload dissector hide raw values?", &spdu_deserializer_hide_raw_values); spdu_parameter_value_names_uat = uat_new("Signal Value Names", sizeof(spdu_signal_value_name_uat_t), /* record size */ DATAFILE_SPDU_VALUE_NAMES, /* filename */ TRUE, /* from profile */ (void **)&spdu_signal_value_names, /* data_ptr */ &spdu_parameter_value_names_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_signal_value_name_cb, /* copy callback */ update_spdu_signal_value_name, /* update callback */ free_spdu_signal_value_name_cb, /* free callback */ post_update_spdu_signal_value_names_cb, /* post update callback */ NULL, /* reset callback */ spdu_parameter_value_name_uat_fields /* UAT field definitions */ ); /* value names must be for signals since we need this data for the later */ prefs_register_uat_preference(spdu_module, "_spdu_parameter_value_names", "Value Names", "A table to define names of signal values", spdu_parameter_value_names_uat); spdu_signal_list_uat = uat_new("Signal PDU Signal List", sizeof(spdu_signal_list_uat_t), /* record size */ DATAFILE_SPDU_SIGNALS, /* filename */ TRUE, /* from profile */ (void **)&spdu_signal_list, /* data_ptr */ &spdu_signal_list_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION | UAT_AFFECTS_FIELDS, NULL, /* help */ copy_spdu_signal_list_cb, /* copy callback */ update_spdu_signal_list, /* update callback */ free_spdu_signal_list_cb, /* free callback */ post_update_spdu_signal_list_cb, /* post update callback */ reset_spdu_signal_list, /* reset callback */ spdu_signal_list_uat_fields /* UAT field definitions */ ); static const char *spdu_signal_list_uat_defaults_[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "FALSE", "FALSE", "FALSE" }; uat_set_default_values(spdu_signal_list_uat, spdu_signal_list_uat_defaults_); prefs_register_uat_preference(spdu_module, "_spdu_signal_list", "Signal List", "A table to define names of signals", spdu_signal_list_uat); prefs_register_static_text_preference(spdu_module, "empty2", "", NULL); prefs_register_static_text_preference(spdu_module, "map", "Protocol Mappings:", NULL); spdu_someip_mapping_uat = uat_new("SOME/IP", sizeof(spdu_someip_mapping_uat_t), /* record size */ DATAFILE_SPDU_SOMEIP_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_someip_mapping, /* data_ptr */ &spdu_someip_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_someip_mapping_cb, /* copy callback */ update_spdu_someip_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_someip_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_someip_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_someip_mapping", "SOME/IP Mappings", "A table to map SOME/IP payloads to Signal PDUs", spdu_someip_mapping_uat); spdu_can_mapping_uat = uat_new("CAN", sizeof(spdu_can_mapping_uat_t), /* record size */ DATAFILE_SPDU_CAN_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_can_mapping, /* data_ptr */ &spdu_can_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_can_mapping_cb, /* copy callback */ update_spdu_can_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_can_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_can_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_can_mapping", "CAN Mappings", "A table to map CAN payloads to Signal PDUs", spdu_can_mapping_uat); spdu_flexray_mapping_uat = uat_new("FlexRay", sizeof(spdu_flexray_mapping_uat_t), /* record size */ DATAFILE_SPDU_FLEXRAY_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_flexray_mapping, /* data_ptr */ &spdu_flexray_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_flexray_mapping_cb, /* copy callback */ update_spdu_flexray_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_flexray_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_flexray_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_flexray_mapping", "FlexRay Mappings", "A table to map FlexRay payloads to Signal PDUs", spdu_flexray_mapping_uat); spdu_lin_mapping_uat = uat_new("LIN", sizeof(spdu_lin_mapping_uat_t), /* record size */ DATAFILE_SPDU_LIN_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_lin_mapping, /* data_ptr */ &spdu_lin_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_lin_mapping_cb, /* copy callback */ update_spdu_lin_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_lin_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_lin_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_lin_mapping", "LIN Mappings", "A table to map LIN payloads to Signal PDUs", spdu_lin_mapping_uat); spdu_pdu_transport_mapping_uat = uat_new("PDU Transport", sizeof(spdu_pdu_transport_mapping_uat_t), /* record size */ DATAFILE_SPDU_PDU_TRANSPORT_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_pdu_transport_mapping, /* data_ptr */ &spdu_pdu_transport_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_pdu_transport_mapping_cb, /* copy callback */ update_spdu_pdu_transport_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_pdu_transport_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_pdu_transport_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_pdu_transport_mapping", "PDU Transport Mappings", "A table to map PDU Transport payloads to Signal PDUs", spdu_pdu_transport_mapping_uat); spdu_ipdum_mapping_uat = uat_new("AUTOSAR I-PduM", sizeof(spdu_ipdum_mapping_uat_t), /* record size */ DATAFILE_SPDU_IPDUM_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_ipdum_mapping, /* data_ptr */ &spdu_ipdum_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_ipdum_mapping_cb, /* copy callback */ update_spdu_ipdum_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_ipdum_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_ipdum_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_ipdum_mapping", "IPduM Mappings", "A table to map AUTOSAR I-PduM PDUs to Signal PDUs", spdu_ipdum_mapping_uat); spdu_dlt_mapping_uat = uat_new("DLT", sizeof(spdu_dlt_mapping_uat_t), /* record size */ DATAFILE_SPDU_DLT_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_dlt_mapping, /* data_ptr */ &spdu_dlt_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_dlt_mapping_cb, /* copy callback */ update_spdu_dlt_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_dlt_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_dlt_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_dlt_mapping", "DLT Mappings", "A table to map DLT non-verbose Payloads to Signal PDUs", spdu_dlt_mapping_uat); spdu_uds_mapping_uat = uat_new("UDS", sizeof(spdu_uds_mapping_uat_t), /* record size */ DATAFILE_SPDU_UDS_MAPPING, /* filename */ TRUE, /* from profile */ (void **)&spdu_uds_mapping, /* data_ptr */ &spdu_uds_mapping_num, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* but not fields */ NULL, /* help */ copy_spdu_uds_mapping_cb, /* copy callback */ update_spdu_uds_mapping, /* update callback */ NULL, /* free callback */ post_update_spdu_uds_mapping_cb, /* post update callback */ NULL, /* reset callback */ spdu_uds_mapping_uat_fields /* UAT field definitions */ ); prefs_register_uat_preference(spdu_module, "_spdu_uds_mapping", "UDS Mappings", "A table to map UDS payloads to Signal PDUs", spdu_uds_mapping_uat); /* Aggregation Feature */ spdu_aggregation_data = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal); } void proto_reg_handoff_signal_pdu(void) { static gboolean initialized = FALSE; if (!initialized) { signal_pdu_handle_someip = register_dissector("signal_pdu_over_someip", dissect_spdu_message_someip, proto_signal_pdu); signal_pdu_handle_can = register_dissector("signal_pdu_over_can", dissect_spdu_message_can, proto_signal_pdu); dissector_add_for_decode_as("can.subdissector", signal_pdu_handle_can); heur_dissector_add("can", dissect_spdu_message_can_heur, "Signal PDU over CAN", "signal_pdu_can_heur", proto_signal_pdu, HEURISTIC_ENABLE); signal_pdu_handle_flexray = register_dissector("signal_pdu_over_flexray", dissect_spdu_message_flexray, proto_signal_pdu); dissector_add_for_decode_as("flexray.subdissector", signal_pdu_handle_flexray); heur_dissector_add("flexray", dissect_spdu_message_flexray_heur, "Signal PDU over FlexRay", "signal_pdu_flexray_heur", proto_signal_pdu, HEURISTIC_ENABLE); signal_pdu_handle_lin = register_dissector("signal_pdu_over_lin", dissect_spdu_message_lin, proto_signal_pdu); signal_pdu_handle_pdu_transport = register_dissector("signal_pdu_over_pdu_transport", dissect_spdu_message_pdu_transport, proto_signal_pdu); signal_pdu_handle_ipdum = register_dissector("signal_pdu_over_IPduM", dissect_spdu_message_ipdum, proto_signal_pdu); heur_dissector_add("dlt", dissect_spdu_message_dlt_heur, "Signal PDU over DLT", "signal_pdu_dlt_heur", proto_signal_pdu, HEURISTIC_ENABLE); heur_dissector_add("uds", dissect_spdu_message_uds_heur, "Signal PDU over UDS", "signal_pdu_uds_heur", proto_signal_pdu, HEURISTIC_ENABLE); initialized = TRUE; } } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-simple.c
/* packet-simple.c * Routines for SIMPLE dissection * Copyright 2015 Peter Ross * * SPDX-License-Identifier: GPL-2.0-or-later */ /* SIMPLE (Standard Interface for Multiple Platform Link Evaluation) * is a protocol for exchanging tactical data link messages, such as Link 16, * over Internet Protocols. * * The protocol is described in STANAG 5602. See: * http://assistdoc1.dla.mil/qsDocDetails.aspx?ident_number=213042 */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include "packet-link16.h" void proto_reg_handoff_simple(void); void proto_register_simple(void); static const range_string Node_Strings[] = { { 1, 128, "Unicast" }, { 129, 129, "Broadcast" }, { 160, 168, "Multicast" }, { 169, 169, "Adjacent" }, { 0, 0, NULL }, }; static const value_string Subnode_Strings[] = { { 1, "RTT" }, { 2, "Terminal-Host Interface" }, { 4, "File & Mail Transfers" }, { 5, "Open" }, { 6, "Status & Control" }, { 7, "Time Synchronisation" }, { 202, "Scenario (Script)" }, { 203, "IJMS" }, { 204, "Link 4" }, { 205, "Link 11" }, { 206, "Link 16" }, { 207, "Link 22" }, { 208, "DIS" }, { 209, "Voice Group A" }, { 210, "Voice Group B" }, { 211, "Link 11B" }, { 0, NULL }, }; enum { SIMPLE_LINK16 = 1, SIMPLE_STATUS = 61 }; static const value_string PacketType_Strings[] = { { SIMPLE_LINK16, "Link 16" }, { 2, "Link 11" }, { 3, "Link 4" }, { 4, "Link 22" }, { 5, "Interim JTIDS Message Standard (IJMS)" }, { 8, "Variable Message Format (VMF)" }, { 10, "MIDS Terminal Specific Messages (MTSM)" }, { 13, "MIDS/JTIDS Voice" }, { 20, "Link 11B" }, { 32, "DIS Protocol Data Unit (PDU)" }, { SIMPLE_STATUS, "Status/Configuration" }, { 62, "E-mail/File Transfer Protocol (FTP)" }, { 63, "Round Trip Timing (RTT)" }, { 65, "Time Synchronisation" }, { 66, "TSA Status" }, { 100, "National Message" }, { 0, NULL }, }; enum { SIMPLE_LINK16_FIXED_FORMAT = 2 }; static const value_string Link16_Subtype_Strings[] = { { 0, "Uncoded Free Text" }, { 1, "Coded Free Text" }, { SIMPLE_LINK16_FIXED_FORMAT, "Fixed Format" }, { 0, NULL }, }; static const value_string Status_Subtype_Strings[] = { { 1, "Node Status" }, { 0, NULL }, }; static const value_string Security_Level_Strings[] = { { 0, "Unclassified" }, { 1, "NATO Unclassified" }, { 2, "Confidential" }, { 3, "NATO Confidential" }, { 4, "Secret" }, { 5, "NATO Secret" }, { 6, "National Only" }, { 7, "Level 7" }, { 8, "Level 8" }, { 9, "Level 9" }, { 0, NULL }, }; static const value_string Link16_Terminal_Type[] = { { 0, "None" }, { 1, "US Navy Air (JTIDS)" }, { 2, "US Navy Ship (JTIDS)" }, { 3, "US F-15 (JTIDS)" }, { 4, "US F/A-18 (MIDS)" }, { 5, "US Army Class 2M (JTIDS)" }, { 6, "US MCE (JTIDS)" }, { 7, "E-3 (JTIDS)" }, { 8, "UK Tornado F3 (JTIDS)" }, { 9, "UK UKADGE (JTIDS)" }, { 10, "Low Volume Terminal - Generic (MIDS)" }, { 11, "Low Volume Terminal - Platform Type A (MIDS)" }, { 12, "Low Volume Terminal - Platform Type B (MIDS)" }, { 13, "Low Volume Terminal - Platform Type C (MIDS)" }, { 14, "Low Volume Terminal - Platform Type D (MIDS)" }, { 15, "Low Volume Terminal - Platform Type E (MIDS)" }, { 16, "Low Volume Terminal - Platform Type F (MIDS)" }, { 17, "Low Volume Terminal - Platform Type G (MIDS)" }, { 18, "Low Volume Terminal 2, US Army (MIDS)" }, { 19, "Low Volume Terminal MIDS on Ship (MOS) (MIDS)" }, { 20, "US Fighter Data Link (FDL) (MIDS)" }, { 21, "AN/URC-138" }, { 22, "Low Volume Terminal Platform Type H (MIDS)" }, { 23, "Low Volume Terminal Platform Type I (MIDS)" }, { 0, NULL }, }; static const value_string Link16_Role[] = { { 0, "None" }, { 1, "SIMPLE Host (SH)" }, { 2, "SIMPLE Terminal Emulator (STE)" }, { 3, "SIMPLE Network Monitor (SNM)" }, { 4, "SIMPLE Virtual Host (SVH)" }, { 5, "SIMPLE Virtual Terminal (SVT)" }, { 0, NULL }, }; static const value_string Link16_Sync_Status[] = { { 0, "None" }, { 1, "Net Entry in Progress" }, { 2, "Coarse Sync" }, { 3, "Fine Sync" }, { 0, NULL }, }; static const value_string Link_Terminal_Host_Status[] = { { 0, "Inactive" }, { 1, "Active" }, { 0, NULL }, }; static const value_string Link11_DTS_Type[] = { { 0, "None" }, { 1, "MIL-STD-1397 parallel" }, { 2, "MIL-STD-188-203-1A serial" }, { 0, NULL }, }; static const value_string Link11_Role[] = { { 0, "None"}, { 1, "SIMPLE DTS EMULATOR (SDE) Picket"}, { 2, "SDE Net Control Station (NCS)" }, { 3, "SIMPLE Participating Unit (PU) Emulator (SPE)" }, { 0, NULL }, }; static int proto_simple = -1; static dissector_handle_t link16_handle; static gint hf_simple_sync_byte_1 = -1; static gint hf_simple_sync_byte_2 = -1; static gint hf_simple_length = -1; static gint hf_simple_sequence_number = -1; static gint hf_simple_src_node = -1; static gint hf_simple_src_subnode = -1; static gint hf_simple_dst_node = -1; static gint hf_simple_dst_subnode = -1; static gint hf_simple_packet_size = -1; static gint hf_simple_packet_type = -1; static gint hf_simple_transit_time = -1; static gint hf_simple_link16_subtype = -1; static gint hf_simple_link16_rc = -1; static gint hf_simple_link16_network = -1; static gint hf_simple_link16_ssc2 = -1; static gint hf_simple_link16_npg = -1; static gint hf_simple_link16_ssc1 = -1; static gint hf_simple_link16_stn = -1; static gint hf_simple_link16_word_count = -1; static gint hf_simple_link16_loopback_id = -1; static gint hf_simple_status_subtype = -1; static gint hf_simple_status_word_count = -1; static gint hf_simple_status_name = -1; static gint hf_simple_status_time_hours = -1; static gint hf_simple_status_node_id = -1; static gint hf_simple_status_time_seconds = -1; static gint hf_simple_status_time_minutes = -1; static gint hf_simple_status_security_level = -1; static gint hf_simple_status_node_entry_flag = -1; static gint hf_simple_status_relay_hop = -1; static gint hf_simple_status_dx_flag_system_messages = -1; static gint hf_simple_status_dx_flag_common_tims_bims = -1; static gint hf_simple_status_dx_flag_common_toms_boms = -1; static gint hf_simple_status_dx_flag_simple_receive = -1; static gint hf_simple_status_dx_flag_simple_transmit = -1; static gint hf_simple_status_dx_flag_all_tims_bims = -1; static gint hf_simple_status_dx_flag_all_toms_boms = -1; static gint hf_simple_status_dx_file_id = -1; static gint hf_simple_status_spare_1 = -1; static gint hf_simple_status_link16_terminal_type = -1; static gint hf_simple_status_link16_role = -1; static gint hf_simple_status_link16_sync_status = -1; static gint hf_simple_status_link16_terminal_host_status = -1; static gint hf_simple_status_link16_stn = -1; static gint hf_simple_status_spare_2 = -1; static gint hf_simple_status_link11_dts_type = -1; static gint hf_simple_status_link11_role = -1; static gint hf_simple_status_link11_pu = -1; static gint hf_simple_status_link11_dts_host_status = -1; static gint hf_simple_status_spare_3 = -1; static gint hf_simple_checksum = -1; static gint hf_simple_checksum_status = -1; static gint ett_simple = -1; static gint ett_packet = -1; static gint ett_simple_status_dx_flag = -1; static expert_field ei_simple_sync_bytes_bad = EI_INIT; static expert_field ei_simple_length_bad = EI_INIT; static expert_field ei_simple_packet_size_bad = EI_INIT; static expert_field ei_simple_checksum_bad = EI_INIT; static void dissect_simple_link16(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset) { guint subtype, stn, word_count, i; Link16State state; tvbuff_t *newtvb; proto_tree_add_item(tree, hf_simple_link16_subtype, tvb, offset, 1, ENC_NA); subtype = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(tree, hf_simple_link16_rc, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_link16_network, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_link16_ssc2, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_link16_npg, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_simple_link16_ssc1, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_simple_link16_stn, tvb, offset, 2, ENC_LITTLE_ENDIAN); stn = tvb_get_letohs(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_simple_link16_word_count, tvb, offset, 2, ENC_LITTLE_ENDIAN); word_count = tvb_get_guint8(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_simple_link16_loopback_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, ", STN: %05o, Words:", stn); switch(subtype) { case SIMPLE_LINK16_FIXED_FORMAT: memset(&state, 0, sizeof(state)); for (i = 0; i < word_count; i += 5) { newtvb = tvb_new_subset_length_caplen(tvb, offset, 10, -1); add_new_data_source(pinfo, newtvb, "Link 16 Word"); call_dissector_with_data(link16_handle, newtvb, pinfo, tree, &state); offset += 10; } break; } } static int * const simple_status_dx_flag_fields[] = { &hf_simple_status_dx_flag_system_messages, &hf_simple_status_dx_flag_common_tims_bims, &hf_simple_status_dx_flag_common_toms_boms, &hf_simple_status_dx_flag_simple_receive, &hf_simple_status_dx_flag_simple_transmit, &hf_simple_status_dx_flag_all_tims_bims, &hf_simple_status_dx_flag_all_toms_boms, NULL }; #define SIMPLE_STATUS_NAME_LEN 10 static void dissect_simple_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { char *name; int link16_status, pu; proto_tree_add_item(tree, hf_simple_status_subtype, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_word_count, tvb, offset, 1, ENC_NA); offset++; name = tvb_get_stringzpad(pinfo->pool, tvb, offset, SIMPLE_STATUS_NAME_LEN, ENC_ASCII|ENC_NA); col_append_fstr(pinfo->cinfo, COL_INFO, ", Name: %s", name); proto_tree_add_item(tree, hf_simple_status_name, tvb, offset, SIMPLE_STATUS_NAME_LEN, ENC_ASCII); offset += SIMPLE_STATUS_NAME_LEN; proto_tree_add_item(tree, hf_simple_status_time_hours, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_node_id, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_time_seconds, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_time_minutes, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_security_level, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_node_entry_flag, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_relay_hop, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_bitmask_text(tree, tvb, offset, 2, "Data Extraction Flags", NULL, ett_simple_status_dx_flag, simple_status_dx_flag_fields, ENC_LITTLE_ENDIAN, 0); offset += 2; proto_tree_add_item(tree, hf_simple_status_dx_file_id, tvb, offset, 8, ENC_ASCII); offset += 8; proto_tree_add_item(tree, hf_simple_status_spare_1, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tree, hf_simple_status_link16_terminal_type, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_link16_role, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_link16_sync_status, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_link16_terminal_host_status, tvb, offset, 1, ENC_NA); link16_status = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(tree, hf_simple_status_link16_stn, tvb, offset, 2, ENC_LITTLE_ENDIAN); if (link16_status) col_append_fstr(pinfo->cinfo, COL_INFO, ", STN: %05o", tvb_get_letohs(tvb, offset)); offset += 2; proto_tree_add_item(tree, hf_simple_status_spare_2, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tree, hf_simple_status_link11_dts_type, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_link11_role, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_simple_status_link11_pu, tvb, offset, 1, ENC_NA); pu = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(tree, hf_simple_status_link11_dts_host_status, tvb, offset, 1, ENC_NA); if (tvb_get_guint8(tvb, offset)) col_append_fstr(pinfo->cinfo, COL_INFO, ", PU: %03o", pu); offset++; proto_tree_add_item(tree, hf_simple_status_spare_3, tvb, offset, 4, ENC_NA); } static void dissect_checksum(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { const guint8 * v = tvb_get_ptr(tvb, 0, offset); guint16 expected_checksum = 0; gint i; for (i = 0; i < offset; i++) expected_checksum += v[i]; proto_tree_add_checksum(tree, tvb, offset, hf_simple_checksum, hf_simple_checksum_status, &ei_simple_checksum_bad, pinfo, expected_checksum, ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); } static int dissect_simple(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *simple_item = NULL, *item; proto_tree *simple_tree = NULL, *packet_tree = NULL; guint offset = 0, length, packet_size, packet_type; const gchar *packet_type_string; guint8 sync_bytes_bad = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIMPLE"); if (tree) { simple_item = proto_tree_add_item(tree, proto_simple, tvb, 0, -1, ENC_NA); simple_tree = proto_item_add_subtree(simple_item, ett_simple); } proto_tree_add_item(simple_tree, hf_simple_sync_byte_1, tvb, offset, 1, ENC_NA); sync_bytes_bad |= tvb_get_guint8(tvb, offset) ^ 0x49; offset++; proto_tree_add_item(simple_tree, hf_simple_sync_byte_2, tvb, offset, 1, ENC_NA); sync_bytes_bad |= tvb_get_guint8(tvb, offset) ^ 0x36; offset++; if (sync_bytes_bad) expert_add_info(pinfo, simple_item, &ei_simple_sync_bytes_bad); item = proto_tree_add_item(simple_tree, hf_simple_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); length = tvb_get_letohs(tvb, offset); offset += 2; if (length < 16 || length >= 518 || length > tvb_reported_length(tvb)) expert_add_info(pinfo, item, &ei_simple_length_bad); proto_tree_add_item(simple_tree, hf_simple_sequence_number, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(simple_tree, hf_simple_src_node, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(simple_tree, hf_simple_src_subnode, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(simple_tree, hf_simple_dst_node, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(simple_tree, hf_simple_dst_subnode, tvb, offset, 1, ENC_NA); offset++; item = proto_tree_add_item(simple_tree, hf_simple_packet_size, tvb, offset, 1, ENC_NA); packet_size = tvb_get_guint8(tvb, offset) * 2; if (packet_size < 8 || packet_size - 8 > tvb_reported_length(tvb)) expert_add_info(pinfo, item, &ei_simple_packet_size_bad); packet_size -= 8; offset++; proto_tree_add_item(simple_tree, hf_simple_packet_type, tvb, offset, 1, ENC_NA); packet_type = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(simple_tree, hf_simple_transit_time, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; packet_type_string = val_to_str_const(packet_type, PacketType_Strings, "Unknown"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", packet_type_string); packet_tree = proto_tree_add_subtree_format(simple_tree, tvb, offset, packet_size, ett_packet, NULL, "%s Packet", packet_type_string); switch(packet_type) { case SIMPLE_LINK16: dissect_simple_link16(tvb, pinfo, packet_tree, offset); break; case SIMPLE_STATUS: dissect_simple_status(tvb, pinfo, packet_tree, offset); break; } dissect_checksum(tvb, pinfo, simple_tree, length - 2); return tvb_captured_length(tvb); } void proto_register_simple(void) { static hf_register_info hf[] = { { &hf_simple_sync_byte_1, { "Sync Byte 1", "simple.sync_byte_1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_simple_sync_byte_2, { "Sync Byte 2", "simple.sync_byte_2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_simple_length, { "Length", "simple.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_sequence_number, { "Sequence Number", "simple.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_src_node, { "Source Node", "simple.src_node", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(Node_Strings), 0x0, NULL, HFILL }}, { &hf_simple_src_subnode, { "Source Subnode", "simple.src_subnode", FT_UINT8, BASE_DEC, VALS(Subnode_Strings), 0x0, NULL, HFILL }}, { &hf_simple_dst_node, { "Destination Node", "simple.dst_node", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(Node_Strings), 0x0, NULL, HFILL }}, { &hf_simple_dst_subnode, { "Destination Subnode", "simple.dst_subnode", FT_UINT8, BASE_DEC, VALS(Subnode_Strings), 0x0, NULL, HFILL }}, { &hf_simple_packet_size, { "Packet Size", "simple.packet_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_packet_type, { "Packet Type", "simple.packet_type", FT_UINT8, BASE_DEC, VALS(PacketType_Strings), 0x0, NULL, HFILL }}, { &hf_simple_transit_time, { "Transit Time", "simple.transit_time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_link16_subtype, { "Subtype", "simple.link16.subtype", FT_UINT8, BASE_DEC, VALS(Link16_Subtype_Strings), 0x0, NULL, HFILL }}, { &hf_simple_link16_rc, { "R/C Flag", "simple.link16.rc", FT_BOOLEAN, BASE_DEC, TFS(&tfs_required_not_required), 0x0, NULL, HFILL }}, { &hf_simple_link16_network, { "Network", "simple.link16.network", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_link16_ssc2, { "Sequential Slot Count 2", "simple.link16.ssc2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_link16_npg, { "NPG Number", "simple.link16.npg", FT_UINT16, BASE_DEC, VALS(Link16_NPG_Strings), 0x0, NULL, HFILL }}, { &hf_simple_link16_ssc1, { "Sequential Slot Count 1", "simple.link16.ssc1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_link16_stn, { "Source Track Number", "simple.link16.stn", FT_UINT16, BASE_OCT, NULL, 0x0, NULL, HFILL }}, { &hf_simple_link16_word_count, { "Word Count", "simple.link16.word_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_link16_loopback_id, { "Loopback ID", "simple.link16.loopback_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_subtype, { "Subtype", "simple.status.subtype", FT_UINT8, BASE_HEX, VALS(Status_Subtype_Strings), 0x0, NULL, HFILL }}, { &hf_simple_status_word_count, { "Word Count", "simple.status.word_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_name, { "Name", "simple.status.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_time_hours, { "Time (Hours)", "simple.status.time_hours", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_node_id, { "Node Id", "simple.status.node_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_time_seconds, { "Time (Seconds)", "simple.status.time_seconds", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_time_minutes, { "Time (Minutes)", "simple.status.time_minutes", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_security_level, { "Security Level", "simple.status.security_level", FT_UINT8, BASE_DEC, VALS(Security_Level_Strings), 0x0, NULL, HFILL }}, { &hf_simple_status_node_entry_flag, { "Node Entry Flag", "simple.status.node_entry_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_relay_hop, { "Relay Hop", "simple.status.relay_hop", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_dx_flag_system_messages, { "DX System Messages", "simple.status.dx_flag.system_messages", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL }}, { &hf_simple_status_dx_flag_common_tims_bims, { "DX Common TIMS/BIMS", "simple.status.dx_flag.common_tims_bims", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL }}, { &hf_simple_status_dx_flag_common_toms_boms, { "DX Common TOMS/BOMS", "simple.status.dx_flag.common_toms_boms", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }}, { &hf_simple_status_dx_flag_simple_receive, { "DX SIMPLE Receive", "simple.status.dx_flag.simple_receive", FT_BOOLEAN, 16, NULL, 0x8, NULL, HFILL }}, { &hf_simple_status_dx_flag_simple_transmit, { "DX SIMPLE Transmit", "simple.status.dx_flag.simple_transmit", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL }}, { &hf_simple_status_dx_flag_all_tims_bims, { "DX All TIMS/BIMS", "simple.status.dx_flag.all_tims_bims", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }}, { &hf_simple_status_dx_flag_all_toms_boms, { "DX All TOMS/BOMS", "simple.status.dx_flag.all_toms_boms", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }}, { &hf_simple_status_dx_file_id, { "DX File Id", "simple.status.dx_file_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_spare_1, { "Spare1", "simple.status.spare_1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_link16_terminal_type, { "Link 16 Type", "simple.status.link16.terminal_type", FT_UINT8, BASE_DEC, VALS(Link16_Terminal_Type), 0x0, NULL, HFILL }}, { &hf_simple_status_link16_role, { "Link 16 Role", "simple.status.link16.role", FT_UINT8, BASE_DEC, VALS(Link16_Role), 0x0, NULL, HFILL }}, { &hf_simple_status_link16_sync_status, { "Link 16 Sync Status", "simple.status.link16.sync_status", FT_UINT8, BASE_DEC, VALS(Link16_Sync_Status), 0x0, NULL, HFILL }}, { &hf_simple_status_link16_terminal_host_status, { "Link 16 Terminal/Host Status", "simple.status.link16.terminal_host_status", FT_UINT8, BASE_DEC, VALS(Link_Terminal_Host_Status), 0x0, NULL, HFILL }}, { &hf_simple_status_link16_stn, { "Link 16 STN", "simple.status.link16.stn", FT_UINT16, BASE_OCT, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_spare_2, { "Spare2", "simple.status.spare_2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_link11_dts_type, { "Link 11 DTS Type", "simple.status.link11.dts_type", FT_UINT8, BASE_DEC, VALS(Link11_DTS_Type), 0x0, NULL, HFILL }}, { &hf_simple_status_link11_role, { "Link 11 Role", "simple.status.link11.role", FT_UINT8, BASE_DEC, VALS(Link11_Role), 0x0, NULL, HFILL }}, { &hf_simple_status_link11_pu, { "Link 11 PU", "simple.status.link11.pu", FT_UINT8, BASE_OCT, NULL, 0x0, NULL, HFILL }}, { &hf_simple_status_link11_dts_host_status, { "Link 11 DTS/Host Status", "simple.status.link11.dts_host_status", FT_UINT8, BASE_DEC, VALS(Link_Terminal_Host_Status), 0x0, NULL, HFILL }}, { &hf_simple_status_spare_3, { "Spare3", "simple.status.spare_3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_simple_checksum, { "Checksum", "simple.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_simple_checksum_status, { "Checksum Status", "simple.checksum.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL }} }; static gint *ett[] = { &ett_simple, &ett_packet, &ett_simple_status_dx_flag, }; static ei_register_info ei[] = { { &ei_simple_sync_bytes_bad, { "simple.sync_bytes.bad", PI_MALFORMED, PI_ERROR, "Bad sync bytes", EXPFILL }}, { &ei_simple_length_bad, { "simple.length.bad", PI_MALFORMED, PI_ERROR, "Bad length", EXPFILL }}, { &ei_simple_packet_size_bad, { "simple.packet_size.bad", PI_MALFORMED, PI_ERROR, "Bad packet length", EXPFILL }}, { &ei_simple_checksum_bad, { "simple.checksum.bad.expert", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }}, }; expert_module_t* expert_simple; proto_simple = proto_register_protocol("Standard Interface for Multiple Platform Link Evaluation", "SIMPLE", "simple"); proto_register_field_array(proto_simple, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_simple = expert_register_protocol(proto_simple); expert_register_field_array(expert_simple, ei, array_length(ei)); register_dissector("simple", dissect_simple, proto_simple); } void proto_reg_handoff_simple(void) { dissector_handle_t simple_dissector_handle; simple_dissector_handle = create_dissector_handle(dissect_simple, proto_simple); dissector_add_for_decode_as_with_preference("udp.port", simple_dissector_handle); dissector_add_for_decode_as_with_preference("tcp.port", simple_dissector_handle); link16_handle = find_dissector_add_dependency("link16", proto_simple); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */